WaitForElementToVanish(Zone, Element, Index, Timeout)
|
|
|
|
|
|
|
Wait for Element to disappear from the screen
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.
Step 2: The phone is loading, up top there is a specific icon indicating the page load is in progress.
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.
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.
if(client.waitForElementToVanish("NATIVE", "xpath=//*[@accessibilityLabel='Network connection in progress']", 0, 10000)){// If statement}if (client.WaitForElementToVanish("NATIVE", "xpath=//*[@accessibilityLabel='Network connection in progress']", 0, 10000)){ // Consequent statement }If StrComp (client.WaitForElementToVanish ( "NATIVE", "xpath=//*[@accessibilityLabel='Network connection in progress']", 0, 10000 ), "True") = 0 Then Report 'If statementElse ReportEnd Ifif(self.client.waitForElementToVanish("NATIVE", "xpath=//*[@accessibilityLabel='Network connection in progress']", 0, 10000)):# If statementpassif($client->waitForElementToVanish("NATIVE", "xpath=//*[\@accessibilityLabel='Network connection in progress']", 0, 10000)){ # If statement}