jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Lotts <tljme...@gmail.com>
Subject Re: Regular Expression Extractor and its Variables
Date Mon, 15 Jun 2009 19:10:56 GMT
Try:

   - vars.get("city_10") or you could use ${city_10}
   - vars.put( "city_10", "a" )
   - print(${city_10}) or print(vars.get("city_10"))


On Fri, Jun 5, 2009 at 12:19 PM, mattlamignat <mateusz_grodecki@o2.pl>wrote:

>
> This is my test plan:
>
>  |-User Defined Variable
>  |-HTTP Request
>    |-Regular Expression Extractor
>  |-SOAP Request
>    |-Response Assertion
>
> What I have to do is to capture strings from the HTTP response and check if
> they do exist in the SOAP response. The thing is that I don't know how many
> strings I need to capture (for instance Cities) will be in the HTTP
> response. I set regexp to capture all of them:
> Match No.(0 for Random)   -1
> I set 10 variables in the Response Assertion
> ${city_1}
> ${city_2}
> ....
> ${city_10}
>
> The problem is when I have less than 10 Cities in the HTTP response. In
> this
> case my assertions fail with the message "Test failed: text expected to
> contain /${city_10}/"
>
> I try to replace null in the  ${city_10} with some string that exist in the
> SOAP response so my test will not fail.
>
> I added BeanShell PreProcessor as a child of SOAP Request:
>
> if (vars.get("${city_10}") == null){
> vars.put( "${city_10}", "a" );
> print(vars.get("${city_10}")); // just to ensure above line changed the
> value to "a"
> }
>
> but it's not working - I'm still getting the message "Test failed: text
> expected to contain /${city_10}/"
>
> please help..
>
>
> --
> View this message in context:
> http://www.nabble.com/Regular-Expression-Extractor-and-its-Variables-tp23891274p23891274.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message