Java 仅用于jmeter中失败案例的失败消息
我在脚本中添加了bean shell断言 它显示所有情况下的失败消息,即使它已通过 下面是我的脚本Java 仅用于jmeter中失败案例的失败消息,java,netbeans,jmeter,assertions,beanshell,Java,Netbeans,Jmeter,Assertions,Beanshell,我在脚本中添加了bean shell断言 它显示所有情况下的失败消息,即使它已通过 下面是我的脚本 String response = new String(ResponseData); if(${BoolValue} == true) { Failure = !(response.contains("growth")); FailureMessage = "Projection values is showing in the response data for non-ski
String response = new String(ResponseData);
if(${BoolValue} == true)
{
Failure = !(response.contains("growth"));
FailureMessage = "Projection values is showing in the response data for non-skill reports";
}
if(${BoolValue} == false)
{
Failure = (response.contains("growth"));
FailureMessage = "Projection values is not showing in the response data for skill reports";
}
只有当案例失败时,我才需要获取失败消息。请告诉我,如何执行此操作?在分配失败消息之前检查失败:
String response = new String(ResponseData);
if(${BoolValue} == true)
{
Failure = !(response.contains("growth"));
if (Failure) {
FailureMessage = "Projection values is showing in the response data for non-skill reports";
}
}
if(${BoolValue} == false)
{
Failure = (response.contains("growth"));
if (Failure) {
FailureMessage = "Projection values is not showing in the response data for skill reports";
}
}
顺便说一句,应该使用Java约定,变量名应该以小写字母开头:failure
而不是failure