Canoo and Groovy - how to use storeRegEx

105 Views Asked by At

We would like to test the following flow using Canoo. The tests are written in Groovy, and not as Ant tasks.

  1. Send a request to a specific URL (we use "invoke")
  2. Extract specific information from the response (we use "storeRegEx" with property:"ans")
  3. Print the extracted value (for debug purposes). println "${ans}" - does not work
  4. Use the extracted value in the next action (e.g. invoke "new/url/id=#{ans}")

We saw some references to using an AntBuilder, it fails as well.
Is there some example for that flow?
Thanks

1

There are 1 best solutions below

0
On

remember that it depends on the ant property type (dynamic or ant) whether you have to use #{ans} or ${ans}

println will not work in webtests. Use the description property of webtest steps instead:

group(description:"#{ans}") {
     ...
}

this will show you the value of your property in the test result.