question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Errors running Appium-python pytest, mainly urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=4723): Max retries exceeded with url: /wd/hub/session : Failed to establish a new connection:

See original GitHub issue

The problem

Initially, my scripts are stuck in line :

self.driver = webdriver.Remote('http://{}:{}/wd/hub'.format(self.appium_ip_address,
                                                               self.appium_port),
                                       desired_capabilities=desired_caps)

Sometimes, it works, and most of the time, Appium desktop succeed in conncting the application, but occasionnaly, Appium desktop says he cannot connect because the app crashed, please see logcat (but the app doesn’t launch, for two different apps).

Anyway, this makes me suspect a problem with appium, and I decided to control installation tests (here) and I got a 17 errors, 4 failed, which is not so good for 21 tests.

Environment

  • Appium version (or git revision) that exhibits the issue: 1.17.1
  • Last Appium version that did not exhibit the issue (if applicable):
  • Desktop OS/version used to run Appium: windows 10/ Anaconda distrib/python 3.7.7
  • Node.js version (unless using Appium.app|exe): 12.16.3
  • Npm or Yarn package manager: npm 6.14.4
  • Mobile platform/version under test: android 10, nexus 5, api 29
  • Real device or emulator/simulator: emu
  • Appium CLI or Appium.app|exe:

Details

As most of the log lines refers to errors in urllib3, I tried to upgrade urllib3, but this makes no difference in the result of the test.

I also tried to run the test with and without a emulator running, without difference

Anyway, I would thank you to help me understand what is wrong with my configuration, and help me succeed in running these tests successfully.

Link to Appium logs

Full log is attached log_test.txt

Code To Reproduce Issue [ Good To Have ]

sample code from appium github

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
mykola-mokhnachcommented, May 10, 2020

The log is very messy and big, although I don’t observe any server issues there. All the errors are expected reactions to valid issues, which must be fixed on the client side.

1reaction
shibupandacommented, May 10, 2020

@jeromedejaegher Is this the latest logs you have as I have seen many errors regarding configuration. Let me point out those.

[W3C] Encountered internal error running command: Error: Could not find a connected Android device in 21705ms.

Looks like device is not dected in adb.

2020-05-09 23:52:09:126 [HTTP] <-- DELETE /wd/hub/session/a8dfb2fc-6bd3-455b-9d5d-111ef45b15fd 200 208 ms - 14 2020-05-09 23:52:09:128 [HTTP] 2020-05-09 23:52:09:254 [Instrumentation] Time: 4.064 2020-05-09 23:52:09:255 [Instrumentation] 2020-05-09 23:52:09:255 [Instrumentation] OK (1 test) 2020-05-09 23:52:09:281 [Instrumentation] The process has exited with code 0 2020-05-09 23:52:14:123 [HTTP] --> GET /wd/hub/session/a8dfb2fc-6bd3-455b-9d5d-111ef45b15fd/title 2020-05-09 23:52:14:125 [HTTP] {} 2020-05-09 23:52:14:130 [W3C (a8dfb2fc)] Encountered internal error running command: NoSuchDriverError: A session is either terminated or not

You are trying to get the title after delete the session. You should initiate the driver again.

[Chromedriver] Error: No Chromedriver found that can automate Chrome ‘58.0.3029’

Please use compatible version chrome driver.

[Xcode] Could not find path to Xcode by symlinks located in /var/db/xcode_select_link, or /usr/share/xcode-select/xcode_dir_link

Looks like xocode is not selected use xcode-select to select the required xcode version

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found