Saagar
Saagar

Reputation: 834

Jmeter extract value from Get Request

enter image description here

In this example request 226 is main Post request which internally executes 1 Post and 2 Get requests during run time. how i can extract dynamic code value from one of Get request of 226 which is input for the request 228.

I know how to extract from response using RegEx and Xpath. I this case need help Passing Data From a Request to Another Request

Upvotes: 0

Views: 3895

Answers (4)

Olha Horak
Olha Horak

Reputation: 3738

Hopefully you've already found the solution, but I believe that is what you've been looking for: enter image description here

Upvotes: 1

Vikas Madhusudana
Vikas Madhusudana

Reputation: 1482

you can use beanshell sampler to process the results and have prev to get the list of results

org.apache.jmeter.samplers.SampleResult [] temp=prev.getSubResults(); print(temp[2].getURL())

Upvotes: 0

Dmitri T
Dmitri T

Reputation: 168092

I don't think you will be able to bypass OAuth 2.0 login challenge using correlation. See How to Run Performance Tests on OAuth Secured Apps with JMeter for feasible options.

Upvotes: 0

vins
vins

Reputation: 15390

To extract data from a response, you can go for Regular Expression Extractor in this case which is faster and consumes less memory and CPU compared to other extractors like XPath which is worse.

This blog has decent info on extracting information using Regular Expression Extractor.

You are already saying that you know how to use them. Then it is very easy to pass the value to another request. You just use the variable using below syntax to access the value - ${variablename}. Whereever you need to substitute the value, just use ${variablename}.

Ex: code=${code}&stats=${stats}

Remember: Scope of this variable is within the thread for a thread group.

Upvotes: 0

Related Questions