Skip to main content

[Mobile] Perform Touch ID

Description

Simulate a Touch ID event on iOS simulators.

Keyword name: Mobile.performTouchID

Note:
  • To enable this keyword, Touch ID on the simulator must be enrolled.
  • Touch ID and Face ID are available on certain iPhone and iPad models. To learn more about supported iPhone and iPad models, refer to the following Apple documents: iPhone models and iPad models.

Parameters

ParameterParameter TypeRequiredDescription
matchBooleanYesSimulate a successful touch (true) or a failed touch (false).
flowControlFailureHandlingNoSpecify failure handling schema to determine whether the execution should be allowed to continue or stop. Refer to: Failure Handling.

Exceptions

ThrowPreconditionMessage
StepFailedExceptionIf Touch ID on the simulator is not enrolled.To enable this keyword, touch ID on the simulator must be enrolled.
StepFailedExceptionIf the performTouchID keyword is not performed on an iOS simulator.The performTouchID keyword supports iOS simulators only.
WarningIf the performTouchID keyword is run on unsupported environments.The performTouchID keyword is not available for physical mobile devices.

Example

In this example, we want to open the Authentication.app application using Touch ID.
import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint 
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import static com.kms.katalon.core.testobject.ObjectRepository.findWindowsObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testng.keyword.TestNGBuiltinKeywords as TestNGKW
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.kms.katalon.core.windows.keyword.WindowsBuiltinKeywords as Windows
import internal.GlobalVariable as GlobalVariable
import org.openqa.selenium.Keys as Keys

'Start application with Touch ID enrolled on the current selected iOS simulator'
Mobile.startApplication('/Users/katalon/Library/Developer/Xcode/DerivedData/Authenticate_asgsg/Build/Products/Debug-iphonesimulator/Authentication.app', true)

'Perform a successful Touch ID event'
Mobile.performTouchID(true)

'Close application on the current selected iOS simulator'
Mobile.closeApplication()
Was this page helpful?