How to port Selenium Firefox (IDE) Tests to other Browsers? (windows) How to port Selenium Firefox (IDE) Tests to other Browsers? (windows) selenium selenium

How to port Selenium Firefox (IDE) Tests to other Browsers? (windows)


The best way (and as far as my knowledge, the only way) is to export the Selenium Testcases in the programming language of your choice. Selenium supports - Java, C#, Python, Ruby, PHP and Perl.

Once you export the test cases you can apply your own logic (it's a limitless world atleast we want to believe so) and use drivers for other browsers like IE, Chrome, Opera, even Android etc to run the test in any browser of your choice. There is even a driver to run your test in a headless manner(HTMLUnit).

You can explore thousands of tutorials in this matter and can get started in minutes.

P.S: People might want to edit this answer for better explanation.


The following method can be used to have your test launch other browsers:

    public WebDriver getDriver(String driverName){    WebDriver driver = null;      if( driverName == "firefox")    {       driver = new FirefoxDriver();    }    else if( driverName == "chrome")    {       File chromeFile = new File("C:/webdrivers/chromedriver.exe");       System.setProperty("webdriver.chrome.driver", chromeFile.getAbsolutePath());       driver = new ChromeDriver();    }    else if( driverName == "ie")    {       File ieFile = new File("C:/webdrivers/IEDriverServer.exe");       System.setProperty("webdriver.ie.driver", ieFile.getAbsolutePath());       driver = new InternetExplorerDriver();    }    return driver;}

If you are using TestNG you can define your test method like so:

@Testpublic void verifyElements_FF(){    verifyElements("firefox");}

For launching Chrom and IE you will need to download the drivers and then place them where your test can reach them and change the path to those drivers in the method above.