CN111737152B - Method and device for realizing WEB automatic test by inputting data through webpage - Google Patents

Method and device for realizing WEB automatic test by inputting data through webpage Download PDF

Info

Publication number
CN111737152B
CN111737152B CN202010740552.1A CN202010740552A CN111737152B CN 111737152 B CN111737152 B CN 111737152B CN 202010740552 A CN202010740552 A CN 202010740552A CN 111737152 B CN111737152 B CN 111737152B
Authority
CN
China
Prior art keywords
data
test
verification
tested
selenium
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.)
Active
Application number
CN202010740552.1A
Other languages
Chinese (zh)
Other versions
CN111737152A (en
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.)
National University of Defense Technology
Original Assignee
National University of Defense Technology
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 National University of Defense Technology filed Critical National University of Defense Technology
Priority to CN202010740552.1A priority Critical patent/CN111737152B/en
Publication of CN111737152A publication Critical patent/CN111737152A/en
Application granted granted Critical
Publication of CN111737152B publication Critical patent/CN111737152B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/3684Test management for test design, e.g. generating new test cases
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a method and a device for realizing WEB automatic test by inputting data through a webpage, wherein the method comprises the following steps: configuring a selenium frame and an actuator in a server; inputting key data of each testing step of the automatic test case through a graphic interface, wherein the key data comprises control data, element data and verification data, and storing the key data in a database end; sending an execution command through a graphic interface, calling a selenium frame by an actuator in the server to drive a web page to be tested to load the key data so as to execute an automatic test, and verifying by using the loaded verification data; and checking the checking result through a graphical interface page. According to the scheme of the invention, the input of the user is transferred into the function and the input parameter of the automation frame, so that the software test automation realized by the traditional coding mode is realized by a web input mode.

Description

