CN113836042A - Web automated testing framework system - Google Patents
Web automated testing framework system Download PDFInfo
- Publication number
- CN113836042A CN113836042A CN202111369754.0A CN202111369754A CN113836042A CN 113836042 A CN113836042 A CN 113836042A CN 202111369754 A CN202111369754 A CN 202111369754A CN 113836042 A CN113836042 A CN 113836042A
- Authority
- CN
- China
- Prior art keywords
- module
- test
- test case
- case script
- script
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 152
- 238000013515 script Methods 0.000 claims abstract description 92
- 238000000034 method Methods 0.000 claims abstract description 81
- 230000010354 integration Effects 0.000 claims abstract description 5
- 230000006870 function Effects 0.000 description 7
- 238000010998 test method Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 238000004140 cleaning Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000013522 software testing Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/31—Programming languages or programming paradigms
- G06F8/315—Object-oriented languages
Abstract
The invention discloses a web automatic testing framework system, which comprises: the basic module is integrated and packaged with various page operation methods and is used for being inherited by other modules and calling the page operation methods in the module; the page object class module integrates all page object elements of a project, and has an operation method of the basic class module by inheriting the basic class module; the common auxiliary method module is used for providing a test case script execution result for the framework; the test case script method module is used for compiling a test case script; the test pre-and post-judgment condition module comprises a pre-judgment condition and a post-judgment condition and is used for the test case script method module to inherit and call; the test case script execution module is used for executing the test case script and outputting a corresponding test result; the test result integration module is used for integrating the test results and outputting the test results; the invention reduces the repeatability of the test script.
Description
Technical Field
The invention relates to the technical field of software testing, in particular to a web automatic testing framework system.
Background
For a framework system of the existing mainstream web automation test, a test case script module is the most important module in the project test, and the test case script module is mainly used for compiling the test case script, and the quality of the test case script directly influences the test quality of the whole project. When the test case script module of the framework is used for compiling the test case script, a judgment condition is set before and after compiling in each test case script class, and the condition mainly comprises two classes: a pre-judgment condition and a post-judgment condition. The pre-judging condition is mainly used for presetting a test environment, such as browser driving setting and browser maximization; the post-judgment condition is mainly used for cleaning a test environment after the test is finished, and providing a clean test environment for the next test case script, such as quitting an account and closing browser operation. For each actual project, the number of the test case scripts can reach thousands of test case scripts, and if the two judgment conditions are added to each test case script, the code amount of the script is greatly increased, so that the script writing cost is increased undoubtedly. The above-described pre-and post-determination conditions have many common points, and if each script exists, many scripts are repeated.
Disclosure of Invention
In order to solve the problems in the prior art, the invention aims to provide a web automation testing framework system, and the invention separately modularizes the pre-and post-judgment conditions by separating the pre-and post-judgment conditions, so as to reduce the script code amount, thereby reducing the script compiling cost and the test script repetition degree to the maximum extent.
In order to achieve the purpose, the invention adopts the technical scheme that: a web automation test framework system, comprising:
the basic module is used as a most basic web page operation method providing module, integrates and encapsulates various page operation methods, is used for being inherited by other modules and calls the page operation methods in the module;
the page object type module integrates all page object elements of a project, including element coordinates and element operation, wherein the element coordinates are determined by a front end positioning mode, and the position of a page where the element is located is marked; element operation is provided by the basic class module, and the page object class module inherits the basic class module, so that the operation method of the basic class module is provided;
the common auxiliary method module provides a log output method when the test case script is executed by the framework and a re-execution method after the test case script fails to be executed, and provides a test case script execution result for the framework;
the test case script method module is used for compiling the test case script, integrates various assertion methods of the test case script, does not contain a front and back judgment condition, does not execute the test case script, and only integrates all the test case scripts;
the test case script method module comprises a test pre-and-post judgment condition module, a test post-and-post judgment module and a test case script module, wherein the test pre-and-post judgment condition module is a module separated and extracted from the test case script method module and mainly comprises a pre-judgment condition and a post-judgment condition, and the two conditions are independently extracted to be inherited and called by the test case script method module;
the test case script execution module is used for executing the test case script in the test case script method module and outputting a corresponding test result;
and the test result integration module is used for integrating the test result and outputting the test result after the test case script execution module finishes executing the test case script.
As a further improvement of the invention, in the basic module, the page operation method comprises the steps of browser opening, website inputting, inputting method, clicking, dragging, uploading and mouse operation.
The invention has the beneficial effects that:
the invention separates the part of the common point of the pre-and post-judgment condition and the test script, and does not need to add the pre-and post-judgment condition into the test case script. For each test case script, the module of the test case script method is only required to inherit the module of the separated pre-and post-judgment condition method, so that each test case script can use the separated pre-and post-judgment condition. Through the processing, the script code amount is greatly reduced, and therefore the script writing cost is reduced to the maximum extent.
Drawings
FIG. 1 is a flow chart of system testing according to an embodiment of the present invention.
Detailed Description
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
Examples
As shown in fig. 1, a web automation test framework system provides each module with a separate pre-and post-judgment condition method for inheritance use to complete the compiling, execution and test result output of an automation test script. The different divided modules include:
and the basic class module is used as a most basic web page operation method providing module and is used for being inherited by other modules and calling page operation in the module.
This module is the core module of the overall system, and all other modules need to use the method that this module contains. Meanwhile, the module has expansibility. When the basic method is used in the process of executing the automatic test, if the basic method lacks the operation method required by the test, the basic method can be added into the basic method at any time, and the basic method can be used more flexibly. However, for a common page operation method, the basic class is integrated and packaged by default, such as opening a browser, inputting a website, inputting a method and operating a mouse.
And the page object class module mainly integrates all page object elements of a project. This module is a description of each URL page element that contains the location and method of operation of the page element.
Wherein the position of the page element is determined by the way the front-end HTMl language is positioned. Such as: a register button and a confirm button on the page are positioned by front-end methods such as id, name, CSS and the like when the automatic operation is carried out;
element operation is provided by the basic class module, and the page object class inherits the basic class module, so that the operation method of the basic class module is provided. Such as: clicking, dragging, double clicking, hovering, uploading and the like of the buttons.
And the common auxiliary method module provides function expansion for the whole test framework, and mainly comprises log output and test case script failure retry.
And the log output function is used for outputting the step completion function every time a key step is executed. Such as: for the positioning element and operation element step, after the step is automatically executed, the following steps are printed out: the register button is clicked by locating element # hui in the CSS in the manner of id location. The advantage of adding the log output function is that if the program execution error can be found in time, the debugging is convenient.
The test case script failure retry function of the module is mainly used for executing the case again after the case execution fails until the set times are exceeded and the case is not executed repeatedly. Such as: the maximum repeated execution times is set to be 3 times, when the execution of the case 2 fails, if the case fails all the time, the case is re-executed for 3 times, and if the case still fails after the execution of the case exceeds 3 times, the case is skipped to continue to execute the next case. The function well ensures the accuracy and the effectiveness of the test case script result.
The test case script method module is mainly used for executing the test case script, and the front and back judgment condition method in the front and back judgment condition method module separated from the test case script module is called before the test case script is executed each time. If a registered test case script is to be executed, methods for opening a browser and accessing a website in the test pre-and post-judgment condition method modules are called first; and after the execution of the test case script is registered, methods for logging out an account and closing the browser in the test pre-and post-judgment condition method modules are called.
The test method comprises a test case method and a test pre-post judgment condition method module, wherein the test case method is separated from the test case method and is used for being called by other modules, the test case method mainly comprises a setUp method and a teaDown method, the setUp method is mainly used for setting pre-judgment conditions before testing starts, and the teaDown method is mainly used for setting post judgment conditions after testing is finished. Such as: a browser is required to be arranged in front of a test case script of the test case script module before the test case script is executed, and a method for setting the browser and accessing a website in a front judgment method setUp method in a front judgment condition method and a back judgment condition method is called in a mode of inheriting the test case script method module; and if the browser needs to be closed after the test case script is executed, calling a rear judgment method tearDwon method in the front and rear judgment condition methods to complete the setting of the rear judgment condition after the test is finished.
The test case script execution module is mainly used for executing the test case script in the test case script method module and outputting a corresponding test result. First, the module name, class name, and method name of the module must begin with test _ followed by ASCII code in the order of test _ followed. Such as: the module has two test methods, namely test _02 and test _01, and when the module executes the two test methods, the test _01 is executed first, then the test _02 is executed, and the corresponding test result is input.
And the test result integration module is used for integrating the test result after the test case script execution module finishes executing the test case script, and outputting the test result in a complete test report form. The module will output the test result only after all the cases of the module are executed. Such as: the test case script execution module executes 200 test case scripts in total, 180 test case scripts are successfully executed, 20 test case scripts are failed, and finally the test result is integrated by the test result integration module.
The above is a detailed description of each design flow of the framework, if it is applied to a project. In the later maintenance work of the test framework, only basic modules need to be maintained, and functions needing to be added in the test process are added; the test case script execution module only needs to compile test case scripts aiming at different projects; and the other modules, especially the separated test front-rear judgment modules, can not be greatly modified. The code repetition degree is minimized, and the modification degree of a tester to the system is also greatly reduced. .
The above-mentioned embodiments only express the specific embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention.
Claims (2)
1. A web automation test framework system, comprising:
the basic module is used as a most basic web page operation method providing module, integrates and encapsulates various page operation methods, is used for being inherited by other modules and calls the page operation methods in the module;
the page object type module integrates all page object elements of a project, including element coordinates and element operation, wherein the element coordinates are determined by a front end positioning mode, and the position of a page where the element is located is marked; element operation is provided by the basic class module, and the page object class module inherits the basic class module, so that the operation method of the basic class module is provided;
the common auxiliary method module provides a log output method when the test case script is executed by the framework and a re-execution method after the test case script fails to be executed, and provides a test case script execution result for the framework;
the test case script method module is used for compiling the test case script, integrates various assertion methods of the test case script, does not contain a front and back judgment condition, does not execute the test case script, and only integrates all the test case scripts;
the test case script method module comprises a test pre-and-post judgment condition module, a test post-and-post judgment module and a test case script module, wherein the test pre-and-post judgment condition module is a module separated and extracted from the test case script method module and mainly comprises a pre-judgment condition and a post-judgment condition, and the two conditions are independently extracted to be inherited and called by the test case script method module;
the test case script execution module is used for executing the test case script in the test case script method module and outputting a corresponding test result;
and the test result integration module is used for integrating the test result and outputting the test result after the test case script execution module finishes executing the test case script.
2. The web automation test framework system of claim 1, wherein in the base class module, page operations include browser opening, web site entry, method entry, clicking, dragging, uploading, and mouse operations.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111369754.0A CN113836042A (en) | 2021-11-18 | 2021-11-18 | Web automated testing framework system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111369754.0A CN113836042A (en) | 2021-11-18 | 2021-11-18 | Web automated testing framework system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113836042A true CN113836042A (en) | 2021-12-24 |
Family
ID=78971519
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111369754.0A Pending CN113836042A (en) | 2021-11-18 | 2021-11-18 | Web automated testing framework system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113836042A (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8904358B1 (en) * | 2010-06-08 | 2014-12-02 | Cadence Design Systems, Inc. | Methods, systems, and articles of manufacture for synchronizing software verification flows |
CN106547689A (en) * | 2016-10-20 | 2017-03-29 | 金航数码科技有限责任公司 | A kind of automatic test cases development system and method based on web |
CN110321281A (en) * | 2019-05-24 | 2019-10-11 | 中国工程物理研究院计算机应用研究所 | Web test platform and test method based on mixing automated test frame |
CN110851356A (en) * | 2019-10-30 | 2020-02-28 | 河海大学 | Selenium-based Web application automatic test framework and construction method and system thereof |
CN111104315A (en) * | 2019-11-29 | 2020-05-05 | 京东数字科技控股有限公司 | Test script generation method and device and computer readable storage medium |
CN112015638A (en) * | 2020-07-30 | 2020-12-01 | 西安雷风电子科技有限公司 | Automatic testing method and system |
CN112506785A (en) * | 2020-12-15 | 2021-03-16 | 杭州电魂网络科技股份有限公司 | Automatic testing method, device, equipment and medium for login of Html5 game page |
-
2021
- 2021-11-18 CN CN202111369754.0A patent/CN113836042A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8904358B1 (en) * | 2010-06-08 | 2014-12-02 | Cadence Design Systems, Inc. | Methods, systems, and articles of manufacture for synchronizing software verification flows |
CN106547689A (en) * | 2016-10-20 | 2017-03-29 | 金航数码科技有限责任公司 | A kind of automatic test cases development system and method based on web |
CN110321281A (en) * | 2019-05-24 | 2019-10-11 | 中国工程物理研究院计算机应用研究所 | Web test platform and test method based on mixing automated test frame |
CN110851356A (en) * | 2019-10-30 | 2020-02-28 | 河海大学 | Selenium-based Web application automatic test framework and construction method and system thereof |
CN111104315A (en) * | 2019-11-29 | 2020-05-05 | 京东数字科技控股有限公司 | Test script generation method and device and computer readable storage medium |
CN112015638A (en) * | 2020-07-30 | 2020-12-01 | 西安雷风电子科技有限公司 | Automatic testing method and system |
CN112506785A (en) * | 2020-12-15 | 2021-03-16 | 杭州电魂网络科技股份有限公司 | Automatic testing method, device, equipment and medium for login of Html5 game page |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6802026B1 (en) | Parameterizable and reconfigurable debugger core generators | |
CN101526919B (en) | Method for generating script files to test Web application software and device thereof | |
US8875103B2 (en) | Method of testing multiple language versions of a software system using one test script | |
US8555234B2 (en) | Verification of soft error resilience | |
US20070061641A1 (en) | Apparatus and method for generating test driver | |
CN110908895A (en) | Page automatic testing method and device, computer equipment and storage medium | |
US11615018B2 (en) | Automation testing tool framework | |
CN110597721A (en) | Automatic interface pressure testing method based on pressure testing script | |
CN112463586A (en) | Method and medium for automatically generating application program interface test case | |
CN103186459A (en) | JAVA graphical user interface automatic test method based on scripts | |
CN108427645B (en) | Method and system for realizing unattended operation in automatic test platform without command line interface | |
CN107480050B (en) | Test method for automatically testing update package | |
CN117370217A (en) | Automatic interface test result generation method based on python | |
CN113836042A (en) | Web automated testing framework system | |
CN112783769A (en) | Self-defined automatic software testing method | |
CN114239459B (en) | Processing method, device, equipment and medium for FPGA prototype design file | |
CN112285542B (en) | Debugging and testing method for FPGA external interface logic | |
CN115757100A (en) | Automated testing framework facing user interface, method, equipment and medium | |
CN115407997A (en) | Agile development application method and system based on low codes | |
EP0801348A1 (en) | Method of monitoring the operation of a computer | |
CN114281709A (en) | Unit testing method, system, electronic equipment and storage medium | |
Scullard | Test case selection using VDM | |
CN114218666A (en) | Simulation preprocessing method and device | |
CN111078193A (en) | Software development method and system for data analysis system | |
CN111813665A (en) | Big data platform interface data testing method and system based on python |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20211224 |
|
RJ01 | Rejection of invention patent application after publication |