Anonymous
Anonymous

Reputation: 888

JMeter: How to fetch values of hidden elements

I tried extracting hidden element using CSS/JQuery extractor but that doesnot help.

Can XPath extractor be helpful for following expression:

<input id="hdnBat" type="hidden" value="12345.8">

I have tried using following XPath Query:

//input[@type="hidden" ] [@id="hdnBat"]/@value

but that does not help.

And below is the error in JMeter log:

2016/07/20 13:03:33 ERROR - jmeter.util.XPathUtil: Type=Val=false Tol=false org.xml.sax.SAXParseException; lineNumber: 5; columnNumber: 64; Element type "link" must be followed by either attribute specifications, ">" or "/>".

Upvotes: 0

Views: 317

Answers (1)

Naveen Kumar
Naveen Kumar

Reputation: 50

You Can Use With Normal Jquery or Javascript Using document.getElementById

In Javascript

var result = document.getElementById('hdnBat').val();

In Jquery

var result = $("#hdnBat").val();

You can try this

Upvotes: 0

Related Questions