3
如何從.NET框架內的Windows上控制Opera驅動程序https://github.com/operasoftware/operadriver/(甚至Opera瀏覽器本身)?從.NET中控制Opera驅動程序
我的目標是做類似的東西,以Browsershots.org
如何從.NET框架內的Windows上控制Opera驅動程序https://github.com/operasoftware/operadriver/(甚至Opera瀏覽器本身)?從.NET中控制Opera驅動程序
我的目標是做類似的東西,以Browsershots.org
要做到這一點是使用了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());