How can I quickly check if a xpath is valid in IE? How can I quickly check if a xpath is valid in IE? selenium selenium

How can I quickly check if a xpath is valid in IE?


Use the XPath Visualizer.

This is a popular tool that through the years has taught XPath the fun way to thousands of developers.

You first load an XML file and then can enter any XPath expressions and see the selected nodes immediately hi-lighted in the XML document. There are many more features, even for experienced developers.

The XPath Visualizer can be downloaded here.


This StackOverflow post has some links to techniques for finding XPath in IE.

Finding an elements XPath using IE Developer tool

I particularly like this solution in that post: http://functionaltestautomation.blogspot.com/2008/12/xpath-in-internet-explorer.html

However, to test/verify your XPath, whether found from such tools or you defined it yourself, you may want to do something like this (if you're thinking something similar to what FirePath provides for XPath/CSS validity verification):

http://autumnator.wordpress.com/2013/05/02/testing-xpath-and-css-locators-firepath-style-across-browsers/


As I am knew to xpaths, I am having issues trying to pinpoint the exact xpath I need to click on this element. The process of changing my coded xpath, compiling my C# app, loading the app, running the app, then having Selenium exception out is getting pretty annoying.

I've created SWD Page Recorder for this purpose. It can work with all browsers supported by Selenium WebDriver and allows to debug, test and save locators for further editing.

When you download Page Recorder, please, put the Internet Explorer driver near the executable: IE Driver Download page