开发者

Canoo and Groovy - how to use storeRegEx

开发者 https://www.devze.com 2023-04-07 08:31 出处:网络
We would like to test the following flow using Canoo. The tests are written in Groovy, and not as Ant tasks.

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. inv开发者_StackOverflowoke "new/url/id=#{ans}")

We saw some references to using an AntBuilder, it fails as well.

Is there some example for that flow?

Thanks


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号