Slow interaction with Android apps - possible solution

Mobile Testing, Android App Testing.
User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Slow interaction with Android apps - possible solution

Post by odklizec » Thu Mar 07, 2019 3:28 pm

Hi guys,

I've recently started automating Android apps and I was shocked about the speed (slowness) of interaction with instrumented apps via spy and overall speed of playback. A simple test consisting of login, few touches and validations here or there and logout took about 18-20m! Plus it was incredibly slow to interact with the app UI, via Spy. Just today, I found an old post discussing similar issue. And sure enough, disabling "Full image comparison" in instrumentation settings helped also in my case! The same test now finished in 1.8-1.9m and interaction with UI via Spy is smooth, like working with desktop/web apps. I can finally track elements, without 30s or longer delays, between clicks in mobile app UI tree :D
FullImageComparison.png
You do not have the required permissions to view the files attached to this post.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

dugovic.milan
Posts: 68
Joined: Wed Jun 29, 2016 1:19 pm
Location: Frankfurt, Germany
Contact:

Re: Slow interaction with Android apps - possible solution

Post by dugovic.milan » Mon Mar 11, 2019 9:01 am

You are most likely aware of this, but when you run your tests over WiFi, not via USB it also speeds up you test execution. But anyhow, thanks for the hint. Much appreciated!
Ranorex Explorer @DVAG
Support my Ranorex Ideas & Improvements
My current approach: Ranorex 9.2.0

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Slow interaction with Android apps - possible solution

Post by odklizec » Mon Mar 11, 2019 9:49 am

Hi Milan,

Yes, I'm aware that wifi is supposed to be faster. However, it was not helpful in this particular case. It appears that if the instrumented app features camera functionality, this instrumentation flag dramatically slows the Ranorex/AUT interaction performance.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

mafi
Posts: 21
Joined: Thu Mar 21, 2019 2:43 pm

Re: Slow interaction with Android apps - possible solution

Post by mafi » Thu Aug 01, 2019 4:02 pm

Hi,
I faced the same problem at my side as well, but that setting didn't help me so much.
It is true the Spy performances improved, but test running is still slow finding elements.
Perhaps it is just my feeling, but I think the speed gets worst elapsing time. I mean, the same object that searched at the beginning of the test can be found in some seconds, at the end of the test cannot be found at all. It seems that some kind of buffer overflows...
Anyone has the same problem?
Any suggestions?

mafi
Posts: 21
Joined: Thu Mar 21, 2019 2:43 pm

Re: Slow interaction with Android apps - possible solution

Post by mafi » Fri Aug 02, 2019 1:13 pm

I tried also to disable screenshots and Android OS automation options from plugin settings of solution, but nothing: speed slightly improves, but TS cannot finish, because latest test cases fail finding elements that at the beginning of the TS can be successfully found.
I also noticed that, trying to spy the device once failed TS, I can see the device, but no children in it.
I tried to refresh the connection during the test (Ranorex.Core.Remoting.RemoteServiceLocator.Service.GetByDisplayName(DeviceName).Reconnect(); and Ranorex.Core.Remoting.RemoteServiceLocator.Service.Refresh();) but it didn't help.
I do not know what's the problem; the main goal would be end the whole test suite and then increase performance if possible.
Is there anyone who can help with some suggestions?
Thanks.

sstrand72
Posts: 11
Joined: Thu May 30, 2019 3:38 pm

Re: Slow interaction with Android apps - possible solution

Post by sstrand72 » Wed Sep 09, 2020 4:38 pm

I also am having issues with this. I have disabled web testing and full image comparison, along with always running over Wifi. But we are seeing it take a long time to identify elements on the screen. I also see a post about whitelisting the application in Ranorex to improve performance, however, it does not appear to apply to APKs on Mobile Devices/Tablets.

Any suggestions around this would be extremely helpful. Our tests can run for days and saving time is of the essence for us.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Slow interaction with Android apps - possible solution

Post by odklizec » Fri Sep 11, 2020 7:13 am

Hi,

I'm afraid, it's impossible to suggest anything reliable without seeing the app under test. So I think you will have to contact directly Ranorex support about this? They will, of course need access to the apk.

The best I can suggest (without seeing, at very least, a Ranorex snapshot of the apk and example of slow xpath) is to improve the xpaths? I guess you will have to make the xpaths a bit more precise?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration