Software test graphic verification code login method, system, medium and equipment

By pre-storing and reading the graph verification code, the problems of low efficiency of graphics verification code testing and high difficulty of operation and maintenance testing in software testing are solved, and efficient and accurate automated testing is achieved, reducing costs and the risks of new problems.

CN119475305APending Publication Date: 2025-02-18INSPUR FINANCIAL INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411527288.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

In software testing, the test efficiency of graphics verification code is low, the operation and maintenance test is difficult, it is easy to introduce new problems, and it is costly.

Method used

By pre-storing the graphics verification code and reading the stored graphics verification code before calling the login interface, ensuring that the login interface can automatically log in during automated testing.

Benefits of technology

Improves the efficiency and accuracy of testing, avoids modification of code, reduces the risk of introducing new problems, and reduces costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119475305A_ABST
    Figure CN119475305A_ABST
Patent Text Reader

Abstract

The invention discloses a software test graphic verification code login method, system, medium and equipment. The method comprises the following steps: S1, parameterizing basic environment information: parameterizing public information required to be used; s2, database connection: if the database connection is successful, entering step S3; if the database connection is unsuccessful, returning to the step S1; s3, a graphic verification code pre-storage data storing the content of the graphic verification code; s4, reading the graphic verification code, the login user name and the password; s5, calling a login interface; user identity information is verified by calling an identity interface; and S6, login succeeds. The method has the advantages that the graphic verification code is pre-stored, and the stored graphic verification code is read before the login interface is called, so that the login interface can be automatically logged in in an automatic test, the test efficiency and accuracy are effectively improved, the code does not need to be modified, and a new problem is prevented from being introduced in a graphic verification code test process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and in particular to a method, system, medium and equipment for logging in with a software testing graphic verification code. Background Art

[0002] Graphic verification code is a type of verification code (CAPTCHA, Completely Automated Public Turing test to tell Computers and Humans Apart)1. It generates a picture with interference elements by converting a string of randomly generated numbers, symbols, etc. The user needs to identify the content in the picture and enter it, so as to distinguish whether the user is a computer or a human. The functions of graphic verification code include preventing malicious password cracking: preventing machine automation programs from constantly trying different password combinations to crack user account passwords, protecting user account security. Preventing vote swiping: In voting scenarios, avoid machine vote swiping to ensure the authenticity and fairness of voting results. Preventing forum flooding: Preventing machines from automatically posting a large amount of meaningless content on forums and other platforms, and maintaining the normal communication order of the platform. Resisting hacker attacks: Preventing hackers from using automated attack methods to use brute force to continuously log in to specific registered users and other malicious behaviors. At present, graphic verification codes still face many security issues, including client issues: If there are vulnerabilities in the client, they may be maliciously exploited to bypass the verification of graphic verification codes. For example, malware may tamper with the submission information of the verification result on the client side, but this part of the search results does not give specific cases; server-side problems: such as logical vulnerabilities: such as improper setting of the session lifespan of the verification code. If it is global rather than for a certain verification process, the client can use the same content again after the verification is passed. Because the session of the verification code is not destroyed in time, this logical BUG may be exploited by people without technical experience to crack it; the problem of easy cracking caused by technical problems of the verification code itself: some low-level graphic verification codes may be cracked by graphic cutting, fading, denoising and comparison. For example, first cut the content on the verification code image into the smallest unit and remove the blank space around it; then fade the color image to black and white; then remove the noise; and then use the graphics library to perform pixel comparison and other operations to crack the verification code after the smallest cut.

[0003] When testing the platform, you need to call the login interface to obtain a valid token before you can test other interfaces. So you need to call the login interface to obtain a valid token first. The problem is that in addition to the username and password, the login interface also requires a correct graphic verification code to successfully log in and obtain a valid token. The graphic verification code is displayed randomly and has a time limit each time. When testing the login interface, how to ensure that the graphic verification code is correct each time needs to be carefully considered.

[0004] There are currently two main ways to test the graphic verification code. The first is to modify the code in the login interface test and remove the graphic verification code. This method changes the interface code and may cause many problems, including increased difficulty in maintenance testing: because when the interface code changes, the relevant test cases also need to be updated accordingly. This not only increases the workload of testers, but may also lead to insufficient test coverage, thereby missing some potential problems. If the interface changes are not notified to the test team in a timely manner, it may cause delays and duplication of testing work. Decreased code quality and maintainability: Frequent changes in interface code may lead to decreased code quality and increased code complexity and coupling. This makes subsequent maintenance and expansion more difficult, and also increases the risk of introducing new bugs. In addition, the readability and comprehensibility of the code will also be affected, which is a challenge for developers who are new to the project. Decreased system performance and stability: Changes in interface code may affect the performance and stability of the system. For example, if the implementation logic of the interface changes, it may make the way of processing data more time-consuming, thereby extending the response time. In addition, if the change involves concurrent processing or resource management, improper modifications may cause waste of system resources or competition conditions, which in turn affects the stable operation of the system. The second method is to use the page login and obtain a token after successful login. This method requires you to log in again to obtain a token every time you test the interface, and the token is time-limited.

[0005] In view of this, it is necessary to provide a method, system, medium and device for software testing graphic verification code login. Summary of the invention

[0006] The present invention provides a method, system, medium and device for logging in a software test graphic verification code, which effectively solves the problems of high timeliness requirement, great difficulty in operation and maintenance testing, easy introduction of new problems and high cost in existing graphic verification code testing.

[0007] The technical solution adopted by the present invention is:

[0008] A method for software testing graphic verification code login, comprising the following steps:

[0009] S1. Parameterization of basic environmental information: parameterize the public information required;

[0010] S2, connect to database: if the database connection is successful, go to step S3; if the database connection is unsuccessful, return to step S1;

[0011] S3, graphic verification code pre-storage database: storing the content of the graphic verification code;

[0012] S4, read the graphic verification code, login user name and password;

[0013] S5. Call the login interface; verify the user's identity information by calling the identity interface;

[0014] S6. Login successful.

[0015] Furthermore, the public information includes the test environment IP address, port number, tested interface address, login user name, password, database server address, port number, password.

[0016] Furthermore, the specific method of pre-storing the graphic verification code in the S3 in the database is to store it in a key-value format, wherein the key stores the key value to be read and the value stores the content of the graphic verification code.

[0017] Furthermore, the graphic verification code read in S4 is a key value stored in a key-value format.

[0018] Furthermore, the method for connecting to the database in S2 is a direct connection, a connection pool or a management tool.

[0019] Furthermore, the graphic verification code includes text, graphics or a complex image of mixed elements.

[0020] Furthermore, the method for calling the login interface in S5 is implemented by sending a request to an HTTP request library.

[0021] The system based on software testing graphic verification code login includes:

[0022] Information parameterization module, used to parameterize the public information required;

[0023] A graphic verification code storage module is used to store the content of the graphic verification code;

[0024] Read the login module, which is used to read the graphic verification code, login username and password;

[0025] The authentication module is used to call the login interface to verify user information.

[0026] A computer-readable storage medium stores a computer program, and when the computer program is processed and executed, the steps of the method for logging in a software test graphic verification code are implemented. The computer-readable storage medium can adopt any combination of one or more readable storage media, wherein the readable storage medium includes an electrical, optical, electromagnetic, infrared or semiconductor system, device or device, or any combination thereof.

[0027] A computer device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus:

[0028] The memory is used to store computer programs;

[0029] The processor is used to execute the steps of the method for logging in the software test graphic verification code by running the program stored in the memory. As an embodiment of the present invention, the communication bus mentioned in the above-mentioned terminal can be a peripheral component interconnect standard (Peripheral Component Interconnect, referred to as PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, referred to as EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. The communication interface is used for communication between the above-mentioned terminal and other devices. The memory can include a random access memory (Random Access Memory, referred to as RAM), and can also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Optionally, the memory can also be at least one storage device located away from the aforementioned processor. The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0030] Beneficial effects of the invention:

[0031] 1. The present invention pre-stores the graphic verification code and reads the stored graphic verification code before calling the login interface, thereby ensuring that the login interface can automatically log in during the automated test, effectively improving the efficiency and accuracy of the test, and does not require code modification, thereby avoiding the introduction of new problems during the graphic verification code testing process.

[0032] 2. The present invention fully realizes automated testing, and the entire operation process is streamlined. Compared with the previous cumbersome side-viewing method, it is more efficient and less costly.

[0033] 3. The method adopted by the present invention parameterizes all the public information needed. If the public information is changed during use, only a certain parameter value here needs to be modified, which improves the convenience of operation.

[0034] 4. The present invention includes multiple ways to connect to the database, which can improve the compatibility of the test. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 A flowchart of a method for logging in with a graphic verification code for software testing provided in an embodiment of the present application. DETAILED DESCRIPTION

[0036] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0037] like Figure 1 As shown, the first embodiment provided by the embodiment of the present application is a method for logging in with a software test graphic verification code, comprising the following steps:

[0038] S1. Parameterization of basic environmental information: parameterize the public information required;

[0039] S2, connect to database: if the database connection is successful, go to step S3; if the database connection is unsuccessful, return to step S1;

[0040] S3, graphic verification code pre-storage database: storing the content of the graphic verification code;

[0041] S4, read the graphic verification code, login user name and password;

[0042] S5. Call the login interface; verify the user's identity information by calling the identity interface;

[0043] S6. Login successful.

[0044] In the above design, by detecting that the data connection is correct, the graphic verification code is pre-stored, and the stored graphic verification code is read before calling the login interface. This ensures the timeliness and correctness of each reading, and the login interface and other interfaces can be tested to ensure that the login interface can be automatically logged in during the automated test.

[0045] Specifically: the public information includes the test environment IP address, port number, tested interface address, login user name, password, database server address, port number, password.

[0046] In the above design, all the public information needed is parameterized. If the public information is changed during use, only a certain parameter value here needs to be modified, which improves the convenience of operation.

[0047] Specifically: the specific method of pre-storing the graphic verification code in the S3 database is to store it in key-value format, where the key stores the key value to be read, and the value stores the content of the graphic verification code. Key-Value format storage is a simple data storage mode that organizes data in the form of key (Key) and value (Value). Among them, the key is an identifier used to uniquely identify the data, and the value is the data content corresponding to the key.

[0048] In the above design, by setting the key-value format storage method, the simplicity and efficiency of the key-value format storage can be used to perform fast data retrieval and storage, especially in large-scale data storage scenarios. The value can be directly located through the key without the need for complex query statements, effectively improving work efficiency.

[0049] Specifically, what is read in S4 as the graphic verification code is the key value stored in the key-value format.

[0050] In the above design, reading the key value stored in the key-value format can realize the effective reading of the data content.

[0051] Specifically: the method for connecting to the database in S2 is a direct connection, a connection pool or a management tool.

[0052] Direct connections include JDBC connections: Through the Java Database Connection (JDBC) API, you can use the DriverManager class or a third-party driver to directly connect to the database; tools such as Navicat: Using graphical database management tools, such as Navicat, you can connect to various types of databases through simple configuration. Connection pool technology: In order to improve the efficiency and management of database connections, database connection pool technology is usually used, such as DBCP, C3P0, etc. These technologies can reuse connections and reduce resource consumption. Use database management tools: For example, DBeaver, it is a free and open source database management tool that supports the connection and management of multiple databases.

[0053] In the above design, the method of connecting to the database can realize the rapid connection to the database by selecting the most appropriate connection method.

[0054] Specifically: the graphic verification code contains text, graphics or a complex image of mixed elements.

[0055] In the above design, the graphic verification code includes complex graphics of text, graphics and mixed elements, which can further increase the complexity of the graphic verification code and increase the difficulty of deciphering the graphic verification code.

[0056] Specifically: the method for calling the login interface in S5 is implemented by sending a request to an HTTP request library.

[0057] In the above design, the login interface can be quickly called by sending a request to the HTTP request library to call the login interface.

[0058] The second embodiment provided by the present application is a system for software testing a graphical verification code login, comprising:

[0059] Information parameterization module, used to parameterize the public information required;

[0060] A graphic verification code storage module is used to store the content of the graphic verification code;

[0061] Read the login module, which is used to read the graphic verification code, login username and password;

[0062] The authentication module is used to call the login interface to verify user information.

[0063] The third embodiment provided by the present application is a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is processed and executed, the steps of the method for software testing graphic verification code login are implemented.

[0064] In addition, the computer-readable storage medium of this embodiment may adopt any combination of one or more computer-readable storage media, wherein the computer-readable storage medium includes electrical, optical, electromagnetic, infrared or semiconductor systems, devices or components, or any combination thereof.

[0065] The fourth embodiment provided by the present application is a computer device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus:

[0066] The memory is used to store computer programs;

[0067] The processor is used to execute the steps of the software testing graphic verification code login method by running the program stored in the memory.

[0068] As an embodiment of the present invention, the communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc.

[0069] As an implementation mode of the present invention, the communication interface is used for communication between the above-mentioned terminal and other devices.

[0070] As an embodiment of the present invention, the memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0071] As an embodiment of the present invention, the above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0072] To further explain in detail, it should be understood that the above is only a specific embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for logging in with a graphic verification code for software testing, characterized in that: The steps include: S1. Parameterization of basic environmental information: parameterize the public information required; S2, connect to database: if the database connection is successful, go to step S3; if the database connection is unsuccessful, return to step S1; S3, graphic verification code pre-storage database: storing the content of the graphic verification code; S4, read the graphic verification code, login user name and password; S5. Call the login interface; verify the user's identity information by calling the identity interface; S6. Login successful.

2. The method for logging in with a software test graphic verification code according to claim 1, characterized in that: The public information includes the test environment IP address, port number, tested interface address, login user name, password, database server address, port number, password.

3. The method for logging in with a software test graphic verification code according to claim 2, characterized in that: The specific method of pre-storing the graphic verification code in the S3 in the database is to store it in a key-value format, wherein the key stores the key value to be read, and the value stores the content of the graphic verification code.

4. The method for logging in with a software test graphic verification code according to claim 3, characterized in that: The graphic verification code read in S4 is a key value stored in a key-value format.

5. The method for logging in with a software test graphic verification code according to claim 1, characterized in that: The method for connecting to the database in S2 is direct connection, connection pool or management tool.

6. The method for logging in with a software test graphic verification code according to claim 1, characterized in that: The graphic verification code includes text, graphics or a complex image of mixed elements.

7. The method for logging in with a software test graphic verification code according to claim 1, characterized in that: The method for calling the login interface in S5 is implemented by sending a request to an HTTP request library.

8. A system for logging in with a graphical verification code based on software testing, characterized in that: include, Information parameterization module, used to parameterize the public information required; A graphic verification code storage module is used to store the content of the graphic verification code; Read the login module, which is used to read the graphic verification code, login username and password; The authentication module is used to call the login interface to verify user information.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is processed and executed, the steps of the method for logging in with a software test graphic verification code according to any one of claims 1 to 7 are implemented.

10. A computer device, characterized in that: The method comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus: The memory is used to store computer programs; The processor is used to execute the steps of the method for logging in with a software test graphic verification code according to any one of claims 1 to 7 by running the program stored in the memory.