Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

Bad performance when testing an Android React Native application with running animations

Bad performance when testing an Android React Native application with running animations

If you are testing a React Native Android application which involves animations running, this can have a drastic impact on record and replay performance. To understand and resolve this issue, you will need to understand the sync mechanisms in use.

There are two types of synchronization mechanisms active when testing mobile on Android: 

  1. The ‘waitForIdle’ sync of UIAutomator2 (this is running on the Android device)
  1. The Silk Test sync (this is running on the Open Agent)

While the waitForIdle sync waits until no window messages are received any more for a certain amount of time (typically 500ms), the Silk Test sync captures mobile device hierarchies until they do not change anymore (also for a specified amount of time).

Within the React apps where an animation is running, UIAutomator2 waitForIdle sync does not become idle because there are always new window messages (because of the animations). With the capability disableAndroidWaitForIdle=true, you can turn off the waitForIdle sync completely. However, this capability only affects the sync that is running on the Android device. 

To use this functionality, you can set this within your connectionString.  

sConnectionString = “deviceName=Nexus 7;platformName=Android; disableAndroidWaitForIdle=true;app=C:\MyMobileApps\ReactAnimation.apk”

The Silk Test sync would wait by default up to 10 seconds until it gives up and declares a hierarchy as idle. If you change the OPT_SYNC_TIMEOUT, you can only influence the Silk Test sync to become idle earlier.

The recommended approach would be to use the disableAndroidWaitForIdle capability to work-around the UIAutomator2 issue first. This should in theory not lead to any failing tests. In order to speed test runs up, you could play around with the OPT_SYNC_TIMEOUT (i.e. decrease it and check if tests are still running stable).

In some situations, it may require a combination of both the disableAndroidWaitForIdle and Sync Timeout settings.


Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2017-06-27 09:49
Updated by:
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.