UI automatic test method and device, storage medium and computer equipment

By determining the execution parameters and target script set in the UI automation test, and using the test script library for playback testing, the need for the test team to be familiar with the framework and code in the existing technology is solved, the testing efficiency and stability are improved, and the cost is reduced.

CN118708484APending Publication Date: 2024-09-27创优数字科技(广东)有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410809008.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

Existing UI automated testing methods require all members of the test team to be familiar with the implementation framework and code, resulting in higher maintenance and testing costs and lower efficiency when personnel changes are frequent.

Method used

By receiving automated test instructions, determining execution parameters, obtaining the test script library, determining the target script set based on the parameters, logging in to the execution account in the target application for playback testing, recording execution results, and reducing team communication and maintenance costs.

Benefits of technology

It improves the stability and efficiency of UI automated testing, avoids test failure problems caused by inconsistent account status, and reduces the maintenance and communication costs of the test team.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118708484A
    Figure CN118708484A
Patent Text Reader

Abstract

The invention provides a UI automatic test method and device, a storage medium and computer equipment, and the method comprises the steps: determining a target application and a to-be-tested branch in the target application according to an execution parameter; due to the fact that the account states of different accounts in the target application are not always consistent, the execution account of the test needs to be determined according to the branch to be tested, and the problem that the test fails due to the fact that the account state of the execution account is strongly associated with a service scene is avoided. And the stability and the test efficiency of the automatic test are improved. And determining a target script set in the test script library, and when the target application is in a compiled state, performing a playback test on the to-be-tested branch by using the test script set under the execution account. Therefore, testers only need to upload the test scripts recorded by the testers to the test script library and set the execution parameters during testing, playback testing can be carried out on the to-be-tested branches, the maintenance cost of a test team is reduced, and therefore the efficiency of UI automatic testing is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software testing technology, and in particular to a UI automated testing method, apparatus, storage medium, and computer equipment. Background Art

[0002] In most e-commerce and retail companies today, applications play an important role. As the main channel for online business, applications can attract users to register as members and complete the shopping process. However, with the advancement of technology and the intensification of market competition, the iteration frequency of applications is getting higher and higher. Since the stability of the application interface is closely related to the user experience, for those e-commerce systems that iterate once a week, how to ensure the functional stability of the application interface in frequent iterations is particularly important.

[0003] Currently, UI (User Interface) automation can simulate the interaction between users and applications, ensure the consistency of the application interface on different platforms, and detect potential problems quickly and accurately. However, this method requires all members of the test team to be familiar with the implementation framework and code. For test teams with frequent personnel changes, the maintenance and testing costs are high, which leads to low efficiency of UI automation testing. Summary of the invention

[0004] The purpose of this application is to solve at least one of the above-mentioned technical defects, especially the technical defect that in the prior art, UI automation requires all members of the test team to be familiar with the implementation framework and code, which leads to high maintenance and testing costs for the test team with frequent personnel changes, thus resulting in low efficiency of UI automation testing.

[0005] In a first aspect, the present application provides a UI automation testing method, the method comprising:

[0006] When receiving an automated test instruction, determining execution parameters according to the automated test instruction;

[0007] Determine a target application and a branch to be tested in the target application according to the execution parameters, and determine an execution account for this test based on the branch to be tested;

[0008] Acquire a test script library, and determine a target script set in the test script library according to the execution parameter; wherein the test script library includes test scripts uploaded by multiple users;

[0009] Compiling the target application;

[0010] When the target application is in a compiled state, the execution account is logged in the target application, the target script set is used under the execution account to perform a playback test on the branch to be tested, and the execution result of each test script in the target script set on the branch to be tested is recorded.

[0011] In one embodiment, the updating process of the test script library includes:

[0012] For each test script received and uploaded by the user, extract the application identifier, branch identifier, scenario description and script name of the test script;

