CN112231229B - Web UI automatic test method, system, electronic equipment and readable storage medium - Google Patents

Web UI automatic test method, system, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN112231229B
CN112231229B CN202011239254.0A CN202011239254A CN112231229B CN 112231229 B CN112231229 B CN 112231229B CN 202011239254 A CN202011239254 A CN 202011239254A CN 112231229 B CN112231229 B CN 112231229B
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.)
Active
Application number
CN202011239254.0A
Other languages
Chinese (zh)
Other versions
CN112231229A (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
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
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

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: configuration information acquisition: 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 the module to be tested is obtained according to the configuration information, reading the execution step information of each test case, and obtaining UI test cases according to the execution step information; the method comprises the following steps: and carrying out Web UI automatic test according to the UI test case and outputting a test result.

Description

Web UI automatic test method, 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 Web UI automated testing.
Background
In the context of today's system design, webUI interactions are becoming more and more complex, and the requirements for UI testing for this type are also becoming more and more vigorous.
In the conventional UI test mode, a tester needs to basically use manual testing, perform operations on an interface, and also needs to maintain a large number of test cases and test data. For a formed system, a certain logic rule exists in UI test of the main body business logic, and the similarity of test cases is very high aiming at the same type of column configuration information, and the change is likely to be the position of an element.
To cope with frequent new or changing demands of the system, testers often have to expend 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, a lot of time is often required for regressively debugging the corresponding test case, and the compact development progress may cause that the part of the associated module cannot be sufficiently tested, so that new defects are found after the production environment is online.
There is therefore an urgent need to develop a method, system, electronic device, and readable storage medium for Web UI automated testing that overcomes the above-described drawbacks.
Disclosure of Invention
In view of the above problems, the present invention provides a Web UI automation test method, including:
configuration information acquisition: 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, reading the execution step information of each test case, and obtaining UI test cases according to the execution step information;
The method comprises the following steps: and carrying out Web UI automatic test according to the UI test case and outputting a test result.
The above Web UI automation test system, wherein the executing 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:
The calculation steps are as follows: 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;
The automatic testing method for the Web UI comprises the following steps of:
judging: judging the types of the positive test cases and the negative test cases;
The front test case processing steps are as follows: when the test case is a front test case, traversing the correct step information in 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: when the test case is a negative test case, judging whether to multiplex the positive test case, if so, multiplexing the step information of the repeated part of the positive test case, generating the step information of the rest 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 name of the negative test case and adding the step information to a test step list;
And an output step: and finally combining and splicing all the step information of the module to be tested according to the test step list to output the final test case.
The automatic testing method for the Web UI comprises the following steps:
matching: performing element positioning matching according to the possible value list;
The normal execution steps are as follows: recording the execution state of the final test case and generating an HTML test report;
Error execution step: performing screenshot on the place where the final test case is executed with errors, and generating an HTML test report;
A transmitting step: and sending the HTML test report.
The automatic test method for the Web UI further comprises the following steps of outputting a stack track in an abnormal state; the error executing 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 acquires a module list of a module to be tested, and acquires 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.
The above-mentioned automatic test system of Web UI, wherein, the execution step information includes a test case name, an element positioning mode, an element position, operation information and step information, and the final test case obtaining device 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;
A reading unit for reading the step information and the operation information corresponding to each step in the step information;
the possible value list obtaining unit is used 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 is used for 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.
The Web UI automation test system described above, wherein the final test case output unit includes:
and a judging module: judging the types of the positive test cases and the negative test cases;
front test case processing module: when the test case is a front test case, traversing the correct step information in 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: when the test case is a negative test case, judging whether to multiplex the positive test case, if so, multiplexing the step information of the repeated part of the positive test case, generating the step information of the rest 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 name of the negative test case and adding the step information to a test step list;
And an output module: and finally combining and splicing all the step information of the module to be tested according to the test step list to output the final test case.
The invention also provides 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 the above when executing the computer program.
The present invention also provides a readable storage medium having stored thereon a computer program, 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 invention can automatically read each step of the test case and dynamically generate the UI test case, thereby solving the problem that the UI test needs a large number of regression in the face of the system requirement of frequent iteration. Meanwhile, the invention can reduce repeated operation of testers and save time. The invention can manage and automatically maintain the UI test cases, and help the testers who cannot write codes to carry out WebUI automatic tests.
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 may 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 of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a Web UI automation test method of the present invention;
FIG. 2 is a partial flow chart of step S2 in FIG. 1;
FIG. 3 is a partial flow chart of step S24 in FIG. 2;
FIG. 4 is a flow chart of element positioning;
FIG. 5 is an application flowchart of step S24;
FIG. 6 is a partial flow chart of step S3 in FIG. 1;
FIG. 7 is a flowchart showing the steps S32, S33 and S34 in FIG. 6;
FIG. 8 is a flowchart illustrating the step S31 of FIG. 6;
FIG. 9 is a schematic diagram of the architecture of the Web UI automation test system of the present invention;
fig. 10 is a schematic structural view of the electronic device of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The exemplary embodiments of the present invention and the descriptions thereof are intended to illustrate the present invention, but not to limit the present invention. In addition, the same or similar reference numerals are used for the same or similar parts in the drawings and the embodiments.
The terms "first," "second," "S1," "S2," …, etc. as used herein do not denote a particular order or sequence, nor are they intended to limit the invention, but rather are merely intended to distinguish one element or operation from another in the same technical terms.
With respect to directional terms used herein, for example: upper, lower, left, right, front or rear, etc., are merely references to the directions of the drawings. Thus, directional terminology is used for purposes of illustration and is not intended to be limiting.
As used herein, the terms "comprising," "including," "having," "containing," and the like are intended to be inclusive and mean an inclusion, but not limited to.
As used herein, "and/or" includes any or all combinations of such things.
Reference herein to "a plurality" includes "two" and "more than two"; the term "plurality of sets" as used herein includes "two sets" and "more than two sets".
The terms "about," "approximately" and the like as used herein are used to modify any quantitative or positional deviation that could vary slightly without such slight variation or positional deviation altering its nature. In general, 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 above mentioned values can be adjusted according to the actual requirements, and are not limited thereto.
Certain words used to describe the application will be discussed below or elsewhere in this specification to provide additional guidance to those skilled in the art in describing the application.
Aiming at the automatic test of WebUI, the invention maintains and forms the test case based on the step of manual operation on the basis of simulating the manual operation, uses Python language and combines with Selenium frame to read the test case, automatically executes the operation of each step according to the maintained test case, reduces repeated labor, lightens the daily work load of the tester and is used for saving unnecessary maintenance cost. The method comprises the steps of reading operation of each step for realizing the maintained test cases by input items of the Web UI automation test, refining the operation of different modules into each step, and generating the test cases which can be directly executed to cover more than 90% of Web UI automation test scenes. 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 is a detailed description with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a flowchart of a Web UI automation test method according to the present invention. As shown in fig. 1, the Web UI automation test method of the present invention includes:
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;
Step S2 of UI test case acquisition: after the number of the test cases contained in the module to be tested is obtained according to the configuration information, reading the execution step information of each test case, and obtaining UI test cases 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.
The method comprises the steps of executing step information, namely, reading UI executing step information maintained by Excel by using Python language, wherein the executing step information comprises a test case name, an element positioning mode, an element position, operation information, step information and input parameter information. According to different element positions and element operations, a series of UI test cases are generated through logical grouping of test case names. Therefore, each step of the test cases can be automatically read, UI test cases are dynamically generated, specifically, configuration information of each module to be tested is read one by one aiming at a module list to be tested, the number of the test cases contained in each module to be tested is calculated, and the test cases are generated and executed according to execution step information of configuration of each test case. Therefore, the problem that a large number of regression is required for UI test facing the system requirement of frequent iteration is solved; meanwhile, repeated operation of testers can be reduced, time is saved, UI test cases can be managed and automatically maintained, and the testers who cannot write codes are helped to carry out WebUI automatic tests.
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 the 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: and 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 a flowchart of element positioning, as shown in fig. 4, in step S23 of obtaining a possible value list, taking a positive test case as an example, when the positive test case is generated, whether the element has a unique feature or not is sequentially determined, whether the relative position is fixed or not, for example, whether an element positioning mode is generated through ID, xpath, selector, classname, linktext, PARTIAL LINK text and tagname, if an element is newly added on an interface, whether the element can still be positioned to the same information, all possible positioning mode ranges of the element are sequentially generated, and the possible positioning mode ranges are put into the possible value list for subsequent use, wherein the logic of the negative test case is the same as that of the positive test case, so that the details are not repeated here.
Referring to fig. 3 and 5, fig. 3 is a partial flowchart of step S24 in fig. 2, and fig. 5 is an application flowchart of step S24. As shown in fig. 3 and 5, the final test case output step S24 includes:
judgment step S241: judging the types of the positive test cases and the negative test cases;
front test case processing step S242: when the test case is a front test case, traversing the correct step information in 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: when the test case is a negative test case, judging whether to multiplex the positive test case, if so, multiplexing the step information of the repeated part of the positive test case, generating the step information of the rest 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 name of the negative test case and adding the step information to a test step list;
In this embodiment, when the test case is generated, a positive case and a negative case are generated. When the front side use case is generated, a test step list which is available for the front side use case is obtained, and the test step list is put into the test use cases one by one. And when the negative cases are generated, acquiring a test step list which is available for the negative cases, and putting the test step list into the test cases one by one. And finally, combining all 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 module to be tested according to the test step list to output the UI test case.
Referring to fig. 6 and 7, fig. 6 is a partial flow chart of step S3 in fig. 1, and fig. 7 is a flow chart 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 performed: recording the execution state of the final test case and generating an HTML test report;
Error execution step S33: performing screenshot on the place where the final test case is executed with errors, and generating an HTML test report;
A 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 executing step further includes outputting a log of error levels.
In the WebUI automated test process, an element positioning failure condition is often encountered, and error information is generally reported as "no unit", which generally causes the condition to start from the following aspects, namely whether delay exists in a network or not, and the whole page is not completely loaded. Secondly, when the structure of the iframe is encountered, the element needs to be switched to the iframe, thirdly, the element needs to judge that a plurality of windows exist under the current condition and then the handle is switched. Fourthly, the page returns a dynamic id, and the elements are always not positioned in an automatic positioning mode through a browser, and can be replaced by fullxpath at the moment. 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, a possible value list is first matched, and if an element can be located, the next process is performed; if the element is not positioned, the element is positioned by adding the intelligent waiting, switching to the corresponding iframe, switching the polling handle to the corresponding window and xfullpath, and the next step is performed if the positioning is successful.
Referring to fig. 9, fig. 9 is a schematic structural diagram of the Web UI automation test system of the present invention. As shown in fig. 9, the Web UI automation test system of the present invention includes:
the configuration information acquisition device 11 acquires a module list of a module to be tested, and acquires configuration information of the module to be tested according to the module list;
The UI test case obtaining device 12 obtains the number of test cases included in the module to be tested according to the configuration information, reads execution step information of each test case, and obtains a UI test case according to the execution step information;
And the execution device 13 is used for carrying out Web UI automation 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 device 12 includes:
A calculating unit 121, configured to obtain the number of test cases included in the module to be tested according to the configuration information;
a reading unit 122 for reading the step information and the operation information corresponding to each step in the step information;
A possible value list obtaining unit 123 for reading and locating the position of each element in the test case according to the element locating mode and the element position to obtain a possible value list;
And a UI test case output unit 124, configured to generate a positive test case and/or a negative test case according to the step information and the operation information, and integrate 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 judgment module 1241: judging the types of the positive test cases and the negative test cases;
Front test case processing module 1242: when the test case is a front test case, traversing the correct step information in 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: when the test case is a negative test case, judging whether to multiplex the positive test case, if so, multiplexing the step information of the repeated part of the positive test case, generating the step information of the rest 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 name of the negative test case and adding the step information to a test step list;
Output module 1244: and finally combining and splicing all the step information of the module 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.
In particular, the processor 81 may include a Central Processing Unit (CPU), or an Application SPECIFIC INTEGRATED Circuit (ASIC), or may be configured as one or more integrated circuits that implement 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 comprise a hard disk drive (HARD DISK DRIVE, abbreviated HDD), floppy disk drive, solid state drive (Solid STATE DRIVE, abbreviated SSD), flash memory, optical disk, magneto-optical disk, magnetic tape, or universal serial bus (Universal Serial Bus, abbreviated USB) drive, or a combination of two or more of these. The 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 (Random Access Memory, RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (Programmable Read-Only Memory, abbreviated PROM), an erasable PROM (Erasable Programmable Read-Only Memory, abbreviated EPROM), an electrically erasable PROM (ELECTRICALLY ERASABLE PROGRAMMABLE READ-Only Memory, abbreviated EEPROM), an electrically rewritable ROM (ELECTRICALLY ALTERABLE READ-Only Memory, abbreviated EAROM), or a FLASH Memory (FLASH), or a combination of two or more of these. The RAM may be a Static Random-Access Memory (SRAM) or a dynamic Random-Access Memory (Dynamic Random Access Memory DRAM), where the DRAM may be a fast page mode dynamic Random-Access Memory (Fast Page Mode Dynamic Random Access Memory, FPMDRAM), an extended data output dynamic Random-Access Memory (Extended Date Out Dynamic Random Access Memory, EDODRAM), a synchronous dynamic Random-Access Memory (Synchronous Dynamic Random-Access Memory, SDRAM), or the like, as appropriate.
Memory 82 may be used to store or cache various data files that need to be processed and/or communicated, as well as possible computer program instructions for execution by 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 to each other via the bus 80 and perform communication with each other.
The communication interface 83 is used to enable communication between modules, devices, units and/or units in embodiments of the application. Communication port 83 may also enable communication with other components such as: and the external equipment, the image/data acquisition equipment, the database, the external storage, the image/data processing workstation and the like are used for data communication.
Bus 80 includes hardware, software, or both that couple components of the electronic device to one another. Bus 80 includes, but is not limited to, at least one of: data Bus (Data Bus), address Bus (Address Bus), control Bus (Control Bus), expansion Bus (Expansion Bus), local Bus (Local Bus). By way of example, and not limitation, bus 80 may include a graphics acceleration interface (ACCELERATED GRAPHICS Port, abbreviated as AGP) or other graphics Bus, an enhanced industry standard architecture (Extended Industry Standard Architecture, abbreviated as EISA) Bus, a Front Side Bus (Front Side Bus, abbreviated as FSB), a HyperTransport (abbreviated as HT) interconnect, an industry standard architecture (Industry Standard Architecture, abbreviated as ISA) Bus, a wireless bandwidth (InfiniBand) interconnect, a Low Pin Count (LPC) Bus, a memory Bus, a micro channel architecture (Micro Channel Architecture, abbreviated as MCA) Bus, a peripheral component interconnect (PERIPHERAL COMPONENT INTERCONNECT, abbreviated as PCI) Bus, a PCI-Express (PCI-X) Bus, a serial advanced technology attachment (SERIAL ADVANCED Technology Attachment, abbreviated as SATA) Bus, a video electronics standards Association local (Video Electronics Standards Association Local Bus, abbreviated as 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 embodiments of the application have been described and illustrated with respect to a particular bus, the application contemplates any suitable bus or interconnect.
In addition, in conjunction with the automated testing method WebUI in the above embodiment, embodiments of the present application may be implemented by providing a computer-readable storage medium. The computer readable storage medium has stored thereon computer program instructions; the computer program instructions, when executed by a processor, implement any one WebUI of the automated test methods of the embodiments described above.
In summary, the invention has the following effects:
1. The test staff 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 more than 90% of UI test scenes, reduce repeated operation of the test staff and save time;
2. when the UI element position changes, the tester only needs to manually update the test element position information. 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. The tester who can not write codes can simply realize Web UI automatic test through the technology.
Although the 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 scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (8)

1. A Web UI automation test method, comprising:
configuration information acquisition: 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, reading the execution step information of each test case, and obtaining UI test cases according to the execution step information;
The method comprises the following steps: performing Web UI automatic test according to the UI test case and outputting a test result;
the executing step information comprises a test case name, an element positioning mode, an element position, operation information and step information, and the UI test case obtaining step comprises the following steps:
The calculation steps are as follows: 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: and 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.
2. The Web UI automation test method of claim 1, wherein the UI test case outputting step comprises:
judging: judging the types of the positive test cases and the negative test cases;
The front test case processing steps are as follows: when the test case is a front test case, traversing the correct step information in 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: when the test case is a negative test case, judging whether to multiplex the positive test case, if so, multiplexing the step information of the repeated part of the positive test case, generating the step information of the rest 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 name of the negative test case and adding the step information to a test step list;
And an output step: and finally combining and splicing all the step information of the module to be tested according to the test step list to output the UI test case.
3. The Web UI automation test method of claim 1, wherein the performing step comprises:
matching: performing element positioning matching according to the possible value list;
the normal execution steps are as follows: recording the execution state of the UI test case and generating an HTML test report;
Error execution step: performing screenshot on the place where the UI test case is executed with errors, and generating an HTML test report;
A transmitting step: and sending the HTML test report.
4. The Web UI automation test method of claim 3, wherein the normally executing step further comprises outputting a stack trace in an abnormal state; the error executing step further includes outputting a log of error levels.
5. A Web UI automation test system, comprising:
the configuration information acquisition device acquires a module list of a module to be tested, and acquires 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;
the execution device 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, and the UI test case obtaining device comprises:
the computing unit is used for obtaining the number of test cases contained in the module to be tested according to the configuration information;
A reading unit for reading the step information and the operation information corresponding to each step in the step information;
the possible value list obtaining unit is used 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 is used for 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.
6. The Web UI automation test system of claim 5, wherein the UI test case output unit comprises:
and a judging module: judging the types of the positive test cases and the negative test cases;
front test case processing module: when the test case is a front test case, traversing the correct step information in 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: when the test case is a negative test case, judging whether to multiplex the positive test case, if so, multiplexing the step information of the repeated part of the positive test case, generating the step information of the rest 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 name of the negative test case and adding the step information to a test step list;
And an output module: and finally combining and splicing all the step information of the module to be tested according to the test step list to output the UI test case.
7. 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 automated test method of any of claims 1-4 when the computer program is executed.
8. A readable storage medium having stored thereon a computer program, which when executed by a processor implements the Web UI automation test method according to any one of claims 1 to 4.
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 CN112231229A (en) 2021-01-15
CN112231229B true CN112231229B (en) 2024-06-28

Family

ID=

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109062802A (en) * 2018-08-13 2018-12-21 深圳壹账通智能科技有限公司 A kind of method for testing software, computer readable storage medium and terminal device
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

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN110941546A (en) * 2019-10-12 2020-03-31 平安健康保险股份有限公司 Automatic test method, device, equipment and storage medium for WEB page case

Similar Documents

Publication Publication Date Title
CN111324526B (en) Interface test system, method and server
CN111611797B (en) Method, device and equipment for marking prediction data based on Albert model
CN112181854B (en) Method, device, equipment and storage medium for generating process automation script
CN115757483A (en) Automatic testing method and device, electronic equipment and storage medium
CN112328490A (en) Software system research and development quality evaluation method and system, storage medium and electronic equipment
CN114091383A (en) Test sequence generation method, device and system and related equipment
US20240045752A1 (en) Methods and apparatuses for troubleshooting a computer system
CN112231229B (en) Web UI automatic test method, system, electronic equipment and readable storage medium
CN111427582B (en) RTL code management method, device, equipment and computer readable storage medium
CN110532458B (en) Method and device for determining search mode, server and storage medium
CN111209180B (en) Regression testing method and device based on fuzzy matching
US11556460B2 (en) Test case generation for software development using machine learning
CN113238940B (en) Interface test result comparison method, device, equipment and storage medium
CN114091391A (en) Chip verification method, device, equipment and storage medium
CN115168217A (en) Defect discovery method and device for source code file
CN112231229A (en) Web UI (user interface) automatic testing method and system, electronic equipment and readable storage medium
KR102201845B1 (en) Automation unit test method of multi-task based software and system for the same
CN116028329A (en) Method, electronic device and computer program product for detecting code defects
CN113126881A (en) System configuration method, device, equipment, readable storage medium and distributed storage system
CN117574817B (en) Design automatic verification method, system and verification platform for self-adaptive time sequence change
US11036613B1 (en) Regression analysis for software development and management using machine learning
CN114448851B (en) Automatic data testing method and system
CN114756473A (en) Test method, test device, electronic equipment and storage medium
CN117311672A (en) Software model architecture, battery management system controller and vehicle
CN113742225A (en) Test data generation method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant