J
J
Jaco232019-07-28 10:08:02
Android
Jaco23, 2019-07-28 10:08:02

Problem connecting to Appium server running in console via C#. What can be trouble?

5d3d4902649bf289830561.png
The server to the console is working properly. If you enter localhost:port into the browser, then the server responds normally and writes logs to the console. But if you try to hook into it with code, C# throws an error
5d3d495fa680c520677925.png
. At the same time, as I run the desktop version, the same code works fine without failures.
Connection snippet:

DesiredCapabilities cap = new DesiredCapabilities(); // экземпляр класса настроек
cap.SetCapability("deviceName", "device"); // имя девайся (абсолютно любое)
cap.SetCapability("udid", "127.0.0.1:62028");
cap.SetCapability("platformVersion", "5.1.1");// версия платформы (тоже любая)
cap.SetCapability("platformName", "Android");//имя платформы
cap.SetCapability("appPackage", "com.instagram"); // пространство имен используемое приложением
cap.SetCapability("appActivity", "com.instagram"); // активное окно

AndroidDriver<IWebElement> driver = new AndroidDriver<IWebElement>(new Uri("http://0.0.0.0:4543/wd/hub"), cap); // инициализируем экземпляр класса драйвера с настроечками
WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question