Saturday, 8 March 2014

Run tests on specific Firefox version | Selenium



Firefox binary lets you run tests on your favorite Firefox versions. Follow the steps below:

1| Install multiple versions of Firefox in your PC.
2| Make sure the installed Firefox versions on different path locations using Custom installation


import java.io.File;
import org.openqa.selenium.firefox.FirefoxBinary;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;

private WebDriver driver;

FirefoxBinary binary = new FirefoxBinary(new File("C://Program Files//Mozilla Firefox26//firefox.exe"));
FirefoxProfile profile = new FirefoxProfile();  
driver = new FirefoxDriver(binary, profile);



#PYTHON

from selenium.webdriver.firefox.firefox_binary import FirefoxBinary

driver = webdriver.Firefox(firefox_binary=FirefoxBinary("C://Program Files//Mozilla Firefox26//firefox.exe"))

1 comment: