Reputation: 331
I want to run my tests on diff versions of Firefox installed on my machine by mentioning the respective versions, I read this link https://stackoverflow.com/questions/12596097/how-to-set-particular-firefox-version-in-selenium-webdriver
, but i dont want to create profiles manually and pass the same, is their any way on the run time to decide which version to pick??
Upvotes: 3
Views: 2801
Reputation: 11776
And for those using python use FirefoxBinary
Specify path to firefox binary using FirefoxBinary:
from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
browser = webdriver.Firefox(firefox_binary=FirefoxBinary('path goes here'))
Hope it helps someone :)
Upvotes: 0
Reputation: 14748
Try using FirefoxBinary
class when setting up the WebDriver.
For example: I assume you have FF 15 installed in C:\testing\ff15\firefox.exe
Then, before setting up the webDriver do this:
File pathToBinary = new File("C:\\testing\\ff15\\firefox.exe");
FirefoxBinary binary = new FirefoxBinary(pathToBinary);
FirefoxDriver driver = new FirefoxDriver(binary, new FirefoxProfile());
I never tried it, but I think it should work
Upvotes: 4