Vitalii
Vitalii

Reputation: 1

How to extract parameter value from redirect url and put it to another one?

I ran into a problem in JMeter.

I have URL and into body there is GET http://test.com/registration?test={value} and I need to extract value of test parameter and put this value to the next url to another parameter.

I used Regular Expression Extractor but all I can do is pull out the whole URL but not specific value from the URL.

By way of example:

  1. http://test.com/browse where we have code 303 and in the body

<a href="http://test.com/registration?test={value}">See Other</a>.

  1. I need to extract value from http://test.com/registration?test={value} and put this value to the another URL

If you have any thoughts on this please help. Thanks in advance!

I used Regular Expression Extractor but all I can do is pull out the whole URL but not specific value from the URL.

Probably there are any other ways to solve it.

Upvotes: 0

Views: 385

Answers (1)

Dmitri T
Dmitri T

Reputation: 168217

Try with this regular expression:

test=(.+?)"

enter image description here

Full configuration just in case:

enter image description here

You will be able to refer extracted value as ${value} where required.

You might find Boundary Extractor easier to use, in this case you just need to provide "left" and "right" boundaries and it will extract everything in-between:

enter image description here

More information: The Boundary Extractor vs. the Regular Expression Extractor in JMeter

Upvotes: 0

Related Questions