Skip to main content
Transform your testing process with: Real Device Features, Company-wide Licences, & App Percy

Test Biometric authentication on BrowserStack mobile devices

Important: This feature is available only under Device Cloud Pro, Device Cloud Pro + Visual Cloud, and Enterprise Pro plans. For more details, check out our pricing page.

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 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.

If you are using BrowserStack SDK, you can set the following capability within the browserstack.yml file:

Capability Description Expected values
enableBiometric Enable Biometric Authentication true/false
browserstack.yml
Copy icon Copy snippet

BrowserStack SDK is a plug-n-play solution that takes care of all the integration steps for you. Using the BrowserStack SDK is the recommended integration method for your project. To know more, visit the SDK core concepts page.

Use the following code snippet to enable Biometric Authentication:

Capability Description Expected values
enableBiometric Enable Biometric Authentication true/false
DesiredCapabilities capabilities = new DesiredCapabilities();
HashMap<String, Object> browserstackOptions = new HashMap<String, Object>();
browserstackOptions.put("enableBiometric", "true");
var capabilities = {
  	'bstack:options' : {
  		"enableBiometric" : "true",
  	},
}
desired_cap = {
  	'bstack:options' : {
  		"enableBiometric" : "true",
  	},
}
capabilities = {
    'bstack:options' => {
        "enableBiometric" => "true",
    },
}
AppiumOptions capabilities = new AppiumOptions();
Dictionary<string, object> browserstackOptions = new Dictionary<string, object>();
browserstackOptions.Add("enableBiometric", "true");
Capability Description Value
browserstack.enableBiometric Enable Biometric Authentication true/false
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 :

Note: On iOS, if the Biometric Authentication prompt does not show up and the test passes automatically, then contact our Support team.
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 BrowserStack 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 Android, currently we support the following Biometric APIs in Android SDK :

On iOS, currently we support the following Biometric APIs in iOS SDK :

  • 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 apps & apps built with cross platform frameworks such as React Native, Flutter, etc.

Note: On Android :
  • Biometric feature is supported only on Android 6.0 & above
  • Apps using code obfuscation tools such as Proguard are not supported
On iOS :
  • 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.

Check this page for a list of various JavaScript Executors that BrowserStack offers.

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
Download Copy