CN112988605B - Method and device for realizing WEB application automatic test - Google Patents

Method and device for realizing WEB application automatic test Download PDF

Info

Publication number
CN112988605B
CN112988605B CN202110506580.1A CN202110506580A CN112988605B CN 112988605 B CN112988605 B CN 112988605B CN 202110506580 A CN202110506580 A CN 202110506580A CN 112988605 B CN112988605 B CN 112988605B
Authority
CN
China
Prior art keywords
test
test case
assertion
case file
indication
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
CN202110506580.1A
Other languages
Chinese (zh)
Other versions
CN112988605A (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.)
Accumulus Technologies Tianjin Co Ltd
Original Assignee
Accumulus Technologies Tianjin 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 Accumulus Technologies Tianjin Co Ltd filed Critical Accumulus Technologies Tianjin Co Ltd
Priority to CN202110506580.1A priority Critical patent/CN112988605B/en
Publication of CN112988605A publication Critical patent/CN112988605A/en
Application granted granted Critical
Publication of CN112988605B publication Critical patent/CN112988605B/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

Abstract

The invention provides a method and a device for realizing WEB application automatic test, comprising the following steps: receiving the editing operation of a user on a test case file of WEB application; responding to the editing operation, calling an increasing indication function of playright, and increasing screenshot indication and/or assertion indication at a target test operation in the test case file to obtain an edited test case file; executing the edited test case file by calling a headless browser function of playright to generate an execution result, wherein when the edited test case file is executed, a screenshot instruction and/or the assertion instruction are/is executed at a target test operation; and generating a test report according to the execution result. In the invention, the browser is not required to be called when the test case is executed by calling the function of the Playright, the test case can be executed on the server, and the one-key increase of the comparison between the assertion and the screenshot is supported.

Description

