I want to know how to connect with appium in Windows 10.

6 views
Skip to first unread message

김승환

unread,
Jul 14, 2020, 6:00:43 AM7/14/20
to AltUnity - UI test automation tool for Unity3D
Google Translator

Proceed with the following steps.
An error has occurred and you cannot proceed any further.
Can you guide me through the order to connect with appium?




Step)
1.Open to appium 4728 port.
2. Connect adb devices at the command prompt (cmd).
  1) The device is connected to the PC via USB.
  2) adb tcpip 5001.
  3) Disconnect USB connection between device and PC.
  4) adb connect wifi_ip:5001. (Connect device to adb by WIFI)
3. Write and run python code. (adventure-tests.py)
4. An error occurred.

test_find_element_and_tap (__main__.SampleAppiumTest) ... ERROR

================================================== ====================
ERROR: test_find_element_and_tap (__main__.SampleAppiumTest)
-------------------------------------------------- --------------------
Traceback (most recent call last):
  File "C:\Users\silamon\AppData\Local\Programs\Python\Python37\lib\site-packages\altunityrunner\runner.py", line 31, in __init__
    self.socket.connect((TCP_IP, TCP_PORT))
ConnectionRefusedError: [WinError 10061] Connection failed because the target computer refused the connection

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\test\python_appium_tests_test.py", line 36, in setUp
    self.altdriver = AltrunUnityDriver(self.driver, self.platform)
  File "C:\Users\silamon\AppData\Local\Programs\Python\Python37\lib\site-packages\altunityrunner\runner.py", line 41, in __init__
    self.stop()
  File "C:\Users\silamon\AppData\Local\Programs\Python\Python37\lib\site-packages\altunityrunner\runner.py", line 56, in stop
    self.request_end).execute()
  File "C:\Users\silamon\AppData\Local\Programs\Python\Python37\lib\site-packages\altunityrunner\commands\close_connection.py", line 12, in execute
    data = self.send_data(self.create_command('closeConnection'))
  File "C:\Users\silamon\AppData\Local\Programs\Python\Python37\lib\site-packages\altunityrunner\commands\base_command.py", line 96, in send_data
    self.socket.send(data.encode('utf-8'))
OSError: [WinError 10057] Unable to request to send or receive data because the socket is not connected or the address is not provided when sending to a datagram socket using the Sendto call




In addition, if you do "adb forward tcp:13000 tcp:13000". other socket connections will fail.

2020-07-14 18:58:04.837 | DEBUG | altunityrunner.runner:__init__:33-Get server Version
2020-07-14 18:58:04.847 | DEBUG | altunityrunner.commands.close_connection:execute:13-Sent close connection command...
2020-07-14 18:58:05.848 | DEBUG | altunityrunner.commands.close_connection:execute:16-Socket closed.
2020-07-14 18:58:05.848 | ERROR | altunityrunner.runner:__init__:42-Server is not yet reachable
2020-07-14 18:58:05.848 | WARNING | altunityrunner.runner:__init__:43-Trying to reach AltUnity Server at port 13000, retrying (timing out in 56 secs)...

Dorin Oltean

unread,
Jul 16, 2020, 5:50:20 AM7/16/20
to 김승환, AltUnity - UI test automation tool for Unity3D
Hey,
I managed to run the tests on device over wifi following these steps:

1) The device is connected to the PC via USB.
2) adb tcpip 5001                               # enables adb connection over tcp on port 5001
3) Disconnect USB connection between device and PC.
4) adb connect device_ip:5001         #  connect to device via wifi
5) adb devices                                   # to make sure adb is connected to the device
6) adb forward tcp:13000 tcp:13000  # this will forward all traffic from localhost:13000 to connected_device:13000. needed for AltUnityDriver to connect to the game on device

appium is optional, but if you want to use it
7) Open to appium on default port

8) Write and run python test code  


--
You received this message because you are subscribed to the Google Groups "AltUnity - UI test automation tool for Unity3D" group.
To unsubscribe from this group and stop receiving emails from it, send an email to altunityforu...@altom.com.
To view this discussion on the web visit https://groups.google.com/a/altom.com/d/msgid/altunityforum/80a4e781-f147-4a0b-ad0c-c6f8ee5f6600o%40altom.com.


--

Dorin Oltean

AltWalker Developer @ Altom
Python | Vue.js

Reply all
Reply to author
Forward
0 new messages