I’ve been using RobotFramework with its Selenium Library for web automation for quite a while now and have always had the problem of getting any scripts that use XPath run on Internet Explorer.
For some web applications, if they’re not too complex and don’t use a lot of Ajax, you might be able to run scripts that use XPath on Internet Explorer and actually have them finish in this lifetime. But most of the time, they won’t.
However, none of the sites I read told me how to do that. I’ve never used Selenium RC directly, I’ve always used the Selenium Library for/from within RobotFramework, so maybe this is a trivial change in Selenium. But for those of you, like me, who are stuck with a “selenium-server.jar” file, here’s what I had to do:
1. Locate “selenium-server.jar” (For RobotFramework users, this will be located in your Python directory, under \Lib\site-packages\SeleniumLibrary\lib\)
2. Make a copy of it (just in case).
3. Rename it to “selenium-server.zip” and unpack it.
4. Browse the unpacked selenium-server folder and go to \core\scripts\.
5. Edit “selenium-browserbot.js”.
6. Inside the file, search for “ajaxslt”. Depending on the version that you have installed, you should find one of the following lines:
7. Change this line to:
8. Save the file.
9. Archive the folder again into “selenium-server.zip”
10. Rename it back to “selenium-server.jar”
This worked just fine for me and I now get almost the same run times on Internet Explorer and Firefox. Hope it helps!