CN115658496A - Extensible Web automatic test method, system, equipment and storage medium - Google Patents

Extensible Web automatic test method, system, equipment and storage medium Download PDF

Info

Publication number
CN115658496A
CN115658496A CN202211291051.5A CN202211291051A CN115658496A CN 115658496 A CN115658496 A CN 115658496A CN 202211291051 A CN202211291051 A CN 202211291051A CN 115658496 A CN115658496 A CN 115658496A
Authority
CN
China
Prior art keywords
test
indication
assertion
function code
interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211291051.5A
Other languages
Chinese (zh)
Inventor
孟靖
杨胜洁
徐文豪
王弘毅
张凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SmartX Inc
Original Assignee
SmartX Inc
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 SmartX Inc filed Critical SmartX Inc
Priority to CN202211291051.5A priority Critical patent/CN115658496A/en
Publication of CN115658496A publication Critical patent/CN115658496A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application provides an extensible Web automatic testing method, system, equipment and storage medium. The automatic testing method comprises the following steps: receiving operation data of a test case set in the test step, calling an indication function of playright in response to the operation data, and adding a function code indicated by a screenshot and a function code indicated by assertion at a target test operation position in the test case set to obtain an edited test case file; and executing a test case file execution test comprising executing the function code indicated by the screenshot and the function code indicated by the assertion at the target test operation by calling a browser of the playright to generate a test report, wherein an access interface of the test report corresponds to a specific hashID or a default hashID as a unique identifier. The technical scheme provided by the invention can generate a corresponding executable test case set aiming at the test scene requirement while improving the efficiency and reliability of the automatic test, so that the test service can carry out the expansion of the service test and/or the function test.

Description

Extensible Web automatic test method, system, equipment and storage medium
Technical Field
The present application relates to the field of automated testing technologies, and in particular, to an extensible Web automated testing method, system, device, and storage medium.
Background
At present, in the field of Web testing, many automated testing tools are available on a UI layer, different testing tools mainly include Robot Framework, selenium, katalon Studio and the like, different testing tools have their own characteristics and application ranges, but an existing testing tool cannot perform a complete Web test, and none of the existing testing tools can meet all requirements for product testing in actual production, for example, when test requirements for UI, functional flow, performance acquisition and the like cannot be met at the same time, when an actual result of an automated test is verified, only display information on an interface is usually verified and compared, information in other aspects such as resource correctness of mail downloading and the like is not verified and compared, and a failed scene is inconvenient to reproduce and trace.
When different systems need specific test verification requirements, the existing Web test is difficult to expand and cannot be applied to a scene with complex or diversified test verification requirements, and the expandability, the test efficiency and the reliability of the test function test of the Web automatic test service are reduced.
Disclosure of Invention
Aiming at the defects in the prior art, the application provides an extensible Web automatic test method, a system, equipment and a storage medium, and realizes a Web automatic test clothes scheme suitable for various test requirements and test scenes.
In order to achieve the purpose, the invention adopts the following technical scheme:
a first aspect of the present application provides an extensible Web automated testing method, which specifically includes:
receiving operation data of a user on a to-be-tested case set of the Web application, wherein the test case set records the operation data of each test step of the user on the Web application;
responding to the operation data, calling an indication function of playright, adding a function code indicated by screenshot and a function code indicated by assertion at a target test operation position of a test case set to be tested, and obtaining an edited test case file;
wherein the assertion indication comprises at least one of: an element assertion indication;
the screenshot indication includes at least one of: control indication, picture indication and text indication;
executing the edited test case file by calling a browser of playright to generate an execution result, wherein when the edited test case file is executed, the function code indicated by the screenshot and the function code indicated by the assertion are executed at the target test operation position;
and realizing continuous integration and continuous delivery of the Web automation test based on a container scheme, and generating a test report according to an execution result, wherein an access interface of the test report corresponds to a specific hashID or a default hashID as a unique identifier.
In one possible implementation manner of the first aspect, adding function code indicated by the assertion, and executing the function code indicated by the assertion at the target test operation includes:
calling a playright framework to realize the operation and access of the element assertion indication and the path address assertion indication;
converting the element assertion indication into an XML file, calling key elements of the XML file to position, and then executing a function code of the assertion indication at a target test operation;
and comparing the element value corresponding to the element information with an expected value to acquire an execution result under the condition that whether the specified element information exists in the execution result.
In a possible implementation manner of the first aspect, adding function code indicated by a screenshot, and executing the function code indicated by the screenshot at the target test operation includes:
calling a screenshot method to intercept a snapshot of the running interface to be compared and/or a snapshot of a reference interface;
transmitting the intercepted operation interface to be compared and the intercepted reference interface to a picture snapshot interface for comparison, calculating and displaying difference information of the operation interface to be compared and the intercepted reference interface, and acquiring an execution result;
wherein the difference information comprises difference pixel values of the control and/or the picture and/or the text;
the reference interface comprises an interface in operation and/or a preset saved interface.
In a possible implementation manner of the first aspect, the Web automation test method further includes:
adding a screen recording instruction at a target test operation position;
responding to a screen recording instruction, executing a screen recording function, and recording the whole process of page testing;
and reproducing the test flow under the condition that the page test fails.
In a possible implementation manner of the first aspect, the Web automation test method further includes:
adding a function code for verifying the file resource at the target test operation part, responding to a request for verifying the file resource, and acquiring a download link of the file resource;
downloading the file resources is executed, and an MD5 value to be verified corresponding to the file resources is generated;
comparing the MD5 value to be verified with the standard MD5 value to obtain an execution result;
and the standard MD5 value is a standard MD5 value corresponding to the standard file which is audited without errors and stored persistently.
In a possible implementation manner of the first aspect, the Web automation test method further includes:
adding function codes of page performance test at the target test operation;
responding to the performance test based on the Lighthouse, and transmitting the address to be tested into the interface for acquiring the performance test report, and acquiring an execution result.
In a possible implementation manner of the first aspect, the generating a test report according to the execution result includes:
the method comprises the steps of realizing a continuous integration and continuous delivery method of Web automatic testing based on a container scheme, selecting an automatic integration tool to create an automatic testing task, and generating a testing report for functional testing and/or business testing after successful testing deployment;
under the condition that the query requirement of the generated test report comprises a part of execution results, constructing a specific hashID comprising a specific field through the setting of a custom parameter;
constructing a default hashID under the condition that the query requirement of the generated test report comprises all execution results;
and viewing a test report through the specific hashID or the default hashID as an interface for public access, wherein the test report comprises a part of execution results or all execution results.
A second aspect of the present application provides an extensible Web automated testing system, which executes the foregoing Web automated testing method, and specifically includes:
the receiving unit is used for receiving the operation data of a user on a to-be-tested case set of the Web application, and the test case set records the operation data of each test step of the user on the Web application;
the response unit is used for responding to the operation data, calling an indication function of playright, adding a function code indicated by screenshot and a function code indicated by assertion at a target test operation position in the test case set to be tested, and obtaining an edited test case file; wherein the assertion indication comprises at least one of: an element assertion indication; the screenshot indication includes at least one of: control indication, picture indication and text indication;
the execution unit is used for executing the edited test case file by calling a browser of playright and generating an execution result, wherein when the edited test case file is executed, the function code indicated by the screenshot and the function code indicated by the assertion are executed at the target test operation;
and the test report generating unit is used for realizing continuous integration and continuous delivery of the Web automation test based on the container scheme, and generating a test report according to an execution result, wherein an access interface of the test report corresponds to the specific hashID or the default hashID and serves as a unique identifier.
A third aspect of the present application provides an extensible Web automation test device, which executes the foregoing Web automation test method, and specifically includes:
a memory for storing a computer program;
and the processor is used for realizing the extensible Web automatic testing method when executing the computer program.
A fourth aspect of the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the foregoing extensible Web automation testing method.
Through the technical scheme that this application provided, possess following beneficial technological effect at least:
1. the application provides an extensible Web automatic test method which can comprise the steps of accessing links, operating pages and assertions, recording a screen, comparing screenshots, collecting performance, verifying downloaded resource content, testing reports and continuously integrating, and can improve the test efficiency and reliability while realizing Web automatic test of a system.
2. The Web automatic test scheme based on the framework can also support multiple projects, and only corresponding executable test cases are generated in corresponding test services according to corresponding test scene requirements, so that the test services are correspondingly expanded under the framework.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments with reference to the following drawings:
FIG. 1 illustrates a flow diagram of an extensible Web automation testing method, in accordance with an embodiment of the present application;
FIG. 2 illustrates a schematic diagram of a Web automated testing process including screen recording, according to an embodiment of the application;
FIG. 3 illustrates a Web automated testing flow diagram including document resource validation, according to an embodiment of the application;
FIG. 4 is a schematic diagram illustrating a Web automation test flow including a page performance test, according to an embodiment of the application;
FIG. 5 illustrates an extensible Web automation test system according to an embodiment of the present application;
fig. 6 shows a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The present invention will be described in detail with reference to specific examples. The following examples will aid those skilled in the art in further understanding the present invention, but are not intended to limit the invention in any manner. It should be noted that variations and modifications can be made by persons skilled in the art without departing from the concept of the invention. All falling within the scope of the present invention.
The term "including" and variations thereof as used herein is intended to be open-ended, i.e., "including but not limited to". Unless specifically stated otherwise, the term "or" means "and/or". The term "based on" means "based at least regionally. The terms "one example embodiment" and "one embodiment" mean "at least one example embodiment". The term "another embodiment" means "at least one additional embodiment". The terms "first," "second," and the like may refer to different or the same objects. Other explicit and implicit definitions are also possible below.
The problems existing in the prior art are solved. In some embodiments provided by the present invention, fig. 1 illustrates a flow diagram of an extensible Web automation testing method. As shown in fig. 1, the extensible Web automation test method may include:
step 100: and receiving operation data of a user on a to-be-tested case set of the Web application, wherein the test case set records the operation data of each test step of the user on the Web application. It can be understood that the test case compiling guidance is provided by unifying the test case compiling specification in the Web automatic test, and the readability, the performability and the reasonability of the compiled test case are improved.
Step 200: and responding to the operation data, calling an indication function of playwright, adding a function code indicated by the screenshot and a function code indicated by the assertion at a target test operation position in the test case set to be tested, and obtaining an edited test case file. It will be appreciated that the Web page may include in the automated test: text: for obtaining information between the tag pairs; title: the method comprises the steps of obtaining a title of a current page; current _ url: the method comprises the steps of obtaining a website of a current page; get _ attribute: acquiring element assertion indication, screenshot indication and the like of certain attribute and the like of an element, comparing an actual result with an expected result through the assertion indication and the screenshot indication, and realizing the verification of the correctness of the functional process by adding the screenshot indication and the assertion indication in the playright frame through the playright frame.
Wherein the assertion indication comprises at least one of: an element assertion indication; the screenshot indication includes at least one of: control indication, picture indication and text indication.
Step 300: and executing the edited test case file by calling a browser of playright to generate an execution result, wherein the function code indicated by the screenshot and the function code indicated by the assertion are executed at the target test operation when the edited test case file is executed. It can be understood that, when the test is executed, the added assertion indication and the function code indicated by the screenshot are run to the screenshot indication and the assertion indication input in the function code by the user through the program, so that the program runs in the added function code to execute the test, and the output of the assertion result and the verification result is realized after the test is run.
Step 400: the method is used for realizing continuous integration and continuous delivery of the Web automation test based on a container scheme, and generating a test report according to an execution result, wherein an access interface of the test report corresponds to a specific hashID or a default hashID as a unique identifier. It can be understood that each test execution will take the hash ID of the continuous delivery execution, and then the test report service generated by the execution result obtains the corresponding test report according to the hash ID, and any corresponding test report corresponds to the interface of the public access based on the hash ID as the unique identifier for viewing the test report.
Adding the function code indicated by the assertion to the step 300, wherein executing the function code indicated by the assertion at the target test operation comprises:
calling a playright framework to realize the operation and access of the element assertion indication and the path address assertion indication;
converting the element assertion indication into an XML file, calling key elements of the XML file for positioning, and executing a function code of the assertion indication at a target test operation;
and comparing the element value corresponding to the element information with an expected value to acquire an execution result under the condition that whether the specified element information exists in the execution result.
It can be understood that, in the playright, a corresponding element may be selected directly through a page text character, the text information to be processed including URL access and element operation is obtained through a playright framework, the element location information is extracted into an XML file, a related element in the XML file is called during location, or the XML file is subjected to interception processing and the like, including XPath, using a path expression to select a node or a node set in the XML file, the related element in the XML file is directly called, a key element of assertion is obtained to generate a corresponding test scenario, then the page element is subjected to operations such as clicking and sliding, and an operation feedback result is asserted, and correspondingly, in a character string, a comparison between two objects mainly asserts whether an element value of a character string of the page element reaches an expected value in a manner of is, in, = and the like.
In step 300, adding the function code indicated by the screenshot, and executing the function code indicated by the screenshot at the target test operation includes:
calling a screenshot method to intercept a snapshot of the running interface to be compared and/or a snapshot of a reference interface;
transmitting the intercepted operation interface to be compared and the intercepted reference interface to a picture snapshot interface for comparison, calculating and displaying difference information of the operation interface to be compared and the intercepted reference interface, and acquiring an execution result;
wherein the difference information comprises difference pixel values of the control and/or the picture and/or the text;
the reference interface comprises an interface in operation and/or a preset saved interface.
It can be understood that, a snapshot is intercepted by calling a screenshot method, the snapshot comprises a snapshot 1 of the to-be-tested interface of the snapshot of the line interface and a snapshot 2 serving as a reference interface, the snapshot 1 and the snapshot 2 are transmitted to a picture snapshot interface, a comparison result of the snapshot 1 and the snapshot 2 is returned according to the interface, and whether an expected result is met or not is judged according to difference information included in the comparison result; or calling a screenshot method to intercept the snapshot, wherein the snapshot comprises a snapshot 1 'of the interface to be tested of the snapshot of the line interface, meanwhile, a locally preset and saved interface snapshot 2' is called, and whether the expected result is met or not is judged according to the difference information included in the comparison result.
In some embodiments of the present application, the picture snapshot interface may be implemented based on pixelmatch, which is a pixel-level image comparison library based on which an interface to obtain diff images is packaged. The interface is designed to receive two pictures with the same size through corresponding parameter setting, then the difference rate of the snapshot 1 (1 ') and the snapshot 2 (2') is obtained through a pixel comparison algorithm of pixelmatch, difference information is obtained, and a difference recording picture including the difference information is generated according to the difference information and stored in an internal memory so as to generate a corresponding test report according to the difference recording picture.
In some embodiments of the present application, the snapshot obtained through the screenshot indication may be used to verify correctness of a page UI style, a picture, and a text, and a person skilled in the art may also select a suitable service flow for verification according to actual needs.
For example, after a project is on-line, the snapshot of all pages in the project is captured through automatic verification indicated by the screenshot, the snapshot is determined as a unique reference value, and after iteration updating is required subsequently, the difference between the two snapshots is obtained by the screenshot of the iterated project page and the previously stored unique reference value together through a snapshot interface, so that specific information modified or influenced by the iteration is quickly located.
In some embodiments of the present application, fig. 2 shows a schematic diagram of a Web automated testing process including screen recording. As shown in fig. 2, the extensible Web automation test method may further include:
adding a screen recording instruction at a target test operation position;
responding to a screen recording instruction, executing a screen recording function, and recording the whole process of page testing;
and reproducing the test flow under the condition that the page test fails.
It can be understood that, by adding a screen recording instruction by using the add _ script _ tag method of playright or playright evaulte, a screen JS file is recorded, and by this step, the whole page test flow can be recorded, so that when the automatic test fails to be performed, an operation path can be reproduced through the file stored in the screen, and the reason of the test failure can be tracked.
In some embodiments of the present application, fig. 3 shows a schematic diagram of a Web automation test flow including document resource validation. As shown in fig. 3, the extensible Web automation test method may further include:
adding a function code for verifying the file resource at the target test operation part, responding to a request for verifying the file resource, and acquiring a download link of the file resource;
downloading the file resources is executed, and an MD5 value to be verified corresponding to the file resources is generated;
comparing the MD5 value to be verified with the standard MD5 value to obtain an execution result;
and the standard MD5 value is a standard MD5 value corresponding to the standard file which is audited without errors and stored persistently.
It can be understood that, in the flow of the automatic test of downloading of the file resource, the operation element can be simulated through the function code of the file resource verification to fill in the form to trigger the sending of the mail, the relevant mail is searched through the mail service API, the soup library is called to process the mail API to return the result to obtain the download link of the file resource, if the resource file is relevant to change, the file in the mail is obtained through the corresponding file resource download link and the MD5 value of the changed file is stored, if the MD5 value and the standard MD5 value of the same resource are consistent, it can be determined that the newly obtained file resource is correct, otherwise, the file resource is incorrect, the test result is obtained and sent to the test report interface.
In some embodiments of the present application, it is possible to manually ensure that the downloaded file content is correct when downloading the file resource for the first time, and persistently store the MD5 value of the standard file as the standard MD5 value for the reference value of the file resource verification.
In some embodiments of the present application, the mail service is implemented based on an open source scheme mailDev, the mailDev provides an SMTP service for receiving mails and a mail client, a test mail needs to be integrated into a test environment of codes, a corresponding test case set execution function code is sent to a corresponding mail client, and then the test case set acquires corresponding mail content as a file resource by acquiring a file resource download link. For example, subsequent iterations of downloading file-related codes by an email may affect the correctness of file resources acquired in the email, so that an automated test needs to be performed on all existing file resources to verify the correctness of the resources.
In some embodiments of the present application, fig. 4 shows a schematic diagram of a Web automation test flow including a page performance test. As shown in fig. 4, the extensible Web automation test method may further include:
adding function codes of page performance test at the target test operation;
and responding to the performance test based on the Lighthouse, and transmitting the address to be tested into the interface for acquiring the performance test report, and acquiring an execution result.
It can be understood that the performance test case can be divided into five parts, namely an expected target user test, a user concurrent test, a fatigue strength and large data volume test, a network performance test and a server performance test, for example, how changes of bandwidth, delay, load and port influence the response time of a user through the network performance test; and testing the system for a long time by a certain load pressure under the condition that the system stably operates through a fatigue test.
In some embodiments of the present application, generating the test report according to the execution result includes: selecting an automatic integration tool to create an automatic test task for testing the functional test and/or the service test after the successful deployment and generating a test report; under the condition that the query requirement of the generated test report comprises a part of execution results, constructing a specific hashID comprising a specific field through the setting of a custom parameter; constructing a default hashID under the condition that the query requirement of the generated test report comprises all execution results; and viewing the test report by using the specific hashID or the default hashID as an open access interface, wherein the test report comprises a part of execution results or all execution results.
It can be understood that the configuration file corresponding to the automated test task implements a corresponding flow, and the execution of each step may be manual or automatic, for example, how to judge that the next step is automatically executed when a certain step in the preamble succeeds is critical in triggering the task execution of different warehouses, and it is necessary to construct a runner machine specially used for executing these constructions, and the runner machine needs to acquire the public key of the target machine, write the public key into the authority file, and then access the machine in which each test service is deployed; specifically, the runner can be deployed by using a docker container and used for isolating different running units, a task required to be executed at this time needs to be described in a configuration file corresponding to an automatic test task, the runner executes the task on the configuration file after reading the configuration file, and returns an execution result to pipeline after the execution is completed, that is, a corresponding shell command is executed to trigger an energy test and/or a service test of the project, each test task carries a hash ID for continuously paying for execution at this time, and then a corresponding test report is acquired according to the hash ID through a developed test report service.
It can be understood that the business test and/or the functional test related in the present application generates a test report by default, and all the tests show that for any one of the business test and/or the functional test, a corresponding test report is generated, such as a snapshot comparison test report and a mail test report, and then these reports are collected by a report service, and each test task is run by a CICD, so each construction process has a specific hashID or a default hashID as a unique identifier of each report, and the test report provides an interface for public access, and the corresponding test report can be obtained only by the hashID.
Specifically, after one test task is executed, the generation of the default hsahID can realize that all service tests and/or functional tests are accessed through the corresponding public access interfaces; specifically, when a user wants to view test reports of snapshot and file resources and ignore performance test reports, the user can obtain corresponding test reports by accessing xx.xx.xx/reportashid = xxx & content = snapshot, and a report service is not limited to a certain item, and can access the corresponding test reports based on the report service as long as the test reports are generated by different test interfaces used by the corresponding item.
It will be appreciated that after completing the automated flow of continued integrated unit testing and integration testing, continued delivery may automatically publish verified code to the repository, in order to achieve an efficient continued delivery flow, it is necessary to ensure that continued integration is built into the development pipeline. The goal of continuous delivery is to have a code library that can be deployed to the production environment at any time. The continuous integration and continuous delivery method may specifically include: manufacturing a mirror image template required by application containerization; using an automatic integration tool to establish a task of continuous integration, wherein the task comprises compiling, packaging and testing of codes and constructing a mirror image through a mirror image template; creating a task for continuous deployment using an automated integration tool; and using an automation integration tool to create an automation test task for testing the functions and the services of the new environment after successful deployment.
And after the test report is consulted and conforms to the preset period, executing the corresponding CI jobto deploy to the test environment, making a workflow through each defined task, and completing the definition of development, test, deployment and release processes adapting to the development mode of the user until the test is passed, so that the test can be deployed to the formal environment. The method has the advantages that the process is online, the delivery contents of all links are managed by using the CI/CD, certain communication cost is reduced, relevant cases of the automatic test are correspondingly maintained after the process is used, corresponding automatic test tasks can be automatically executed in research and development, and the QE is not needed to be relied on.
In some embodiments of the present application, fig. 5 provides a schematic structural diagram of an extensible Web automation test, which is applied to the extensible Web automation test method provided in the foregoing embodiments. Specifically, as shown in fig. 5, the extensible Web automation test system may include:
the receiving unit 001 is used for receiving operation data of a to-be-tested case set of the Web application by a user, and the test case set records the operation data of each test step of the Web application by the user;
the response unit 002 is configured to, in response to the operation data, invoke an indication function of playwright, add a function code indicated by a screenshot and a function code indicated by an assertion at a target test operation in the set of test cases to be tested, and obtain an edited test case file; wherein the assertion indication comprises at least one of: an element assertion indication; the screenshot indication includes at least one of: control indication, picture indication and text indication;
the execution unit 003 is configured to execute the edited test case file by calling a browser of playright, and generate an execution result, where when the edited test case file is executed, a function code indicated by the screenshot and a function code indicated by the assertion are executed at the target test operation;
and the test report generating unit 004 generates a test report according to the execution result, wherein an access interface of the test report corresponds to the specific hashID or the default hashID as the unique identifier.
It can be understood that the functions of the receiving unit 001 to the test report generating unit 004 in the functional modules correspond to the operations performed in the steps 100 to 400, and are not described herein again.
It should be understood that aspects of the present technology may be implemented as a system, method or program product. Accordingly, aspects of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining software and hardware aspects that may all generally be referred to herein as a "circuit," module "or" platform.
It will be understood by those skilled in the art that the elements or modules or steps of the invention described above may be implemented in a general purpose computing device, they may be centralized on a single computing device or distributed across a network of computing devices, and alternatively, they may be implemented in program code executable by a computing device, such that they may be stored on a storage medium and executed by a computing apparatus, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module.
Fig. 6 is a schematic structural diagram of an electronic device for implementing the extensible Web automation test method in the foregoing embodiment according to some embodiments of the present invention. An electronic apparatus 600 implemented according to the implementation method in the present embodiment is described in detail below with reference to fig. 6. The electronic device 600 shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of any embodiment of the technical solution of the present invention.
As shown in fig. 6, the electronic device 600 is embodied in the form of a general purpose computing device. The set-up of the electronic device 600 may include, but is not limited to: at least one processing unit 610, at least one memory unit 620, a bus 630 connecting the different platform components (including the memory unit 620 and the processing unit 610), a display unit 640, and the like.
The storage unit stores program codes, and the program codes can be executed by the processing unit 610, so that the processing unit 610 executes the implementation of each functional module in the extensible Web automation test system in this embodiment.
The storage unit 620 may include readable media in the form of volatile memory units, such as a random access unit (RAM) 6201 and/or a cache memory unit 6202, which may further include a read-only memory unit (ROM) 6203.
The memory unit 620 may also include a program/utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination of these examples may include an implementation of a network environment
Bus 630 may represent one or more of any of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an image acceleration port, a processing unit, or a local bus using any of a variety of bus architectures.
The audio-visual signal synchronization processing device 600 can also communicate with one or more external devices 700, such as a keyboard, pointing device, bluetooth device, etc., one or more devices that enable a user to interact with the electronic device 600, and/or any device (e.g., router, modem, etc.) that enables the electronic device to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 650. Also, the electronic device 600 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) through the network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 via the bus 630. It should be appreciated that although not shown in FIG. 6, other hardware and/or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms, to name a few.
In some embodiments of the present invention, a computer-readable storage medium is further provided, on which a computer program is stored, which, when being executed by a processor, can implement the implementation of each functional module in the display screen control system in the above disclosure.
Although this embodiment does not set forth any specific embodiments in detail, in some possible embodiments, the various aspects described in the technical solution of the present invention may also be implemented in the form of a program product, which includes program code for causing a terminal device to perform the steps according to the embodiments described in the various embodiments of the technical solution of the present invention in the area of the image stitching method in the technical solution of the present invention, when the program product runs on the terminal device.
A computer readable storage medium may include a data signal propagating in baseband or as a region of a carrier wave, carrying readable program code therein. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable storage medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the C language or similar programming languages. The program code may execute entirely on the user's computing device, regionally on the user's device, as a stand-alone software package, regionally on a remote computing device on the user's computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
In summary, the technical scheme provided by the invention can include accessing links, operating pages and assertions, screen recording, screenshot comparison, performance acquisition, verifying and downloading resource content, testing reports and continuous integration, and can realize Web automatic testing of a system and improve testing efficiency and reliability; the Web automatic test scheme based on the framework can also support multiple projects, and only corresponding executable test cases are generated in corresponding test services according to corresponding test scene requirements, so that the test services are correspondingly expanded under the framework.
The above description is only for the purpose of describing the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention, and any variations and modifications made by those skilled in the art based on the foregoing disclosure are within the scope of the appended claims.

Claims (10)

1. An extensible Web automation test method, characterized in that the method comprises:
receiving operation data of a user on a to-be-tested case set of the Web application, wherein the test case set records the operation data of each test step of the user on the Web application;
responding to the operation data, calling an indication function of playright, and adding a function code indicated by screenshot and a function code indicated by assertion at a target test operation position in the test case set to be tested to obtain an edited test case file;
wherein the assertion indication comprises at least one of: an element assertion indication;
the screenshot indication includes at least one of: control indication, picture indication and text indication;
executing the edited test case file by calling a browser of playwright to generate an execution result;
when the edited test case file is executed, executing the function code indicated by the screenshot and the function code indicated by the assertion at the target test operation;
and generating a test report according to the execution result, wherein an access interface of the test report corresponds to a specific hashID or a default hashID as a unique identifier.
2. The extensible Web automation testing method of claim 1, wherein adding the function code indicated by the assertion, executing the function code indicated by the assertion at the target testing operation comprises:
calling a playright framework to realize the operation and the access of the element assertion indication and the path address assertion indication;
converting the element assertion indication into an XML file, calling a key element of the XML file for positioning, and then executing a function code of the assertion indication at the target test operation;
and comparing an element value corresponding to the element information with an expected value under the condition that whether the specified element information exists in the execution result or not, and acquiring the execution result.
3. The extensible Web automation test method of claim 1, wherein adding screenshot-indicated function code, executing the screenshot-indicated function code at the target test operation comprises:
calling a screenshot method to intercept a snapshot of the running interface to be compared and/or a snapshot of a reference interface;
transmitting the intercepted operation interface to be compared and the reference interface to a picture snapshot interface for comparison, calculating and displaying difference information of the operation interface to be compared and the reference interface, and acquiring the execution result;
wherein the difference information comprises difference pixel values of a control and/or a picture and/or text;
the reference interface comprises an interface in operation and/or a preset saved interface.
4. The extensible Web-automation testing method of claim 1, further comprising:
adding a screen recording instruction at the target test operation;
responding to the screen recording instruction, executing a screen recording function, and recording the whole process of page testing;
and reproducing the test flow under the condition that the page test fails.
5. The extensible Web automation test method of claim 1, the method further comprising:
adding a function code for verifying the file resource at the target test operation part, responding to the request for verifying the file resource, and acquiring a download link of the file resource;
executing the downloading of the file resource, and generating an MD5 value to be verified corresponding to the file resource;
comparing the MD5 value to be verified with a standard MD5 value to obtain the execution result;
and the standard MD5 value is a standard MD5 value corresponding to a standard file which is audited without errors and is stored persistently.
6. The extensible Web automation test method of claim 1, the method further comprising:
adding function codes of page performance test at the target test operation;
responding to the performance test based on the Lighthouse, and transmitting the address to be tested into the interface for obtaining the performance test report, and obtaining the execution result.
7. The extensible Web automation test method of any one of claims 1-6, wherein generating the test report based on the execution result comprises:
selecting an automatic integration tool to create an automatic test task for functional testing and/or business testing after successful test deployment and generating the test report;
under the condition that the query requirement of the generated test report comprises part of the execution result, constructing a specific hashID comprising a specific field through setting of a custom parameter;
constructing a default hashID under the condition that the query requirement of the generated test report comprises all the execution results;
and viewing the test report by using the specific hashID or the default hashID as an interface for public access, wherein the test report comprises a part of execution results or all execution results.
8. An extensible Web automated test system for performing the Web automated test method of any of claims 1-7, the system comprising:
the receiving unit is used for receiving operation data of a user on a to-be-tested case set of the Web application, and the test case set records the operation data of each test step of the user on the Web application;
the response unit is used for responding to the operation data, calling an indication function of playright, and adding a function code indicated by screenshot and a function code indicated by assertion at a target test operation position in the test case set to be tested to obtain an edited test case file; wherein the assertion indication comprises at least one of: an element assertion indication; the screenshot indication includes at least one of: control indication, picture indication and text indication;
the execution unit is used for executing the edited test case file by calling a browser of playright to generate an execution result, wherein when the edited test case file is executed, the function code indicated by the screenshot and the function code indicated by the assertion are executed at the target test operation;
and the test report generating unit is used for generating a test report according to the execution result, and an access interface of the test report corresponds to a specific hashID or a default hashID and is used as a unique identifier.
9. An extensible Web automation test device, comprising:
a memory for storing a computer program;
a processor for implementing the extensible Web automation test method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, which computer program, when executed by a processor, implements the extensible Web automation testing method of any one of claims 1 to 7.
CN202211291051.5A 2022-10-21 2022-10-21 Extensible Web automatic test method, system, equipment and storage medium Pending CN115658496A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211291051.5A CN115658496A (en) 2022-10-21 2022-10-21 Extensible Web automatic test method, system, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211291051.5A CN115658496A (en) 2022-10-21 2022-10-21 Extensible Web automatic test method, system, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115658496A true CN115658496A (en) 2023-01-31

Family

ID=84988493

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211291051.5A Pending CN115658496A (en) 2022-10-21 2022-10-21 Extensible Web automatic test method, system, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115658496A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116414699A (en) * 2023-03-13 2023-07-11 深圳华锐分布式技术股份有限公司 Operation and maintenance testing method, device, equipment and medium
CN116932414A (en) * 2023-09-14 2023-10-24 深圳市智慧城市科技发展集团有限公司 Method and equipment for generating interface test case and computer readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070277158A1 (en) * 2006-02-24 2007-11-29 International Business Machines Corporation Method and apparatus for testing of business processes for Web services
US8239820B1 (en) * 2005-07-18 2012-08-07 Progress Software Corporation Compliance method and system for XML-based applications
CN109144856A (en) * 2018-07-27 2019-01-04 北京皮尔布莱尼软件有限公司 A kind of UI automated testing method calculates equipment and storage medium
CN112988605A (en) * 2021-05-10 2021-06-18 云账户技术(天津)有限公司 Method and device for realizing WEB application automatic test
CN114281680A (en) * 2021-12-03 2022-04-05 苏州浪潮智能科技有限公司 Web automatic testing method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8239820B1 (en) * 2005-07-18 2012-08-07 Progress Software Corporation Compliance method and system for XML-based applications
US20070277158A1 (en) * 2006-02-24 2007-11-29 International Business Machines Corporation Method and apparatus for testing of business processes for Web services
CN109144856A (en) * 2018-07-27 2019-01-04 北京皮尔布莱尼软件有限公司 A kind of UI automated testing method calculates equipment and storage medium
CN112988605A (en) * 2021-05-10 2021-06-18 云账户技术(天津)有限公司 Method and device for realizing WEB application automatic test
CN114281680A (en) * 2021-12-03 2022-04-05 苏州浪潮智能科技有限公司 Web automatic testing method and system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116414699A (en) * 2023-03-13 2023-07-11 深圳华锐分布式技术股份有限公司 Operation and maintenance testing method, device, equipment and medium
CN116414699B (en) * 2023-03-13 2023-12-08 深圳华锐分布式技术股份有限公司 Operation and maintenance testing method, device, equipment and medium
CN116932414A (en) * 2023-09-14 2023-10-24 深圳市智慧城市科技发展集团有限公司 Method and equipment for generating interface test case and computer readable storage medium
CN116932414B (en) * 2023-09-14 2024-01-05 深圳市智慧城市科技发展集团有限公司 Method and equipment for generating interface test case and computer readable storage medium

