A B / S architecture product automated testing method and system
By combining factor tools, SmartWeb tools and data preparation tools, automated execution scripts are generated and data preparation is solved, and the test execution time is significantly shortened.
Patent Information
- Application Number
- CN202011403170.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-04
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2040-12-04
AI Technical Summary
The prior art cannot combine case and automated data preparation technology with automated scripts during software automation testing, resulting in a long data preparation and execution time required during the testing process, affecting the testing efficiency.
By combining factor tools, SmartWeb tools and data preparation tools, an automated execution script is generated, and the data preparation tool is called according to the conditional combination relationship in the scenario case for data preparation, and assigned values to script parameters to achieve automated testing.
It greatly saves testers' execution case time and improves test execution efficiency.
Smart Images

Figure CN112380135B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer testing technology, and in particular to an automatic testing method and system for B / S architecture products. Background Art
[0002] Software development is a huge system engineering. Since it involves many different system functions, it is difficult to ensure 100% stable operation during the development process. This is a problem that must be solved for industries that strictly require software operation stability, such as banks. Therefore, pre-prepared test cases are usually used to test various functional modules and various usage environments of the software to find any possible stability problems in the software or any other problems that may affect the normal operation of the software after it is launched. Obviously, whether the test case library, automation scripts and data preparation can work together in a coordinated manner is an important factor affecting whether the test can be executed efficiently.
[0003] In the process of software automation testing, the existing technology is unable to combine cases, automated data preparation technology and automated scripts, resulting in a long data preparation and data execution time during the testing process, affecting the test execution efficiency. Summary of the invention
[0004] In order to address the deficiencies in the prior art, the present invention proposes an automated testing method and system for B / S architecture products. By combining factor tools, SmartWeb tools and data preparation tools, when executing scenario cases, existing scenario cases are selected to generate automated execution scripts. When executing the automated scripts, the data preparation tool is called to prepare data for the corresponding conditions according to the conditional combination relationship in the case, and the data is assigned to the script parameters, which greatly saves the time of testers in executing cases.
[0005] To achieve the above objectives, the technical solutions adopted by the present invention include:
[0006] A B / S architecture product automated testing method, characterized by comprising:
[0007] Enter the factors into the factor tool to generate scenario cases;
[0008] The factors are synchronized to the data preparation tool and matched with the data to generate test data;
[0009] Use SmartWeb tool to input SmartWeb script to generate script cases for corresponding scenario cases;
[0010] Select a scenario case, call the corresponding script case and matching test data to perform the test.
[0011] Furthermore, the factors include event factors, condition factors, product factors, channel factors, result factors, time factors and user factors.
[0012] Furthermore, the step of inputting factors into the factor tool to generate scenario cases includes:
[0013] A rule engine is obtained according to the relationship between the test requirement configuration factors, wherein the rule engine includes product channels, user channels, product events, event time, user events, and event conditions;
[0014] According to the selected factors, the rule engine is used to encapsulate the scenarios;
[0015] Generate test cases based on scenarios.
[0016] Furthermore, the script case of inputting the SmartWeb script to generate the corresponding scenario case includes:
[0017] Use SmartWeb tool to enter the xpath path of page elements.
[0018] Furthermore, the method further comprises:
[0019] When you modify factors that have been entered into the Factor Tool, the changes are synchronized to the Data Preparation Tool and SmartWeb Tool.
[0020] Furthermore, the method further comprises:
[0021] When a scenario case changes, the changed scenario case is synchronized to the data preparation tool and SmartWeb tool.
[0022] The present invention also relates to a B / S architecture product automatic testing system, which is characterized by comprising:
[0023] Factor tool, used to generate scenario cases based on entered factors;
[0024] Data preparation tools to generate test data;
[0025] SmartWeb tool, used to generate script examples.
[0026] Furthermore, the factor tool includes:
[0027] A rule engine module, used to obtain a rule engine according to the relationship between the configuration factors of the test requirements;
[0028] A scenario encapsulation module is used to encapsulate the selected factors into scenarios according to the rule engine;
[0029] The test case generation module is used to generate scenario cases based on scenarios.
[0030] The present invention also relates to a computer-readable storage medium, characterized in that a computer program is stored on the storage medium, and when the computer program is executed by a processor, the above-mentioned B / S architecture product automatic testing method is implemented.
[0031] The present invention also relates to an electronic device, characterized in that it comprises a processor and a memory;
[0032] The memory is used to store scenario cases, test data and script cases;
[0033] The processor is used to execute the above-mentioned B / S architecture product automation testing method by calling the scenario cases, test data and script cases.
[0034] The beneficial effects of the present invention are:
[0035] By adopting the B / S architecture product automated testing method and system described in the present invention, by combining factor tools, SmartWeb tools and data preparation tools, when executing scenario cases, existing scenario cases are selected to generate automated execution scripts. When executing the automated scripts, the data preparation tool is called to prepare data for the corresponding conditions according to the condition combination relationship in the case, and the data is assigned to the script parameters, which greatly saves the time of testers in executing cases and improves the test execution efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 The figure is a flow chart of the automated testing method for B / S architecture products of the present invention.
[0037] Figure 2 It is a schematic diagram of the structure of the B / S architecture product automation test system of the present invention. DETAILED DESCRIPTION
[0038] In order to more clearly understand the content of the present invention, it will be described in detail with reference to the drawings and embodiments.
[0039] The first part of the present invention provides a Figure 1 The B / S architecture product automated testing method shown includes the following steps:
[0040] Entering factors into a factor tool to generate scenario cases, wherein the factors include event factors, condition factors, product factors, channel factors, result factors, time factors, and user factors. Specifically, generating scenario cases preferably includes configuring the relationship between factors according to the test requirements to obtain a rule engine, encapsulating the selected factors into scenarios according to the rule engine, and generating test cases according to the scenarios, and satisfying business requirements by applying the relationship between factors configured by the rule engine including product channels, user channels, product events, event time, user events, and event conditions;
[0041] The factors are synchronized to the data preparation tool and matched with the data to generate test data, converting the descriptive language of the atomic classes in the scenario cases into data elements that can be used by the SmartWeb tool;
[0042] Use SmartWeb tool to input SmartWeb script to generate script case corresponding to scenario case, especially use SmartWeb tool to input xpath path of page element, which is used to uniquely identify the position of a certain input element in the page in the scenario, simulate manual operation steps, and realize automatic execution. Preferably, auxiliary identification tool can be used in combination to identify xpath path of atomic input element in the page of the tested system, that is, xpath path is used to uniquely locate the position of each input box to simulate manual operation steps, and each input box and data required to be input in the test page are input into smartweb tool, and after input is completed, a case is formed and can be directly run automatically;
[0043] When modifying factors that have been entered into the Factor Tool, the modification will be synchronized to the Data Preparation Tool and SmartWeb Tool;
[0044] When a scenario case is changed, synchronize the changed scenario case to the data preparation tool and SmartWeb tool;
[0045] Select a scenario case, call the corresponding script case and matching test data to perform the test.
[0046] When implementing the above method, the principle of loose coupling is followed. The factor tool is the center, and only the system factors and generated scenario cases are stored. The data preparation tool provides related functions around the mapping relationship stored in the factors. The SmartWeb tool stores scripts and manages operations around factors and scenario cases. The factor tool only needs to synchronize and jump. When the factors in the factor tool are modified, the relevant contents in the data preparation tool and SmartWeb tool are modified synchronously.
[0047] The second part of the present invention relates to a method as Figure 2 The B / S architecture product automated testing system shown includes:
[0048] A factor tool, used to generate scenario cases according to the input factors, further comprising a rule engine module, used to obtain a rule engine according to the relationship between the factors configured according to the test requirements, a scenario encapsulation module, used to encapsulate the selected factors into scenarios according to the rule engine, and a test case generation module, used to generate scenario cases according to the scenarios;
[0049] Data preparation tools to generate test data;
[0050] SmartWeb tool, used to generate script examples.
[0051] Furthermore, the present invention also relates to a readable storage medium storing a program for executing the above-mentioned B / S architecture product automated testing method. By using the readable storage medium, the program can be executed to implement the above-mentioned B / S architecture product automated testing method.
[0052] Furthermore, the present invention also relates to an electronic device comprising a memory and a processor, wherein the memory is used to store data necessary for executing the above-mentioned B / S architecture product automated testing method, and the processor is used to execute the B / S architecture product automated testing method.
[0053] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A B / S architecture product automated testing method, characterized in that: include: Enter the factors into the factor tool to generate scenario cases; The factors include event factors, condition factors, product factors, channel factors, result factors, time factors and user factors; The step of inputting factors into a factor tool to generate scenario cases includes: configuring the relationship between factors according to test requirements to obtain a rule engine, wherein the rule engine includes product channels, user channels, product events, event time, user events, and event conditions; encapsulating the selected factors into scenarios according to the rule engine; and generating test cases according to the scenarios; wherein the rule engine is a configuration mechanism for configuring the relationship between the factors to meet business requirements; The factors are synchronized to the data preparation tool and matched with the data to generate test data; Use SmartWeb tool to input SmartWeb script to generate script cases for corresponding scenario cases; Select a scenario case, call the corresponding script case and matching test data to perform the test.
2. The method according to claim 1, characterized in that The script cases for entering SmartWeb scripts to generate corresponding scenario cases include: Use SmartWeb tool to enter the xpath path of page elements.
3. The method according to claim 1, characterized in that The method further comprises: When you modify factors that have been entered into the Factor Tool, the changes are synchronized to the Data Preparation Tool and SmartWeb Tool.
4. The method according to claim 1, characterized in that The method further comprises: When a scenario case changes, the changed scenario case is synchronized to the data preparation tool and SmartWeb tool.
5. A B / S architecture product automated testing system, characterized in that: include: Factor tool, used to generate scenario cases based on entered factors; The factors include event factors, condition factors, product factors, channel factors, result factors, time factors and user factors; The factor tool includes: a rule engine module, which is used to configure the relationship between factors according to the test requirements to obtain a rule engine; a scenario encapsulation module, which is used to encapsulate the selected factors into scenarios according to the rule engine; and a test case generation module, which is used to generate test cases according to the scenarios; wherein the rule engine is a configuration mechanism for configuring the relationship between the factors to meet business requirements; A data preparation tool is used to generate test data, wherein the factors are synchronized to the data preparation tool and matched with the data to generate the test data; SmartWeb tool is used to generate script cases, where SmartWeb tool is used to input SmartWeb scripts to generate script cases for corresponding scenario cases; Among them, select the scenario case, call the corresponding script case and matching test data to perform the test.
6. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, which, when executed by a processor, implements the B / S architecture product automated testing method according to any one of claims 1 to 4.
7. An electronic device, characterized in that: including a processor and a memory; The memory is used to store scenario cases, test data and script cases; The processor is used to execute the B / S architecture product automation testing method described in any one of claims 1 to 4 by calling the scenario cases, test data and script cases.
Citation Information
Patent Citations
Testing method and device and computer readable storage medium
CN110162468A