Method and device for realizing WEB application automatic test
Technical Field
The invention relates to the field of automatic testing, in particular to a method and a device for realizing WEB application automatic testing.
Background
In testing of WEB (World Wide WEB) projects, UI (User interface) automated testing is used as a relatively important automated testing project, which can improve testing efficiency and reduce manual regression testing time, so it is necessary to develop UI automated testing tools.
In the prior art, most UI automation tools are realized based on Selenium, the Selenium needs to operate a browser, various webpage internal driving software needs to be installed, the browser needs to be called when a test case is actually executed, and the use scene has certain limitation and complexity.
Disclosure of Invention
The invention provides a method and a device for realizing WEB application automatic test, which are used for solving the problem that a use scene is limited because a browser is required to be called for testing when UI automatic test is carried out in the prior art.
In order to solve the above problems, the present invention is realized by:
in a first aspect, the present invention provides a method for implementing an automated test for a WEB application, including:
receiving an editing operation of a user on a test case file of a WEB application, wherein a plurality of test operations of the user on the WEB application are recorded in the test case file;
in response to the editing operation, calling an increase indication function of playright, and adding the function code indicated by the screenshot and/or the function code indicated by the assertion at a target test operation in the test case file by one key to obtain an edited test case file, wherein the assertion indication comprises at least one of the following: a case assertion indication, a control assertion indication, and a path address assertion indication;
executing the edited test case file by calling a headless browser function of playright to generate an execution result, wherein when the edited test case file is executed, the function code indicated by the screenshot and/or the function code indicated by the assertion are/is executed at the target test operation;
and generating a test report according to the execution result.
Optionally, before receiving an editing operation of a user on a test case file of a WEB application, the method further includes:
receiving a recording case request of a user;
responding to the recording case request, and connecting with a terminal corresponding to the user;
receiving a command of starting recording of a user;
responding to the command for starting recording, sending a recording script to the terminal and executing the recording script at the terminal, wherein the browser in playright is called when the recording script is executed, and a test case file is generated according to the test operation of a user in the browser;
and receiving and storing the test case file returned by the terminal.
Optionally, if the edited test case file includes a screenshot instruction;
executing the edited test case file by calling a headless browser function of playright comprises the following steps:
and intercepting the running interface of the WEB application after the target test operation corresponding to the screenshot instruction is executed.
Optionally, intercepting the running interface of the WEB application after the target test operation corresponding to the screenshot instruction is executed further includes:
and uploading the running interface to a storage platform and encrypting the running interface.
Optionally, after the edited test case file is executed by calling a headless browser function of playright, the method further includes:
selecting at least two intercepted operation interfaces as operation interfaces to be compared for comparison, marking out difference information between the operation interfaces to be compared and displaying the difference information.
Optionally, if the test case file includes an assertion indication;
executing the edited test case file by calling a headless browser function of playright comprises the following steps:
determining whether a specified copy, control and/or path address element exists in the execution result until the assertion indication is added;
comparing specified copy, control, and/or path address element values in the execution result until the assertion indication is added to expected values.
In a second aspect, the present invention provides an apparatus for implementing an automated test for WEB applications, including:
the first receiving module is used for receiving the editing operation of a user on a test case file of the WEB application, and a plurality of test operations of the user on the WEB application are recorded in the test case file;
the editing module is used for responding to the editing operation, calling an increasing indication function of playright, and adding a function code indicated by one-key screenshot and/or a function code indicated by assertion at a target testing operation in the test case file to obtain an edited test case file, wherein the assertion indication comprises at least one of the following items: a case assertion indication, a control assertion indication, and a path address assertion indication;
the execution module is used for executing the edited test case file by calling a headless browser function of playright to generate an execution result, wherein when the edited test case file is executed, the function code indicated by the screenshot and/or the function code indicated by the assertion are/is executed at the target test operation;
and the report generating module is used for generating a test report according to the execution result.
Optionally, the second receiving module is configured to receive a recording use case request of a user;
the connection module is used for responding to the recording case request and connecting with a terminal corresponding to the user;
the third receiving module is used for receiving a command of starting recording of a user;
the recording module is used for responding to the command for starting recording, sending a recording script to the terminal and executing the recording script on the terminal, wherein the recording script calls a browser in playright when executing the recording script, and generates a test case file according to the test operation of a user in the browser;
and the fourth receiving module is used for receiving and storing the test case file returned by the terminal.
Optionally, the executing module further includes:
and the interception submodule is used for intercepting the running interface of the WEB application after the target test operation corresponding to the screenshot instruction is executed.
Optionally, the executing module further includes:
and the storage submodule is used for uploading the operation interface to a storage platform and encrypting the operation interface.
Optionally, the screenshot comparison module is configured to select at least two intercepted operation interfaces as operation interfaces to be compared, mark difference information between the operation interfaces to be compared, and display the difference information.
Optionally, the executing module further includes:
a first assertion module, configured to determine whether a specified copy, control, and/or path address element exists in the execution result until the assertion indication is added;
a second predicate module to compare specified literal, control, and/or path address element values in the execution result until the predicate indication is added to expected values.
In a third aspect, the present invention provides a server, comprising: a processor, a memory and a program stored on the memory and executable on the processor, the program, when executed by the processor, implementing the steps of the method for implementing WEB application automation testing as set forth in any one of the first aspect.
In a fourth aspect, the present invention provides a computer-readable storage medium, having stored thereon a computer program, which when executed by a processor, implements the steps of the method for implementing WEB application automation testing according to any one of the first aspect.
According to the invention, the browser is not called when the test case is executed by calling the function of the Playright, the test case can be executed on the server, and the one-key increase of the assertion and the screenshot comparison are supported, so that the problem that the use scene is limited due to the fact that the browser is required to be called to carry out the test when the UI automatic test is carried out in the prior art is solved.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a schematic flow chart of a method for implementing an automated test of a WEB application according to an embodiment of the present invention;
fig. 2 is a schematic interface diagram of a method for implementing an automated test of a WEB application according to an embodiment of the present invention;
fig. 3 is a schematic flowchart illustrating a method for implementing an automated test for a WEB application according to an embodiment of the present invention;
fig. 4 is a schematic flowchart illustrating a comparison of inserted documents in a method for implementing an automated test for WEB applications according to an embodiment of the present invention;
fig. 5 is a schematic flowchart illustrating a user operation execution process of a method for implementing an automated WEB application test according to an embodiment of the present invention;
fig. 6 is a schematic flowchart illustrating comparison of insertion screenshots in a method for implementing an automated WEB application test according to an embodiment of the present invention;
fig. 7 is a schematic recording flow diagram of a method for implementing an automated WEB application test according to an embodiment of the present invention;
fig. 8 is a schematic view illustrating a user operation recording flow of a method for implementing an automated WEB application test according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of an apparatus for implementing an automated WEB application test according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, 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.
Referring to fig. 1 and fig. 2, an embodiment of the present invention provides a method for implementing an automated test for a WEB application, including:
step 11: receiving an editing operation of a user on a test case file of a WEB application, wherein a plurality of test operations of the user on the WEB application are recorded in the test case file;
step 12: in response to the editing operation, calling an increase indication function of playright, and adding the function code indicated by the screenshot and/or the function code indicated by the assertion at a target test operation in the test case file by one key to obtain an edited test case file, wherein the assertion indication comprises at least one of the following: a case assertion indication, a control assertion indication, and a path address assertion indication;
step 13: executing the edited test case file by calling a headless browser function of playright to generate an execution result, wherein when the edited test case file is executed, the function code indicated by the screenshot and/or the function code indicated by the assertion are/is executed at the target test operation;
step 14: and generating a test report according to the execution result.
According to the invention, the browser is not called when the test case is executed by calling the function of the Playright, the test case can be executed on the server, and the one-key increase of the assertion and the screenshot comparison are supported, so that the problem that the use scene is limited due to the fact that the browser is required to be called to carry out the test when the UI automatic test is carried out in the prior art is solved.
In the embodiment of the present invention, please refer to fig. 2, where fig. 2 is an operation interface of a user for editing a test case file of a WEB application, and when a screenshot instruction and/or an assertion instruction needs to be added to the test case file, the user may click an "edit" button of the interface to enter an editing interface, where the editing interface includes: the method comprises the following steps that a user can add screenshot instructions at the mouse stopping position of a test case file by clicking 'insert screenshot'; and a screenshot instruction can be added at any place of the test case; the "paperwork assertion", "control assertion" and/or "path address assertion" may be added at the mouse stop of the test case file by clicking on the "paperwork assertion", "control assertion" and/or "path address assertion".
Referring to fig. 3, after the user clicks "insert screenshot", an insert screenshot function insert screenshot is added at the mouse stop of the test case file.
Referring to fig. 4, taking the case assertion as an example, after a user clicks "case assertion", adding a case assertion function assertText at a mouse stop of a test case file, where the case assertion function includes user inputtable contents, and the user can set the case assertion contents by setting the inputtable contents; for example, the user enters a document to be searched "button 1" or "button 1.text = test" at "please enter a document to be searched" in the function code.
In step 13, in the embodiment of the present invention, a user clicks "run", and executes a runScript function on a server, where the executed function supports multi-process parallel execution, for example: supporting that at least one test case is executed on one server at the same time, and supporting that a plurality of servers execute one test case at the same time; calling a launch function in playright, and executing the test case by setting the headless = True; when the test case is executed, a browser does not need to be called, so that the test case can be executed on a server without the browser; referring to fig. 5, when a user performs an operation, an execution case is first selected; then executing the use case; and finally, acquiring the generated test report.
In the embodiment of the present invention, optionally, if the edited test case file includes a screenshot instruction;
executing the edited test case file by calling a headless browser function of playright comprises the following steps:
and intercepting the running interface of the WEB application after the target test operation corresponding to the screenshot instruction is executed.
In this embodiment of the present invention, optionally, intercepting the running interface of the WEB application after the target test operation corresponding to the screenshot indication is executed further includes:
and uploading the running interface to a storage platform and encrypting the running interface.
Referring to fig. 3, in the embodiment of the present invention, the screenshot function insertScreenshot intercepts a picture of a current running interface by calling a page of playright, executes a screenshot saving function saveImg, calls a unified storage interface, uploads the intercepted picture to a storage platform for encrypted storage, and improves security.
In the embodiment of the present invention, optionally, if the test case file includes a predicate indication;
executing the edited test case file by calling a headless browser function of playright comprises the following steps:
determining whether a specified copy, control and/or path address element exists in the execution result until the assertion indication is added;
comparing specified copy, control, and/or path address element values in the execution result until the assertion indication is added to expected values.
In an embodiment of the present invention, executing the assertion indication includes: judging whether specified copy, control and/or path address elements exist in the execution result until the assertion indication is added and comparing the specified copy, control and/or path address element values in the execution result until the assertion indication is added with an expected value; for example: when the program runs to the position where the user inputs the button 1 in the function code, whether the button 1 element exists in the execution result until the assertion indication position is added or whether the current case display of the button 1 in the execution result until the assertion indication position is added is tested when the program runs to the position where the user inputs the button 1.text = test in the function code is found, and the comparison of the specified element value and the expected value is realized.
In this embodiment of the present invention, optionally, the executing the edited test case file by calling a headless browser function of playright, and after generating the execution result, the method further includes:
selecting at least two intercepted operation interfaces as operation interfaces to be compared for comparison, marking out difference information between the operation interfaces to be compared and displaying the difference information.
Referring to fig. 6, when receiving an operation of clicking "screenshot comparison" on the interface by the user, popping up a dialog box, displaying all the currently stored screenshots in a list form, clicking "confirm" after the user selects two screenshots from all the screenshots, executing a screenshot comparison function screenenshot img, marking different pixel points of the two screenshots by the screenshot comparison function screenhot img, and displaying the different pixel points to the user.
In the embodiment of the present invention, optionally, before receiving the editing operation of the user on the test case file of the WEB application, the method further includes:
receiving a recording case request of a user;
responding to the recording case request, and connecting with a terminal corresponding to the user;
receiving a command of starting recording of a user;
responding to the command for starting recording, sending a recording script to the terminal and executing the recording script at the terminal, wherein the browser in playright is called when the recording script is executed, and a test case file is generated according to the test operation of a user in the browser;
and receiving and storing the test case file returned by the terminal.
Referring to fig. 2, fig. 7, and fig. 8, in the embodiment of the present invention, a user clicks "start node", receives a recording use case request of the user, and obtains an available access link in a Jenkins cluster, for example: 10 starting links are reserved in advance in the Jenkins cluster, and test0-test9, when a user clicks the 'starting node', a starting node function startNode function is called, the starting node function can select an idle node as the starting node of the user and generate a corresponding access link, and a starting command is issued to the user through the link, so that the user computer is accessed to the Jenkins cluster as a slave node, the recording operation is completed on the user computer, and the cluster mode is realized through an API (Application Programming Interface) provided by the Jenkins master-slave mode, so that an execution task can be issued to any one or more online machines when a case is executed, and parallel execution is supported; after clicking 'start recording', a user receives a command for starting recording of the user, executes a function runRecording function for starting recording, calls a browser through a python3-m playright codegen command, opens a specified browser page, performs corresponding operation on the page by the user, then closes the browser, converts the operation of the user into a format of a test case file, transmits the test case file generated by recording back to a server and stores the test case file in the server after recording is finished through a function script file function for storing the record file; referring to fig. 8, after the test case file is saved, an assertion indication and a screenshot indication may be added to the test case file, and after the assertion indication is added, it may be supported to determine whether a specified file, control, and/or path address element exists in the test case file and to compare a specified element value in the test case file with an expected value; after the screenshot instruction is added, the operation interface of the WEB application after the target test operation corresponding to the screenshot instruction is executed can be intercepted, and screenshot comparison is carried out on the intercepted operation interface.
Referring to fig. 9, the present invention provides an apparatus for implementing an automated test for WEB applications, including:
the first receiving module 91 is configured to receive an editing operation of a user on a test case file of a WEB application, where the test case file records a plurality of test operations of the user on the WEB application;
an editing module 92, configured to, in response to the editing operation, invoke an increase indication function of playright, and add a function code indicated by a one-key screenshot and/or a function code indicated by an assertion at a target test operation in the test case file to obtain an edited test case file, where the assertion indication includes at least one of: a case assertion indication, a control assertion indication, and a path address assertion indication;
an executing module 93, configured to execute the edited test case file by calling a headless browser function of playright, and generate an execution result, where when the edited test case file is executed, the function code indicated by the screenshot and/or the function code indicated by the assertion are executed at the target test operation;
and a report generating module 94, configured to generate a test report according to the execution result.
In the embodiment of the present invention, optionally, the second receiving module is configured to receive a recording use case request of a user;
the connection module is used for responding to the recording case request and connecting with a terminal corresponding to the user;
the third receiving module is used for receiving a command of starting recording of a user;
the recording module is used for responding to the command for starting recording, sending a recording script to the terminal and executing the recording script on the terminal, wherein the recording script calls a browser in playright when executing the recording script, and generates a test case file according to the test operation of a user in the browser;
and the fourth receiving module is used for receiving and storing the test case file returned by the terminal.
In this embodiment of the present invention, optionally, the execution module further includes:
and the interception submodule is used for intercepting the running interface of the WEB application after the target test operation corresponding to the screenshot instruction is executed.
In this embodiment of the present invention, optionally, the execution module further includes:
and the storage submodule is used for uploading the operation interface to a storage platform and encrypting the operation interface.
In the embodiment of the present invention, optionally, the screenshot comparison module is configured to select at least two intercepted operation interfaces as operation interfaces to be compared, and mark difference information between the operation interfaces to be compared and display the difference information.
In this embodiment of the present invention, optionally, the execution module further includes:
a first assertion module, configured to determine whether a specified copy, control, and/or path address element exists in the execution result until the assertion indication is added;
a second predicate module to compare specified literal, control, and/or path address element values in the execution result until the predicate indication is added to expected values.
The apparatus for implementing automatic testing of WEB applications according to the embodiment of the present invention can implement each process implemented by the method for implementing automatic testing of WEB applications according to the method embodiment of fig. 1, and is not described herein again to avoid repetition.
Referring to fig. 10, an embodiment of the present invention further provides a server 100, which includes a processor 101, a memory 102, and a computer program stored in the memory 102 and capable of running on the processor 101, where the computer program, when executed by the processor 101, implements the processes of the above-mentioned method for implementing an automatic test of a WEB application, and can achieve the same technical effects, and therefore, in order to avoid repetition, details are not repeated here.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when executed by a processor, the computer program implements each process of the above method for implementing an automatic test of a WEB application, and can achieve the same technical effect, and is not described herein again to avoid repetition. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a terminal) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (10)

