A UI automated testing method, device, computer equipment and storage medium
By disconnecting the long-term connection with the test terminal during automated testing of the Android system and using the service process to complete the test requirements, the problem of test interruption is solved and efficient automated testing and resource saving are achieved.
Patent Information
- Application Number
- CN202311126238.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-01
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2043-09-01
AI Technical Summary
When conducting automated testing of the Android system, the connection to the device under test cannot be maintained for a long time, causing the test to be unable to continue.
By receiving the file package transmitted by the test end on the device under test, check the survival status of the service process, disconnect when the service process is alive, receive the test requirements, and use the service process to complete automated testing based on the test requirements to avoid long connection to achieve offline execution and resource saving.
It solves the problem of test interruption caused by disconnection, enables the test to be completed without a long connection, and improves test efficiency and resource utilization.
Smart Images

Figure CN117149638B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a UI automation testing method, device, computer equipment and storage medium. Background Art
[0002] Android system hardware is diverse, such as: mobile phones, tablets, TVs, car computers, robots, smart hardware, etc. When performing actual system automation testing, you may encounter situations where you cannot connect to the device under test through a data cable or network for a long time. Once you lose connection with the device under test, you cannot continue to complete the test.
[0003] Therefore, how to avoid the above situation and complete system automation testing has become a problem that needs to be solved at present. Summary of the invention
[0004] In view of this, the present invention provides a UI automation testing method, apparatus, computer equipment and storage medium to solve the problem that the test cannot be completed due to the inability to connect to the tested device for a long time.
[0005] In a first aspect, the present invention provides a UI automation testing method, which is executed by a device to be tested, and includes:
[0006] Receive the file package transmitted by the test end, which includes the test application; check the survival status of the service process; when the service process is in the survival state, disconnect from the test end and receive the test requirements, which are generated by the test application; based on the test requirements, use the service process to complete the automated test of the device under test.
[0007] The UI automated testing method provided in this embodiment, after receiving the file package transmitted by the test end, first determines whether the device under test meets the test prerequisite of the automated test by checking the survival status of the service process. When the service process is in a survival state, it can be disconnected from the test end and receive the test requirements so that the automated testing process can be completed using the service process based on the test requirements. In the above manner, this embodiment avoids long-term connection with the test end, solves the problem of being unable to continue testing when disconnected, and achieves the effect of offline execution and reducing hardware occupancy during execution.
[0008] In an optional embodiment, the method further includes:
[0009] When the service process is in a non-living state, establish a connection with the test end to start the service process.
[0010] In an optional implementation, based on the test requirements, the service process is used to complete the automated test of the device to be tested, including:
[0011] Configure the test task based on the test requirements and generate a test configuration file; extract the task configuration parameters from the test configuration file; determine whether the current test task is an interruption-retest task based on the task configuration parameters and obtain the determination result; perform automated testing on the device under test based on the determination result.
[0012] In an optional implementation, the file package further includes a parsing script, a first configuration file, and a second configuration file, and an automated test is performed on the device to be tested based on the judgment result, including:
[0013] When the judgment result is that the current test task is not a test task after interruption, the first configuration file is parsed by using the parsing script to obtain dependent functions and variables; the second configuration file is parsed by using the parsing script to obtain a use case execution list; combined with the dependent functions and variables, each use case is run according to the use case execution list by using the service process to complete the automated test of the device under test.
[0014] In an optional implementation, when the current test task is a test task after interruption, before parsing the first configuration file using the parsing script to obtain dependent functions and variables, the method further includes:
[0015] Get the execution result corresponding to the interruption; update the starting execution status of the automated test based on the execution result.
[0016] The UI automated testing method provided in this embodiment can continue to run from the location where the interruption occurred after the service process is abnormally interrupted and restarted, thereby avoiding resource occupation of rerunning, saving testing time, and improving testing efficiency.
[0017] In an optional implementation, after completing the automated test of the device to be tested by using the service process based on the test requirements, the method further includes:
[0018] Generate prompt information and display the prompt information on the interactive interface of the test application.
[0019] In an optional implementation, after generating the prompt information and displaying the prompt information on the interactive interface of the test application, the method further includes:
[0020] When a query instruction is received, the test data, test log and test results of the automated test are obtained; the test data, test log and test results are processed, and the processing results are displayed on the interactive interface.
[0021] This embodiment processes all test data, test logs and test results, and displays the processing results on an interactive interface, so that the tester can analyze the test process based on the processing results.
[0022] In a second aspect, the present invention provides a UI automation testing device, the device comprising:
[0023] The first receiving module is used to receive the file package transmitted by the test end, which includes the test application; the checking module is used to check the survival status of the service process; the second receiving module is used to disconnect from the test end when the service process is in the survival state and receive the test requirements, which are generated by the test application; the testing module is used to complete the automated testing of the device to be tested using the service process based on the test requirements.
[0024] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the UI automation testing method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0025] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the UI automation testing method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0027] Figure 1 is a flowchart of a UI automation testing method according to an embodiment of the present invention;
[0028] Figure 2 is a flowchart of another UI automation testing method according to an embodiment of the present invention;
[0029] Figure 3 is a flowchart of another UI automation testing method according to an embodiment of the present invention;
[0030] Figure 4 is a structural block diagram of a UI automation testing device according to an embodiment of the present invention;
[0031] Figure 5 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0033] When the system automation test is actually performed, the test end and the device under test need to be connected at all times. Once the connection is disconnected, the test cannot be completed. To solve the above problem, an embodiment of the present invention provides a UI automation test method, in which the device under test only needs to be connected to the test segment for a short time. After the device under test receives the file package transmitted by the test end and establishes a connection with the test end, the startup service process of the device under test has been started, and the connection with the test end can be disconnected at this time. When the device under test receives the test request, the automated test can be completed through the service process. The embodiment of the method can avoid the situation of being connected to the test end for a long time in the above manner, solves the problem of being unable to continue to complete the test due to disconnection, thereby achieving the effect of completing the test without a long connection.
[0034] According to an embodiment of the present invention, an embodiment of a UI automated testing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0035] In this embodiment, a UI automation testing method is provided, which can be used for any Android hardware device, such as mobile phones, watches, TVs, car computers, etc. Figure 1 is a flowchart of a UI automation testing method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0036] Step S101, receiving a file package transmitted by a test end.
[0037] Specifically, the test end is connected to the device under test via Android Debug Bridge (abbreviated as adb). The file package includes a test application, which is an application program and file used to execute a test function.
[0038] Exemplarily, after the device under test establishes a connection with the test end, when the device under test receives the file package transmitted by the test end, the test application is installed in the device under test. During the installation process, the device under test only needs to receive but does not need to respond.
[0039] Exemplarily, in addition to the test application (i.e., test.apk), the file package also includes dependent files, including other test applications (i.e., 2.0 customized apk, actions.apk), Android-side command line tool execution files (am, pm, dumpsys, etc.), shell parsing scripts, and configuration files that are dependent on the test process. The configuration file includes a first configuration file with an extension of .sl and a second configuration file with an extension of .tc, wherein the first configuration file includes basic functions and variables that are dependent on during the execution of the use case, and the second configuration file includes test cases. The dependent files recorded in this embodiment are used to provide a file basis for the test process.
[0040] Step S102, checking the survival status of the service process.
[0041] Specifically, there are two kinds of survival states of the service process, namely, the survival state and the non-survival state. The method of checking the survival state is not specifically limited here, and those skilled in the art can choose it according to the actual situation.
[0042] Exemplarily, in this embodiment, the survival status of the service process is determined in the following manner. When the device to be tested is an Android device, the background process has a process number, i.e., pid. Since Android runs on the linx kernel, the process corresponds to the proc pseudo-system rule, $pid is the process number, and the path / proc / $pid / cmdline is the command line command and parameter file. Therefore, when the folder "path / proc / pid" exists, it is determined that the service process is in a survival state.
[0043] Step S103: When the service process is in a live state, it disconnects from the test end and receives a test request.
[0044] Specifically, when the service process is in a live state, it means that the device under test has met the test conditions, and at this time, the connection with the test end can be disconnected. When a test requirement generated by the test application is received, the test can be started.
[0045] Exemplarily, in another optional embodiment, when the service process is in a non-survival state, a connection is established with the test end to start the service process.
[0046] Specifically, when the service process is in a non-survival state, it means that the device under test does not meet the test conditions. To conduct a test, a connection must be established with the test end, and the test end must start the service process before the test can begin.
[0047] Step S104: Based on the test requirements, the service process is used to complete the automated test of the device to be tested.
[0048] Specifically, the service process executes the test case to complete the automated test of the device under test.
[0049] The UI automated testing method provided in this embodiment, after receiving the file package transmitted by the test end, first determines whether the device under test meets the test prerequisite of the automated test by checking the survival status of the service process. When the service process is in a survival state, it can be disconnected from the test end and receive the test requirements so that the automated testing process can be completed using the service process based on the test requirements. In the above manner, this embodiment avoids long-term connection with the test end, solves the problem of being unable to continue testing when disconnected, and achieves the effect of offline execution and reducing hardware occupancy during execution.
[0050] In this embodiment, a UI automation testing method is provided, which can be used for any Android hardware device, such as mobile phones, watches, TVs, car computers, etc. Figure 2 is a flowchart of a UI automation testing method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0051] Step S201: Receive the file package transmitted by the test end. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0052] Step S202: Check the survival status of the service process. Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.
[0053] Step S203: When the service process is in a live state, disconnect from the test end and receive test requirements. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.
[0054] Step S204: Based on the test requirements, the service process is used to complete the automated test of the device to be tested.
[0055] Specifically, the above step S204 includes:
[0056] Step S2041, configure the test task based on the test requirements and generate a test configuration file.
[0057] Specifically, each test requirement corresponds to a test task, and each test task has a corresponding test configuration file, which includes task parameter configuration, loop configuration, and parallel background script configuration.
[0058] The task configuration parameters are used to uniquely identify the test task, that is, the task configuration parameters correspond one-to-one to the test configuration file.
[0059] The loop configuration includes loop type configuration and loop value configuration. The loop type is the number of loops or the loop duration, and the loop value corresponds to the loop type. For example, the use cases corresponding to a certain test requirement include use case a, use case b, and use case c. When the configured loop type is the number of loops and the loop value is 10, it means that each use case will be run 10 times in sequence, that is, use case a will run 10 times, then use case b will run 10 times, and finally use case c will run 10 times, and then the run will end. When the configured loop type is the loop duration and the loop value is 30 seconds, it means that use case a will start running at the time it starts, and use case b will start running 30 seconds later. Similarly, use case b will start running 30 seconds after use case c runs, and use case c will end running 30 seconds later.
[0060] The background script configuration includes other tasks that need to be run while running the current test task. For example, you can run a performance monitoring script while testing to monitor the performance data of the device during operation. The purpose of configuring the background script is to implement testing capabilities such as performance testing and load stress testing to expand testing requirements beyond UI automation testing.
[0061] Step S2042: extracting task configuration parameters from the test configuration file.
[0062] Specifically, the test configuration file is parsed according to a preset parsing rule, and task configuration parameters are extracted from the test configuration file after parsing. It should be noted that the task configuration parameters are used to represent the test configuration file.
[0063] Exemplarily, the parsing script parses the configuration file according to preset parsing rules. The preset parsing rules may be to parse the number of columns with tab delimiters, and different parsing rules correspond to different numbers of columns and English names of designated columns.
[0064] Step S2043, judging whether the current test task is an interruption-retest task based on the task configuration parameters, and obtaining a judgment result.
[0065] Specifically, it is determined whether there is historical test data corresponding to the task configuration parameters in the preset storage location. If there is, it indicates that the current test task has been started but not completed, that is, the current test task is a test task after interruption. When there is no historical test data corresponding to the task configuration parameters in the preset storage location, it indicates that the current test task has not been started, that is, the current test task is not a test task after interruption. The preset storage location is used to store the test data generated during the test process.
[0066] Step S2044: perform automated testing on the device to be tested based on the determination result.
[0067] In some optional implementations, the above step S2044 includes:
[0068] Step a1: when the judgment result is that the current test task is not a test task after interruption, the first configuration file is parsed by using a parsing script to obtain dependent functions and variables.
[0069] Specifically, the parsing script parses the first configuration file in the same manner as the parsing method in the embodiment of step S2042. The first configuration file is a file with an extension of .sl, which is used to store dependent functions and variables required during the running of the use case.
[0070] Step a2: parse the second configuration file using a parsing script to obtain a use case execution list.
[0071] Specifically, the second configuration file includes all the use cases required for the test. After the second configuration file is parsed using the parsing script, the use cases corresponding to the current test requirements are extracted from the parsed second configuration file according to the preset mapping relationship between "test requirements and use cases". A use case execution list is generated according to the loop configuration in the test configuration file, and a corresponding file name is configured for each use case in the use case execution list, and the file name uses .tc as the extension. It should be noted that the mapping relationship between "test requirements and use cases" is constructed by technicians in this field based on the test requirements before the test, and can be stored in the memory of the device to be tested in advance.
[0072] For example, according to the mapping relationship between "test requirements and use cases", the use cases corresponding to the current test requirements are determined to be use case a, use case b, and use case c. A use case execution list is generated according to the configured number of loops. In this embodiment, the number of loops is 10 times, so there are 30 use cases in the use case execution list, and a corresponding file name is configured for each use case, which is used to identify the use case. It should be noted that during the operation, each use case adopts a "read and burn" method, that is, when a use case is executed, the test data corresponding to the use case is immediately written to the preset storage location, and then the use case is deleted from the use case execution list.
[0073] Step a3: Combine dependent functions and variables and use the service process to run each use case according to the use case execution list to complete the automated test of the device under test.
[0074] Specifically, during the operation, the service process runs each use case in the use case execution list in turn, and during the execution of the use case, the dependent functions and variables corresponding to the use case are loaded in real time. When all the use cases in the use case execution list are executed, the automated testing process of the device under test ends.
[0075] It should be noted that when using the service to run the use case, the corresponding process needs to be started according to the configuration of the parallel background script recorded in step S2041, and run in parallel with the service process to complete the collection of performance data during the operation.
[0076] In some optional implementations, when the current test task is a test task after interruption, before the above step a1, it also includes:
[0077] Step b1, obtaining the execution result corresponding to the interruption.
[0078] Specifically, when the current test task is a test task after an interruption, the last test data is obtained from the preset storage location, and the file name corresponding to the last test data is used to determine the use case that was completed when the interruption occurred (that is, the execution result corresponding to the interruption occurred).
[0079] Exemplarily, each time a use case is executed, a test data is generated. For example, there are 30 use cases in the use case execution list, and the file names corresponding to the use cases are x001.tc, x002.tc, ..., x030.tc. During the test, when the 14th use case is completed and the 15th is running, an exception occurs, causing the service process to be interrupted. When the service is started again, the last test data is read from the preset storage location, and the use case file name is extracted from the last test data. The use case file name is x014.tc. Based on the file name, it can be known that the 14th use case has been completed when the interruption occurs.
[0080] Step b2: updating the initial execution status of the automated test based on the execution result.
[0081] For example, still taking the embodiment in step b1 as an example, it is determined that the execution result when the interruption occurs is that the 14th use case has been completed. Then, the 15th use case in the use case execution list can be directly used as the starting execution use case (i.e., the starting execution state) of this automated test. When starting to run, it can be directly started from the 15th use case.
[0082] The UI automated testing method provided in this embodiment can continue to run from the location where the interruption occurred after the service process is abnormally interrupted and restarted, thereby avoiding resource occupation of rerunning, saving testing time, and improving testing efficiency.
[0083] In this embodiment, a UI automation testing method is provided, which can be used for any Android hardware device, such as mobile phones, watches, TVs, car computers, etc. Figure 3 is a flowchart of a UI automation testing method according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:
[0084] Step S301, receiving a file package transmitted by a test end.
[0085] Step S302, checking the survival status of the service process.
[0086] Step S303: When the service process is in a live state, it disconnects from the test end and receives a test request.
[0087] Step S304: Based on the test requirements, the service process is used to complete the automated test of the device to be tested.
[0088] After the above step S304, the method further includes:
[0089] Step S305: generate prompt information, and display the prompt information on the interactive interface of the test application.
[0090] Specifically, the prompt information is information indicating that the test is completed. Displaying the prompt information on the interactive interface of the test application can help testers understand the test progress and view the test results.
[0091] Step S306, when a query instruction is received, the test data, test log and test result of the automated test are obtained.
[0092] Specifically, when each test case is run, the test data, test log and test result corresponding to the test case will be generated. When a query instruction is received, the test data, test log and test result corresponding to each test case in the automated test process are obtained from the preset storage location.
[0093] Step S307, process the test data, test logs and test results, and display the processing results on the interactive interface.
[0094] Specifically, the test data, test logs and test results are analyzed and processed respectively, and the obtained processing results are displayed respectively. This embodiment does not specifically limit the analysis and processing method, and those skilled in the art can select it according to actual display requirements.
[0095] This embodiment performs statistical processing on all test data, test logs and test results, and displays the processing results on an interactive interface, so that testers can analyze the test process based on the processing results.
[0096] In this embodiment, a UI automated testing device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0097] This embodiment provides a UI automation testing device, such as Figure 4 As shown, including:
[0098] The first receiving module 401 is used to receive a file package transmitted by a test end, where the file package includes a test application.
[0099] The checking module 402 is used to check the survival status of the service process.
[0100] The second receiving module 403 is used to disconnect from the test end when the service process is in a live state and receive a test requirement generated by a test application.
[0101] The testing module 404 is used to complete the automated testing of the device to be tested by using the service process based on the testing requirements.
[0102] In some optional embodiments, the above device further includes:
[0103] The connection module is used to establish a connection with the test end to start the service process when the service process is in a non-living state.
[0104] In some optional implementations, the testing module 404 includes:
[0105] The generation submodule is used to configure test tasks based on test requirements and generate test configuration files.
[0106] Extraction submodule, used to extract task configuration parameters from test configuration files.
[0107] The judgment submodule is used to judge whether the current test task is an interruption re-test task based on the task configuration parameters, and obtain the judgment result.
[0108] The test submodule is used to perform automated testing on the device under test based on the judgment results.
[0109] In some optional implementations, the file package in the first receiving module 401 also includes a parsing script, a first configuration file, and a second configuration file, and the test submodule includes:
[0110] The first parsing unit is used to parse the first configuration file using a parsing script to obtain dependent functions and variables when the judgment result is that the current test task is not a test task after interruption.
[0111] The second parsing unit is used to parse the second configuration file using a parsing script to obtain a use case execution list.
[0112] The running unit is used to combine dependent functions and variables, and use the service process to run each use case according to the use case execution list to complete the automated test of the device under test.
[0113] In some optional implementations, when the current test task in the judgment submodule is a test task after interruption, before the first parsing unit, it also includes:
[0114] The acquisition unit is used to obtain the corresponding execution result when an interrupt occurs.
[0115] The updating unit is used to update the initial execution state of the automated test based on the execution result.
[0116] In some optional implementations, after the test module 404, the apparatus further includes:
[0117] The generation module is used to generate prompt information and display the prompt information on the interactive interface of the test application.
[0118] In some optional implementations, after generating the module, the apparatus further includes:
[0119] The acquisition module is used to acquire the test data, test log and test results of the automated test when receiving a query instruction.
[0120] The storage module is used to process the test data, test logs and test results, and display the processing results on the interactive interface.
[0121] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0122] The UI automated testing apparatus in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0123] The embodiment of the present invention also provides a computer device having the above Figure 4 The UI automation test setup is shown.
[0124] See also Figure 5 , Figure 5 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 5As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.
[0125] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0126] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0127] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0128] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0129] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0130] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0131] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A UI automation testing method, characterized in that: The method is performed by a device under test, and the method includes: Receiving a file package transmitted by a test end, wherein the file package includes a test application; Check the survival status of the service process; When the service process is in a live state, disconnecting from the test end and receiving a test requirement, the test requirement is generated by the test application; Based on the test requirements, the service process is used to complete the automated test of the device to be tested; Wherein, based on the test requirement, using the service process to complete the automated test of the device under test includes: Perform test task configuration based on the test requirements and generate a test configuration file; Extracting task configuration parameters from the test configuration file; Determine whether the current test task is an interruption-retest task based on the task configuration parameters, and obtain a determination result; An automated test is performed on the device under test based on the judgment result.
2. The method according to claim 1, characterized in that The method further comprises: When the service process is in a non-living state, a connection is established with the test end to start the service process.
3. The method according to claim 1, characterized in that: The file package also includes a parsing script, a first configuration file, and a second configuration file. The automated test of the device under test based on the judgment result includes: When the judgment result is that the current test task is not the post-interruption test task, the first configuration file is parsed using the parsing script to obtain dependent functions and variables; Parsing the second configuration file using the parsing script to obtain a use case execution list; In combination with dependent functions and variables, the service process is used to run each use case according to the use case execution list to complete the automated test of the device under test.
4. The method according to claim 3, characterized in that When the current test task is the post-interruption test task, before the first configuration file is parsed using the parsing script to obtain dependent functions and variables, the method further includes: Get the execution result corresponding to the interruption; The initial execution state of the automated test is updated based on the execution result.
5. The method according to claim 1, characterized in that After completing the automated test of the device under test by using the service process based on the test requirement, the method further includes: Prompt information is generated, and the prompt information is displayed on the interactive interface of the test application.
6. The method according to claim 5, characterized in that After generating prompt information and displaying the prompt information on the interactive interface of the test application, the method further includes: When receiving a query instruction, obtain the test data, test log and test results of the automated test; The test data, the test log and the test result are processed, and the processing result is displayed on an interactive interface.
7. A UI automated testing device, characterized in that: The device comprises: A first receiving module, configured to receive a file package transmitted by a test end, wherein the file package includes a test application; Check module, used to check the survival status of the service process; A second receiving module is used to disconnect from the test end when the service process is in a live state and receive a test requirement, where the test requirement is generated by the test application; A test module, used to complete the automated test of the device to be tested by using the service process based on the test requirements; The test module is specifically used for: Perform test task configuration based on the test requirements and generate a test configuration file; Extracting task configuration parameters from the test configuration file; Determine whether the current test task is an interruption-retest task based on the task configuration parameters, and obtain a determination result; An automated test is performed on the device under test based on the judgment result.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the UI automation testing method according to any one of claims 1 to 6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the UI automation testing method according to any one of claims 1 to 6.