Similar Documents

Publication Publication Date Title
US7643982B2 (en) Debugging prototyped system solutions in solution builder wizard environment
US7770151B2 (en) Automatic generation of solution deployment descriptors
US7617486B2 (en) Method and system to automate software testing using sniffer side and browser side recording and a toolbar interface
US7620885B2 (en) Automatic generation of documentation for component-based computing solution
US8839107B2 (en) Context based script generation
CN108845940B (en) Enterprise-level information system automatic function testing method and system
EP2228726B1 (en) A method and system for task modeling of mobile phone applications
US20080126390A1 (en) Efficient stress testing of a service oriented architecture based application
CN115658496A (en) Extensible Web automatic test method, system, equipment and storage medium
US8301720B1 (en) Method and system to collect and communicate problem context in XML-based distributed applications
US20070240118A1 (en) System, method, and software for testing a software application
US11226830B2 (en) System for building, managing, deploying and executing reusable analytical solution modules for industry applications
CN101866315B (en) Test method and system of software development tool
US20140059513A1 (en) Creation and Uploading of Archives for Software Projects to Submission Portal
US11449414B2 (en) Mapping test parameter data elements during heterogeneous component-based testing in a portable automation framework in both API mode and UI mode
US8661414B2 (en) Method and system for testing an order management system
US11741002B2 (en) Test automation systems and methods using logical identifiers
US20210117313A1 (en) Language agnostic automation scripting tool
CN115658529A (en) Automatic testing method for user page and related equipment
US11422783B2 (en) Auto-deployment of applications
CN110727575B (en) Information processing method, system, device and storage medium
US11269712B1 (en) Customized categorial error handling framework for heterogeneous component-based testing in a portable automation framework
US20220066915A1 (en) Controlling heterogeneous component-based testing in a portable automation framework with test scripts in both api mode and ui mode
CN116166907B (en) Method and device for developing Web application by using WebAsssembly and service page compiling technology
CN117112060A (en) Component library construction method and device, electronic equipment and storage 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