LLM-based natural language driven GUI test rehearsal and test script generation method
By using an LLM-based natural language-driven approach combined with a multi-agent system, we have achieved efficient conversion of natural language test cases into cross-framework compatible test scripts. This solves the problems of low efficiency and compatibility in traditional GUI testing, and improves the efficiency and accuracy of automated testing.
Patent Information
- Application Number
- CN202511517346.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-23
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-10-23
AI Technical Summary
Traditional GUI testing relies on manually writing test cases and automated scripts, which is inefficient and costly. It also faces challenges in interface understanding and operation adaptation, test framework dependency and version compatibility issues, and low efficiency in human-computer collaboration.
We adopt an LLM-based natural language-driven approach, which transforms high-level test cases into low-level test operation descriptions through a human-computer interaction cycle between the planning agent and the tester. Combined with text and visual bimodal interface understanding, we generate cross-framework adapted test scripts and use a multi-agent system for automated pre-playing and code generation.
It enables testers without a programming background to participate in automated test design, lowers the technical threshold, improves the adaptability of test operations and the efficiency of script maintenance, enhances the reusability of test logic and the controllability of the test process, and ensures test accuracy and efficiency.
Smart Images

Figure CN120973696A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of software engineering, in particular to a natural language driven GUI test rehearsal and test script generation method based on LLM. BACKGROUND
[0002] With the continuous improvement of the complexity of software systems, as a key link to ensure software quality, GUI testing is facing the challenges of low efficiency and high cost. Traditional GUI testing mainly relies on manual writing of test cases and automation scripts, and the following technical pain points exist: Conversion barrier from natural language to test script: Test personnel usually describe test requirements using natural language, but converting high-level natural language cases into machine executable test scripts requires professional programming knowledge, resulting in a collaboration gap between the test team and the development team.
[0003] Interface understanding and operation adaptation problem: GUI interface elements change frequently, and traditional automation tools rely on fixed element positioning methods, making it difficult to cope with interface reconstruction, cross-browser compatibility and other scenarios, resulting in a sharp increase in test script maintenance costs.
[0004] Test framework dependency and version adaptation problem: Different test frameworks (such as Selenium, Cypress, Playwright) have large differences in syntax specifications and APIs, making it difficult to reuse test scripts across frameworks, and framework version iterations often cause historical scripts to fail.
[0005] Low efficiency of human-machine collaboration: Existing automation testing tools lack effective human-machine interaction mechanisms, and test personnel cannot intuitively intervene in the test process, making it difficult to quickly correct deviations between test case design and actual execution. SUMMARY
[0006] To overcome the shortcomings of the prior art, the present application provides a natural language driven GUI test rehearsal and test script generation method based on LLM, which solves the problem of "traditional GUI testing mainly relies on manual writing of test cases and automation scripts, low efficiency and high cost".
[0007] To achieve the above purpose, the present application is implemented by the following technical scheme: a natural language driven GUI test rehearsal and test script generation method based on LLM, comprising the following steps: S1: Test operation design: Test personnel and planning agent interact through human-computer cycle to convert high-level test cases described in natural language into low-level, standardized test operation descriptions; wherein the planning agent adopts a hybrid architecture based on retrieval enhancement generation, and the test personnel reviews, adjusts and feeds back the test operation descriptions, and the feedback information is stored in the context memory module of the planning agent as prior knowledge; S2: Test automation rehearsal: The operation agent takes the test operation descriptions generated in S1 as input, performs test rehearsal on the system under test and generates test operation primitives; The operation agent understands interface elements in text and visual dual modalities, extracts HTML element visibility, operability, element size, spatial position and element type attributes at the text level, and uses set-of-mark technology to mark interface elements that are interactive and visible at the visual level, and realizes semantic alignment of text and visual features through unified element numbering; The operation agent adopts a strict operation type limiting mechanism, only supports click, drag, page jump, key, selection and input operations, and adopts a single-step execution strategy, re-evaluates the interface state of the system under test after each operation execution to respond to dynamic changes, and only generates test operation primitives in triple structure after successful operation execution; S3: Test script generation: The code generation agent takes the test operation primitives generated in S2 and the test script requirements specified by the test personnel as input to generate executable test scripts; The code generation agent adopts a three-stage generation strategy, the first stage parses the test framework version, programming language, execution mode and other requirements specified by the test personnel, the second stage calls the fetch MCP service through the model context protocol client to obtain the official documents and API references of the specified test framework version, and the third stage accurately converts the triple structure of the test operation primitives into code statements supported by the target test framework; At the same time, the code generation agent ensures code quality from static analysis and dynamic execution analysis levels through a quality control mechanism based on deterministic agents, and automatically corrects potential problems.
[0008] Preferably, the test operation description in S1 is a low-level standardized natural language description of a single atomic operation in the test step, which explicitly includes action type, target component semantics, necessary parameters and description information.
[0009] Preferably, in S2, the operation agent and the system under test adopt a sequential interaction control mode, and the interaction process is: the operation agent first perceives the state of the system under test, which includes page URL, page title, page semantic information, then integrates the system state with the test operation description to make operation decisions and execute operations, and the system under test updates the state after operation execution, completing one interaction.
[0010] Preferably, the test operation primitives in S2 are machine executable metadata corresponding to the test operation descriptions, and the test operation primitives can adapt to different browser automation frameworks.
[0011] Preferably, the test script requirements specified by the tester in S3 include unit test framework selection, web automation framework selection and programming language selection, and the test script generated by the code generation agent contains test environment setup, test step implementation and resource cleanup code.
[0012] Preferably, in the semantic analysis process of the test case by the planning agent in S1, the business rules and constraints implied in the test steps can be understood in combination with the retrieved domain knowledge of the system under test.
[0013] Preferably, in S2, the operation agent simplifies the complex interface structure into a list of meaningful elements when processing.
[0014] Preferably, in S3, the code generation agent obtains the official documents and API references of the specified test framework version through the MCP tool, which serves as the knowledge base for code generation, ensuring that the generated test code conforms to the syntax specifications and best practices of the specific framework version, and the selection and version control of the framework are completely specified by the tester.
[0015] Preferably, the human-machine cycle interaction process in S1 supports the tester to adjust and optimize the test operation description sequence generated by the planning agent according to actual needs, or provide more detailed instructions and prompt information to the planning agent.
[0016] Preferably, the method is applied to the design, execution and test script generation of the automatic test process of the Web system.
[0017] The present application provides a natural language driven GUI test rehearsal and test script generation method based on LLM. It has the following advantages: 1. The present application realizes the automatic conversion of natural language test cases to standardized test operations through the human-machine cycle interaction between the planning agent and the tester, enabling non-programming background testers to participate in the design of automated testing, significantly reducing the technical threshold.
[0018] 2. The present application adopts a text and visual dual-mode interface understanding mechanism, and realizes cross-modal semantic alignment by combining a unified element number, solving the limitations of traditional tools relying on single element positioning, making the test operation adaptable to interface dynamic changes and reducing script maintenance costs.
[0019] 3. The application realizes the adaptation and conversion of the same test logic to different Web automation frameworks (Selenium, Cypress, Playwright, etc.) by testing the intermediate layer design of the operation primitive and the framework document retrieval ability of the MCP tool, and improves the reusability of test assets.
[0020] 4. The application enables testers to intuitively intervene in each link of the test process and correct the deviation of the intelligent agent decision in a timely manner through the visual review interface and interactive correction mechanism, thereby ensuring the test accuracy while maintaining the automation efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0021] Figure 1 The overall flowchart of the application Figure 2 The test personnel and multi-agent system cooperation flowchart of the application Figure 3 The test operation design flowchart of the application Figure 4 The test automation rehearsal flowchart of the application Figure 5 The test script generation flowchart of the application.
[0022] Figure 6 The test script generation flowchart of the application. DETAILED DESCRIPTION
[0023] The technical solutions in the embodiments of the application will be described below with reference to the drawings in the specification of the application. Obviously, the described embodiments are only some of the embodiments of the application, not all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of the application.
[0024] For the convenience of subsequent description of the specific content of the application, the related professional terms used in the invention content are explained.
[0025] 1. Graphical User Interface (GUI) test: a test method for verifying whether the function, appearance and interaction of a software interface meet the requirements. It checks the correctness, layout rationality, response speed and compatibility of interface elements by simulating user operations.
[0026] 2. Test script: a set of automated instructions or codes for simulating user interaction with the system under test, which is executed by automated tools to automatically check whether the function, layout and response meet the expectations.
[0027] 3. Large Language Models (LLMs): Deep learning models trained on vast amounts of data, excelling at understanding and generating natural language, widely used in tasks such as question answering, translation, and creative writing.
[0028] 4. LLM Agent: An AI system with autonomous decision-making capabilities, combining LLMs with planning, memory, and tool invocation functions to perform complex tasks.
[0029] 5. Multi-Agent System: A distributed system composed of multiple autonomous agents that interact and collaborate to complete complex tasks.
[0030] 6. Human-in-the-loop (HITL): A workflow that combines human intelligence with automated systems (such as AI or multi-agent systems) through real-time supervision, intervention, or collaboration to optimize decision-making, improve system reliability, and adaptability.
[0031] 7. Test Case: A validation scheme designed for specific functions or scenarios in software testing, explicitly describing preconditions, test steps, input data, and expected results to determine whether the system behaves as expected.
[0032] 8. Test Step: A specific sequence of operations performed in software testing to verify the expected behavior of the tested function, typically including input, operation, and expected result descriptions.
[0033] 9. Test Operation Description: A low-level, standardized natural language description of individual atomic operations in test steps, explicitly including action type, target component semantics, necessary parameters, and explanations.
[0034] Test Operation Primitives: Machine-executable metadata corresponding to test operation descriptions, including target component positioning information, operation type enumeration values, and optional parameter values.
[0035] The overall flow of the method is divided into three stages, as shown in Figure 1: In the test operation design stage, take the test case as input, and output the test operation description through the human-in-the-loop (HITL) interaction mode; In the automated test rehearsal stage, take the test operation description of the previous stage as input, and output the operation primitives through the operation agent to test the system; In the test script generation stage, take the operation primitives of the previous stage as input, and output the actual executable test script through the code generation agent.
[0036] The specific collaboration details are shown in FIG. 2. The tester interacts with multiple agents to ultimately achieve the generation of the test script: interacts with the human-in-the-loop (HITL) to cooperatively complete the design and confirmation of the test operation description, the pre-exploration of the web automation test, the output of the test operation primitives, and the generation of the test script.
[0037] Step 1, test operation design In web GUI automation testing, the tester usually needs to write high-level test case descriptions to describe the user tasks or business goals that the tester needs to test for the system under test (a system login function test case shown in Table 1). However, in the face of abstract and general test case descriptions, large language models often cannot accurately understand, and hallucination problems result in low accuracy of test instruction implementation and conversion. In order to improve the accuracy of large language models for instruction implementation and improve the efficiency of automated execution, the method needs to convert high-level test case steps into low-level test operation descriptions for web pages. The tester interacts with the planning agent through human-in-the-loop (HITL) to gradually disassemble, correct, and generate test operation descriptions for the natural language described test case steps.
[0038] Table 1: A system login function test case example
[0039] The specific process is shown in FIG. 3: taking the tester, planning agent, and operation agent as the main body, mainly including modeling the domain knowledge of the system under test, semantic understanding of the test case, and interactive design of the test operation description.
[0040] In the modeling of the domain knowledge of the system under test, the planning agent takes the system manual, interface specification, and historical test data as input, adopts a hybrid architecture based on retrieval-augmented generation (RAG), and stores and retrieves the document information of the system under test through a vector database. After these documents are processed through semantic vectorization, the business concepts and operation methods in the system under test are understood, providing necessary domain knowledge support for the understanding of the system under test and providing a basis for accurate conversion of test cases to test operation descriptions, which can support the agent to perform efficient similarity retrieval.
[0041] In understanding the semantics of test cases, the planning agent first performs semantic analysis on the input test case, identifies the key business concepts, operation objects, operation steps, and corresponding expected results. Through the retrieval enhancement generation mode, the planning agent can understand the business rules and constraints implied in the test steps by combining the domain knowledge of the system under test. This deep understanding enables the agent to accurately grasp the test intent and lay the foundation for subsequent operation description generation.
[0042] In interactive test operation description design, to ensure the accuracy of the generated results, the method introduces a human-computer cycle interactive confirmation mechanism. The agent, based on the semantic understanding of the system under test and the test case, decomposes and plans the test steps, generates a standardized test operation instruction sequence, each instruction including precise positioning description of interface elements and corresponding operation parameters, and comprehensively considers factors such as interface structure characteristics, operation sequence dependency relationships, and possible conditional branches. The agent combines semantic understanding and knowledge retrieval mechanism for operation description generation, and displays the action type and target element corresponding to each test operation through a visual interface for review and confirmation by the tester. The tester can adjust and optimize the operation description sequence according to actual needs, or provide more detailed instructions and prompt information to the agent to enhance the planning accuracy. The adjustment information and feedback results in the above interaction process will be written into the agent's context memory module as prior knowledge to support continuous planning and interactive confirmation in subsequent test steps. Through the above progressive quality optimization mechanism, accurate conversion of high-level test cases to low-level executable test operation descriptions can be achieved, and the intelligent level and practical performance of test operation generation can be significantly improved.
[0043] Taking Table 1 as an example, after test operation design, the planning agent will generate a test operation description sequence as shown in Table 2, including steps such as accessing the system under test, inputting username and password, and clicking the login button. This conversion not only preserves the test intent, but also provides sufficient execution details, providing reliable input for subsequent automated test rehearsal.
[0044] Table 2 Example of test operation description sequence for login function of a certain system
[0045] Step 2, test automation rehearsal After the initial test operation description design, the generated test operation description can be used as input information for the test operation description of the subsequent iteration of the system under test. The operation agent performs test operation rehearsal on the system under test and generates the test operation primitive sequence corresponding to the current round after each successful operation. Since the actual operation rehearsal is performed, it ensures accurate execution and effective verification of each test step.
[0046] The specific process is shown in FIG. 4: the operation agent and the system under test adopt a sequential interaction control mode, the operation agent first perceives the system under test state (including page URL, page title, page semantic information), and integrates the system state with the test operation description, then makes operation decision and operation execution, and the system under test updates the state after execution, completing one interaction.
[0047] In the perception of the system under test and the semantic understanding of the page element, the operation agent adopts a text and visual dual-modal method to understand the interface element. At the text level, the application extracts multi-dimensional features of HTML elements, including visibility, operability, element size, spatial position, and element type, etc. At the visual level, the application uses the set-of-mark technology to mark the interactive and visible interface elements, and realizes the semantic alignment of text features and visual features through a unified element number. This dual-modal interface understanding method has the following advantages: first, by extracting the multi-dimensional features of HTML elements, the operable elements can be accurately identified and located; second, the visual marking technology can capture the visual features and spatial relationships of elements; finally, the semantic alignment of text and visual features ensures the accuracy of operation decision. For complex interface structures, the application simplifies the page into a list of meaningful elements, reducing the processing difficulty.
[0048] In decision making and operation execution, the operation agent adopts a strict operation type limiting mechanism to ensure the rationality of the generated operation decision. The application supports basic operation types including click, dragdrop, goto, keypress, select, and type, and abstracts their parameters. Through function calling and structured output, the application ensures that only predefined operation types can be generated, improving the reliability of operation execution. To cope with the dynamic changes of the interface, the application adopts a single-step execution strategy. The operation agent re-evaluates the interface state after each operation execution, making decisions for the next operation. This strategy ensures that the system under test can respond to the dynamic changes of the interface in a timely manner, improving the accuracy of the test rehearsal.
[0049] In operation primitive generation, the application first defines that the operation primitive is a standardized description of the successful execution of the operation, adopting a triple (locator, parameter, operation name) structure. Only after the operation is successfully executed on the system under test, the corresponding operation primitive is generated, ensuring the effectiveness of the primitive. By abstracting the operation, the generated test operation primitive can adapt to different browser automation frameworks, improving the portability of the test script. As shown in Table 3, each operation primitive contains complete execution information, providing reliable input for subsequent test script generation.
[0050] Table 3. Examples of system login function test operation primitives
[0051] Step 3: Test script generation After generating the operation primitives, the generated operation primitives can be converted for use by various browser automation frameworks (such as Selenium, Playwright, etc.), taking the operation primitives as input information, and the code generation agent generates test scripts suitable for different test environments according to the specific requirements of the test personnel for the test script (such as unit test framework, web automation framework, programming language, etc.), ultimately realizing GUI test rehearsal and test script generation for natural language test cases. Through strict code generation strategies and quality control mechanisms, the generated test scripts meet the requirements of specific test frameworks and maintain high code quality.
[0052] The specific process is shown in Figure 5: after accepting the operation primitives and user requirement inputs, the code generation agent selectively calls MCP to obtain the relevant dependency documentation manual for the user's specific requirements for the test script, and the code generation agent adopts a three-stage generation strategy to ensure the accuracy and standardization of the test script. The first stage is requirement analysis, and the agent strictly follows the requirements specified by the test personnel, including version selection of the test framework, programming language preference, synchronous or asynchronous execution mode, and other technical specifications. The second stage is document retrieval, and the present application obtains the official documentation and API reference for the specified test framework version through the MCP tool to provide accurate technical guidance for code generation. The third stage is code conversion, which accurately converts the triples (locator, parameter, operation name) in the test operation primitives into code statements supported by the target test framework.
[0053] This phased generation strategy has the following advantages: first, by strictly following user requirements, it ensures that the generated code conforms to project specifications; second, by document retrieval enhancement, it ensures that the code conforms to the syntax requirements of the specific framework version; and finally, by precise triple conversion, it ensures accurate implementation of the test operation.
[0054] The code generation agent supports code generation of mainstream automated test frameworks through a document retrieval mechanism. The application realizes the connection of the Model Context Protocol (MCP) client, uses the fetch MCP service call to extract the web page content, obtains the test framework documents of the corresponding version, and uses these documents as the knowledge base for code generation to ensure that the generated code meets the syntax specifications and best practices of the specific framework version. The selection and version control of the framework are completely specified by the test personnel, and the agent strictly generates the corresponding test code according to the specified version of the framework document.
[0055] To ensure the quality of the generated code, the application implements a quality control mechanism based on deterministic agents. This mechanism includes two levels of static analysis and dynamic execution analysis. At the static analysis level, the system checks the syntax correctness, naming conventions, and code structure of the code; at the dynamic execution analysis level, the application can execute the test script with the authorization of the test personnel to verify its runtime behavior. When potential problems are found, the agent will try to automatically correct them; for problems that cannot be automatically corrected, the application will request assistance from the test personnel.
[0056] It should be particularly noted that the test script generation of the application only focuses on the implementation of test steps and does not involve the generation of test assertions. This design choice allows the application to focus on improving the accuracy of operation sequence implementation, while leaving the verification logic of test results to the test personnel to define according to specific business requirements.
[0057] As shown in FIG. 6, the generated test script includes complete test environment setup, test step implementation, and resource cleanup code. The structure of the script is clear, with complete annotations, making it easy for the test personnel to understand and maintain. In this way, the application can convert test operation primitives into high-quality automated test scripts, providing a reliable code base for test execution. The generated test script meets the requirements and is executable.
[0058] The application adopts a multi-agent system architecture based on large language models, which divides the complex GUI test automation task into three core stages: test operation interaction design, automated test rehearsal, and test script generation. Each stage is handled by a dedicated agent, effectively reducing the complexity of the task through clear division of responsibilities and collaboration mechanisms. In particular, the application has significant advantages in the following aspects: 1. By planning the RAG architecture of the agent, the application achieves deep semantic understanding of the test case, ensuring accurate grasp of the test intent; 2. With the help of the dual-modal understanding ability of the operation agent, the accuracy and robustness of interface operations are improved; 3. The three-stage generation strategy of the agent using code generation ensures the quality of the test script and the framework adaptability.
[0059] The present application improves the stability of the test script through the innovative interface element processing method: 1. Adopting a dual-modal interface understanding method of text and vision, the semantic labeling and alignment of interface elements are realized through the set-of-mark technology; 2. Multi-dimensional feature extraction of HTML elements is realized, including the comprehensive analysis of visibility, operability, element size, spatial position, etc. 3. Through strict operation type limitation and single-step execution strategy, the problem of dynamic changes of the interface is effectively solved; This semantic understanding-based method has stronger adaptability than the traditional coordinate or XPath-based positioning method, and can maintain the effectiveness of the test script when the interface changes.
[0060] The present application realizes significant optimization in resource utilization efficiency: 1. Direct communication between agents is realized through function call, avoiding the complexity of communication protocol overhead; 2. Deterministic agent design is adopted, ensuring code quality through static analysis and dynamic execution analysis, reducing the need for manual intervention; 3. The generation of test scripts is limited to the operation step implementation level, avoiding the complexity of test assertion generation; In addition, the multi-agent collaboration mechanism of the present application also has the following advantages: 1. Through the explicit error handling mechanism, controllability and reliability in the test process are realized; 2. The quality control mechanism based on human-computer cycle ensures the accuracy and practicality of the generated results; 3. Supports the adaptation of different test frameworks, improving the universality and scalability of the system; Through the comprehensive effect of the above technical effects, the present application significantly improves the efficiency and reliability of GUI test automation, providing an innovative solution for test engineering practice.
[0061] Although embodiments of the present application have been shown and described, it will be understood by those of ordinary skill in the art that various changes, modifications, replacements and variations of these embodiments can be made without departing from the principles and spirit of the present application, and the scope of the present application is defined by the appended claims and their equivalents.
Claims
1. A method for natural language-driven GUI test pre-visualization and test script generation based on LLM, characterized in that, Includes the following steps: S1: Test Operation Design: Testers and planning agents interact cyclically to convert high-level test cases described in natural language into low-level, standardized test operation descriptions. The planning agent adopts a hybrid architecture based on retrieval enhancement generation. Testers review, adjust, and provide feedback on the test operation descriptions. The feedback information is stored as prior knowledge in the context memory module of the planning agent. S2: Test Automation Pre-Drill: The operational agent takes the test operation descriptions generated in S1 as input, performs a test pre-drill on the system under test, and generates test operation primitives. The operational agent uses a dual-modal approach of text and vision to understand interface elements. At the text level, it extracts the visibility, operability, element size, spatial position, and element type attributes of HTML elements. At the visual level, it uses set-of-mark technology to mark interactive and visible interface elements, and achieves semantic alignment between text and visual features through unified element numbering. The operational agent adopts a strict operation type limitation mechanism, supporting only click, drag, page jump, button, selection, and input operations. It also adopts a single-step execution strategy, re-evaluating the interface state of the system under test after each operation to cope with dynamic changes. Test operation primitives with a triple structure are generated only after the operation is successfully executed. S3: Test Script Generation: The code generation agent takes the test operation primitives generated in S2 and the test script requirements specified by the tester as input to generate executable test scripts. The code generation agent adopts a three-stage generation strategy. In the first stage, it parses the test framework version, programming language, and execution mode requirements specified by the tester. In the second stage, it connects to the Model Context Protocol client and calls the fetch MCP service to obtain the official documentation and API references for the specified test framework version. In the third stage, it accurately converts the triple structure of the test operation primitives into code statements supported by the target test framework. At the same time, the code generation agent ensures code quality from the static analysis and dynamic execution analysis levels through a quality control mechanism based on deterministic agents, and automatically corrects potential problems.
2. The method for LLM-based natural language-driven GUI test pre-visualization and test script generation according to claim 1, characterized in that, The test operation description in S1 is a low-level normalized natural language description of a single atomic operation in the test step, which explicitly includes the action type, target component semantics, necessary parameters and explanatory information.
3. The method for LLM-based natural language-driven GUI test pre-visualization and test script generation according to claim 1, characterized in that, In S2, the operating agent and the system under test adopt a sequential interactive control mode. The interaction process is as follows: the operating agent first perceives the state of the system under test, which includes the page URL, page title, and page semantic information. Then, the operating agent integrates the system state with the test operation description, makes an operation decision, and executes the operation. After the operation is executed, the system under test updates its state, completing one interaction.
4. The method for LLM-based natural language-driven GUI test pre-visualization and test script generation according to claim 1, characterized in that, The test operation primitives in S2 are machine-executable metadata corresponding to the test operation description, and the test operation primitives can be adapted to different browser automation frameworks.
5. The method for LLM-based natural language-driven GUI test pre-visualization and test script generation according to claim 1, characterized in that, The test script requirements specified by the tester in S3 include the selection of unit testing framework, web automation framework, and programming language, and the test script generated by the code generation agent includes test environment settings, test step implementation, and resource cleanup code.
6. The method for LLM-based natural language-driven GUI test pre-visualization and test script generation according to claim 1, characterized in that, In the process of semantic parsing of test cases by the planning agent in S1, the retrieved domain knowledge of the system under test can be combined to understand the business rules and constraints implicit in the test steps.
7. The method for LLM-based natural language-driven GUI test pre-visualization and test script generation according to claim 1, characterized in that, In S2, when processing complex interface structures, the operating agent simplifies the page into a list of meaningful elements.
8. The method for LLM-based natural language-driven GUI test pre-visualization and test script generation according to claim 1, characterized in that, The code generation agent in S3 obtains the official documentation and API references of the specified test framework version through the MCP tool, which serve as the knowledge base for code generation. This ensures that the generated test code conforms to the syntax specifications and best practices of the specific framework version, and the selection and version control of the framework are entirely specified by the testers.
9. The method for LLM-based natural language-driven GUI test pre-visualization and test script generation according to claim 1, characterized in that, The human-computer cyclic interaction process in S1 allows testers to adjust and optimize the test operation description sequence generated by the planning agent according to actual needs, or to provide more detailed instructions and prompts to the planning agent.
10. The method for LLM-based natural language-driven GUI test pre-visualization and test script generation according to claim 1, characterized in that, The method is applied to the design, execution, and script generation stages of automated testing processes for Web systems.
Citation Information
Patent Citations
Automatic test input generation method based on dynamic page splitting
CN119576760A
Robot operation method, robot, storage medium, device and program product
CN119610111A
Multi-agent-based scene granularity interface test case generation method
CN120086125A
API intelligent test method based on context awareness
CN120803956A
System for augmenting roi of large multimodal model based on vision
KR102830333B1