[Webtest] Reading different url parameters from a file

Marc Guillemot webtest@lists.canoo.com
Thu, 1 Jun 2006 00:20:50 -0700 (PDT)


Hi,

welcome to Webtest.

Assuming that you're porperty file contains entries like:
value.0=something
value.1=something else
value.2=other thing

It would be nice to have the possibility to write a test like:
<repeat count="3">
  <invoke url="http://localhost/getpage.html?param1=${value.#{count}}"/>
  .. some tests ...
</repeat>

Sadly this isn't yet possible (it will come but I can't say when) as a
workaround you can use a small script:
<repeat count="3">
  <groovy>
    def propertyName = 'value.' + step.webtestProperties['count']
    step.webtestProperties['currentValue'] =
step.project.properties[propertyName]
  </groovy>
  <invoke url="http://localhost/getpage.html?param1=#{currentValue}"/>
  .. some tests ...
</repeat>

Marc.
--
View this message in context: http://www.nabble.com/Reading+different+url+parameters+from+a+file-t1712054.html#a4657598
Sent from the WebTest forum at Nabble.com.