Automatic testing method and system for cloud software

By generating a software component tree and using mouse clicks to generate automated test scripts, and combining with cloud platform to distribute and execute test tasks, the problems of low automation testing efficiency and low code reuse in the existing technology are solved, and efficient and high-quality automated testing is achieved.

CN119782163AInactive Publication Date: 2025-04-08CHERY AUTOMOBILE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411851509.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-04-08
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing automated testing methods have problems in on-board entertainment systems with low code reuse rates and waste of manpower and material resources, and the testing process lacks visualization and efficient scripting methods.

Method used

By generating a software component tree, using mouse click operations to generate automated test scripts, and combining with cloud platform to distribute and execute test tasks to achieve distributed concurrent testing.

Benefits of technology

It improves the efficiency and quality of automated testing, lowers the code capability threshold for testers, saves resources, and realizes real-time monitoring and data analysis support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119782163A_ABST
    Figure CN119782163A_ABST
Patent Text Reader

Abstract

The invention discloses a cloud software automatic testing method and system, and belongs to the technical field of automobile testing. Comprising the steps of obtaining a projection of to-be-tested software, and generating a software component tree of the to-be-tested software according to the projection of the to-be-tested software; according to the software component tree, determining a tested component and a corresponding test action in response to a click operation of a tester, generating a test task and distributing the test task to a plurality of test units; the test unit is used for automatically testing the tested component according to the received test task to generate a test log; a final test result is obtained, and the final test result is generated by analyzing the test log through the log server and the main control server. The matching performance of automatic testing and vehicle machine rack automatic testing can be improved, the automatic testing efficiency and the code reuse rate are improved, and the problems that the existing automatic testing efficiency and the code reuse rate are low are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automobile testing technology, and in particular to a cloud software automated testing method and system. Background Art

[0002] The statements in this section merely mention background art related to the present invention and do not necessarily constitute prior art.

[0003] With the development of society, the popularity and frequency of automobile use are increasing. As users' functional demands increase, more and more functions are used in the field of in-vehicle entertainment. Infotainment systems with the appearance and experience of consumer electronics are still the main competitive advantage of OEMs.

[0004] With the development of smart cockpits, the number of cockpit functions and software has increased dramatically, and the corresponding software testing tasks have also increased dramatically. Although automated testing is booming, the existing automated testing is blind, directly scripting use cases with code, one use case corresponds to one script, the code reuse rate is low, and manpower and material resources are wasted. Summary of the invention

[0005] In order to address the deficiencies in the prior art, the present invention provides a cloud-based software automation testing method, system, electronic device and computer-readable storage medium, which utilizes a software component tree to perform visual generation of test cases, thereby improving the efficiency of automated testing and being more suitable for vehicle test bench automation testing scenarios.

[0006] In a first aspect, the present invention provides a method for automated testing of cloud software;

[0007] A cloud software automated testing method, comprising:

[0008] Obtaining a projection of the software to be tested, and generating a software component tree of the software to be tested according to the projection of the software to be tested;

[0009] According to the software component tree, in response to the tester's click operation, the tested component and the corresponding test action are determined, and the test task is generated and distributed to multiple test units; the test unit is used to perform automated testing on the tested component according to the received test task and generate a test log;

[0010] A final test result is obtained, wherein the final test result is generated by analyzing the test log by the log server and the main control server.

[0011] In some embodiments, the software component tree of the software to be tested is generated based on the projection of the software to be tested as follows: taking the main page of the software to be tested as the root node, through the open source automated testing framework uiatuomator2, in response to the tester's mouse movement and mouse click operations, each component under test in the software to be tested is triggered in turn and its attribute information is read to generate corresponding child nodes.

[0012] In some embodiments, the software component tree is used to determine the components to be tested and the corresponding test actions in response to the tester's click operations, and the test tasks are generated specifically as follows: the components in the component tree are selected through the open source automated testing tool uiatuomator2, and the corresponding operations are selected after the components are selected, and the test scripts are generated in the script editing interface.

[0013] In some implementations, the test log is a running log generated by the software to be tested during the testing process.

[0014] In some implementations, analyzing the test log by the log server and the master control server to generate the final test result includes:

[0015] The log processing server analyzes the test log, obtains the test results and transmits them to the main control server; the main control server analyzes the test results, determines the final test results and transmits them to the cloud task management platform.

[0016] In some implementations, the log processing server analyzes the test log by: extracting bug information in the test log through keyword matching.

[0017] In some implementations, before testing, a test environment is prepared for the test unit.

[0018] In a second aspect, the present invention provides a cloud software automated testing system;

[0019] A cloud software automated testing system, comprising a plurality of testing units, a cloud task management platform, a master control server, a message transfer server and a log processing server;

[0020] The cloud task management platform is used to obtain the projection of the software to be tested, and generate a software component tree of the software to be tested according to the projection of the software to be tested; according to the software component tree, in response to the click operation of the tester, determine the tested component and the corresponding test action, generate the test task and distribute it to multiple test units through the main control server and the message transfer server; the test unit is used to perform automated testing on the tested component according to the received test task, generate the test log and transmit it to the log processing server;

[0021] The log processing server is used to analyze the test log, obtain the test results and transmit them to the main control server; the main control server is used to analyze the test results, determine the final test results and transmit them to the cloud task management platform.

[0022] In a third aspect, the present invention provides an electronic device;

[0023] An electronic device includes a memory and a processor, and computer instructions stored in the memory and executed on the processor. When the computer instructions are executed by the processor, the above-mentioned cloud software automatic testing method is completed.

[0024] In a fourth aspect, the present invention provides a computer-readable storage medium;

[0025] A computer-readable storage medium is used to store computer instructions. When the computer instructions are executed by a processor, the above-mentioned cloud software automatic testing method is completed.

[0026] Compared with the prior art, the present invention has the following beneficial effects:

[0027] 1. The technical solution provided by the present invention is a WYSIWYG low-typing code writing method, that is, when writing an automation script, the code typing method is converted into mouse clicks to generate an automation script, which improves the writing efficiency of the test script and reduces the coding ability threshold of the tester; by introducing a component tree to simplify the difficulty of writing automation scripts, ordinary software testers can independently write automation test scripts, and at the same time use a cloud platform to solve environmental limitations and save resources.

[0028] 2. The technical solution provided by the present invention distributes and executes test tasks through a cloud task management platform, realizes distributed concurrent testing, improves the efficiency of automated testing, reduces hardware investment, and can monitor test results in real time to improve test quality; through the big data processing technology of the cloud platform, it realizes the screening and analysis of test data to provide data support for the testing process. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0030] Figure 1 A schematic diagram of a process flow provided by an embodiment of the present invention;

[0031] Figure 2 A schematic diagram of a system architecture provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0032] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used in the present invention have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0033] It should be noted that the terms used herein are only for describing specific embodiments, and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that the terms "include" and "have" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0034] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.

[0035] Embodiment 1

[0036] Next, combine Figure 1 , a cloud software automation testing method disclosed in this embodiment is described in detail. The cloud software automation testing method is applied to a cloud task management platform and includes the following steps:

[0037] S1. Log in to the cloud task management platform, import test cases or write test cases online, submit test case review, write test scripts, submit script review, obtain the projection of the software to be tested, and generate the software component tree of the software to be tested based on the projection of the software to be tested.

[0038] In order to implement WYSIWYG script writing in the vehicle test bench automated cloud test scenario and reduce the constraints of the test scenario on automated testing, in this embodiment, a software component tree of the software to be tested is generated according to the projection of the software to be tested.

[0039] As an implementation mode, S1 specifically includes:

[0040] S101. Enter the URL of the cloud task management platform to enter the login page.

[0041] S102, input user name, password, and picture verification code to enter the system.

[0042] S103. Click the cabinet management menu and click the cabinet to be used to enter the cabinet details page and check the cabinet status. If it is prompted that there is no adb device, go to the test cabinet to receive and turn on the car machine adb.

[0043] S104. Click Resource Library, click Camera Service, select Camera, and check whether the camera block diagram is aligned with the camera.

[0044] S105. Enter the use case management, click Add Use Case, and then write the use case; submit it for review after writing is completed. After the review is passed, return to the use case management page, find the use case, click Script, select the script compilation and execution machine, and enter the script writing page.

