HFAIEDH Fares
HFAIEDH Fares

Reputation: 54

How to send a parameter in jmeter as a variable?

I'm trying to launch a performance test, but for each time , there an attribute called "QueryID" which is created in the source code of the application. First HTTP Request with QueryID

There is a multiple http request and for the QueryID, it has the same value.

I tried to detect it in the previous http request (to pass it through regular expression), but it won't show up.

Has anyone idea how i can configure it as a "variable" that it will be filled in each time with his random value from the application?

Thanks

Upvotes: 0

Views: 2286

Answers (2)

Prashant Vadher
Prashant Vadher

Reputation: 1075

Steps to Resolve this:

  1. You have already collected QUERYID value using Regular expression extractor. For example You have returned QUERYID in Reference Name field of Regular expression extractor as shown in below Image.

enter image description here

  1. Now Mention ${QUERYID} in value section as shown in below image

enter image description here

Upvotes: 1

Dmitri T
Dmitri T

Reputation: 168122

If the QueryID is created in the source code of the application, most probably it's created with a JavaScript function so you basically need to implement the same function using JSR223 PreProcessor and Groovy language

Once you generate the value you can store it into a JMeter Variable using vars shorthand for JMeterVariables class instance and you will be able to use it normally later on.

Upvotes: 0

Related Questions