CN112231213A - Web automatic testing method, system, storage medium and terminal equipment - Google Patents

Web automatic testing method, system, storage medium and terminal equipment Download PDF

Info

Publication number
CN112231213A
CN112231213A CN202011112421.5A CN202011112421A CN112231213A CN 112231213 A CN112231213 A CN 112231213A CN 202011112421 A CN202011112421 A CN 202011112421A CN 112231213 A CN112231213 A CN 112231213A
Authority
CN
China
Prior art keywords
test
web
browser
console
interface
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
Application number
CN202011112421.5A
Other languages
Chinese (zh)
Inventor
陈泳
汪贤
李孝君
陈基涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Zhufeng Network Technology Co ltd
Original Assignee
Guangzhou Zhufeng Network Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Guangzhou Zhufeng Network Technology Co ltd filed Critical Guangzhou Zhufeng Network Technology Co ltd
Priority to CN202011112421.5A priority Critical patent/CN112231213A/en
Publication of CN112231213A publication Critical patent/CN112231213A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Abstract

The invention discloses a Web automatic testing method, a Web automatic testing system, a Web automatic testing storage medium and terminal equipment based on a browser, wherein the method comprises the following steps: when a user interface based on a browser enters a console of a developer mode, the browser downloads Web resources on a server side based on an HTTP request; presenting the Web resource in a window of the browser to obtain a presented webpage interface; receiving a test instruction generated by an operator in the console; and calling a corresponding resource parameter function in an automatic testing system in the console based on the testing instruction to automatically execute the simulation user operation test processing on the webpage interface to obtain a test result. In the embodiment of the invention, automatic testing is realized, and manual operation in the testing process is reduced.

Description

Web automatic testing method, system, storage medium and terminal equipment
Technical Field
The invention relates to the technical field of internet, in particular to a Web automatic testing method and system based on a browser, a storage medium and terminal equipment.
Background
The browser is used as an important carrier of information transfer, the web page bears a platform of various website applications, and in order to complete function tests on the PC end and the mobile end, manual operation is usually required on the equipment. In the prior art, a series of processes of browsing a webpage by a user and outputting a test report can be simulated by inputting and executing codes by using a browser development tool console, so that an automatic test effect of simulating manual operation is achieved. The method comprises the steps of designing, compiling and packaging codes, introducing a script code library, defining users, events, network requests, timing tasks, data caching, data transmission and the like, defining various schemes, inputting a small number of configuration items and adapting to more user scenes or functional modules. For example, after a user page is simulated to enter a page, after webpage resources are loaded, the page is controlled to operate an input box, operate a button, execute click time and browser rolling events after a few seconds, manual operation is replaced, meanwhile, the dwell time is automatically counted, and the page resource request condition is captured.
In the prior art, a browser is opened manually, a webpage address is input, a browser developer tool is opened, a test code is written manually, and the whole process depends on more manual operations; the requirement on personnel capacity is high, the debugging code needs to use the bottom-layer programming capacity, and a complete resource library such as a frame or an assembly which does not improve the coding efficiency is convenient to introduce; no test case integration, test suite; and lacks the ability to automatically output test reports.
Disclosure of Invention
The invention aims to overcome the defects of the prior art, and provides a Web automatic testing method and system based on a browser, a storage medium and terminal equipment, so that automatic testing is realized, and manual operation in the testing process is reduced.
In order to solve at least one technical problem, an embodiment of the present invention provides a Web automation testing method based on a browser, where the method includes:
when a user interface based on a browser enters a console of a developer mode, the browser downloads Web resources on a server side based on an HTTP request;
presenting the Web resource in a window of the browser to obtain a presented webpage interface;
receiving a test instruction generated by an operator in the console;
and calling a corresponding resource parameter function in an automatic testing system in the console based on the testing instruction to automatically execute the simulation user operation test processing on the webpage interface to obtain a test result.
Optionally, the browser includes a presentation engine, a network component, a UI backend, a js parser, and a data store; the presentation engine is responsible for analyzing and displaying the Web resource content requested to be presented; the network component is responsible for generating HTTP network requests; the UI back end is responsible for drawing a webpage interface; the js parser is responsible for parsing and executing js codes; and the data storage is responsible for storing the data required by the browser on a hard disk.
Optionally, the presenting the Web resource in the window of the browser to obtain a presented Web interface includes:
analyzing the HTML document in the Web resource, and constructing a DOM tree based on the analysis result;
rendering the DOM tree, and analyzing the style attributes of external CSS files and elements in the rendering process to obtain a rendering tree;
positioning each node in the rendering tree on an exact coordinate of a screen, and drawing on the exact coordinate;
and traversing each node in the drawing process and drawing by using the UI rear end to form a presented webpage interface.
Optionally, the rendering tree includes a plurality of visual effects and rectangles in a display order in contention;
the rendered web page interface includes regions other than a web page content form, including an address bar, a status bar, a toolbar, and a back leg/forward button.
Optionally, the console allows standard JavaScript statements and special commands to be used to help debug the web interface.
Optionally, the resource parameter function includes a resource library, a framework, an interaction flow, a test case, and a test report;
the resource library is used for providing common functions, test tools, common plug-ins and data structure operations; the framework is used for providing an API; the interaction flow is used for providing interaction rules, jump paths and conventional event flow instructions of the pages; the test tool provides a set of test inputs, execution conditions, and expected results tailored to a particular objective for verifying that a particular requirement is met; the test report is used for delivering all documents included in the test process, including a test plan, a test case/case, a defect record and a test report.
Optionally, the invoking, in the console, a corresponding resource parameter function in an automated testing system based on the test instruction to perform automatic execution of a simulation user operation test process on the web interface to obtain a test result includes:
the control console establishes a test connection with the automatic test system;
and after the control console receives the test instruction, sequentially calling a resource library, a frame, an interactive flow, a test case and a test report in the automatic test system based on the control console to automatically execute the test processing of simulating the user operation on the webpage interface to obtain a test result.
In addition, an embodiment of the present invention further provides a Web automation testing apparatus based on a browser, where the apparatus includes:
a downloading module: the method comprises the steps that when a user interface based on a browser enters a console of a developer mode, the browser downloads Web resources on a server side based on an HTTP request;
a presentation module: the Web resource is presented in the window of the browser, and a presented webpage interface is obtained;
a generation module: the test system is used for receiving a test instruction generated by an operator in the operation of the console;
an automatic test module: and the system is used for calling a corresponding resource parameter function in an automatic testing system in the control console based on the testing instruction to automatically execute the simulation user operation testing processing on the webpage interface to obtain a testing result.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements any one of the above described Web automation testing methods.
In addition, an embodiment of the present invention further provides a terminal device, which includes:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to: and executing the Web automatic testing method.
In the embodiment of the invention, the automatic test system provides abundant automatic test methods, so that more manual operations are reduced in the whole process; a standard frame and operation steps are provided, so that technical storage or filing is facilitated; providing a js command of a simple control console, unifying and standardizing, and reducing professional thresholds, wherein the js command can be used by non-professional technicians except developers, testers, product managers and the like; providing test case integration and a test suite; and provide the template of the automatic output test report, realize the automatic generation and output test report, in order to reach the test goal; the invention provides a packaged complete test flow, and a user can complete the scenes of page debugging, page interaction, event binding and execution, interface joint debugging and the like only by inputting a small amount of command line codes according to a configuration description document without knowing an internal implementation principle. The learning cost is reduced, and the testing efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of a method for automated browser-based Web testing in an embodiment of the present invention;
FIG. 2 is a schematic structural component diagram of a browser-based Web automation testing device in an embodiment of the present invention;
fig. 3 is a schematic structural component diagram of a terminal device in the embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Examples
Referring to fig. 1, fig. 1 is a flowchart illustrating a Web automation testing method based on a browser in an embodiment of the present invention.
As shown in fig. 1, a method for Web automation test based on browser includes:
s11: when a user interface based on a browser enters a console of a developer mode, the browser downloads Web resources on a server side based on an HTTP request;
in the specific implementation process of the invention, the browser comprises a presentation engine, a network component, a UI rear end, a js parser and a data storage; the presentation engine is responsible for analyzing and displaying the Web resource content requested to be presented; the network component is responsible for generating HTTP network requests; the UI back end is responsible for drawing a webpage interface; the js parser is responsible for parsing and executing js codes; and the data storage is responsible for storing the data required by the browser on a hard disk.
Specifically, when a user enters a console of a developer mode through a browser, the browser sends an HTTP request to a server through a built-in network component of the browser, and the request content is a downloaded Web resource; after receiving the request, the server establishes connection with the browser and issues the Web resource to the browser, so that the browser downloads the Web resource on the server side.
The browser comprises a presentation engine, a network component, a UI rear end, a js parser and a data storage; the UI (interface) comprises an address bar, a status bar, a tool bar and a back/forward button except for a webpage content form; transmitting instructions between the browser engine user interface and the presentation engine; the presentation (rendering) engine is responsible for parsing and displaying the requested content; the network component is responsible for network requests, such as HTTP requests; the UI back end is responsible for drawing basic widgets, such as system modal popup; the js parser is responsible for parsing and executing js codes; data storage: the browser needs various data stored on the hard disk.
S12: presenting the Web resource in a window of the browser to obtain a presented webpage interface;
in a specific implementation process of the present invention, the presenting the Web resource in the window of the browser to obtain a presented Web interface includes: analyzing the HTML document in the Web resource, and constructing a DOM tree based on the analysis result; rendering the DOM tree, and analyzing the style attributes of external CSS files and elements in the rendering process to obtain a rendering tree; positioning each node in the rendering tree on an exact coordinate of a screen, and drawing on the exact coordinate; and traversing each node in the drawing process and drawing by using the UI rear end to form a presented webpage interface.
Further, the rendering tree includes a plurality of visual effects and rectangles in a display order in contention; the rendered web page interface includes regions other than a web page content form, including an address bar, a status bar, a toolbar, and a back leg/forward button.
Specifically, an HTML document in a downloaded Web resource is analyzed in the browser, an analysis result is obtained, and then a DOM tree is constructed according to the analysis result; rendering the DOM tree, and analyzing the style attributes of external CSS files and elements in the rendering process to obtain a rendering tree; locating each node in the render tree at an exact coordinate, typically a pixel coordinate, on the screen of the terminal; drawing on the exact coordinates; and traversing each node in the drawing process and drawing by using the UI rear end to form a webpage interface of the program.
Analyzing an HTML document to construct a DOM tree, analyzing style attributes of external CSS files and elements in a rendering process, wherein the rendering tree comprises a plurality of visual effects and is a rectangle in a correct display sequence, positioning each node on an exact coordinate of a screen in a layout process, and traversing each node in a drawing process to draw by using a UI rear end; the rendered web page interface also includes areas other than the web page content form, including an address bar, a status bar, a toolbar, and back/forward buttons.
S13: receiving a test instruction generated by an operator in the console;
in the specific implementation process of the invention, the console allows the standard JavaScript statements and special commands to be used to help debug the webpage interface.
Specifically, after a user (operator) enters a console in a developer mode through a user interface of a browser, a test instruction generating operation is performed on the console, that is, the console receives a corresponding operation performed by the operator on the console, and generates a test instruction.
The console allows standard JavaScript statements and special commands to be used to help debug the webpage interface; the console can view diagnostic information, display rich structured data, control and filter output, detect and modify page elements, measure execution time, and the like; including diagnostics and logging to the console, comparing similar data objects, measurement and statistics execution, exception and error handling, and console API referencing.
The post role of receiving the operator can be a developer, a tester and a product manager, and the automatic testing step based on the browser can be completed only by being familiar with the technology.
S14: and calling a corresponding resource parameter function in an automatic testing system in the console based on the testing instruction to automatically execute the simulation user operation test processing on the webpage interface to obtain a test result.
In the specific implementation process of the invention, the resource parameter function comprises a resource library, a frame, an interactive flow, a test case and a test report; the resource library is used for providing common functions, test tools, common plug-ins and data structure operations; the framework is used for providing an API; the interaction flow is used for providing interaction rules, jump paths and conventional event flow instructions of the pages; the test tool provides a set of test inputs, execution conditions, and expected results tailored to a particular objective for verifying that a particular requirement is met; the test report is used for delivering all documents included in the test process, including a test plan, a test case/case, a defect record and a test report.
Further, the invoking, in the console, a corresponding resource parameter function in an automated testing system based on the test instruction to perform automatic execution of a simulation user operation test process on the web interface to obtain a test result includes: the control console establishes a test connection with the automatic test system; and after the control console receives the test instruction, sequentially calling a resource library, a frame, an interactive flow, a test case and a test report in the automatic test system based on the control console to automatically execute the test processing of simulating the user operation on the webpage interface to obtain a test result.
Specifically, after the console generates the test instruction, the corresponding resource parameter function in the automated testing system is called in the console according to the test instruction to automatically execute the simulation user operation test on the web interface, so as to obtain the test result.
Before testing, firstly, the console is required to establish test connection with the automatic test system; and then after the control console receives the test instruction, the resource library, the frame, the interactive flow, the test case and the test report in the automatic test system are sequentially called by the control console to automatically execute the simulation user operation test processing on the webpage interface, and a test result is obtained.
The automatic test system integrates a plurality of resource parameter function modules such as a resource library, a frame, an interactive flow, a test case, a test report and the like, and aims to input a test instruction conveniently through a control console of a browser, then call the automatic parameter system to complete automatic operation and complete a series of automatic tests.
The resource parameter function of the automatic test system comprises a resource library, a framework, an interactive process, a test case, a test report and an extension module. The resource library is used for providing a commonly used resource library, solving commonly used functions, tool methods, data structure operations, commonly used plug-ins and the like. The framework is used for providing simple and convenient API, selectively adding modules, unifying the specification, being easy to integrate with other libraries and projects, being simple and easy to use and being convenient for a user to operate; such as providing selectors, DOM traversal and operations, utility functions, tool methods, event processing, AJAX requests. The interaction flow is used for providing instructions such as interaction rules, jump paths, conventional event flows and the like of the pages; for example, the a page jumps to the B page, and the operation of clicking the button is performed. The test case is used for a set of test inputs, execution conditions, and expected results compiled for a particular target, and is used to verify whether a particular requirement is met, including test targets, test environments, input data, test steps, expected results, test scripts, and the like. The test includes the steps of delivering all included documents in the test process, mainly including test plans, test cases/cases, defect records and test reports. Defining a test report template, and after executing a test case, automatically generating a related test report, such as a functional test, and ensuring that the function of a test object is normal, wherein the related test report comprises functions of a business process, data processing, a boundary value and the like, all test requirements and cases are covered, the test is finished in an ST environment, the number of effective cases is xx, the execution rate is xx%, the success rate is xx%, the defect closing rate is xx%, and the defects are repaired and returned to be closed at present. The expansion module is used for reserving addition of more modules, so that the expansibility is well made, the subsequent test is more automatic, and the test precision is higher.
In the embodiment of the invention, the automatic test system provides abundant automatic test methods, so that more manual operations are reduced in the whole process; a standard frame and operation steps are provided, so that technical storage or filing is facilitated; providing a js command of a simple control console, unifying and standardizing, and reducing professional thresholds, wherein the js command can be used by non-professional technicians except developers, testers, product managers and the like; providing test case integration and a test suite; and provide the template of the automatic output test report, realize the automatic generation and output test report, in order to reach the test goal; the invention provides a packaged complete test flow, and a user can complete the scenes of page debugging, page interaction, event binding and execution, interface joint debugging and the like only by inputting a small amount of command line codes according to a configuration description document without knowing an internal implementation principle. The learning cost is reduced, and the testing efficiency is improved.
Examples
Referring to fig. 2, fig. 2 is a schematic structural component diagram of a Web automation testing apparatus based on a browser in an embodiment of the present invention.
As shown in fig. 2, a Web automation test device based on a browser, the device includes:
the downloading module 21: the method comprises the steps that when a user interface based on a browser enters a console of a developer mode, the browser downloads Web resources on a server side based on an HTTP request;
in the specific implementation process of the invention, the browser comprises a presentation engine, a network component, a UI rear end, a js parser and a data storage; the presentation engine is responsible for analyzing and displaying the Web resource content requested to be presented; the network component is responsible for generating HTTP network requests; the UI back end is responsible for drawing a webpage interface; the js parser is responsible for parsing and executing js codes; and the data storage is responsible for storing the data required by the browser on a hard disk.
Specifically, when a user enters a console of a developer mode through a browser, the browser sends an HTTP request to a server through a built-in network component of the browser, and the request content is a downloaded Web resource; after receiving the request, the server establishes connection with the browser and issues the Web resource to the browser, so that the browser downloads the Web resource on the server side.
The browser comprises a presentation engine, a network component, a UI rear end, a js parser and a data storage; the UI (interface) comprises an address bar, a status bar, a tool bar and a back/forward button except for a webpage content form; transmitting instructions between the browser engine user interface and the presentation engine; the presentation (rendering) engine is responsible for parsing and displaying the requested content; the network component is responsible for network requests, such as HTTP requests; the UI back end is responsible for drawing basic widgets, such as system modal popup; the js parser is responsible for parsing and executing js codes; data storage: the browser needs various data stored on the hard disk.
The presentation module 22: the Web resource is presented in the window of the browser, and a presented webpage interface is obtained;
in a specific implementation process of the present invention, the presenting the Web resource in the window of the browser to obtain a presented Web interface includes: analyzing the HTML document in the Web resource, and constructing a DOM tree based on the analysis result; rendering the DOM tree, and analyzing the style attributes of external CSS files and elements in the rendering process to obtain a rendering tree; positioning each node in the rendering tree on an exact coordinate of a screen, and drawing on the exact coordinate; and traversing each node in the drawing process and drawing by using the UI rear end to form a presented webpage interface.
Further, the rendering tree includes a plurality of visual effects and rectangles in a display order in contention; the rendered web page interface includes regions other than a web page content form, including an address bar, a status bar, a toolbar, and a back leg/forward button.
Specifically, an HTML document in a downloaded Web resource is analyzed in the browser, an analysis result is obtained, and then a DOM tree is constructed according to the analysis result; rendering the DOM tree, and analyzing the style attributes of external CSS files and elements in the rendering process to obtain a rendering tree; locating each node in the render tree at an exact coordinate, typically a pixel coordinate, on the screen of the terminal; drawing on the exact coordinates; and traversing each node in the drawing process and drawing by using the UI rear end to form a webpage interface of the program.
Analyzing an HTML document to construct a DOM tree, analyzing style attributes of external CSS files and elements in a rendering process, wherein the rendering tree comprises a plurality of visual effects and is a rectangle in a correct display sequence, positioning each node on an exact coordinate of a screen in a layout process, and traversing each node in a drawing process to draw by using a UI rear end; the rendered web page interface also includes areas other than the web page content form, including an address bar, a status bar, a toolbar, and back/forward buttons.
The generation module 23: the test system is used for receiving a test instruction generated by an operator in the operation of the console;
in the specific implementation process of the invention, the console allows the standard JavaScript statements and special commands to be used to help debug the webpage interface.
Specifically, after a user (operator) enters a console in a developer mode through a user interface of a browser, a test instruction generating operation is performed on the console, that is, the console receives a corresponding operation performed by the operator on the console, and generates a test instruction.
The console allows standard JavaScript statements and special commands to be used to help debug the webpage interface; the console can view diagnostic information, display rich structured data, control and filter output, detect and modify page elements, measure execution time, and the like; including diagnostics and logging to the console, comparing similar data objects, measurement and statistics execution, exception and error handling, and console API referencing.
The post role of receiving the operator can be a developer, a tester and a product manager, and the automatic testing step based on the browser can be completed only by being familiar with the technology.
The automatic test module 24: and the system is used for calling a corresponding resource parameter function in an automatic testing system in the control console based on the testing instruction to automatically execute the simulation user operation testing processing on the webpage interface to obtain a testing result.
In the specific implementation process of the invention, the resource parameter function comprises a resource library, a frame, an interactive flow, a test case and a test report; the resource library is used for providing common functions, test tools, common plug-ins and data structure operations; the framework is used for providing an API; the interaction flow is used for providing interaction rules, jump paths and conventional event flow instructions of the pages; the test tool provides a set of test inputs, execution conditions, and expected results tailored to a particular objective for verifying that a particular requirement is met; the test report is used for delivering all documents included in the test process, including a test plan, a test case/case, a defect record and a test report.
Further, the invoking, in the console, a corresponding resource parameter function in an automated testing system based on the test instruction to perform automatic execution of a simulation user operation test process on the web interface to obtain a test result includes: the control console establishes a test connection with the automatic test system; and after the control console receives the test instruction, sequentially calling a resource library, a frame, an interactive flow, a test case and a test report in the automatic test system based on the control console to automatically execute the test processing of simulating the user operation on the webpage interface to obtain a test result.
Specifically, after the console generates the test instruction, the corresponding resource parameter function in the automated testing system is called in the console according to the test instruction to automatically execute the simulation user operation test on the web interface, so as to obtain the test result.
Before testing, firstly, the console is required to establish test connection with the automatic test system; and then after the control console receives the test instruction, the resource library, the frame, the interactive flow, the test case and the test report in the automatic test system are sequentially called by the control console to automatically execute the simulation user operation test processing on the webpage interface, and a test result is obtained.
The automatic test system integrates a plurality of resource parameter function modules such as a resource library, a frame, an interactive flow, a test case, a test report and the like, and aims to input a test instruction conveniently through a control console of a browser, then call the automatic parameter system to complete automatic operation and complete a series of automatic tests.
The resource parameter function of the automatic test system comprises a resource library, a framework, an interactive process, a test case, a test report and an extension module. The resource library is used for providing a commonly used resource library, solving commonly used functions, tool methods, data structure operations, commonly used plug-ins and the like. The framework is used for providing simple and convenient API, selectively adding modules, unifying the specification, being easy to integrate with other libraries and projects, being simple and easy to use and being convenient for a user to operate; such as providing selectors, DOM traversal and operations, utility functions, tool methods, event processing, AJAX requests. The interaction flow is used for providing instructions such as interaction rules, jump paths, conventional event flows and the like of the pages; for example, the a page jumps to the B page, and the operation of clicking the button is performed. The test case is used for a set of test inputs, execution conditions, and expected results compiled for a particular target, and is used to verify whether a particular requirement is met, including test targets, test environments, input data, test steps, expected results, test scripts, and the like. The test includes the steps of delivering all included documents in the test process, mainly including test plans, test cases/cases, defect records and test reports. Defining a test report template, and after executing a test case, automatically generating a related test report, such as a functional test, and ensuring that the function of a test object is normal, wherein the related test report comprises functions of a business process, data processing, a boundary value and the like, all test requirements and cases are covered, the test is finished in an ST environment, the number of effective cases is xx, the execution rate is xx%, the success rate is xx%, the defect closing rate is xx%, and the defects are repaired and returned to be closed at present. The expansion module is used for reserving addition of more modules, so that the expansibility is well made, the subsequent test is more automatic, and the test precision is higher.
In the embodiment of the invention, the automatic test system provides abundant automatic test methods, so that more manual operations are reduced in the whole process; a standard frame and operation steps are provided, so that technical storage or filing is facilitated; providing a js command of a simple control console, unifying and standardizing, and reducing professional thresholds, wherein the js command can be used by non-professional technicians except developers, testers, product managers and the like; providing test case integration and a test suite; and provide the template of the automatic output test report, realize the automatic generation and output test report, in order to reach the test goal; the invention provides a packaged complete test flow, and a user can complete the scenes of page debugging, page interaction, event binding and execution, interface joint debugging and the like only by inputting a small amount of command line codes according to a configuration description document without knowing an internal implementation principle. The learning cost is reduced, and the testing efficiency is improved.
The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements the Web automation testing method according to any one of the embodiments. The computer-readable storage medium includes, but is not limited to, any type of disk including floppy disks, hard disks, optical disks, CD-ROMs, and magneto-optical disks, ROMs (Read-Only memories), RAMs (Random AcceSS memories), EPROMs (EraSable Programmable Read-Only memories), EEPROMs (Electrically EraSable Programmable Read-Only memories), flash memories, magnetic cards, or optical cards. That is, a storage device includes any medium that stores or transmits information in a form readable by a device (e.g., a computer, a cellular phone), and may be a read-only memory, a magnetic or optical disk, or the like.
The embodiment of the invention also provides a computer application program which runs on a computer and is used for executing the Web automatic testing method of any one of the embodiments.
In addition, fig. 3 is a schematic structural composition diagram of the terminal device in the embodiment of the present invention.
An embodiment of the present invention further provides a terminal device, as shown in fig. 3. The terminal device includes a processor 302, a memory 303, an input unit 304, a display unit 305, and the like. Those skilled in the art will appreciate that the device configuration means shown in fig. 3 do not constitute a limitation of all devices and may include more or less components than those shown, or some components in combination. The memory 303 may be used to store the application 301 and various functional modules, and the processor 302 executes the application 301 stored in the memory 303, thereby performing various functional applications of the device and data processing. The memory may be internal or external memory, or include both internal and external memory. The memory may comprise read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), flash memory, or random access memory. The external memory may include a hard disk, a floppy disk, a ZIP disk, a usb-disk, a magnetic tape, etc. The disclosed memory includes, but is not limited to, these types of memory. The disclosed memory is by way of example only and not by way of limitation.
The input unit 304 is used for receiving input of signals and receiving keywords input by a user. The input unit 304 may include a touch panel and other input devices. The touch panel can collect touch operations of a user on or near the touch panel (for example, operations of the user on or near the touch panel by using any suitable object or accessory such as a finger, a stylus and the like) and drive the corresponding connecting device according to a preset program; other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., play control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like. The display unit 305 may be used to display information input by a user or information provided to the user and various menus of the server. The display unit 305 may take the form of a liquid crystal display, an organic light emitting diode, or the like. The processor 302 is a control center of the server, connects various parts of the entire apparatus using various interfaces and lines, performs various functions and processes data by operating or executing software programs and/or modules stored in the memory 302, and calling data stored in the memory.
As an embodiment, the terminal device includes: one or more processors 302, a memory 303, one or more applications 301, wherein the one or more applications 301 are stored in the memory 303 and configured to be executed by the one or more processors 302, and wherein the one or more applications 301 are configured to perform the method for Web automation testing of any of the above embodiments.
In the embodiment of the invention, the automatic test system provides abundant automatic test methods, so that more manual operations are reduced in the whole process; a standard frame and operation steps are provided, so that technical storage or filing is facilitated; providing a js command of a simple control console, unifying and standardizing, and reducing professional thresholds, wherein the js command can be used by non-professional technicians except developers, testers, product managers and the like; providing test case integration and a test suite; and provide the template of the automatic output test report, realize the automatic generation and output test report, in order to reach the test goal; the invention provides a packaged complete test flow, and a user can complete the scenes of page debugging, page interaction, event binding and execution, interface joint debugging and the like only by inputting a small amount of command line codes according to a configuration description document without knowing an internal implementation principle. The learning cost is reduced, and the testing efficiency is improved.
In addition, the above detailed description is given to a method, a system, a storage medium, and a terminal device for Web automation test based on a browser according to an embodiment of the present invention, and a specific example should be used herein to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A Web automatic testing method based on a browser is characterized by comprising the following steps:
when a user interface based on a browser enters a console of a developer mode, the browser downloads Web resources on a server side based on an HTTP request;
presenting the Web resource in a window of the browser to obtain a presented webpage interface;
receiving a test instruction generated by an operator in the console;
and calling a corresponding resource parameter function in an automatic testing system in the console based on the testing instruction to automatically execute the simulation user operation test processing on the webpage interface to obtain a test result.
2. The Web automation test method of claim 1, wherein the browser comprises a presentation engine, a network component, a UI backend, a js parser, and a data store; the presentation engine is responsible for analyzing and displaying the Web resource content requested to be presented; the network component is responsible for generating HTTP network requests; the UI back end is responsible for drawing a webpage interface; the js parser is responsible for parsing and executing js codes; and the data storage is responsible for storing the data required by the browser on a hard disk.
3. The Web automation test method of claim 1, wherein the presenting the Web resource in the window of the browser and obtaining the presented Web interface comprises:
analyzing the HTML document in the Web resource, and constructing a DOM tree based on the analysis result;
rendering the DOM tree, and analyzing the style attributes of external CSS files and elements in the rendering process to obtain a rendering tree;
positioning each node in the rendering tree on an exact coordinate of a screen, and drawing on the exact coordinate;
and traversing each node in the drawing process and drawing by using the UI rear end to form a presented webpage interface.
4. The Web automation test method according to claim 3, wherein the rendering tree includes a plurality of visual effects and rectangles in a display order in contention;
the rendered web page interface includes regions other than a web page content form, including an address bar, a status bar, a toolbar, and a back leg/forward button.
5. The Web automation test method of claim 1, wherein the console allows debugging of the Web interface using standard JavaScript statements and proprietary commands.
6. The Web automated testing method of claim 1, wherein the resource parameter functions include a resource library, a framework, an interaction flow, a test case, and a test report;
the resource library is used for providing common functions, test tools, common plug-ins and data structure operations; the framework is used for providing an API; the interaction flow is used for providing interaction rules, jump paths and conventional event flow instructions of the pages; the test tool provides a set of test inputs, execution conditions, and expected results tailored to a particular objective for verifying that a particular requirement is met; the test report is used for delivering all documents included in the test process, including a test plan, a test case/case, a defect record and a test report.
7. The Web automation test method of claim 6, wherein the invoking of the corresponding resource parameter function in the automation test system in the console based on the test instruction automatically executes a simulation user operation test process on the Web interface to obtain a test result includes:
the control console establishes a test connection with the automatic test system;
and after the control console receives the test instruction, sequentially calling a resource library, a frame, an interactive flow, a test case and a test report in the automatic test system based on the control console to automatically execute the test processing of simulating the user operation on the webpage interface to obtain a test result.
8. A browser-based Web automation test apparatus, the apparatus comprising:
a downloading module: the method comprises the steps that when a user interface based on a browser enters a console of a developer mode, the browser downloads Web resources on a server side based on an HTTP request;
a presentation module: the Web resource is presented in the window of the browser, and a presented webpage interface is obtained;
a generation module: the test system is used for receiving a test instruction generated by an operator in the operation of the console;
an automatic test module: and the system is used for calling a corresponding resource parameter function in an automatic testing system in the control console based on the testing instruction to automatically execute the simulation user operation testing processing on the webpage interface to obtain a testing result.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the Web automation testing method of any one of claims 1 to 7.
10. A terminal device, characterized in that it comprises:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to: -executing the Web automation test method according to any one of claims 1 to 7.
CN202011112421.5A 2020-10-16 2020-10-16 Web automatic testing method, system, storage medium and terminal equipment Pending CN112231213A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011112421.5A CN112231213A (en) 2020-10-16 2020-10-16 Web automatic testing method, system, storage medium and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011112421.5A CN112231213A (en) 2020-10-16 2020-10-16 Web automatic testing method, system, storage medium and terminal equipment