[0045] S106. Obtaining the projection of the software to be tested in the vehicle computer through the testing unit.

[0046] Exemplarily, the open source automated testing tool uiatuomator2 is run in the test unit, and a screenshot of the vehicle computer, that is, a projection of the software to be tested in the vehicle computer, is obtained through the open source automated testing tool uiatuomator2.

[0047] S107, taking the main page of the software to be tested as the root node, in response to the tester's mouse movement and mouse click operations, trigger each component under test in the software to be tested in turn and read its attribute information, generate corresponding child nodes, each child node corresponds to a unique ID, until all components in the software to be tested are triggered to form a component tree.

[0048] Exemplarily, the edit mode is selected in the open source automated testing tool uiatuomator2. In the edit mode, the open source automated testing tool uiatuomator2 automatically generates component selection boxes in response to the tester's mouse movement operations, and adds components to the component tree in response to the tester's mouse click operations.

[0049] At the same time, in the process of creating the component tree, each node is assigned actions that can be performed on the component, including but not limited to copying component ID, resetting text, getting text, waiting for text, waiting for control, checking control, clicking control, double-clicking control, long pressing control, checking switch, getting component screenshot, component color, component details and other custom scripts.

[0050] The code writing efficiency is improved through the above-mentioned WYSIWYG low-typing code writing method.

[0051] S108. After the script is written, submit it for review.

[0052] S109. After the review is completed, select the script that has passed the review to generate a test task in the task editing menu, select the start time, and start the task at a scheduled time; or manually click the start button to execute the task.

[0053] S2. According to the software component tree, in response to the tester's click operation, the components under test and the corresponding test actions are determined, test tasks are generated and distributed to multiple test units; the test unit is used to perform automated testing on the components under test according to the received test tasks and generate test logs.

[0054] Specifically, select the projection mode through the open source automated testing tool uiatuomator2. In the projection mode, directly operate the car computer to select the components in the component tree. After selecting the components, right-click the components to be operated and select the corresponding operation. The corresponding code will be automatically generated in the script editing interface. At this time, the test unit is in an idle state.

[0055] Next, we will take the example of writing an automated test script for Amap navigation:

[0056] Find the component corresponding to Amap in the component tree, match Amap through xpath or image matching or resourceid, text, etc., right-click the Amap component, select Open Component Operation, automatically generate a script to open Amap, and then find the subcomponent search box component of the Amap component, right-click and select Click Operation to invoke the input method. At this time, the tester can click on the coordinates to type the destination name on the virtual keyboard or use the set_text() function to input the destination into the vehicle computer through the data stream.

[0057] In this embodiment, when writing an automation script, the code typing method is changed to generating the automation script by mouse clicking, thereby improving the generation efficiency of the test script.

[0058] As an implementation mode, before the test, the environment of the test unit is prepared, specifically including checking the vehicle computer status, turning on the vehicle computer ADB switch, and checking whether the industrial phase image selection box is aligned.

[0059] S3. Obtain a final test result, wherein the final test result is generated by analyzing the test log by the log server and the main control server.

[0060] Specifically, after receiving the test script, the test unit performs automated testing on the component under test according to the accepted test script and generates a test log. Here, the test log is the operation log generated by the software to be tested during the testing process; the log processing server analyzes the test log, obtains the test results and transmits them to the main control server; the main control server analyzes the test results, determines the final test results and transmits them to the cloud task management platform.

[0061] Exemplarily, the log processing server extracts the bug information in the test log by keyword matching and transmits it to the main control server. The main control server stores the bug information and determines the final test result according to the bug information.

[0062] Here, the keyword matching method adopts the existing technology, such as extraction through regular expressions, etc. This embodiment does not make any improvements to it, and will not be repeated here.

[0063] Embodiment 2

[0064] Combination Figure 2 , based on the first embodiment, this embodiment discloses a cloud software automation testing system, including multiple test units, a cloud task management platform, a master control server, a message transfer server and a log processing server;

