I don't know why following query doesn't work:
//a/@href[@class='specified_string']
XPath uses path expressions to select nodes or node-sets in an XML document. The node is selected by following a path or steps.
XPath assertion uses XPath expression to select the target node and its values. It compares the result of an XPath expression to an expected value. XPath is an XML query language for selecting nodes from an XML. Step 1 − After clicking Add Assertion, select Assertion Category – Property Content.
Try it the other way round:
//a[@class='specified_string']/@href
After all, class
is an attribute of the <a>
element, not an attribute of the href
attribute.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With