2011-06-08 68 views

回答

2

要做到這一點是使用了RemoteWebDriver,這就需要硒服務器運行的最簡單方法。代碼如下所示(警告:未經測試的代碼)。

// Assumes the Selenium server is running on port 4444 on localhost. 
// Note that the Opera() method of the DesiredCapabilities class is 
// not included in 2.0rc2 (the currently available binary release), 
// but does exist in the trunk. 
IWebDriver driver = new RemoteWebDriver("http://localhost:4444/wd/hub", DesiredCapabilities.Opera()); 
相關問題