[0065] The cloud task management platform is used to obtain the projection of the software to be tested, and generate the software component tree of the software to be tested based on the projection of the software to be tested; based on the software component tree, in response to the tester's click operation, the tested components and corresponding test actions are determined, and the test tasks are generated and distributed to multiple test units through the main control server and the message relay server; the test unit is used to perform automated testing on the tested components according to the received test tasks, generate test logs and transmit them to the log processing server; the log processing server is used to analyze the test logs, obtain the test results and transmit them to the main control server; the main control server is used to analyze the test results, determine the final test results and transmit them to the cloud task management platform.

[0066] Embodiment 3

[0067] Embodiment 3 of the present invention provides an electronic device, including a memory and a processor, and computer instructions stored in the memory and executed on the processor. When the computer instructions are executed by the processor, the steps of the above-mentioned cloud software automatic testing method are completed.

[0068] Embodiment 4

[0069] Embodiment 4 of the present invention provides a computer-readable storage medium for storing computer instructions. When the computer instructions are executed by a processor, the steps of the above-mentioned cloud software automated testing method are completed.

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

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

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

[0073] The description of each embodiment in the above embodiments has different emphases. For parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0074] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A cloud software automated testing method, characterized in that: include: Obtaining a projection of the software to be tested, and generating a software component tree of the software to be tested according to the projection of the software to be tested; According to the software component tree, in response to the tester's click operation, the components to be tested and the corresponding test actions are determined, and the test tasks are generated and distributed to multiple test units; The test unit is used to perform automated testing on the tested component according to the received test task and generate a test log; A final test result is obtained, wherein the final test result is generated by analyzing the test log by the log server and the main control server.

2. The cloud software automated testing method according to claim 1, characterized in that: The software component tree of the software to be tested is generated based on the projection of the software to be tested as follows: the main page of the software to be tested is taken as the root node, and through the open source automated testing tool uiatuomator2, in response to the tester's mouse movement and mouse click operations, each component under test in the software to be tested is triggered in turn and its attribute information is read to generate corresponding child nodes.

3. The cloud software automated testing method according to claim 1, characterized in that: According to the software component tree, in response to the tester's click operation, the components to be tested and the corresponding test actions are determined, and the test tasks are generated specifically as follows: the components in the component tree are selected through the open source automated testing tool uiatuomator2, and the corresponding operations are selected after the components are selected, and the test scripts are generated in the script editing interface.

4. The cloud software automated testing method according to claim 1, characterized in that: The test log is a running log generated by the software to be tested during the testing process.

5. The cloud software automated testing method according to claim 1, characterized in that: The final test results generated by analyzing the test logs through the log server and the master control server include: The log processing server analyzes the test log, obtains the test results and transmits them to the main control server; the main control server analyzes the test results, determines the final test results and transmits them to the cloud task management platform.

6. The cloud software automated testing method according to claim 5, characterized in that: The log processing server analyzes the test log specifically by extracting bug information in the test log through keyword matching.

7. The cloud software automated testing method according to claim 1, characterized in that: Before testing, prepare the test environment for the test unit.

8. A cloud software automated testing system, characterized in that: Includes multiple test units, cloud task management platform, master control server, message transfer server and log processing server; The cloud task management platform is used to obtain the projection of the software to be tested, and generate a software component tree of the software to be tested according to the projection of the software to be tested; according to the software component tree, in response to the click operation of the tester, determine the tested component and the corresponding test action, generate the test task and distribute it to multiple test units through the main control server and the message transfer server; the test unit is used to perform automated testing on the tested component according to the received test task, generate the test log and transmit it to the log processing server; The log processing server is used to analyze the test log, obtain the test results and transmit them to the main control server; The master control server is used to analyze the test results, determine the final test results and transmit them to the cloud task management platform.

9. An electronic device, characterized in that: The method comprises a memory and a processor, and computer instructions stored in the memory and executed on the processor. When the computer instructions are executed by the processor, the cloud software automated testing method according to any one of claims 1 to 7 is completed.

10. A computer-readable storage medium, characterized in that: Used to store computer instructions, which, when executed by a processor, complete the cloud software automation testing method described in any one of claims 1-7.

Citation Information

Patent Citations

  • Edge computing test method and device, equipment and readable storage medium

    CN111506508A

  • Distributed test system and control method

    CN113392028A

  • Automatic test script generation method and device, computer equipment and storage medium

    CN117931652A