Skip to content
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
@lukeis

Description

@lukeis

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions