Overview
Automated tests can sometimes fail during the login process even when manual login with the same credentials works perfectly. This discrepancy often arises from two common scenarios: network-level restrictions, such as requiring a VPN connection, or security measures like One-Time Password (OTP) verification sent via email. This document outlines the causes and solutions for these issues.
How It Works
Network and IP Restrictions
If an application is hosted within a private network or requires a VPN connection for access, automated tests may fail because they cannot reach the application URL. Functionize tests are executed from the Functionize cloud infrastructure, which does not inherit your local machine's network configuration, including any active VPN connections. Therefore, even with correct credentials, the test cannot access the login page.
To resolve this, your organization's network team must whitelist Functionize's IP addresses or proxy endpoints. This action grants the Functionize platform access to your application, allowing the automated tests to run successfully.
Email-Based One-Time Passwords (OTP)
Another common challenge is when an application requires a verification code sent to a user's email to complete the login process. To handle this in an automated fashion, you can use the Functionize Email Reader.
The process involves the following steps:
- Create an auto-forwarding rule in your corporate email client. This rule should be configured to automatically forward the verification emails (which can be identified by sender or subject line) to a designated Functionize email address, such as
project-name@functionize.com. - In your Functionize test case, add an action that uses the Email Reader tool.
- The Email Reader will access the forwarded email in the Functionize mailbox, parse its content, and extract the verification code.
- The extracted code is then stored in a variable, which can be used to populate the verification field in your application, allowing the test to log in and continue without manual intervention.
Limitations
The Email Reader solution is dependent on your organization's email policies. If your corporate email system does not permit the creation of auto-forwarding rules to external domains, this method will not be viable. In such cases, an alternative approach would need to be explored with your team.
Related Info
- For detailed instructions on setting up and using the Email Reader, please refer to the article: Using the Email Reader