This repository was archived by the owner on Nov 29, 2018. It is now read-only.
This repository was archived by the owner on Nov 29, 2018. It is now read-only.
How to extract xpath of a Webelement #5520
Closed
Description
Originally reported on Google Code with ID 5520
How can i get the xpath of a WebElement
Webelement element= driver.findElement(By.name("q"));
something like
element.getAbsoluteXpath(); ->> this should be like this ".//div//input[@name='q']"
element.getRelativeXpath(); ->> this should be like this "html/body/div/input..."
how to do the same
Reported by susanth.nair
on 2013-04-18 06:46:01