Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
SEO Metadata
titleSeeTest Automation - Sync Elements


SyncElements (SilentTime, Timeout)

Supported_os
SupportWMobiletrue
SupportIOStrue
SupportSymbiantrue
SupportAndroidtrue
SupportWPtrue
SupportBBtrue

Description

Waits for all the UI elements on the page to be ready. Works on the dump level. Returns true when there are no changes to the elements dump for the specified period of time.

Parameters

  • SilentTime - The period of time for the UI elements to be static (No changes to the dump).
  • Timeout - Waiting Timeout in milliseconds.

Usage

Scenario: In this example, We will use the SyncElements command to wait for all the UI elements in Google Play to load before resuming our script.


Parameters:

  • SilentTime: will be set to 3000 - 3 seconds
  • Timeout: will be set to 10000 - 10 seconds




Result: The script will resume only after all of the UI elements on the page load. If the page takes more than 10 seconds to load the command will timeout and the script will continue.

    

Code Examples

Code Block
languagejava
titleJava Example
linenumberstrue
if(client.syncElements(3000, 10000)){
// If statement
}
Code Block
languagec#
titleC# Example
linenumberstrue
collapsetrue
if(client.SyncElements(3000, 10000))
{
// If statement
}
Code Block
languagevb
titleVBScript Example
linenumberstrue
collapsetrue
If StrComp (client.SyncElements ( 3000, 10000 ), "True") = 0 Then
	Report
	'If statement
Else
	Report
End If
Code Block
languagepy
titlePython Example
linenumberstrue
collapsetrue
if(self.client.syncElements(3000, 10000)):
# If statement
pass
Code Block
languageperl
titlePerl Example
linenumberstrue
collapsetrue
if($client->syncElements(3000, 10000)){
If statement
}