在 W2k8 64 位,我在 android 4.1 API 级别 16 的 android 模拟器实例中使用 ARM 作为 CPU。启动它后,我正在运行我的 UnitTest 并在第一行
var webDriver = new AndroidDriver("http://localhost:8080/wd/hub"); //also with no argument
我有一个例外:
Unexpected error. System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:8080
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()
at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
此 WebDriver 的版本是 2.25.1.0。
我关注了这篇文章:
http://www.nishantverma.com/2011/06/installing-webdriver-on-android.html
当我使用 Firefox 或 ChromeDriver 等其他驱动程序时工作正常。
我将不胜感激任何建议