Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers 2

up vote 4 down vote accepted

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?

share|improve this answer
    
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? –  Rakesh Prabhakaran May 9 '11 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 May 9 '11 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 May 10 '11 at 12:07
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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