I changed the code to
if (vars.get("city_10") == null){
vars.put( "city_10", "a" );
print(vars.get("city_10"));
}
and it's working! thank you Sir!
I was suprised that this part was wrong because it was printing "a".. :)
anyway do you know that better way by any chance? :)
Deepak Shetty wrote:
>
> if (vars.get("${city_10}") == null) is wrong
> should be
> vars.get("city_10")
> Im sure theres a better way to do what you want though :)
> regards
> deepak
>
> On Fri, Jun 5, 2009 at 9:19 AM, mattlamignat <[email protected]>
> 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: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/Regular-Expression-Extractor-and-its-Variables-tp23891274p23892094.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]