[0013] The test script and its corresponding branch identifier, scenario description and script name are saved in the test script library under the category corresponding to the application identifier to complete the update of the test script library.

[0014] In one embodiment, the step of determining a target script set in the test script library according to the execution parameter includes:

[0015] Acquire a script identification set in the execution parameter; wherein the script identification set includes at least one script identification;

[0016] Searching for a test script matching each script identifier in the script identifier set in a category corresponding to the target application in the test script library, and acquiring the found test script from the test script library to generate a temporary script set;

[0017] Determine whether there is a test script with the same script name in the temporary script set;

[0018] If there are test scripts with the same script name in the temporary script set, the test scripts with the same script name are uniformly named according to a preset strategy to update the temporary script set, and the updated temporary script set is determined as the target script set;

[0019] If there is no test script with the same script name in the temporary script set, the temporary script set is determined as the target script set.

[0020] In one embodiment, the step of determining the execution account of the current test based on the branch to be tested includes:

[0021] Obtaining branch information of the branch to be tested;

[0022] Determine a corresponding target scene according to the branch information;

[0023] Matching the target scenario with the account status of each account in a preset account library to obtain a matching degree between the target scenario and each account;

[0024] The account with the highest matching degree with the target scenario among all accounts is determined as the execution account of this test.

[0025] In one embodiment, the step of compiling the target application includes:

[0026] Pulling the source code of the target application;

[0027] The source code is analyzed to obtain an executable file of the target application, so as to complete the compilation of the target application.

[0028] In one embodiment, the step of performing a playback test on the branch to be tested using the target script set under the execution account includes:

[0029] Determining an execution directory in the target application for executing a test script;

[0030] Each test script in the target script set is copied to the execution directory, and the test scripts in the target script set are executed in sequence.

[0031] In one embodiment, the method further comprises:

[0032] Acquire a notifier list of the target application, and determine at least one client corresponding to the notifier list;

[0033] A test analysis report is generated according to the execution result of each test script in the target script set on the to-be-tested branch, and the test analysis report is sent to at least one client corresponding to the notifier list.

[0034] In a second aspect, the present application provides a UI automation testing device, the device comprising:

[0035] A parameter determination module, for determining execution parameters according to the automated test instruction when an automated test instruction is received;

[0036] An information determination module, used to determine a target application and a branch to be tested in the target application according to the execution parameters, and determine an execution account for this test based on the branch to be tested;

[0037] A script set determination module, used to obtain a test script library and determine a target script set in the test script library according to the execution parameter; wherein the test script library includes test scripts uploaded by multiple users;

[0038] An application compiling module, used for compiling the target application;

[0039] A playback test module is used to log in the execution account in the target application when the target application is in a compiled state, perform a playback test on the branch to be tested using the target script set under the execution account, and record the execution result of each test script in the target script set on the branch to be tested.

[0040] In a third aspect, the present application provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the UI automation testing method described in any of the above embodiments.

[0041] In a fourth aspect, the present application provides a computer device, comprising: one or more processors, and a memory;

[0042] The memory stores computer-readable instructions, and when the one or more processors execute the computer-readable instructions, the steps of the UI automation testing method described in any one of the above embodiments are performed.

[0043] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0044] The UI automated testing method, device, storage medium and computer equipment provided by the present application include: determining execution parameters, and determining the target application and the branch to be tested in the target application according to the execution parameters. Then, since the account status of different accounts in the target application is not necessarily the same, it is necessary to determine the execution account of this test according to the branch to be tested, so as to avoid the problem of test failure caused by the strong association of the account status of the execution account with the business scenario. Then improve the stability and test efficiency of automated testing. Then obtain the test script library to determine the target script set in the test script library, when the target application is in a compiled state, log in the execution account in the target application, and use the test script set under the execution account to replay the branch to be tested. In addition, the test script library includes test scripts uploaded by multiple users. In this way, the testers only need to upload their recorded test scripts to the test script library, and set the execution parameters during the test, so as to achieve the replay test of the branch to be tested using the target script set under the execution account, without each tester having to understand the test framework and code, thereby reducing the communication cost and maintenance cost of the test team, so as to achieve the purpose of improving the efficiency of UI automated testing. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0046] Figure 1 A flowchart of a UI automation testing method provided in an embodiment of the present application;

[0047] Figure 2 A flowchart of the steps of determining a target script set in a test script library provided in an embodiment of the present application;

[0048] Figure 3 A flowchart of the steps of determining the execution account of this test based on the branch to be tested provided in an embodiment of the present application;

[0049] Figure 4 A flowchart of the steps of performing a playback test on a branch to be tested using a target script set under an execution account provided in an embodiment of the present application;

[0050] Figure 5 A schematic diagram of the structure of a UI automation testing device provided in an embodiment of the present application;

[0051] Figure 6 An internal structure diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0052] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0053] In one embodiment, the present application provides a UI automated testing method, and the following embodiment is described by applying the method to a server. It can be understood that the UI automated testing method can be executed by a single server or a server cluster composed of multiple servers, and the present application does not make specific restrictions on this.

[0054] like Figure 1 As shown, the present application provides a UI automation testing method, the method comprising:

[0055] Step S101: when an automated test instruction is received, an execution parameter is determined according to the automated test instruction.

[0056] The execution parameters are parameters involved in executing the playback test, including application identifiers, branch identifiers, and script identifier sets.

[0057] In this step, when the user needs to perform automated testing on the UI (User Interface) of the application, the execution parameters can be input through the client to generate automated testing instructions. The client sends the automated testing instructions to the server, and when the server receives the automated testing instructions, it parses the automated testing instructions to determine the execution parameters.

[0058] Step S102: Determine the target application and the branch to be tested in the target application according to the execution parameters, and determine the execution account for this test based on the branch to be tested.

[0059] The target application refers to the application to be tested with UI automation. It is understood that the target application can be a small program. The branch to be tested refers to the code branch to be tested with automation in the target application. The execution account refers to the login account of the target application when performing UI automation testing.

[0060] In this step, the application (target application) to be tested with UI automation can be determined according to the application identifier in the execution parameters, and the code branch (branch to be tested) to be tested with UI automation can be determined in the target application according to the branch identifier in the execution parameters. Next, since the account status of different accounts in the target application may not be consistent, it is necessary to determine the execution account for this test according to the branch to be tested, so as to avoid the problem of test failure caused by the account status of the execution account being strongly associated with the business scenario. For example, if a specific scenario requires a new user, a new account is needed for testing, and some scenarios require users with points or coupons, so an account with points or coupons is needed for testing.

[0061] It is understandable that because the success rate of the test scenario is strongly related to the rights and interests of the account, role and other information, if a single user is used for each UI automation test, the test scenario coverage of this method will be small. In each UI automation test, the execution account is determined based on the branch to be tested. In this way, the coverage of the test scenario can be broadened, and the success rate and test efficiency of the automated test can also be improved.

[0062] Step S103: Acquire a test script library, and determine a target script set in the test script library according to the execution parameters.

[0063] The test script library includes multiple test scripts uploaded by users. The test script library is used to store the test scripts uploaded by users. The target script set refers to the test script set used for playback test in this test.

[0064] Specifically, different business testers can record their own test scenarios to obtain test scripts, and upload the obtained test scripts to the test script library. When the server receives the test scripts uploaded by each user (i.e., business tester), it will save these test scripts in the test script library. Therefore, the test script library is dynamically changing.

[0065] In this step, the test script library at this time is obtained, and then the target script set is determined in the test script library according to the script identification set in the execution parameters. It can be understood that since the user needs to record the scenario use case first and upload the recorded script before the UI automation test can be performed, the test script library contains the scripts required for this test.

[0066] Step S104: compile the target application.

