Automated testing method, device, equipment and storage medium

By obtaining the test request of the user under test, entering the login state, and using the path collection file and encapsulated jump function, jumping directly to the test page, solving the problems of low efficiency and poor stability in complex page operations, achieving more efficient testing and lower error risks.

CN119759792APending Publication Date: 2025-04-04华润数字科技有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411985027.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

Traditional automated testing methods are inefficient and poorly stable when handling complex page operations, resulting in low efficiency in execution of use cases and high risk of errors in intermediate processes.

Method used

By obtaining the test request of the user under test, entering the login state, and using the path collection file and the encapsulated jump function, jump directly to the test page to reduce unnecessary intermediate processes.

Benefits of technology

It improves the efficiency of automated testing, reduces the risk of errors in the intermediate process, and optimizes the page jump process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759792A_ABST
    Figure CN119759792A_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides an automated testing method, device, equipment and storage medium, the method comprising: obtaining a test request of a tested user for a current test case and entering a login state; searching a path collection file for a web page path of a current test page corresponding to the current test case according to the current test case, the path collection file comprising a web page path of a test page corresponding to the test case; jumping to the current test page according to a packaged jump function and the web page path of the current test page to test the current test case. The embodiment of the present invention can jump to the current test page through a packaged jump function, thereby saving unnecessary intermediate processes, optimizing the page jump process, improving test efficiency, and reducing the risk of errors in the intermediate process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an automated testing method, device, equipment and storage medium. Background Art

[0002] In order to free test engineers from mechanical and repetitive testing work and focus more on testing new functions and designing more comprehensive test cases, automated testing is needed. Under limited manpower and time conditions, automated testing needs to cover more scenarios at the lowest cost and achieve rapid verification.

[0003] When developing scripts in traditional testing solutions, if the business operation page is complex, the efficiency and stability of this solution will be greatly reduced; when executing script use cases, each use case or each use case class needs to be logged in, and then the user is simulated to click the menu level by level to enter the target test page and execute the script use case.

[0004] This solution has a time-consuming and error-prone pre-process, lower use case execution efficiency, and poor framework stability. Summary of the invention

[0005] The embodiments of the present invention provide an automated testing method, apparatus, device and storage medium, which aim to improve the efficiency of automated testing and reduce the risk of errors in the intermediate process.

[0006] In a first aspect, an embodiment of the present invention provides an automated testing method, the method comprising:

[0007] Get the test request of the tested user for the current test case and enter the login state;

[0008] According to the current test case, searching for the web page path of the current test page corresponding to the current test case in a path collection file, wherein the path collection file includes the web page path of the test page corresponding to the test case;

[0009] According to the encapsulated jump function and the web page path of the current test page, jump to the current test page to test the current test case.

[0010] Further, the web page path includes a basic path and a difference path, and the path collection file includes the difference path of the test case;

[0011] The step of searching the path collection file for the web page path of the current test page corresponding to the current test case comprises:

[0012] Searching the path collection file for the difference path corresponding to the current test case;

[0013] The web page path is composed according to the basic path and the difference path.

[0014] Further, the current test case includes a test order, and the method further includes:

[0015] Through the checkpoint function, determine whether the current test order is tested successfully;

[0016] If the current test order is tested successfully, the next test order is tested, otherwise, the exception is captured by the checkpoint function and the flag bit corresponding to the checkpoint function is modified.

[0017] Furthermore, the step of capturing an exception through the checkpoint function further includes:

[0018] Record the failure information of the current test order.

[0019] Furthermore, the method further comprises:

[0020] By means of a result checking function, the flag bit is compared with an initial value;

[0021] If the flag bit is the same as the initial value, the test result of the current test case is determined to be successful; otherwise, the test result of the current test case is determined to be failed.

[0022] Furthermore, the step of entering the login state includes:

[0023] Determine whether the user being tested is logging in for the first time;

[0024] If the user being tested logs in for the first time, the user enters the login state according to the input user name and password, and generates a Cookies file, which includes the login information of the user being tested;

[0025] If the user being tested is not logging in for the first time, the user enters the login state according to the latest Cookies file and the encapsulated login function.

[0026] Furthermore, the steps of entering the login state according to the latest Cookies file and the encapsulated login function include:

[0027] Determine whether the update time of the latest Cookies file is within the preset validity period;

[0028] If the update time of the latest Cookies file is within the preset effective time, the latest Cookies file is read through the login function to enter the login state.

[0029] In a second aspect, an embodiment of the present invention provides an automated testing device, the automated testing device comprising:

[0030] The login module is used to obtain the test request of the tested user for the current test case and enter the login state;

[0031] A jump module, used for searching, according to the current test case, the web page path of the current test page corresponding to the current test case in a path collection file, wherein the path collection file includes the web page path of the test page corresponding to the test case;

[0032] The test module is used to jump to the current test page according to the encapsulated jump function and the web page path of the current test page to test the current test case.

[0033] In a third aspect, an embodiment of the present invention provides a computer device, the 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 via the communication bus;

[0034] Memory, used to store computer programs;

[0035] The processor is used to implement the steps of an automated testing method provided in the first aspect when executing a program stored in the memory.

[0036] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of an automated testing method provided in the first aspect are implemented.

[0037] The embodiment of the present invention provides an automated testing method, device, equipment and storage medium. When a test is required, the test request of the tested user for the current test case is first obtained to enter the login state; then, according to the current test case, the web page path corresponding to the current test case is searched in the path collection file; and the encapsulated jump function is used to jump to the web page path, thereby entering the current test page. The embodiment of the present invention can jump to the current test page through the encapsulated jump function, saving unnecessary intermediate processes, optimizing the page jump process, improving the test efficiency, and reducing the risk of errors in the intermediate process. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.

[0039] Figure 1 A flowchart of an automated testing method provided by an embodiment of the present invention;

[0040] Figure 2 A flowchart of a test case provided in the prior art;

[0041] Figure 3 A flowchart of a test case provided by an embodiment of the present invention;

[0042] Figure 4 A flowchart of a login process provided by the prior art;

[0043] Figure 5 A flowchart of a login process provided by an embodiment of the present invention;

[0044] Figure 6 A schematic diagram of the structure of an automated testing device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0046] In order to make the description of the disclosed content more detailed and complete, the following is an illustrative description of the implementation mode and specific examples of the present invention; however, this is not the only form of implementing or applying the specific embodiments of the present invention. The implementation mode covers the features of multiple specific embodiments and the method steps and their sequence for constructing and operating these specific embodiments. However, other specific embodiments can also be used to achieve the same or equal functions and step sequences. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0047] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein.

[0048] In the description of the embodiments of the present invention, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two, and other quantifiers are similar. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention, and the embodiments of the present application and the features in the embodiments may be combined with each other without conflict.

[0049] In the traditional method, when testing the security group-associated resource scenario, first open the login page, enter the user name and password to log in, and then click the control center, network, security group, and associated resources in sequence after logging in. Then, execute the script use case of the security group-associated resources. This test process requires clicking one level at a time, with low execution efficiency, cumbersome intermediate processes, and high risk of errors.

[0050] The embodiment of the present invention provides an automated testing method, which can be applied to various application scenarios such as web page function testing and APP function testing. Taking web page function testing as an example, the tester needs to test a certain function of a web page provided by a client, and sends a test request of the current test case to the server; after receiving the test request, the server enters the login state according to the user name and password included in the test request; then, according to the current test case, the web page path of the current test page corresponding to the current test case is searched in the path collection file; finally, according to the encapsulated jump function and the web page path of the current test page, jump to the current test page to test the current test case.

[0051] The server can be implemented by an independent server or a server cluster composed of multiple servers. The client can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited thereto. The client and the server can be connected via Bluetooth, USB (Universal Serial Bus) or other communication connection methods, which is not limited in the embodiments of the present invention.

[0052] Figure 1 A flowchart of an automated testing method provided by an embodiment of the present invention is as follows: Figure 1 As shown, the method includes:

[0053] In the embodiment of the present invention, executing the webpage automated test requires at least two prerequisites: first, it is necessary to log in to a preset account of the user to be tested; second, it is necessary to enter the test page to execute a specific test case.

[0054] S110, obtaining a test request of the tested user for the current test case and entering a login state;

[0055] When a web page needs to be tested, in order to cover all functions and situations of the web page, multiple test cases need to be used to test the web page; a test case refers to a set of test inputs, execution conditions, expected results and post-conditions designed for a specific test purpose during the software testing process. The current test case is the test case that needs to be tested currently, and the execution process of each test case is the same. The embodiment of the present invention is described by taking the current test case as an example.

