如何使用RemoteWebDriver指示Firefox配置文件

Pau*_*ers 4 selenium webdriver selenium-webdriver

查看Selenium 2.0(alpha 7)源代码,似乎可以通过功能API设置RemoteWebDriver的Ff配置文件.但目前尚不清楚如何做到这一点.

有任何想法吗?

Ser*_*rov 9

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);
Run Code Online (Sandbox Code Playgroud)