I am using page object model. Here is XPath that I have written for Heading of the page and stored it in the heading WebElement variable:
@FindBy( xpath = "//div[@class='page-title category-title']")
private WebElement heading;`
My goal is to get or extract the XPath back from the element heading.
I have tried printing it but the result I am getting is, System.out.println(heading)
gave me:
[[FirefoxDriver: firefox on WINDOWS (4520a9a1-c58b-4b34-ae3e-48613e6e7005)] -> xpath: //div[@class='page-title category-title']]`
And my expectation is :
//div[@class='page-title category-title']
as a string.