CN112231229A - Web UI (user interface) automatic testing method and system, electronic equipment and readable storage medium - Google Patents

Web UI (user interface) automatic testing method and system, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN112231229A
CN112231229A CN202011239254.0A CN202011239254A CN112231229A CN 112231229 A CN112231229 A CN 112231229A CN 202011239254 A CN202011239254 A CN 202011239254A CN 112231229 A CN112231229 A CN 112231229A
Authority
CN
China
Prior art keywords
test case
test
information
module
list
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.)
Granted
Application number
CN202011239254.0A
Other languages
Chinese (zh)
Other versions
CN112231229B (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.)
Enyike Beijing Data Technology Co ltd
Original Assignee
Enyike Beijing Data 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 Enyike Beijing Data Technology Co ltd filed Critical Enyike Beijing Data Technology Co ltd
Priority to CN202011239254.0A priority Critical patent/CN112231229B/en
Priority claimed from CN202011239254.0A external-priority patent/CN112231229B/en
Publication of CN112231229A publication Critical patent/CN112231229A/en
Application granted granted Critical
Publication of CN112231229B publication Critical patent/CN112231229B/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
    • 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

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 discloses a Web UI automatic test method, a system, electronic equipment and a readable storage medium, wherein the Web UI automatic test method comprises the following steps: a configuration information acquisition step: acquiring a module list of a module to be tested, and acquiring configuration information of the module to be tested according to the module list; UI test case obtaining step: after the number of test cases contained in a module to be tested is obtained according to the configuration information, the execution step information of each test case is read, and UI test cases are obtained according to the execution step information; the execution steps are as follows: and carrying out Web UI automatic test according to the UI test case and outputting a test result.

Description

