Mayank
Mayank

Reputation: 9

Jmeter Regular Expression Extractor to extract an input value

I am new to Jmeter's Regular Expression Extractor. For an HTTP Request, I am getting an HTML Response. I want to extract an e-mail address which is a hidden value in that response for use in the subsequent request.

The string is:

<input type="hidden" name="login" id="login" value="[email protected]" >

How can I do this?

Upvotes: 0

Views: 6683

Answers (3)

Subash Bose
Subash Bose

Reputation: 71

Regexp as following

id="login" value="(.*)"

Upvotes: 1

Aliaksandr Belik
Aliaksandr Belik

Reputation: 12873

You may also maybe like more effective XPath Extractor, used the same way as RegEx Extractor. XPath query will look like:

//input[@type='hidden'][@name='login']/@value

and extractor itself:

xpath extractor

Upvotes: 5

BlackGaff
BlackGaff

Reputation: 7707

This site has great tutorials on how to perl regex's: http://www.regular-expressions.info/

I would also recommend getting the tool "Regex Coach" to help you write - it searches for your string in real time.

But, your regex will look something like:

<input type="hidden" name="login" id="login" value="(.+?)" > 

You want to make sure you include the (), as that is the part JMeter will store into your variable.

Upvotes: 1

Related Questions