Share
Go down
Lucas66
Posts : 2
Join date : 2012-07-31

How can I identify Xpath?

on Sat Aug 04, 2012 2:04 am
I just started with Selenium. In QTP we can use SPY to identify an object in browser such as button, table, radio, edit field, weblist, etc… I do not know what we can use in Selenium to identify (or locate) Xpath (e.g. driver.findElement(By.xpath("//div[@id='contentContainer']/map/area[2]")).click()Wink. Can anyone tell me? Thanks in advance.
ashish_gangwar
Posts : 5
Join date : 2012-08-06
Age : 40
Location : Noida

Re: How can I identify Xpath?

on Mon Aug 06, 2012 5:30 pm
Following 2 ways you can use.
1. Install a "add on" "FireBug" to your Firefox Mozilla browser then after launching the URL you can do InspectElement.
2. Open Selenium IDE and go to recording mode with the correct URL in its "Base URL". Launch the application (under testing) then manually click on the objects you want to get xPath of. Stop the recording. In IDE, select the line for the object and then see the list of properties (xPath, ID etc.) from the dropdown list of the "Target list".

Please let me know if you have any difficulty in doing so.
mattA
Posts : 8
Join date : 2012-08-07

Re: How can I identify Xpath?

on Tue Aug 07, 2012 3:01 am
also you can install firepath for firebug and it lists xpaths for you Very Happy
avatar
sandeepqa
Posts : 3
Join date : 2012-08-03

Re: How can I identify Xpath?

on Tue Aug 07, 2012 5:41 pm
XPath generator, editor, inspector and simple extraction tool. Since FF3, it requires DOM inspector plug-in .
•URL to Add:
addons.mozilla.org/en-US/firefox/addon/1192
–Click Add to Firefox
–Select XPather and Press Install Now button
–Press Restart Firefox Now button.
Lucas66
Posts : 2
Join date : 2012-07-31

Re: How can I identify Xpath?

on Tue Aug 07, 2012 9:49 pm
Thanks so much everyone!
Sponsored content

Re: How can I identify Xpath?

Back to top
Permissions in this forum:
You cannot reply to topics in this forum