Open aksh-02 opened 5 months ago
02-02 12:50:10.574 3339 3708 I appium : Waiting up to 3000ms for the device to idle 02-02 12:50:13.602 3339 3708 I appium : The following attributes will be included to the page source: [text] 02-02 12:50:28.535 3339 3708 I appium : Took 1ms to retrieve 1 matches for '//*[@text='All']' XPath query
Most likely this is an idling issue. You see the above wait times out after 3 seconds, which means the main UI thread is still busy. This is easy to validate if you just terminate the application under test and try to perform the lookup on any other system or third-party app control to make sure it is fast enough.
02-02 12:50:28.535 3339 3708 I appium : Took 1ms to retrieve 1 matches for '//*[https://github.com/text='All']' XPath query
This is the log for the internal xpath lookup performance, although it does not log how much time it takes to build the XML from the actual accessibility layer.
This is the log for the internal xpath lookup performance, although it does not log how much time it takes to build the XML from the actual accessibility layer.
right that's why I think the time is being taken here
try (InputStream xmlStream = toStream(true)) {
final Document document = SAX_BUILDER.build(xmlStream);
You see the above wait times out after 3 seconds, which means the main UI thread is still busy.
What can be done to optimize this. Also for more context, this seems to be working fine on a real device but is too slow on an emulator
although it does not log how much time it takes to build the XML from the actual accessibility layer.
would this also get affected by the UI thread being busy. Also, In that case should we not be seeing ANR errors.
We're using appium v1.21.0 for android app testing. Intermittently we notice find element commands taking ~20 seconds. We've reduced waitForIdleTimeout and that didn't reduce the time significantly. On debugging further through adb logcat logs
From these logs, I see the time is being taken in this part of the code
So It might be either
toStream
orSAX_BUILDER.build
functions, but I'm not able to debug any further because of no Info logs there (wasn't able to change log-level to debug either)Initially I though, since this was happening intermittently this might be a resource crunch issue, But I didn't see any such crunch while monitoring host or adb shell metrics.
This is my session create request body