A scriptless UI automated testing system and method based on HarmonyOS
By obtaining the attribute vectors of interface elements on the HarmonyOS system and calculating their similarity, and combining this with distributed soft bus technology, scriptless UI automated testing was achieved. This solved the problems of script dependency and poor cross-platform compatibility of testing tools on the HarmonyOS system, and improved testing efficiency and quality.
Patent Information
- Application Number
- CN202510453146.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-11
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2045-04-11
AI Technical Summary
Existing UI automation testing tools on HarmonyOS suffer from strong script dependency, poor cross-platform compatibility, and weak dynamic element handling, making it difficult to effectively identify and process dynamic layout components on HarmonyOS, resulting in high testing and maintenance costs and low efficiency.
By obtaining the attribute library text of interface elements and converting it into vectors, calculating attribute similarity and comprehensive matching coefficients, and combining it with the distributed soft bus technology of the HarmonyOS system, scriptless UI automated testing is achieved, supporting parallel execution and real-time detection on multiple devices, and generating interactive reports.
It improves the accuracy of test matching and system robustness, reduces test maintenance costs, and enhances the efficiency and quality of automated testing. In particular, it enables quick understanding of test results and problem localization when dealing with complex and ever-changing interface elements.
Smart Images

Figure CN120371699B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of UI automation testing technology, specifically to a scriptless UI automation testing system and method based on the HarmonyOS system. Background Technology
[0002] HarmonyOS, as a next-generation distributed operating system, possesses cross-platform capabilities of "develop once, deploy on multiple devices," with its ArkUI framework supporting various device types such as mobile phones, tablets, and smart screens. Its unique distributed soft bus technology allows for seamless migration of interface components across different devices (e.g., task flow), posing new challenges to automated testing: traditional single-device testing frameworks struggle to cover cross-device interaction scenarios. Existing UI automated testing tools (such as Appium and Selenium) suffer from three major pain points: strong script dependency, requiring complex code to define test logic, making them unfriendly to non-technical personnel; poor cross-platform adaptability, with high test case maintenance costs due to differences in resolution and interaction methods across different devices; and weak dynamic element handling, with low recognition rates for HarmonyOS's dynamic layout components (such as the automatic element arrangement in Grid layout). Codeless testing, on the other hand, defines test processes through visual operation recording and natural language description. Combined with AI technologies (such as computer vision and NLP), it can achieve automatic generation of test scripts, intelligent element location, and anomaly scenario prediction.
[0003] Chinese invention application CN119718908A discloses a method and system for UI automated testing. The method includes obtaining interface elements from the HTML source code of a prototype interface, obtaining element keywords of the interface elements based on their element types, automatically recording and tracking the test logic of click events when an interface element contains a click event, establishing a mapping relationship between the test logic and the interface elements by associating the element keywords with the test logic, constructing a description of the requirements to be tested based on the element types and the mapping relationship, inputting the description of the requirements to be tested into an AI large language model to generate a UI automated test script, and performing UI automated testing on the interface to be tested corresponding to the prototype interface based on the UI automated test script to obtain the test results.
[0004] In the above invention applications, when the layout of the interface to be tested changes, the interface elements can be located by element keywords and the associated test logic can be further driven. There is no need to modify and maintain the UI automation test script, which improves the efficiency of UI automation testing. However, if the ID is dynamically generated, the interface elements cannot be obtained based on the HTML source code of the prototype interface, so it is impossible to establish the mapping relationship between the test logic and the interface elements.
[0005] Therefore, this invention provides a scriptless UI automated testing system and method based on the HarmonyOS system. Summary of the Invention
[0006] (a) Technical problems to be solved
[0007] To address the shortcomings of existing technologies, this invention provides a scriptless UI automated testing system and method based on the HarmonyOS system. This invention obtains the attribute library text of interface elements and converts it into vectors, denoted as the first attribute vector and second attribute vector of the interface element. Based on the first attribute vector of the interface element to be tested and the first attribute vectors of interface elements in the element library, the first attribute similarity of the interface element to be tested is calculated. Based on the second attribute vector of the interface element to be tested and the second attribute vectors of interface elements in the element library, the second attribute similarity of the interface element to be tested is calculated. Finally, based on the first and second attribute similarities of the interface element to be tested, the comprehensive matching coefficient of the interface element to be tested is calculated, and a manual calibration warning is sent out. This helps improve matching accuracy, handle complex situations, continuously optimize the model, and enhance system robustness, thereby improving the efficiency and quality of automated testing, especially when facing complex and ever-changing interface elements, thus solving the technical problems described in the background art.
[0008] (II) Technical Solution
[0009] To achieve the above objectives, the present invention provides the following technical solution: a scriptless UI automated testing method based on the HarmonyOS system, comprising the following steps:
[0010] Deploy the testing framework to the HarmonyOS 5.0 development environment, traverse the component tree of the interface under test, and if there is no element in the element library that has the same unique identifier as the element component of the interface under test, issue an element auxiliary analysis command.
[0011] Upon receiving the element-assisted analysis instruction, the attribute library text of the interface element is obtained and converted into a vector, which is denoted as the first attribute vector of the interface element. Second attribute vector Based on the first attribute vector of the interface element to be tested and the first attribute vector of the interface elements in the element library Calculate the first attribute similarity As of the elements of the interface to be tested. x Based on obtaining the second attribute vector of the interface element to be tested and the second attribute vector of the interface elements in the element library Calculate the second attribute similarity Bs of the elements in the interface to be tested. x And based on the first attribute similarity As of the interface elements to be tested x Similarity to the second attribute Bs x Calculate the comprehensive matching coefficient Zps of the interface elements to be tested, and send out a manual calibration warning.
[0012] Once all interface elements are matched, an operation flowchart for the interface elements is generated to achieve parameterized testing. Test cases are synchronized to be 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.
[0013] Furthermore, the UI Test Framework interface of HarmonyOS is called to traverse the component tree of the interface under test, parse the component tree attributes and hierarchical relationship to accurately locate the interface elements. If there is an element in the element library that has the same unique identifier as the interface element component, then the interface element under test and the element with the same unique identifier of the component selected by the element are recorded as a successful match.
[0014] The element library refers to a set of predefined interface elements, including component unique identifiers, HTML tag names, visible text, ancestor chain paths, and images.
[0015] Furthermore, the attribute library of the interface elements is obtained, namely the HTML tag names, visible text, and ancestor chain paths. Based on the bag-of-words model, the attribute library text of the interface elements is converted into a vector, denoted as the first attribute vector of the interface element. Based on ELMo, the attribute library text of the interface element is converted into a vector, denoted as the second attribute vector of the interface element.
[0016] Furthermore, obtain the first attribute vector of the interface element to be tested. and the first attribute vector of the interface elements in the element library Calculate the first attribute similarity As of the elements of the interface to be tested. x :
[0017]
[0018] Cosine similarity is used to measure the consistency of vector directions; the closer the value is to 1, the more similar the vectors are.
[0019] Furthermore, obtain the second attribute vector of the interface element to be tested. and the second attribute vector of the interface elements in the element library Calculate the second attribute similarity Bs of the elements in the interface to be tested. x :
[0020]
[0021] Furthermore, obtain the first attribute similarity As of the elements of the interface to be tested. x Similarity to the second attribute Bs x Calculate the overall matching coefficient Zps of the interface elements to be tested:
[0022]
[0023] If the overall matching coefficient Zps of the interface element to be tested is less than 0.9, a manual calibration warning will be sent out.
[0024] Furthermore, if the overall matching coefficient Zps of the interface element to be tested is not less than 0.9, then the element corresponding to the overall matching coefficient of the interface element to be tested is recorded as a successful match.
[0025] Furthermore, after all interface elements are matched, the initial device is used to record interactive actions such as clicking, swiping, and input, generating a flowchart of interface element operations. Assertions (such as checking the existence of text and controls), conditional branches, or loop logic are defined by dragging and dropping components, and parameterized testing is achieved by binding external data sources (Excel / JSON) without the need for coding.
[0026] Furthermore, by utilizing the HarmonyOS distributed soft bus, test cases can be executed synchronously on multiple devices in parallel. The operation coordinates can be automatically adjusted according to the screen size of different devices (mobile phones, watches, smart screens), and application crashes, ANRs (application unresponsiveness), or interface rendering anomalies can be detected in real time, triggering a retry mechanism.
[0027] Furthermore, it records operation steps, performance data (CPU / memory), network requests and device logs, automatically marks failure reasons (such as element not found, response timeout), associates screenshots and stack information, generates interactive HTML reports, and displays pass rate, defect distribution and performance trend charts.
[0028] A scriptless UI automation testing system based on HarmonyOS includes:
[0029] The interface element initial matching module deploys the 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 that has the same unique identifier as the component element of the interface to be tested, it issues an element auxiliary analysis instruction.
[0030] The interface element auxiliary matching module, upon receiving the element auxiliary 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. Second attribute vector Based on the first attribute vector of the interface element to be tested and the first attribute vector of the interface elements in the element library Calculate the first attribute similarity As of the elements of the interface to be tested. x Based on obtaining the second attribute vector of the interface element to be tested and the second attribute vector of the interface elements in the element library Calculate the second attribute similarity Bs of the elements in the interface to be tested. x And based on the first attribute similarity As of the interface elements to be tested x Similarity to the second attribute Bs x Calculate the comprehensive matching coefficient Zps of the interface elements to be tested, and send out a manual calibration warning.
[0031] The automated testing module generates a flowchart of interface element operations after all interface elements are matched, enabling parametric testing, synchronizing test cases to be executed in parallel on multiple devices, detecting application crashes, ANRs, or interface rendering anomalies in real time, and generating interactive HTML reports that display pass rates, defect distribution, and performance trend charts.
[0032] (III) Beneficial Effects
[0033] This invention provides a scriptless UI automated testing system and method based on HarmonyOS, which has the following beneficial effects:
[0034] 1. Deploy the testing framework to the HarmonyOS 5.0 development environment, traverse the component tree of the interface to be tested, and if there is no element in the element library that has the same unique identifier as the component element of the interface to be tested, issue an element auxiliary analysis instruction to ensure that the test covers all interface components and avoids omissions.
[0035] 2. Upon receiving the element auxiliary analysis instruction, the attribute library text of the interface element is obtained and converted into a vector, which is denoted as the first attribute vector of the interface element. Second attribute vector Based on the first attribute vector of the interface element to be tested and the first attribute vector of the interface elements in the element library Calculate the first attribute similarity As of the elements of the interface to be tested. x Based on obtaining the second attribute vector of the interface element to be tested and the second attribute vector of the interface elements in the element library Calculate the second attribute similarity Bs of the elements in the interface to be tested. x And based on the first attribute similarity As of the interface elements to be tested x Similarity to the second attribute Bs x Calculating the comprehensive matching coefficient Zps of the interface elements under test and sending out manual calibration warnings helps improve matching accuracy, handle complex situations, continuously optimize the model and enhance system robustness, and improve the efficiency and quality of automated testing, especially when facing complex and ever-changing interface elements.
[0036] 3. After all interface elements are matched, an interface element operation flowchart is generated to achieve parameterized testing, synchronize test cases to execute in parallel on multiple devices, detect application crashes, ANRs or interface rendering anomalies in real time, generate interactive HTML reports, and display pass rates, defect distribution and performance trend charts, which helps to quickly understand test results, locate problems and track performance changes. Attached Figure Description
[0037] Figure 1 This is a flowchart illustrating a scriptless UI automation testing method based on the HarmonyOS system according to the present invention.
[0038] Figure 2 This is a schematic diagram of the structure of a scriptless UI automated testing system based on the HarmonyOS system according to the present invention. Detailed Implementation
[0039] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0040] Please see Figure 1 This invention provides a scriptless UI automation testing method based on the HarmonyOS system, comprising 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, and if there is no element in the element library that has the same unique identifier as the component element of the interface to be tested, issue an element auxiliary analysis command.
[0042] Step one includes the following:
[0043] Step 101: Deploy the test framework to the HarmonyOS 5.0 development environment, ensuring compatibility with the Ark Compiler and ArkUI component library, connecting to the target device (mobile phone, tablet, IoT device), supporting multi-device collaborative testing, enabling accessibility services and automated testing permissions in the HarmonyOS system, and ensuring that controls can be captured.
[0044] Step 102: Call the HarmonyOS UI Test Framework interface, traverse the component tree of the interface to be tested, parse the component tree attributes and hierarchical relationship to accurately locate the interface element. If there is an element in the element library with the same unique identifier (ID) as the interface element component, then the interface element to be tested and the element with the same unique identifier (ID) of the selected component are recorded as a successful match.
[0045] The element library refers to a set of predefined interface elements, including component unique identifiers (IDs), HTML tag names, visible text, ancestor chain paths, and images.
[0046] Step 103: If there is no element in the element library that has the same unique identifier (ID) as the element component of the interface to be tested, then issue an element auxiliary analysis command.
[0047] When using this method, refer to steps 101 to 103:
[0048] Deploy the testing framework to the HarmonyOS 5.0 development environment, traverse the component tree of the interface under test, and if there is no element in the element library that has the same unique identifier as the component element under test, issue an element auxiliary analysis command to ensure that the test covers all interface components and avoids omissions.
[0049] Step 2: After receiving the element auxiliary 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. Second attribute vector Based on the first attribute vector of the interface element to be tested and the first attribute vector of the interface elements in the element library Calculate the first attribute similarity As of the elements of the interface to be tested. x Based on obtaining the second attribute vector of the interface element to be tested and the second attribute vector of the interface elements in the element library Calculate the second attribute similarity Bs of the elements in the interface to be tested. x And based on the first attribute similarity As of the interface elements to be tested x Similarity to the second attribute Bs x Calculate the comprehensive matching coefficient Zps of the interface elements to be tested, and send out a manual calibration warning.
[0050] Step two includes the following steps:
[0051] Step 201: After receiving the element auxiliary analysis instruction, obtain the HTML tag name of the interface element (e.g., ...). <button>, <input type="text"> It extracts the visible text of UI elements using textContent or innerHTML, parses the DOM tree to record the parent relationships of UI elements, and records them as the attribute library of UI elements (HTML tag name, visible text, ancestor chain path).
[0052] Step 202: Obtain the attribute library of the interface elements (HTML tag name, visible text, ancestor chain path), and convert the attribute library text of the interface elements into vectors according to the Bag of Words (BoW) model, denoted as the first attribute vector of the interface elements. Based on ELMo, the attribute library text of the interface element is converted into a vector, denoted as the second attribute vector of the interface element.
[0053] The bag-of-words model works by counting the frequency of each word to generate sparse vectors. ELMo, on the other hand, uses a bidirectional LSTM to capture contextual information 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 elements in the element library Calculate the first attribute similarity As of the elements of the interface to be tested. x :
[0055]
[0056] Cosine similarity is used to measure the consistency of vector directions; the closer the value is to 1, the more similar the vectors are.
[0057] Step 204: Obtain the second attribute vector of the interface element to be tested. and the second attribute vector of the interface elements in the element library Calculate the second attribute similarity Bs of the elements in the interface to be tested. x :
[0058]
[0059] Step 205: Obtain the first attribute similarity As of the elements in the interface to be tested. x Similarity to the second attribute Bs x Calculate the overall matching coefficient Zps of the interface elements to be tested:
[0060]
[0061] If the overall matching coefficient Zps of the interface element to be tested is less than 0.9, a manual calibration warning will be sent out.
[0062] If the overall matching coefficient Zps of the interface element to be tested is not less than 0.9, then the element corresponding to the overall matching coefficient of the interface element to be tested is recorded as a successful match.
[0063] When using this method, refer to steps 201 to 205:
[0064] Upon receiving the element-assisted analysis instruction, the attribute library text of the interface element is obtained and converted into a vector, which is denoted as the first attribute vector of the interface element. Second attribute vector Based on the first attribute vector of the interface element to be tested and the first attribute vector of the interface elements in the element library Calculate the first attribute similarity As of the elements of the interface to be tested. x Based on obtaining the second attribute vector of the interface element to be tested and the second attribute vector of the interface elements in the element library Calculate the second attribute similarity Bs of the elements in the interface to be tested. x And based on the first attribute similarity As of the interface elements to be tested x Similarity to the second attribute Bs x Calculating the comprehensive matching coefficient Zps of the interface elements under test and sending out manual calibration warnings helps improve matching accuracy, handle complex situations, continuously optimize the model and enhance system robustness, and improve the efficiency and quality of automated testing, especially when facing complex and ever-changing interface elements.
[0065] Step 3: After all interface elements are matched, generate an interface element operation flowchart to achieve parameterized testing, synchronize test cases to execute in parallel on multiple devices, detect application crashes, ANRs or interface rendering anomalies in real time, generate an interactive HTML report, and display the pass rate, defect distribution and performance trend chart.
[0066] Step three includes the following:
[0067] Step 301: After all interface elements are matched, operate the initial device to record interactive actions such as clicking, swiping, and input, generate an interface element operation flowchart, define assertions (such as checking the existence of text and controls), conditional branches or loop logic by dragging and dropping components, and bind external data sources (Excel / JSON) to achieve parameterized testing without coding.
[0068] Step 302: Utilize the HarmonyOS distributed soft bus to synchronize test cases to execute in parallel on multiple devices. Automatically adjust operation coordinates according to different device screen sizes (mobile phones, watches, smart screens), and detect application crashes, ANRs (application unresponsiveness), or interface rendering anomalies in real time, triggering a retry mechanism.
[0069] Step 303: Record operation steps, performance data (CPU / memory), network requests and device logs, automatically mark failure reasons (such as element not found, response timeout), associate screenshots and stack information, generate an interactive HTML report, and display the pass rate, defect distribution and performance trend chart.
[0070] When using this method, refer to steps 301 to 303:
[0071] Once all interface elements are matched, an interface element operation flowchart is generated to achieve parameterized testing. Test cases are synchronized to be executed in parallel on multiple devices. Application crashes, ANRs, or interface rendering anomalies are detected in real time. An interactive HTML report is generated 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 see Figure 2 This invention provides a scriptless UI automated testing system based on the HarmonyOS system, comprising:
[0073] The initial matching module for interface elements deploys the test framework to the HarmonyOS 5.0 development environment, traverses the tree of the interface components to be tested, and if there is no element in the element library that has the same unique identifier as the interface element component to be tested, it issues an element auxiliary analysis instruction.
[0074] The interface element auxiliary matching module, upon receiving the element auxiliary 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. Second attribute vector Based on the first attribute vector of the interface element to be tested and the first attribute vector of the interface elements in the element library Calculate the first attribute similarity As of the elements of the interface to be tested. x Based on obtaining the second attribute vector of the interface element to be tested and the second attribute vector of the interface elements in the element library Calculate the second attribute similarity Bs of the elements in the interface to be tested. x And based on the first attribute similarity As of the interface elements to be tested x Similarity to the second attribute Bs x Calculate the comprehensive matching coefficient Zps of the interface elements to be tested, and send out a manual calibration warning.
[0075] The automated testing module generates a flowchart of interface element operations after all interface elements are matched, enabling parametric testing, synchronizing test cases to be executed in parallel on multiple devices, detecting application crashes, ANRs, or interface rendering anomalies in real time, and generating interactive HTML reports that display pass rates, 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 thereof. When implemented in software, the above embodiments can be implemented, in whole or in part, as a computer program product. Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented 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 separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0078] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.< / button>
Claims
1. A scriptless UI automatic test method based on a HongMeng system, characterized in that: Comprising the following steps: deploying a test framework to the Harmony 5.0 development environment, traversing the interface component tree to be tested, if the element library does not exist the same element as the unique identifier of the interface element component to be tested, then issue an element auxiliary analysis instruction outwardly; Upon receiving the element auxiliary analysis instruction, the attribute library text of the interface element is obtained and converted into a vector, denoted as the first attribute vector of the interface element. , , ) and second attribute vector ( , , Based on the first attribute vector of the interface element to be tested ( , , ) and the first attribute vector of the interface elements in the element library ( , , ), calculate the first attribute similarity of the elements of the interface to be tested. Based on obtaining the second attribute vector of the interface element to be tested ( , , ) and the second attribute vector of the interface elements in the element library ( , , ), calculate the second attribute similarity of the elements in the interface to be tested. And based on the first attribute similarity of the interface elements to be tested. Second attribute similarity Calculate the overall matching coefficient of the interface elements to be tested. Send out manual calibration warnings; An attribute library of the interface element, i.e. an HTML tag name, visible text and an ancestor chain path, is obtained, the attribute library text of the interface element is converted into a vector according to a bag-of-words model, and the vector is recorded as a first attribute vector of the interface element ( , , ), the attribute library text of the interface element is converted into a vector according to ELMo, and the vector is recorded as a second attribute vector of the interface element ( , , ). Obtaining a first attribute similarity of the to-be-tested interface element and a second attribute similarity , calculating a comprehensive matching coefficient of the to-be-tested interface element : After all interface elements are matched, generate an interface element operation flowchart, implement parameterized testing, synchronize test cases to multiple devices for parallel execution, real-time detect application crashes, ANR or interface rendering abnormalities, generate an interactive HTML report, and show pass rate, defect distribution and performance trend chart.
2. The scriptless UI automated testing method based on the Harmony system according to claim 1, characterized in that: calling the UI Test Framework interface of Harmony, traversing the interface component tree to be tested, analyzing the component tree attributes and hierarchical relationship to accurately locate the interface elements, if the element library contains the same element as the unique identifier of the interface element component, then mark the tested interface element and the element in the element library with the same component unique identifier as a successful match; wherein the element library refers to a set of predefined interface elements, including component unique identifier, HTML tag name, visible text, ancestor chain path and image.
3. The scriptless UI automated testing method based on the Harmony system according to claim 1, characterized in that: Obtaining a first attribute vector of the to-be-tested interface element ( , , ) and a first attribute vector of the interface element in the element library ( , , ), and calculating a first attribute similarity of the to-be-tested interface element : wherein the cosine similarity is used to measure the consistency of vector direction, and the value closer to 1 indicates greater similarity.
4. The scriptless UI automated testing method based on the Harmony system according to claim 1, characterized in that: Obtaining a second attribute vector of the to-be-tested interface element ( , , ) and a second attribute vector of the interface element in the element library ( , , ), and calculating a second attribute similarity of the to-be-tested interface element : 。 5. The scriptless UI automated testing method based on the Harmony system according to claim 1, characterized in that: If the comprehensive matching coefficient of the interface element to be tested is less than 0.9, an artificial calibration warning is sent outwards. less than 0.
9.
6. The scriptless UI automated testing method based on the Harmony system according to claim 1, characterized in that: If the overall matching coefficient of the interface elements to be tested If the overall matching coefficient is not less than 0.9, the element corresponding to the number of the element in the interface to be tested is recorded as a successful match.
7. A scriptless UI automatic test system based on a Hongmeng system, used for implementing the method in any one of claims 1 to 6. Comprising: an interface element initial matching module, deploying a test framework to the Harmony 5.0 development environment, traversing the interface component tree to be tested, if the element library does not exist the same element as the unique identifier of the interface element component to be tested, then issue an element auxiliary analysis instruction outwardly; The interface element auxiliary matching module, upon receiving the element auxiliary 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 second attribute vector ( , , Based on the first attribute vector of the interface element to be tested ( , , ) and the first attribute vector of the interface elements in the element library ( , , ), calculate the first attribute similarity of the elements in the interface to be tested. Based on obtaining the second attribute vector of the interface element to be tested ( , , ) and the second attribute vector of the interface elements in the element library ( , , ), calculate the second attribute similarity of the elements in the interface to be tested. And based on the first attribute similarity of the interface elements to be tested. Second attribute similarity Calculate the overall matching coefficient of the interface elements to be tested. Send out manual calibration warnings; an automated testing module, after all interface elements are matched, generate an interface element operation flowchart, implement parameterized testing, synchronize test cases to multiple devices for parallel execution, real-time detect application crashes, ANR or interface rendering abnormalities, generate an interactive HTML report, and show 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
UI automatic testing method and system
CN119718908A