问题描述
我在Mac上安装了Appium和Xcode,并尝试从Windows VM上的Visual Studio运行代码,但到目前为止没有成功. Mac上"Appium的常规设置"中的服务器地址和端口与AppiumServers.cs类(127.0.0.1:4723)中的服务器地址和端口相同.请协助.可以预期,我得到的错误如下.
I installed Appium and Xcode on my mac and trying to run code from Visual Studio on Windows VM, but to no success so far. Server's address and port in General Settings of the Appium on Mac are the same as in AppiumServers.cs class (127.0.0.1:4723). Please assist.The error that I get, as to be expected, is below.
SetUp : OpenQA.Selenium.WebDriverException : 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:4723
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, 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)
推荐答案
我认为我做到了.问题出在IP地址上. 127.0.0.1是本地的.我需要更改试图连接到Macbook Pro IP的IP地址.
I think I managed. The problem was with the IP address. 127.0.0.1 is local. I needed to change the IP address I was trying to connect to the IP of the Macbook Pro.
这篇关于使用C#/Visual Studio的Appium iOS自动化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!