Open TripleG opened 1 year ago
org.asynchttpclient.netty.request.NettyRequestSender
do you mean the Java client's timeout behavior to wait for the response by Appium? Maybe https://discuss.appium.io/ helps to ask such general questionsAfter pulling my hair for hours I found the problem, but I have no logical explanation for it.
I put a breakpoint and paused the test before the click()
and I decided to try send the click
request with Postman.
Here is what I found out:
This works
POST 127.0.0.1:4723/session/793894ad-6acc-4005-bdc0-84682a231d7f/element/eyJmaW5kZXJUeXBlIjoiQnlWYWx1ZUtleSIsImtleVZhbHVlVHlwZSI6IlN0cmluZyIsImtleVZhbHVlU3RyaW5nIjoibG9nSW5CdXR0b25LZXkifQ%3D%3D/click
This does not work(it hangs as described)
POST 127.0.0.1:4723/session/793894ad-6acc-4005-bdc0-84682a231d7f/element/eyJrZXlWYWx1ZVR5cGUiOiJTdHJpbmciLCJrZXlWYWx1ZVN0cmluZyI6ImxvZ2luQnV0dG9uS2V5IiwiZmluZGVyVHlwZSI6IkJ5VmFsdWVLZXkifQ%3D%3D/click
The difference between the two requests is the element_id
part.
Decoded values from Base64:
Working - {"finderType":"ByValueKey","keyValueType":"String","keyValueString":"logInButtonKey"}
Hanging - {"keyValueType":"String","keyValueString":"loginButtonKey","finderType":"ByValueKey"}
The attributes and values are exactly the same, but they are in different order.
I cannot even think of a reason why parsing a JSON would cause hanging/issue because of specific attributes order. Looks like a bug to me, but I am not sure where to open it.
@KazuCocoa Any thoughts and suggestions?
interesting... then potentially https://github.com/ashwithpoojary98/javaflutterfinder/blob/master/src/main/java/io/github/ashwith/flutter/FlutterFinder.java#L29-L48 ?
https://github.com/search?q=repo%3Aappium%2Fappium-flutter-driver%20keyValueType&type=code is possible relevant code in this repository.
Then, what about eyJmaW5kZXJUeXBlIjoiQnlWYWx1ZUtleSIsImtleVZhbHVlU3RyaW5nIjoibG9nSW5CdXR0b25LZXkiLCJrZXlWYWx1ZVR5cGUiOiJTdHJpbmcifQ==
? (eyJmaW5kZXJUeXBlIjoiQnlWYWx1ZUtleSIsImtleVZhbHVlU3RyaW5nIjoibG9nSW5CdXR0b25LZXkiLCJrZXlWYWx1ZVR5cGUiOiJTdHJpbmcifQ%3D%3D
as url encoded)
{"finderType":"ByValueKey","keyValueString":"logInButtonKey","keyValueType":"String"}
. This order is currently this driver's repository's generated base 64
@KazuCocoa I just noticed that the attribute values are not the same. "keyValueString":"logInButtonKey"
vs "keyValueString":"loginButtonKey"
. Notice the lower case i
in login
. So, this was the problem, not the attributes order.
BUT, another question arises - why the Flutter driver doesn't throw element not found
, but hangs instead. Do you have any idea if I need to set some parameters to the appium server, or some options to give it timeout for searching for the element or something?
I tried to use uiAutomator2
just for the experiment and it returns 404 not found element after ~10 seconds. But the flutter driver just hangs if the element doesn't exist...
Hey guys, I also faced with this problem... flutter driver stuck on executing any command on Dart VM side.... I assume that something wrong on Dart VM side but don't know how to get it's logs or any other helpful information
why the Flutter driver doesn't throw element not found, but hangs instead
This is because the current (original) implementation waits for the response by the DartVM, that's it. It looks like the original implementation's base design.
So like https://github.com/appium/appium-flutter-driver/issues/430 , each request perhaps can have timeout to the Dart VM to respond like no such element error in case no response by the Dart VM by the timeout. I'm not sure then also the Dart VM can accept another new request (e.g. the previous command blocks some Dart VM procedure), but maybe such timeout can be added. (PRs are welcome)
@TripleG check your locator value.
I have a very simple experimental test for Flutter driver. I just want to try to click an element in a flutter app. I am using
https://github.com/ashwithpoojary98/javaflutterfinder
as Java client for flutter elements:I am running the test on a physical device. The application is started successfully, but the
click()
command hangs without any response and I wait 600 seconds until the HTTP client throws timeout exception:Here is the full appium log:
The interesting part of the log:
The
click
command is sent successfully, it looks good. The locator is 100% correct. But after the HTTP client timeout, theDELETE
command is sent, because of the@AfterMethod
cleanup.I have few questions in general:
click
command hangs - it doesn't throw "not found element", nor "unable to click" or something. It just hangs.keep-alive
nornewCommandTimeout
timeouts stop the execution? I need to wait600
seconds for the HTTP client timeout. Is there a way to configure smaller timeout of theorg.asynchttpclient.netty.request.NettyRequestSender
?