Reputation: 1039
I'm trying to get JMeter to read a pre-filled form input value at the following XPath: /html/body/div[1]/div[3]/div[2]/form/table/tbody/tr[2]/td/div[1]/input/@value
Since I only got ERROR as a result, I investigated and enabled Tidy (tolerant parser) as well as verbosity (not Quiet; Report errors) and I found this:
ERROR - jmeter.util.XPathUtil: TidyException: line 65 column 9 - Error: <nav> is not recognized!
line 95 column 11 - Error: <nav> is not recognized!
InputStream: Doctype given is ""
InputStream: Document content looks like HTML 4.01 Transitional
85 warnings, 2 errors were found!
This document has errors that must be fixed before
using HTML Tidy to generate a tidied up version.
Since we are in 2017, the document is of course written in HTML5 and <nav>
is a perfectly valid tag. Yet Tidy fails to recognize it. I'm running an up-to-date Arch Linux system with JMeter 3.1 r1770033.
How can I use XPath in JMeter for HTML5 websites?
Upvotes: 1
Views: 538
Reputation: 6398
Using Xpath Extractor
:
//input[@id='title_de']/@value
screenshot references:
Xpath Extractor configuration:
Using Regular Expression Extractor
:
input id="title_de" class="string optional" value="(.*?)"
View Results Tree (highlighted the captured value):
Upvotes: 1