DesiredCapabilities capabilities = DesiredCapabilities.InternetExplorer();
System.Environment.SetEnvironmentVariable("webdriver.ie.driver", @"C:\\IEDriverServer.exe");
instance = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), capabilities);
我也有一個系統變量設置,並且IEDriverServer
是在系統路徑中。我無法從命令行運行IEDriver(這讓我想到路徑配置有些問題,或者有些安全限制)Selenium 2.0遠程網絡驅動程序無法啓動IEDriver與C#
請注意,集線器和節點是同一臺機器。
當我執行的測試中,我得到:
"System.InvalidOperationException:
The path to the driver executable must be set by the webdriver.ie.driver system property; for m....."![enter image description here][1]
我跑這個一體機既充當樞紐和節點只是爲了讓一個概念證明它會爲我工作。
嗨吉姆,謝謝你的回答。 是的,這是C#綁定,我在一臺機器上運行所有東西,只是爲了證明它對我有用。 – 2014-10-28 12:11:07