Skip to main content

SeeTestAutomation - WaitForElementToVanish

info

Please note that this tool is classified as a Legacy tool. We recommend transitioning to our updated solutions to maintain optimal performance and security in your workflows. For more information on this matter, please reach out to technical support .

WaitForElementToVanish(Zone, Element, Index, Timeout)

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 SeeTestAutomation 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.

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

The command instructs SeeTestAutomation 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.

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 Expand source

if (client.WaitForElementToVanish("NATIVE", "xpath=//*[@accessibilityLabel='Network connection in progress']", 0, 10000))
{ // Consequent statement }

VBScript Example Expand source

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 Expand source

if(self.client.waitForElementToVanish("NATIVE", "xpath=//*[@accessibilityLabel='Network connection in progress']", 0, 10000)):
# If statement
pass

Perl Example Expand source

if($client->waitForElementToVanish("NATIVE", "xpath=//*[\@accessibilityLabel='Network connection in progress']", 0, 10000)){
# If statement
}