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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to