Method and device for realizing WEB automatic test by inputting data through webpage
Technical Field
The invention relates to the technical field of software testing automation, in particular to a method and a device for realizing WEB automation testing through webpage input data.
Background
With the continuous development of modern society informatization, various software products appear in a blowout mode in order to meet the requirements of people on work and life. Meanwhile, in order to meet different differentiated and personalized requirements, software becomes more and more complex. In order to deal with more and more complex software applications and ensure the reliability of the software, a large number of software testers pay hard labor. In the software testing process, a great deal of repeated labor exists, and various automatic software testing technologies realized in a programming mode are generated in the background. The realization of the automatic test requires that software testers in a project group use the same programming language to realize the test work of modules of respective test software in an automatic execution code mode so as to replace manual page operation. After the tester realizes the automatic code, the automatic code can be repeatedly executed for many times, so that the effect of avoiding repeated labor is realized.
The WEB software testing automation solves the defect of repeated labor in the testing process of part of software, but also has the following problems: 1. automation requires the tester to have access to programming capabilities, but the proportion of test practitioners that can be programmed is currently not high. 2. In order to facilitate the management of the automatic test case codes, the automatic test cases are generally required to be written in the same programming language in the project, and the programming quality of a test group is a more severe requirement. 3. The automatic use cases exist in a code mode, and the code styles of different testers may be quite different, so that the examination of the use cases is inconvenient. 4. The use cases are stored in the local places of the testers, so that cooperation development is inconvenient, and reuse of the use cases among the testers is inconvenient.
Disclosure of Invention
In order to solve the technical problems, the invention provides a method and a device for realizing WEB automatic testing by inputting data through a webpage, wherein the method and the device are used for solving the problem that in the prior art, automation needs testers to master programming capability, but the proportion of programming among current testing workers is not high; the automatic use cases exist in a code mode, and the code styles of different testers are possibly quite different, so that the examination of the use cases is inconvenient; the use cases are stored in the local of the testers, so that cooperation development is inconvenient, and the reuse of the use cases among the testers is inconvenient.
According to a first aspect of the present invention, there is provided a method for implementing WEB automation test by entering data into a WEB page, the method comprising the following steps:
step S101: configuring a selenium frame and an actuator in a server, wherein the actuator internally stores three mapping tables, namely a page controller mapping table, an element locator mapping table and an element controller mapping table, and is used for mapping use case data stored in a database into a function called by the selenium frame and a parameter corresponding to the function;
step S102: inputting key data of each testing step of the automatic test case through a graphic interface, wherein the key data comprises control data, element data and verification data, and storing the key data in a database end; the graphical interface and the web page to be tested are configured on different terminals;
step S103: sending an execution command through a graphic interface, calling a selenium frame by an actuator in the server to drive a web page to be tested to load the key data so as to execute an automatic test, and verifying by using the loaded verification data;
step S104: and checking the checking result through a graphical interface page.
Further, the step S102: inputting key data of each testing step of an automatic test case through a graphic interface, wherein the key data comprises control data, element data and verification data, and storing the key data in a database end, and the method comprises the following steps:
dividing a test case into a plurality of test steps, inputting control data, element data and verification data required by each test step through a graphic interface, wherein the graphic interface is an HTML webpage, and storing the control data, the element data and the verification data in a database through an HTTP (hyper text transport protocol); the control data comprise operation behaviors and operation values of the web page to be tested, the element data comprise positioning modes and positioning strings of the object to be tested in the web page to be tested, the verification data comprise verification modes and verification values, and the object to be tested in the web page to be tested is verified through the verification data after being operated according to the operation behaviors and the operation values.
Further, the step S103: sending an execution command through a graphic interface, calling a selenium frame by an executor in the server to drive a web page to be tested to load the key data so as to execute an automatic test, and verifying by using the loaded verification data, wherein the method comprises the following steps:
step S1031: sending a test case execution command through a graphic interface, acquiring key data of each test step corresponding to the test case from a database end by a server, and transmitting the key data into an actuator; the executor takes the first test step to be executed as the current test step;
step S1032: the method comprises the steps that an executor acquires operation data and element data of a current testing step, wherein the operation data comprises operation behaviors and operation values of a web page to be tested; selecting an entry page controller or an element controller according to the operation data: if the operation behavior in the operation data belongs to the page controller mapping table, entering the page controller, acquiring an operation value, inquiring the page controller mapping table, calling a corresponding function in the selenium, controlling the operation value in the corresponding function in the selenium page, and executing the function; if the operation behavior in the operation data belongs to the element controller mapping table, entering the element controller, inquiring the element locator mapping table, calling a selenium function corresponding to the element data, acquiring an element instance returned by the selenium function, inquiring the element controller mapping table, calling an element control function corresponding to the selenium, and transmitting the element instance and the operation value into the element controller mapping table and executing the element instance and the operation value;
step S1033: the method comprises the steps that an executor obtains verification data of a current testing step, a selenium function is called to obtain an actual operation value for operating the testing step from a web page to be tested, the verification data and the actual operation value are transmitted into a verifier to be verified, a verification result is output, and the verification result is stored in a database end;
step S1034: judging whether to execute the complete testing step, if so, ending the method; if not, the next step to be tested is taken as the current testing step, and the process goes to step S1032.
Further, after step S104, according to the verification result, the test case of the web page is modified and copied through the graphical interface.
According to a second aspect of the present invention, there is provided an apparatus for implementing WEB automation test by entering data through a selenium webpage, the apparatus comprising:
a configuration module: configuring a selenium frame and an actuator in a server, wherein the actuator internally stores three mapping tables, namely a page controller mapping table, an element locator mapping table and an element controller mapping table, and is used for mapping use case data stored in a database into a function called by the selenium frame and a parameter corresponding to the function;
a logging module: inputting key data of each testing step of the automatic test case through a graphic interface, wherein the key data comprises control data, element data and verification data, and storing the key data in a database end; the graphical interface and the web page to be tested are configured on different terminals;
a test module: sending an execution command through a graphic interface, calling a selenium frame by an actuator in the server to drive a web page to be tested to load the key data so as to execute an automatic test, and verifying by using the loaded verification data;
a result checking module: and checking the checking result through a graphical interface page.
Further, the logging module includes:
the input submodule is used for dividing the test case into a plurality of test steps, inputting control data, element data and verification data required by each test step through a graphical interface, wherein the graphical interface is an HTML webpage, and storing the control data, the element data and the verification data in a database through an HTTP (hyper text transport protocol); the control data comprise operation behaviors and operation values of the web page to be tested, the element data comprise positioning modes and positioning strings of the object to be tested in the web page to be tested, the verification data comprise verification modes and verification values, and the object to be tested in the web page to be tested is verified through the verification data after being operated according to the operation behaviors and the operation values.
Further, the test module includes:
the test command generation submodule comprises: sending a test case execution command through a graphic interface, acquiring key data of each test step corresponding to the test case from a database end by a server, and transmitting the key data into an actuator; the executor takes the first test step to be executed as the current test step;
testing the submodule: the method comprises the steps that an executor acquires operation data and element data of a current testing step, wherein the operation data comprises operation behaviors and operation values of a web page to be tested; selecting an entry page controller or an element controller according to the operation data: if the operation behavior in the operation data belongs to the page controller mapping table, entering the page controller, acquiring an operation value, inquiring the page controller mapping table, calling a corresponding function in the selenium, controlling the operation value in the corresponding function in the selenium page, and executing the function; if the operation behavior in the operation data belongs to the element controller mapping table, entering the element controller, inquiring the element locator mapping table, calling a selenium function corresponding to the element data, acquiring an element instance returned by the selenium function, inquiring the element controller mapping table, calling an element control function corresponding to the selenium, and transmitting the element instance and the operation value into the element controller mapping table and executing the element instance and the operation value;
a checking submodule: the method comprises the steps that an executor obtains verification data of a current testing step, a selenium function is called to obtain an actual operation value for operating the testing step from a web page to be tested, the verification data and the actual operation value are transmitted into a verifier to be verified, a verification result is output, and the verification result is stored in a database end;
a judgment submodule: it is determined whether a full partial test procedure is performed.
Furthermore, the device for realizing the WEB automatic test by inputting data through the webpage comprises a modification and replication sub-module which is used for modifying and replicating the test case of the WEB webpage through a graphical interface according to the verification result.
According to a third aspect of the present invention, there is provided a system for implementing WEB automation test by entering data through a WEB page, including:
a processor for executing a plurality of instructions;
a memory to store a plurality of instructions;
the instructions are used for being stored by the memory, and being loaded and executed by the processor, so that the method for realizing WEB automation test through webpage input data is realized.
According to a fourth aspect of the present invention, there is provided a computer readable storage medium having a plurality of instructions stored therein; the instructions are used for loading and executing the method for realizing the WEB automation test through the webpage input data by the processor.
According to the scheme of the invention, the web page interface is provided for the user, the input of the user is transferred into the function and the input parameter of the automation frame, the software test automation realized by the traditional coding mode is realized in a web input mode, coding is not required, the development threshold of the automatic test case is greatly reduced, the coding process of the development of the automatic test case is simplified into a page data input process, each step of the case is digitalized, the content originally coupled in the code is decoupled into parameterized data which is stored in a data warehouse, the reference, the copy and the batch copy of the case are convenient, and the development efficiency is greatly improved. The automatic test cases are divided into individual execution steps, so that error checking and positioning are facilitated. The use cases are made to be platform, and the use cases can be developed and examined quickly.
The foregoing description is only an overview of the technical solutions of the present invention, and in order to make the technical solutions of the present invention more clearly understood and to implement them in accordance with the contents of the description, the following detailed description is given with reference to the preferred embodiments of the present invention and the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention. In the drawings:
FIG. 1 is a flowchart of a method for implementing WEB automation testing by entering data through a webpage according to an embodiment of the present invention;
FIG. 2 is a diagram of a system architecture for implementing WEB automation testing according to an embodiment of the present invention;
FIG. 3 is a diagram of component association for one embodiment of the present invention;
FIG. 4 is a schematic diagram of logging operation information according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of entry element information according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of logging verification information according to an embodiment of the present invention;
FIG. 7 is a diagram illustrating a page controller mapping table according to an embodiment of the present invention;
FIG. 8 is a diagram illustrating an element locator mapping table according to an embodiment of the present invention;
FIG. 9 is a diagram illustrating an element controller mapping table according to an embodiment of the present invention;
fig. 10 is a block diagram of an apparatus for implementing WEB automation test by entering data through a WEB page according to an embodiment of the present invention.
Description of reference numerals:
1: a user graphical interface; 2: a system server; 3: a database server.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the specific embodiments of the present invention and the accompanying drawings. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. 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.
First, a flowchart of a method for implementing WEB automation test according to an embodiment of the present invention is described with reference to fig. 1, and fig. 2 shows a system architecture diagram for implementing WEB automation test according to an embodiment of the present invention. As shown in fig. 1-2, the method comprises the steps of:
step S101: configuring a selenium frame and an actuator in a server, wherein the actuator internally stores three mapping tables, namely a page controller mapping table, an element locator mapping table and an element controller mapping table, and is used for mapping use case data stored in a database into a function called by the selenium frame and a parameter corresponding to the function;
step S102: inputting key data of each testing step of the automatic test case through a graphic interface, wherein the key data comprises control data, element data and verification data, and storing the key data in a database end; the graphical interface and the web page to be tested are configured on different terminals;
step S103: sending an execution command through a graphic interface, calling a selenium frame by an actuator in the server to drive a web page to be tested to load the key data so as to execute an automatic test, and verifying by using the loaded verification data;
step S104: and checking the checking result through a graphical interface page.
The step S102: inputting key data of each testing step of an automatic test case through a graphic interface, wherein the key data comprises control data, element data and verification data, and storing the key data in a database end, and the method comprises the following steps:
dividing a test case into a plurality of test steps, inputting control data, element data and verification data required by each test step through a graphic interface, wherein the graphic interface is an HTML webpage, and storing the control data, the element data and the verification data in a database through an HTTP (hyper text transport protocol); the control data comprise operation behaviors and operation values of the web page to be tested, the element data comprise positioning modes and positioning strings of the object to be tested in the web page to be tested, the verification data comprise verification modes and verification values, and the object to be tested in the web page to be tested is verified through the verification data after being operated according to the operation behaviors and the operation values.
The step S103: sending an execution command through a graphic interface, calling a selenium frame by an executor in the server to drive a web page to be tested to load the key data so as to execute an automatic test, and verifying by using the loaded verification data, wherein the method comprises the following steps:
step S1031: sending a test case execution command through a graphic interface, acquiring key data of each test step corresponding to the test case from a database end by a server, and transmitting the key data into an actuator; the executor takes the first test step to be executed as the current test step;
step S1032: the method comprises the steps that an executor acquires operation data and element data of a current testing step, wherein the operation data comprises operation behaviors and operation values of a web page to be tested; selecting an entry page controller or an element controller according to the operation data: if the operation behavior in the operation data belongs to the page controller mapping table, entering the page controller, acquiring an operation value, inquiring the page controller mapping table, calling a corresponding function in the selenium, controlling the operation value in the corresponding function in the selenium page, and executing the function; if the operation behavior in the operation data belongs to the element controller mapping table, entering the element controller, inquiring the element locator mapping table, calling a selenium function corresponding to the element data, acquiring an element instance returned by the selenium function, inquiring the element controller mapping table, calling an element control function corresponding to the selenium, and transmitting the element instance and the operation value into the element controller mapping table and executing the element instance and the operation value;
step S1033: the method comprises the steps that an executor obtains verification data of a current testing step, a selenium function is called to obtain an actual operation value for operating the testing step from a web page to be tested, the verification data and the actual operation value are transmitted into a verifier to be verified, a verification result is output, and the verification result is stored in a database end;
step S1034: judging whether to execute the complete testing step, if so, ending the method; if not, the next step to be tested is taken as the current testing step, and the process goes to step S1032.
The server can insert, modify and request data to the database end, the web page to be tested executes automatic test, when the case is called, the executor of the server analyzes the data, and maps the data required when the case is executed.
The database end is used for storing data required by each test step input through the graphical interface and providing the data to the server when a test case is executed; storing results of execution of each test step of the test case; and commands such as the order of each step of the sent adjustment test case, the copy test case and the like can be received, and the flexible adjustment and multiplexing of the test case are realized.
In this embodiment, the association relationship among the graphical user interface 1, the server 2, and the database 3 is shown in fig. 3.
Further, in step S104, the present embodiment: and after checking the verification result, modifying and copying the test case of the web page through the graphical interface according to the verification result.
The entry operation information, the entry element information, the entry verification information, the page controller mapping table, the element locator mapping table, and the element controller mapping table in this embodiment refer to fig. 4 to 9, respectively.
Yet another embodiment illustrates a specific application of the present invention.
The tester divides the test case corresponding to a test scene into a plurality of test steps according to the actual situation, and inputs the data required by each test step one by one in the graphic interface. Taking a user login scenario as an example, in the first step, a user name needs to be input in a login page user name input box, and data that the user needs to enter is as follows:
the operation data comprises an operation method and an operation value, wherein the operation method is sendKeys, namely, the data is input into the input box; the operation value is admin, namely the login user name of the tested system.
The element data includes: the user name input box is positioned in a mode of id, namely the element is searched and positioned through the id of the html element; the username input box locates the string username, i.e. the id of the username input box in the html of the login page in the system is assumed to be username.
The verifying the data includes: checking, namely judging whether the actual value and the expected value are equal or not; the expected value is admin.
And (4) inputting all steps of a complete test case by a user, and storing all data into a database end. When the use case is executed, the server sequentially takes out data of the test steps from the database end and calls the actuator, the actuator firstly calls the element according to the mapping table to obtain the function initialization element, and for example, according to the positioning mode id and the positioning string username, the actuator calls the selenium to obtain the element function to position the element function to the user name input box on the login page of the system to be tested. And then according to the operation mode field sendKeys, calling sendKeys (value) function of selenium through a mapping table to operate the browser to input an operation value admin to a user name input box of the login page. And then the executor acquires an actual text from the login page user name input box as admin, acquires a verification mode from the database as equals, verifies that the expected value is admin, compares that the actual value is equal to the expected value, passes the verification, and writes the verification result true into the database. The tester can check the execution result of each step of the test scene in real time through the user graphic interface.
An embodiment of the present invention further provides a device for implementing an automatic WEB test by entering data through a WEB page, and as shown in fig. 10, the device includes:
a configuration module: configuring a selenium frame and an actuator in a server, wherein the actuator internally stores three mapping tables, namely a page controller mapping table, an element locator mapping table and an element controller mapping table, and is used for mapping use case data stored in a database into a function called by the selenium frame and a parameter corresponding to the function;
a logging module: inputting key data of each testing step of the automatic test case through a graphic interface, wherein the key data comprises control data, element data and verification data, and storing the key data in a database end; the graphical interface and the web page to be tested are configured on different terminals;
a test module: sending an execution command through a graphic interface, calling a selenium frame by an actuator in the server to drive a web page to be tested to load the key data so as to execute an automatic test, and verifying by using the loaded verification data;
a result checking module: and checking the checking result through a graphical interface page.
The embodiment of the invention further provides a system for realizing WEB automatic test by inputting data through a webpage, which comprises the following steps:
a processor for executing a plurality of instructions;
a memory to store a plurality of instructions;
the instructions are used for being stored by the memory, and being loaded and executed by the processor, so that the method for realizing WEB automation test through webpage input data is realized.
The embodiment of the invention further provides a computer readable storage medium, wherein a plurality of instructions are stored in the storage medium; the instructions are used for loading and executing the method for realizing the WEB automation test through the webpage input data by the processor.
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict.
In the embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions in actual implementation, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a physical machine Server, or a network cloud Server, etc., and needs to install a Windows or Windows Server operating system) to perform some steps of the method according to various embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the present invention in any way, and any simple modification, equivalent change and modification made to the above embodiment according to the technical spirit of the present invention are still within the scope of the technical solution of the present invention.

Claims (6)

1. A method for realizing WEB automatic test by inputting data through a webpage is characterized by comprising the following steps:
step S101: configuring a selenium frame and an actuator in a server, wherein the actuator internally stores three mapping tables, namely a page controller mapping table, an element locator mapping table and an element controller mapping table, and is used for mapping use case data stored in a database into a function called by the selenium frame and a parameter corresponding to the function;
step S102: inputting key data of each testing step of the automatic test case through a graphic interface, wherein the key data comprises control data, element data and verification data, and storing the key data in a database end; the graphical interface and the web page to be tested are configured on different terminals;
step S103: sending an execution command through a graphic interface, calling a selenium frame by an actuator in the server to drive a web page to be tested to load the key data so as to execute an automatic test, and verifying by using the loaded verification data;
step S104: checking a checking result through a graphical interface page;
the step S102: inputting key data of each testing step of an automatic test case through a graphic interface, wherein the key data comprises control data, element data and verification data, and storing the key data in a database end, and the method comprises the following steps:
dividing a test case into a plurality of test steps, inputting control data, element data and verification data required by each test step through a graphic interface, wherein the graphic interface is an HTML webpage, and storing the control data, the element data and the verification data in a database through an HTTP (hyper text transport protocol); the control data comprise operation behaviors and operation values of the web page to be tested, the element data comprise a positioning mode and a positioning string of an object to be tested in the web page to be tested, the verification data comprise a verification mode and a verification value, and the object to be tested in the web page to be tested is verified through the verification data after being operated according to the operation behaviors and the operation values; the step S103: sending an execution command through a graphic interface, calling a selenium frame by an executor in the server to drive a web page to be tested to load the key data so as to execute an automatic test, and verifying by using the loaded verification data, wherein the method comprises the following steps:
step S1031: sending a test case execution command through a graphic interface, acquiring key data of each test step corresponding to the test case from a database end by a server, and transmitting the key data into an actuator; the executor takes the first test step to be executed as the current test step;
step S1032: the method comprises the steps that an executor acquires operation data and element data of a current testing step, wherein the operation data comprises operation behaviors and operation values of a web page to be tested; selecting an entry page controller or an element controller according to the operation data: if the operation behavior in the operation data belongs to the page controller mapping table, entering the page controller, acquiring an operation value, inquiring the page controller mapping table, calling a corresponding function in the selenium, controlling the operation value in the corresponding function in the selenium page, and executing the function; if the operation behavior in the operation data belongs to the element controller mapping table, entering the element controller, inquiring the element locator mapping table, calling a selenium function corresponding to the element data, acquiring an element instance returned by the selenium function, inquiring the element controller mapping table, calling an element control function corresponding to the selenium, and transmitting the element instance and the operation value into the element controller mapping table and executing the element instance and the operation value;
step S1033: the method comprises the steps that an executor obtains verification data of a current testing step, a selenium function is called to obtain an actual operation value for operating the testing step from a web page to be tested, the verification data and the actual operation value are transmitted into a verifier to be verified, a verification result is output, and the verification result is stored in a database end;
step S1034: judging whether to execute the complete testing step, if so, ending the method; if not, the next step to be tested is taken as the current testing step, and the process goes to step S1032.
2. The method for realizing WEB automation test through webpage entry data according to claim 1, wherein after the step S104, the test cases of the WEB webpage are modified and copied through a graphical interface according to the verification result.
3. An apparatus for implementing WEB automation test by inputting data through a WEB page, the apparatus comprising:
a configuration module: configuring a selenium frame and an actuator in a server, wherein the actuator internally stores three mapping tables, namely a page controller mapping table, an element locator mapping table and an element controller mapping table, and is used for mapping use case data stored in a database into a function called by the selenium frame and a parameter corresponding to the function;
a logging module: inputting key data of each testing step of the automatic test case through a graphic interface, wherein the key data comprises control data, element data and verification data, and storing the key data in a database end; the graphical interface and the web page to be tested are configured on different terminals;
a test module: sending an execution command through a graphic interface, calling a selenium frame by an actuator in the server to drive a web page to be tested to load the key data so as to execute an automatic test, and verifying by using the loaded verification data;
a result checking module: checking a checking result through a graphical interface page;
the logging module comprises:
the input submodule is used for dividing the test case into a plurality of test steps, inputting control data, element data and verification data required by each test step through a graphical interface, wherein the graphical interface is an HTML webpage, and storing the control data, the element data and the verification data in a database through an HTTP (hyper text transport protocol); the control data comprise operation behaviors and operation values of the web page to be tested, the element data comprise a positioning mode and a positioning string of an object to be tested in the web page to be tested, the verification data comprise a verification mode and a verification value, and the object to be tested in the web page to be tested is verified through the verification data after being operated according to the operation behaviors and the operation values;
the test module comprises:
the test command generation submodule comprises: sending a test case execution command through a graphic interface, acquiring key data of each test step corresponding to the test case from a database end by a server, and transmitting the key data into an actuator; the executor takes the first test step to be executed as the current test step;
testing the submodule: the method comprises the steps that an executor acquires operation data and element data of a current testing step, wherein the operation data comprises operation behaviors and operation values of a web page to be tested; selecting an entry page controller or an element controller according to the operation data: if the operation behavior in the operation data belongs to the page controller mapping table, entering the page controller, acquiring an operation value, inquiring the page controller mapping table, calling a corresponding function in the selenium, controlling the operation value in the corresponding function in the selenium page, and executing the function; if the operation behavior in the operation data belongs to the element controller mapping table, entering the element controller, inquiring the element locator mapping table, calling a selenium function corresponding to the element data, acquiring an element instance returned by the selenium function, inquiring the element controller mapping table, calling an element control function corresponding to the selenium, and transmitting the element instance and the operation value into the element controller mapping table and executing the element instance and the operation value; a checking submodule: the method comprises the steps that an executor obtains verification data of a current testing step, a selenium function is called to obtain an actual operation value for operating the testing step from a web page to be tested, the verification data and the actual operation value are transmitted into a verifier to be verified, a verification result is output, and the verification result is stored in a database end;
a judgment submodule: it is determined whether a full partial test procedure is performed.
4. The apparatus for implementing WEB automation test through webpage entry data according to claim 3, wherein the apparatus for implementing WEB automation test through webpage entry data comprises a modification and replication sub-module, which is used for modifying and replicating the test cases of the WEB webpage through a graphical interface according to the verification result.
5. A system for realizing WEB automatic test by inputting data through a webpage is characterized by comprising:
a processor for executing a plurality of instructions;
a memory to store a plurality of instructions;
wherein the instructions are stored by the memory and loaded and executed by the processor in a manner as recited in any of claims 1-2 for implementing WEB automated testing by WEB page entry data.
6. A computer-readable storage medium having stored therein a plurality of instructions; the instructions for loading and executing by a processor the method for WEB automated testing via WEB page entered data as claimed in any of claims 1-2.
CN202010740552.1A 2020-07-29 2020-07-29 Method and device for realizing WEB automatic test by inputting data through webpage Active CN111737152B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010740552.1A CN111737152B (en) 2020-07-29 2020-07-29 Method and device for realizing WEB automatic test by inputting data through webpage

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010740552.1A CN111737152B (en) 2020-07-29 2020-07-29 Method and device for realizing WEB automatic test by inputting data through webpage

Publications (2)

Publication Number Publication Date
CN111737152A CN111737152A (en) 2020-10-02
CN111737152B true CN111737152B (en) 2020-11-20

Family

ID=72656356

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010740552.1A Active CN111737152B (en) 2020-07-29 2020-07-29 Method and device for realizing WEB automatic test by inputting data through webpage

Country Status (1)

Country Link
CN (1) CN111737152B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113239298A (en) * 2021-06-18 2021-08-10 北京邮电大学 Automatic capturing and inputting method and device for automatic test elements
CN113656319A (en) * 2021-08-25 2021-11-16 广东三维家信息科技有限公司 Regression testing method and device, electronic equipment and storage medium
CN114064482A (en) * 2021-11-17 2022-02-18 北京金堤科技有限公司 Visual testing method and device, computer storage medium and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109992496A (en) * 2017-12-29 2019-07-09 北京京东尚科信息技术有限公司 A kind of data processing method and device for automatic test
CN111209217A (en) * 2020-03-12 2020-05-29 苏州浪潮智能科技有限公司 System software function testing method, device, equipment and storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6993748B2 (en) * 2001-10-26 2006-01-31 Capital One Financial Corporation Systems and methods for table driven automation testing of software programs
US9575873B2 (en) * 2013-09-13 2017-02-21 Sap Se Software testing system and method
CN104820640B (en) * 2015-05-19 2018-07-24 广州华多网络科技有限公司 A kind of webpage test method and device
CN106598869A (en) * 2016-12-26 2017-04-26 北京京东金融科技控股有限公司 Method and device for realizing automatic software testing and electronic equipment
CN107783902A (en) * 2017-09-26 2018-03-09 甘肃万维信息技术有限责任公司 A kind of Selenium automated testing methods and system from coding
CN109726112A (en) * 2018-08-17 2019-05-07 平安普惠企业管理有限公司 Traverse test method, unit and computer readable storage medium
CN110908895A (en) * 2019-10-11 2020-03-24 深圳壹账通智能科技有限公司 Page automatic testing method and device, computer equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109992496A (en) * 2017-12-29 2019-07-09 北京京东尚科信息技术有限公司 A kind of data processing method and device for automatic test
CN111209217A (en) * 2020-03-12 2020-05-29 苏州浪潮智能科技有限公司 System software function testing method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN111737152A (en) 2020-10-02

