Hi, all,
I'm trying to set up a custom step for my webtest project by
extending a
new class from StoreXPath.
But all I get is the following NullpointerException:
/home/thomas/development/canoo/webtest.xml:11: Unexpected exception
caught: org.apache.tools.ant.BuildException
at com.canoo.webtest.steps.StepUtil.handleException(StepUtil.java:
122)
at com.canoo.webtest.steps.Step.handleException(Step.java:387)
at com.canoo.webtest.steps.Step.execute(Step.java:118)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun
.reflect
.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun
.reflect
.DelegatingMethodAccessorImpl
.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org
.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:
106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at com.canoo.webtest.ant.WebtestTask.executeSteps(WebtestTask.java:
236)
at com.canoo.webtest.ant.WebtestTask.execute(WebtestTask.java:208)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:
288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun
.reflect
.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun
.reflect
.DelegatingMethodAccessorImpl
.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org
.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:
106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:
1337)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at
org
.apache
.tools
.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
at org.apache.tools.ant.Main.runBuild(Main.java:758)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: /home/thomas/development/canoo/firstWebTest.xml:18:
java.lang.NullPointerException
at
org
.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:
116)
at org.apache.tools.ant.Task.perform(Task.java:348)
at
com
.canoo
.webtest.ant.TestStepSequence.executeSteps(TestStepSequence.java:43)
at
com
.canoo.webtest.ant.TestStepSequence.doExecute(TestStepSequence.java:
31)
at com.canoo.webtest.steps.Step.execute(Step.java:103)
... 25 more
Caused by: java.lang.NullPointerException
at
com
.canoo
.webtest
.engine
.WebTestException.readUrlCurrentResponse(WebTestException.java:29)
at
com
.canoo.webtest.engine.WebTestException.<init>(WebTestException.java:
25)
at
com
.canoo.webtest.engine.WebTestException.<init>(WebTestException.java:
40)
at
com
.canoo.webtest.engine.WebTestException.<init>(WebTestException.java:
48)
at
com
.canoo
.webtest
.engine.StepExecutionException.<init>(StepExecutionException.java:25)
at com.canoo.webtest.steps.Step.checkContextDefined(Step.java:129)
at com.canoo.webtest.steps.Step.execute(Step.java:99)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:
288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun
.reflect
.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun
.reflect
.DelegatingMethodAccessorImpl
.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org
.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:
106)
... 29 more
--- Nested Exception ---
/home/thomas/development/canoo/firstWebTest.xml:18:
java.lang.NullPointerException
at
org
.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:
116)
at org.apache.tools.ant.Task.perform(Task.java:348)
at
com
.canoo
.webtest.ant.TestStepSequence.executeSteps(TestStepSequence.java:43)
at
com
.canoo.webtest.ant.TestStepSequence.doExecute(TestStepSequence.java:
31)
at com.canoo.webtest.steps.Step.execute(Step.java:103)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun
.reflect
.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun
.reflect
.DelegatingMethodAccessorImpl
.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org
.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:
106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at com.canoo.webtest.ant.WebtestTask.executeSteps(WebtestTask.java:
236)
at com.canoo.webtest.ant.WebtestTask.execute(WebtestTask.java:208)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:
288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun
.reflect
.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun
.reflect
.DelegatingMethodAccessorImpl
.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org
.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:
106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:
1337)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at
org
.apache
.tools
.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
at org.apache.tools.ant.Main.runBuild(Main.java:758)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: java.lang.NullPointerException
at
com
.canoo
.webtest
.engine
.WebTestException.readUrlCurrentResponse(WebTestException.java:29)
at
com
.canoo.webtest.engine.WebTestException.<init>(WebTestException.java:
25)
at
com
.canoo.webtest.engine.WebTestException.<init>(WebTestException.java:
40)
at
com
.canoo.webtest.engine.WebTestException.<init>(WebTestException.java:
48)
at
com
.canoo
.webtest
.engine.StepExecutionException.<init>(StepExecutionException.java:25)
at com.canoo.webtest.steps.Step.checkContextDefined(Step.java:129)
at com.canoo.webtest.steps.Step.execute(Step.java:99)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:
288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun
.reflect
.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun
.reflect
.DelegatingMethodAccessorImpl
.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org
.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:
106)
... 29 more
--- Nested Exception ---
java.lang.NullPointerException
at
com
.canoo
.webtest
.engine
.WebTestException.readUrlCurrentResponse(WebTestException.java:29)
at
com
.canoo.webtest.engine.WebTestException.<init>(WebTestException.java:
25)
at
com
.canoo.webtest.engine.WebTestException.<init>(WebTestException.java:
40)
at
com
.canoo.webtest.engine.WebTestException.<init>(WebTestException.java:
48)
at
com
.canoo
.webtest
.engine.StepExecutionException.<init>(StepExecutionException.java:25)
at com.canoo.webtest.steps.Step.checkContextDefined(Step.java:129)
at com.canoo.webtest.steps.Step.execute(Step.java:99)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:
288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun
.reflect
.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun
.reflect
.DelegatingMethodAccessorImpl
.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org
.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:
106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at
com
.canoo
.webtest.ant.TestStepSequence.executeSteps(TestStepSequence.java:43)
at
com
.canoo.webtest.ant.TestStepSequence.doExecute(TestStepSequence.java:
31)
at com.canoo.webtest.steps.Step.execute(Step.java:103)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun
.reflect
.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun
.reflect
.DelegatingMethodAccessorImpl
.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org
.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:
106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at com.canoo.webtest.ant.WebtestTask.executeSteps(WebtestTask.java:
236)
at com.canoo.webtest.ant.WebtestTask.execute(WebtestTask.java:208)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:
288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun
.reflect
.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun
.reflect
.DelegatingMethodAccessorImpl
.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org
.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:
106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:
1337)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at
org
.apache
.tools
.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
at org.apache.tools.ant.Main.runBuild(Main.java:758)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
This is the interesting part of my build-file:
<project name="SimpleTest" basedir="." default="wt.full">
<property name="webtest.home" location="." />
<import file="${webtest.home}/webtest.xml"/>
<target name="wt.testInWork">
<webtest name="Test Case">
<config useInsecureSSL="true" />
<taskdef name="myCustomStep"
classname="de.mycompany.webtests.support.StoreOrderId"
classpathref="wt.defineTasks.classpath.webtest" />
<!-- Homepage -->
<invoke url="http://localhost" />
<myCustomStep xpath="//*"/>
...
Does anybody have an idea what I'm doing wrong?
Regards,
Thomas
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest