Script-free UI (User Interface) automatic test system and method based on swan monk system

By calculating the attribute similarity and comprehensive matching coefficient of interface elements on the Hongmeng system, generating operation flow charts, and implementing parameterized testing, the problem of script dependence and poor cross-platform adaptation of UI automation testing tools on the Hongmeng system is solved, and the testing efficiency and quality are improved.

CN120371699AActive Publication Date: 2025-07-25HANGZHOU UUSENSE TECH CO LTD

Patent Information

Application Number
CN202510453146.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-11
Publication Date
2025-07-25
Estimated Expiration
2045-04-11

AI Technical Summary

Technical Problem

The existing UI automation testing tools have problems such as strong script dependence, poor cross-platform adaptation, and weak dynamic element processing on the Hongmeng system, making it difficult to effectively identify the dynamic layout components of the Hongmeng system, resulting in high test and maintenance costs and low efficiency.

Method used

By obtaining the attribute library text of the interface element into a vector, calculating the attribute similarity and comprehensive matching coefficient of the interface element to be tested, generating the interface element operation flow chart, implementing parameterized testing, synchronizing test cases to multiple devices in parallel, detecting exceptions in real time and generating interactive reports.

Benefits of technology

Improves the matching accuracy and system robustness of tests, improves the efficiency and quality of automated tests, especially when facing complex and variable interface elements, ensuring that the test covers all components and quickly understands the test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120371699A_ABST
    Figure CN120371699A_ABST
Patent Text Reader

Abstract

The invention discloses a script-free UI automatic testing system and method based on a swan monk system, and relates to the technical field of UI automatic testing. The method comprises the steps that a testing frame is deployed to a swan monk 5.0 development environment, a to-be-tested interface component tree is traversed, and if an element with the same unique identifier as a to-be-tested interface element component does not exist in an element library, the script-free UI automatic testing system is started; if yes, an element auxiliary analysis instruction is sent out; after an element auxiliary analysis instruction is received, obtaining an attribute library text of the interface element, converting the attribute library text into a vector, and calculating a second attribute similarity of the to-be-tested interface element according to a second attribute vector of the to-be-tested interface element and a second attribute vector of the interface element in the element library; according to the first attribute similarity and the second attribute similarity of the to-be-tested interface elements, the comprehensive matching coefficient of the to-be-tested interface elements is calculated, and manual calibration early warning is sent outwards; and after matching of all the interface elements is completed, an interface element operation flow chart is generated, parameterized testing is achieved, and the efficiency and quality of automatic testing can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of UI automated testing, and specifically provides a scriptless UI automated testing system and method based on the HarmonyOS system. Background Art

[0002] As a new generation of distributed operating system, the HarmonyOS system has the cross-platform ability of "one development, multi-terminal deployment". Its ArkUI framework supports multi-form devices such as mobile phones, tablets, and smart screens. Its unique distributed soft bus technology allows interface components to seamlessly migrate between different devices (such as task transfer), which poses new challenges to automated testing: traditional single-device testing frameworks are difficult to cover cross-device interaction scenarios. There are three major pain points in existing UI automated testing tools (such as Appium and Selenium): strong script dependence, complex code needs to be written to define test logic, which is not friendly to non-technical personnel. Poor cross-platform adaptation, the differences in resolution and interaction methods of different devices lead to high use case maintenance costs. Weak dynamic element processing, low recognition rate for dynamic layout components of HarmonyOS (such as automatically arranging elements in a Grid layout). Codeless Testing defines the test process through visual operation recording, natural language description, etc. Combining AI technologies (such as computer vision and NLP), it can achieve automatic test script generation, intelligent element positioning, and abnormal scenario prediction.

[0003] In a Chinese invention application with the application publication number CN119718908A, a method and system for UI automated testing are disclosed, including obtaining interface elements from the HTML source code of the prototype interface, obtaining the element keywords of the interface elements according to the element types of the interface elements. When the interface element contains a click event, the test logic of the click event will be automatically recorded and tracked, and the element keywords are associated with the test logic to establish the mapping relationship between the test logic and the interface elements. The test requirement description to be tested is constructed according to the element type and the mapping relationship, and the test requirement description to be tested is input into the AI large language model to generate a UI automated test script. The UI automated test is performed on the interface to be tested corresponding to the prototype interface according to the UI automated test script to obtain the test result.

[0004] In the above invention application, when the interface layout of the interface to be tested changes, the interface elements can be located through the element keywords and further drive the associated test logic, without modifying and maintaining the UI automated test script, improving the efficiency of UI automated testing. However, for interface elements whose IDs are dynamically generated and cannot be obtained from the HTML source code of the prototype interface, the mapping relationship between the test logic and the interface elements cannot be established for association.

[0005] Therefore, the present invention provides a scriptless UI automated testing system and method based on the HarmonyOS system. Summary of the Invention

[0006] (1) Technical Problem to be Solved

[0007] Aiming at the deficiencies of the prior art, the present invention provides a scriptless UI automated testing system and method based on the HarmonyOS. The present invention converts the attribute library text of the interface element into a vector, denoted as the first attribute vector and the second attribute vector of the interface element. According to the first attribute vector of the interface element to be tested and the first attribute vector of the interface element in the element library, the first attribute similarity of the interface element to be tested is calculated. According to the second attribute vector of the interface element to be tested and the second attribute vector of the interface element in the element library, the second attribute similarity of the interface element to be tested is calculated. And according to the first attribute similarity and the second attribute similarity of the interface element to be tested, the comprehensive matching coefficient of the interface element to be tested is calculated, and an artificial calibration warning is sent outwards, which helps to improve the matching accuracy, handle complex situations, continuously optimize the model and enhance the system robustness, helps to improve the efficiency and quality of automated testing, especially when facing complex and changeable interface elements, thus solving the technical problems recorded in the background art.

[0008] (2) Technical Solution

[0009] To achieve the above object, the present invention is realized through the following technical solutions: A scriptless UI automated testing method based on the HarmonyOS, including the following steps:

[0010] Deploy the test framework to the HarmonyOS 5.0 development environment, traverse the component tree of the interface element to be tested. If there is no element in the element library with the same unique identifier as the interface element component to be tested, an element-assisted analysis instruction is sent outwards;

[0011] After receiving the element-assisted analysis instruction, convert the attribute library text of the interface element into a vector, denoted as the first attribute vector of the interface element and the second attribute vector According to the first attribute vector of the interface element to be tested and the first attribute vector of the interface element in the element library Calculate the first attribute similarity As of the interface element to be tested x , according to the second attribute vector of the interface element to be tested obtained and the second attribute vector of the interface element in the element library Calculate the second attribute similarity Bs of the interface element to be tested x , and according to the first attribute similarity As of the interface element to be tested x and the second attribute similarity Bs x Calculate the comprehensive matching coefficient Zps of the interface element to be tested, and send out an artificial calibration warning;

[0012] After all interface elements are matched, generate a flowchart for interface element operations, implement parameterized testing, synchronize test cases for parallel execution on multiple devices, detect application crashes, ANRs, or interface rendering anomalies in real time, and generate an interactive HTML report to display the pass rate, defect distribution, and performance trend chart.

[0013] Further, call the UI Test Framework interface of HarmonyOS, traverse the component tree of the interface to be tested, parse the component tree attributes and hierarchical relationships to accurately locate interface elements. If there is an element in the element library with the same unique identifier as the interface element component, mark the interface element to be tested and the element in the element library with the same unique identifier as a successful match;

[0014] Among them, the element library refers to a set of predefined interface elements, including unique component identifiers, HTML tag names, visible text, ancestor chain paths, and images.

[0015] Further, obtain the attribute library of the interface element, that is, the HTML tag name, visible text, and ancestor chain path. Convert the text of the attribute library of the interface element into a vector according to the bag-of-words model, and record it as the first attribute vector of the interface element Convert the text of the attribute library of the interface element into a vector according to ELMo, and record it as the second attribute vector of the interface element

[0016] Further, obtain the first attribute vector of the interface element to be tested and the first attribute vector of the interface element in the element library Calculate the first attribute similarity As of the interface element to be tested x :

[0017]

[0018] Among them, the cosine similarity is used to measure the consistency of vector directions, and the closer the value is to 1, the more similar it is.

[0019] Further, obtain the second attribute vector of the interface element to be tested and the second attribute vector of the interface element in the element library Calculate the second attribute similarity Bs of the interface element to be tested x :

[0020]

[0021] Further, obtain the first attribute similarity As of the interface element to be tested x and the second attribute similarity Bs x , and calculate the comprehensive matching coefficient Zps of the interface element to be tested:

[0022]

[0023] If the comprehensive matching coefficient Zps of the interface element to be measured is less than 0.9, an artificial calibration warning is sent outwards.

[0024] Furthermore, if the comprehensive matching coefficient Zps of the interface element to be measured is not less than 0.9, the corresponding numbered element of the comprehensive matching coefficient of the interface element to be measured is marked as successfully matched.

[0025] Furthermore, after all interface elements are matched, the initial device is operated to record interaction actions such as clicking, swiping, and inputting, generate an interface element operation flow chart, define assertions (such as checking text and control existence), conditional branches or loop logics through drag-and-drop components, and bind to an external data source (Excel / JSON) to implement parameterized testing without coding.

[0026] Furthermore, by using the HarmonyOS distributed soft bus, test cases are synchronized and executed in parallel on multiple devices. The operation coordinates are automatically adjusted according to the screen sizes of different devices (mobile phones, watches, smart screens), and application crashes, ANR (Application Not Responding), or interface rendering anomalies are detected in real time to trigger a retry mechanism.

[0027] Furthermore, operation steps, performance data (CPU / memory), network requests, and device logs are recorded, the failure reasons are automatically marked (such as element not found, response timeout), screenshots are associated with stack information, and an interactive HTML report is generated to display the pass rate, defect distribution, and performance trend chart.

[0028] A scriptless UI automation testing system based on the HarmonyOS system, comprising:

[0029] An initial interface element matching module, which deploys a test framework to the HarmonyOS 5.0 development environment, traverses the component tree of the interface element to be measured, and if there is no element in the element library with the same unique identifier as the interface element component to be measured, an element-assisted analysis instruction is sent outwards;

[0030] An interface element assisted matching module, after receiving the element-assisted analysis instruction, obtains the text of the attribute library of the interface element and converts it into a vector, denoted as the first attribute vector of the interface element and the second attribute vector According to the first attribute vector of the interface element to be measured and the first attribute vector of the interface element in the element library Calculate the first attribute similarity As of the interface element to be measured x , according to the obtained second attribute vector of the interface element to be measured and the second attribute vector of the interface element in the element library Calculate the second attribute similarity Bs of the interface element to be tested x and, based on the first attribute similarity As of the interface element to be tested x and the second attribute similarity Bs x calculate the comprehensive matching coefficient Zps of the interface element to be tested, and send out an artificial calibration warning;

[0031] Automation testing module. After all interface elements are matched, generate an interface element operation flowchart to implement parameterized testing, synchronize test cases to multiple devices for parallel execution, detect application crashes, ANRs, or interface rendering anomalies in real time, and generate an interactive HTML report to display the pass rate, defect distribution, and performance trend chart.

[0032] (III) Beneficial effects

[0033] The present invention provides a scriptless UI automation testing system and method based on the HarmonyOS, having the following beneficial effects:

[0034] 1. Deploy the test framework to the HarmonyOS 5.0 development environment, traverse the interface component tree to be tested. If there is no element in the element library with the same unique identifier as the interface element component to be tested, send out an element-assisted analysis instruction, which can ensure that all interface components are covered by the test and avoid omission.

[0035] 2. After receiving the element-assisted analysis instruction, obtain the attribute library text of the interface element and convert it into a vector, denoted as the first attribute vector of the interface element and the second attribute vector Based on the first attribute vector of the interface element to be tested and the first attribute vector of the interface element in the element library calculate the first attribute similarity As of the interface element to be tested x , based on the obtained second attribute vector of the interface element to be tested and the second attribute vector of the interface element in the element library calculate the second attribute similarity Bs of the interface element to be tested x , and, based on the first attribute similarity As x and the second attribute similarity Bs x of the interface element to be tested, calculate the comprehensive matching coefficient Zps of the interface element to be tested, and send out an artificial calibration warning, which helps to improve the matching accuracy, handle complex situations, continuously optimize the model, and enhance the system robustness, and helps to improve the efficiency and quality of automation testing, especially when facing complex and changeable interface elements.

[0036] 3. After all interface elements are matched, generate a flowchart of interface element operations to implement parameterized testing, synchronize test cases for parallel execution on multiple devices, detect application crashes, ANRs, or interface rendering anomalies in real-time, and generate an interactive HTML report to display the pass rate, defect distribution, and performance trend charts, which helps quickly understand the test results, locate problems, and track performance changes. Description of the Drawings

[0037] Figure 1 It is a schematic flowchart of a scriptless UI automated testing method based on the HarmonyOS of the present invention;

[0038] Figure 2 It is a schematic structural diagram of a scriptless UI automated testing system based on the HarmonyOS of the present invention. Detailed Embodiments

[0039] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0040] Please refer to Figure 1 , the present invention provides a scriptless UI automated testing method based on the HarmonyOS, including the following steps:

[0041] Step 1: Deploy the test framework to the HarmonyOS 5.0 development environment, traverse the component tree of the interface to be tested. If there is no element in the element library with the same unique identifier as the component of the interface element to be tested, an element-assisted analysis instruction is sent outwards.

[0042] The content of the above Step 1 includes:

[0043] Step 101: Deploy the test framework to the HarmonyOS 5.0 development environment, be compatible with the Ark Compiler and the ArkUI component library, connect to the target device (mobile phone, tablet, IoT device), support multi-device collaborative testing, enable the accessibility service and the automated testing permission of the HarmonyOS to ensure that the controls can be captured.

[0044] Step 102: Call the UI Test Framework interface of the HarmonyOS to traverse the component tree of the interface to be tested, parse the component tree attributes and hierarchical relationships to accurately locate the interface elements. If there is an element in the element library with the same unique identifier (ID) as the component of the interface element, mark the interface element to be tested and the element with the same unique identifier (ID) in the element library as successfully matched.

[0045] Among them, the element library refers to a set of predefined interface elements, including the component unique identifier (ID), HTML tag name, visible text, ancestor chain path, and image.

[0046] Step 103: If there is no element in the element library with the same component unique identifier (ID) as the interface element to be tested, send out an element-assisted analysis instruction.

[0047] When in use, combine the content in Steps 101 to 103:

[0048] Deploy the test framework to the HarmonyOS 5.0 development environment, traverse the interface component tree to be tested. If there is no element in the element library with the same component unique identifier as the interface element to be tested, send out an element-assisted analysis instruction, which can ensure that all interface components are covered by the test and avoid omission.

[0049] Step 2: After receiving the element-assisted analysis instruction, obtain the attribute library text of the interface element and convert it into a vector, denoted as the first attribute vector of the interface element and the second attribute vector According to the first attribute vector of the interface element to be tested and the first attribute vector of the interface element in the element library Calculate the first attribute similarity As of the interface element to be tested x , according to the obtained second attribute vector of the interface element to be tested and the second attribute vector of the interface element in the element library Calculate the second attribute similarity Bs of the interface element to be tested x , and according to the first attribute similarity As x and the second attribute similarity Bs x of the interface element to be tested, calculate the comprehensive matching coefficient Zps of the interface element to be tested and send out an artificial calibration warning.

[0050] The said Step 2 includes the following steps:

[0051] Step 201: After receiving the element-assisted analysis instruction, obtain the HTML tag name of the interface element (such as <button>, <input type="text"> ) and extract the visible text of the interface element through textContent or innerHTML, parse the DOM tree to record the parent relationship of the interface element, and record it as the attribute library of the interface element (HTML tag name, visible text, ancestor chain path)

[0052] Step 202: Obtain the attribute library of the interface element (HTML tag name, visible text, ancestor chain path), convert the text of the attribute library of the interface element into a vector according to the Bag of Words (BoW) model, and record it as the first attribute vector of the interface element Convert the text of the attribute library of the interface element into a vector according to ELMo, and record it as the second attribute vector of the interface element

[0053] The principle of the Bag of Words model is to count the occurrence frequency of each word and generate a sparse vector. The principle of ELMo is to capture context information through bidirectional LSTM and generate dynamic word vectors.

[0054] Step 203: Obtain the first attribute vector of the interface element to be tested and the first attribute vector of the interface element in the element library Calculate the first attribute similarity As of the interface element to be tested x :[[]]END]]

[0055]

[0056] Among them, the cosine similarity is used to measure the consistency of vector directions, and the closer the value is to 1, the more similar it is.

[0057] Step 204: Obtain the second attribute vector of the interface element to be tested and the second attribute vector of the interface element in the element library Calculate the second attribute similarity Bs of the interface element to be tested x :[[]]END]]

[0058]

[0059] Step 205: Obtain the first attribute similarity As x and the second attribute similarity Bs x of the interface element to be tested, and calculate the comprehensive matching coefficient Zps of the interface element to be tested:

[0060]

[0061] If the comprehensive matching coefficient Zps of the interface element to be tested is less than 0.9, send an artificial calibration warning outward.

[0062] If the comprehensive matching coefficient Zps of the interface element to be tested is not less than 0.9, the corresponding numbered element of the comprehensive matching coefficient of the interface element to be tested is recorded as a successful match.

[0063] During use, combine the content in steps 201 to 205:

[0064] After receiving the element-assisted analysis instruction, obtain the attribute library text of the interface element and convert it into a vector, which is recorded as the first attribute vector of the interface element and the second attribute vector According to the first attribute vector of the interface element to be tested and the first attribute vector of the interface element in the element library Calculate the first attribute similarity As of the interface element to be tested x , according to the obtained second attribute vector of the interface element to be tested and the second attribute vector of the interface element in the element library Calculate the second attribute similarity Bs of the interface element to be tested x , and according to the first attribute similarity As of the interface element to be tested x and the second attribute similarity Bs x , calculate the comprehensive matching coefficient Zps of the interface element to be tested, and send out an artificial calibration warning, which helps to improve the matching accuracy, handle complex situations, continuously optimize the model and enhance the system robustness, and helps to improve the efficiency and quality of automated testing, especially when facing complex and changeable interface elements.

[0065] Step 3: After all interface elements are matched, generate an interface element operation flow chart to implement parameterized testing, synchronize test cases to multiple devices for parallel execution, and real-time detect application crashes, ANRs or interface rendering anomalies, and generate an interactive HTML report to display the pass rate, defect distribution and performance trend chart.

[0066] The said step 3 includes the following content:

[0067] Step 301: After all interface elements are matched, operate the initial device to record interactive actions such as clicks, swipes, and inputs, generate an interface element operation flow chart, define assertions (such as checking text, control existence), conditional branches or loop logic by dragging components, and bind external data sources (Excel / JSON) to implement parameterized testing without coding.

[0068] Step 302: Use the HarmonyOS distributed soft bus to synchronize test cases to multiple devices for parallel execution, automatically adjust the operation coordinates according to different device screen sizes (mobile phones, watches, smart screens), and real-time detect application crashes, ANRs (application unresponsiveness) or interface rendering anomalies, and trigger the retry mechanism.

[0069] Step 303: Record the operation steps, performance data (CPU / memory), network requests, and device logs, automatically mark the failure reasons (such as element not found, response timeout), associate screenshots and stack information, and generate an interactive HTML report to display the pass rate, defect distribution, and performance trend chart.

[0070] When in use, combine the content in Steps 301 to 303:

[0071] After all interface element matches are completed, generate an interface element operation flow chart, implement parameterized testing, synchronize test cases to multiple devices for parallel execution, detect application crashes, ANRs, or interface rendering anomalies in real time, and generate an interactive HTML report to display the pass rate, defect distribution, and performance trend chart, which helps to quickly understand the test results, locate problems, and track performance changes.

[0072] Please refer to Figure 2 , the present invention provides a scriptless UI automated testing system based on the HarmonyOS, including:

[0073] An initial interface element matching module deploys a test framework to the HarmonyOS 5.0 development environment, traverses the component tree of the interface to be tested, and if there is no element in the element library with the same unique identifier as the interface element to be tested, sends out an element-assisted analysis instruction.

[0074] An interface element assisted matching module, after receiving the element-assisted analysis instruction, obtains the attribute library text of the interface element and converts it into a vector, denoted as the first attribute vector of the interface element and the second attribute vector According to the first attribute vector of the interface element to be tested and the first attribute vector of the interface element in the element library Calculate the first attribute similarity As of the interface element to be tested x , according to the obtained second attribute vector of the interface element to be tested and the second attribute vector of the interface element in the element library Calculate the second attribute similarity Bs of the interface element to be tested x , and according to the first attribute similarity As x and the second attribute similarity Bs x of the interface element to be tested, calculate the comprehensive matching coefficient Zps of the interface element to be tested, and send out an artificial calibration warning.

[0075] Automated testing module. After all interface elements are matched, it generates a flowchart for interface element operations, implements parameterized testing, synchronizes test cases for parallel execution on multiple devices, detects application crashes, ANRs, or interface rendering anomalies in real time, and generates an interactive HTML report to display the pass rate, defect distribution, and performance trend charts.

[0076] The above embodiments can be implemented in whole or in part by software, hardware, firmware, or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. Those of ordinary skill in the art will realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or in a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution.

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

[0078] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered within the protection scope of the present application.< / button>

Claims

1. A scriptless UI automated testing method based on the HarmonyOS, characterized in that: It includes the following steps: Deploy the test framework to the HarmonyOS 5.0 development environment, traverse the component tree of the interface to be tested. If there is no element in the element library with the same unique identifier as the component of the interface element to be tested, an element-assisted analysis instruction is sent outwards; After receiving the element-assisted analysis instruction, obtain the attribute library text of the interface element and convert it into a vector, denoted as the first attribute vector of the interface element and the second attribute vector According to the first attribute vector of the interface element to be tested and the first attribute vector of the interface element in the element library Calculate the first attribute similarity As of the interface element to be tested x , according to the obtained second attribute vector of the interface element to be tested and the second attribute vector of the interface element in the element library Calculate the second attribute similarity Bs of the interface element to be tested x , and according to the first attribute similarity As of the interface element to be tested x and the second attribute similarity Bs x , calculate the comprehensive matching coefficient Zps of the interface element to be tested, and send out an artificial calibration warning; After all interface elements are matched, an operation flow chart of the interface elements is generated to implement parameterized testing. The test cases are synchronized and executed in parallel on multiple devices. Application crashes, ANRs, or interface rendering anomalies are detected in real time, and an interactive HTML report is generated to display the pass rate, defect distribution, and performance trend chart.

