I have an Internet Explorer only web application.
I’m exploring what we can do to automate the testing.
Selenium looks like a good tool, but to be able to activate links etc. I need to tell it where they are. The application wasn’t built with this kind of testing in mind, so there generally aren’t id attributes on the key elements.
No problem, I think, I can use XPath expressions. But finding the correct XPath for, say, a button, is a royal pain if done by inspecting the source of the page.
With Firefox / Firebug, I can select the element then use ‘Copy XPath’ to get the expression.
I have the IE Developer Toolbar and it’s frustratingly close. I can click to select the element of interest and display all sorts of information about it. but I can’t see any convenient way of determining the XPath for it.
So is there any way of doing this with IE?
I would use bookmarklets. I have one XPath related, but I don’t know if it works in IE. I gotta go but I will test it and give it if it works on IE.
Two bookmarklet sites for Web developers from my bookmarks: Subsimple’s bookmarklets and Squarefree’s Bookmarklets. Lot of useful things there…
[EDIT] OK, I am back. The bookmarklet I had was for FF only, and wasn’t optimal. I finally rewrote it, although using ideas from the original one. Can’t find back where I found it.
Expanded JS:
You have to select the element and activate the bookmarklet to get its XPath.
Now, the bookmarklet versions (thanks to Bookmarklet Builder):
IE
(I had to break it in two parts, because IE doesn’t like very long bookmarklets (max size varies depending on IE versions!). You have to activate the first one (function def) then the second one. Tested with IE6.)
FF