In JMeter, using a post processor Regular Expression Extractor, i want to extract the form's action attribute. What regular expression should i use?
Asked
Active
Viewed 631 times
2 Answers
1
You should not be using regular expression to parse HTML, go for XPath Extractor instead and use query like
//form/@action
See XPath Tutorial and Using the XPath Extractor in JMeter for more details.
0
I could not get the XPath Extractor to work; from reading the JMeter log, it looks like the XPath Extractor will not work if the html being parsed is not well-formed xml.
But, I was able to extract the form action using a CSS Selector Extractor with the following values:
- CSS Selector expression: form
- Attribute: action
- Match No. (0 for Random): 1

Tom Regan
- 3,580
- 4
- 42
- 71
-
You can tick the "Use Tidy (tolerant parser)" option to get around this – Shawson Apr 17 '23 at 10:34