[0067] Among them, compilation refers to the process of converting source code written in a high-level language (such as C, C++, Java, etc.) into machine language or bytecode that can be executed by a computer.

[0068] In this step, the target application needs to be compiled first, so that the target application is in an executable state, and then the branch to be tested in the target application is replayed.

[0069] Step S105: When the target application is in a compiled state, log in to the execution account in the target application, use the target script set to replay the branch to be tested under the execution account, and record the execution result of each test script in the target script set on the branch to be tested.

[0070] The execution results include actual execution results and expected execution results.

[0071] In this step, when the target application is in a compiled state, the login password corresponding to the execution account can be obtained, and the execution account and its corresponding login password can be used to log in to the target application, so as to use the target script set to perform a playback test on the branch to be tested in the state where the execution account is logged in to the target application. In the process of the playback test, the execution result of each test script of the target script set on the branch to be tested is recorded for subsequent test result analysis.

[0072] The UI automated testing method, device, storage medium and computer equipment provided by the present application include: determining execution parameters, and determining the target application and the branch to be tested in the target application according to the execution parameters. Then, since the account status of different accounts in the target application is not necessarily the same, it is necessary to determine the execution account of this test according to the branch to be tested, so as to avoid the problem of test failure caused by the strong association of the account status of the execution account with the business scenario. Then improve the stability and test efficiency of automated testing. Then obtain the test script library to determine the target script set in the test script library, when the target application is in a compiled state, log in to the execution account in the target application, and use the test script set under the execution account to replay the branch to be tested. In addition, the test script library includes test scripts uploaded by multiple users. In this way, the testers only need to upload their recorded test scripts to the test script library, and one of the testers sets the execution parameters during the test, so as to achieve the replay test of the branch to be tested using the target script set under the execution account, without each tester having to understand the test framework and code, thereby reducing the communication cost and maintenance cost of the test team, so as to achieve the purpose of improving the efficiency of UI automated testing.

[0073] In one embodiment, the updating process of the test script library includes:

[0074] For each test script received and uploaded by the user, extract the application identifier, branch identifier, scenario description and script name of the test script;

[0075] The test script and its corresponding branch identifier, scenario description and script name are saved in the test script library under the category corresponding to the application identifier to complete the update of the test script library.

[0076] The user refers to a business tester. The application identifier is used to identify the application program, and the branch identifier is used to identify the code branch. The scenario description is used to describe the content recorded by the test script. It is understandable that the test script library can be divided into different categories according to different application identifiers to facilitate searching when determining the target script set.

[0077] In this embodiment, for each test script received, the application identifier, branch identifier, scenario description and script name in the test script are extracted, and then the category corresponding to the application identifier in the test script library is determined based on the application identifier, and the test script and its application identifier, branch identifier, scenario description and script name are stored under the category to complete the update of the test script library.

[0078] It is understandable that each user records the test scenarios he is familiar with and uploads the corresponding test scripts to the test script library, and finally the server completes the playback test. In this way, multi-person collaborative recording can be achieved, and the recorded test scripts are uniformly stored in the test script library, so that each user only needs to be responsible for part of the recording work, and the playback test process can be completed automatically, reducing the maintenance cost of the test team and further improving the efficiency of UI automation testing.

[0079] like Figure 2 As shown, in one embodiment, the step of determining the target script set in the test script library according to the execution parameter includes:

[0080] Step S201: Obtain a script identification set in the execution parameters.

[0081] The script identifier set includes at least one script identifier.

[0082] Step S202: searching for a test script matching each script identifier in the script identifier set in the category corresponding to the target application in the test script library, and acquiring the found test script from the test script library to generate a temporary script set.

[0083] Exemplarily, assuming that the script identification set in the execution parameters includes script identification A, script identification B and script identification C, and in the category corresponding to the target application in the test script library, there are test script a with script identification A, test script b with script identification B, test script c with script identification C and test script d with script identification D. At this time, the test scripts that can match the script identification set are test script a, test script b and test script c. At this time, a temporary script set including test script a, test script b and test script c is generated.

