Closed dmertins closed 2 years ago
Try to get the logcat output, perhaps it contains more details
@mykola-mokhnach I've included the complete logcat on my first comment.
The logcat output has no any explicit issues. Could you attach the full server log, not just a part of it?
@mykola-mokhnach I've included the complete Appium Server on my first comment.
It looks like the downstream server did respond, but then the Appium server did stuck somewhere. Try to debug the process like it is described in https://nodejs.org/en/docs/guides/debugging-getting-started/ to just see where it is stuck and the actual stack trace
@dmertins can you confirm if it works with the current release version (not the 2.0 beta). This is to rule out issue in current release
@dmertins can you confirm if it works with the current release version (not the 2.0 beta). This is to rule out issue in current release
@rajdeepv it's working as expected on 1.23.0-beta.0, with EspressoDriver version: 1.50.1. The server returns the 404 response to the client with both "espresso" and "compose" subdrivers.
Appium Server log with "espresso" subdriver:
2022-03-02 11:47:13:404 - [HTTP] --> POST /wd/hub/session/c832c907-7a52-4700-bd8a-3cf859f9e079/element
2022-03-02 11:47:13:404 - [HTTP] {"using":"xpath","value":"//*[@text='Non Existent Text']"}
2022-03-02 11:47:13:408 - [W3C (c832c907)] Driver proxy active, passing request on via HTTP proxy
2022-03-02 11:47:13:409 - [debug] [WD Proxy] Matched '/wd/hub/session/c832c907-7a52-4700-bd8a-3cf859f9e079/element' to command name 'findElement'
2022-03-02 11:47:13:409 - [debug] [WD Proxy] Proxying [POST /wd/hub/session/c832c907-7a52-4700-bd8a-3cf859f9e079/element] to [POST http://localhost:8300/session/9416c63e-cd6f-4aab-9884-34e2f6be7259/element] with body: {"using":"xpath","value":"//*[@text='Non Existent Text']"}
2022-03-02 11:47:13:561 - [WD Proxy] Got response with status 404: {"id":"cda018f1-98b5-4688-b42f-21ad360281a8","sessionId":"9416c63e-cd6f-4aab-9884-34e2f6be7259","value":{"error":"no such element","message":"Could not find espresso element with strategy XPATH and selector //*[@text='Non Existent Text']","stacktrace":"io.appium.espressoserver.lib.handlers.exceptions.NoSuchElementException: Could not find espresso element with strategy XPATH and selector //*[@text='Non Existent Text']\n\tat io.appium.espressoserver.lib.handlers.FindElement.handleEspresso(FindElement.kt:39)\n\tat io.appium.espressoserver.lib.handlers.FindElement.handleEspresso(FindElement.kt:27)\n\tat io.appium.espressoserver.lib.handlers.RequestHandler$DefaultImpls.invokeStrategy(RequestHandler.kt:35)\n\tat io.appium.espressoserver.lib.handlers.FindElement.invokeStrategy(FindElement.kt:27)\n\tat io.appium.espressoserver.lib.handlers.FindElement.invokeStrategy(FindElement.kt:27)\n\tat io.appium.espressoserver.lib.handlers.RequestHandler$DefaultImpls.handleInternal(RequestHandler.kt:29)\n\tat io.appium.espre...
2022-03-02 11:47:13:602 - [debug] [W3C] Matched W3C error code 'no such element' to NoSuchElementError
2022-03-02 11:47:13:604 - [HTTP] <-- POST /wd/hub/session/c832c907-7a52-4700-bd8a-3cf859f9e079/element 404 200 ms - 1671
Appium Server log with "compose" subdriver:
2022-03-02 11:52:24:542 - [HTTP] --> POST /wd/hub/session/aa849824-64ce-443f-ae33-97f4e7f39a5c/element
2022-03-02 11:52:24:542 - [HTTP] {"using":"xpath","value":"//*[@text='Non Existent Text']"}
2022-03-02 11:52:24:543 - [W3C (aa849824)] Driver proxy active, passing request on via HTTP proxy
2022-03-02 11:52:24:543 - [debug] [WD Proxy] Matched '/wd/hub/session/aa849824-64ce-443f-ae33-97f4e7f39a5c/element' to command name 'findElement'
2022-03-02 11:52:24:543 - [debug] [WD Proxy] Proxying [POST /wd/hub/session/aa849824-64ce-443f-ae33-97f4e7f39a5c/element] to [POST http://localhost:8300/session/afb51389-ca58-4a7d-a2fc-57f0a1473ac6/element] with body: {"using":"xpath","value":"//*[@text='Non Existent Text']"}
2022-03-02 11:52:24:604 - [WD Proxy] Got response with status 404: {"id":"60415675-2d24-47f1-b7f5-029f2fe7e51e","sessionId":"afb51389-ca58-4a7d-a2fc-57f0a1473ac6","value":{"error":"no such element","message":"Could not find a compose element with strategy 'XPATH' and selector '//*[@text='Non Existent Text']'","stacktrace":"io.appium.espressoserver.lib.handlers.exceptions.NoSuchElementException: Could not find a compose element with strategy 'XPATH' and selector '//*[@text='Non Existent Text']'\n\tat io.appium.espressoserver.lib.handlers.FindElement.handleCompose(FindElement.kt:52)\n\tat io.appium.espressoserver.lib.handlers.FindElement.handleCompose(FindElement.kt:27)\n\tat io.appium.espressoserver.lib.handlers.RequestHandler$DefaultImpls.invokeStrategy(RequestHandler.kt:34)\n\tat io.appium.espressoserver.lib.handlers.FindElement.invokeStrategy(FindElement.kt:27)\n\tat io.appium.espressoserver.lib.handlers.FindElement.invokeStrategy(FindElement.kt:27)\n\tat io.appium.espressoserver.lib.handlers.RequestHandler$DefaultImpls.handleInternal(RequestHandler.kt:29)\n\tat io.appi...
2022-03-02 11:52:24:608 - [debug] [W3C] Matched W3C error code 'no such element' to NoSuchElementError
2022-03-02 11:52:24:608 - [HTTP] <-- POST /wd/hub/session/aa849824-64ce-443f-ae33-97f4e7f39a5c/element 404 66 ms - 1679
@mykola-mokhnach then it seems like something changed in Appium V2.0
I have no idea what that could be. Without debug/stacktrace info I cannot help much
@mykola-mokhnach I'll try to debug the process.
@dmertins were you able to locate the issue? I ran into the same problem.
Just adding an excerpt of my appium log:
Server is running Appium 2.0 (Command line). Request via a Maven, Appium Java 8.0.0, Cucumber and TestNG.
Client Workflow:
Server:
22-03-11 12:48:25:683 - [35m[Appium][39m Welcome to Appium v2.0.0-beta.24 2022-03-11 12:48:25:686 - [35m[Appium][39m Non-default server args: 2022-03-11 12:48:25:688 - [35m[Appium][39m { logTimestamp: [33mtrue[39m, relaxedSecurityEnabled: [33mtrue[39m } 2022-03-11 12:48:25:688 - [35m[Appium][39m Attempting to load driver uiautomator2... 2022-03-11 12:48:26:329 - [35m[Appium][39m Appium REST http interface listener started on 0.0.0.0:4723 2022-03-11 12:48:26:329 - [35m[Appium][39m Available drivers: 2022-03-11 12:48:26:329 - [35m[Appium][39m - uiautomator2@1.75.0 (automationName 'UiAutomator2') 2022-03-11 12:48:26:330 - [35m[Appium][39m No plugins have been installed. Use the "appium plugin" command to install the one(s) you want to use. . . . 2022-03-14 07:09:04:014 - [35m[HTTP][39m [37m-->[39m [37mPOST[39m [37m/session/003cd2c8-53a7-4be5-ab94-7b7e273cf1c0/element[39m 2022-03-14 07:09:04:015 - [35m[HTTP][39m [90m{"using":"xpath","value":"//button[contains(text(),'Accept all cookies')]"}[39m 2022-03-14 07:09:04:015 - [35m[W3C (003cd2c8)][39m Driver proxy active, passing request on via HTTP proxy 2022-03-14 07:09:04:016 - [debug] [35m[WD Proxy][39m Matched '/session/003cd2c8-53a7-4be5-ab94-7b7e273cf1c0/element' to command name 'findElement' 2022-03-14 07:09:04:016 - [debug] [35m[WD Proxy][39m Proxying [POST /session/003cd2c8-53a7-4be5-ab94-7b7e273cf1c0/element] to [POST http://127.0.0.1:8003/wd/hub/session/0d695a16f3e86c195ffa7f135882b506/element] with body: {"using":"xpath","value":"//button[contains(text(),'Accept all cookies')]"} 2022-03-14 07:09:04:045 - [debug] [35m[WD Proxy][39m Got response with status 200: {"value":{"element-6066-11e4-a52e-4f735466cecf":"a8b9d8e3-bca6-4f0e-8b08-2d0f380f8693"}} 2022-03-14 07:09:04:047 - [35m[HTTP][39m [37m<-- POST /session/003cd2c8-53a7-4be5-ab94-7b7e273cf1c0/element [39m[32m200[39m [90m32 ms - 148[39m 2022-03-14 07:09:04:047 - [35m[HTTP][39m [90m[39m 2022-03-14 07:09:04:105 - [35m[HTTP][39m [37m-->[39m [37mPOST[39m [37m/session/003cd2c8-53a7-4be5-ab94-7b7e273cf1c0/element/a8b9d8e3-bca6-4f0e-8b08-2d0f380f8693/click[39m 2022-03-14 07:09:04:106 - [35m[HTTP][39m [90m{"id":"a8b9d8e3-bca6-4f0e-8b08-2d0f380f8693"}[39m 2022-03-14 07:09:04:106 - [35m[W3C (003cd2c8)][39m Driver proxy active, passing request on via HTTP proxy 2022-03-14 07:09:04:108 - [debug] [35m[WD Proxy][39m Matched '/session/003cd2c8-53a7-4be5-ab94-7b7e273cf1c0/element/a8b9d8e3-bca6-4f0e-8b08-2d0f380f8693/click' to command name 'click' 2022-03-14 07:09:04:108 - [debug] [35m[WD Proxy][39m Proxying [POST /session/003cd2c8-53a7-4be5-ab94-7b7e273cf1c0/element/a8b9d8e3-bca6-4f0e-8b08-2d0f380f8693/click] to [POST http://127.0.0.1:8003/wd/hub/session/0d695a16f3e86c195ffa7f135882b506/element/a8b9d8e3-bca6-4f0e-8b08-2d0f380f8693/click] with body: {"id":"a8b9d8e3-bca6-4f0e-8b08-2d0f380f8693"} 2022-03-14 07:09:04:415 - [debug] [35m[WD Proxy][39m Got response with status 200: {"value":null} 2022-03-14 07:09:04:416 - [35m[HTTP][39m [37m<-- POST /session/003cd2c8-53a7-4be5-ab94-7b7e273cf1c0/element/a8b9d8e3-bca6-4f0e-8b08-2d0f380f8693/click [39m[32m200[39m [90m310 ms - 25[39m 2022-03-14 07:09:04:416 - [35m[HTTP][39m [90m[39m 2022-03-14 07:09:04:477 - [35m[HTTP][39m [37m-->[39m [37mPOST[39m [37m/session/003cd2c8-53a7-4be5-ab94-7b7e273cf1c0/element[39m 2022-03-14 07:09:04:477 - [35m[HTTP][39m [90m{"using":"xpath","value":"//button[contains(text(),'Accept all cookies')]"}[39m 2022-03-14 07:09:04:478 - [35m[W3C (003cd2c8)][39m Driver proxy active, passing request on via HTTP proxy 2022-03-14 07:09:04:479 - [debug] [35m[WD Proxy][39m Matched '/session/003cd2c8-53a7-4be5-ab94-7b7e273cf1c0/element' to command name 'findElement' 2022-03-14 07:09:04:479 - [debug] [35m[WD Proxy][39m Proxying [POST /session/003cd2c8-53a7-4be5-ab94-7b7e273cf1c0/element] to [POST http://127.0.0.1:8003/wd/hub/session/0d695a16f3e86c195ffa7f135882b506/element] with body: {"using":"xpath","value":"//button[contains(text(),'Accept all cookies')]"} 2022-03-14 07:09:14:642 - [35m[WD Proxy][39m Got response with status 404: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//button[contains(text(),'Accept all cookies')]\"}\n (Session info: chrome=98.0.4758.101)","stacktrace":"#0 0x55728ef9bb33 <unknown>\n#1 0x55728ea646d8 <unknown>\n#2 0x55728ea9a6f1 <unknown>\n#3 0x55728ea9a8b1 <unknown>\n#4 0x55728eacd574 <unknown>\n#5 0x55728eab808d <unknown>\n#6 0x55728eacb2fb <unknown>\n#7 0x55728eab7f53 <unknown>\n#8 0x55728ea8da0a <unknown>\n#9 0x55728ea8ead5 <unknown>\n#10 0x55728efcd2fd <unknown>\n#11 0x55728efe64bb <unknown>\n#12 0x55728efcf0d5 <unknown>\n#13 0x55728efe7145 <unknown>\n#14 0x55728efc2aaf <unknown>\n#15 0x55728f003ba8 <unknown>\n#16 0x55728f003d28 <unknown>\n#17 0x55728f01e48d <unknown>\n#18 0x7fee40945609 <unknown>\n"}}
@mykola-mokhnach I'm having the same issue with appium-uiautomator2-driver. Here is my log https://gist.github.com/ostap-oleksyn/0d69e1db3cd11fea44b0ee497086dee1 I can provide a sample project with a app where this is reproducible.
@mykola-mokhnach I'm having the same issue with appium-uiautomator2-driver. Here is my log https://gist.github.com/ostap-oleksyn/0d69e1db3cd11fea44b0ee497086dee1 I can provide a sample project with a app where this is reproducible.
It would be nice to have a sample script and target app, where the issue could consistently be reproduced. Please provide these if you can
@mykola-mokhnach is this fix in appium 2.0.0-beta.30?
Yes, although you have to make sure the particular driver depends on @appium/base-driver@8.4.2+
. Perhaps, it would be necessary to reinstall it for this or to wait until https://github.com/appium/appium/issues/16747 is resolved
@dmertins were you able to locate the issue? I ran into the same problem.
I wasnt't able to debug Appium Server and find the problem. But I've tested Appium v2.0.0-beta.35, with espresso@2.2.6 and the issue is not happening anymore.
@mykola-mokhnach I wasn't able to debug Appium Server v2.0.0-beta.25 and check exactly where the application was stuck. But I've tested Appium v2.0.0-beta.35 with espresso@2.3.0 and the problem is not ocurring anymore. I think we can close this issue, in case no one has any objection.
Was fixed for me with Beta 30 👍🏻
Great!
I'm facing an issue when the element I look for is not present on screen. In that scenario, WD Proxy gets a 404 response and it gets stuck. The test client never receives the HTTP response, and the automation session never ends:
I'm using Appium Server v2.0.0-beta.25, Node v16.14.0, espresso@2.0.1 and Appium-Python-Client 2.1.2.
Edit: adding Android logcat and full Appium Server log. Android Logcat:
Full Appium Server log: