Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am evaluating using Selenium to perform automated testing of my company's Asp.net Webforms application. Since most of the html ids are auto-generated I am trying to rely on xpaths to be able to interact with my page.

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 need to find some way to quickly determine if an xpath is valid (i.e. exists) or not.

Unfortunately, they coded this site to only work in IE, so that is all i have access to.

If someone has a good quick way for me to test an xpath out in IE, I would be very grateful!

like image 953
KallDrexx Avatar asked Dec 14 '10 18:12

KallDrexx


People also ask

How do I check if XPath is correct in IE?

Here we would base our discussion to check the validity of the created XPath in Chrome's Developer tool. Step #1: For creating XPath in Developer tool, open the console tab. Step #3: Press the enter key to see all the matching HTML elements with the specified Xpath. In our case, there is only one matching HTML element.

Does Internet Explorer support XPath?

Selenium Webdriver – IE DriverIE doesn't have a native XPath engine for finding elements.


1 Answers

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.

like image 158
Dimitre Novatchev Avatar answered Sep 17 '22 14:09

Dimitre Novatchev