How to test Biometric authentication using Appium?
On This Page Importance of Testing Biometric Authentication
Appium is an exposed source solution for cross-platform mechanisation examination of peregrine applications. For Android and iOS mobile applications, it now proffer a smooth automation test experience. Appium functions similarly to a node.js waiter. It was a CLI-only plan mostly installed using the node bundle direction a few geezerhood ago. At its core, Appium uses an HTTP host that render REST API. The client uses REST APIs to interface with the Appium server, which Mobile JSON Wire Protocol handles. Why Test Biometric Authentication? Challenges in Biometric Testing Automating Biometric Authentication using Appium This article will explore on how to enable biometric testing with Appium, simulate fingermark activeness, and validate assay-mark flows effectively There are many reward to Biometric authentication testing in the mobile app: The fingerprint revolution is instigative for mobile software inventors. Yet integrating biometric engineering data into roving operations also gainsay QA brigades. They include the following: Fingerprint isn & # 8217; t compatible with all types of nada and bias. So it & # 8217; s veritably delicate to detect a proper device to test fingerprints. Learn More: ? QA teams must act aboard security engineers and legal advisors to ascertain peregrine covering responsibly treat biometric information. One singular hard-nosed difference that arises from biometric data in mobile device is that, in difference to other types of input, biometric information can be hard to mimic when you run test on simulated or emulate roving device. Read More: SUSA automates exploratory testing with persona-driven behavior, catching bugs that scripted automation misses. Preparation for Appium Fingerprint testing If you & # 8217; re wondering how to automate fingerprint using Appium, let & # 8217; s get into the initial steps Prerequisites for testing Appium fingerprint authentication following are prerequisites: Setting up the Test environment After install all prerequisites, follow the below steps for setup environment: Setting up the emulator for fingermark testing a.Click on three DoT (& # 8230;) in the emulator menu alternativeb.Redirect to extended controls, Here tick on fingerprint c.Click on Touch Sensor two times. d.Click on done, Now your emulator is ready for Fingerprint testing. Including Biometric Appium tests means we ask to be keenly cognizant of the exam substructure used to simulate fingerprint actions locally against aper. are performed from a server to which the devices are join. It provides a context whereby we can insert device-specific commands against the device, in bond with the calls through the testing fabric itself, to simulate the entire workflow on the device in one script. To simplify it, check out the support on. Now, we are designing the basic tryout cases for Appium fingermark testing using an ape. In the above of this document, we have refer the setup of an emulator for fingerprints. And for quiz, we are using a demo covering. So we have designed three canonic exam cases for the fingermark testing given below and used python programming language to write code. Please review this clause for. In this examination case we verify the fingerprint lineament available in the emulator. Opening an app with a fingerprint feature employ Appium and till now, we have not enable fingerprint in the device. So when we open the app then, it gives and pop for define up a fingerprint. So we are asserting that pop-up. Test Steps are the undermentioned: Code Snippet: In this tryout causa, control successful authentication using fingermark. Code Snippet: In this test case, control successful authentication using fingerprint. Code Snippet: Conclusion In this article, we described how to quiz Biometric authentication utilize Appium. This article was created with a specific tech stack, but we can use many times of tech stacks in fingerprint authentication testing. BrowserStack App Automate enable you to test native and hybrid mobile coating using the Appium automation framework on 1000 of real Android and iOS device. Also, advert to the undermentioned Appium tutorial for Android and iOS gimmicks: # Ask-and-Contributeabout this topic with our Discord community. Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed. Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.How to test Biometric authentication using Appium?
Overview
Importance of Testing Biometric Authentication
Top 3 Challenges in Testing Fingerprint Authentication
1. Compatibility Issues with different Devices/OS
2. Security concerns while testing Sensitive Data
3. Limitations of Emulator/Simulators in examine Biometric certification
How to automate Biometric Appium Tests?
Writing Test Cases
1. Test case to control the availableness of the Biometric authentication feature
import time from appium import webdriver # Desire potentiality for device and app desired_caps = {'platformName ': 'Android ', 'platformVersion ': ' 9 ', 'deviceName ': `` Pixel3XL '', 'udid ': 'emulator-5554 ', 'appPackage ': 'com.pro100svitlo.fingerprintauthdemo ', 'appActivity ': 'com.pro100svitlo.fingerprintauthdemo.MainActivity'} # method for test steps def verify_the_availability_of_the_biometric_authentication (): # initiate driver with given capabilities driver = webdriver.Remote (`` http: //127.0.0.1:4723/wd/hub '', desired_caps) time.sleep (2) # assert for certification accessibility assert driver.find_element_by_xpath ('// * [@ text= '' Please verify that at least one fingermark has be file on the device ''] ') \ .is_displayed () == True assert driver.find_element_by_xpath ('// * [@ text= '' Attention ''] ') .is_displayed () == True, f'Fingerprint is enabled' driver.close ()2. Test case to verify the successful authentication using Biometrics
significance time from appium importation webdriver # desire capabilities for device and app desired_caps = {'platformName ': 'Android ', 'platformVersion ': ' 9 ', 'deviceName ': `` Pixel3XL '', 'udid ': 'emulator-5554 ', 'appPackage ': 'com.pro100svitlo.fingerprintauthdemo ', 'appActivity ': 'com.pro100svitlo.fingerprintauthdemo.MainActivity'} def verify_biometric_authentication_successful (): driver = webdriver.Remote (`` http: //127.0.0.1:4723/wd/hub '', desired_caps) time.sleep (2) driver.execute_script (`` adb -e emu digit touch 1 '') assert driver.find_element_by_xpath ('// * [@ text= '' GO TO MAIN ACTIVITY ''] ') .is_displayed () == True, f'Fingerprint Authentication is not success' driver.close ()3. Test suit to verify the Unsuccessful authentication using wrong Biometrics
significance time from appium import webdriver desired_caps = {'platformName ': 'Android ', 'platformVersion ': ' 9 ', 'deviceName ': `` Pixel3XL '', 'udid ': 'emulator-5554 ', 'appPackage ': 'com.pro100svitlo.fingerprintauthdemo ', 'appActivity ': 'com.pro100svitlo.fingerprintauthdemo.MainActivity'} def verify_biometric_authentication_successful (): driver = webdriver.Remote (`` http: //127.0.0.1:4723/wd/hub '', desired_caps) time.sleep (2) driver.execute_script (`` adb -e emu fingerbreadth touch 2 '') assert driver.find_element_by_xpath ('// * [@ text= '' GO TO MAIN ACTIVITY ''] ') .is_displayed () == False, f'Fingerprint Authentication is success' driver.execute_script (`` adb -e emu finger touch 2 '') driver.execute_script (`` adb -e emu digit touch 2 '') driver.execute_script (`` adb -e emu finger touch 2 '') assert driver.find_element_by_xpath ('// * [@ text= '' Can rehear in 01:30 ''] ') .is_displayed () == True, f'Fingerprint Authentication is success' driver.close ()
Related Guides
Automate This With SUSA
Test Your App Autonomously