Quality Testing

Quality is delighting customers

I am using Selenium in JAVA. How to call different browser versions using Selenium

Views: 281

Reply to This

Replies to This Discussion

Hi Shria,

Use this:
setUp("http://change-this-to-the-site-you-are-testing/", "*iexplore C:\Program Files\MultipleIEs\IE7\iexplore.exe");

Hope it will work.

Thanks Kiran, I will try this and let you know.

If you are using WebDriver in combination with TestNg/junit then it is very easy to implement 

for this we just need to write one xml file and we define certain parameter that is used directly in Java WebDriver code that will call respective Browser  simultaneously and this code is very helpful for compatibility testing 

to read this in detail visit this link 


Selenium IDE is only in Firefox Plugin.... You can recorded the Test Script and to run only in Firefox Browser....

Selenium Remote Control used to Running different browser for selenium Script.... Exported the Selenium Script.. Set Up the Selenium RC and Running the Different browser in Selenium..

Selenium Web driver also used for running different browser for selenium Script.....

You can check the tutorials in Selenium RC, Selenium Web driver see and learn the further Details


To use different browsers in selenium (if using Java with TestNG framework), you can create a Setup java file which would be extended in all automation scripts. In that Setup file, you can use 'If/Else' statements to call different browsers under 'BeforeTest' annotation. It's the simplest way being used in any automation testing company these days. Something like this (Selenium 3):


public static WebDriver getWebDriver(String Browser) {

try {

if (Browser.equalsIgnoreCase("firefox"))

{ System.setProperty("webdriver.gecko.driver", "ExeFiles/geckodriver.exe");

return driver = new FirefoxDriver();

else if (Browser.equalsIgnoreCase("Chrome"))

{ System.setProperty("webdriver.chrome.driver", "ExeFiles/chromedriver.exe");

return driver = new ChromeDriver();

else if (Browser.equalsIgnoreCase("IE"))


System.setProperty("webdriver.ie.driver", "ExeFiles/IEDriverServer.exe");

return driver = new InternetExplorerDriver();
} catch (Exception ex) {  }

return driver; }

Hope it helps,.



TTWT Magazine





© 2019   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service