1. A method for realizing WEB application automatic test is characterized by comprising the following steps:
receiving an editing operation of a user on a test case file of a WEB application, wherein a plurality of test operations of the user on the WEB application are recorded in the test case file;
in response to the editing operation, calling an increase indication function of playright, and adding the function code indicated by the screenshot and/or the function code indicated by the assertion at a target test operation in the test case file by one key to obtain an edited test case file, wherein the assertion indication comprises at least one of the following: a case assertion indication, a control assertion indication, and a path address assertion indication;
executing the edited test case file by calling a headless browser function of playright to generate an execution result, wherein when the edited test case file is executed, the function code indicated by the screenshot and/or the function code indicated by the assertion are/is executed at the target test operation;
and generating a test report according to the execution result.
2. The method for realizing automatic test of WEB application according to claim 1, wherein before receiving the editing operation of the user on the test case file of the WEB application, the method further comprises:
receiving a recording case request of a user;
responding to the recording case request, and connecting with a terminal corresponding to the user;
receiving a command of starting recording of a user;
responding to the command for starting recording, sending a recording script to the terminal and executing the recording script at the terminal, wherein the browser in playright is called when the recording script is executed, and a test case file is generated according to the test operation of a user in the browser;
and receiving and storing the test case file returned by the terminal.
3. The method for realizing automated testing of WEB applications according to claim 1,
if the edited test case file comprises a screenshot instruction;
executing the edited test case file by calling a headless browser function of playright comprises the following steps:
and intercepting the running interface of the WEB application after the target test operation corresponding to the screenshot instruction is executed.
4. The method for realizing automatic test of WEB application according to claim 3, wherein the step of intercepting the running interface of the WEB application after the corresponding target test operation is executed by the screenshot indication further includes:
and uploading the running interface to a storage platform and encrypting the running interface.
5. The method for realizing automatic test of WEB applications according to claim 3, wherein after the edited test case file is executed by calling headless browser function of playright, the method further comprises:
selecting at least two intercepted operation interfaces as operation interfaces to be compared for comparison, marking out difference information between the operation interfaces to be compared and displaying the difference information.
6. The method for realizing automated testing of WEB applications according to claim 1,
if the test case file comprises an assertion indication;
executing the edited test case file by calling a headless browser function of playright comprises the following steps:
determining whether a specified copy, control and/or path address element exists in the execution result until the assertion indication is added;
comparing specified copy, control, and/or path address element values in the execution result until the assertion indication is added to expected values.
7. The utility model provides a device for realize WEB application automated test which characterized in that includes:
the first receiving module is used for receiving the editing operation of a user on a test case file of the WEB application, and a plurality of test operations of the user on the WEB application are recorded in the test case file;
the editing module is used for responding to the editing operation, calling an increasing indication function of playright, and adding a function code indicated by one-key screenshot and/or a function code indicated by assertion at a target testing operation in the test case file to obtain an edited test case file, wherein the assertion indication comprises at least one of the following items: a case assertion indication, a control assertion indication, and a path address assertion indication;
the execution module is used for executing the edited test case file by calling a headless browser function of playright to generate an execution result, wherein when the edited test case file is executed, the function code indicated by the screenshot and/or the function code indicated by the assertion are/is executed at the target test operation;
and the report generating module is used for generating a test report according to the execution result.
8. The apparatus for implementing automated test for WEB applications according to claim 7, further comprising:
the second receiving module is used for receiving a recording case request of a user;
the connection module is used for responding to the recording case request and connecting with a terminal corresponding to the user;
the third receiving module is used for receiving a command of starting recording of a user;
the recording module is used for responding to the command for starting recording, sending a recording script to the terminal and executing the recording script on the terminal, wherein the recording script calls a browser in playright when executing the recording script, and generates a test case file according to the test operation of a user in the browser;
and the fourth receiving module is used for receiving and storing the test case file returned by the terminal.
9. A server, comprising a processor, a memory, and a program or instructions stored on the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method for automated testing of Web applications according to any of claims 1-6.
10. A readable storage medium storing thereon a program or instructions, which when executed by a processor, implement the steps of the method for implementing automated testing of WEB applications according to any of claims 1 to 6.
CN202110506580.1A 2021-05-10 2021-05-10 Method and device for realizing WEB application automatic test Active CN112988605B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110506580.1A CN112988605B (en) 2021-05-10 2021-05-10 Method and device for realizing WEB application automatic test

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110506580.1A CN112988605B (en) 2021-05-10 2021-05-10 Method and device for realizing WEB application automatic test

Publications (2)

Publication Number Publication Date
CN112988605A CN112988605A (en) 2021-06-18
CN112988605B true CN112988605B (en) 2021-07-16

Family

ID=76337396

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110506580.1A Active CN112988605B (en) 2021-05-10 2021-05-10 Method and device for realizing WEB application automatic test

Country Status (1)

Country Link
CN (1) CN112988605B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114281680B (en) * 2021-12-03 2024-01-12 苏州浪潮智能科技有限公司 Web automatic testing method and system
CN115237813A (en) * 2022-09-19 2022-10-25 平安银行股份有限公司 Script generation and test method, electronic device and computer storage medium
CN115658496A (en) * 2022-10-21 2023-01-31 北京志凌海纳科技有限公司 Extensible Web automatic test method, system, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2000002143A1 (en) * 1998-07-07 2000-01-13 Versaware Technologies, Ltd. Digital publishing and dynamic integration
US7979145B1 (en) * 2007-04-24 2011-07-12 Beck Keith E Method of script selection
CN108509339A (en) * 2018-03-22 2018-09-07 京北方信息技术股份有限公司 Method for generating test case, device based on browser and mind map and equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2000002143A1 (en) * 1998-07-07 2000-01-13 Versaware Technologies, Ltd. Digital publishing and dynamic integration
US7979145B1 (en) * 2007-04-24 2011-07-12 Beck Keith E Method of script selection
CN108509339A (en) * 2018-03-22 2018-09-07 京北方信息技术股份有限公司 Method for generating test case, device based on browser and mind map and equipment

