Hi all,

It's been a long time since I've last posted here...
I'm happy to work with Webtest again.

I'm facing a problem that didn't appear with the last version I used (2.5 I think)

I have a storeXPath() step (sorry for the method formulation, but I'm using groooooovy) that works really well with the 2.5 version.
I use the same script with an other webtest path (which points to the 2.6)

My 53th step raise this exception (I put only the relevant information that doesn't come from the webtest exception treatment):

*<error exception="com.canoo.webtest.engine.StepExecutionException" message="Unexpected exception caught: java.lang.NullPointerException">
               <antStack>
                   <call filename="" line="0"/>
               </antStack>
               <stacktrace><![CDATA[: Unexpected exception caught:
--- Nested Exception ---
java.lang.NullPointerException
at org.jaxen.function.ContainsFunction.evaluate(ContainsFunction.java:131)
   at org.jaxen.function.ContainsFunction.call(ContainsFunction.java:100)
at org.jaxen.expr.DefaultFunctionCallExpr.evaluate(DefaultFunctionCallExpr.java:177)
   at org.jaxen.expr.DefaultPredicate.evaluate(DefaultPredicate.java:95)
   at org.jaxen.expr.PredicateSet.applyPredicate(PredicateSet.java:269)
   at org.jaxen.expr.PredicateSet.evaluatePredicates(PredicateSet.java:244)
   at org.jaxen.expr.DefaultNameStep.evaluate(DefaultNameStep.java:291)
at org.jaxen.expr.DefaultLocationPath.evaluate(DefaultLocationPath.java:140) at org.jaxen.expr.DefaultAbsoluteLocationPath.evaluate(DefaultAbsoluteLocationPath.java:113)
   at org.jaxen.expr.DefaultXPathExpr.asList(DefaultXPathExpr.java:102)
   at org.jaxen.BaseXPath.selectNodesForContext(BaseXPath.java:674)
   at org.jaxen.BaseXPath.selectSingleNodeForContext(BaseXPath.java:698)
   at org.jaxen.BaseXPath.stringValueOf(BaseXPath.java:279)
at com.canoo.webtest.steps.store.StoreXPath.evaluateXPath(StoreXPath.java:72) at com.canoo.webtest.steps.store.StoreXPath.doExecute(StoreXPath.java:68)
   at com.canoo.webtest.steps.Step.execute(Step.java:101)
   at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
   at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
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:105)
   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:101)
   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:105)
   at org.apache.tools.ant.Task.perform(Task.java:348)
   at com.canoo.webtest.ant.WebtestTask.execute(WebtestTask.java:206)
   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:105)
   at org.apache.tools.ant.Task.perform(Task.java:348)
   at groovy.util.AntBuilder.nodeCompleted(AntBuilder.java:178)
   at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:153)
   at groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:132)
   at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64)
at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:777) at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:753) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:167)
   at com.pingwy.groovy.tests.Webtest_GMF.run(Webtest_GMF.groovy:98)
   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.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:95) at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:599)
   at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:904)
   at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:773) at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:753) at org.codehaus.groovy.runtime.InvokerHelper.runScript(InvokerHelper.java:402)
   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.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:95) at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:599)
   at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1077)
at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:744) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:167)
   at com.mycompany.groovy.tests.Webtest.main(Webtest.groovy)
]]></stacktrace>
           </error>*

It seems to come from Jaxen contains() evaluation within the xpath which is
storeXPath(xpath: "//td[contains(child::text(),'stuff')]/following-sibling::td[position()=2]/child::text()", property:"prop")

Has Jaxen's version changed since 2.5 ? Does somebody know if it comes from Webtest or for Jaxen ?

Thanks for reading me

Florent

Reply via email to