[Webtest] verifyXPath troubles

Karel Soupal Karel Soupal" <karel@soupal.cz
Tue, 24 Apr 2007 14:51:55 +0200


Thanks Marc,
you are correct .. I did not pay enough attention as the xml used to work=
 =20
.. and it is actually a good news as being a tester I like the fact that =
=20
the tool become more strict .. ;)

Dne Tue, 24 Apr 2007 12:34:16 +0200 Marc Guillemot <mguillemot@yahoo.fr> =
=20
napsal/-a:

> Hi Karel,
>
> the XPath engine (Jaxen) is now stricter and complains about incorrect =
=20
> xpath expressions it previously accepted.
> In your case, it seems to me that the closing parenthese for contains i=
s =20
> missing.
>
> Marc.
>
> Karel =A9oupal wrote:
>> Hi,
>>  I am experiencing strange behavior with the verifyXPath step. Checkin=
g =20
>> the table for a string I need to parse the string in the xml file .. s=
o =20
>> the code looks there like this:
>>  <verifyxpath description=3D"table check" =20
>> xpath=3D"//table[@id=3D'users']//tr[(((#{newnumber}-1)*4)+#{count}+4)]=
/td[1][contains(string(),'#{newnumber}varloB#{count}@127.0.0.1']" =20
>> />
>>  then in results the xpath parses like this:
>>  =20
>> //table[@id=3D'users']//tr[(((1-1)*4)+0+4)]/td[1][contains(string(),'1=
varloB0@127.0.0.1'] =20
>>   This syntax certainly worked on the version some time ago (cca 2005 =
=20
>> .. another question would be how to tell the exact build of the =20
>> distribution .. I have the old sources still on my backup)
>> but now with R_1393 does not work and gives me this exception:
>>  Error Message: org.jaxen.XPathSyntaxException cannot be cast to =20
>> java.lang.RuntimeException
>> Location: (line: )
>> Exception: java.lang.ClassCastException
>>  Stacktrace java.lang.ClassCastException: =20
>> org.jaxen.XPathSyntaxException cannot be cast to =20
>> java.lang.RuntimeException
>>     at =20
>> com.canoo.webtest.steps.AbstractStepContainer.executeContainedStep(Abs=
tractStepContainer.java:79) =20
>>      at =20
>> com.canoo.webtest.steps.AbstractStepContainer.executeContainedSteps(Ab=
stractStepContainer.java:91) =20
>>      at =20
>> com.canoo.webtest.steps.control.GroupStep.doExecute(GroupStep.java:14)
>>     at =20
>> com.canoo.webtest.steps.control.MultipleExecutionStepContainer$Proxies=
ResettingGroupStep.doExecute(MultipleExecutionStepContainer.java:39) =20
>>      at com.canoo.webtest.steps.Step.execute(Step.java:104)
>>     at org.apache.tools.ant.Task.perform(Task.java:364)
>>     at =20
>> com.canoo.webtest.steps.control.RepeatStep.executeContainedTasks(Repea=
tStep.java:205) =20
>>      at =20
>> com.canoo.webtest.steps.control.RepeatStep.doExecute(RepeatStep.java:1=
59)
>>     at com.canoo.webtest.steps.Step.execute(Step.java:104)
>>     at =20
>> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>>     at org.apache.tools.ant.Task.perform(Task.java:364)
>>     at =20
>> com.canoo.webtest.steps.AbstractStepContainer.executeContainedStep(Abs=
tractStepContainer.java:74) =20
>>      at =20
>> com.canoo.webtest.steps.AbstractStepContainer.executeContainedSteps(Ab=
stractStepContainer.java:91) =20
>>      at =20
>> com.canoo.webtest.steps.control.GroupStep.doExecute(GroupStep.java:14)
>>     at com.canoo.webtest.steps.Step.execute(Step.java:104)
>>     at =20
>> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>>     at org.apache.tools.ant.Task.perform(Task.java:364)
>>     at =20
>> com.canoo.webtest.steps.AbstractStepContainer.executeContainedStep(Abs=
tractStepContainer.java:74) =20
>>      at =20
>> com.canoo.webtest.steps.AbstractStepContainer.executeContainedSteps(Ab=
stractStepContainer.java:91) =20
>>      at =20
>> com.canoo.webtest.steps.control.GroupStep.doExecute(GroupStep.java:14)
>>     at com.canoo.webtest.steps.Step.execute(Step.java:104)
>>     at =20
>> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>>     at org.apache.tools.ant.Task.perform(Task.java:364)
>>     at =20
>> com.canoo.webtest.steps.AbstractStepContainer.executeContainedStep(Abs=
tractStepContainer.java:74) =20
>>      at =20
>> com.canoo.webtest.steps.AbstractStepContainer.executeContainedSteps(Ab=
stractStepContainer.java:91) =20
>>      at =20
>> com.canoo.webtest.steps.control.GroupStep.doExecute(GroupStep.java:14)
>>     at =20
>> com.canoo.webtest.steps.control.MultipleExecutionStepContainer$Proxies=
ResettingGroupStep.doExecute(MultipleExecutionStepContainer.java:39) =20
>>      at com.canoo.webtest.steps.Step.execute(Step.java:104)
>>     at org.apache.tools.ant.Task.perform(Task.java:364)
>>     at =20
>> com.canoo.webtest.steps.control.RepeatStep.executeContainedTasks(Repea=
tStep.java:205) =20
>>      at =20
>> com.canoo.webtest.steps.control.RepeatStep.doExecute(RepeatStep.java:1=
59)
>>     at com.canoo.webtest.steps.Step.execute(Step.java:104)
>>     at =20
>> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>>     at org.apache.tools.ant.Task.perform(Task.java:364)
>>     at =20
>> com.canoo.webtest.ant.TestStepSequence.executeSteps(TestStepSequence.j=
ava:43) =20
>>      at =20
>> com.canoo.webtest.ant.TestStepSequence.doExecute(TestStepSequence.java=
:31)
>>     at com.canoo.webtest.steps.Step.execute(Step.java:104)
>>     at org.apache.tools.ant.Task.perform(Task.java:364)
>>     at com.canoo.webtest.ant.WebtestTask.execute(WebtestTask.java:164)
>>     at =20
>> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>>     at org.apache.tools.ant.Task.perform(Task.java:364)
>>     at org.apache.tools.ant.Target.execute(Target.java:341)
>>     at org.apache.tools.ant.Target.performTasks(Target.java:369)
>>     at =20
>> org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>>     at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
>>     at =20
>> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExec=
utor.java:40) =20
>>      at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
>>     at org.apache.tools.ant.Main.runBuild(Main.java:668)
>>     at org.apache.tools.ant.Main.startAnt(Main.java:187)
>>     at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
>>     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
>>  Any help deeply appreciated!
>>  --Karel Soupal
>> _______________________________________________
>> WebTest mailing list
>> WebTest@lists.canoo.com
>> http://lists.canoo.com/mailman/listinfo/webtest
>>
>
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>



--=20
Karel Soupal