I tried to getText() of an element in a specific screen in my app (with a GL rendering), and it takes 10 seconds to get the element’s text .
and when the GL rendering is paused it takes 20ms to get the element’s text.
Do you have any explanation for this ?
Is there something I can do ? (I really need to get the element’s text much quicker)
Thanks !!!
Code
t =self.driver.find_element_by_id(“com.App:id/debugTextView”).text
appium server logs
[HTTP] --> GET /wd/hub/session/7cade58b-3bac-4096-a4be-8fdb94a317ab/element/27/text
[HTTP] {}
[W3C] Calling AppiumDriver.getText() with args: [“27”,“7cade58b-3bac-4096-a4be-8fdb94a317ab”]
[AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“element:getText”,“params”:{“elementId”:“27”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“element:getText”,“params”:{“elementId”:“27”}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: getText
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:“T2T Time: 136ms”}
[AndroidBootstrap] Received command result from bootstrap
[MJSONWP] Responding to client with driver.getText() result: “T2T Time: 136ms”
[HTTP] <-- GET /wd/hub/session/7cade58b-3bac-4096-a4be-8fdb94a317ab/element/27/text 200 10104 ms - 89
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:“T2T Time: 136ms”}
[AndroidBootstrap] Received command result from bootstrap
You have setup longer implicit wait or using both implicit & explicit waits together. Which gives weired results.
You need to follow same good practices from web automation to mobile as well, don’t mix implicit and explicit waits, keep implicit wait to minimal and use custom explicit wait for individual elements.
I am using uiautomator2 and I am experiencing the same issue.
The appium response takes about 10 seconds when a webview is playing a video in the application under test, android. But for the rest, it takes less than 100 ms.