[0056] After receiving a test request for the current test case from the user under test, the user under test information included in the test request is used to enter the login state from the login page. In the embodiment of the present invention, the specific method of entering the login state from the login page can be to log in after entering the user name and password of the user under test on the login page, or to log in directly according to the historical login information recorded on the web page. The specific method can be determined according to the actual situation, and the embodiment of the present invention does not make any specific restrictions on this.

[0057] The tested users are generally pre-defined users, such as testers and technicians within the company, and can be specifically determined according to actual conditions, and the embodiments of the present invention do not specifically limit this.

[0058] S120, according to the current test case, searching for a web page path of a current test page corresponding to the current test case in a path collection file, wherein the path collection file includes a web page path of a test page corresponding to the test case;

[0059] In the embodiment of the present invention, a path collection file is pre-set, and the path collection file includes the web page path of the test page corresponding to each test case, and there is a one-to-one correspondence between each test case and each web page path. For example, each test case is numbered, each number is unique, and the number of the test case is also used as the number of the corresponding web page path, so that the corresponding web page path can be found according to the number.

[0060] According to the current test case, a search is performed in the path collection file to find the web page path of the current test web page corresponding to the current test case. The current test web page is the web page for executing the test case.

[0061] S130, jumping to the current test page according to the packaged jump function and the web page path of the current test page to test the current test case.

[0062] Use the encapsulated jump function to jump to the page indicated by the web page path found in the above step. This page is the current test page. Execute the current test case on the current test page, thereby omitting the process of clicking the menu level by level to enter the current test page, improving execution efficiency and reducing the maintenance cost caused by errors in the intermediate process.

[0063] The embodiment of the present invention provides an automated testing method. When a test is required, the test request of the tested user for the current test case is first obtained, and the login state is entered; then, according to the current test case, the web page path corresponding to the current test case is searched in the path collection file; and the encapsulated jump function is used to jump to the web page path, thereby entering the current test page. The embodiment of the present invention can jump to the current test page through the encapsulated jump function, saving unnecessary intermediate processes, optimizing the page jump process, improving the test efficiency, and reducing the risk of errors in the intermediate process.

[0064] As an implementation mode, the web page path includes a basic path and a difference path, and the path collection file includes the difference path of the test case;

[0065] The step of searching the path collection file for the web page path of the current test page corresponding to the current test case comprises:

[0066] Searching the path collection file for the difference path corresponding to the current test case;

[0067] The web page path is composed according to the basic path and the difference path.

[0068] When developing an automated script in an embodiment of the present invention, each test case or each test case class needs to enter the corresponding target test page for testing. For a tested web page, the web page path of the test page corresponding to each test case has the same part, so the same path is extracted as the basic path, and the different path for each web page path is used as the difference path, all the difference paths are stored in the path collection file, and each test case and each difference path are one-to-one.

[0069] When searching for the web page path of the current test page corresponding to the current test case in the path collection file, first find the corresponding difference path in the path collection file, concatenate the basic path and the difference path, and obtain the web page path unique to the test case.

[0070] In the embodiment of the present invention, the web page path is divided into a basic path and a difference path, and only the difference path is stored in the path collection file, which can improve the search efficiency when searching for the difference path corresponding to the current test case.

[0071] In some embodiments, the current test case includes a test order, and the method further includes:

[0072] Through the checkpoint function, determine whether the current test order is tested successfully;

[0073] If the current test order is tested successfully, the next test order is tested, otherwise, the exception is captured by the checkpoint function and the flag bit corresponding to the checkpoint function is modified.

[0074] In the embodiment of the present invention, each test case includes multiple test orders to achieve comprehensive and in-depth testing of a function. The embodiment of the present invention pre-encapsulates a checkpoint function, which is only responsible for detecting whether the test point is successful or failed, and recording error information when it fails. By encapsulating the checkpoint function, when it is needed, the checkpoint function can be directly called.

[0075] The checkpoint function also sets a flag, which is represented by flag and has an initial value of 0.

[0076] In the embodiment of the present invention, a checkpoint is set after each test order, and the checkpoint function is used to determine whether the test order is successfully tested. Specifically, if the checkpoint function determines that the current test order is successfully tested, the next test order is tested continuously; if the current test order fails, the exception is captured by the checkpoint function, and the value of the flag is modified after the exception is captured; in the embodiment of the present invention, if a test order fails, the value of the flag is increased by 1, and the next test order is tested continuously.

