You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Vincent Partington <vp...@xebia.com> on 2003/12/24 11:20:37 UTC

Re: Response assertion returns 'error=true' when sample result has failure

> En/na Vincent Partington ha escrit:
>> Hi,
>>
>> The class ResponseAssertion (in ApacheJMeter 1.9.1) has the following
>> bit of code:
>>
>>    public AssertionResult getResult(SampleResult response)
>>    {
>>       AssertionResult result;
>>       if (!response.isSuccessful())
>>       {
>>          result = new AssertionResult();
>>          result.setError(true);
>>          result.setFailureMessage(
>>             new String((byte[]) response.getResponseData()));
>>          return result;
>>       }
>>       result = evaluateResponse(response);
>>       return result;
>>    }
> Can you be more specific as to the problems it causes?

When a response assertion fails normally, it returns a failure message
such as "Test Failed, expected to contain MAGICSTRINGVALUE". However, when
an earlier assertion caused the sample result to be flagged as not
succesful, the response assertion returns "error=true" _and_ returns the
complete response data (be it HTML or binaryr data) as the failure
message.

That in turn can cause binary data to be inserted into the results XML
file (when jmeter.save.saveservice.assertion_results=all in
jmeter.properties). And then we get to the whole jorphan.io.TextFile can
of worms we are discussing in the other thread. :)

I don't see the purpose of this piece of code, but if it were left in, I
would strongly suggest setting the failure message to something like "Test
failed, sample cannot be relied upon".

Regards, Vincent.




---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Response assertion returns 'error=true' when sample result has failure

Posted by Jordi Salvat i Alabart <js...@atg.com>.
Sorry, I understood that one.

I was asking about this sentence:

«
Using the response data as the failure message causes problems when the
response data is binary (see my earlier post about UTF-8/ISO-8859-1).
»

Apologies for the confusion.


En/na Vincent Partington ha escrit:
>>En/na Vincent Partington ha escrit:
>>
>>>Hi,
>>>
>>>The class ResponseAssertion (in ApacheJMeter 1.9.1) has the following
>>>bit of code:
>>>
>>>   public AssertionResult getResult(SampleResult response)
>>>   {
>>>      AssertionResult result;
>>>      if (!response.isSuccessful())
>>>      {
>>>         result = new AssertionResult();
>>>         result.setError(true);
>>>         result.setFailureMessage(
>>>            new String((byte[]) response.getResponseData()));
>>>         return result;
>>>      }
>>>      result = evaluateResponse(response);
>>>      return result;
>>>   }
>>
>>Can you be more specific as to the problems it causes?
> 
> 
> When a response assertion fails normally, it returns a failure message
> such as "Test Failed, expected to contain MAGICSTRINGVALUE". However, when
> an earlier assertion caused the sample result to be flagged as not
> succesful, the response assertion returns "error=true" _and_ returns the
> complete response data (be it HTML or binaryr data) as the failure
> message.
> 
> That in turn can cause binary data to be inserted into the results XML
> file (when jmeter.save.saveservice.assertion_results=all in
> jmeter.properties). And then we get to the whole jorphan.io.TextFile can
> of worms we are discussing in the other thread. :)
> 
> I don't see the purpose of this piece of code, but if it were left in, I
> would strongly suggest setting the failure message to something like "Test
> failed, sample cannot be relied upon".
> 
> Regards, Vincent.
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org