You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by bu...@apache.org on 2009/03/11 02:11:12 UTC

DO NOT REPLY [Bug 46831] New: if "Response data" consists text with "$" then using ${VAR} there will not work for "Contains/Matches" rules

https://issues.apache.org/bugzilla/show_bug.cgi?id=46831

           Summary: if "Response data" consists text with "$" then using
                    ${VAR} there will not work for "Contains/Matches"
                    rules
           Product: JMeter
           Version: 2.3.2
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main
        AssignedTo: jmeter-dev@jakarta.apache.org
        ReportedBy: slavko_h@yahoo.com


I have HTTP response data that contains a text:
-----------
...
Email Address:<br>
<input name="tbRegisterEmailAddress" value="qatest1" size="8"/>
            @<select name="RegisterValidEmailGroup$ctl00$drpEmails"
id="RegisterValidEmailGroup_ctl00_drpEmails">
...
-----------
(...) means that something is above and below.

I'm using "Response Assertion" for verifying this text with "Contains" rule.

RA-1) using of "Pattern to test" as
----
(?s)Email Address:<br>(.*)
<input name="tbRegisterEmailAddress" value="${ID}" size="8"/>(.*)
----
works OK, where ${ID} is data from csv config file and ${ID}="qatest1" (without
quotes) and "Debug" sample has confirmed it;

RA-2) using of "Pattern to test" as
----
(?s)Email Address:<br>(.*)
<input name="tbRegisterEmailAddress" value="qatest1" size="8"/>(.*)
            @<select name="RegisterValidEmailGroup\$ctl00\$drpEmails"
id="RegisterValidEmailGroup_ctl00_drpEmails">(.*)
----
works OK, where "qatest1" is defined as a literal;

RA-3) using of "Pattern to test" as
----
(?s)Email Address:<br>(.*)
<input name="tbRegisterEmailAddress" value="${ID}" size="8"/>(.*)
            @<select name="RegisterValidEmailGroup\$ctl00\$drpEmails"
id="RegisterValidEmailGroup_ctl00_drpEmails">(.*)
----
FAILED, where ${ID}="qatest1" from csv config file and "Debug" sample has
confirmed it;

What is wrong?
You can simplify response - the idea is if response data has "$" character(s)
in the text - using ${VAR} as jmeter variable will not work (in my case ${VAR}
comes before a text with "$")

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 46831] if "Response data" consists text with "$" then using ${VAR} there will not work for "Contains/Matches" rules

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46831


Sebb <se...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX




--- Comment #7 from Sebb <se...@apache.org>  2009-05-07 06:22:29 PST ---
It's just not possible to fix this now without breaking existing tests.

Any existing tests using functions which require \$ as part of one of their
parameters - e.g. the regexFunction - would need to be recoded.

However, the documentation will be updated to describe how to reference such
variables.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 46831] if "Response data" consists text with "$" then using ${VAR} there will not work for "Contains/Matches" rules

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46831


Sebb <se...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |normal




--- Comment #6 from Sebb <se...@apache.org>  2009-03-11 14:20:24 PST ---
(In reply to comment #5)
> Thank Sebb for explanation in details, neither ways will not work for me.

Why not?

> So, I will wait for a fix.
> As you probably recognized that that response is from .NET (.NEt uses "$" as
> part of id-names) - so it is pretty severe issue - marked as "critical".

This is not a critical issue, because there are several work-rounds.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 46831] if "Response data" consists text with "$" then using ${VAR} there will not work for "Contains/Matches" rules

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46831


Sebb <se...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO




--- Comment #1 from Sebb <se...@apache.org>  2009-03-10 19:35:37 PST ---
Could you create a simple test plan and attach it please?

Use the Java Request sampler to generate the response data, and define the
variables on the test plan.

I suspect the problem may be one of spurious spaces; these are best dealt with
by an actual example.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 46831] if "Response data" consists text with "$" then using ${VAR} there will not work for "Contains/Matches" rules

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46831





--- Comment #3 from Yaroslav <sl...@yahoo.com>  2009-03-11 10:53:33 PST ---
Created an attachment (id=23370)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23370)
testPlan

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 46831] if "Response data" consists text with "$" then using ${VAR} there will not work for "Contains/Matches" rules

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46831


Sebb <se...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW




--- Comment #4 from Sebb <se...@apache.org>  2009-03-11 11:25:03 PST ---
Looks like the variable processing is messing with the '\$' in the string - if
you look carefully at the assertion error message you should see that the '\'
has been stripped from before the '$'.

If you change the non-variable version so it fails, you should see that the
'\$' is preserved.

This is obviously a bug.

One work-round is to replace '\$' with '.', but this will allow other
characters aprt from $.

Another is to replace it with '\\$' - however this will probably stop working
when the bug is fixed.

A third is to use two REs, one with the ${ID} part and another with the rest,
but this will not check the order in which the parts appear.

Or you put '\$' in a variable and use that.

By the way, there is no point in putting '(.*)' at the end of a contains check.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 46831] if "Response data" consists text with "$" then using ${VAR} there will not work for "Contains/Matches" rules

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46831





--- Comment #2 from Yaroslav <sl...@yahoo.com>  2009-03-11 10:52:33 PST ---
So, Sebb
I've attached a simple TestPlan with using Java sample.
The issue has a place there as well.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 46831] if "Response data" consists text with "$" then using ${VAR} there will not work for "Contains/Matches" rules

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46831


Yaroslav <sl...@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical




--- Comment #5 from Yaroslav <sl...@yahoo.com>  2009-03-11 13:58:55 PST ---
Thank Sebb for explanation in details, neither ways will not work for me.
So, I will wait for a fix.
As you probably recognized that that response is from .NET (.NEt uses "$" as
part of id-names) - so it is pretty severe issue - marked as "critical".

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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