Also Published As

Publication number Publication date
CN112988605A (en) 2021-06-18

Similar Documents

Publication Publication Date Title
CN112988605B (en) Method and device for realizing WEB application automatic test
US9076072B2 (en) System and method for web page rendering test automation suite
US20100211865A1 (en) Cross-browser page visualization generation
CN105302722B (en) CTS automatic testing method and device
CN110808897A (en) Proxy access method, user equipment, storage medium, device and system
WO2019227708A1 (en) Online debugging apparatus and method for test case, and computer-readable storage medium
CN115065652B (en) Message reply method and device, storage medium and computer equipment
EP3968145A1 (en) Apparatus and method for executing customized artificial intelligence production line, and device and medium
US20140082582A1 (en) Resource Tracker
CN111045941B (en) Positioning method and device for user interface control and storage medium
CN113760763A (en) Software testing method, device, server and system
WO2020177519A1 (en) Debugging method executed on smart terminal and software debugging device
CN110825600B (en) Page information processing method, server and page display device
CN115658529A (en) Automatic testing method for user page and related equipment
CN112231206A (en) Script editing method for application program test, computer readable storage medium and test platform
CN107846344B (en) Method and device for pushing messages in batch in instant messaging tool and electronic equipment
CN112905441A (en) Test case generation method, test method, device and equipment
CN110543429A (en) Test case debugging method and device and storage medium
EP2883134A1 (en) Executable software specification generation
US11106571B2 (en) Identification of input object in a graphical user interface
CN115470152A (en) Test code generation method, test code generation device, and storage medium
CN113590564B (en) Data storage method, device, electronic equipment and storage medium
CN111708519B (en) Service component processing method, device, equipment and storage medium
JP6097231B2 (en) Program generating apparatus and method
CN109324822B (en) PWA (public warning assistant) item detection method, computer-readable storage medium and terminal device

Legal Events

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