[0077] It should be noted that the checkpoint function can be continuously expanded according to business scenarios, such as whether the actual and expected values ​​are equal, whether the actual value is greater than the expected value, whether the actual value contains the expected value, etc.

[0078] In this way, the checkpoint function will not stop running the code due to the failure of the test order. The checkpoint function is only responsible for checking the test points and recording error information.

[0079] In some embodiments, the step of capturing an exception through the checkpoint function further includes:

[0080] Record the failure information of the current test order.

[0081] In the embodiment of the present invention, after the checkpoint function captures the exception, the failure information of the current test order is recorded to facilitate subsequent search for the cause of the exception.

[0082] In some embodiments, the method further comprises:

[0083] By means of a result checking function, the flag bit is compared with an initial value;

[0084] If the flag bit is the same as the initial value, the test result of the current test case is determined to be successful; otherwise, the test result of the current test case is determined to be failed.

[0085] The result check function in the embodiment of the present invention is responsible for determining the final state of the test case, that is, determining whether the test case is successful or failed. Specifically, the check result function compares the flag bit and the initial value. If the flag bit and the initial value are equal, the final test result of the current test case is determined to be successful. Otherwise, the final test result of the current test case is determined to be failed.

[0086] Among them, the initial value in the embodiment of the present invention is 0.

[0087] In the actual implementation process, the result check function is represented by Result, which encapsulates the traditional assertion assertEqual(flag, 0). When flag=0, it indicates that the final result of the current test case is passed, and when flag is not equal to 0, it indicates that the final result of the current test case is failed.

[0088] In the embodiment of the present invention, after checking all test orders, the result check function is called to compare whether the flag is equal to 0. If it is equal, the test case succeeds. If it is not equal, the test case fails. The test order information that does not meet the expectations has been recorded during the test process and will be printed out in the report, which is convenient for correcting the web page according to the error information.

[0089] In the embodiment of the present invention, a checkpoint function and a result check function are used to check all test orders and record information, and no code changes are required even if new orders are added.

[0090] For example, Figure 2 A flowchart of a test case provided in the prior art, such as Figure 2 As shown in the figure, the test results of test orders 1 to N are checked through native assertions. After each test order is tested, the native assertion is called. After test order 1 passes, since test order 2 fails, the subsequent test orders 3 to N are not checked. That is, after test order 2 fails, the code will stop running and the subsequent code will not be executed; and if you want to know which orders failed, other means are needed to achieve it, which increases the complexity of the code.

[0091] Figure 3 A flowchart of a test case provided by an embodiment of the present invention, such as Figure 3As shown, the test results of test orders 1 to test orders N are checked through the checkpoint function. After each test order is tested, the checkpoint function is called. After test order 1 passes, since test order 2 fails, the flag is increased by 1, and the failure information of test order 2 is recorded. And the subsequent test orders 3 to test orders N are checked in turn, that is, the code will not stop running after test order 2 fails, but will continue to detect each test order, even the newly added order M. The checkpoint function in this solution can check all test orders, and finally judge the status of the test case through the result check function, and finally output the result of each test case.

[0092] In the prior art, Figure 4 A flowchart of a login process provided by the prior art, such as Figure 4 As shown, in order to reduce the coupling between codes, the developers of automation scripts often close the current login page after each test case or each test case class is executed; to execute the next test case or test case class, it is necessary to reopen the login page and execute the above two complete preconditions 1. Often, there are thousands or even more automated test cases for a medium-to-large system under test, and it takes up to several hours to execute all the test cases, and the error rate is often high; some of the errors are caused by errors in the precondition operation process, resulting in the failure of the test case, and the precondition operation process is also time-consuming. Assuming that each execution of the automation case script does not require frequent logins and can directly jump to the target page under test, will it shorten the time and reduce the error rate in execution?

[0093] In some embodiments, Figure 5 A flowchart of a login process provided by an embodiment of the present invention, such as Figure 5 As shown, the steps of entering the login state include:

[0094] Determine whether the user being tested is logging in for the first time;

[0095] If the user being tested logs in for the first time, the user enters the login state according to the input user name and password, and generates a Cookies file, which includes the login information of the user being tested;

[0096] If the user being tested is not logging in for the first time, the user enters the login state according to the latest Cookies file and the encapsulated login function.

