Search
 
 

Display results as :
 


Rechercher Advanced Search

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

How can I identify Xpath?

View previous topic View next topic Go down

How can I identify Xpath?

Post by Lucas66 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.

Lucas66

Posts : 2
Join date : 2012-07-31

Back to top Go down

Re: How can I identify Xpath?

Post by ashish_gangwar 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.

ashish_gangwar

Posts : 5
Join date : 2012-08-06
Age : 39
Location : Noida

Back to top Go down

Re: How can I identify Xpath?

Post by mattA on Tue Aug 07, 2012 3:01 am

also you can install firepath for firebug and it lists xpaths for you Very Happy

mattA

Posts : 8
Join date : 2012-08-07

Back to top Go down

Re: How can I identify Xpath?

Post by sandeepqa 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.

sandeepqa

Posts : 3
Join date : 2012-08-03

Back to top Go down

Re: How can I identify Xpath?

Post by Lucas66 on Tue Aug 07, 2012 9:49 pm

Thanks so much everyone!

Lucas66

Posts : 2
Join date : 2012-07-31

Back to top Go down

Re: How can I identify Xpath?

Post by Sponsored content Today at 7:16 pm


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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