Test Biometric authentication on BrowserStack mobile devices

Important:
  • On iOS, The Biometric Authentication feature is currently in Beta and may involve changes based on feedback.
  • On Android, currently this feature is not supported.

The majority of mobile devices today support Biometric hardware sensors to authenticate device owner’s identity. BrowserStack enables you to test Biometric Authentication such as Touch ID/Fingerprint Sensor, Face ID, etc on a BrowserStack mobile device.

In this guide, you will learn about :

  1. How to test Biometric authentication in an App Automate session
  2. Frequently Asked Questions (FAQs)

1. How to test Biometric authentication in an App Automate session

To test Biometric Authentication feature in your mobile apps, follow the below outlined steps :

1.1 Enable Biometric Authentication in the Appium Session

Use BrowserStack’s Appium capability browserstack.enableBiometric:"true” in the desired capabilities to enable Biometric in a BrowserStack Appium session.

This ensures your app undergoes Sensor Instrumentation which is a process using which BrowserStack supports app’s interaction with different mobile sensors such as Biometric.

DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("browserstack.enableBiometric", "true");
var capabilities = {
    "browserstack.enableBiometric" : "true"
}
desired_cap = {
	"browserstack.enableBiometric" : "true"
}
desired_caps = {
    "browserstack.enableBiometric" => "true"
}
DesiredCapabilities capability = new DesiredCapabilities();
desiredCapabilities.SetCapability("browserstack.enableBiometric", "true");

1.2 Use BrowserStack’s custom executor to interact with Biometric authentication dialog

Biometric Auth Dialog

When your app, which is BrowserStack sensor instrumented, presents Biometric Authentication alert use our custom executor with action biometric & arguments {"biometricMatch": "pass"} to interact with the alert as shown below :

driver.executeScript("browserstack_executor: {\"action\":\"biometric\", \"arguments\": {
    \"biometricMatch\" : \"pass\"
}})
await driver.execute("browserstack_executor: {\"action\":\"biometric\", \"arguments\": {
  \"biometricMatch\" : \"pass\"
}}”)
driver.execute_script("browserstack_executor: {\"action\":\"biometric\", \"arguments\": {
    \"biometricMatch\" : \"pass\"
}}”)
@driver.execute_script("browserstack_executor: {\"action\":\"biometric\", \"arguments\": {
    \"biometricMatch\" : \"pass\"
}}”)
driver.executeScript("browserstack_executor: {\"action\":\"biometric\", \"arguments\": {
    \"biometricMatch\" : \"pass\"
}})

Frequently Asked Questions (FAQs)

1. How does Biometric Authentication work on BrowserStaack mobile devices?

BrowserStack supports an app’s interaction with different mobile sensors such as Biometric using Sensor Instrumentation. Sensor Instrumentation is the process in which, if Biometric is enabled for the session, we inject BrowserStack’s Biometric code module into the app which mocks or overrides Biometric APIs used by the app.

2. What Biometric APIs are supported by BrowserStack Biometric feature?

Please note that Biometric feature will work only if the app uses any of the following supported Biometric APIs. To get more details about the Biometric APIs your app uses please check with your app development team.

On iOS, currently we support the following Biometric APIs :

  • canEvaluatePolicy & evaluatePolicy APIs from the LAContext class in the Apple’s iOS Biometric SDK. For more details, please check LAContext Apple documentation.
Note: On iOS :

3. Do we need to register Biometric on the mobile device or make any changes in the app code?

NO. You do not need to register any Biometric on the mobile device or make any changes in the app code.

4. What kind of apps are supported?

We support native & cross platform iOS apps such as React Native, Flutter, etc.

Note:
  • Biometric feature is supported only on iOS 13 & above devices.
  • iOS apps signed with Enterprise certificates are not supported. Biometric feature needs browserstack.resignApp to be true.

Need some help?

If you have any queries, please get in touch with us.

We're sorry to hear that. Please share your feedback so we can do better







Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better







Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback!

Talk to an Expert
Talk to an Expert