In Jmeter v4.0 r 1823414 I can use If Controller only with single statement, but not with multiple. Example of using multiple statements I have taken from here and it was suggested to use
${__javaScript("${responsecode}"=="404")} && ${__javaScript("${responseMessage}" == "Not Found")}
I have also checked blazemeter tutorial page, but it says nothing about multiple conditional statements inside If Controller.
Example of my Test Plan is below
In my Debug Sampler I can see following
At some place in the Test Plan I put IF Controller to check that both variables are equal to not_found
...
${__javaScript(vars.get('manual_bug')=='not_found')} && ${__javaScript(vars.get('integration_bug')=='not_found')}
...so all the subsequent actions are executed. However, this IF Controller either never gets executed or always return FALSE. Not sure what's happening with it.
Before blaming me that I didn't do enough research and rushed to ask a question on SO, I will provide below samples of what I've already tried and that didn't help:
-
With double quotes around variables
${__javaScript(vars.get("manual_bug")=="not_found")} && ${__javaScript(vars.get("integration_bug")=="not_found")}
-
With additional space between equal sign
${__javaScript(vars.get('manual_bug') == 'not_found')} && ${__javaScript(vars.get('integration_bug') == 'not_found')}
- Avoid using vars.get
${__javaScript(${manual_bug} == 'not_found')} && ${__javaScript(${integration_bug} == 'not_found')}
-
Using double quotes without vars.get
${__javaScript(${manual_bug} == "not_found")} && ${__javaScript(${integration_bug} == "not_found")}
My log file looks completely fine, no errors
Please advise if someone was able to execute multiple conditional statements in the Jmeter tool? Thanks!
Aucun commentaire:
Enregistrer un commentaire