Silk Mobile

Table of Contents (Homepage)

WaitForElementToVanish

WaitForElementToVanish(Zone, Element, Index, Timeout)

images/images/os-icons/os_ios_150x150.png

images/images/os-icons/os_android_150x150.png

images/images/os-icons/os_windows_150x150.png

images/images/os-icons/os_blackberry_150x150.png

images/images/os-icons/os_symbian02_150x150.png

images/images/os-icons/os_windows_mobile_150x150.png

Description

Wait for Element to disappear from the screen

Parameters

  • Zone – Select Zone

  • Element – Select Element to wait for

  • Index – Element Order. Index=0 refers to the first appearance of the element; Index=1 refers to the second appearance of the element, etc.

  • Timeout– Waiting Timeout in milliseconds.

Usage

Scenario:

In this Example we will call up the iTunes store. While the page is loading an icon will appear indicating the page load is in progress. The WaitForElementToVanish command instructs Silk Mobile not to perform the next operation until the loading icon has vanished, indicating the page is done loading.

Step 1: Click on the iTunes Store icon. The phone will begin loading the next page.

images/download/attachments/2689142/1.jpg

Step 2: The phone is loading, up top there is a specific icon indicating the page load is in progress.

images/download/attachments/2689142/2.jpg

The command instructs Silk Mobile to wait for this element to vanish from the screen, indicating the page has loaded before performing the next operation.

Step 3: The following command, to change the setting from featured to charts could not have been performed until the page finished loading.

images/download/attachments/2689142/3.jpg

Command usage: In order to wait for element to vanish before moving to the next step.

Parameters:

  • Zone – will be set to "NATIVE"

  • Element – Select "loading" Element to wait for it to vanish from the top of the screen while the page is loading.

  • Index – will be set to "0".

  • Timeout – will be set to "10000" (= 10 seconds). Will return false if element is still visible after time out period elapses.

Code Examples

Java Example
if(client.waitForElementToVanish("NATIVE", "xpath=//*[@accessibilityLabel='Network connection in progress']", 0, 10000)){
// If statement
}
C# Example
if (client.WaitForElementToVanish("NATIVE", "xpath=//*[@accessibilityLabel='Network connection in progress']", 0, 10000))
{ // Consequent statement }
VBScript Example
If StrComp (client.WaitForElementToVanish ( "NATIVE", "xpath=//*[@accessibilityLabel='Network connection in progress']", 0, 10000 ), "True") = 0 Then
Report
'If statement
Else
Report
End If
Python Example
if(self.client.waitForElementToVanish("NATIVE", "xpath=//*[@accessibilityLabel='Network connection in progress']", 0, 10000)):
# If statement
pass
Perl Example
if($client->waitForElementToVanish("NATIVE", "xpath=//*[\@accessibilityLabel='Network connection in progress']", 0, 10000)){
# If statement
}