I am trying to create a Test Script using JMeter 2.0.2, in which I have a Http Request from which I'm extracting a phrase, that is stored in a variable say errVar. In the If controller I need to check for the contents of this variable with a String value say word1.word2.word3. I'm providing the If controller the condition in Javascript Style like ${errVar}=='word1.word2.word3'. I have also tried out all options like, using double quotes in the string "word1.word2.word3", removing all the quotes, either single or double. Using the variable without $ and {}, using single equla to sign, but nothing seems to work. Please suggest ASAP. Regards AV
Are there any errors in the jmeter.log file? You probably need to quote both sides of the comparison, e.g. '${errVar}'=='word1.word2.word3' What happens if you replace == with != - does it then work? If neither == nor != works, then the JavaScript must be invalid.
It Worked, but initially I was trying to get all the patterns in the form say name="word1.word2.word3". So it gave all the patterns, as I checked by putting a HTTP Request object below a For Each Controller. But the If controller is not working below the For Each Controller. So Now I have to find the exact number of the Pattern Match that comes out to be some number every time, say 6. This is a workarount at this moment but I actually need to find it out from a group of extracted, values. Please suggest on that. Hope U understand the problem I'm facing. Regards AV
I have a similiar problem. I was using the IfController after a ForEach controller. When I use the recommended syntax '${returnFoo}'=='Software' in a list of 6 elements starting with 'Software' the IF claims to find 'Software' in all 6 elements. It is a substring in one, but not all. "returnFoo" is the output variable from ForEach. If I use any other element from the ForEach list, it never finds it. I know returnFoo is being set with each element in the ForEach List. I have set it in another HTTP request and seen the output. So it appears as if there is a problem in the comparison. I tried the COUNT example, that works ok. Regards, Dennis Todd Hewlett Packard
This appears to be the same as 32790 - condition not being re-evaluated *** This bug has been marked as a duplicate of 32790 ***
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/1487