Web UI (user interface) automatic testing method and system, electronic equipment and readable storage medium
Technical Field
The present invention relates to UI testing, and in particular, to a method, a system, an electronic device, and a readable storage medium for automatically testing a Web UI.
Background
In the context of system design today, the interaction of WebUI is more and more complex, and the need for this type of UI testing is also growing.
In the conventional UI test mode, a tester needs to basically use manual testing to perform operations on an interface, and also needs to maintain a large amount of test cases and test data. For a formed system, a certain logic rule exists in the UI test of the main business logic, and for the column configuration information of the same type, the similarity of the test cases is very high, and the variation may be the positions of elements.
To cope with frequent new or changed system requirements, testers often spend a lot of manpower on regression test cases, many of which are single repetitive operations. Especially, when the interface of a certain module is adjusted or changed, it often takes a lot of time to return to debug the corresponding test case, and the compact development progress may cause that the related module cannot be sufficiently tested, so that a new defect is discovered after the production environment is on line.
Therefore, it is urgently needed to develop a Web UI automatic testing method, a Web UI automatic testing system, an electronic device and a readable storage medium which overcome the above-mentioned defects.
Disclosure of Invention
In order to solve the above problems, the present invention provides an automated testing method for a Web UI, wherein the automated testing method comprises:
a configuration information acquisition step: acquiring a module list of a module to be tested, and acquiring configuration information of the module to be tested according to the module list;
UI test case obtaining step: after the number of the test cases contained in the module to be tested is obtained according to the configuration information, the execution step information of each test case is read, and UI test cases are obtained according to the execution step information;
the execution steps are as follows: and carrying out Web UI automatic test according to the UI test case and outputting a test result.
In the above automatic test system for Web UI, the execution step information includes a test case name, an element positioning method, an element position, operation information, and step information, and the final test case obtaining step includes:
a calculation step: obtaining the number of test cases contained in the module to be tested according to the configuration information;
a reading step: reading the step information and the operation information corresponding to each step in the step information;
a possible value list obtaining step: reading and positioning the position of each element in the test case according to the element positioning mode and the element position to obtain a possible value list;
in the above automatic test method for a Web UI, the step of outputting the final test case includes:
a judging step: judging the types of the positive test case and the negative test case;
front test case processing steps: when the test case is a front test case, traversing the correct step information under the step according to the name of the front test case and adding the step information to a test step list;
negative test case processing steps: if the test case is a negative test case, judging whether the positive test case is multiplexed, if so, multiplexing step information of a repeated part of the positive test case, generating step information of a residual part of the negative test case, and adding the step information to a test step list; if not, traversing the wrong step information under the step according to the negative test case name and adding the step information to a test step list;
an output step: and finally combining and splicing all the step information of the modules to be tested according to the test step list to output the final test case.
The above automatic test method for Web UI, wherein the executing step includes:
matching: performing element positioning matching according to the possible value list;
normally executing the steps: recording the execution state of the final test case and generating an HTML test report;
an error execution step: screenshot is carried out on the place where the final test case is executed wrongly, and an HTML test report is generated;
a sending step: and sending the HTML test report.
In the above automatic test method for a Web UI, the normal execution step further includes outputting a stack trace in an abnormal state; the error performing step further includes outputting a log of error levels.
The invention also provides a Web UI automatic test system, which comprises:
the configuration information acquisition device is used for acquiring a module list of the module to be tested and acquiring the configuration information of the module to be tested according to the module list;
the UI test case obtaining device is used for reading the execution step information of each test case after obtaining the number of the test cases contained in the module to be tested according to the configuration information, and obtaining the UI test cases according to the execution step information;
and the execution device is used for carrying out Web UI automatic test according to the UI test case and outputting a test result.
In the above-mentioned Web UI automated testing system, the execution step information includes a test case name, an element positioning method, an element position, operation information, and step information, and the final test case obtaining apparatus includes:
the computing unit is used for obtaining the number of test cases contained in the module to be tested according to the configuration information;
the reading unit is used for reading the step information and the operation information corresponding to each step in the step information;
a possible value list obtaining unit for reading and positioning the position of each element in the test case according to the element positioning mode and the element position to obtain a possible value list;
and the UI test case output unit generates a positive test case and/or a negative test case according to the step information and the operation information, and integrates the positive test case and/or the negative test case to obtain the UI test case.
In the above Web UI automated testing system, the final test case output unit includes:
a judging module: judging the types of the positive test case and the negative test case;
the front test case processing module: when the test case is a front test case, traversing the correct step information under the step according to the name of the front test case and adding the step information to a test step list;
the negative test case processing module: if the test case is a negative test case, judging whether the positive test case is multiplexed, if so, multiplexing step information of a repeated part of the positive test case, generating step information of a residual part of the negative test case, and adding the step information to a test step list; if not, traversing the wrong step information under the step according to the negative test case name and adding the step information to a test step list;
an output module: and finally combining and splicing all the step information of the modules to be tested according to the test step list to output the final test case.
The invention also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the computer program to realize the Web UI automation testing method.
The invention also provides a readable storage medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the Web UI automation test method as described in any one of the above.
In summary, compared with the prior art, the invention has the following effects: the method can automatically read each step of the test case and dynamically generate the UI test case, thereby solving the problem that a large amount of regression is needed in the face of frequent iterative system requirements and UI test. Meanwhile, the invention can reduce the repeated operation of the tester and save time. The invention can manage and automatically maintain the UI test cases and help testers who do not write codes to carry out WebUI automatic test.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
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, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a flow chart of a Web UI automated testing method of the present invention;
FIG. 2 is a flowchart illustrating the substeps of step S2 in FIG. 1;
FIG. 3 is a flowchart illustrating the substeps of step S24 in FIG. 2;
FIG. 4 is an element location flow diagram;
FIG. 5 is a flowchart illustrating the application of step S24;
FIG. 6 is a flowchart illustrating the substeps of step S3 in FIG. 1;
FIG. 7 is a flowchart illustrating the application of steps S32, S33 and S34 in FIG. 6;
FIG. 8 is a flowchart illustrating the application of step S31 in FIG. 6;
FIG. 9 is a schematic structural diagram of the Web UI automated test system of the present invention;
fig. 10 is a schematic structural diagram of an electronic device according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, 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 some, but not all, embodiments of the present 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.
The exemplary embodiments of the present invention and the description thereof are provided to explain the present invention and not to limit the present invention. Additionally, the same or similar numbered elements/components used in the drawings and the embodiments are used to represent the same or similar parts.
As used herein, the terms "first", "second", "S1", "S2", …, etc. do not particularly denote an order or sequential meaning, nor are they intended to limit the present invention, but merely distinguish between elements or operations described in the same technical terms.
With respect to directional terminology used herein, for example: up, down, left, right, front or rear, etc., are simply directions with reference to the drawings. Accordingly, the directional terminology used is intended to be illustrative and is not intended to be limiting of the present teachings.
As used herein, the terms "comprising," "including," "having," "containing," and the like are open-ended terms that mean including, but not limited to.
As used herein, "and/or" includes any and all combinations of the described items.
References to "plurality" herein include "two" and "more than two"; reference to "multiple sets" herein includes "two sets" and "more than two sets".
As used herein, the terms "substantially", "about" and the like are used to modify any slight variation in quantity or error that does not alter the nature of the variation. Generally, the range of slight variations or errors modified by such terms may be 20% in some embodiments, 10% in some embodiments, 5% in some embodiments, or other values. It should be understood by those skilled in the art that the aforementioned values can be adjusted according to actual needs, and are not limited thereto.
Certain words used to describe the present application are discussed below or elsewhere in this specification to provide additional guidance to those skilled in the art in describing the present application.
Aiming at the automatic test of WebUI, on the basis of simulating manual operation, a test case is maintained and formed based on the steps of manual operation, a Python language is used and a Selenium frame is combined, the test case is read, the operation of each step is automatically executed according to the maintained test case, repeated labor is reduced, the daily work burden of a tester is relieved, and unnecessary maintenance cost is saved. The input item of the Web UI automatic test is a test case which is well maintained, the operation of each step is read, the operation of different modules is refined into each step, a test case which can be directly executed is generated, and more than 90% of Web UI automatic test scenes are covered. When the configuration information changes, the change information can be read and automatically executed, and only the maintenance test case needs to be manually updated. The following detailed description is made with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a flowchart illustrating a Web UI automation test method according to the present invention. As shown in FIG. 1, the automated testing method for Web UI of the present invention comprises:
configuration information acquisition step S1: acquiring a module list of a module to be tested, and acquiring configuration information of the module to be tested according to the module list;
UI test case obtaining step S2: after the number of the test cases contained in the module to be tested is obtained according to the configuration information, the execution step information of each test case is read, and UI test cases are obtained according to the execution step information;
step S3 is executed: and carrying out Web UI automatic test according to the UI test case and outputting a test result.
Specifically, the method reads UI execution step information maintained by Excel by using Python language, and comprises the test case name, the element positioning mode, the element position, the element operation and the input parameter information. The invention generates a series of UI test cases by logically grouping the test case names according to different element positions and element operations. Therefore, the method can automatically read each step of the test case to dynamically generate the UI test case, specifically, aiming at the module list to be tested, the method reads the configuration information of each module to be tested one by one, calculates the number of the test cases contained in each module to be tested, and generates and executes the test case according to the execution step information configured by each test case. Therefore, the problem that a large amount of regression is needed in the UI test in the face of the system requirement of frequent iteration is solved; meanwhile, the repeated operation of testers can be reduced, the time is saved, UI test cases can be managed and maintained automatically, and the testers who do not write codes can be helped to carry out WebUI automatic test.
Referring to fig. 2, fig. 2 is a flowchart illustrating a sub-step of step S2 in fig. 1. As shown in fig. 2, the final test case obtaining step S2 includes:
calculation step S21: and obtaining the number of test cases contained in the module to be tested according to the configuration information.
Reading step S22: and reading the step information and the operation information corresponding to each step in the step information.
Possible value list obtaining step S23: and reading and positioning the position of each element in the test case according to the element positioning mode and the element position to obtain a possible value list.
UI test case output step S24: generating a positive test case and/or a negative test case according to the step information and the operation information, and integrating the positive test case and/or the negative test case to obtain the UI test case.
Referring to fig. 4, fig. 4 is an element positioning flowchart, as shown in fig. 4, in the possible value list obtaining step S23, taking a positive test case as an example, when the case is generated, it is sequentially determined whether an element has a unique feature and whether a relative position is fixed, for example, an element positioning manner is generated by ID, xpath, selector, classname, linktext, partial link text, and tag, if an element is newly added on an interface, whether the element can still be positioned to the same information, all possible positioning manner ranges of the element are sequentially generated and put into a possible value list for subsequent use, where the logic of a negative test case is the same as that of the positive test case, and thus, the description is omitted here.
Referring to fig. 3 and 5, fig. 3 is a flowchart illustrating steps of step S24 in fig. 2, and fig. 5 is an application flowchart illustrating step S24. As shown in fig. 3 and 5, the final test case outputting step S24 includes:
determination step S241: judging the types of the positive test case and the negative test case;
front test case processing step S242: when the test case is a front test case, traversing the correct step information under the step according to the name of the front test case and adding the step information to a test step list;
negative test case processing step S243: if the test case is a negative test case, judging whether the positive test case is multiplexed, if so, multiplexing step information of a repeated part of the positive test case, generating step information of a residual part of the negative test case, and adding the step information to a test step list; if not, traversing the wrong step information under the step according to the negative test case name and adding the step information to a test step list;
in the embodiment, when the test case is generated, a positive case and a negative case are generated. And when the front use case is generated, obtaining a test step list available for the front use case, and putting the test steps into the test cases one by one. And when the negative cases are generated, obtaining a test step list available for the negative cases, and putting the test steps into the test cases one by one. And finally, combining all the test case information of the splicing module to generate a complete test case list.
Output step S244: and finally combining and splicing all the step information of the modules to be tested according to the test step list and outputting the UI test case.
Referring to fig. 6 and 7, fig. 6 is a flowchart illustrating steps of step S3 in fig. 1, and fig. 7 is a flowchart illustrating application of steps S32, S33 and S34 in fig. 6. As shown in fig. 6 and 7, the executing step S3 includes:
matching step S31: performing element positioning matching according to the possible value list;
step S32 is normally executed: recording the execution state of the final test case and generating an HTML test report;
error execution step S33: screenshot is carried out on the place where the final test case is executed wrongly, and an HTML test report is generated;
transmission step S34: and sending the HTML test report.
The normal execution step further comprises outputting a stack track in an abnormal state; the error performing step further includes outputting a log of error levels.
In the WebUI automation test process, the situation that the element cannot be positioned is often encountered, usually the error information is reported as "no reserve element", and the situation can be started from the following aspects, namely whether the network has delay or not and the whole page is not completely loaded. And secondly, when encountering the structure of the iframe, the element is required to be switched to the iframe. And fourthly, the dynamic id is returned by the page, the element is often not positioned in an automatic positioning mode of the browser, and the element can be replaced by the fullxpath. Referring to fig. 8, fig. 8 is a flowchart illustrating an application of step S31 in fig. 6. As shown in fig. 8, in the matching step S31, the possible value list is first matched, and if the element can be located, the next processing is performed; and if the element cannot be positioned, sequentially performing intelligent waiting, switching to the corresponding iframe, polling handle switching to the corresponding window and xfullpath, and performing the next step if the positioning is successful.
Referring to fig. 9, fig. 9 is a schematic structural diagram of the Web UI automatic test system of the present invention. As shown in fig. 9, the Web UI automation test system of the present invention includes:
a configuration information acquiring device 11 for acquiring a module list of a module to be tested and acquiring configuration information of the module to be tested according to the module list;
the UI test case obtaining device 12 is used for reading the execution step information of each test case after obtaining the number of the test cases contained in the module to be tested according to the configuration information, and obtaining the UI test case according to the execution step information;
and the execution device 13 is used for carrying out Web UI automatic test according to the UI test case and outputting a test result.
The execution step information comprises a test case name, an element positioning mode, an element position, operation information and step information.
Further, the final test case obtaining apparatus 12 includes:
the calculating unit 121 is configured to obtain the number of test cases included in the module to be tested according to the configuration information;
a reading unit 122 configured to read the step information and the operation information corresponding to each step in the step information;
a possible value list obtaining unit 123, configured to read and position the position of each element in the test case according to the element positioning manner and the element position, and obtain a possible value list;
and the UI test case output unit 124 generates a positive test case and/or a negative test case according to the step information and the operation information, and integrates the positive test case and/or the negative test case to obtain the UI test case.
Still further, the final test case output unit 124 includes:
the judging module 1241: judging the types of the positive test case and the negative test case;
front test case processing module 1242: when the test case is a front test case, traversing the correct step information under the step according to the name of the front test case and adding the step information to a test step list;
negative test case processing module 1243: if the test case is a negative test case, judging whether the positive test case is multiplexed, if so, multiplexing step information of a repeated part of the positive test case, generating step information of a residual part of the negative test case, and adding the step information to a test step list; if not, traversing the wrong step information under the step according to the negative test case name and adding the step information to a test step list;
output module 1244: and finally combining and splicing all the step information of the modules to be tested according to the test step list to output the final test case.
Referring to fig. 10, fig. 10 is a schematic structural diagram of an electronic device according to the present invention. As shown in figure 10 of the drawings,
the embodiment discloses a specific implementation mode of an electronic device. The electronic device may include a processor 81 and a memory 82 storing computer program instructions.
Specifically, the processor 81 may include a Central Processing Unit (CPU), or A Specific Integrated Circuit (ASIC), or may be configured to implement one or more Integrated circuits of the embodiments of the present Application.
Memory 82 may include, among other things, mass storage for data or instructions. By way of example, and not limitation, memory 82 may include a Hard Disk Drive (Hard Disk Drive, abbreviated to HDD), a floppy Disk Drive, a Solid State Drive (SSD), flash memory, an optical Disk, a magneto-optical Disk, tape, or a Universal Serial Bus (USB) Drive or a combination of two or more of these. Memory 82 may include removable or non-removable (or fixed) media, where appropriate. The memory 82 may be internal or external to the data processing apparatus, where appropriate. In a particular embodiment, the memory 82 is a Non-Volatile (Non-Volatile) memory. In particular embodiments, Memory 82 includes Read-Only Memory (ROM) and Random Access Memory (RAM). The ROM may be mask-programmed ROM, Programmable ROM (PROM), Erasable PROM (EPROM), Electrically Erasable PROM (EEPROM), Electrically rewritable ROM (EAROM), or FLASH Memory (FLASH), or a combination of two or more of these, where appropriate. The RAM may be a Static Random-Access Memory (SRAM) or a Dynamic Random-Access Memory (DRAM), where the DRAM may be a Fast Page Mode Dynamic Random-Access Memory (FPMDRAM), an Extended data output Dynamic Random-Access Memory (EDODRAM), a Synchronous Dynamic Random-Access Memory (SDRAM), and the like.
The memory 82 may be used to store or cache various data files for processing and/or communication use, as well as possible computer program instructions executed by the processor 81.
The processor 81 implements any of the file system capacity management optimization methods of the above embodiments by reading and executing computer program instructions stored in the memory 82.
In some of these embodiments, the electronic device may also include a communication interface 83 and a bus 80. As shown in fig. 10, the processor 81, the memory 82, and the communication interface 83 are connected via the bus 80 to complete mutual communication.
The communication interface 83 is used for implementing communication between modules, devices, units and/or equipment in the embodiment of the present application. The communication port 83 may also be implemented with other components such as: the data communication is carried out among external equipment, image/data acquisition equipment, a database, external storage, an image/data processing workstation and the like.
The bus 80 includes hardware, software, or both to couple the components of the electronic device to one another. Bus 80 includes, but is not limited to, at least one of the following: data Bus (Data Bus), Address Bus (Address Bus), Control Bus (Control Bus), Expansion Bus (Expansion Bus), and Local Bus (Local Bus). By way of example, and not limitation, Bus 80 may include an Accelerated Graphics Port (AGP) or other Graphics Bus, an Enhanced Industry Standard Architecture (EISA) Bus, a Front-Side Bus (FSB), a Hyper Transport (HT) Interconnect, an ISA (ISA) Bus, an InfiniBand (InfiniBand) Interconnect, a Low Pin Count (LPC) Bus, a memory Bus, a microchannel Architecture (MCA) Bus, a PCI (Peripheral Component Interconnect) Bus, a PCI-Express (PCI-X) Bus, a Serial Advanced Technology Attachment (SATA) Bus, a Video Electronics Bus (audio Electronics Association), abbreviated VLB) bus or other suitable bus or a combination of two or more of these. Bus 80 may include one or more buses, where appropriate. Although specific buses are described and shown in the embodiments of the application, any suitable buses or interconnects are contemplated by the application.
In addition, in combination with the WebUI automation test method in the foregoing embodiment, the embodiment of the present application may provide a computer-readable storage medium to implement. The computer readable storage medium having stored thereon computer program instructions; the computer program instructions, when executed by a processor, implement any of the WebUI automated testing methods of the above embodiments.
In summary, the present invention has the following effects:
1. the tester does not need to manually operate the UI to execute the regression test, the technology can configure UI operation information according to the text, generate all test cases by one key, cover over 90% of UI test scenes, reduce repeated operation of the tester and save time;
2. when the position of the UI element is changed, the tester only needs to update the position information of the test element manually. The tester can read the change information of the test case through the technology and execute the test case according to the latest configuration information;
3. by the technology, testers who cannot write codes can simply realize Web UI automatic testing.
Although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A Web UI automatic test method is characterized by comprising the following steps:
a configuration information acquisition step: acquiring a module list of a module to be tested, and acquiring configuration information of the module to be tested according to the module list;
UI test case obtaining step: after the number of the test cases contained in the module to be tested is obtained according to the configuration information, the execution step information of each test case is read, and UI test cases are obtained according to the execution step information;
the execution steps are as follows: and carrying out Web UI automatic test according to the UI test case and outputting a test result.
2. The Web UI automation test method according to claim 1, wherein the execution step information includes a test case name, an element positioning manner, an element position, operation information, and step information, and the final test case obtaining step includes:
a calculation step: obtaining the number of test cases contained in the module to be tested according to the configuration information;
a reading step: reading the step information and the operation information corresponding to each step in the step information;
a possible value list obtaining step: reading and positioning the position of each element in the test case according to the element positioning mode and the element position to obtain a possible value list;
UI test case output step: generating a positive test case and/or a negative test case according to the step information and the operation information, and integrating the positive test case and/or the negative test case to obtain the UI test case.
3. The Web UI automation test method according to claim 2, wherein the final test case outputting step includes:
a judging step: judging the types of the positive test case and the negative test case;
front test case processing steps: when the test case is a front test case, traversing the correct step information under the step according to the name of the front test case and adding the step information to a test step list;
negative test case processing steps: if the test case is a negative test case, judging whether the positive test case is multiplexed, if so, multiplexing step information of a repeated part of the positive test case, generating step information of a residual part of the negative test case, and adding the step information to a test step list; if not, traversing the wrong step information under the step according to the negative test case name and adding the step information to a test step list;
an output step: and finally combining and splicing all the step information of the modules to be tested according to the test step list and outputting the UI test case.
4. The Web UI automation test method according to claim 2, wherein the executing step includes:
matching: performing element positioning matching according to the possible value list;
normally executing the steps: recording the execution state of the final test case and generating an HTML test report;
an error execution step: screenshot is carried out on the place where the final test case is executed wrongly, and an HTML test report is generated;
a sending step: and sending the HTML test report.
5. The Web UI automation test method according to claim 4, wherein the normal execution step further comprises outputting a stack trace in an abnormal state; the error performing step further includes outputting a log of error levels.
6. A Web UI automation test system, characterized by comprising:
the configuration information acquisition device is used for acquiring a module list of the module to be tested and acquiring the configuration information of the module to be tested according to the module list;
the UI test case obtaining device is used for reading the execution step information of each test case after obtaining the number of the test cases contained in the module to be tested according to the configuration information, and obtaining the UI test cases according to the execution step information;
and the execution device is used for carrying out Web UI automatic test according to the UI test case and outputting a test result.
7. The Web UI automation test system according to claim 6, wherein the execution step information includes a test case name, an element positioning manner, an element position, operation information, and step information, and the final test case obtaining means includes:
the computing unit is used for obtaining the number of test cases contained in the module to be tested according to the configuration information;
the reading unit is used for reading the step information and the operation information corresponding to each step in the step information;
a possible value list obtaining unit for reading and positioning the position of each element in the test case according to the element positioning mode and the element position to obtain a possible value list;
and the UI test case output unit generates a positive test case and/or a negative test case according to the step information and the operation information, and integrates the positive test case and/or the negative test case to obtain the UI test case.
8. The Web UI automation test system according to claim 7, wherein the final test case output unit includes:
a judging module: judging the types of the positive test case and the negative test case;
the front test case processing module: when the test case is a front test case, traversing the correct step information under the step according to the name of the front test case and adding the step information to a test step list;
the negative test case processing module: if the test case is a negative test case, judging whether the positive test case is multiplexed, if so, multiplexing step information of a repeated part of the positive test case, generating step information of a residual part of the negative test case, and adding the step information to a test step list; if not, traversing the wrong step information under the step according to the negative test case name and adding the step information to a test step list;
an output module: and finally combining and splicing all the step information of the modules to be tested according to the test step list to output the final test case.
9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the Web UI automation test method according to any one of claims 1 to 5 when executing the computer program.
10. A readable storage medium on which a computer program is stored, which when executed by a processor implements the Web UI automation test method according to any one of claims 1 to 5.
CN202011239254.0A 2020-11-09 Web UI automatic test method, system, electronic equipment and readable storage medium Active CN112231229B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011239254.0A CN112231229B (en) 2020-11-09 Web UI automatic test method, system, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011239254.0A CN112231229B (en) 2020-11-09 Web UI automatic test method, system, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN112231229A true CN112231229A (en) 2021-01-15
CN112231229B CN112231229B (en) 2024-06-28

