java - Failure Message only for failing cases in jmeter -
i have added bean shell assertion in scripts.
it shows failure message cases, if passed.
below scripts
string response = new string(responsedata); if(${boolvalue} == true) { failure = !(response.contains("growth")); failuremessage = "projection values showing in response data non-skill reports"; } if(${boolvalue} == false) { failure = (response.contains("growth")); failuremessage = "projection values not showing in response data skill reports"; }
i need failure message if case gets failed. please let me know, how this?
check failure before failure message assignment:
string response = new string(responsedata); if(${boolvalue} == true) { failure = !(response.contains("growth")); if (failure) { failuremessage = "projection values showing in response data non-skill reports"; } } if(${boolvalue} == false) { failure = (response.contains("growth")); if (failure) { failuremessage = "projection values not showing in response data skill reports"; } }
btw use should use java conventions of variable name should start lowercase letter as: failure
instead failure
.
Comments
Post a Comment