[0097] Therefore, in the embodiment of the present invention, when developing the automation script, in order to remove the strong association between the test cases, each test case or test case class will call the login function. In the embodiment of the present invention, if the user under test logs in for the first time, he enters the user name and password in the login page, enters the login state, and the login function automatically generates a Cookies file.

[0098] Cookies are a type of data file stored on the user's local terminal. They are sent from the website server to the user's browser, which will save them. When the user visits the website again, the browser will send the information in the Cookies file back to the server, and the server can directly log in based on this information.

[0099] If the user being tested is not logging in for the first time, the latest Cookies file can be directly called to enter the login state, skipping the operation process of entering the user name and password, reducing the intermediate process and the risk of errors in the middle.

[0100] In the embodiment of the present invention, the entire login process generally only requires other test cases or test case classes to restore the Cookies file information of the user under test to complete the login state, which greatly improves the efficiency of executing automated use cases and reduces the probability of use case failure due to abnormal login process.

[0101] As an implementation mode, the steps of entering the login state according to the latest Cookies file and the encapsulated login function include:

[0102] Determine whether the update time of the latest Cookies file is within the preset validity period;

[0103] If the update time of the latest Cookies file is within the preset effective time, the latest Cookies file is read through the login function to enter the login state.

[0104] In the embodiment of the present invention, it is determined whether the update time of the latest Cookies file is within the preset effective time. If the update time of the latest Cookies file is within the preset effective time, the latest Cookies file is read through the login function to enter the login state.

[0105] An automated testing method provided by an embodiment of the present invention reduces the redundancy of automated test cases, improves the efficiency of test case execution, and reduces the error rate during execution; and the embodiment of the present invention can meet more business scenarios, and can record in more detail the specific test points that fail during the test process, and accurately find problems.

[0106] Figure 6A schematic diagram of the structure of an automated testing device provided by an embodiment of the present invention is shown in FIG. Figure 6 As shown, the automated testing device comprises:

[0107] The login module 610 is used to obtain the test request of the tested user for the current test case and enter the login state;

[0108] The jump module 620 is used to search the web page path of the current test page corresponding to the current test case in the path collection file according to the current test case, and the path collection file includes the web page path of the test page corresponding to the test case;

[0109] The testing module 630 is used to jump to the current test page according to the packaged jump function and the web page path of the current test page to test the current test case.

[0110] This embodiment is a device embodiment corresponding to the above method embodiment, and its specific implementation process is the same as that of the above method embodiment. For details, please refer to the above method embodiment, and this device embodiment will not elaborate on it.

[0111] In some embodiments, the web page path includes a basic path and a difference path, and the path collection file includes the difference path of the test case;

[0112] The jump module includes a search unit and a combination unit, wherein:

[0113] The searching unit is used to search the path collection file for the distinguished paths corresponding to the current test case;

[0114] The combining unit is used to compose the web page path according to the basic path and the distinguishing path.

[0115] In some embodiments, the current test case includes a test order, and the automated testing device includes a check module and an exception capture module, wherein:

[0116] The checking module is used to determine whether the current test order is tested successfully through a checkpoint function;

[0117] The exception capture module is used to test the next test order if the current test order is successfully tested, otherwise, capture the exception through the checkpoint function and modify the flag bit corresponding to the checkpoint function.

[0118] In some embodiments, the automated testing device further includes a failure recording module, wherein:

[0119] The failure recording module is used to record the failure information of the current test order.

[0120] In some embodiments, the automated testing device further includes a comparison module and a determination module, wherein:

[0121] The comparison module is used to compare the flag bit with the initial value through a result checking function;

[0122] The determination module is used to determine that the test result of the current test case is successful if the flag bit is the same as the initial value, and otherwise, determine that the test result of the current test case is failed.

[0123] In some embodiments, the login module includes a first login determination unit, a first login processing unit, and a non-first login processing unit, wherein:

[0124] The first login determination unit is used to determine whether the user being tested is logging in for the first time;

[0125] The first login processing unit is used to enter the login state according to the input user name and password if the tested user logs in for the first time, and generate a Cookies file, wherein the Cookies file includes the login information of the tested user;

[0126] The non-first login processing unit is used to enter the login state according to the latest Cookies file and the encapsulated login function if the tested user is not logging in for the first time.

[0127] As an implementation manner, the non-first login processing unit includes a validity determination subunit and a validity processing subunit, wherein:

