13

How to maintain automation framework for different browsers like IE and FF?

In my current set up, I maintain two different configuration properties files, one with xpath locators that FF supports and one with DOM values mostly for IE.

What I tried to do is switch between the Properties files so as to support the respective browsers when running , Is there a better way?

2 Answers 2

7

We use selenium 2 and have recently started testing IE in addition to firefox, and there were a lot of problems that came up while trying to test IE. Mainly, we used xpath to define just about everything. For firefox this seemed to work fine. But there was something about the way IE and selenium used xpaths that never really worked for us. Our first big task was to go through all of our tests and use xpath as little as possible. Almost always there was a simple way to change it to check for an id or a class_name. I don't see how the DOM values you use for IE do not work for firefox as well, could you perhaps elaborate?

3
  • Hi Jaison, We mainly have most of the test cases made to run on Firefox only and started working with IE recently. As we found that IE doesnt support Xpath much , we started developing only DOM locators for IE and keep them separate. R u suggesting to use DOM values for both IE and FF . Is that the best practice? Commented May 9, 2011 at 17:03
  • In my experience if it works in IE it will work in firefox. As such, in order to not have two sets of commands (one for firefox and on for IE), I try to convert to using DOM values consistently. On a side note, xpath is really difficult to use and not have to update for simple changes anyway. Hope that helps, if not let me know.
    – Jason Ward
    Commented May 9, 2011 at 17:53
  • I agree with Jason, I did the same thing when I was maintaining Selenium tests, I scripted it in IE then ran them in FireFox when needed. The was less breakage that way than converting from FF to IE.
    – MichaelF
    Commented May 10, 2011 at 12:07
1

Use CSS Locators as much as possible. They are native and run well on IE. Just consider the IE cannot handle many CSS locator logics.

Here is a list of currently supported CSS locator logics under browsers:

http://msdn.microsoft.com/en-us/library/cc351024(v=vs.85).aspx

And here is a link to currently available CSS locators:

http://www.w3.org/TR/2001/CR-css3-selectors-20011113/#selectors

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.