Skip to main content

[Mobile] Wait For Element Present

Description

Wait for the given mobile element to present within the given time (in seconds).

Parameters

ParameterParameter TypeMandatoryDescription
toTestObjectRequiredRepresent a mobile element.
timeOutintRequiredMaximum period of time (in seconds) that system will wait to return a result.
flowControlFailureHandlingOptionalSpecify failure handling schema to determine whether the execution should be allowed to continue or stop.

Returns

Param TypeDescription
Boolean
  • true: the element is present within the timeout.
  • false: the element is NOT present within the timeout.

Example

You want to wait for 'App' control to be present in 10 seconds timeout.

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import internal.GlobalVariable as GlobalVariable

'Start application on current selected android\'s device'
Mobile.startApplication(GlobalVariable.G_AndroidApp, false)

'Wait for app control to be present in 10 seconds timeout'
Mobile.waitForElementPresent(findTestObject('Object Repository/Application/android.widget.TextView - App'), 10)

'Close application on current selected android\'s device'
Mobile.closeApplication()