Publications (1)

Publication Number Publication Date
CN112231213A true CN112231213A (en) 2021-01-15

Family

ID=74118825

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011112421.5A Pending CN112231213A (en) 2020-10-16 2020-10-16 Web automatic testing method, system, storage medium and terminal equipment

Country Status (1)

Country Link
CN (1) CN112231213A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112765040A (en) * 2021-02-04 2021-05-07 深圳市捷视飞通科技股份有限公司 Page testing method, system, computer equipment and storage medium
CN113141283A (en) * 2021-06-22 2021-07-20 中国电子信息产业集团有限公司第六研究所 Network flow simulation test method, system and environment construction method
CN113722229A (en) * 2021-09-06 2021-11-30 挂号网(杭州)科技有限公司 Software testing method and device, electronic equipment and storage medium
CN114238048A (en) * 2021-11-25 2022-03-25 广州市玄武无线科技股份有限公司 Automatic testing method and system for Web front-end performance
CN116070214A (en) * 2022-08-30 2023-05-05 荣耀终端有限公司 Safety testing method and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101866314A (en) * 2010-05-31 2010-10-20 中山大学 Software testing method and software testing system
US20120174075A1 (en) * 2010-08-10 2012-07-05 International Business Machines Corporation Automatically Testing a Web Application
CN102915375A (en) * 2012-11-08 2013-02-06 山东大学 Webpage loading method based on layout zoning
CN104391786A (en) * 2014-10-31 2015-03-04 任子行网络技术股份有限公司 Webpage automatic test system and method thereof
CN109902016A (en) * 2019-03-04 2019-06-18 网易(杭州)网络有限公司 A kind of test method and test platform of Web
CN110377500A (en) * 2019-06-14 2019-10-25 平安科技(深圳)有限公司 Test method, device, terminal device and the medium of Website page

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101866314A (en) * 2010-05-31 2010-10-20 中山大学 Software testing method and software testing system
US20120174075A1 (en) * 2010-08-10 2012-07-05 International Business Machines Corporation Automatically Testing a Web Application
CN102915375A (en) * 2012-11-08 2013-02-06 山东大学 Webpage loading method based on layout zoning
CN104391786A (en) * 2014-10-31 2015-03-04 任子行网络技术股份有限公司 Webpage automatic test system and method thereof
CN109902016A (en) * 2019-03-04 2019-06-18 网易(杭州)网络有限公司 A kind of test method and test platform of Web
CN110377500A (en) * 2019-06-14 2019-10-25 平安科技(深圳)有限公司 Test method, device, terminal device and the medium of Website page

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
张硕,陈苏红,梁洁编者: "软件测试实用案例教程", 31 January 2020, 华中科技大学出版社, pages: 1 *
拿我格子衫来: "浏览器知识 主要组件, dom渲染过程", pages 1, Retrieved from the Internet <URL:https://blog.csdn.net/github_35631540/article/details/103871914> *
松鼠陛下: "javaScript——console 对象与控制台", pages 1, Retrieved from the Internet <URL:https://blog.csdn.net/songshuguowang/article/details/86713806?> *
王志强编著: "Delphi 7开发实例完全剖析", 28 February 2006, 中国电力出版社, pages: 1 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112765040A (en) * 2021-02-04 2021-05-07 深圳市捷视飞通科技股份有限公司 Page testing method, system, computer equipment and storage medium
CN112765040B (en) * 2021-02-04 2024-01-26 深圳市捷视飞通科技股份有限公司 Page test method, system, computer equipment and storage medium
CN113141283A (en) * 2021-06-22 2021-07-20 中国电子信息产业集团有限公司第六研究所 Network flow simulation test method, system and environment construction method
CN113141283B (en) * 2021-06-22 2021-08-17 中国电子信息产业集团有限公司第六研究所 Network flow simulation test method, system and environment construction method
CN113722229A (en) * 2021-09-06 2021-11-30 挂号网(杭州)科技有限公司 Software testing method and device, electronic equipment and storage medium
CN114238048A (en) * 2021-11-25 2022-03-25 广州市玄武无线科技股份有限公司 Automatic testing method and system for Web front-end performance
CN114238048B (en) * 2021-11-25 2022-08-23 广州市玄武无线科技股份有限公司 Automatic testing method and system for Web front-end performance
CN116070214A (en) * 2022-08-30 2023-05-05 荣耀终端有限公司 Safety testing method and electronic equipment
CN116070214B (en) * 2022-08-30 2024-04-02 荣耀终端有限公司 Safety testing method and electronic equipment

Similar Documents

Publication Publication Date Title
CN112231213A (en) Web automatic testing method, system, storage medium and terminal equipment
US11561887B2 (en) Test script debugging using an automated testing framework and UI rendering tree
US8621435B2 (en) Time debugging
US7526681B2 (en) Software testing framework
AU2017258963A1 (en) Simultaneous multi-platform testing
Chen et al. RIPPLES: tool for change in legacy software
US20120124495A1 (en) System and method for object relationship identification in a user interface
Joorabchi et al. Detecting inconsistencies in multi-platform mobile apps
CN101046767A (en) Method and system for automated testing of a graphic-based programming tool
KR20060079080A (en) Methods and apparatus for evaluating aspects of a web page
CN111061526A (en) Automatic testing method and device, computer equipment and storage medium
Grechanik et al. Creating GUI testing tools using accessibility technologies
US20200327043A1 (en) System and a method for automated script generation for application testing
Amalfitano et al. The DynaRIA tool for the comprehension of Ajax web applications by dynamic analysis
Li et al. ADAutomation: An activity diagram based automated GUI testing framework for smartphone applications
CN116841865A (en) Visual test method and device, electronic equipment and storage medium
CN115658529A (en) Automatic testing method for user page and related equipment
EP2105837A2 (en) Test script transformation analyzer with change guide engine
Marchetto et al. Crawlability metrics for automated web testing
US10083108B1 (en) Automated stack-based computerized application crawler
Yandrapally et al. Mutation analysis for assessing end-to-end web tests
Schmid et al. A survey of simulation tools for requirements engineering
Oliveira pytest Quick Start Guide: Write better Python code with simple and maintainable tests
CN113220586A (en) Automatic interface pressure test execution method, device and system
Zhyhulin et al. Combined method of prioritization and automation of software regression testing

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