Functional testing – Login

Functional test cases include:

1. Enter nothing, click the submit button and see the prompt. (Non-empty check)

2. Enter the registered user name and correct password to check whether the login is successful.

3. Enter the registered user name and incorrect password to check whether the login fails.

4. Enter an unregistered user name and any password to check whether the login fails and the information displayed is correct.

5. If both the user name and password are empty, check whether the login fails and the information is correct.

6. If either the user name or password is empty, check whether the login fails and the information is correct.

7. If the verification code function is enabled for login, enter the correct verification code if the user name and password are correct.

8. If the verification code function is enabled for the login function, if the user name and password are correct, enter an incorrect verification code to check whether the login fails and the information is correct.

9. The user name and password are case-sensitive.

10. Check whether the password box on the page is encrypted.

11. Check whether the system prompts you to change the password upon the first successful login of a user created in the background system.

12. Whether the functions of forgetting the user name and password are available;

13. Whether the length of user name and password is limited according to the design requirements on the front page;

14. If the login function requires a verification code, click the verification code picture to check whether the verification code can be replaced and whether the new verification code is available.

15. Check whether the verification code is refreshed when the page is refreshed.

16. If the verification code is time-sensitive, verify the validity of the verification code within and outside the time-sensitive respectively.

17. After the user logs in successfully but the session times out, check whether the user is redirected to the login page.

18. Check whether different levels of users, such as administrators and common users, have the correct permissions after logging in to the system. 19. Check whether the default focus of the page is in the user name input box.

20. Check whether shortcut keys such as Tab and Enter can be used normally.

Interface test – Login

The login interface used here was written in Python itself

For interface testing, you can use tools or write your own scripts for interface testing.

Use tools for interface testing, here I use the domestic interface testing tool APIPOST, it also supports the generation of interface documents.

Select the request method in the tool, now commonly used methods are: GET, POST. Enter the url: http://127.0.0.1:8888/login, because the login is also need to pass the username and password are the two parameters, post method carry parameters in the body, click view response results

Write your own script to test the interface for logging in, using Python + Requests, as shown here:

Performance test – Login

For performance testing of interface testing, we can use JMeter, a lightweight performance testing tool developed in Java.

When performing login performance tests, you need to consider the problem of the verification code. You can either remove the verification code or set a universal verification code. Here, you still use the login interface above to perform performance tests.

Open JMeter, set up thread groups, collection points, requests, view result trees, summary reports, aggregate reports, etc., can be added according to your own needs

Write the HTTP request for login, as shown in figure:

This is done ten times on an interface, but the real logon performance test is when multiple users log in. The constraint here is to use a single interface for concurrent testing of logins.

To see the results of concurrency: