Reputation: 195
I have web app under tests. And I need to test it from Lunix and Windows with firefox 5 only. So, how can I set particular firefox version in New FirefoxDriver() that Firefox 5 runs only, not Firefox 6 or 9? I don't want to set path to firefox because it's not useful approach when we have several OS.
Upvotes: 3
Views: 2921
Reputation: 5667
Create one firefox 5 profile and just give the name of that profile below. It will launch the given profile browser.
FirefoxProfile profile = new ProfilesIni().getProfile(profileName);
DesiredCapabilities dc = DesiredCapabilities.firefox();
dc.setCapability(FirefoxDriver.PROFILE, profile);
driver = new FirefoxDriver(dc);
refer this link to know how to create firefox profile.
Upvotes: 2