[0084] Step S203: Determine whether there is a test script with the same script name in the temporary script set.

[0085] It is understandable that when there are test scripts with the same script name in the temporary script set, a conflict with the same name may occur when using the temporary script set for playback testing, resulting in failure of the playback test. Therefore, when obtaining the temporary script set, a judgment will be made as to whether there is a test script with the same script name in the temporary script set.

[0086] Step S204: if there are test scripts with the same script name in the temporary script set, the test scripts with the same script name are uniformly named according to a preset policy to update the temporary script set, and the updated temporary script set is determined as the target script set.

[0087] The preset strategy is used to ensure that there is no test script with the same script name in the target script set.

[0088] In this step, when there are test scripts with the same script name in the temporary script set, the test scripts with the same script name are uniformly named based on the preset strategy to ensure that there are no test scripts with the same script name in the target script set. Finally, the updated temporary script set is determined as the target script set.

[0089] Step S205: If there is no test script with the same script name in the temporary script set, the temporary script set is determined as the target script set.

[0090] In this step, when there is no test script with the same script name in the temporary script set, there is no need to update the temporary script set, and the temporary script set can be directly determined as the target script set.

[0091] It is understandable that since the test scripts are uploaded by multiple users, each user may have different names. By checking the scripts with the same name, the playback test failure caused by the same name conflict can be avoided, thereby improving the stability and test efficiency of UI automation testing.

[0092] like Figure 3 As shown, in one embodiment, the step of determining the execution account of this test based on the branch to be tested includes:

[0093] Step S301: Obtain branch information of a branch to be tested.

[0094] The branch information is used to describe the implementation function of the branch to be tested.

[0095] Step S302: Determine the corresponding target scene according to the branch information.

[0096] Among them, the target scenario refers to the usage situation or application scenario, which involves specific environment, conditions, behaviors or events.

[0097] In this step, the target scenario corresponding to the branch to be tested is determined according to the implementation function of the branch to be tested described in the branch information.

[0098] Step S303: Match the target scenario with the account status of each account in the preset account library to obtain the matching degree between the target scenario and each account.

[0099] The account library refers to a collection of accounts that can be used to perform automated testing, including at least one account. The account status is used to represent the rights and interests information of the corresponding account.

[0100] In this step, the target scenario is matched with the account status of each account in the account library, and then the account with the highest matching degree with the target scenario is determined as the execution account of this test.

[0101] Furthermore, when calculating the matching degree between the target scenario and each account in the account library, the matching degree can be determined by analyzing the fit between the account status of each account and the target scenario. The matching degree can also be determined by a pre-trained deep learning model. This application does not impose specific restrictions on this.

[0102] Step S304: The account with the highest matching degree with the target scenario among all accounts is determined as the execution account for this test.

[0103] It is understandable that by determining the execution account of this test based on the matching degree of the target scenario corresponding to the branch to be tested, the execution account with the highest matching degree with the branch to be tested can be determined, thus avoiding the test failure problem caused by the account status of the execution account being strongly associated with the business scenario, thereby improving the stability and test efficiency of UI automation testing.

[0104] In one embodiment, the step of compiling the target application includes:

[0105] Pull the source code of the target application;

[0106] Perform source program analysis on the source code to obtain the executable file of the target application to complete the compilation of the target application.

[0107] Source code is a text file written in a programming language that contains instructions and structures used to define the behavior of a computer program. An executable file is generated by compiling or interpreting the source code.

[0108] In this embodiment, the source code of the target application can be pulled from the remote warehouse, and then the source code is analyzed, including lexical analysis, syntax analysis, semantic analysis, etc. Then the executable file of the target application is obtained, so that the target application is in an executable state, so as to complete the compilation of the target application, and then the branch to be tested in the target application can be replayed.