Family

ID=

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117591438A (en) * 2024-01-19 2024-02-23 易方信息科技股份有限公司 Automatic testing method and related device for UI component atomization

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040107415A1 (en) * 2002-12-03 2004-06-03 Konstantin Melamed Web-interactive software testing management method and computer system including an integrated test case authoring tool
CN107783902A (en) * 2017-09-26 2018-03-09 甘肃万维信息技术有限责任公司 A kind of Selenium automated testing methods and system from coding
US20180165179A1 (en) * 2016-12-14 2018-06-14 NIIT Technologies Ltd Determining incompatibilities of automated test cases with modified user interfaces
CN109062802A (en) * 2018-08-13 2018-12-21 深圳壹账通智能科技有限公司 A kind of method for testing software, computer readable storage medium and terminal device
CN109254920A (en) * 2018-09-06 2019-01-22 上海精数信息科技有限公司 Interface testing case generation method, device, electronic equipment, storage medium
CN110399294A (en) * 2019-06-26 2019-11-01 平安科技(深圳)有限公司 Method for generating test case, device, computer equipment and storage medium
CN110659197A (en) * 2018-06-28 2020-01-07 亿度慧达教育科技(北京)有限公司 Application test case generation method and device and software test system
CN110941546A (en) * 2019-10-12 2020-03-31 平安健康保险股份有限公司 Automatic test method, device, equipment and storage medium for WEB page case
CN111198811A (en) * 2018-11-19 2020-05-26 中移(苏州)软件技术有限公司 Page automatic test method and device, electronic equipment and storage medium
CN111427760A (en) * 2019-01-09 2020-07-17 阿里巴巴集团控股有限公司 Page testing method, device, equipment and storage medium
US20200327043A1 (en) * 2019-04-15 2020-10-15 Cognizant Technology Solutions India Pvt. Ltd. System and a method for automated script generation for application testing
CN111881022A (en) * 2020-07-07 2020-11-03 上海中通吉网络技术有限公司 Method, device and equipment for generating test case based on test scene

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040107415A1 (en) * 2002-12-03 2004-06-03 Konstantin Melamed Web-interactive software testing management method and computer system including an integrated test case authoring tool
US20180165179A1 (en) * 2016-12-14 2018-06-14 NIIT Technologies Ltd Determining incompatibilities of automated test cases with modified user interfaces
CN107783902A (en) * 2017-09-26 2018-03-09 甘肃万维信息技术有限责任公司 A kind of Selenium automated testing methods and system from coding
CN110659197A (en) * 2018-06-28 2020-01-07 亿度慧达教育科技(北京)有限公司 Application test case generation method and device and software test system
CN109062802A (en) * 2018-08-13 2018-12-21 深圳壹账通智能科技有限公司 A kind of method for testing software, computer readable storage medium and terminal device
CN109254920A (en) * 2018-09-06 2019-01-22 上海精数信息科技有限公司 Interface testing case generation method, device, electronic equipment, storage medium
CN111198811A (en) * 2018-11-19 2020-05-26 中移(苏州)软件技术有限公司 Page automatic test method and device, electronic equipment and storage medium
CN111427760A (en) * 2019-01-09 2020-07-17 阿里巴巴集团控股有限公司 Page testing method, device, equipment and storage medium
US20200327043A1 (en) * 2019-04-15 2020-10-15 Cognizant Technology Solutions India Pvt. Ltd. System and a method for automated script generation for application testing
CN110399294A (en) * 2019-06-26 2019-11-01 平安科技(深圳)有限公司 Method for generating test case, device, computer equipment and storage medium
CN110941546A (en) * 2019-10-12 2020-03-31 平安健康保险股份有限公司 Automatic test method, device, equipment and storage medium for WEB page case
CN111881022A (en) * 2020-07-07 2020-11-03 上海中通吉网络技术有限公司 Method, device and equipment for generating test case based on test scene

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
T. J. OSTRAND等: "The category-partition method for specifying and generating fuctional tests", 《COMMUNICATIONS OF THE ACM》, 1 June 1988 (1988-06-01), pages 676, XP058156218, DOI: 10.1145/62959.62964 *
张旭舟: "面向复杂程序结构的测试用例自动生成方法研究", 《中国博士学位论文全文数据库信息科技辑》, 15 September 2018 (2018-09-15), pages 138 - 15 *
张雅峰: "Web应用测试用例生成的研究", 《中国优秀硕士学位论文全文数据库信息科技辑》, 15 January 2019 (2019-01-15), pages 139 - 406 *
阿阿潇: "python+xlrd+xlutils+selenium简单实现excel自动化测试", pages 1 - 7, Retrieved from the Internet <URL:《 https://www.jianshu.com/p/2aab60586533》> *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117591438A (en) * 2024-01-19 2024-02-23 易方信息科技股份有限公司 Automatic testing method and related device for UI component atomization
CN117591438B (en) * 2024-01-19 2024-05-14 易方信息科技股份有限公司 Automatic testing method and related device for UI component atomization

Similar Documents

Publication Publication Date Title
CN109783346B (en) Keyword-driven automatic testing method and device and terminal equipment
US20120185669A1 (en) Program inspection method and non-transitory, computer readable storage medium storing inspection program
CN111324540B (en) Interface testing method and device
CN115238616A (en) Automatic modification method and device for chip netlist and electronic equipment
CN112948233A (en) Interface testing method, device, terminal equipment and medium
CN114117973A (en) Logic synthesis method, device and storage medium
CN111680463A (en) File checking method and device
CN115658452A (en) Buried point checking method, buried point checking device, readable storage medium and electronic equipment
CN113138808B (en) Integration method, device, computer equipment and storage medium
CN112560372B (en) Chip prototype verification method, device, equipment and medium
CN112685275A (en) Algorithm strategy searching method and device, electronic equipment and storage medium
CN112731117A (en) Automatic verification method and system for chip, and storage medium
CN111045948A (en) Method, apparatus and storage medium for checking interface signal between modules
CN112231229A (en) Web UI (user interface) automatic testing method and system, electronic equipment and readable storage medium
CN114355171B (en) Reconfigurable chip performance bottleneck detection platform, detection method and electronic equipment
CN112231229B (en) Web UI automatic test method, system, electronic equipment and readable storage medium
US11556460B2 (en) Test case generation for software development using machine learning
CN114091391A (en) Chip verification method, device, equipment and storage medium
CN114020636A (en) Application APP test method and device, electronic equipment and storage medium
CN110442370B (en) Test case query method and device
CN113238940A (en) Interface test result comparison method, device, equipment and storage medium
CN116861829B (en) Method for locating errors in logic system design and electronic equipment
US11782682B2 (en) Providing metric data for patterns usable in a modeling environment
CN117907812B (en) Circuit detection method and device, electronic device, storage medium, and program product
CN115757123B (en) Test case generation method, device, equipment and medium

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