Similar Documents

Publication Publication Date Title
CN111737152B (en) Method and device for realizing WEB automatic test by inputting data through webpage
US20210279577A1 (en) Testing of Computing Processes Using Artificial Intelligence
CN110221975B (en) Method and device for creating interface case automation test script
CN109933521A (en) Automated testing method, device, computer equipment and storage medium based on BDD
CN106550038B (en) Data configuration diagnosis system and method of digital control system
CN109977012B (en) Joint debugging test method, device, equipment and computer readable storage medium of system
CN112799782B (en) Model generation system, method, electronic device and storage medium
CN115658529A (en) Automatic testing method for user page and related equipment
CN112181854A (en) Method, device, equipment and storage medium for generating flow automation script
CN111966580A (en) Automatic testing method, device, equipment and storage medium based on artificial intelligence
CN107357721B (en) Method and device for testing system
CN115617780A (en) Data import method, device, equipment and storage medium
CN114237754B (en) Data loading method and device, electronic equipment and storage medium
CN117370217B (en) Automatic interface test result generation method based on python
CN114328250A (en) Automatic self-checking method, medium and device for software system
CN113094251B (en) Method and device for testing embedded system, computer equipment and storage medium
CN114443039A (en) Input parameter verification method and device, electronic equipment and storage medium
CN111767218A (en) Automatic testing method, equipment and storage medium for continuous integration
CN116719735A (en) Test case generation method and device
KR20120111618A (en) Apparatus and method for testing plc command
CN115934559A (en) Testing method of intelligent form testing system
CN109621406A (en) A kind of generation method and device of configuration file
CN115599683A (en) Automatic testing method, device, equipment and storage medium
WO2019187263A1 (en) Information processing device, test management method, and non-transitory computer-readable medium in which program is stored
CN109669868A (en) The method and system of software test

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
GR01 Patent grant
GR01 Patent grant