2017-09-12 4 views
0

내 스크립트에 bean 쉘 어설 션을 추가했습니다.오류 메시지가 jmeter에서 실패한 경우에만 표시

전달 된 경우에도 모든 경우의 실패 메시지를 보여줍니다.

다음은 내 스크립트 나는 경우 실패됩니다 경우에만 오류 메시지를받을 필요가

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"; 
} 

입니다. 알려주십시오, 어떻게해야합니까? 오류 메시지 할당하기 전에

답변

1

체크 실패 : failure 대신 Failure :

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"; 
    } 
} 

가 BTW 아마 소문자로 시작한다 변수 이름의 자바 규칙을 사용한다 사용한다.

+0

좋아요. 그것은 작동합니다. 감사!!!! – Kamal