A testing method based on Web page visual drag and drop to generate simulated test scenarios
The method addresses high costs and complexity in cloud server testing by using visual Web page dragging to create and manage simulation scenarios, automating script generation and simplifying maintenance, enhancing test efficiency and quality.
Patent Information
- Application Number
- CN202011415139.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-07
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2040-12-07
AI Technical Summary
Existing methods for testing cloud server analysis and statistical data are costly, complex to simulate, and difficult to maintain, requiring high hardware costs, manual scripting, and specialized programming skills.
A testing method and device that uses visual dragging of Web pages to create and manage simulation test scenarios, automatically converting them into program scripts, reducing manual effort and simplifying scenario design and maintenance.
Saves time and costs, improves test quality by visually designing and managing scenarios, eliminating manual coding, and reducing errors, making it easier to promote and learn.
Smart Images

Figure CN112445711B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer software testing, and in particular to a testing method and device for generating simulated testing scenarios based on visual dragging of Web pages. Background Art
[0002] Currently, TV software sends data to the cloud server through a program interface. The cloud server collects, saves, analyzes, counts and displays the data. In order to test the correctness of the cloud server's analysis and statistical data, it is necessary to simulate various scenarios in real life to send a large amount of data to the cloud server. There are three existing methods: Method 1: Use a real TV for testing; Method 2: Use Postman software to send network requests for testing; Method 3: Write a program script, such as a Python script for testing. All three methods finally verify the correctness by comparing whether the statistical data in the cloud server is the same as the known results.
[0003] The first test method is to use a large number of televisions of different brands, and send different data to the server through real operations such as turning on and off the TV and opening different TV applications. This test method requires the use of real TVs, so the hardware cost is high, and the test requires operating the TV to turn it on and off, which will take a lot of time.
[0004] The second test method is to use the Postman software to set network requests with different parameters to simulate different real-life scenarios, and send a large amount of data to the server by running network requests. When this test method simulates complex situations where multiple scenarios intersect, the parameters between network requests are dependent on each other, making it difficult to set parameters and simulate difficult scenarios.
[0005] The third test method is to write different program scripts to simulate real-life scenarios. For each real-life scenario, write a simulation test scenario script, and then run the script to send a large amount of data to the cloud server to achieve the following process: Figure 1 As shown. This testing method requires manual setting of customer information, project information, and the association information between the TV mac and the project saved in the cloud server when writing the script, which makes development complicated. Multiple scenarios will be designed during testing, and using multiple scripts to manage multiple scenarios can easily cause confusion. In addition, it is very unintuitive when maintaining and using the script, and the simulated real-life scenario cannot be intuitively seen. This method requires software testers to have certain programming skills, whether writing scripts or modifying and maintaining scripts later. It has high requirements for testers and is not conducive to large-scale promotion and learning. Summary of the invention
[0006] In view of the above-mentioned defects in the prior art, the technical problem to be solved by the present invention is that the existing methods for testing the correctness of cloud server analysis and statistical data have high hardware costs, difficulties in simulating scenarios, or complex development and maintenance of test programs, and the like. A testing method and device based on visual dragging of Web pages to generate simulation test scenarios are provided, which can uniformly manage and intuitively display simulation test scenarios in Web pages, design simulation test scenarios by visually dragging web page graphic components, and automatically convert visual simulation test scenarios into program scripts to run and run the results in the web pages, thereby saving time and cost and improving test quality.
[0007] To achieve the above object, the present invention provides a test method for generating a simulated test scenario based on visual dragging of a Web page, comprising the following steps:
[0008] Create and save groups of simulation test scenarios on the web page;
[0009] According to the saved simulation test scenario, connect to the cloud server, automatically obtain the data of the cloud server, and design the scenario according to the cloud service data;
[0010] Select a scenario on the web page to run and get the test results.
[0011] Furthermore, create and save a simulation test scenario, including:
[0012] Create groups of functional modules based on test requirements;
[0013] Under the group of the created functional modules, create and save a simulation scenario and set the basic information of the scenario.
[0014] Furthermore, according to the saved simulation test scenario, the cloud server data is automatically obtained, and the scenario design is performed according to the cloud service data, including:
[0015] Connecting to the cloud server;
[0016] Automatically obtain data from the cloud server and display it on the web page in the form of cards for selection;
[0017] According to the data obtained from the cloud server, the specific items and quantities corresponding to the real TV sets are selected to automatically create the simulation machine graphics;
[0018] Add date tracks based on test requirements;
[0019] Drag the simulator graphic to the date track, set the data to be simulated and sent, complete the scene design and save the scene.
[0020] Furthermore, a scenario is selected on the web page to run and obtain test results, including:
[0021] Automatically generate an executable script based on the simulator graphics in the saved scene;
[0022] Click Run Script to compare the statistical data in the cloud server with the expected results to obtain the final test results.
[0023] In a preferred embodiment of the present invention, a test device for generating a simulated test scenario based on visual dragging of a Web page is provided, comprising:
[0024] A new module is used to create and save simulation test scenarios in web pages;
[0025] The design module is used to automatically obtain the data of the cloud server according to the saved simulation test scenarios and to design scenarios based on the cloud service data;
[0026] The running module is used to select a scenario in a web page to run and obtain test results.
[0027] Furthermore, the new modules include:
[0028] The grouping unit is used to create groups of functional modules according to test requirements;
[0029] The storage unit is used to create and save simulation scenarios under the grouping of the created functional modules and set the basic information of the scenarios.
[0030] Furthermore, the design module includes:
[0031] A connection unit, used for connecting to the cloud server;
[0032] The acquisition unit is used to automatically acquire data from the cloud server and display it on the web page in the form of cards for selection;
[0033] A simulator graphics unit is created, which is used to select specific items and quantities corresponding to real TV sets according to data obtained from the cloud server, and automatically create simulator graphics;
[0034] Added unit for adding date tracks based on test requirements;
[0035] The setting unit is used to drag the simulator graphics to the date track, set the data to be sent by the simulation, complete the scene design and save the scene.
[0036] Furthermore, the operation module includes:
[0037] The script unit is used to automatically generate an executable script based on the simulator graphics in the saved scene;
[0038] The test unit is used to click and run the script, compare the statistical data in the cloud server with the expected results, and obtain the final test results.
[0039] In another preferred embodiment of the present invention, a computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements any of the above methods.
[0040] In another preferred embodiment of the present invention, a computer-readable storage medium storing a computer program is characterized in that the computer program enables a computer to implement a test method for generating a simulated test scenario based on visual dragging of a Web page as described above when executed.
[0041] Technical Effects
[0042] 1) By managing simulation test scenarios in groups on the Web page, you can clearly see the current simulation scenarios. When maintaining and using the scenarios, you can also easily click to select the scenarios that need to be maintained and used.
[0043] 2) By automatically acquiring cloud server data, the manual setting of project information and some simulation data can be eliminated, which brings convenience to testing work and saves time costs.
[0044] 3) By designing the simulation test scenario in the form of visual drag and drop, you can have a very intuitive grasp of the entire scenario during design, reducing the risk of errors and improving the quality of the test.
[0045] 4) Automatically generate executable scripts based on graphic scenarios, so that testers no longer need to manually write script codes, which reduces the coding requirements for testers and allows testers to focus on how to design more complete test cases. This greatly helps the promotion, learning and application of simulated test scenarios in the test team.
[0046] 5) Most of the entire process is based on visual operations on Web pages, which reduces the difficulty of use and saves labor costs while ensuring the test function.
[0047] The concept, specific structure and technical effects of the present invention will be further described below in conjunction with the accompanying drawings to fully understand the purpose, characteristics and effects of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 It is a schematic diagram of a test method for writing program scripts in the prior art;
[0049] Figure 2It is a schematic diagram of a testing method for generating a simulation test scenario based on visual dragging of a Web page according to a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0050] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0051] In the following description, specific details such as specific internal procedures and techniques are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.
[0052] Embodiment 1
[0053] like Figure 1 As shown, this embodiment provides a test method for generating a simulated test scenario based on visual dragging of a Web page, comprising the following steps:
[0054] Step 100, creating and saving a group of simulation test scenarios in a web page; specifically includes:
[0055] Step 101, create groups of functional modules according to test requirements; for example, if there are activation ranking, activation map, and activation rhythm functional modules, three groups can be created in sequence, and then scenarios can be added to each group for design;
[0056] Step 102, under the group of the created functional modules, create and save a simulation scene, and set basic information of the scene, such as the scene name, scene description, and the simulated real scene.
[0057] Step 200, automatically obtaining data from the cloud server according to the saved simulation test scenario, and performing scenario design according to the cloud service data; specifically includes:
[0058] Step 201 is used to connect to the cloud server; automatically obtain the data of the cloud server, and display it in the form of cards on the web page for selection; when designing a scene, the cloud server database will be connected to obtain customer and project information and intuitively display it on the web page for selection;
[0059] Step 202, according to the data obtained from the cloud server, select the specific project and quantity corresponding to the actual TV set, and automatically create a simulation machine graphic; by clicking the customer and project information obtained from the cloud server database, select the project to set the TV brand to be simulated, and enter the quantity to simulate the number of TV sets, for example, you can select the CVTE_1 project of the CVTE customer to simulate 500 TV sets, so that a corresponding draggable rectangular graphic will be generated at the top of the page, which is called the simulation machine graphic;
[0060] Step 203, adding a date track according to the test requirements; adding a date track at the bottom of the page, each date track occupies a row of space at the bottom of the page;
[0061] Step 204, drag the simulator graphic to the date track, set the data to be simulated, complete the scene design and save the scene. Drag the simulator graphic to a date track, such as the track of August 8, and a new graphic identical to the dragged simulator graphic will be added to the track, which means that the simulator will simulate sending data to the cloud server on August 8, then click the simulator graphic in the track to set the simulated data.
[0062] By setting different simulator graphics, adding different date tracks, and setting different simulation data, multiple different simulation test scenarios can be designed and saved.
[0063] Step 300, selecting a scenario in a web page to run and obtain test results, specifically includes:
[0064] Step 301, automatically generating an executable script according to the simulator graphics in the saved scene;
[0065] Step 302, click to run the script, compare the statistical data in the cloud server with the expected results, and obtain the final test results.
[0066] The embodiments of the present invention involve three types of data:
[0067] 1. Project information data in the cloud server, which needs to be preset in advance;
[0068] 2. Statistical data in the cloud server. The statistical data is automatically collected by the cloud server after running the simulation scenario, so there is no need to preset it in advance;
[0069] 3. Expected data is known when the test case is designed. For example, when testing the calculator function, a test case is designed as: 50+50, which is expected to be equal to 100. The expected data is known.
[0070] In addition, by repeating steps 201 to 204, the design of multiple simulation test scenarios can be completed, and by repeating steps 102 to 204, the design of all scenarios under the group can be completed.
[0071] Here we will use a simulated scenario test to activate the ranking function to illustrate the process of this method:
[0072] 1) Create a group called "Activation Ranking";
[0073] 2) Click to activate the ranking group, click to create a simulation test scenario named "Smoke Test", and then click the smoke test scenario to start designing;
[0074] 3) From the Customer and Project Information tab obtained from the cloud server, select the Hisense_1 project of the Hisense customer, set the simulation to 1,000 TVs, and generate the Hisense_1 simulator graphics. Similarly, generate the Hisense_2 simulator graphics for 800 TVs and the Hisense_3 simulator graphics for 500 TVs.
[0075] 4) Add the date track of August 8, 2020;
[0076] 5) Drag the Hisense_1 simulator graphic, Hisense_2 simulator graphic, and Hisense_3 simulator graphic to the August 8 date track;
[0077] 6) Click on the Hisense_1 simulator graphic in the date track and set the simulation data: select the cloud server interface address as the website address for the TV activation function and the simulation address as Shanghai; similarly set the simulation data for the Hisense_2 simulator graphic and the Hisense_3 simulator graphic in the track;
[0078] 7) Click Save Smoke Test Scenario, and the saved smoke test scenario will automatically generate an executable script;
[0079] 8) Click the script to run the smoke test scenario;
[0080] 9) Check the progress and results of the scenario. After the scenario runs successfully, compare the activation ranking data in the cloud server with the expected data to see if they are consistent, and finally get the test results.
[0081] By grouping and managing simulation test scenarios on the Web page, you can clearly see the current simulation scenarios. When maintaining and using the scenarios, you can also easily select the scenarios that need to be maintained and used, and automatically generate executable scripts based on the graphic scenarios, so that testers no longer need to manually write script codes, which improves efficiency while reducing code writing errors and lowers programming requirements for testers, making this method conducive to promotion and application.
[0082] Embodiment 2
[0083] In a preferred embodiment of the present invention, a test device for generating a simulated test scenario based on visual dragging of a Web page is provided, comprising:
[0084] A new module is used to create and save simulation test scenarios in web pages;
[0085] The design module is used to automatically obtain the data of the cloud server according to the saved simulation test scenarios and to design scenarios based on the cloud service data;
[0086] The running module is used to select a scenario in a web page to run and obtain test results.
[0087] Furthermore, the new modules include:
[0088] The grouping unit is used to create groups of functional modules according to test requirements;
[0089] The storage unit is used to create and save simulation scenarios under the grouping of the created functional modules and set the basic information of the scenarios.
[0090] Design modules include:
[0091] An establishing unit, used for connecting to the cloud server;
[0092] The acquisition unit is used to automatically acquire data from the cloud server and display it on the web page in the form of cards for selection;
[0093] A simulator graphics unit is created, which is used to select specific items and quantities corresponding to real TV sets according to data obtained from the cloud server, and automatically create simulator graphics;
[0094] Added unit for adding date tracks based on test requirements;
[0095] The setting unit is used to drag the simulator graphics to the date track, set the data to be sent by the simulation, complete the scene design and save the scene.
[0096] The running modules include:
[0097] The script unit is used to automatically generate an executable script based on the simulator graphics in the saved scene;
[0098] The test unit is used to click and run the script, compare the statistical data in the cloud server with the expected results, and obtain the final test results.
[0099] The device of this embodiment is used to implement the method of embodiment 1, and its implementation process is the same as that of embodiment 1, which will not be repeated here.
[0100] Embodiment 3
[0101] Embodiment 3 of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, any one of the above methods is implemented.
[0102] The computer device of this embodiment includes: a processor, a memory, and a computer program stored in the memory and executable on the processor, such as a test program. When the processor executes the computer program, the steps in the above-mentioned data synchronization method embodiments are implemented. Alternatively, when the processor executes the computer program, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0103] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program in the computer device.
[0104] The computer device may be a desktop computer, a notebook computer, a palm computer, a cloud server, etc. The computer device may include, but is not limited to, a processor and a memory.
[0105] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0106] The memory may be an internal storage unit of the computer device, such as a hard disk or memory of the computer device. The memory may also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device. Furthermore, the memory may include both an internal storage unit and an external storage device of the computer device. The memory is used to store the computer program and other programs and data required by the computer device. The memory may also be used to temporarily store data that has been output or is to be output.
[0107] In another preferred embodiment of the present invention, a computer-readable storage medium storing a computer program is provided, wherein the computer program enables a computer to implement, when executed, a test method for generating a simulated test scenario based on visual dragging of a Web page as described in any one of the above.
[0108] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.
Claims
1. A test method for generating simulated test scenarios based on visual dragging of Web pages, characterized in that: The following steps are involved: Step 100, creating and saving a group of simulation test scenarios in a web page; specifically includes: Step 101, creating a group of functional modules according to test requirements; Step 102: Create and save a simulation scenario under the group of the created functional modules, and set the basic information of the scenario. Step 200, according to the saved simulation test scenario, connect to the cloud server, automatically obtain the data of the cloud server, and design the scenario according to the data of the cloud server; specifically, Step 201, establishing a connection with the cloud server; automatically obtaining data from the cloud server and displaying it in the form of cards on the web page for selection; Step 202, according to the data obtained from the cloud server, select the specific project and quantity corresponding to the actual TV set, and automatically create the simulation machine graphics; by clicking the customer and project information obtained from the cloud server database, select the project to set the TV brand to be simulated, and enter the quantity to simulate the number of TV sets; Step 203, adding a date track according to test requirements; Step 204, drag the simulator graphics to the date track, set the data to be simulated and sent, complete the scene design and save the scene; by setting different simulator graphics, adding different date tracks, and setting different simulation data, design multiple different simulation test scenes and save them; Step 300, select a scenario in the web page to run and obtain test results; Repeat steps 201 to 204 to complete the design of multiple simulation test scenarios, and repeat steps 102 to 204 to complete the design of all scenarios under the group; Includes three types of data: (1) Project information data in the cloud server, which needs to be preset in advance; (2) Statistical data in the cloud server. The statistical data is automatically collected by the cloud server after running the simulation scenario and does not need to be preset in advance. (3) Expected data is known when the test case is designed.
2. A test method for generating a simulated test scenario based on visual dragging of a Web page as claimed in claim 1, characterized in that: Select a scenario on the web page to run and get the test results, including: Automatically generate an executable script based on the simulator graphics in the saved scene; Click Run Script to compare the statistical data in the cloud server with the expected results to obtain the final test results.
3. A test device for generating simulated test scenarios based on visual dragging of Web pages, characterized in that: include: A new module is used to create and save simulation test scenarios in web pages; The newly created module includes: The grouping unit is used to create groups of functional modules according to test requirements; The storage unit is used to create and save simulation scenarios under the grouping of the created functional modules and set the basic information of the scenarios; The design module is used to connect to the cloud server according to the saved simulation test scenario, automatically obtain the data of the cloud server, and perform scenario design according to the data of the cloud service; the design module includes: A connection unit, used for connecting to the cloud server; An acquisition unit, used to automatically acquire the data of the cloud server and display it in the form of cards on a web page for selection; A simulator graphics creation unit is used to select specific items and quantities corresponding to actual TV sets according to the data obtained from the cloud server, and automatically create simulator graphics; by clicking on the customer and item information obtained from the cloud server database, selecting an item to set the TV brand to be simulated, and entering the quantity to simulate the number of TV sets; Added unit for adding date tracks based on test requirements; The setting unit is used to drag the simulator graphics to the date track, set the data to be simulated and sent, complete the scene design and save the scene; by setting different simulator graphics, adding different date tracks, and setting different simulation data, multiple different simulation test scenes can be designed and saved; The running module is used to select a scenario in a web page to run and obtain test results.
4. A test device for generating simulated test scenarios based on visual dragging of Web pages as claimed in claim 3, characterized in that: The operation module includes: The script unit is used to automatically generate an executable script based on the simulator graphics in the saved scene; The test unit is used to click and run the script, compare the statistical data in the cloud server with the expected results, and obtain the final test results.
5. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 2 is implemented.
6. A computer-readable storage medium storing a computer program, characterized in that: The computer program enables a computer to implement a test method for generating a simulated test scenario based on visual dragging of a Web page as described in any one of claims 1-2 when executed.
