1 - Introduction
Waiting commands permits to wait the display or the disappearance of an element. It is useful when you change view, the load of a new page for example.
2 - List of waiting commands
Command Example Description waitIdle Waits for device idle. Only use in specific cases for web view refresh issues. COMPATIBILITY : UNIVERSAL waitUntilText Waits for a view element with text specified, to become visible on the screen until a specified timeout. If it is not found, an error is thrown. CASE-INSENSITIVE DEFAULT TIMEOUT: 30000 OPTIONAL TIMEOUT COMPATIBILITY : UNIVERSAL waitUntilDesc Waits for a view element with content-desc specified, to become visible on the screen until a specified timeout. If it is not found, an error is thrown. CASE-INSENSITIVE DEFAULT TIMEOUT: 30000 OPTIONAL TIMEOUT COMPATIBILITY : UNIVERSAL waitUntilTextBeforeClick Waits for a view element with text specified, to become visible on the screen and then clicks on it. If false, it waits 10 second max before the error thrown. If true, it waits 2 seconds max. DEFAULT BOOLEAN : FALSE OPTIONAL BOOLEAN COMPATIBILITY : UNIVERSAL waitUntilDescBeforeClick Waits for a view element with content-desc specified, to become visible on the screen and then clicks on it. If false, it waits 10 second max before the error thrown. If true, it waits 2 seconds max. DEFAULT BOOLEAN : FALSE OPTIONAL BOOLEAN CASE-INSENSITIVE COMPATIBILITY : UNIVERSAL waitUntilTextExact Waits for a view element, with the exact text selected, to become visible on the screen until a specified timeout. If it is not found, an error is thrown. CASE-SENSITIVE DEFAULT TIMEOUT: 30000 OPTIONAL TIMEOUT COMPATIBILITY : UNIVERSAL waitUntilTextExactBeforeClick Waits for a view element, with the exact text selected, to become visible on the screen and then clicks on it. If false, it waits 10 second max before the error thrown. If true, it waits 2 seconds max. CASE-SENSITIVE DEFAULT BOOLEAN : FALSE OPTIONAL BOOLEAN COMPATIBILITY : UNIVERSAL waitUntilDescExact Waits for a view element, with the exact content-desc selected, to become visible on the screen until a specified timeout. If it is not found, an error is thrown. CASE-SENSITIVE DEFAULT TIMEOUT: 30000 OPTIONAL TIMEOUT COMPATIBILITY : UNIVERSAL waitUntilDescExactBeforeClick Waits for a view element, with the exact content-desc selected, to become visible on the screen and then clicks on it. If false, it waits 10 second max before the error thrown. If true, it waits 2 seconds max. CASE-SENSITIVE DEFAULT BOOLEAN : FALSE OPTIONAL BOOLEAN COMPATIBILITY : UNIVERSAL waitUntilId Waits for a view element, with the exact id selected, to become visible on the screen until a specified timeout. If is not found, an error is thrown. DEFAULT TIMEOUT: 30000 OPTIONAL TIMEOUT COMPATIBILITY : UNIVERSAL waitUntilIdBeforeClick Waits for a view element, with the exact id selected, to become visible on the screen and then clicks on it. If false, it waits 10 second max before the error thrown. If true, it waits 2 seconds max. DEFAULT BOOLEAN : FALSE OPTIONAL BOOLEAN COMPATIBILITY : UNIVERSAL waitUntilGoneId Waits until there is no view element, with the exact id selected, visible on the screen until a specified timeout. If it is still found, an error is thrown. DEFAULT TIMEOUT: 30000 OPTIONAL TIMEOUT COMPATIBILITY : UNIVERSAL waitUntilGoneText Waits until there is no view element, with text selected, visible on the screen until a specified timeout. If it is still found, an error is thrown. CASE-INSENSITIVE DEFAULT TIMEOUT: 30000 OPTIONAL TIMEOUT COMPATIBILITY : UNIVERSAL waitUntilGoneTextExact Waits until there is no view element, with the exact text selected, visible on the screen until a specified timeout. If it is still found, an error is thrown. CASE-SENSITIVE DEFAULT TIMEOUT: 30000 OPTIONAL TIMEOUT COMPATIBILITY : UNIVERSAL waitUntilGoneDesc Waits until there is no view element, with content-desc selected, visible on the screen until a specified timeout. If it is still found, an error is thrown. CASE-INSENSITIVE DEFAULT TIMEOUT: 30000 OPTIONAL TIMEOUT COMPATIBILITY : UNIVERSAL waitUntilGoneDescExact Waits until there is no view element, with content-desc selected, visible on the screen until a specified timeout. If it is still found, an error is thrown. CASE-SENSITIVE DEFAULT TIMEOUT: 30000 OPTIONAL TIMEOUT COMPATIBILITY : UNIVERSAL waitUntilGoneClass Waits until there is no view element, with class selected, visible on the screen until a specified timeout. If it is still found, an error is thrown. DEFAULT TIMEOUT: 30000 OPTIONAL TIMEOUT COMPATIBILITY : UNIVERSAL waitUntilWindowUpdate Waits for a window content update event to occur. The specified window package name can be null. If null, a window update from any front-end window will end the wait. COMPATIBILITY : UNIVERSAL Wait Object
waitUntilText,[TEXT]
waitUntilText,[TEXT],[TIMEOUT]
waitUntilDesc,[DESC]
waitUntilDesc,[DESC],[TIMEOUT]
waitUntilTextBeforeClick,[TEXT]
= waitUntilTextBeforeClick,[TEXT],false
waitUntilDescBeforeClick,[DESC]
= waitUntilDescBeforeClick,[DESC],false
waitUntilTextExact,[EXACT-TEXT]
waitUntilTextExact,[EXACT-TEXT],[TIMEOUT]
waitUntilTextExactBeforeClick,[EXACT-TEXT]
= waitUntilTextExactBeforeClick,[EXACT-TEXT],false
waitUntilDescExact,[EXACT-DESC]
waitUntilDescExact,[EXACT-DESC],[TIMEOUT]
waitUntilDescExactBeforeClick,[EXACT-DESC]
= waitUntilDescExactBeforeClick,[EXACT-DESC],false
waitUntilId,[ID]
waitUntilId,[ID],[TIMEOUT]
waitUntilIdBeforeClick,[ID]
=waitUntilIdBeforeClick,[ID],false
waitUntilIdBeforeClick,[ID],true
waitUntilGoneId,[ID]
waitUntilGoneId,[ID],[TIMEOUT]
waitUntilGoneText,[TEXT]
waitUntilGoneText,[TEXT],[TIMEOUT]
waitUntilGoneTextExact,[EXACT-TEXT]
waitUntilGoneTextExact,[EXACT-TEXT],[TIMEOUT]
waitUntilGoneDesc,[DESC]
waitUntilGoneDesc,[DESC],[TIMEOUT]
waitUntilGoneDescExact,[EXACT-DESC]
waitUntilGoneDescExact,[EXACT-DESC],[TIMEOUT]
waitUntilGoneClass,[CLASS]
waitUntilGoneClass,[CLASS],[TIMEOUT]
waitUntilWindowUpdate,[PACKAGE-NAME]
waitUntilWindowUpdate,null
3 - Use case
Use case 1 : wait the display of an element to click on it
Sometimes there are items that are only present on the first display of a screen. This can be a problem when several tests are run on the same application.
We therefore recommend the use of the following commands: WaitUntilBeforeClick
commands
WaitUntilByTextBeforeClick
WaitUntilByDescBeforeClick
WaitUntilByTextExactBeforeClick
WaitUntilByIdBeforeClick
The second parameter of these methods is an optional Boolean which, if set to true, prevents the test from failing on this instruction even if it's false. The default value of this parameter is false.
This test will fail if "OK" is not found: waitUntilByTextBeforeClick,OK
This test continues on the next instruction if "OK" is not found: waitUntilByTextBeforeClick,OK,true
Use case 2 : wait the disappearance of an element
It is possible that the element expected in the display is also present in the page before loading. It is possible to wait for a view to disappear using waitUntilGone.