How to set timeout for chromedriver Appium

0

I am using python-appium client for my hybrid android application, how I can set timeout for exceptions, like NoSuchElement exception and etc., because if I switch to WebView and there is exception Appium python client don’t raise exception and just infinity wait.

Appium logs:

[AndroidUiautomator2Driver@15f5 (2ed5ae5d)] Driver proxy active, passing request on via HTTP proxy [debug] [WD Proxy] Matched ‘/session/2ed5ae5d-e315-4ddc-a9a4-531d750fb59e/element’ to command name ‘findElement’ [debug] [WD Proxy] Proxying [POST /session/2ed5ae5d-e315-4ddc-a9a4-531d750fb59e/element] to [POST http://127.0.0.1:8000/session/11911a8ab974feacce5cf9e170e22ee2/element] with body: {“using”:“xpath”,“value”:"// [@class=“css-18v40m9 3”]"} [WD Proxy] Got response with status 404: {“value”:{“error”:“no such element”,“message”:“no such element: Unable to locate element: {“method”:“xpath”,“selector”:”// [@class=“css-18v40m9 3”]"}\n (Session info: chrome=91.0.4472.114)",“stacktrace”:"0 chromedriver_mac64_v91.0.4472.101 0x0000000100e52649 chromedriver_mac64_v91.0.4472.101 + 2741833\n1 chromedriver_mac64_v91.0.4472.101 0x0000000101508fb3 chromedriver_mac64_v91.0.4472.101 + 9781171\n2 chromedriver_mac64_v91.0.4472.101 0x0000000100bdf308 chromedriver_mac64_v91.0.4472.101 + 172808\n3 chromedriver_mac64_v91.0.4472.101 0x0000000100c1341b chromedriver_mac64_v91.0.4472.101 + 386075\n4 chromedriver_mac64_v91.0.4472.101 0x0000000100c440c4 chromedriver_mac64_v91.0.4472.101 + 585924\n5 chromedriver_mac64_v91.0.4472.101 0x0000000100c3059d chromedriver_mac64_v91.0.4472.101 + 505245\n6 chromedriver_mac64_v91.0.4472.101 0x0000000100c41e94 chromedriver_mac64_v91.0.4472.101 + 577172\n7 chromedriver_mac64_v91.0.4472.101 0x0000000100c30863 chromedriver_mac64_v91.0…

And nothing happen there are no raised exception…

This is because of a known bug in the driver. Please update it and make sure the version of @appium/base-driver component it depends on is above 8.5.0

Thank you! 20 characters 20 characters