2. A scriptless UI automated testing method based on the HarmonyOS system according to claim 1, characterized in that: Call the UI Test Framework interface of HarmonyOS, traverse the component tree of the interface to be tested, parse the component tree attributes and hierarchical relationships to accurately locate the interface elements. If there is an element in the element library with the same unique identifier as the component of the interface element, the interface element to be tested and the element in the element library with the same component unique identifier are recorded as successfully matched; Among them, the element library refers to a set of predefined interface elements, including component unique identifiers, HTML tag names, visible texts, ancestor chain paths, and images.

3. A scriptless UI automated testing method based on the HarmonyOS system according to claim 1, characterized in that: Obtain the attribute library of the interface element, that is, the HTML tag name, visible text, and ancestor chain path. Convert the text of the attribute library of the interface element into a vector according to the bag-of-words model, which is denoted as the first attribute vector of the interface element Convert the text of the attribute library of the interface element into a vector according to ELMo, which is denoted as the second attribute vector of the interface element 4. A scriptless UI automated testing method based on the HarmonyOS system according to claim 1, characterized in that: Obtain the first attribute vector of the interface element to be measured and the first attribute vector of the interface elements in the element library Calculate the first attribute similarity As of the interface element to be measured x : Among them, the cosine similarity is used to measure the consistency of vector directions, and the closer the value is to 1, the more similar it is.

5. A scriptless UI automated testing method based on the HarmonyOS system according to claim 1, characterized in that: Obtain the second attribute vector of the interface element to be measured and the second attribute vector of the interface element in the element library Calculate the second attribute similarity Bs of the interface element to be measured x :

6. A scriptless UI automated testing method based on the HarmonyOS system according to claim 1, characterized in that: Obtain the first attribute similarity As of the interface element to be measured x and the second attribute similarity Bs x , and calculate the comprehensive matching coefficient Zps of the interface element to be measured: If the comprehensive matching coefficient Zps of the interface element to be tested is less than 0.9, an artificial calibration warning is sent outwards.

7. A scriptless UI automated testing method based on the HarmonyOS system according to claim 1, characterized in that: If the comprehensive matching coefficient Zps of the interface element to be tested is not less than 0.9, the corresponding numbered element of the comprehensive matching coefficient of the interface element to be tested is recorded as successfully matched.

8. A scriptless UI automated testing system based on the HarmonyOS system, which is used to implement the method described in any one of claims 1 to 7, and is characterized in that: It includes: An initial matching module for interface elements, which deploys the test framework to the HarmonyOS 5.0 development environment, traverses the component tree of the interface to be tested. If there is no element in the element library with the same unique identifier as the component of the interface element to be tested, an element-assisted analysis instruction is sent outwards; The interface element assisted matching module, after receiving the element assisted analysis instruction, obtains the attribute library text of the interface element and converts it into a vector, denoted as the first attribute vector of the interface element and the second attribute vector According to the first attribute vector of the interface element to be measured and the first attribute vector of the interface element in the element library Calculate the first attribute similarity As of the interface element to be measured x , according to the obtained second attribute vector of the interface element to be measured and the second attribute vector of the interface element in the element library Calculate the second attribute similarity Bs of the interface element to be measured x , and according to the first attribute similarity As of the interface element to be measured x and the second attribute similarity Bs x , calculate the comprehensive matching coefficient Zps of the interface element to be measured, and send out an artificial calibration warning; An automated testing module, after all interface elements are matched, generates an operation flow chart of the interface elements to implement parameterized testing. The test cases are synchronized and executed in parallel on multiple devices. Application crashes, ANRs, or interface rendering anomalies are detected in real time, and an interactive HTML report is generated to display the pass rate, defect distribution, and performance trend chart.

Citation Information

Patent Citations

  • Code detection method, system and equipment based on open source component and storage medium

    CN114201406A

  • Automatic test method and device, electronic equipment and storage medium

    CN114911698A

  • Control adaptation method, device and equipment and readable storage medium

    CN116737587A

  • Automatic testing method, device and equipment for web page and storage medium

    CN119557213A

  • UI automatic testing method and system

    CN119718908A

Cited By

  • AI-based intelligent rendering method and system for UI layout information

    CN122569927A