[0109] like Figure 4 As shown, in one embodiment, the step of replaying the branch to be tested using the target script set under the execution account includes:

[0110] Step S401: Determine the execution directory in the target application for executing the test script.

[0111] The execution target refers to a specific directory in the target application used to execute the test script.

[0112] In this step, a configuration file of the target application may be obtained, and an execution directory for executing the test script in the target application may be determined according to the configuration file.

[0113] Step S402: copy each test script in the target script set to the execution directory, and execute the test scripts in the target script set in sequence.

[0114] In this step, the test scripts in the target script set are executed in sequence to complete the playback test of the branch to be tested.

[0115] It is understandable that executing the test scripts in the target script set in sequence can batch test the functions and scenarios of the branches to be tested, effectively ensuring the correctness and stability of various functions of the target application during its use. This process not only helps to discover and fix potential program errors and logical defects, but also improves software quality and reduces subsequent maintenance costs, further improving the efficiency of UI automation testing.

[0116] In one embodiment, the UI automation testing method further includes:

[0117] Obtain a notifier list of the target application, and determine at least one client corresponding to the notifier list;

[0118] A test analysis report is generated according to the execution result of each test script in the target script set on the branch to be tested, and the test analysis report is sent to at least one client corresponding to the notifier list.

[0119] The notifier list refers to the information of the personnel to be notified of the test results of the corresponding application program. The notifier list includes at least one data record, and each data record in the notifier list represents a notifier or a client.

[0120] In this embodiment, by obtaining the notification list of the target application, and then determining the client corresponding to each data record according to each data record in the notification list, then generating a test analysis report according to the execution result of each test script in the target script set on the branch to be tested, and then sending the test analysis report to the client corresponding to each data record in the notification list.

[0121] Furthermore, a test analysis report can be generated by analyzing the execution results of each test script in the target script set on the branch to be tested, and combining the scenario description of each test script. A deep learning model can also be trained based on historical test data, and then the deep learning model is used to analyze the execution results of each test script in the target script set on the branch to be tested to obtain a test analysis report. This application does not make specific restrictions on this.

[0122] It is understandable that by analyzing the execution results, obtaining a test analysis report, and sending the test analysis report to the preset client to be notified, the client can receive and understand the test results of the playback test in a timely manner, and the tester can directly view the test analysis report. This saves the tester's time cost and can also improve the efficiency of finding problems, thereby improving the efficiency of UI automation testing.

[0123] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0124] The following is a description of a UI automation testing device provided in an embodiment of the present application. The UI automation testing device described below and the UI automation testing method described above can refer to each other.

[0125] like Figure 5 As shown, the present application provides a UI automation testing device 500, the device comprising:

[0126] The parameter determination module 501 is used to determine the execution parameters according to the automated test instruction when receiving the automated test instruction;

[0127] The information determination module 502 is used to determine the target application and the branch to be tested in the target application according to the execution parameters, and determine the execution account of this test based on the branch to be tested;

[0128] The script set determination module 503 is used to obtain a test script library and determine a target script set in the test script library according to the execution parameters; wherein the test script library includes test scripts uploaded by multiple users;

[0129] An application compiling module 504, used to compile a target application;

[0130] The playback test module 505 is used to log in to the execution account in the target application when the target application is in a compiled state, perform playback testing on the branch to be tested using the target script set under the execution account, and record the execution results of each test script in the target script set on the branch to be tested.

[0131] In one embodiment, the script set determination module includes:

[0132] The information extraction submodule is used to extract the application identifier, branch identifier, scenario description and script name of each test script uploaded by the user;

[0133] The script library update submodule is used to save the test script and its corresponding branch identifier, scenario description and script name to the category corresponding to the application identifier in the test script library to complete the update of the test script library.

[0134] In one embodiment, the script set determination module includes:

[0135] The identification set acquisition submodule is used to acquire the script identification set in the execution parameters; wherein the script identification set includes at least one script identification;

[0136] A script search submodule, used to search for a test script matching each script identifier in the script identifier set in a category corresponding to the target application in the test script library, and obtain the found test script from the test script library to generate a temporary script set;

[0137] A judgment submodule is used to judge whether there is a test script with the same script name in the temporary script set;

[0138] The first determination submodule is used for, if there are test scripts with the same script name in the temporary script set, uniformly naming the test scripts with the same script name according to a preset strategy to update the temporary script set, and determining the updated temporary script set as the target script set;

[0139] The second determination submodule is used to determine the temporary script set as the target script set if there is no test script with the same script name in the temporary script set.

[0140] In one embodiment, the information determination module includes:

[0141] The information acquisition submodule is used to obtain the branch information of the branch to be tested;

[0142] A scene determination submodule is used to determine the corresponding target scene according to the branch information;

[0143] A matching submodule, used to match the target scenario with the account status of each account in the preset account library, and obtain the matching degree between the target scenario and each account;

[0144] The account determination submodule is used to determine the account with the highest matching degree with the target scenario among all accounts as the execution account of this test.

[0145] In one embodiment, the application compilation module includes:

[0146] The code pull submodule is used to pull the source code of the target application;

[0147] The application compilation submodule is used to perform source program analysis on the source code to obtain the executable file of the target application to complete the compilation of the target application.

[0148] In one embodiment, the playback test module includes:

[0149] A directory determination submodule, used to determine the execution directory for executing the test script in the target application;

[0150] The script execution submodule is used to copy each test script in the target script set to the execution directory and execute the test scripts in the target script set in sequence.

[0151] In one embodiment, the UI automation testing device further includes:

[0152] A client determination module, used to obtain a notifier list of a target application and determine at least one client corresponding to the notifier list;

[0153] The report generation module is used to generate a test analysis report according to the execution result of each test script in the target script set on the branch to be tested, and send the test analysis report to at least one client corresponding to the notification list.

[0154] The division of each module in the above-mentioned UI automation test device is only for illustration. In other embodiments, the UI automation test device can be divided into different modules as needed to complete all or part of the functions of the above-mentioned UI automation test device. Each module in the above-mentioned UI automation test device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0155] In one embodiment, the present application further provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the UI automation testing method described in any of the above embodiments.

[0156] In one embodiment, the present application further provides a computer device having computer-readable instructions stored therein. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the UI automation testing method described in any one of the above embodiments.

[0157] Indicatively, if Figure 6 As shown, Figure 6 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. The computer device 600 may be provided as a server. Figure 6 , the computer device 600 includes a processing component 602, which further includes one or more processors, and a memory resource represented by a memory 601, for storing instructions that can be executed by the processing component 602, such as an application. The application stored in the memory 601 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 602 is configured to execute instructions to perform the UI automation testing method of any of the above embodiments.

[0158] The computer device 600 may further include a power supply component 603 configured to perform power management of the computer device 600, a wired or wireless network interface 604 configured to connect the computer device 600 to a network, and an input / output (I / O) interface 605. The computer device 600 may operate based on an operating system stored in the memory 601, such as Windows Server TM, Mac OS X TM, Unix TM, Linux TM, Free BSD TM, or the like.

[0159] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0160] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish an entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only include those elements, but also include other elements that are not clearly listed, or also include elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements limited by the sentence "comprise one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements. Herein, the singular "one", "one" and "described / the" may also include plural forms, unless the context clearly indicates another way. It should also be understood that the terms "include / comprise" or "have" etc. specify the existence of stated features, wholes, steps, operations, components, parts or combinations thereof, but do not exclude the possibility of the existence or addition of one or more other features, wholes, steps, operations, components, parts or combinations thereof. At the same time, the term "and / or" used in this specification includes any and all combinations of the relevant listed items.

