[Webtest] <repeat>

Dierk Koenig webtest@lists.canoo.com
Fri, 19 Sep 2003 12:19:57 +0200


In the webtest version you have, the dynamic property does not get
expanded in the xpath attribute of storexpath.
Do you use a recent build?

The current build contains theses tests to assert the proper expansion:
http://webtest.canoo.com/webtest/clover/com/canoo/webtest/steps/StepTest.htm
l
http://webtest.canoo.com/webtest/clover/com/canoo/webtest/steps/StoreXPathTe
st.html

cheers
Mittie


> -----Original Message-----
> From: webtest-admin@lists.canoo.com
> [mailto:webtest-admin@lists.canoo.com]On Behalf Of Hesteric Roman
> Sent: Freitag, 19. September 2003 10:33
> To: 'webtest@lists.canoo.com'
> Subject: RE: [Webtest] <repeat>
> Importance: High
>
>
> Hi!
>
> 	What's wrong in my code, please ?
>
>
> Roman.
>
>
> Example:
>
> 	<repeat count="2" countername="NR">
> 	.
>       .
>       .
>       <storexpath     stepid="Increment" xpath="#{NR}+1" property="Num" />
>      	<setinputfield  stepid="Fill Name" name="NAME" value="#{Num}"/>
>
>       .
>       .
>       </repeat>
>
>
> result:
>
> Error
> Exception
> org.dom4j.InvalidXPathException
> Exception
> Invalid XPath expression: #{NR}+1 Unexpected '#{NR}+1'
> Stacktrace
> org.dom4j.InvalidXPathException: Invalid XPath expression: #{NR}+1
> Unexpected '#{NR}+1'
> 	at org.dom4j.xpath.DefaultXPath.parse(DefaultXPath.java:316)
> 	at org.dom4j.xpath.DefaultXPath.<init>(DefaultXPath.java:63)
> 	at org.dom4j.DocumentFactory.createXPath(DocumentFactory.java:182)
> 	at org.dom4j.tree.AbstractNode.createXPath(AbstractNode.java:207)
> 	at
> org.dom4j.tree.AbstractNode.selectSingleNode(AbstractNode.java:187)
> 	at com.canoo.webtest.steps.StoreXPath.doExecute(StoreXPath.java:66)
> 	at com.canoo.webtest.steps.Step.execute(Step.java:56)
> 	at
> com.canoo.webtest.steps.RepeatWrapper.executeContainedSteps(Repeat
> Wrapper.ja
> va:113)
> 	at
> com.canoo.webtest.steps.RepeatWrapper.doExecute(RepeatWrapper.java:92)
> 	at com.canoo.webtest.steps.Step.execute(Step.java:56)
> 	at com.canoo.webtest.engine.Engine.executeSteps(Engine.java:32)
> 	at
> com.canoo.webtest.ant.TestSpecificationTask.execute(TestSpecificat
> ionTask.ja
> va:55)
> 	at
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:166)
> 	at org.apache.tools.ant.Task.perform(Task.java:317)
> 	at org.apache.tools.ant.Target.execute(Target.java:309)
> 	at org.apache.tools.ant.Target.performTasks(Target.java:334)
> 	at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
> 	at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:371)
> 	at
> org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:143)
> 	at org.apache.tools.ant.Task.perform(Task.java:317)
> 	at org.apache.tools.ant.Target.execute(Target.java:309)
> 	at org.apache.tools.ant.Target.performTasks(Target.java:334)
> 	at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
> 	at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
> 	at org.apache.tools.ant.Main.runBuild(Main.java:610)
> 	at org.apache.tools.ant.Main.start(Main.java:196)
> 	at org.apache.tools.ant.Main.main(Main.java:235)
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>
>