[0128] The validity judgment subunit is used to judge whether the update time of the latest Cookies file is within the preset validity period;

[0129] The effective processing subunit is used to read the latest Cookies file through the login function and enter the login state if the update time of the latest Cookies file is within the preset effective time.

[0130] Based on the above automated testing method, an embodiment of the present invention further provides a computer device, the 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 via the communication bus;

[0131] Memory, used to store computer programs;

[0132] The processor is used to implement the steps of the above-mentioned automatic testing method when executing the program stored in the memory.

[0133] For other details about how the processor in the above-mentioned computer device implements the above-mentioned technical solution, please refer to the description of the automated testing method provided in the above-mentioned invention embodiment, which will not be repeated here.

[0134] Among them, the processor can also be called CPU (Central Processing Unit), the processor may be an integrated circuit chip with signal processing capabilities; the processor can also be a general-purpose processor, DSP (Digital Signal Process), ASIC (Application Specific Integrated Circuit), FPGA (Field Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, among which the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0135] The embodiment of the present invention also provides a computer-readable storage medium, on which a readable computer program is stored; wherein the computer program can be stored in the above storage medium in the form of a software product, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, magnetic disk or optical disk, ROM (Read-Only Memory), RAM (Random Access Memory) and other media that can store program codes, or terminal devices such as computers, servers, mobile phones, and tablets.

[0136] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0137] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0138] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium.

[0139] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0140] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

[0141] The technical solution provided by the present application is introduced in detail above. The principles and implementation methods of the present application are explained by using specific examples in the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

[0142] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0143] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0144] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0145] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0146] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. An automated testing method, characterized in that: The method comprises: Get the test request of the tested user for the current test case and enter the login state; According to the current test case, searching for the web page path of the current test page corresponding to the current test case in a path collection file, wherein the path collection file includes the web page path of the test page corresponding to the test case; According to the encapsulated jump function and the web page path of the current test page, jump to the current test page to test the current test case.

2. The automated testing method according to claim 1, characterized in that: The web page path includes a basic path and a difference path, and the path set file includes the difference path of the test case; The step of searching the path collection file for the web page path of the current test page corresponding to the current test case comprises: Searching the path collection file for the difference path corresponding to the current test case; The web page path is composed according to the basic path and the difference path.

3. The automated testing method according to claim 2, characterized in that: The current test case includes a test order, and the method further includes: Through the checkpoint function, determine whether the current test order is tested successfully; If the current test order is tested successfully, the next test order is tested, otherwise, the exception is captured by the checkpoint function and the flag bit corresponding to the checkpoint function is modified.

4. The automated testing method according to claim 3, characterized in that: The step of capturing an exception through the checkpoint function further includes: Record the failure information of the current test order.

5. The automated testing method according to claim 3, characterized in that: The method further comprises: By means of a result checking function, the flag bit is compared with an initial value; If the flag bit is the same as the initial value, the test result of the current test case is determined to be successful; otherwise, the test result of the current test case is determined to be failed.

6. The automated testing method according to any one of claims 1 to 5, characterized in that: The steps of entering the login state include: Determine whether the tested user is logging in for the first time; If the user being tested logs in for the first time, the user enters the login state according to the input user name and password, and generates a Cookies file, which includes the login information of the user being tested; If the user being tested is not logging in for the first time, the user enters the login state according to the latest Cookies file and the encapsulated login function.

7. The automated testing method according to claim 6, characterized in that: The steps of entering the login state according to the latest Cookies file and the encapsulated login function include: Determine whether the update time of the latest Cookies file is within the preset validity period; If the update time of the latest Cookies file is within the preset effective time, the latest Cookies file is read through the login function to enter the login state.

8. An automated testing device, characterized in that: The automatic testing device comprises: The login module is used to obtain the test request of the tested user for the current test case and enter the login state; A jump module, used for searching, according to the current test case, the web page path of the current test page corresponding to the current test case in a path collection file, wherein the path collection file includes the web page path of the test page corresponding to the test case; The test module is used to jump to the current test page according to the encapsulated jump function and the web page path of the current test page to test the current test case.

9. A computer device, characterized in that: The device includes 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; Memory, used to store computer programs; The processor is used to implement the steps of the automated testing method described in any one of claims 1 to 7 when executing the program stored in the memory.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the automated testing method according to any one of claims 1 to 7 are implemented.