[0161] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.

[0162] 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 may 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 conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A UI automation testing method, It is characterized in that The method comprises: When receiving an automated test instruction, determining execution parameters according to the automated test instruction; Determine a target application and a branch to be tested in the target application according to the execution parameters, and determine an execution account for this test based on the branch to be tested; Acquire a test script library, and determine a target script set in the test script library according to the execution parameter; wherein the test script library includes test scripts uploaded by multiple users; Compiling the target application; When the target application is in a compiled state, the execution account is logged in the target application, the target script set is used under the execution account to perform a playback test on the branch to be tested, and the execution result of each test script in the target script set on the branch to be tested is recorded.

2. The UI automation testing method according to claim 1, It is characterized in that The updating process of the test script library includes: For each test script received and uploaded by the user, extract the application identifier, branch identifier, script identifier, scenario description, and script name of the test script; The test script and its corresponding branch identifier, script identifier, scenario description and script name are saved in the test script library under the category corresponding to the application identifier to complete the update of the test script library.

3. The UI automation testing method according to claim 1 or 2, It is characterized in that The step of determining the target script set in the test script library according to the execution parameter comprises: Acquire a script identification set in the execution parameter; wherein the script identification set includes at least one script identification; Searching for a test script matching each script identifier in the script identifier set in a category corresponding to the target application in the test script library, and acquiring the found test script from the test script library to generate a temporary script set; Determine whether there is a test script with the same script name in the temporary script set; If there are test scripts with the same script name in the temporary script set, the test scripts with the same script name are uniformly named according to a preset strategy to update the temporary script set, and the updated temporary script set is determined as the target script set; If there is no test script with the same script name in the temporary script set, the temporary script set is determined as the target script set.

4. The UI automation testing method according to claim 1, It is characterized in that The step of determining the execution account of the current test based on the branch to be tested includes: Obtaining branch information of the branch to be tested; Determine a corresponding target scene according to the branch information; Matching the target scenario with the account status of each account in a preset account library to obtain a matching degree between the target scenario and each account; The account with the highest matching degree with the target scenario among all accounts is determined as the execution account of this test.

5. The UI automation testing method according to claim 1, It is characterized in that The step of compiling the target application comprises: Pulling the source code of the target application; The source code is analyzed to obtain an executable file of the target application, so as to complete the compilation of the target application.

6. The UI automation testing method according to claim 1, It is characterized in that The step of performing a playback test on the branch to be tested by using the target script set under the execution account includes: Determining an execution directory in the target application for executing a test script; Each test script in the target script set is copied to the execution directory, and the test scripts in the target script set are executed in sequence.

7. The UI automation testing method according to claim 1, It is characterized in that The method further comprises: Acquire a notifier list of the target application, and determine at least one client corresponding to the notifier list; A test analysis report is generated according to the execution result of each test script in the target script set on the to-be-tested branch, and the test analysis report is sent to at least one client corresponding to the notifier list.

8. A UI automated testing device, It is characterized in that The device comprises: A parameter determination module, for determining execution parameters according to the automated test instruction when an automated test instruction is received; An information determination module, used to determine a target application and a branch to be tested in the target application according to the execution parameters, and determine an execution account for this test based on the branch to be tested; A script set determination module, used to obtain a test script library and determine a target script set in the test script library according to the execution parameter; wherein the test script library includes test scripts uploaded by multiple users; An application compiling module, used for compiling the target application; A playback test module is used to log in the execution account in the target application when the target application is in a compiled state, perform a playback test on the branch to be tested using the target script set under the execution account, and record the execution result of each test script in the target script set on the branch to be tested.

9. A storage medium, Features: The storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the UI automation testing method according to any one of claims 1 to 7.

10. A computer device, It is characterized in that include: one or more processors, and memory; The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the UI automation testing method according to any one of claims 1 to 7 are executed.