[Mobile] Wait For Element Present

Description

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

Parameters

Param Param Type Mandatory Description
to TestObject Required Represent a mobile element.
timeOut  int  Required Maximum period of time (in seconds) that system will wait to return a result.
flowControl FailureHandling Optional Specify 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(findTestObject('Object Repository/Application/android.widget.TextView - App')), 10)

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

Feedback