What is BankID
BankID is a digital identification system widely used in countries like Sweden, Norway, and Finland. It allows individuals to securely prove their identity online and authorize electronic transactions.How to test BankID
There are two approaches for handling BankID in your QA.tech tests: stubbing BankID in your testing environment, or manual authentication using the live screen stream.Option 1: Stubbing BankID (Recommended)
Stubbing gives you fully automated tests without manual intervention. This requires changes to your application code by your development team. From BankID’s official documentation:How do I test my BankID implementation? How about automation? Testing can’t be automated. Passwords/Security codes have to be manually entered in the BankID clients. We recommend building a so-called test stub that simulates the BankID service web service. It can also be used to perform load tests on your services. https://developers.bankid.com/support
What is stubbing?
Stubbing replaces the BankID integration with a placeholder that automatically grants access in your testing environment. For example, you accept a specific personnummer like199001011234 and always grant that user access. This should only be permitted in a testing environment, never in production.
On the client:
Option 2: Manual Authentication
If you can’t stub BankID, you can manually complete the authentication yourself. Since QA.tech live streams the browser screen during test execution, you can watch the test and scan the BankID QR code in real time. Create a dedicated login test that waits for you to authenticate, and then reuse that login state across all your other tests via dependencies. You only need to authenticate once per test run.Create a Login Test
Create a test with instructions like:The long wait gives you enough time to find the running test, open the live stream, and scan the QR code with your phone.
Open the Live Stream and Scan
Find the running login test in the QA.tech dashboard and open its live screen stream. You’ll see the BankID QR code on screen. Open the BankID app on your phone and scan the QR code shown in the stream.