You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Paco1 <pa...@hotmail.com> on 2007/08/16 17:17:43 UTC

Response Assertion semicolon problem

Hello all. I am trying to write a response assertion in jmeter that checks
that a particular image is set properly (disabled).

Here is the string of code that I am trying to check:
<input type="image" id="esnLookup" name="_target1" onClick="setMode();"
src='/ehmdrc-pdeu/resources/icons/disabledLookup.jpg' border="0" disabled>

When I add this to the response assertion, it fails. I added a tree listener
and can see that this string of code is indeed being returned. I believe it
has something to do with the semicolon borking jmeter.
I tried searching for a portion of the string around the semicolon to see if
they would pass or fail, my results are as follows:
string:            response assertion result:
"setMode(); 	fails
"setMode()	PASSES
de();"		fails
e();"		PASSES
e();"		fails
      ^space ater double quote
;" src=		PASSES
;" src='/ehmdrc-pdeu/resources/icons/disabledLookup.jpg'	PASSES
();" src='							                   PASSES
();" src='/ehmdrc-pdeu/resources/icons/disabledLookup.jpg'	PASSES
setMode();" src							               fails
<input type="image" id="esnLookup" name="_target1" onClick="setMode()	PASSES
" src='/ehmdrc-pdeu/resources/icons/disabledLookup.jpg' border="0" disabled>
PASSES
;" src='/ehmdrc-pdeu/resources/icons/disabledLookup.jpg' border="0"
disabled>	PASSES
();" src='/ehmdrc-pdeu/resources/icons/disabledLookup.jpg' border="0"
disabled> PASSES
e();" src='/ehmdrc-pdeu/resources/icons/disabledLookup.jpg' border="0"
disabled> fails

It is odd that the response assertion doesn't fail just for the semicolon,
but fails when there is text around it.
Does anybody know of a way to get jmeter to ignore whatever is making the
response assertion fail and just search for the text that I put in the
response assertion? (e.g. puting the string in single quotes, double quotes,
parenthesis, slashes, dancing in the rain, praying to the sun god)

If not, does anybody know of another way that I can check that the image
id="esnLookup" is pointing to disabledLookup.jpg?

Any assistance is much appreciated. (:

-Grant
-- 
View this message in context: http://www.nabble.com/Response-Assertion-semicolon-problem-tf4280336.html#a12183405
Sent from the JMeter - User mailing list archive at Nabble.com.


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


Re: Response Assertion semicolon problem

Posted by sebb <se...@gmail.com>.
Response Assertion uses regular expressions.

The problem is the (), which does not match ( followed by ) - it
represents a field to be extracted, and there is no content, so
effectively the () is ignored.

Use \(\) instead.

On 16/08/07, Paco1 <pa...@hotmail.com> wrote:
>
> Hello all. I am trying to write a response assertion in jmeter that checks
> that a particular image is set properly (disabled).
>
> Here is the string of code that I am trying to check:
> <input type="image" id="esnLookup" name="_target1" onClick="setMode();"
> src='/ehmdrc-pdeu/resources/icons/disabledLookup.jpg' border="0" disabled>
>
> When I add this to the response assertion, it fails. I added a tree listener
> and can see that this string of code is indeed being returned. I believe it
> has something to do with the semicolon borking jmeter.
> I tried searching for a portion of the string around the semicolon to see if
> they would pass or fail, my results are as follows:
> string:            response assertion result:
> "setMode();     fails
> "setMode()      PASSES
> de();"          fails
> e();"           PASSES
> e();"           fails
>      ^space ater double quote
> ;" src=         PASSES
> ;" src='/ehmdrc-pdeu/resources/icons/disabledLookup.jpg'        PASSES
> ();" src='                                                                         PASSES
> ();" src='/ehmdrc-pdeu/resources/icons/disabledLookup.jpg'      PASSES
> setMode();" src                                                                fails
> <input type="image" id="esnLookup" name="_target1" onClick="setMode()   PASSES
> " src='/ehmdrc-pdeu/resources/icons/disabledLookup.jpg' border="0" disabled>
> PASSES
> ;" src='/ehmdrc-pdeu/resources/icons/disabledLookup.jpg' border="0"
> disabled>       PASSES
> ();" src='/ehmdrc-pdeu/resources/icons/disabledLookup.jpg' border="0"
> disabled> PASSES
> e();" src='/ehmdrc-pdeu/resources/icons/disabledLookup.jpg' border="0"
> disabled> fails
>
> It is odd that the response assertion doesn't fail just for the semicolon,
> but fails when there is text around it.
> Does anybody know of a way to get jmeter to ignore whatever is making the
> response assertion fail and just search for the text that I put in the
> response assertion? (e.g. puting the string in single quotes, double quotes,
> parenthesis, slashes, dancing in the rain, praying to the sun god)
>
> If not, does anybody know of another way that I can check that the image
> id="esnLookup" is pointing to disabledLookup.jpg?
>
> Any assistance is much appreciated. (:
>
> -Grant
> --
> View this message in context: http://www.nabble.com/Response-Assertion-semicolon-problem-tf4280336.html#a12183405
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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