An automated testing method, apparatus, device, and storage medium
By sending a list of use cases to the terminal and determining the target interface from the interface, obtaining the product list for assertion, the problem that existing automated testing methods cannot meet the needs of diverse and personalized users is solved, and the user experience is improved.
Patent Information
- Application Number
- CN202211199948.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-29
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2042-09-29
AI Technical Summary
The existing automated testing methods cannot effectively meet the diverse and personalized user needs, affecting the user experience.
By responding to the tester's request instructions, send a list of use cases to the terminal, add automated use cases, and determine the target interface from the preset interface, obtain the product list, perform assertions to determine the test results, and complete automated tests.
It has achieved the adaptation to the diverse and personalized user needs of the interface and improved the user experience.
Smart Images

Figure CN115543798B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of automated testing, and specifically relates to an automated testing method, device, equipment, and storage medium. Background Art
[0002] Personalized search recommendation, also known as "personalized search and recommendation", is a ranking method. It means that when different users search for the same keyword in the same search engine, the sorting of multiple products returned by the corresponding interface is different. In addition, the interface will return search results more suitable for the user according to the user's characteristics. When a user searches for a product in a search engine, the user expects the products retrieved to meet their expectations. For example, the user wants to search for a dress priced between 500 and 1000 yuan, or the user wants to search for headphones with the shipping area being Guangdong Province, or the user wants to search for pants with free shipping insurance, etc. Such diverse user needs make the product data returned by the interface vary greatly. Therefore, the interface needs to adapt to diverse and personalized user needs. Therefore, it is necessary to regularly perform automated testing on the interface to ensure the accuracy and stability of the interface.
[0003] However, the existing automated testing methods cannot effectively meet diverse and personalized user needs, affecting the user experience. Summary of the Invention
[0004] In view of this, the present application provides an automated testing method, device, equipment, and storage medium, which are used to solve the problem that the existing automated testing methods cannot effectively meet diverse and personalized user needs, affecting the user experience.
[0005] To achieve the above objectives, the following solutions are proposed:
[0006] In a first aspect, an automated testing method includes:
[0007] Responding to a request instruction from a tester for automated testing, sending a use case list to the terminal corresponding to the tester for the tester to add automated use cases to the use case list;
[0008] Determining a target interface from each preset interface according to the automated use case;
[0009] Based on the target interface, obtaining a first product list corresponding to the automated use case;
[0010] Obtaining a product wide table corresponding to the first product list, and combining the first product list with the product wide table to obtain a second product list;
[0011] Asserting the second product list to obtain a first test result;
[0012] Based on the first test result, determine the final test result to complete the automated test.
[0013] Preferably, determining the target interface from each preset interface according to the automated test case includes:
[0014] Obtain the interface name corresponding to the automated test case;
[0015] Based on the interface name, select from each of the interfaces, and use the selected interface as the target interface.
[0016] Preferably, obtaining the first commodity list corresponding to the automated test case based on the target interface includes:
[0017] Obtain the interface input parameters corresponding to the automated test case;
[0018] Use the interface input parameters to request the target interface so that the target interface returns a response message corresponding to the automated test case;
[0019] Determine the first commodity list corresponding to the automated test case from the response message.
[0020] Preferably, making an assertion on the second commodity list to obtain the first test result includes:
[0021] Determine the assertion type through a preset verification target;
[0022] Judge whether the second commodity list conforms to the assertion type to obtain the first test result.
[0023] Preferably, determining the assertion type through a preset verification target includes:
[0024] When the verification target is to match a specified field, the assertion type is the first preset threshold;
[0025] When the verification target is sorting, the assertion type is the second preset threshold;
[0026] When the verification target is whether a specified commodity attribute matches, the assertion type is the third preset threshold;
[0027] When the verification target is whether a specified field is empty, the assertion type is the fourth preset threshold.
[0028] Preferably, determining the final test result based on the first test result includes:
[0029] Use a preset evaluation criterion to judge whether the first test result passes;
[0030] If the first test result fails, obtain the interface name corresponding to the automation case and the execution time of the automation case;
[0031] Based on the first test result, determine the reason for the failure of the first test result;
[0032] Integrate the interface name corresponding to the automation case, the execution time, and the reason for the failure of the first test result to obtain the final test result;
[0033] If the first test result passes, use the first test result as the final test result.
[0034] In a second aspect, an automated testing device includes:
[0035] An automated case adding module, configured to respond to a request instruction for automated testing by a tester, and send a case list to the terminal corresponding to the tester, for the tester to add automated cases in the case list;
[0036] A target interface determining module, configured to determine a target interface from each preset interface according to the automation case;
[0037] A first commodity list obtaining module, configured to obtain a first commodity list corresponding to the automation case based on the target interface;
[0038] A second commodity list obtaining module, configured to obtain a commodity wide table corresponding to the first commodity list, and combine the first commodity list with the commodity wide table to obtain a second commodity list;
[0039] An assertion module, configured to assert the second commodity list to obtain a first test result;
[0040] A final test result obtaining module, configured to determine a final test result based on the first test result to complete the automated testing.
[0041] Preferably, the first commodity list obtaining module includes:
[0042] An interface input parameter obtaining module, configured to obtain interface input parameters corresponding to the automation case;
[0043] A request module, configured to request the target interface by using the interface input parameters, for the target interface to return a response message corresponding to the automation case;
[0044] A first commodity list determining module, configured to determine a first commodity list corresponding to the automation case from the response message.
[0045] In a third aspect, an automated testing device includes a memory and a processor;
[0046] The memory is used for storing programs;
[0047] The processor is used for executing the programs to implement each step of the automated testing method as described in the first aspect.
[0048] In a fourth aspect, a storage medium stores a computer program, and when the computer program is executed by a processor, each step of the automated testing method as described in the first aspect is implemented.
[0049] It can be seen from the above technical solutions that in this application, in response to a request instruction for automated testing from a tester, a use case list is sent to the terminal corresponding to the tester for the tester to add automated use cases in the use case list; based on the automated use cases, a target interface is determined from each preset interface; based on the target interface, a first commodity list corresponding to the automated use cases is obtained; a commodity wide table corresponding to the first commodity list is acquired, and the first commodity list is combined with the commodity wide table to obtain a second commodity list; the second commodity list is asserted to obtain a first test result; based on the first test result, a final test result is determined to complete the automated testing. This solution provides a way for testers to add automated use cases, thereby performing automated testing on the interface, enabling the interface to meet various diverse and personalized user requirements and enhancing the user experience. Description of the Drawings
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings according to the provided drawings without creative efforts.
[0051] Figure 1 It is an optional flowchart of an automated testing method provided by an embodiment of this application;
[0052] Figure 2 It is a schematic flowchart of adding automated use cases provided by an embodiment of this application;
[0053] Figure 3 It is an optional flowchart of another automated testing method provided by an embodiment of this application;
[0054] Figure 4 It is a schematic structural diagram of an automated testing device provided by an embodiment of this application;
[0055] Figure 5 A schematic structural diagram of an automated test device provided by an embodiment of the present application. Specific implementation manners
[0056] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0057] Personalized search recommendation, also known as "personalized search recommendation", is a ranking method. It means that when different users search for the same keyword in the same search engine, the sorting of multiple products returned by the corresponding interface is different. In addition, the interface will return search results more suitable for the user according to information such as the user's characteristics and historical records. These historical records include the click situation of the keywords searched by the user in the search results, the access situation on various websites, etc. After the search engine analyzes these user information, when the user conducts a search later, the interface can return more targeted search results. When a user searches for a product in a search engine, the user will require that the products searched are in line with their expectations. For example, the user wants to search for a dress with a price between 500 and 1000 yuan, or the user wants to search for headphones with a shipping area of Guangdong Province, or the user wants to search for pants with free shipping insurance, etc. Such diverse user needs make the product data returned by the interface vary greatly. Therefore, the interface needs to adapt to diverse and personalized user needs. Therefore, it is necessary to regularly conduct automated tests on the interface to ensure the accuracy and stability of the interface.
[0058] However, the existing automated test methods cannot effectively meet diverse and personalized user needs, affecting the user experience.
[0059] An embodiment of the present invention provides an automated test method, which can be applied to various computer terminals or intelligent terminals, and the execution subject thereof can be a processor or a server of a computer terminal or an intelligent terminal. The method flowchart of the method is as Figure 1 shown, specifically including:
[0060] S1: In response to a request instruction for an automated test from a tester, send a use case list to the terminal corresponding to the tester for the tester to add automated use cases in the use case list.
[0061] In this application, the tester triggers an automated test on the corresponding terminal. After receiving the request instruction, the terminal responds to the tester's request instruction for an automated test and pops up a window for adding automated test cases (cases) on the terminal interface. As Figure 2 shown, the adding window can be a tab for automated management, and the tester needs to fill in various parameters corresponding to the automated test cases, including: interface name, interface input parameters, assertion parameters, etc.
[0062] The tester can choose to add multiple automated test cases according to their own requirements to meet diverse user needs.
[0063] In one example, as Figure 2 shown:
[0064] The interface ID of the added automated test case is 3. The module to which the automated test case belongs is osp-recommend.a. The interface name corresponding to the automated test case is com,vio,recomme. The name of the automated test case is PRICE_ASC, and the name of the automated test case can be verified and formatted in JSON. The interface input parameters and assertion parameters corresponding to the automated test case can also be filled in one by one.
[0065] It can be understood that multiple verification rules can be set for one automated test case, and multiple verification rules can be combined and used to improve the utilization rate of the automated test case.
[0066] S2: Determine the target interface from each preset interface according to the automated test case.
[0067] In this solution, there are multiple preset interfaces. Each automated test case can correspond to one interface, or multiple automated test cases can correspond to one interface.
[0068] Therefore, based on the added automated test case, select the interface corresponding to the automated test case as the target interface.
[0069] S3: Based on the target interface, obtain the first commodity list corresponding to the automated test case.
[0070] In the embodiment provided in this application, based on the target interface determined in the above step S2, obtain the first commodity list corresponding to the automated test case. The first commodity list includes commodity names, commodity attributes corresponding to the automated test case, etc. In one example, if the tester wants to test whether the commodity received by the user is a pink short-sleeved shirt, the first commodity list can include commodity names, such as: short-sleeved shirt, T-shirt, top, etc.; it can also include commodity colors, such as: pink, color, light color, etc.; it can also include the types of people suitable for the commodity, such as: the elderly, children, boys, girls, etc.
[0071] S4: Obtain the wide product table corresponding to the first product list, and combine the first product list with the wide product table to obtain a second product list.
[0072] It can be understood that the wide product table is the underlying table storing detailed product information. In this application, the detailed product information may include the store to which the product belongs, the materials used for the product, the production time of the product, the product delivery time period, the product size, whether it includes shipping insurance, etc. This embodiment does not limit this. Additionally, the wide product table can be a list returned separately by the interface corresponding to this automated use case, or a list returned simultaneously with the first product list.
[0073] Combine the first product list with the wide product table and integrate them into a clear and detailed second product list, which is convenient for testers to perform subsequent assertion detection.
[0074] In addition, after obtaining the second product list, the second product list can be de-duplicated by spuld, the product inventory can be verified, the product on-shelf and off-shelf status can be inspected, and brand category screening can be verified to obtain a more accurate second product list.
[0075] S5: Assert the second product list to obtain a first test result.
[0076] After obtaining the second product list in the above step S4, assert the second product list to obtain a first test result.
[0077] S6: Based on the first test result, determine the final test result to complete the automated test.
[0078] As can be seen from the above technical solution, in this application, in response to the request instruction for automated testing by the tester, a use case list is sent to the terminal corresponding to the tester for the tester to add automated use cases in the use case list; according to the automated use cases, a target interface is determined from each preset interface; based on the target interface, a first product list corresponding to the automated use cases is obtained; the wide product table corresponding to the first product list is obtained, and the first product list is combined with the wide product table to obtain a second product list; the second product list is asserted to obtain a first test result; based on the first test result, the final test result is determined to complete the automated test. This solution provides a way for testers to add automated use cases, thereby performing automated testing on the interface, enabling the interface to handle various diverse and personalized user requirements and improving the user experience.
[0079] In the method provided by the embodiment of the present invention, the process of determining the target interface from each preset interface according to the automated use cases is specifically described as follows:
[0080] S21: Obtain the interface name corresponding to the automation use case.
[0081] S22: Based on the interface name, select from each of the interfaces, and use the selected interface as the target interface.
[0082] Specifically, when adding an automation use case, the interface name corresponding to the automation use case is set. Therefore, obtain the interface name and find the corresponding target interface among the preset interfaces.
[0083] The above embodiment describes the process of determining the target interface from each preset interface according to the automation use case of the present application. Next, the process of obtaining the first commodity list corresponding to the automation use case based on the target interface in the present application will be described in detail, as Figure 3 shown, please refer to Figure 3 , including:
[0084] S31: Obtain the interface input parameters corresponding to the automation use case.
[0085] S32: Use the interface input parameters to request the target interface, so that the target interface returns a response message corresponding to the automation use case.
[0086] S33: Determine the first commodity list corresponding to the automation use case from the response message.
[0087] Specifically, when adding an automation use case, the interface input parameters corresponding to the automation use case are set. Therefore, obtain the interface input parameters, use the interface input parameters as request parameters to request the target interface, and the target interface responds to the tester's request instruction and returns a response message corresponding to the automation use case. Thus, the first commodity list corresponding to the automation use case can be determined according to the response message returned by the target interface.
[0088] It can be understood that the response message returned by the interface is returned by page, and each page contains a fixed number of commodities. Therefore, the automation use case is also set to be a single page, which is convenient for automated testing.
[0089] The above embodiment describes the process of obtaining the first commodity list corresponding to the automation use case based on the target interface in the present application. Next, the process of making an assertion on the second commodity list to obtain the first test result in the present application will be described in detail.
[0090] S51: Determine the assertion type through a preset verification target.
[0091] S52: Determine whether the second commodity list conforms to the assertion type to obtain the first test result.
[0092] In the embodiments provided in the present application, the process of determining the assertion type through a preset verification target may include:
[0093] 1) When the verification target is to match a specified field, the assertion type is a first preset threshold.
[0094] 2) When the verification target is sorting, the assertion type is a second preset threshold.
[0095] 3) When the verification target is whether the specified attribute of the commodity matches, the assertion type is the third preset threshold.
[0096] 4) When the verification target is whether a specified field is empty, the assertion type is a fourth preset threshold.
[0097] The first preset threshold can be set to 0, the second preset threshold can be set to 1, the third preset threshold can be set to 2, and the fourth preset threshold can be set to 3. In an example, when the verification target is to match the specified field, AssertType (assertion type) == 0; when the verification target is to verify the sorting, AssertType == 1; when the verification target is to verify whether the specified attribute of the product matches, AssertType == 2; when the verification type is to verify whether the specified field is empty, AssertType == 3. Among them, for each assertion type, it can be subdivided, such as sorting verification AssertType == 1, it can be distinguished in ascending or descending order according to the keywords "price" or "price", "agio" or "discount", "weight" or "sales volume", "first_shelf_time" or "shelf time", "commission_rate" or "commission rate", "commission_amt" or "commission amount", etc.
[0098] The above embodiment illustrates the process of asserting the second product list and obtaining the first test result of the present application. The following describes in detail the process of determining the final test result based on the first test result provided by the present application.
[0099] Use the preset evaluation criteria to determine whether the first test result passes.
[0100] If the first test result fails, the interface name corresponding to the automation case and the execution time of the automation case are obtained. Based on the first test result, the reason for the failure of the first test result is determined. The interface name and execution time corresponding to the automation case are integrated with the reason for the failure of the first test result to obtain a final test result.
[0101] If the first test result passes, the first test result is used as the final test result.
[0102] In the above solution, if the first test result fails, the final test result can be fed back to the tester for the tester to detect and correct the interface based on the final test result.
[0103] The automated testing method provided by this application can be reused for different interfaces, and can also be used for baseline verification before product release, or daily online testing verification, or set up a timed automated testing method to set functions such as configuration modules, execution frequency of automated testing, and alarm issuance to ensure the long-term stability of the interface and improve the efficiency of automated testing at the same time.
[0104] On the one hand, this solution is applicable to scenarios where personalized processing of interface results affects the consistency of interface return data and it is impossible to judge interface exceptions by the presence or absence of fields. It is possible to judge whether it is reasonable based on some information, rather than one-sided verification by judging the presence or absence of interface return data, improving the credibility of verification and reducing the misjudgment rate.
[0105] On the other hand, in some scenarios where multiple interfaces share a set of processing logics and a change in one interface may affect other interfaces, therefore, using the automated testing method provided by this application to configure automated test cases for each interface can achieve the effect of regression testing.
[0106] Corresponding to Figure 1 the method described above, an embodiment of the present invention also provides an automated testing device for Figure 1 the specific implementation of the method in Figure 4 , an embodiment of the present invention provides an automated testing device which can be in a computer terminal or various mobile devices. Combining Figure 4 as shown in
[0107] An automated test case adding module 10, configured to respond to a request instruction for automated testing by a tester, and send a use case list to the terminal corresponding to the tester for the tester to add automated test cases in the use case list;
[0108] A target interface determining module 20, configured to determine a target interface from each preset interface according to the automated test case;
[0109] A first product list obtaining module 30, configured to obtain a first product list corresponding to the automated test case based on the target interface;
[0110] The second product list obtaining module 40 is configured to obtain a product wide table corresponding to the first product list, and combine the first product list with the product wide table to obtain a second product list;
[0111] The assertion module 50 is configured to assert the second product list to obtain a first test result;
[0112] The final test result obtaining module 60 is configured to determine a final test result based on the first test result to complete the automated test.
[0113] As can be seen from the above technical solution, in this application, in response to a request instruction for automated testing from a tester, a use case list is sent to the terminal corresponding to the tester for the tester to add automated use cases to the use case list; according to the automated use cases, a target interface is determined from each preset interface; based on the target interface, a first product list corresponding to the automated use cases is obtained; a product wide table corresponding to the first product list is obtained, and the first product list is combined with the product wide table to obtain a second product list; the second product list is asserted to obtain a first test result; based on the first test result, a final test result is determined to complete the automated test. This solution provides a way for testers to add automated use cases, thereby performing automated testing on the interface, enabling the interface to handle various diverse and personalized user requirements and improving the user experience.
[0114] In one example, the target interface determining module 20 may include:
[0115] The interface name obtaining module is configured to obtain an interface name corresponding to the automated use case;
[0116] The selection module is configured to select from each of the interfaces based on the interface name and use the selected interface as the target interface.
[0117] In one example, the first product list obtaining module 30 may include:
[0118] The interface input parameter obtaining module is configured to obtain an interface input parameter corresponding to the automated use case;
[0119] The request module is configured to request the target interface with the interface input parameter for the target interface to return a response message corresponding to the automated use case;
[0120] The first product list determining module is configured to determine a first product list corresponding to the automated use case from the response message.
[0121] In one example, the assertion module 50 may include:
[0122] An assertion type determination module, configured to determine an assertion type through a preset verification target;
[0123] A first test result obtaining module, configured to determine whether the second commodity list conforms to the assertion type and obtain a first test result.
[0124] In one example, the assertion type determination module may include:
[0125] When the verification target is to match a specified field, the assertion type is a first preset threshold;
[0126] When the verification target is sorting, the assertion type is a second preset threshold;
[0127] When the verification target is whether a specified commodity attribute matches, the assertion type is a third preset threshold;
[0128] When the verification target is whether a specified field is empty, the assertion type is a fourth preset threshold.
[0129] In one example, the final test result obtaining module 60 may include:
[0130] A judgment module, configured to judge whether the first test result passes by using a preset judgment criterion;
[0131] A first obtaining module, configured to, if the first test result fails, obtain the interface name corresponding to the automated test case and the execution time of the automated test case;
[0132] A non - passing reason determination module, configured to determine the non - passing reason of the first test result based on the first test result;
[0133] An integration module, configured to integrate the interface name corresponding to the automated test case, the execution time, and the non - passing reason of the first test result to obtain a final test result;
[0134] A final test result determination module, configured to, if the first test result passes, use the first test result as the final test result.
[0135] Furthermore, an embodiment of the present application provides an automated test device. Optionally, Figure 5 shows a hardware structure block diagram of the automated test device. Referring to Figure 5 , the hardware structure of the automated test device may include: at least one processor 01, at least one communication interface 02, at least one memory 03, and at least one communication bus 04.
[0136] In the embodiments of the present application, the number of the processor 01, the communication interface 02, the memory 03, and the communication bus 04 is at least one, and the processor 01, the communication interface 02, and the memory 03 complete communication with each other through the communication bus 04.
[0137] The processor 01 may be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention, etc.
[0138] The memory 03 may include a high-speed RAM memory, and may also include a non-volatile memory, etc., such as at least one disk memory.
[0139] Among them, the memory stores a program, and the processor can call the program stored in the memory. The program is used to execute the following automated test method, including:
[0140] In response to a request instruction for automated testing from a tester, send a use case list to the terminal corresponding to the tester for the tester to add automated use cases in the use case list;
[0141] Determine a target interface from each preset interface according to the automated use case;
[0142] Based on the target interface, obtain a first commodity list corresponding to the automated use case;
[0143] Obtain a commodity wide table corresponding to the first commodity list, and combine the first commodity list with the commodity wide table to obtain a second commodity list;
[0144] Assert the second commodity list to obtain a first test result;
[0145] Based on the first test result, determine the final test result to complete the automated test.
[0146] Optionally, for the refined functions and extended functions of the program, reference may be made to the description of the automated test method in the method embodiments.
[0147] The embodiments of the present application further provide a storage medium, which can store a program suitable for being executed by a processor. When the program runs, it controls the device where the storage medium is located to execute the following automated test method, including:
[0148] In response to a request instruction for automated testing from a tester, send a use case list to the terminal corresponding to the tester for the tester to add automated use cases in the use case list;
[0149] Determine a target interface from each preset interface according to the automation use case;
[0150] Based on the target interface, obtain a first commodity list corresponding to the automation use case;
[0151] Obtain a commodity wide table corresponding to the first commodity list, and combine the first commodity list with the commodity wide table to obtain a second commodity list;
[0152] Assert the second commodity list to obtain a first test result;
[0153] Based on the first test result, determine the final test result to complete the automation test.
[0154] Specifically, the storage medium may be a computer-readable storage medium, and the computer-readable storage medium may be an electronic memory such as a flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, a hard disk, or a ROM.
[0155] Optionally, the refinement function and expansion function of the program may refer to the description of the automation test method in the method embodiment.
[0156] In addition, each functional module in each embodiment of the present disclosure may be integrated together to form an independent part, or each module may exist alone, or two or more modules may be integrated to form an independent part. If the function is implemented in the form of a software functional module and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present disclosure, in essence, or the part that contributes to the prior art, or a part of this technical solution, may be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a live broadcast device, or a network device, etc.) to execute all or part of the steps of the methods in each embodiment of the present disclosure.
[0157] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising said element.
[0158] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other.
[0159] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An automated testing method, characterized in that, Including: In response to the request instruction for automated testing by the tester, sending a list of test cases to the terminal corresponding to the tester for the tester to add automated test cases to the list of test cases; Determining a target interface from each preset interface according to the automated test case; Based on the target interface, obtaining a first product list corresponding to the automated test case; including: obtaining interface input parameters corresponding to the automated test case; using the interface input parameters to request the target interface for the target interface to return a response message corresponding to the automated test case; determining the first product list corresponding to the automated test case from the response message; Obtaining a product wide table corresponding to the first product list and combining the first product list with the product wide table to obtain a second product list; Asserting the second product list to obtain a first test result; Based on the first test result, determining a final test result to complete the automated test; including: using a preset evaluation criterion to determine whether the first test result passes; if the first test result does not pass, obtaining the interface name corresponding to the automated test case and the execution time of the automated test case; based on the first test result, determining the reason for the failure of the first test result; integrating the interface name corresponding to the automated test case, the execution time, and the reason for the failure of the first test result to obtain a final test result; if the first test result passes, using the first test result as the final test result.
2. The method according to claim 1, characterized in that The determining a target interface from each preset interface according to the automated test case includes: Obtaining the interface name corresponding to the automated test case; Based on the interface name, selecting from each of the interfaces and taking the selected interface as the target interface.
3. The method according to claim 1, wherein The asserting the second product list to obtain a first test result includes: Determining an assertion type through a preset verification target; Judging whether the second product list conforms to the assertion type to obtain a first test result.
4. The method according to claim 3, characterized in that The determining an assertion type through a preset verification target includes: When the verification target is to match a specified field, the assertion type is a first preset threshold; When the verification target is sorting, the assertion type is a second preset threshold; When the verification target is whether a specified product attribute matches, the assertion type is a third preset threshold; When the verification target is whether a specified field is empty, the assertion type is a fourth preset threshold.
5. An automated test device, characterized in that, Including: An automated test case adding module for, in response to the request instruction for automated testing by the tester, sending a list of test cases to the terminal corresponding to the tester for the tester to add automated test cases to the list of test cases; A target interface determining module for determining a target interface from each preset interface according to the automated test case; The first product list obtaining module is used to obtain a first product list corresponding to the automation use case based on the target interface, and includes: an interface input parameter obtaining module for obtaining interface input parameters corresponding to the automation use case; a request module for using the interface input parameters to request the target interface so that the target interface returns a response message corresponding to the automation use case; a first product list determining module for determining a first product list corresponding to the automation use case from the response message. The second product list obtaining module is used to obtain a product wide table corresponding to the first product list, and combine the first product list with the product wide table to obtain a second product list. The assertion module is used to assert the second product list to obtain a first test result. The final test result obtaining module is used to determine a final test result based on the first test result to complete the automation test, and includes: judging whether the first test result passes by using a preset evaluation criterion; if the first test result does not pass, obtaining the interface name corresponding to the automation use case and the execution time of the automation use case; determining the reason for the failure of the first test result based on the first test result; integrating the interface name corresponding to the automation use case, the execution time and the reason for the failure of the first test result to obtain a final test result; if the first test result passes, using the first test result as the final test result.
6. An automated test device, characterized in that, It includes a memory and a processor. The memory is used to store programs. The processor is used to execute the program to implement each step of the automation test method according to any one of claims 1-4.
7. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements each step of the automation test method according to any one of claims 1-4.
Citation Information
Patent Citations
WEB interface automated testing method and system
CN106933745A
Test case generator and user interface
US20210248057A1