简体   繁体   中英

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="abs12.test@test.com" >

How can I do this?

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 提取器

Regexp as following

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM