Bug 53145 - HTTP Sampler - function in path evaluated too early
Summary: HTTP Sampler - function in path evaluated too early
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.6
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
Depends on:
Reported: 2012-04-25 10:42 UTC by jerald
Modified: 2012-04-25 12:29 UTC (History)
0 users

jmx script file which explains the bug in simple manner (7.76 KB, application/octet-stream)
2012-04-25 10:42 UTC, jerald

Note You need to log in before you can comment on or make changes to this bug.
Description jerald 2012-04-25 10:42:04 UTC
Created attachment 28676 [details]
jmx script file which explains the bug in simple manner

i tried with defining two variables test1 and test2 with values 10 and 20 respectively using user defined variables. both variables are used inside the function __intSum and the variables used are resolved and expression is executed with out any error. But if i use the variable created using regular expression extractor, it is not resolved and it throws NumberFormatException in jmeter logs.

I have attached a sample jmx scrript file which sends a GET request to google.com and then extracts a number from its image file name using REE and assigning that value to variable test3. This variable test3 is not resolved inside the function __intSum and it throws NumberFormatException.
Comment 1 Sebb 2012-04-25 11:59:18 UTC
The problem is that the function is being evaluated before the variable has been defined.

Use the test plan toe initialise test3 as a valid number (e.g. 1) and the test will then work.

However, this does point to a possible bug in JMeter - I'm not yet sure why the function is being executed at test startup. If it's necessary to do so, the code could perhaps be more tolerant of the error.
Comment 2 Sebb 2012-04-25 12:27:02 UTC
URL: http://svn.apache.org/viewvc?rev=1330236&view=rev
Bug 53145 - HTTP Sampler - function in path evaluated too early


Tidied up code so it only extracts the property value if it's a StringProperty.
Previously the debug statements were executing the function as part of building their string parameters.
Comment 3 The ASF infrastructure team 2022-09-24 20:37:49 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2816