Automatic software testing method and device, medium and equipment
By building a preset test system based on modular script library and graphical interface, the problem of the inability to efficiently and quickly automate different web pages in the existing technology is solved, and efficient and flexible automated testing is achieved, reducing testing costs and improving testing efficiency.
Patent Information
- Application Number
- CN202510219242.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2025-06-24
AI Technical Summary
The existing technology cannot efficiently and quickly conduct automated testing of different web pages. Traditional automated testing methods lack flexibility and scalability, making it difficult to deal with testing costs and efficiency issues when software system updates or changes in testing requirements.
By building a preset test system based on a modular script library and a graphical interface, each web page to be tested is obtained, and the corresponding test module is selected according to its characteristics, the test parameters are configured to generate a test script, and the test script is run using the unique ID of the web page element to generate detailed test results.
It realizes the efficiency and flexibility of automated software testing, improves testing efficiency, reduces testing costs, and can quickly generate detailed test results, helping testers quickly locate problems and optimize them.
Smart Images

Figure CN120196544A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automated software testing, and particularly to an automated software testing method, device, medium and equipment. Background Art
[0002] With the rapid development of Internet technology, the complexity and functional diversity of software systems are increasing continuously, and the importance of software testing in ensuring software quality and user experience is becoming increasingly prominent. Traditional software testing methods mainly rely on manual testing. This method is not only inefficient, vulnerable to human factors, but also difficult to meet the testing requirements of large-scale software systems. In recent years, automated testing technology has gradually become the mainstream trend in the field of software testing. It can significantly improve testing efficiency and accuracy by writing test scripts to automatically execute test tasks.
[0003] However, existing automated testing methods still have some limitations. For example, traditional automated test cases usually target a single test scenario, lacking flexibility and scalability. When the software system is updated or the testing requirements change, the test scripts often need to be rewritten or extensively modified, which not only increases the testing cost but also reduces the testing efficiency. In addition, for complex software systems containing multiple web pages, there may be differences in the testing processes between different web pages, and traditional automated testing methods are difficult to efficiently handle such diverse testing requirements. These limitations result in the inability of the existing technology to efficiently and quickly perform automated testing on different web pages. Summary of the Invention
[0004] The present invention provides an automated software testing method, device, medium and equipment to solve the problem that the existing technology cannot efficiently and quickly perform automated testing on different web pages.
[0005] In a first aspect, the present application provides an automated software testing method, including:
[0006] Obtain each web page to be tested;
[0007] Select each test module in a preset test system according to the web pages to be tested; wherein, the preset test system is constructed according to preset modular script libraries and a graphical interface;
[0008] Configure each test parameter of each web page to be tested according to preset parameter configurations and the test modules to obtain each test script of each web page to be tested;
[0009] Run the test scripts according to the unique IDs of each web page element to be tested to obtain the test results of each web page.
[0010] This application realizes the efficiency and flexibility of automated software testing by constructing a preset test system based on a modular script library and a graphical interface. First, by obtaining each web page to be tested and selecting corresponding test modules in the preset test system according to its characteristics, the pertinence and adaptability of the test are ensured. Since the test system is constructed based on a modular script library, users can flexibly configure test parameters for each web page to be tested and generate test scripts according to the preset parameter configurations, which not only improves the generation efficiency of test scripts but also enhances the scalability and maintainability of the system. In addition, by running the test scripts through the unique ID of web page elements, the accuracy and reliability of the test are further improved. Finally, the system can quickly generate detailed test results to help testers quickly locate problems and optimize them. This modular and automated test method significantly improves the test efficiency and reduces the test cost. This application effectively solves the problem that the prior art cannot perform automated testing on different web pages efficiently and quickly.
[0011] As a preferred embodiment of the first aspect, running the respective test scripts according to the unique ID of each web page element to be tested to obtain the test results of each web page specifically includes:
[0012] Running the respective test scripts according to the unique ID of each web page element to be tested;
[0013] Extracting the exception information and execution status data during the running process of the respective test scripts according to the preset test log;
[0014] Obtaining the test results of each web page according to the exception information, execution status data, and preset determination conditions.
[0015] After obtaining the test results of each web page according to the exception information, execution status data, and preset determination conditions, it further includes:
[0016] Generating test reports for each web page according to the test results of each web page;
[0017] The test reports of each web page include the test pass rate, failure cause analysis, and exception information.
[0018] In this preferred embodiment, the present application can efficiently and accurately obtain the test results of each web page by running test scripts using the unique IDs of web page elements and combining with a preset test log mechanism. Specifically, the system first runs the test scripts according to the unique IDs of web page elements to ensure that the test operations can accurately locate and operate each element on the web page, thereby ensuring the accuracy and reliability of the test. During the running of the test scripts, the system will extract abnormal information and execution status data in real time according to the preset test log mechanism, and these data provide key bases for the subsequent determination of test results. Finally, the system combines the extracted abnormal information, execution status data with the preset determination conditions to generate detailed test results. This mechanism can not only quickly discover problems occurring during the test process, but also intuitively reflect the smoothness of the test process through the execution status data, thereby providing comprehensive feedback to testers and helping them quickly locate and fix problems.
[0019] As a preferred embodiment of the first aspect, the step of configuring the test parameters of each web page to be tested according to the preset parameter configuration and each test module to obtain the test scripts of each web page to be tested further includes:
[0020] Adding version identifiers to each of the test scripts according to a preset script library management module;
[0021] When calling the test scripts, verifying the compatibility of each of the version identifiers;
[0022] If there is an incompatibility in the versions, generating a downgrade processing prompt for each of the test scripts.
[0023] In this preferred embodiment, the present application significantly improves the stability and reliability of automated testing by introducing version identifiers and a compatibility verification mechanism in the test script management process. Specifically, when generating test scripts, the system uses a preset script library management module to add version identifiers to each script, which enables different versions of scripts to be clearly distinguished and managed. When calling test scripts, the system verifies the compatibility of the version identifiers to ensure that different versions of scripts can work together. If an incompatibility in the versions is found, the system generates a downgrade processing prompt to remind the user to make necessary adjustments or updates. Through this mechanism, the present application can not only effectively avoid test failures caused by script version conflicts, but also ensure the continuity and stability of the test process, thereby reducing test risks, improving test efficiency and accuracy, and providing a more reliable automated testing solution for software development and testing.
[0024] As a preferred embodiment of the first aspect, configuring the respective test parameters of each web page to be tested according to the preset parameter configuration and each of the test modules to obtain the respective test scripts for each web page to be tested is specifically as follows:
[0025] Selecting each test module for each web page to be tested according to the respective modular script libraries of the preset test system; wherein, the respective modular script libraries include login, factory reset, or modifying wifi parameters;
[0026] Configuring the respective test parameters of each web page to be tested according to each of the test modules and the graphical interface to obtain the respective test parameters for each web page to be tested;
[0027] Obtaining the respective test scripts for each web page to be tested according to each test script module and the respective parameters.
[0028] In this preferred embodiment, the present application realizes an efficient and flexible test script generation process through the combination of the modular script library and the graphical interface, thereby significantly improving the efficiency and adaptability of automated testing. Specifically, the system uses the preset modular script library (login, factory reset, or modify wifi parameter module) to select appropriate test modules for different web pages. This modular design enables the test scripts to be flexibly combined according to specific requirements, enhancing the scalability and reusability of the system. Further, through the graphical interface for parameter configuration (such as username, password, ID of page elements, etc.), users can generate test scripts without writing code, reducing the technical threshold of testing and improving the generation efficiency of test scripts. Finally, the system generates targeted test scripts based on the selected test modules and configured parameters, ensuring the accuracy and reliability of the testing. This design not only improves the testing efficiency but also enhances the flexibility and adaptability of testing, providing a more efficient and convenient solution for software testing.
[0029] In a second aspect, the present application provides an automated software testing device. The automated software testing device includes an acquisition module, a selection module, a configuration module, and a testing module;
[0030] The acquisition module is used to acquire each web page to be tested;
[0031] The selection module is used to select each test module in the preset test system according to each web page to be tested; wherein, the preset test system is constructed according to the preset respective modular script libraries and the graphical interface;
[0032] The configuration module is used to configure the respective test parameters of each web page to be tested according to the preset parameter configuration and each of the test modules to obtain the respective test scripts for each web page to be tested;
[0033] The test module is used to run the respective test scripts according to the unique IDs of the web page elements to be tested, and obtain the test results of the respective web pages.
[0034] This device uses four modules to divide the work and coordinate with each other to perform automated testing on different web pages more efficiently. This application realizes the efficiency and flexibility of automated software testing by constructing a preset test system based on a modular script library and a graphical interface. First, by obtaining each web page to be tested and selecting the corresponding test module in the preset test system according to its characteristics, the pertinence and adaptability of the test are ensured. Since the test system is built based on a modular script library, users can flexibly configure test parameters for each web page to be tested and generate test scripts according to the preset parameter configurations, which not only improves the generation efficiency of test scripts but also enhances the scalability and maintainability of the system. In addition, by running the test scripts according to the unique IDs of the web page elements, the accuracy and reliability of the test are further improved. Finally, the system can quickly generate detailed test results to help testers quickly locate problems and optimize them. This modular and automated testing method significantly improves the test efficiency and reduces the test cost. This application effectively solves the problem that the prior art cannot perform automated testing on different web pages efficiently and quickly.
[0035] As a preferred embodiment of the second aspect, running the respective test scripts according to the unique IDs of the web page elements to be tested and obtaining the test results of the respective web pages specifically includes:
[0036] Running the respective test scripts according to the unique IDs of the web page elements to be tested;
[0037] Extracting the exception information and execution status data during the running process of the respective test scripts according to the preset test log;
[0038] Obtaining the test results of the respective web pages according to the exception information, execution status data, and preset determination conditions, and quickly performing automated testing on different web pages.
[0039] In this preferred embodiment, the present application can efficiently and accurately obtain the test results of each web page by running test scripts using the unique ID of web page elements and combining with a preset test log mechanism. Specifically, the system first runs the test script according to the unique ID of the web page element to ensure that the test operations can accurately locate and operate each element on the web page, thereby ensuring the accuracy and reliability of the test. During the running of the test script, the system will extract abnormal information and execution status data in real time according to the preset test log mechanism, and these data provide key bases for the subsequent determination of test results. Finally, the system combines the extracted abnormal information, execution status data with the preset determination conditions to generate detailed test results. This mechanism can not only quickly discover problems occurring during the test process, but also intuitively reflect the smoothness of the test process through the execution status data, thereby providing comprehensive feedback to testers and helping them quickly locate and fix problems.
[0040] As a preferred embodiment of the second aspect, configuring the respective test parameters of each web page to be tested to obtain the respective test scripts of each web page to be tested according to the preset parameter configuration and the respective test modules specifically includes:
[0041] Selecting the respective test modules of each web page to be tested according to the respective modular script libraries of the preset test system; wherein, the respective modular script libraries include login, factory reset, or modification of wi-fi parameters;
[0042] Configuring the parameters of each web page to be tested according to the respective test modules and the graphical interface to obtain the respective test parameters of each web page to be tested;
[0043] Obtaining the respective test scripts of each web page to be tested according to the respective test script modules and the respective parameters.
[0044] In this preferred embodiment, the present application combines a modular script library and a graphical interface to achieve an efficient and flexible test script generation process, thereby significantly improving the efficiency and adaptability of automated testing. Specifically, the system uses a preset modular script library (login, factory reset, or modify WiFi parameter module) to select appropriate test modules for different web pages. This modular design enables test scripts to be flexibly combined according to specific requirements, enhancing the scalability and reusability of the system. Further, through the graphical interface for parameter configuration (such as username, password, ID of page elements, etc.), users can generate test scripts without writing code, reducing the technical threshold of testing and improving the generation efficiency of test scripts. Finally, the system generates targeted test scripts based on the selected test modules and configured parameters, ensuring the accuracy and reliability of testing. This design not only improves testing efficiency but also enhances the flexibility and adaptability of testing, providing a more efficient and convenient solution for software testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 : A flowchart showing an embodiment of the automated software testing method provided by the present application;
[0046] Figure 2 : A structural diagram showing an embodiment of the automated software testing device provided by the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0047] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying 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 of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0048] Embodiment 1
[0049] Please refer to Figure 1 , which is an automated software testing method provided by an embodiment of the present invention.
[0050] In this embodiment, the process of the automated software testing method in the present application is described in detail through steps S01 - S04.
[0051] The automated software testing system of this application can implement the testing of different web pages. Existing companies currently have multiple sets of web pages, but the testing processes between different web pages are generally the same. It is required that front-end engineers add unique ID attributes to each interactive element such as menus, buttons, input boxes, etc., and establish and maintain a document containing all the ID of web page elements. This step is the basis of automated testing, ensuring that the test script can accurately identify and operate these elements. For web pages with different testing processes, develop specialized customized testing modules. These modules are written according to the requirements of specific web pages, but also rely on the unique ID of the elements to locate and operate.
[0052] The automated software testing system of this application is modular-based, including a test script editor, a script library management module, a test execution module, and a result analysis module. These modules constitute a testing system.
[0053] Among them, the test script editor is used to write and edit test scripts. Users can create test scripts according to test requirements through a graphical interface or a code editor. The test script consists of multiple reusable script modules, and each module implements specific test functions, such as logging in, restoring factory settings, modifying wifi parameters, etc.
[0054] The script library management module is used to store and manage test script modules. This module provides functions for creating, editing, deleting, and querying script modules, facilitating users to select and combine script modules according to test requirements. At the same time, this module also supports version control of script modules to ensure the stability and consistency of test scripts.
[0055] The test execution module is responsible for parsing and executing test scripts. The test execution engine sequentially calls the modules in the script library according to the module order in the test script to achieve the automated execution of the test process. During the execution process, the test execution engine can also adjust the test process according to the test results, such as retrying according to error prompts or skipping specific test steps.
[0056] The test result analysis module is used to collect and analyze test results. This module can automatically capture log information, exception information, and test result data during the test process, and judge the test results according to preset judgment conditions. At the same time, this module can also generate a detailed test report, including information such as the test pass rate and failure reason analysis, to help users quickly locate problems and take corresponding repair measures.
[0057] S01: Obtain each web page to be tested.
[0058] S02: Select each test module in a preset test system according to the web pages to be tested; among them, the preset test system is constructed according to preset modular script libraries and a graphical interface.
[0059] As a preferred embodiment of Embodiment 1, the preset test system is constructed according to the preset modular script libraries and graphical interface, specifically as follows:
[0060] According to the test requirements, design and implement a series of reusable test script modules. These modules should cover common test functions, such as login, factory reset, modifying WiFi parameters, etc.
[0061] Package the designed test script modules and store them in the script library management module. The script library management module provides functions for creating, editing, deleting, and querying script modules to ensure the effective management and quick retrieval of modules.
[0062] Design the graphical interface of the test script editor to make it intuitive and easy to use. The interface should include functional areas such as a module selection area, a script editing area, and a parameter configuration area.
[0063] Implement functions such as module selection, script editing, and parameter configuration in the graphical interface. The required test script modules can be conveniently selected through the graphical interface, and they can be edited and configured to meet different use case requirements.
[0064] Through the graphical interface, select the corresponding test script modules according to the test requirements.
[0065] The system automatically generates test scripts according to the modules selected by the user and the configured parameters. The test scripts are composed of multiple reusable script modules and are arranged in the order specified by the user.
[0066] S03: Configure the test parameters of each web page to be tested according to the preset parameter configuration and each test module, and obtain the test scripts of each web page to be tested.
[0067] As a preferred embodiment of Embodiment 1, the step of configuring the test parameters of each web page to be tested according to the preset parameter configuration and each test module, and obtaining the test scripts of each web page to be tested, specifically is:
[0068] Through the graphical interface, select the corresponding test script modules according to the test requirements.
[0069] The system automatically generates test scripts according to the modules selected by the user and the configured parameters. The test scripts are composed of multiple reusable script modules and are arranged in the order specified by the user. The generated test scripts can also be selected to be saved for subsequent use or modification.
[0070] In this preferred embodiment, the present application realizes an efficient and flexible test script generation process through the combination of a modular script library and a graphical interface, thereby significantly improving the efficiency and adaptability of automated testing. Specifically, the system uses a preset modular script library (login, factory reset, or modify Wi-Fi parameter module) to select appropriate test modules for different web pages. This modular design enables the test scripts to be flexibly combined according to specific requirements, enhancing the scalability and reusability of the system. Further, through the graphical interface for parameter configuration (such as username, password, ID of page elements, etc.), users can generate test scripts without writing code, reducing the technical threshold of testing and improving the generation efficiency of test scripts. Finally, the system generates targeted test scripts based on the selected test modules and configured parameters, ensuring the accuracy and reliability of the testing. This design not only improves the testing efficiency but also enhances the flexibility and adaptability of testing, providing a more efficient and convenient solution for software testing.
[0071] S04: Run the respective test scripts according to the unique IDs of the respective web page elements to be tested, and obtain the test results of the respective web pages.
[0072] As a preferred embodiment of Embodiment 1, the step of running the respective test scripts according to the unique IDs of the respective web page elements to be tested and obtaining the test results of the respective web pages is specifically as follows:
[0073] Run the respective test scripts according to the unique IDs of the respective web page elements to be tested;
[0074] Extract the exception information and execution status data during the running of the respective test scripts according to a preset test log;
[0075] Obtain the test results of the respective web pages according to the exception information, execution status data, and preset determination conditions.
[0076] In this preferred embodiment, the present application can efficiently and accurately obtain the test results of each web page by running test scripts using the unique ID of web page elements and combining with a preset test log mechanism. Specifically, the system first runs the test scripts according to the unique ID of web page elements to ensure that the test operations can accurately locate and operate each element on the web page, thus guaranteeing the accuracy and reliability of the tests. During the running of the test scripts, the system will, according to the preset test log mechanism, extract abnormal information and execution status data in real time, and these data provide key basis for the subsequent determination of test results. Finally, the system combines the extracted abnormal information, execution status data with the preset determination conditions to generate detailed test results. This mechanism can not only quickly discover problems occurring during the test process, but also intuitively reflect the smoothness of the test process through the execution status data, thereby providing comprehensive feedback to testers and helping them quickly locate and fix problems.
[0077] As a preferred embodiment of Embodiment 1, after running the respective test scripts according to the unique ID of each web page element to be tested and obtaining the test results of each web page, it further includes:
[0078] The test execution engine parses and executes the generated test scripts. According to the module sequence in the scripts, it sequentially calls the modules in the script library to achieve the automated execution of the test process.
[0079] During the test execution process, the test result analysis module automatically captures the log information, abnormal information, and test result data during the test process.
[0080] According to the preset judgment conditions, the test results are judged. The system can automatically determine whether the test passes and record the reasons for failure and abnormal information.
[0081] The test result data is uploaded to the server for subsequent analysis and processing. The server can store the test result data and provide query and export functions, facilitating users to view and analyze the test results at any time.
[0082] The test result analysis module generates a detailed test report based on the test result data. The report includes content such as the test pass rate, failure cause analysis, abnormal information, etc., helping users quickly locate problems and take corresponding repair measures.
[0083] According to the test results and feedback, optimize the test script module and test process to improve the accuracy and efficiency of the test.
[0084] With the update of software versions and the change of test requirements, the test script module library can be continuously updated and improved to ensure the continuous effectiveness and adaptability of the test system.
[0085] As a preferred embodiment of Embodiment 1, configuring the respective test parameters of each web page to be tested according to the preset parameter configuration and the respective test modules, and obtaining the respective test scripts of each web page to be tested, further includes:
[0086] Adding respective version identifiers to the respective test scripts according to a preset script library management module;
[0087] When calling the test script, verifying the compatibility of the respective version identifiers;
[0088] If there is an incompatibility in versions, generating a downgrade processing prompt for the respective test scripts.
[0089] In this preferred embodiment, the present application significantly improves the stability and reliability of automated testing by introducing a version identifier and a compatibility verification mechanism in the test script management process. Specifically, when the system generates a test script, it uses a preset script library management module to add a version identifier to each script, which enables different versions of scripts to be clearly distinguished and managed. When calling a test script, the system verifies the compatibility of the version identifier to ensure that different versions of scripts can work together. If an incompatibility in versions is found, the system generates a downgrade processing prompt to remind the user to make necessary adjustments or updates. Through this mechanism, the present application can not only effectively avoid test failures caused by script version conflicts, but also ensure the continuity and stability of the test process, thereby reducing test risks, improving test efficiency and accuracy, and providing a more reliable automated testing solution for software development and testing.
[0090] The present application realizes the high efficiency and flexibility of automated software testing by constructing a preset test system based on a modular script library and a graphical interface. First, by obtaining each web page to be tested and selecting the corresponding test module in the preset test system according to its characteristics, the pertinence and adaptability of the test are ensured. Since the test system is constructed based on a modular script library, users can flexibly configure test parameters for each web page to be tested and generate test scripts according to the preset parameter configuration, which not only improves the generation efficiency of test scripts, but also enhances the scalability and maintainability of the system. In addition, by running the test script through the unique ID of the web page element, the accuracy and reliability of the test are further improved. Finally, the system can quickly generate detailed test results to help testers quickly locate problems and optimize them. This modular and automated testing method significantly improves test efficiency and reduces test costs. The present application effectively solves the problem that the prior art cannot perform automated testing on different web pages efficiently and quickly.
[0091] Embodiment 2
[0092] Please refer to Figure 2, which is an automated software testing device provided by an embodiment of the present application.
[0093] In this embodiment, the automated software testing device includes an acquisition module 10, a selection module 20, a configuration module 30, and a testing module 40.
[0094] The automated software testing system of the present application can implement the testing of different web pages. Existing companies currently have multiple sets of web pages, but the testing processes between different web pages are generally the same. It is required that front-end engineers add unique ID attributes to each interactive element such as menus, buttons, input boxes, etc., and establish and maintain a document containing the IDs of all web page elements. This step is the basis of automated testing to ensure that the test script can accurately identify and operate these elements. For web pages with different testing processes, specialized customized testing modules are developed. These modules are written according to the requirements of specific web pages, but also rely on the unique IDs of elements for positioning and operation.
[0095] The automated software testing system of the present application is modular-based and includes a test script editor, a script library management module, a test execution module, and a result analysis module. These modules constitute a testing system.
[0096] Among them, the test script editor is used to write and edit test scripts. Users can create test scripts according to test requirements through a graphical interface or a code editor. The test script consists of multiple reusable script modules, and each module implements specific test functions, such as logging in, restoring factory settings, modifying wifi parameters, etc.
[0097] The script library management module is used to store and manage test script modules. This module provides functions for creating, editing, deleting, and querying script modules, facilitating users to select and combine script modules according to test requirements. At the same time, this module also supports version control of script modules to ensure the stability and consistency of test scripts.
[0098] The test execution module is responsible for parsing and executing test scripts. The test execution engine sequentially calls the modules in the script library according to the module order in the test script to achieve the automated execution of the test process. During the execution process, the test execution engine can also adjust the test process according to the test results, such as retrying according to error prompts or skipping specific test steps.
[0099] The test result analysis module is used to collect and analyze test results. This module can automatically capture log information, exception information, and test result data during the test process, and determine the test results according to preset judgment conditions. At the same time, this module can also generate a detailed test report, including information such as the test pass rate and failure cause analysis, to help users quickly locate problems and take corresponding repair measures.
[0100] The acquisition module 10 is used to acquire each web page to be tested.
[0101] The selection module 20 is used to select each test module in a preset test system according to the web pages to be tested; wherein, the preset test system is constructed according to preset modular script libraries and a graphical interface.
[0102] As a preferred embodiment of Embodiment 2, the preset test system is constructed according to preset modular script libraries and a graphical interface, specifically:
[0103] According to the test requirements, design and implement a series of reusable test script modules. These modules should cover common test functions such as login, factory reset, modifying WiFi parameters, etc.
[0104] Package the designed test script modules and store them in the script library management module. The script library management module provides functions for creating, editing, deleting, and querying script modules to ensure the effective management and quick retrieval of modules.
[0105] Design the graphical interface of the test script editor to make it intuitive and easy to use. The interface should include functional areas such as a module selection area, a script editing area, and a parameter configuration area.
[0106] Implement functions such as module selection, script editing, and parameter configuration in the graphical interface. The required test script modules can be conveniently selected through the graphical interface, and they can be edited and configured to meet different use case requirements.
[0107] Select the corresponding test script module according to the test requirements through the graphical interface.
[0108] The system automatically generates a test script according to the module selected by the user and the configured parameters. The test script consists of multiple reusable script modules arranged in the order specified by the user.
[0109] The configuration module 30 is used to configure each test parameter of each web page to be tested according to the preset parameter configuration and the test modules, and obtain each test script of each web page to be tested.
[0110] As a preferred embodiment of Embodiment 2, the step of configuring each test parameter of each web page to be tested according to the preset parameter configuration and the test modules, and obtaining each test script of each web page to be tested, specifically:
[0111] Select the corresponding test script module according to the test requirements through the graphical interface.
[0112] The system automatically generates test scripts based on the modules selected by the user and the configured parameters. The test scripts are composed of multiple reusable script modules, arranged in the order specified by the user, and the generated test scripts can also be selected for saving for subsequent use or modification.
[0113] In this preferred embodiment, the present application realizes an efficient and flexible test script generation process through the combination of a modular script library and a graphical interface, thereby significantly improving the efficiency and adaptability of automated testing. Specifically, the system uses a preset modular script library (login, factory reset, or modify wifi parameter module) to select appropriate test modules for different web pages. This modular design enables test scripts to be flexibly combined according to specific requirements, enhancing the scalability and reusability of the system. Further, through the graphical interface for parameter configuration (such as username, password, ID of page elements, etc.), users can generate test scripts without writing code, reducing the technical threshold of testing and improving the generation efficiency of test scripts. Finally, the system generates targeted test scripts based on the selected test modules and configured parameters, ensuring the accuracy and reliability of the testing. This design not only improves the testing efficiency but also enhances the flexibility and adaptability of testing, providing a more efficient and convenient solution for software testing.
[0114] The test module 40 is used to run the respective test scripts according to the unique IDs of the respective web page elements to be tested, and obtain the test results of the respective web pages.
[0115] As a preferred embodiment of the second embodiment, running the respective test scripts according to the unique IDs of the respective web page elements to be tested and obtaining the test results of the respective web pages specifically includes:
[0116] Running the respective test scripts according to the unique IDs of the respective web page elements to be tested;
[0117] Extracting the exception information and execution status data during the running of the respective test scripts according to a preset test log;
[0118] Obtaining the test results of the respective web pages according to the exception information, execution status data, and preset determination conditions.
[0119] In this preferred embodiment, the present application can efficiently and accurately obtain the test results of each web page by running test scripts using the unique IDs of web page elements and combining with a preset test log mechanism. Specifically, the system first runs the test scripts according to the unique IDs of web page elements to ensure that the test operations can accurately locate and operate each element on the web page, thus guaranteeing the accuracy and reliability of the tests. During the running of the test scripts, the system will, according to the preset test log mechanism, extract abnormal information and execution status data in real time, and these data provide key bases for the subsequent determination of test results. Finally, the system combines the extracted abnormal information, execution status data with the preset determination conditions to generate detailed test results. This mechanism can not only quickly discover problems occurring during the test process, but also intuitively reflect the smoothness of the test process through the execution status data, thereby providing comprehensive feedback to testers and helping them quickly locate and fix problems.
[0120] As a preferred embodiment of the second embodiment, after running the respective test scripts according to the unique IDs of the respective web page elements to be tested to obtain the test results of each web page, it further includes:
[0121] The test execution engine parses and executes the generated test scripts. According to the module sequence in the scripts, it sequentially calls the modules in the script library to realize the automated execution of the test process.
[0122] During the test execution process, the test result analysis module automatically captures the log information, abnormal information, and test result data during the test process.
[0123] According to the preset judgment conditions, the test results are judged. The system can automatically determine whether the test passes and record the reasons for failure and abnormal information.
[0124] The test result data is uploaded to the server for subsequent analysis and processing. The server can store the test result data and provide query and export functions, facilitating users to view and analyze the test results at any time.
[0125] The test result analysis module generates a detailed test report based on the test result data. The report includes contents such as the test pass rate, failure reason analysis, abnormal information, etc., helping users quickly locate problems and take corresponding repair measures.
[0126] According to the test results and feedback, the test script module and the test process are optimized to improve the accuracy and efficiency of the test.
[0127] With the update of the software version and the change of test requirements, the test script module library can be continuously updated and improved to ensure the continuous effectiveness and adaptability of the test system.
[0128] As a preferred embodiment of the second embodiment, configuring the test parameters of each web page to be tested according to the preset parameter configuration and each test module, and obtaining the test scripts of each web page to be tested, further includes:
[0129] Adding version identifiers to each of the test scripts according to a preset script library management module;
[0130] When calling the test script, verifying the compatibility of each version identifier;
[0131] If there is an incompatibility in versions, generating a downgrade processing prompt for each of the test scripts.
[0132] In this preferred embodiment, the present application significantly improves the stability and reliability of automated testing by introducing a version identifier and a compatibility verification mechanism in the test script management process. Specifically, when the system generates test scripts, it uses a preset script library management module to add version identifiers to each script, which enables different versions of scripts to be clearly distinguished and managed. When calling a test script, the system verifies the compatibility of the version identifiers to ensure that different versions of scripts can work together. If an incompatibility in versions is found, the system generates a downgrade processing prompt to remind the user to make necessary adjustments or updates. Through this mechanism, the present application can not only effectively avoid test failures caused by script version conflicts, but also ensure the continuity and stability of the test process, thereby reducing test risks, improving test efficiency and accuracy, and providing a more reliable automated testing solution for software development and testing.
[0133] The present application realizes the high efficiency and flexibility of automated software testing by constructing a preset test system based on a modular script library and a graphical interface. First, by obtaining each web page to be tested and selecting corresponding test modules in the preset test system according to its characteristics, the pertinence and adaptability of the test are ensured. Since the test system is constructed based on a modular script library, users can flexibly configure test parameters for each web page to be tested and generate test scripts according to the preset parameter configuration, which not only improves the generation efficiency of test scripts, but also enhances the scalability and maintainability of the system. In addition, by running the test script through the unique ID of the web page element, the accuracy and reliability of the test are further improved. Finally, the system can quickly generate detailed test results to help testers quickly locate problems and optimize them. This modular and automated testing method significantly improves test efficiency and reduces test costs. The present application effectively solves the problem that the prior art cannot perform automated testing on different web pages efficiently and quickly.
[0134] Embodiment Three:
[0135] An embodiment of the present application provides a computer-readable storage medium, which includes a stored computer program. When the computer program runs, it controls the device where the computer-readable storage medium is located to execute the described automated software testing method.
[0136] Among them, for the described automated software testing method, if it is implemented in the form of a software functional unit and used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above embodiment methods of the present invention, it can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium, etc.
[0137] Embodiment 4
[0138] The present application provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements any one of the automated software testing methods described in Embodiment 1.
[0139] For the above specific embodiments, the purpose, technical solutions, and beneficial effects of the present invention are further described in detail. It should be understood that the above are only specific embodiments of the present invention and are not used to limit the protection scope of the present invention. It is particularly pointed out that for those skilled in the art, any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. An automated software testing method, characterized in that: include: Get each web page to be tested; According to the web pages to be tested, each test module is selected in a preset test system; wherein the preset test system is constructed according to preset modular script libraries and graphical interfaces; According to the preset parameter configuration and the test modules, the test parameters of the web pages to be tested are configured to obtain the test scripts of the web pages to be tested; According to the unique ID of each web page element to be tested, each test script is run to obtain the test result of each web page.
2. The automated software testing method according to claim 1, characterized in that: According to the unique ID of each web page element to be tested, each test script is run to obtain the test result of each web page, specifically: Running each test script according to the unique ID of each web page element to be tested; According to the preset test log, extract the abnormal information and execution status data during the running of each test script; The test results of each web page are obtained according to the abnormal information, the execution status data and the preset judgment conditions.
3. The automated software testing method according to claim 2, characterized in that: After obtaining the test results of each web page according to the abnormal information, the execution status data and the preset judgment conditions, the method further includes: Generate a test report for each web page according to the test results of each web page; The test report of each web page includes the test pass rate, failure reason analysis and abnormal information.
4. The automated software testing method according to claim 1, characterized in that: The method further comprises configuring each test parameter of each web page to be tested according to the preset parameter configuration and each test module to obtain each test script of each web page to be tested. According to the preset script library management module, adding each version identifier to each of the test scripts; When calling the test script, verifying the compatibility of each version identifier; If there is any version incompatibility, a downgrade processing prompt is generated for each test script.
5. The automated software testing method according to claim 1, characterized in that: The method of configuring each test parameter of each web page to be tested according to the preset parameter configuration and each test module to obtain each test script of each web page to be tested is as follows: According to each modular script library of the preset test system, each test module of each web page to be tested is selected; wherein each modular script library includes logging in, restoring factory settings or modifying wifi parameters; According to the test modules and the graphical interface, parameters are configured for each web page to be tested to obtain test parameters for each web page to be tested; According to each test script module and each parameter, each test script of each web page to be tested is obtained.
6. An automated software testing device, characterized in that: include: Get modules, select modules, configure modules and test modules; The acquisition module is used to obtain each web page to be tested; The selection module is used to select various test modules in a preset test system according to the various web pages to be tested; wherein the preset test system is constructed according to various preset modular script libraries and graphical interfaces; The configuration module is used to configure each test parameter of each web page to be tested according to the preset parameter configuration and each test module, and obtain each test script of each web page to be tested; The test module is used to run each test script according to the unique ID of each web page element to be tested, and obtain the test result of each web page.
7. The automated software testing device according to claim 6, characterized in that: The test module is used to run each test script according to the unique ID of each web page element to be tested, and obtain the test results of each web page, specifically: The testing module runs each test script according to the unique ID of each web page element to be tested; According to the preset test log, extract the abnormal information and execution status data during the running of each test script; The test results of each web page are obtained according to the abnormal information, the execution status data and the preset judgment conditions.
8. The automated software testing device according to claim 6, characterized in that: The method of configuring each test parameter of each web page to be tested according to the preset parameter configuration and each test module to obtain each test script of each web page to be tested is as follows: According to each modular script library of the preset test system, each test module of each web page to be tested is selected; wherein each modular script library includes logging in, restoring factory settings or modifying wifi parameters; According to the test modules and the graphical interface, parameters are configured for each web page to be tested to obtain test parameters for each web page to be tested; According to each test script module and each parameter, each test script of each web page to be tested is obtained.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the automated software testing method according to any one of claims 1 to 5.
10. A terminal device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the automated software testing method according to any one of claims 1 to 5 when executing the computer program.