Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Does One Indicate the Firefox Profile With RemoteWebDriver

Looking at the Selenium 2.0 (alpha 7) source it appears to be possible to set the Ff profile of the RemoteWebDriver via the capabilities API. Yet it is not clear how one would do it.

Any ideas?

like image 664
Paul R Rogers Avatar asked Dec 16 '22 19:12

Paul R Rogers


2 Answers

FirefoxProfile profile = new FirefoxProfile();

// OR
// FirefoxProfile profile = new FirefoxProfile(new File(...));      

// Init your profile 

// OR
// If you created the profile by providing a path to it,
// the path should refer to the one on the host of the WD server

DesiredCapabilities caps = DesiredCapabilities.firefox();
caps.setCapability(FirefoxDriver.PROFILE, profile);

WebDriver driver = new RemoteWebDriver(new URL("http://<....>:4444/wd/hub"), caps);
like image 176
Sergii Pozharov Avatar answered Dec 22 '22 02:12

Sergii Pozharov


You can assign to each Selenium grid 2 node a specific firefox profile, just set the webdriver.firefox.profile property:

java -jar selenium-server-standalone-2.37.0.jar -Dwebdriver.firefox.profile=my-profile -role node -hub http://mydomain.com:4444/grid/register

  • The value of the webdriver.firefox.profile has to be the firefox profile name, not the location or the folder name

http://automatictester.wordpress.com/2013/04/07/selenium-running-custom-firefox-profile/

like image 32
Andreas Panagiotidis Avatar answered Dec 22 '22 02:12

Andreas Panagiotidis