CN110928772A - Test method and device - Google Patents

Test method and device Download PDF

Info

Publication number
CN110928772A
CN110928772A CN201911072997.0A CN201911072997A CN110928772A CN 110928772 A CN110928772 A CN 110928772A CN 201911072997 A CN201911072997 A CN 201911072997A CN 110928772 A CN110928772 A CN 110928772A
Authority
CN
China
Prior art keywords
node
dom
target
type
test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911072997.0A
Other languages
Chinese (zh)
Other versions
CN110928772B (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.)
WeBank Co Ltd
Original Assignee
WeBank 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 WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN201911072997.0A priority Critical patent/CN110928772B/en
Publication of CN110928772A publication Critical patent/CN110928772A/en
Priority to PCT/CN2020/125167 priority patent/WO2021088724A1/en
Application granted granted Critical
Publication of CN110928772B publication Critical patent/CN110928772B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/03Credit; Loans; Processing thereof

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • General Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Computer Hardware Design (AREA)
  • Development Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Technology Law (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention discloses a testing method and a testing device, wherein a testing case is obtained by recording the operation of a user on a testing interface, if the testing case is determined to be tested, the testing interface is played back according to the operation information of the user on one or more DOM nodes, and after the operation playback corresponding to each DOM node is finished, a first interface obtained by playback and a standard interface corresponding to the operation are rendered. By automatically executing the assertion after each operation is finished, the user does not need to manually set the assertion condition, so that the user without programming ability can also use the method to perform the front-end interface test, the use threshold is low, and the degree of the automatic test is higher; and the first interface and the standard interface are rendered, so that a user can visually check the difference data in the test result, and compared with the mode of giving a test report by the existing test method, the user experience is better.

Description

Test method and device
Technical Field
The invention relates to the technical field of financial technology (Fintech), in particular to a testing method and a testing device.
Background
With the development of computer technology, more and more technologies are applied in the financial field, and the traditional financial industry is gradually changing to financial technology (Fintech), however, the financial technology also puts higher demands on the technology due to the requirements of security and real-time performance of the financial industry. The front-end interface test is a conventional operation of financial interface development, and the conventional interface test method usually needs to arrange testers in advance, and use the testers to repeatedly click DOM nodes on the test interface in each interface test process, however, this method is very dependent on manual work, the test efficiency is low, and the difference of manual operation may cause inaccurate test results.
To solve the above problem, in one possible implementation, the automated interface testing work can be implemented using existing automated testing software, such as sikuli software, selenium software, katalon software, and the like. However, these software usually require some programming ability for the user, resulting in a low degree of automated testing and a poor user experience; for example, the selenium software usually needs to manually set an assertion condition, that is, a user needs to input a statement for controlling the assertion condition in a selenium software interface by using a programming language supported by the selenium software, so that the selenium software asserts at a position where the assertion condition is satisfied when the interface test is performed, and if the statement for controlling the assertion condition is not set by the user or the statement set by the user is incorrect, the selenium software cannot obtain an accurate test result.
In summary, a testing method is needed to solve the technical problems of low degree of automated testing and poor user experience caused by the requirement of a user to have a certain programming capability in the existing automated testing software.
Disclosure of Invention
The embodiment of the invention provides a testing method and a testing device, which are used for solving the technical problems of low degree of automatic testing and poor user experience caused by the fact that a user needs to have certain programming capability in the existing automatic testing software.
In a first aspect, a testing method provided in an embodiment of the present invention includes:
recording the operation of a user on a test interface to obtain a test case, wherein the test case comprises operation information of the user on operating one or more DOM nodes on a DOM tree corresponding to the test interface; further, if the test case is determined to be tested, the test interface is played back according to the operation information of the user for operating the one or more DOM nodes, and after the operation playback corresponding to each DOM node is finished, the first interface obtained through playback and the standard interface corresponding to the operation are rendered according to the test result corresponding to the operation.
In the design, the assertion is automatically executed after the operation of each DOM node is finished, so that the assertion condition is not required to be manually set by a user, and the user without programming capability can also use the method to perform front-end interface test, so that the use threshold is low, and the degree of automatic test is higher; and after the operation playback of each DOM node is finished, the first interface and the standard interface are rendered according to the test result of the playback operation, so that a user can visually check the difference data in the test result.
In one possible design, the recording the operation of the user on the test interface to obtain the test case includes: determining a target DOM node triggered by the user from a DOM tree corresponding to the test interface aiming at any operation of the user on the test interface; determining a positioning identifier of the target DOM node in the DOM tree according to the identifier and the type of the target DOM node and/or the hierarchical relation of the target DOM node in the DOM tree, and generating test data corresponding to the operation according to the positioning identifier of the target DOM node in the DOM tree, the type of the operation, the content of the operation and the time information of the operation and the previous operation; and generating the test case according to the test data corresponding to each operation of the user on the test interface.
In the above design, the location identifier of the target DOM node in the DOM tree is determined by using the identifier and the type of the target DOM node and/or the hierarchical relationship of the target DOM node in the DOM tree, and a simpler calculation condition can be selected according to actual conditions to calculate the location identifier of the target DOM node.
In one possible design, the determining, according to the identifier and the type of the target DOM node and/or the hierarchical relationship of the target DOM node in the DOM tree, the location identifier of the target DOM node in the DOM tree includes: judging whether the identification of the target DOM node belongs to a first type identification, if so, taking the identification of the target DOM node as a positioning identification of the target DOM node, wherein the first type identification is used for uniquely identifying the target DOM node during recording and playback; if not, judging whether the type of the target DOM node is the only type in the DOM tree, if so, taking the type of the target DOM node as a positioning identifier of the target DOM node, and if not, determining the positioning identifier of the target DOM node according to the hierarchical relation of the target DOM node in the DOM tree.
In the design, the calculation logic of the first identification, the second type and the last hierarchical relationship is set, so that the positioning identification of the target DOM node can be quickly calculated, and compared with the mode of calculating the positioning identification of each target DOM node by using the absolute path of the target DOM node in the prior art, the calculation complexity can be greatly reduced, and the test efficiency is improved.
In one possible design, the determining, according to the hierarchical relationship of the target DOM node in the DOM tree, the location identifier of the target DOM node includes: judging whether a father node of the target DOM node exists or not, if not, determining a positioning identifier of the target DOM node according to the sequence of the type of the target DOM node in the DOM tree; if the DOM node exists, combining the type of the father node of the target DOM node and the type of the target DOM node to obtain a primary combination type corresponding to the target DOM node, judging whether the primary combination type corresponding to the target DOM node is the only type in the DOM tree, if so, taking the primary combination type corresponding to the target DOM node as a positioning identifier of the target DOM node, if not, judging whether the father node of the target DOM node exists, and if not, determining the positioning identifier of the target DOM node according to the sequence of the primary combination type corresponding to the target DOM node in the DOM tree; and if so, combining the type of the father node of the target DOM node, the type of the father node of the target DOM node and the type of the target DOM node to obtain a secondary combination type corresponding to the target DOM node, and determining the positioning identifier of the target DOM node according to the secondary combination type corresponding to the target DOM node.
In the design, the combination type corresponding to the target DOM node is obtained by gradually calling the father node, the combination type is directly used as the positioning identifier when the combination type is unique, the combination type is obtained by calling the father node of the higher level when the combination type is not unique, the positioning identifier can be quickly determined according to the father node which is closer to the target DOM node, the positioning identifier is determined without using the complete path of the target DOM node in the DOM tree, and therefore the data volume required to be processed by testing can be reduced on the basis of ensuring the uniqueness of the positioning identifier, and the testing efficiency is improved.
In one possible design, the determining whether the identifier of the target DOM node is a first type identifier includes: and if the identification of the target DOM node consists of numbers, determining that the identification of the target DOM node does not belong to the first type identification, and if the identification of the target DOM node comprises characters except the numbers, determining that the identification of the target DOM node belongs to the first type identification.
In the design, the timestamp, the equipment identifier and the like are both composed of numbers, and if the timestamp or the equipment identifier is used as the identifier of the target DOM node, the identifier of the target DOM node is changed due to different timestamps during recording and playback or recording and playback are performed on different test servers, so that the recorded target DOM node cannot be positioned according to the identifier of the target DOM node during playback operation; therefore, whether the identification of the target DOM node belongs to meaningless identification or not can be definitely judged by setting the first type identification to contain characters except numbers, so that the problem that the target DOM node cannot be inquired in a playback stage due to the fact that the first type identification is used as a positioning identification can be avoided, and the testing accuracy is improved.
In a possible design, the rendering the first interface obtained by playback and the standard interface corresponding to the operation according to the test result corresponding to the operation includes: analyzing the first interface to obtain a first DOM tree, analyzing the standard interface to obtain a standard DOM tree, and generating difference data corresponding to the difference nodes according to the difference of the difference nodes in the first DOM tree and the standard DOM tree aiming at any difference node in the I-level node layers of the first DOM tree and the standard DOM tree; aiming at any same node in the I level node layers of the first DOM tree and the standard DOM tree, if the same node is determined to have a connected I +1 level sub-node, comparing all the I +1 level sub-nodes connected with the same node in the first DOM tree and the standard DOM tree, and judging whether any connected I +1 level sub-node belongs to a difference node or the same node according to a comparison result; wherein I is an integer greater than 0; further, according to difference data corresponding to each difference node in each level of node layer, rendering elements corresponding to each difference node on the first interface and the standard interface to obtain a test result corresponding to the operation.
In the design, the comparison is performed once each time the playback operation is performed, and the playback interface and the standard interface corresponding to the operation are rendered according to the comparison result, so that a user can intuitively determine whether the result of the operation is accurate according to the playback interface and the standard interface.
In a possible design, the determining whether any of the I +1 th-level child nodes belongs to a different node or an identical node according to the comparison result includes: if the I +1 level child node does not exist in the standard DOM tree and the I +1 level child node exists in the first DOM tree, determining the I +1 level child node as a newly added node; if the I +1 level child node exists in the standard DOM tree and the I +1 level child node does not exist in the first DOM tree, determining the I +1 level child node as a deleted node; if the I +1 level child node in the standard DOM tree is different from the I +1 level child node in the first DOM tree in any one or more of style, type, name, identification and attribute, determining the I +1 level child node as a changed node; further, if the I +1 th-level child node is any one of a new node, a deleted node, or a changed node, it is determined that the I +1 th-level child node is a difference node, and if the I +1 th-level child node in the standard DOM tree is the same as the I +1 th-level child node in the first DOM tree in style, type, name, identifier, and attribute, it is determined that the I +1 th-level child node is the same node.
In one possible design, the playing back the test interface according to the operation information of the user operating the one or more DOM nodes includes: inserting the test cases into a task pool, wherein the task pool is used for storing one or more test cases to be executed; further, a first process in an idle state is selected from the multiple processes, the test case is sent to the first process, so that the first process performs playback operation on the test interface according to operation information of the user for operating the one or more DOM nodes, and the test case in the task pool is set to be in a locked state.
In the design, the testing efficiency of the front-end interface can be better improved by arranging a plurality of processes to execute the testing tasks in parallel.
In a second aspect, an embodiment of the present invention provides a testing apparatus, including:
the recording module is used for recording the operation of a user on the test interface to obtain a test case; the test case comprises operation information of the user for operating one or more DOM nodes on a DOM tree corresponding to the test interface;
the playback module is used for playing back the test interface according to the operation information of the user for operating the one or more DOM nodes if the test case is determined to be tested;
and the processing module is used for generating a test result corresponding to the operation according to a first interface obtained by playing back the operation and a standard interface corresponding to the operation after the operation playback corresponding to each DOM node is finished.
In one possible design, the recording module is specifically configured to: determining a target DOM node triggered by the user from a DOM tree corresponding to the test interface aiming at any operation of the user on the test interface; determining a positioning identifier of the target DOM node in the DOM tree according to the identifier and the type of the target DOM node and/or the hierarchical relation of the target DOM node in the DOM tree, and generating test data corresponding to the operation according to the positioning identifier of the target DOM node in the DOM tree, the type of the operation, the content of the operation, and the time information of the operation and the previous operation; and further, generating the test case according to the test data corresponding to each operation of the user on the test interface.
In one possible design, the recording module is specifically configured to: judging whether the identification of the target DOM node belongs to a first type identification, if so, taking the identification of the target DOM node as a positioning identification of the target DOM node, wherein the first type identification is used for uniquely identifying the target DOM node during recording and playback; if not, judging whether the type of the target DOM node is the only type in the DOM tree, if so, taking the type of the target DOM node as a positioning identifier of the target DOM node, and if not, determining the positioning identifier of the target DOM node according to the hierarchical relation of the target DOM node in the DOM tree.
In one possible design, the recording module is specifically configured to: judging whether a father node of the target DOM node exists or not, if not, determining a positioning identifier of the target DOM node according to the sequence of the type of the target DOM node in the DOM tree; if the DOM node exists, combining the type of the father node of the target DOM node and the type of the target DOM node to obtain a primary combination type corresponding to the target DOM node, judging whether the primary combination type corresponding to the target DOM node is the only type in the DOM tree, if so, taking the primary combination type corresponding to the target DOM node as a positioning identifier of the target DOM node, if not, judging whether the father node of the target DOM node exists, and if not, determining the positioning identifier of the target DOM node according to the sequence of the primary combination type corresponding to the target DOM node in the DOM tree; and if so, combining the type of the father node of the target DOM node, the type of the father node of the target DOM node and the type of the target DOM node to obtain a secondary combination type corresponding to the target DOM node, and determining the positioning identifier of the target DOM node according to the secondary combination type corresponding to the target DOM node.
In one possible design, the recording module is specifically configured to: and if the identification of the target DOM node consists of numbers, determining that the identification of the target DOM node does not belong to the first type identification, and if the identification of the target DOM node comprises characters except the numbers, determining that the identification of the target DOM node belongs to the first type identification.
In one possible design, the processing module is specifically configured to: analyzing the first interface to obtain a first DOM tree, analyzing the standard interface to obtain a standard DOM tree, and generating difference data corresponding to the difference nodes according to the difference of the difference nodes in the first DOM tree and the standard DOM tree aiming at any difference node in the I-level node layers of the first DOM tree and the standard DOM tree; aiming at any same node in the I level node layers of the first DOM tree and the standard DOM tree, if the same node is determined to have a connected I +1 level sub-node, comparing all the I +1 level sub-nodes connected with the same node in the first DOM tree and the standard DOM tree, and judging whether any connected I +1 level sub-node belongs to a difference node or the same node according to a comparison result; wherein I is an integer greater than 0; further, according to difference data corresponding to each difference node in each level of node layer, rendering elements corresponding to each difference node on the first interface and the standard interface to obtain a test result corresponding to the operation.
In one possible design, the processing module is specifically configured to: if the I +1 level child node does not exist in the standard DOM tree and the I +1 level child node exists in the first DOM tree, determining the I +1 level child node as a newly added node; if the I +1 level child node exists in the standard DOM tree and the I +1 level child node does not exist in the first DOM tree, determining the I +1 level child node as a deleted node; if the I +1 level child node in the standard DOM tree is different from the I +1 level child node in the first DOM tree in any one or more items of style, type, name, identification and attribute, determining the I +1 level child node as a changed node; further, if the I +1 th-level child node is any one of a new node, a deleted node, or a changed node, it is determined that the I +1 th-level child node is a difference node, and if the I +1 th-level child node in the standard DOM tree is the same as the I +1 th-level child node in the first DOM tree in style, type, name, identifier, and attribute, it is determined that the I +1 th-level child node is the same node.
In one possible design, the playback module is specifically configured to: inserting the test case into a task pool, wherein the task pool is used for storing one or more test cases to be executed, further, selecting a first process in an idle state from a plurality of processes, sending the test case to the first process, so that the first process performs playback operation on the test interface according to operation information of the user for operating the one or more DOM nodes, and setting the test case in the task pool to be in a locked state.
In a third aspect, an embodiment of the present invention provides a computing device, which includes at least one processing unit and at least one storage unit, where the storage unit stores a computer program, and when the program is executed by the processing unit, the processing unit is caused to execute the testing method according to any of the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores a computer program executable by a computing device, and when the program runs on the computing device, the computer program causes the computing device to execute the testing method according to any one of the first aspect.
These and other aspects of the invention are apparent from and will be elucidated with reference to the embodiments described hereinafter.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic flow chart corresponding to a testing method according to an embodiment of the present invention;
fig. 2 is an interface schematic diagram of a service interface according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a DOM tree corresponding to a test interface according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating a method for determining a location identifier of a target DOM node according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of an interface of a possible case categorizer according to an embodiment of the present invention;
fig. 6 is a schematic interface diagram of a Chrome recording plug-in according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a testing apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The field of financial technology (Fintech) generally relates to a plurality of businesses, for example, the business of a bank may include card selling business, deposit business, loan business, insurance business, financing business, etc., and the business volume of the bank per day may reach thousands or even tens of thousands. Generally, a bank can perform field business at the location of the bank, and also can set a front-end page corresponding to the business on a network, and provide corresponding business for a user through the front-end page corresponding to the business; for example, by setting the front-end interface corresponding to the loan transaction, the user can directly perform loan operation on the front-end interface corresponding to the loan transaction, so that the user can handle loan transaction more conveniently.
In the process of developing a front-end page, when version upgrade or fault maintenance needs to be performed on the front-end page, a developer may generally modify an old version of a front-end page program or generate a new program based on the old version of the front-end page program, however, the modified program may cause element dislocation on an interface or abnormal node function, such as change of a model of a DOM node, change of an attribute of the DOM node, messy code of content of the DOM node, and the like. Therefore, the interface test is an indispensable loop in the research and development process of the front-end page, the interface test means that whether the style, content, position, function and the like of the DOM node are abnormal relative to the standard DOM node is determined by clicking the DOM node on the test interface, and the abnormal DOM node caused by the program updating process can be detected by executing the interface test, so that the research and development of the front-end page can be smoothly carried out.
In one possible implementation, the Selenium software can be used for an automated interface test process, and the Selenium software comprises four independent script files, namely a recording script file, a playback script file, an assertion script file and a test result script file; correspondingly, the automatic testing process based on the Selenium software specifically comprises a recording stage, a playback stage, an assertion stage and a testing result stage, each stage requires a user to call a script file of the stage by using a programming language supported by the Selenium software, and the specific implementation processes of the four stages are as follows:
recording stage
After the user calls the script file of the recording phase using the programming language supported by the Selenium software, the test server may start the recording phase. In the recording stage, the user can manually click each DOM node on the test interface, and correspondingly, the test server can record the operation information of clicking each DOM node on the test interface by the user in sequence, so that the change condition of the test interface is recorded into a test case. For example, if the user sequentially clicks on DOM node A on the test interface2DOM node A1And DOM node A3Then the Selenium software can record the DOM node a of the user pair in turn2DOM node A1And DOM node A3And can be according to the operation information of the user on the DOM node A2DOM node A1And DOM node A3Generates a test case.
The operation information of the user on each DOM node can comprise position information of the DOM node and an operation type of the user on the DOM node, and thus, the test case can comprise the sequence, the position information and the operation type of each DOM node operated by the user. In specific implementation, the Selenium software may determine the location information of each DOM node by using an Xpath scheme, that is, obtaining a DOM tree corresponding to the test interface according to the test interface, and then obtaining the location information of the DOM node according to an absolute path of the DOM node in the DOM tree corresponding to the test interface, for example, combining identifiers of DOM nodes included in a path from a root node to the DOM node in the DOM tree, and using the combined identifier as the location information of the DOM.
Playback phase
The test server may initiate the playback phase after the user invokes the script file for the playback phase using a programming language supported by the Selenium software. In the playback stage, the test server can acquire the test cases generated in the recording stage and can sequentially play back the operation information of the user on the multiple DOM nodes according to the test cases; specifically, for any operation information, the test server may find the DOM node from the test interface according to the position information of the DOM node, and then perform playback operation on the DOM node according to the operation type of the recording stage, for example, if the operation type of the DOM node in the recording stage is a click, the playback stage may also click the DOM node on the test interface.
Assertion phase
The assertion phase and the playback phase can be executed in parallel, and the assertion condition of the assertion phase is set by a user, so that the test server can assert according to the assertion condition set by the user when executing the playback phase. Specifically, after a user calls a script file in an assertion stage by using a programming language supported by the Selenium software, the test server can respond to an assertion interface for the user, and the user can input an assertion condition on the assertion interface, so that the test server is triggered to assert according to the assertion condition; for example, if the user sets the DOM node A2Making an assertion, the test server may be on DOM node A2After operation, comparing the operated interface with the standard interface to determine a DOM node A2Whether the style, content, function, etc. of (a) is abnormal.
Test results stage
After a user calls a script file in a test result stage by using a programming language supported by the Selenium software, the test server can respond to a test result report to the user, wherein the test result report can include a test result of a DOM node of which the user sets an assertion condition, and the test result report is testedThe test result may include test normality or test abnormality, and the test result report may be displayed to the user in the form of text. For example, if DOM node A2DOM node A1And DOM node A3All set up an assertion condition and the test result is reported as DOM node A2Test exception, DOM node A1Testing Normal, DOM node A3If the test is abnormal, the user can repair the DOM node A according to the test result report2And DOM node A3
According to the above, although the Selenium software can automatically complete the interface test, since the user needs to use the programming language supported by the Selenium software to call the script file corresponding to each stage, the user needs to skillfully master the programming language supported by the Selenium software, which results in great development difficulty and poor user experience; that is, the level of automation of the Selenium software is not high, and the automated page test in a complete sense cannot be realized. Furthermore, the automatic test process based on the Selenium software has the following disadvantages:
(1) in the recording stage, the Selenium software positions each DOM node based on the Xpath scheme, and since the Xpath scheme needs to determine the position information of the DOM node by using the absolute path of the DOM node in the DOM tree, the method needs to execute a more complicated path determination process on each DOM node, so that the DOM node needs longer time to be positioned, and the efficiency of interface test is lower;
(2) the Selenium software combines the identifications of the DOM nodes in the DOM tree as the position information of the DOM nodes, however, in most cases, the identifications of the DOM nodes may be meaningless identifications such as timestamps, and the identifications of the same DOM node are different due to the difference of the timestamps in the recording stage and the playback stage; therefore, if the position information of the DOM node is obtained according to the meaningless identification in the mode, the DOM node cannot be inquired in the playback process, so that the test process is wrong, and the test accuracy is low;
(3) in the assertion stage, the Selenium software can only assert one or a plurality of DOM nodes according to the assertion conditions set by the user, on one hand, the method needs the user to manually supplement the assertion conditions, which results in low automation program; on the other hand, because a user sets an assertion condition for the DOM node by writing the identifier of the DOM node, the portability is poor, and a general assertion condition cannot be set for each DOM node;
(4) the test result of the Selenium software on each DOM node is the success or failure of the test process, and a specific test result cannot be given, so that a user cannot visually check the abnormal information of the DOM node, and the fault repairing process of the user is not facilitated.
Based on the above, the invention provides a testing method, which is used for realizing a set of universal and complete automatic testing process on the basis of improving the efficiency of interface testing and improving the accuracy and portability of testing.
Fig. 1 is a schematic flowchart corresponding to a testing method provided in an embodiment of the present invention, where the method is applied to a test server, and the method includes:
step 101, recording the operation of a user on a test interface to obtain a test case.
In specific implementation, a service interface can be arranged on the test server, the service interface is based on a World Wide Web (Web) server and a Web browser, and the service interface can comprise a plurality of function icons; therefore, when receiving the link corresponding to the service interface input by the user on the web browser, the test server can provide the service interface for the user, and further, if the condition that the user clicks the function icon on the service interface is detected, the function corresponding to the function icon can be executed through the web browser.
Fig. 2 is a schematic diagram of a service interface according to an embodiment of the present invention, and as shown in fig. 2, a recording sub-interface and a service sub-interface may be disposed on the service interface, where the recording sub-interface may be provided with a function button of "recording plug-in", and the service sub-interface may be provided with a function button of "case management", a function button of "playback", and a function button of "difference presentation". In specific implementation, after a user inputs a preset link corresponding to a service interface on a web browser, the test server may display the recording sub-interface to the user through the web browser, or may display the recording sub-interface and the service sub-interface to the user at the same time; further, if it is detected that the user clicks a function button of a recording plug-in on the recording sub-interface, the test server may convert the recording sub-interface on the web browser into a test interface, and may start a preset recording plug-in to record operation information of the user on the test interface, so as to obtain a recording script; after receiving a message of ending recording triggered by a user, the test server can convert the recording script into a test case and can add the test case into a case managed by the service sub-interface.
The preset recording plug-in may be any type of plug-in having an interface recording function, such as a Chrome recording plug-in, a Unity3D recording plug-in, and the like, and is not limited specifically.
It should be noted that the foregoing is only an exemplary and simple description, and does not constitute a limitation on the scheme, and in a specific implementation, the function icon may be set on the service interface, or may also be directly set on the test interface, and is not limited. In the above example, since the function icon is set on the service interface, after detecting that the user triggers the function button of the "recording plug-in", the test server may automatically jump from the service interface to the test interface, and record the operation information of the user on the test interface to obtain the recording script; correspondingly, if the function icon is arranged on the test interface, after the fact that the user triggers the function button of the recording plug-in is detected, the test server can directly record the operation information of the user on the test interface to obtain the recording script.
In the embodiment of the invention, after receiving a starting instruction of the test server, the preset recording plug-in can firstly analyze the test interface to obtain a DOM tree corresponding to the test interface, the DOM tree can comprise a plurality of DOM nodes with hierarchical relations, a previous-level node connected with any DOM node is called a father node of the DOM node, a next-level node connected with any DOM node is called a child node of the DOM node, and one DOM node can have one father node and a plurality of child nodes. Each DOM node may correspond to an element on the test interface, and each DOM node may have corresponding information such as style, content, attributes, and location.
Fig. 3 is a schematic structural diagram of a DOM tree corresponding to a test interface according to an embodiment of the present invention, and as shown in fig. 3, the DOM tree corresponding to the test interface may include a first-level node layer, a second-level node layer, a third-level node layer, and a fourth-level node layer. Wherein, a DOM node B can be arranged in the first level node layer1DOM node B1Type of (2) is Document; DOM node B can be arranged in the second level node layer21DOM node B22And DOM node B23DOM node B21Is Element, DOM node B22Of type Entity, DOM node B23Type of (1) is Notation; a DOM node B can be arranged in the third level node layer31DOM node B32And DOM node B33DOM node B31Is Element, DOM node B32Type of (1) is Notation, DOM node B33The type of (2) is Element; a DOM node B can be arranged in the fourth level node layer41DOM node B41Type of (2) is Notation.
In the embodiment of the invention, a node in a first level node layer is called a root node, a node in a second level node layer connected with the root node is called a first level child node of the root node, and the root node is called a first level father node of the node in the second level node layer; accordingly, a node in the third level node layer is referred to as a first level child node of the connected node in the second level node layer, referred to as a second level child node of the root node, a node in the connected second level node layer is referred to as a first level parent node of the node in the third level node layer, and the root node is referred to as a second level parent node of the node in the third level node layer. For example, as shown in FIG. 3, DOM node B1Is a root node; DOM node B21As DOM node B1And is DOM node B31Is DOM node B41The second level parent node of (1).
It should be noted that fig. 3 is only an exemplary simple illustration, which only illustrates the hierarchical relationship and the type between the DOM nodes, and does not illustrate the information such as the attribute, the style, and the like of each DOM node, and this illustration is only for convenience of illustrating the scheme, and does not constitute a limitation on the scheme, and in a specific implementation, the structure of the DOM tree may be set according to actual needs, and is not specifically limited.
In a possible implementation manner, after the DOM tree corresponding to the test interface is obtained by analyzing the test interface, the preset recording plug-in may record the operation information of the user on the test interface to obtain the recording script as follows: aiming at any operation of a user on a test interface, determining a target DOM node triggered by the user in a DOM tree corresponding to the test interface, obtaining a positioning identifier of the target DOM node in the DOM tree according to the identifier and the type of the target DOM node or the hierarchical relation of the target DOM node in the DOM tree, and generating a recording script corresponding to the operation according to the positioning identifier of the target DOM node, the type of the operation, the content of the operation, the time information of the operation and the previous operation; further, after receiving a message that the user triggers the end of recording, obtaining a test case corresponding to the recording according to a recording script corresponding to each operation of the user on the test interface.
The following is a specific example:
in this example, the test interface is a page on an HTML5 browser, and the preset recording plug-in is a Chrome recording plug-in, in a specific implementation, after a start instruction sent by the test server is received, the Chrome recording plug-in may cache types and identifiers of all DOM nodes in a DOM tree corresponding to the test interface first, and then may monitor DOM nodes on the test interface using a MotationObserver API interface of the HTML5 browser, and if it is monitored that a new DOM node is newly added, a DOM node is deleted, or a DOM node is modified, the test interface after the DOM node is modified may be reanalyzed to obtain a modified DOM tree, and thus, the Chrome recording plug-in may re-cache types and identifiers of all DOM nodes in the modified DOM tree.
In the above example, the way of monitoring the change of the DOM node may be: a Chrome recording plug-in sets a buried point event capturing mechanism on a test page of an HTML5 browser in advance, and when a certain buried point event (such as a click event, a double-click event and an input event) is detected to be triggered, the operations (corresponding to the click operation, the double-click operation and the input operation) of a user can be captured through the buried point event capturing mechanism; further, for any captured operation, the Chrome recording plug-in may obtain information of the type of the operation, the content of the operation, the location identifier of the target DOM node corresponding to the operation, the duration of the operation and the last operation, and generate a recording script corresponding to the operation based on the information.
In this embodiment of the present invention, there may be multiple ways of determining a location identifier of a target DOM node corresponding to an operation, and fig. 4 is a flowchart corresponding to a method for determining a location identifier of a target DOM node provided in this embodiment of the present invention, as shown in fig. 4, the method includes:
step 401, determining a target DOM node corresponding to the operation according to the operation of the user, and obtaining the type and the identifier of the target DOM node from the types and the identifiers of the DOM nodes cached in advance.
For example, after receiving a start instruction sent by the test server, since the Chrome recording plug-in first caches the types and identifiers of all DOM nodes in the DOM tree corresponding to the test interface in the browser space, if it is determined that the user is directed to a DOM node (e.g., DOM node B)22) After the click operation is executed, the Chrome recording plug-in can directly acquire the DOM node B from the browser space22Type and identification of. Wherein DOM node B22The identification and the type of the DOM node B can be preset by an interface developer, so that the Chrome recording plug-in can acquire the DOM node B by calling a configuration file of a test interface22The identity and type of (c); based on the DOM tree illustrated in FIG. 3, DOM node B22Is type Entity.
Step 402, determining whether the identifier of the target DOM node belongs to the first type identifier, if so, executing step 403, and if not, executing step 404.
In the embodiment of the present invention, the first type identifier is used to indicate an identifier capable of uniquely identifying the target DOM node in different operation processes, that is, if the identifier of a DOM node belongs to the first type identifier, the identifier of the DOM node will not change when the DOM node is clicked at different time and/or on different devices.
In one possible scenario, when the identification of a DOM node is set to generate a timestamp, a cyclic number, or a random number, the identification of the DOM node may change if the DOM node is clicked on at a different time and/or on a different device. For example, taking the identifier of the DOM node as the generation timestamp, if the time for clicking the DOM node during recording is 10:09, and the time for clicking the DOM node during playback of the test case is 12:10, the identifiers of the DOM nodes during recording and playback are different, that is, the DOM node cannot be queried according to the identifier of the DOM node during recording during playback.
Based on the principle, in the embodiment of the present invention, if the identifier of the target DOM node is composed of a number, it may be determined that the identifier of the target DOM node does not belong to the first type identifier, and if the identifier of the target DOM node includes characters other than the number, it may be determined that the identifier of the target DOM node belongs to the first type identifier. In the embodiment of the invention, whether the identification of the target DOM node belongs to the meaningless identification can be definitely judged by setting the first type identification to contain characters except numbers, so that the problem that the target DOM node cannot be inquired in a playback stage due to the fact that the first type identification is used as a positioning identification can be avoided, and the testing accuracy is improved.
And step 403, taking the identifier of the target DOM node as a positioning identifier of the target DOM node.
When the identification of the target DOM node belongs to the first type identification, because the identification of the target DOM node can uniquely identify the target DOM node in different operation processes, the corresponding target DOM node can also be found according to the identification of the target DOM node determined in the recording process during playback, and therefore, the identification of the target DOM node can be directly used as the positioning identification of the target DOM node.
Step 404, determining whether the type of the target DOM node is the only type in the DOM tree, if so, executing step 405, and if not, executing step 406.
When the identifier of the target DOM node does not belong to the first type identifier, since the identifier of the target DOM node cannot uniquely identify the target DOM node in different operation processes, it is explained that the corresponding target DOM node cannot be found according to the identifier of the target DOM node determined during recording during playback, and therefore, the identifier of the target DOM node cannot be directly used as the positioning identifier of the target DOM node. Therefore, the positioning identifier of the target DOM node can be determined according to the type of the target DOM node, and if the positioning identifier of the target DOM node cannot be determined according to the type of the target DOM node, the positioning identifier of the target DOM node can be determined according to the hierarchical relationship of the target DOM node in the DOM tree.
And step 405, taking the type of the target DOM node as a positioning identifier of the target DOM node.
Step 406, determining whether a parent node of the previous level exists, if yes, performing step 407, and if no, performing step 410.
And step 407, obtaining the combination type corresponding to the target DOM node according to the type of the parent node at the upper level.
Step 408, judging whether the combination type corresponding to the target DOM node is the only type in the DOM tree, if so, executing step 409, and if not, executing step 406.
And step 409, taking the combination type corresponding to the target DOM node as the positioning identifier of the target DOM node.
And step 410, determining the positioning identifier of the target DOM node according to the type of the target DOM node or the sequence of the combined type corresponding to the target DOM node in the DOM tree.
The specific implementation of steps 404 to 410 is described with a specific example based on the DOM tree illustrated in fig. 3:
for convenience of description, the following embodiments of the present invention refer to a type of a combined DOM node and a combined type of the DOM node obtained by using a type of a primary parent node as a primary combined type corresponding to the DOM node, and refer to a combined type obtained by combining a type of a DOM node, a type of a primary parent node of the DOM node and a type of a secondary parent node of the DOM node as a secondary combined type corresponding to the DOM node, and sequentially recur.
DOM node B, as shown in FIG. 31Type of is Document, DOM node B21Is Element, DOM node B22Type of is Entity, DOM node B23Type of is Notation, DOM node B31Is Element, DOM node B32Type of is Notation, DOM node B33Is Element, DOM node B41Is Notation, because the Document type and the Entity type are the only types in the DOM tree, if the target DOM node is DOM node B1Or DOM node B22Then, the type of the target DOM node can be directly used as the positioning identifier of the target DOM node. For example, if the target DOM node is DOM node B1If the target DOM node is located in the Document, the location identifier of the target DOM node is Document; or, if the target DOM node is DOM node B22Then the location identifier of the target DOM node is Entity.
Accordingly, node B is due to DOM21DOM node B31And DOM node B33All types of the node B are Element types and DOM node B23DOM node B32And DOM node B41The types of the elements are all Notation types, and the Element types and the Notation types are not the only types in the DOM tree; thus, if the target DOM node is DOM node B21DOM node B23DOM node B31DOM node B32DOM node B33Or DOM node B41If the preset recording plug-in unit is any DOM node in the target DOM tree, the preset recording plug-in unit can firstly combine the type of the target DOM node and the type of the primary father node of the target DOM node to obtain the primary combination type corresponding to the target DOM node, judge whether the primary combination type corresponding to the target DOM node is the only type in the DOM tree or not, if so, use the primary combination type corresponding to the target DOM node as the positioning identifier of the target DOM node, and if not, use the preset recording plug-in unit as the positioning identifier of the target DOM node according to the type of the target DOM node and the type of the primary father node of the target DOM nodeAnd obtaining a secondary combination type corresponding to the target DOM node according to the type of the secondary father node of the target DOM node and the type of the secondary father node of the target DOM node, and then executing the judging process aiming at the secondary combination type corresponding to the target DOM node until the judging process is executed to the root node.
For example, if the target DOM node is DOM node B31Then DOM node B can be assembled first31Type Element, DOM node B31Primary parent node DOM node B21Get DOM node B31Corresponding primary combination type Element-Element; because the Element-Element type is the only type in the DOM tree, DOM node B can be converted to a DOM node B31Corresponding primary combination type Element-Element is used as DOM node B31The positioning identifier of (2). Correspondingly, if the target DOM node is DOM node B32Then DOM node B can be assembled first32Type Notation, DOM node B32Primary parent node DOM node B21Get DOM node B32Corresponding primary combination type Element-Notation; due to DOM node B41The corresponding primary combination type is also Element-Notation, which shows that the Element-Notation type is not the only type in the DOM tree, therefore, the DOM node B is not required to be connected32Corresponding primary combination type Element-Notation as DOM node B32Instead of combining DOM node B32Type Notation, DOM node B32Primary parent node DOM node B21Type Element, DOM node B32Second level parent node DOM node B1Get DOM node B32Corresponding secondary combination type Document-Element-notification; since Document-Element-Notation type is the only type in DOM tree, DOM node B can be added32Corresponding two-level combination type Document-Element-Notation as DOM node B32The location identification of (2).
As an example, assume DOM node B23Type of (D) is not Notation but Element, DOM node B33Type of (2) is not Element but Notation, then due to DOM node B33The corresponding secondary combination type is also Document-Element-Notation, which means Document-Element-Notation is not the only type in DOM tree, therefore, DOM node B is not used32Corresponding two-level combination type Document-Element-Notation as DOM node B32The positioning identifier of (2). Further, querying the DOM tree discovers DOM node B32Second level parent node DOM node B1Being root nodes, i.e. DOM node B32There is no tertiary parent node, so the pre-set recording plug-in can be based on DOM node B32Determining the positioning identifier corresponding to the target DOM node according to the sequence of the corresponding two-level combination type Document-Element-Notation in the DOM tree, specifically, because the DOM node B32The order of the corresponding two-level combination type Document-Element-Notation in the DOM tree is the first bit, and the DOM node B33The order of the corresponding two-level combination type Document-Element-Notation in the DOM tree is the second bit, so that the DOM node B can be divided into two parts32The combination form Document-Element-Notation-1 of the corresponding secondary combination type and the sequence of the combination type in the DOM tree is taken as the DOM node B32The positioning identifier of (2).
Because the Selenium software directly obtains the position information of the DOM nodes (namely, the Xpath scheme) according to the absolute paths of the target DOM nodes in the DOM tree, each DOM node needs a relatively complex calculation process to determine the positioning identifier of each DOM node, and thus the performance loss of the test system is relatively serious; by adopting the positioning mode illustrated in fig. 4, the positioning identifier of each DOM node can be quickly calculated by adopting the calculation logic of first identifier, second type and last hierarchical relationship, so that the calculation complexity can be reduced, and the test efficiency can be improved.
Further, after the location identifier of the target DOM node is determined, the preset recording plug-in may obtain operation information such as the type of the operation (e.g., single click, double click, reading, writing, etc.), the content of the operation (e.g., written data), the time duration between the operation and the previous operation, and may also obtain operation path information such as a Uniform Resource Locator (URL), a user agent, device information, and the like of the test interface, and may assemble the operation information and the operation path information according to a preset format, thereby obtaining a recording script corresponding to the operation.
In an embodiment of the present invention, there may be multiple ways of obtaining a recording script by assembling operation information and operation path information, in a possible implementation manner, a case classifier is preset on a test server, fig. 5 is a schematic diagram of a possible case classifier, and as shown in fig. 5, the case classifier includes script functions corresponding to multiple operation types, such as a create function, a setViewPort function, a setusergent function, a goto function, a wait function, a dbclick function, a click function, a tap function, an input function, a select function, an upload function, a dest function, and the like. In specific implementation, after the positioning identifier of the target DOM node corresponding to each operation is determined, the operation information and the operation path information of each operation can be automatically input into the case classifier, so that the case classifier can call a create function to create a script object corresponding to each operation, then the operation process corresponding to each operation can be determined in a traversal mode according to the operation path information of each operation, and finally the variable of the function can be updated according to the traversal process to obtain a recorded script; for example, if a certain operation is a single-click operation, the script function corresponding to the operation can be determined to be a click function after traversing the operation path information of the operation; thus, the case classifier can update the variable in the click function according to the operation information of the operation to obtain the recording script corresponding to the operation.
It should be noted that one operation of the user may correspond to one recording script, or may correspond to multiple recording scripts, and is not limited specifically.
In the embodiment of the invention, each operation executed by a user on the test interface can be input into the case classifier in real time, so that after the operation of the user on the test interface is recorded, the case classifier can arrange and combine the recording scripts corresponding to each operation of the user in sequence to obtain the recorded test case (the script file). Further, the test server may set an identifier for the test case recorded this time, may then store the script file of the test case recorded this time in the case management folder, and may add the identifier of the test case recorded this time in an interface corresponding to a function button of "case management" corresponding to the service sub-interface, so as to display to the user.
The process of obtaining a test case by recording using the preset recording plug-in is described above in a software implementation form, and the modules of the preset recording plug-in are described below from a hardware implementation perspective.
Fig. 6 is a schematic structural diagram of a Chrome recording plug-in provided in an embodiment of the present invention, and as shown in fig. 6, the Chrome recording plug-in may be composed of a pop module, a Background module, and a Content module, and functions of the pop module, the Background module, and the Content module are as follows:
the Popup module is responsible for interface display and logic processing of the Chrome recording plug-in. Specifically, the Popup module may provide a function button of "start recording" and a function button of "end recording" to the user, and notify the Background module when it is detected that the user clicks the function button of "start recording" or the function button of "end recording"; and the Popup module can also display the test case sent by the Background module to the user after the Chrome recording plug-in finishes recording.
The Background module is a bridge for receiving the Popup module and the Content module. In specific implementation, the Background module can notify the Content module of a message that a user clicks a function button for "start recording" and a function button for "end recording" in the Popup module, and can receive operation information corresponding to a plurality of embedded point events sent by the Content module after the Chrome recording plug-in finishes recording, and can call a case classifier to convert the operation information into a test case, and then can send the test case to the Popup module so that the user can conveniently view the test case.
The execution environment of the Content module may be set in the test interface. In specific implementation, after receiving a message sent by a Background module and sent by a user clicking a function button for starting recording, the Content module may monitor and record a buried point event in a test interface, such as a click event, an input event, a change event, a touchstart event, a touchmove event, a touchcancel event, and the like; correspondingly, after receiving a message sent by the Background module and indicating that a user clicks a functional button for 'recording ending', the Content module may send operation information corresponding to the recorded embedded point events to the Background module, where the operation information corresponding to each embedded point event may include a type of the embedded point event, a location identifier of a target DOM node of the operation, operation information, a time difference between the current operation and the last operation, and the like.
And step 102, if the test case is determined to be tested, playing back the test interface according to the operation information of the user for operating the one or more DOM nodes.
In one possible implementation, the test server may preset a plurality of processes, and may execute a plurality of test tasks in parallel using the plurality of processes. In specific implementation, after a user triggers a function button of case management in a service sub-interface, the test server can display historical test cases to the user, so that if the test server detects that the user triggers a certain test case, the test server can firstly add the identifier of the test case into a task pool to be executed, and then can poll a plurality of processes to determine the busy degree of each process; if it is determined that a process is in an idle state, the script file of the test case can be sent to the idle process, and the test case in the task pool to be executed can be locked, so that unnecessary performance loss caused by repeated processing of the test case by other processes is avoided.
The number of processes in the test server may be set according to the number of cores of a Central Processing Unit (CPU), or may be set by a user according to a service requirement, which is not limited specifically. After the process is allocated to the test case, the process can use the VM virtual machine capability of the node. Specifically, the process may first analyze a script file corresponding to the test case to obtain a plurality of recorded scripts corresponding to the operations, and since the recorded script corresponding to each operation is represented by a function, the process may execute a function by using a preset browser algorithm, thereby sequentially playing back the plurality of operations on the test interface.
In the embodiment of the present invention, the preset browser algorithm may be set by a person skilled in the art according to experience, for example, the preset browser algorithm may be a puppeteer browser algorithm, a PhantomJS browser algorithm, and the like, and is not limited specifically.
Taking the operation of the headless browser through the puppeteer browser algorithm as an example, in specific implementation, a process can firstly obtain a Create function from a script file of a test case, and can call the puppeteer browser algorithm by using the Create function, so that the puppeteer browser algorithm executes a task of starting the headless browser, and thus the puppeteer browser algorithm can establish socket connection with the headless browser; further, if the recording script corresponding to a certain operation is a Click function, the puppeteer browser algorithm may wait for an element corresponding to the target DOM node to appear on the test interface of the headless browser according to the location identifier of the operated target DOM node, and then send a control instruction to the puppeteer browser algorithm according to the Click mode of the Click function on the target DOM node, so that the puppeteer browser algorithm may inform the headless browser to execute a Click operation on the element corresponding to the target DOM node through socket connection.
It can be understood that the above-mentioned process describes the playback process of the operation by taking the operation type as a click as an example, and other operation types can be implemented according to the process, which is not described herein again.
For example, if a script file corresponding to a certain test case is: firstly, click function records that a user clicks DOM node B21Then the wait function records that the user clicks the DOM node B21After waiting 30 seconds, then dbclick function records that the user double-clicks DOM node B23Then the wait function records that the user double-clicks the DOM node B23Then waiting for 15 seconds, and finally recording the user at DOM node B by the input function1If the 'document' is input, the process can call the headless browser through a puppeteer browser algorithm, and firstly clicks the DOM node B on the test interface of the headless browser21Then waits for 30 seconds before double-clicking on DOM node B23And is onWait for 15 seconds and then at DOM node B1The "document" is input, thereby completing the complete playback of the user's operation in the test case.
And 103, after the operation playback corresponding to each DOM node is finished, rendering the first interface obtained by playback and the standard interface corresponding to the operation according to the test result corresponding to the operation.
In particular, for any operation (e.g., double-clicking DOM node B)23) Calling a puppeteer browser algorithm in the process to control the headless browser to perform a DOM node B on the test interface23After double-click, the test interface can jump to the first interface, so that the process can compare the first interface with the standard interface corresponding to the operation, determine the difference of each DOM node in the DOM trees corresponding to the two interfaces, and render the corresponding element difference on the first interface and the standard interface according to the difference of each DOM node, so that a user can visually check the test result. The standard interface may be set by a person skilled in the art according to experience, for example, the standard interface may be an interface obtained by programming, or may also be a most standard interface selected from a test process in a past, and is not limited specifically.
In the embodiment of the invention, after the first interface is jumped to, the process can analyze the first interface to obtain the corresponding first DOM tree, and can determine the standard DOM tree corresponding to the standard interface according to the standard database; the standard interface corresponding to the multiple operations can be stored in the standard database only, or the standard interface and the standard DOM tree corresponding to the multiple operations can be stored at the same time, and accordingly, the process can directly obtain the standard DOM tree from the standard database, or can obtain the standard interface first and then analyze the standard DOM tree. Further, for any difference node in the level I node layer, the process may generate difference data corresponding to the difference node according to the difference of the difference node in the first DOM tree and the standard DOM tree, and for any same node in the level I node layer, if it is determined that a child node connected to the same node exists in the level I +1 node layer, the process may respectively compare all child nodes of the same node in the first DOM tree and the standard DOM tree, and may determine whether any child node belongs to the difference node or the same node according to the comparison result, and perform comparison according to the above process until all nodes do not have child nodes.
In specific implementation, a process may compare a first root node in a first level node layer of a first DOM tree with a standard root node in a first level node layer of a standard DOM tree, and if the first root node and the standard root node are in a style, content, type and attribute, if any one or more items are different in the style, content and type, the node belongs to a modified node; if only the first root node exists and the standard root node does not exist, determining the first root node as a newly added node; and if only the standard root node exists but not the first root node, determining the standard root node as a deleted node, wherein the newly added node, the deleted node and the modified node are all difference nodes, and the process can generate difference data corresponding to the difference nodes according to the difference of the difference nodes in the first DOM tree and the standard DOM tree. Correspondingly, if the style, the content, the type, the attribute and the like of the first root node and the standard root node are the same, the first root node and the standard root node belong to the same node, aiming at the same first root node and the standard root node, the process can compare all child nodes of the first root node in the first DOM tree with all child nodes of the standard root node in the standard DOM tree, and can determine whether any child node belongs to a different node or the same node according to the comparison mode of the root nodes; for a different child node in any child node, the process may generate difference data corresponding to the different child node according to the difference of the different child node in the first DOM tree and the standard DOM tree, and for the same child node in any child node, the process may continue to compare all child nodes of the same child node in the first DOM tree with all child nodes of the same child node in the standard DOM tree until there is no child node.
According to the mode, after the comparison between the first DOM tree and the standard DOM tree is completed, the process can obtain the difference data of a plurality of difference nodes, wherein the type of the difference data can be newly added, deleted or modified; in this way, the process may render on the first interface and the standard interface according to difference data of a plurality of difference nodes, for example, a first type of detection frame may be used to frame out a new node on the first interface, a second type of detection frame may be used to frame out a deleted node on the standard interface, or a third type of detection frame may be used to frame out a modified node having a difference on the first interface and the second interface. The first type detection frame, the second type detection frame and the third type detection frame may be set by those skilled in the art based on experience, and are not limited in particular. For example, in one possible approach, colors may be used to identify different types of checkboxes, such as a first type of checkbox may be set to green, a second type of checkbox to red, and a third type of checkbox to yellow; in another possible way, characters can be used to identify different types of check boxes, such as adding new characters to the first type check box, adding deleted characters to the second type check box, and adding modified characters and/or specific modified contents to the third type check box.
In one example, after the first interface and the standard interface are rendered, in order to facilitate a user to visually view the difference node, screenshots may be further performed on the difference node on the first interface and the standard interface, and the screenshots are displayed to the user.
In the embodiment of the invention, the operation of the user on the test interface is recorded to obtain the test case, and the test case comprises the operation information of the user on operating one or more DOM nodes on the DOM tree corresponding to the test interface; further, if the test case is determined to be tested, the test interface is played back according to the operation information of the user for operating the one or more DOM nodes, and after the operation playback corresponding to each DOM node is finished, the first interface obtained through playback and the standard interface corresponding to the operation are rendered according to the test result corresponding to the operation. In the embodiment of the invention, the assertion is automatically executed after the operation of each DOM node is finished, so that the user does not need to manually set the assertion condition, and thus, the user without programming ability can also use the method to perform the front-end interface test, so that the use threshold is low, and the degree of automatic test is higher; and after the operation playback of each DOM node is set to be finished, the first interface and the standard interface are rendered according to the test result of the playback operation, so that a user can visually check the difference data in the test result, and compared with the mode that the existing test method gives a complex test report, the user experience is better.
In view of the above method flow, an embodiment of the present invention further provides a testing apparatus, and specific contents of the testing apparatus may be implemented with reference to the above method.
Fig. 7 is a schematic structural diagram of a testing apparatus according to an embodiment of the present invention, including:
the recording module 701 is used for recording the operation of a user on the test interface to obtain a test case; the test case comprises operation information of the user for operating one or more DOM nodes on a DOM tree corresponding to the test interface;
a playback module 702, configured to, if it is determined that the test case is to be tested, play back the test interface according to operation information of the user operating the one or more DOM nodes;
and the processing module 703 is configured to render the first interface obtained by playback and the standard interface corresponding to the operation according to the test result corresponding to the operation after the playback of the operation corresponding to each DOM node is finished.
Optionally, the recording module 701 is specifically configured to:
determining a target DOM node triggered by the user from a DOM tree corresponding to the test interface aiming at any operation of the user on the test interface; determining a positioning identifier of the target DOM node in the DOM tree according to the identifier and the type of the target DOM node and/or the hierarchical relation of the target DOM node in the DOM tree, and generating test data corresponding to the operation according to the positioning identifier of the target DOM node in the DOM tree, the type of the operation, the content of the operation and the time information of the operation and the previous operation;
and generating the test case according to the test data corresponding to each operation of the user on the test interface.
Optionally, the recording module 701 is specifically configured to:
judging whether the identification of the target DOM node belongs to a first type identification, if so, taking the identification of the target DOM node as a positioning identification of the target DOM node, wherein the first type identification is used for uniquely identifying the target DOM node during recording and playback; if not, judging whether the type of the target DOM node is the only type in the DOM tree, if so, taking the type of the target DOM node as a positioning identifier of the target DOM node, and if not, determining the positioning identifier of the target DOM node according to the hierarchical relation of the target DOM node in the DOM tree.
Optionally, the recording module 701 is specifically configured to:
judging whether a father node of the target DOM node exists or not, if not, determining a positioning identifier of the target DOM node according to the sequence of the type of the target DOM node in the DOM tree; if the DOM node exists, combining the type of the father node of the target DOM node and the type of the target DOM node to obtain a primary combination type corresponding to the target DOM node, judging whether the primary combination type corresponding to the target DOM node is the only type in the DOM tree, if so, taking the primary combination type corresponding to the target DOM node as a positioning identifier of the target DOM node, if not, judging whether the father node of the target DOM node exists, and if not, determining the positioning identifier of the target DOM node according to the sequence of the primary combination type corresponding to the target DOM node in the DOM tree; and if so, combining the type of the father node of the target DOM node, the type of the father node of the target DOM node and the type of the target DOM node to obtain a secondary combination type corresponding to the target DOM node, and determining the positioning identifier of the target DOM node according to the secondary combination type corresponding to the target DOM node.
Optionally, the recording module 701 is specifically configured to:
and if the identification of the target DOM node consists of numbers, determining that the identification of the target DOM node does not belong to the first type identification, and if the identification of the target DOM node comprises characters except the numbers, determining that the identification of the target DOM node belongs to the first type identification.
Optionally, the processing module 703 is specifically configured to:
analyzing the first interface to obtain a first DOM tree, and analyzing the standard interface to obtain a standard DOM tree;
for any difference node in the I-level node layers of the first DOM tree and the standard DOM tree, generating difference data corresponding to the difference node according to the difference of the difference node in the first DOM tree and the standard DOM tree; aiming at any same node in the I level node layers of the first DOM tree and the standard DOM tree, if the same node is determined to have a connected I +1 level sub-node, comparing all the I +1 level sub-nodes connected with the same node in the first DOM tree and the standard DOM tree, and judging whether any connected I +1 level sub-node belongs to a difference node or the same node according to a comparison result; wherein I is an integer greater than 0;
and rendering the elements corresponding to the different nodes on the first interface and the standard interface according to the difference data corresponding to the different nodes in each level of node layer to obtain the test result corresponding to the operation.
Optionally, the processing module 703 is specifically configured to:
if the I +1 level child node does not exist in the standard DOM tree and the I +1 level child node exists in the first DOM tree, determining the I +1 level child node as a newly added node; if the I +1 level child node exists in the standard DOM tree and the I +1 level child node does not exist in the first DOM tree, determining the I +1 level child node as a deleted node; if the I +1 level child node in the standard DOM tree is different from the I +1 level child node in the first DOM tree in any one or more items of style, type, name, identification and attribute, determining the I +1 level child node as a change node;
and if the I +1 level child node is any one of a newly added node, a deleted node or a changed node, determining that the I +1 level child node is a difference node, and if the I +1 level child node in the standard DOM tree is the same as the I +1 level child node in the first DOM tree in style, type, name, identification and attribute, determining that the I +1 level child node is the same node.
Optionally, the playback module 702 is specifically configured to:
inserting the test cases into a task pool, wherein the task pool is used for storing one or more test cases to be executed;
and selecting a first process in an idle state from the plurality of processes, and sending the test case to the first process, so that the first process performs playback operation on the test interface according to the operation information of the user for operating the one or more DOM nodes, and sets the test case in the task pool to be in a locked state.
From the above, it can be seen that: in the embodiment of the invention, the operation of the user on the test interface is recorded to obtain the test case, wherein the test case comprises the operation information of the user on operating one or more DOM nodes on the DOM tree corresponding to the test interface; further, if the test case is determined to be tested, the test interface is played back according to the operation information of the user for operating the one or more DOM nodes, and after the operation playback corresponding to each DOM node is finished, the first interface obtained through playback and the standard interface corresponding to the operation are rendered according to the test result corresponding to the operation. In the embodiment of the invention, the assertion is automatically executed after the operation of each DOM node is finished, so that the user does not need to manually set the assertion condition, and the user without programming ability can also use the method to test the front-end interface, thereby having low use threshold and higher degree of automatic testing; and after the operation playback of each DOM node is set to be finished, the first interface and the standard interface are rendered according to the test result of the playback operation, so that a user can visually check the difference data in the test result, and compared with the mode that the existing test method gives a complex test report, the user experience is better.
Based on the same inventive concept, an embodiment of the present invention further provides a computing device, including at least one processing unit and at least one storage unit, where the storage unit stores a computer program, and when the program is executed by the processing unit, the processing unit is caused to execute the test method in any one of fig. 2.
Based on the same inventive concept, the embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program executable by a computing device, and when the program runs on the computing device, the computer program causes the computing device to execute the testing method described in any one of fig. 2.
It should be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is intended to include such modifications and variations.

Claims (18)

1. A method of testing, the method comprising:
recording the operation of a user on the test interface to obtain a test case; the test case comprises operation information of the user for operating one or more DOM nodes on a DOM tree corresponding to the test interface;
if the test case is determined to be tested, the test interface is played back according to the operation information of the user for operating the one or more DOM nodes;
and after the operation playback corresponding to each DOM node is finished, rendering is carried out on the first interface obtained by playback and the standard interface corresponding to the operation according to the test result corresponding to the operation.
2. The method of claim 1, wherein the recording of the user's operation of the test interface to obtain the test case comprises:
determining a target DOM node triggered by the user from a DOM tree corresponding to the test interface aiming at any operation of the user on the test interface; determining a positioning identifier of the target DOM node in the DOM tree according to the identifier and the type of the target DOM node and/or the hierarchical relationship of the target DOM node in the DOM tree, and generating test data corresponding to the operation according to the positioning identifier of the target DOM node in the DOM tree, the type of the operation, the content of the operation, and the time information of the operation and the previous operation;
and generating the test case according to the test data corresponding to each operation of the user on the test interface.
3. The method according to claim 2, wherein said determining the location identity of said target DOM node in said DOM tree according to the identity, type and/or hierarchical relationship of said target DOM node in said DOM tree comprises:
judging whether the identification of the target DOM node belongs to a first type identification, if so, taking the identification of the target DOM node as a positioning identification of the target DOM node, wherein the first type identification is used for uniquely identifying the target DOM node during recording and playback; if not, judging whether the type of the target DOM node is the only type in the DOM tree, if so, taking the type of the target DOM node as a positioning identifier of the target DOM node, and if not, determining the positioning identifier of the target DOM node according to the hierarchical relation of the target DOM node in the DOM tree.
4. The method according to claim 3, wherein said determining the location identity of said target DOM node according to its hierarchical relationship in said DOM tree comprises:
judging whether a father node of the target DOM node exists or not, if not, determining a positioning identifier of the target DOM node according to the sequence of the type of the target DOM node in the DOM tree; if the DOM node exists, combining the type of the father node of the target DOM node and the type of the target DOM node to obtain a primary combination type corresponding to the target DOM node, judging whether the primary combination type corresponding to the target DOM node is the only type in the DOM tree, if so, taking the primary combination type corresponding to the target DOM node as a positioning identifier of the target DOM node, if not, judging whether the father node of the target DOM node exists, and if not, determining the positioning identifier of the target DOM node according to the sequence of the primary combination type corresponding to the target DOM node in the DOM tree; and if so, combining the type of the father node of the target DOM node, the type of the father node of the target DOM node and the type of the target DOM node to obtain a secondary combination type corresponding to the target DOM node, and determining the positioning identifier of the target DOM node according to the secondary combination type corresponding to the target DOM node.
5. The method of claim 3, wherein determining whether the identity of the target DOM node is a first type identity comprises:
and if the identification of the target DOM node consists of numbers, determining that the identification of the target DOM node does not belong to the first type identification, and if the identification of the target DOM node comprises characters except the numbers, determining that the identification of the target DOM node belongs to the first type identification.
6. The method according to claim 1, wherein the rendering on the first interface obtained by playback and the standard interface corresponding to the operation according to the test result corresponding to the operation includes:
analyzing the first interface to obtain a first DOM tree, and analyzing the standard interface to obtain a standard DOM tree;
for any difference node in the I-level node layers of the first DOM tree and the standard DOM tree, generating difference data corresponding to the difference node according to the difference of the difference node in the first DOM tree and the standard DOM tree; aiming at any same node in the I level node layers of the first DOM tree and the standard DOM tree, if the same node is determined to have a connected I +1 level sub-node, comparing all the I +1 level sub-nodes connected with the same node in the first DOM tree and the standard DOM tree, and judging whether any connected I +1 level sub-node belongs to a difference node or the same node according to a comparison result; wherein I is an integer greater than 0;
and rendering the elements corresponding to the different nodes on the first interface and the standard interface according to the difference data corresponding to the different nodes in each level of node layer to obtain the test result corresponding to the operation.
7. The method according to claim 6, wherein the determining whether any connected I +1 th-level child node belongs to a difference node or an identical node according to the comparison result comprises:
if the I +1 level child node does not exist in the standard DOM tree and the I +1 level child node exists in the first DOM tree, determining the I +1 level child node as a newly added node; if the I +1 level child node exists in the standard DOM tree and the I +1 level child node does not exist in the first DOM tree, determining the I +1 level child node as a deleted node; if the I +1 level child node in the standard DOM tree is different from the I +1 level child node in the first DOM tree in any one or more items of style, type, name, identification and attribute, determining the I +1 level child node as a changed node;
and if the I +1 level child node is any one of a newly added node, a deleted node or a changed node, determining that the I +1 level child node is a difference node, and if the I +1 level child node in the standard DOM tree is the same as the I +1 level child node in the first DOM tree in style, type, name, identification and attribute, determining that the I +1 level child node is the same node.
8. The method according to any one of claims 1 to 7, wherein the playing back the test interface according to the operation information of the user operating the one or more DOM nodes comprises:
inserting the test cases into a task pool, wherein the task pool is used for storing one or more test cases to be executed;
and selecting a first process in an idle state from the plurality of processes, and sending the test case to the first process, so that the first process performs playback operation on the test interface according to the operation information of the user for operating the one or more DOM nodes, and sets the test case in the task pool to be in a locked state.
9. A test apparatus, the apparatus comprising:
the recording module is used for recording the operation of a user on the test interface to obtain a test case; the test case comprises operation information of the user for operating one or more DOM nodes on a DOM tree corresponding to the test interface;
the playback module is used for playing back the test interface according to the operation information of the user for operating the one or more DOM nodes if the test case is determined to be tested;
and the processing module is used for rendering the first interface obtained by playback and the standard interface corresponding to the operation according to the test result corresponding to the operation after the operation playback corresponding to each DOM node is finished.
10. The apparatus of claim 9, wherein the recording module is specifically configured to:
determining a target DOM node triggered by the user from a DOM tree corresponding to the test interface aiming at any operation of the user on the test interface; determining a positioning identifier of the target DOM node in the DOM tree according to the identifier and the type of the target DOM node and/or the hierarchical relationship of the target DOM node in the DOM tree, and generating test data corresponding to the operation according to the positioning identifier of the target DOM node in the DOM tree, the type of the operation, the content of the operation, and the time information of the operation and the previous operation;
and generating the test case according to the test data corresponding to each operation of the user on the test interface.
11. The apparatus of claim 10, wherein the recording module is specifically configured to:
judging whether the identification of the target DOM node belongs to a first type identification, if so, taking the identification of the target DOM node as a positioning identification of the target DOM node, wherein the first type identification is used for uniquely identifying the target DOM node during recording and playback; if not, judging whether the type of the target DOM node is the only type in the DOM tree, if so, taking the type of the target DOM node as a positioning identifier of the target DOM node, and if not, determining the positioning identifier of the target DOM node according to the hierarchical relation of the target DOM node in the DOM tree.
12. The apparatus of claim 11, wherein the recording module is specifically configured to:
judging whether a father node of the target DOM node exists or not, if not, determining a positioning identifier of the target DOM node according to the sequence of the type of the target DOM node in the DOM tree; if the DOM node exists, combining the type of the father node of the target DOM node and the type of the target DOM node to obtain a primary combination type corresponding to the target DOM node, judging whether the primary combination type corresponding to the target DOM node is the only type in the DOM tree, if so, taking the primary combination type corresponding to the target DOM node as a positioning identifier of the target DOM node, if not, judging whether the father node of the target DOM node exists, and if not, determining the positioning identifier of the target DOM node according to the sequence of the primary combination type corresponding to the target DOM node in the DOM tree; and if so, combining the type of the father node of the target DOM node, the type of the father node of the target DOM node and the type of the target DOM node to obtain a secondary combination type corresponding to the target DOM node, and determining the positioning identifier of the target DOM node according to the secondary combination type corresponding to the target DOM node.
13. The apparatus of claim 11, wherein the recording module is specifically configured to:
and if the identification of the target DOM node consists of numbers, determining that the identification of the target DOM node does not belong to the first type identification, and if the identification of the target DOM node comprises characters except the numbers, determining that the identification of the target DOM node belongs to the first type identification.
14. The apparatus of claim 9, wherein the processing module is specifically configured to:
analyzing the first interface to obtain a first DOM tree, and analyzing the standard interface to obtain a standard DOM tree;
for any difference node in the I-level node layers of the first DOM tree and the standard DOM tree, generating difference data corresponding to the difference node according to the difference of the difference node in the first DOM tree and the standard DOM tree; aiming at any same node in the I level node layers of the first DOM tree and the standard DOM tree, if the same node is determined to have a connected I +1 level sub-node, comparing all the I +1 level sub-nodes connected with the same node in the first DOM tree and the standard DOM tree, and judging whether any connected I +1 level sub-node belongs to a difference node or the same node according to a comparison result; wherein I is an integer greater than 0;
and rendering the elements corresponding to the different nodes on the first interface and the standard interface according to the difference data corresponding to the different nodes in each level of node layer to obtain the test result corresponding to the operation.
15. The apparatus of claim 14, wherein the processing module is specifically configured to:
if the I +1 level child node does not exist in the standard DOM tree and the I +1 level child node exists in the first DOM tree, determining the I +1 level child node as a newly added node; if the I +1 level child node exists in the standard DOM tree and the I +1 level child node does not exist in the first DOM tree, determining the I +1 level child node as a deleted node; if the I +1 level child node in the standard DOM tree is different from the I +1 level child node in the first DOM tree in any one or more items of style, type, name, identification and attribute, determining the I +1 level child node as a changed node;
and if the I +1 level child node is any one of a newly added node, a deleted node or a changed node, determining that the I +1 level child node is a difference node, and if the I +1 level child node in the standard DOM tree is the same as the I +1 level child node in the first DOM tree in style, type, name, identification and attribute, determining that the I +1 level child node is the same node.
16. The apparatus according to any one of claims 9 to 15, wherein the playback module is specifically configured to:
inserting the test cases into a task pool, wherein the task pool is used for storing one or more test cases to be executed;
and selecting a first process in an idle state from the plurality of processes, and sending the test case to the first process, so that the first process performs playback operation on the test interface according to the operation information of the user for operating the one or more DOM nodes, and sets the test case in the task pool to be in a locked state.
17. A computing device comprising at least one processing unit and at least one memory unit, wherein the memory unit stores a computer program that, when executed by the processing unit, causes the processing unit to perform the method of any of claims 1 to 8.
18. A computer-readable storage medium storing a computer program executable by a computing device, the program, when run on the computing device, causing the computing device to perform the method of any of claims 1 to 8.
CN201911072997.0A 2019-11-05 2019-11-05 Test method and device Active CN110928772B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201911072997.0A CN110928772B (en) 2019-11-05 2019-11-05 Test method and device
PCT/CN2020/125167 WO2021088724A1 (en) 2019-11-05 2020-10-30 Testing method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911072997.0A CN110928772B (en) 2019-11-05 2019-11-05 Test method and device

Publications (2)

Publication Number Publication Date
CN110928772A true CN110928772A (en) 2020-03-27
CN110928772B CN110928772B (en) 2022-03-08

Family

ID=69852387

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911072997.0A Active CN110928772B (en) 2019-11-05 2019-11-05 Test method and device

Country Status (2)

Country Link
CN (1) CN110928772B (en)
WO (1) WO2021088724A1 (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111767217A (en) * 2020-06-24 2020-10-13 中国工商银行股份有限公司 JS unit test case generation method and device
CN111857932A (en) * 2020-07-27 2020-10-30 成都安恒信息技术有限公司 Web substitution and filling method for operation and maintenance auditing system based on puppeteer
CN111881043A (en) * 2020-07-27 2020-11-03 山石网科通信技术股份有限公司 Page testing method and device, storage medium and processor
CN112116439A (en) * 2020-08-10 2020-12-22 杭州优行科技有限公司 Clearing and settlement testing method, device, terminal and storage medium
WO2021088724A1 (en) * 2019-11-05 2021-05-14 深圳前海微众银行股份有限公司 Testing method and apparatus
CN112817866A (en) * 2021-02-25 2021-05-18 北京百家科技集团有限公司 Recording playback method, device, system, computer equipment and storage medium
CN113032229A (en) * 2021-02-24 2021-06-25 山东英信计算机技术有限公司 JAVA performance test method, system and medium
CN113238949A (en) * 2021-05-19 2021-08-10 北京仁科互动网络技术有限公司 Test method, test device, electronic equipment and storage medium
CN113901360A (en) * 2021-10-25 2022-01-07 联想(北京)有限公司 Data processing method and device and electronic equipment
CN113901365A (en) * 2021-05-29 2022-01-07 长沙市到家悠享家政服务有限公司 Performance pressure measurement platform and method, electronic equipment and readable medium
CN114297076A (en) * 2021-12-30 2022-04-08 四川启睿克科技有限公司 Automatic testing method for Web website

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113312259B (en) * 2021-05-26 2023-12-29 深圳前海微众银行股份有限公司 Interface testing method and device
CN113485909B (en) * 2021-06-01 2023-10-27 杭州网易云音乐科技有限公司 Test method, test device, computing equipment and medium
CN113392007B (en) * 2021-06-17 2023-09-08 网易(杭州)网络有限公司 Compatibility testing method and device
CN114978360A (en) * 2022-05-10 2022-08-30 紫光计算机科技有限公司 Automatic testing method and device for communication equipment, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105740154A (en) * 2016-03-03 2016-07-06 北京白鹭时代信息技术有限公司 Webgame test script generation method and device
CN106133766A (en) * 2014-03-18 2016-11-16 谷歌公司 For calculating, apply and show the system and method for document increment
US20170264378A1 (en) * 2011-05-31 2017-09-14 Hewlett Packard Enterprise Development Lp Vulnerability detection
CN108415702A (en) * 2018-01-22 2018-08-17 北京奇艺世纪科技有限公司 A kind of mobile terminal application interface dynamic rendering intent and device
CN109144856A (en) * 2018-07-27 2019-01-04 北京皮尔布莱尼软件有限公司 A kind of UI automated testing method calculates equipment and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102419732B (en) * 2011-12-27 2015-03-18 Tcl集团股份有限公司 Android-platform-based automated testing method and testing tool
CN104598232B (en) * 2015-01-12 2018-02-13 北京大学 A kind of Web applications striding equipment catches back method
US10031730B2 (en) * 2015-04-22 2018-07-24 Salesforce.Com, Inc. Systems and methods of implementing extensible browser executable components
CN109684220A (en) * 2018-12-26 2019-04-26 苏州博纳讯动软件有限公司 A kind of browser compatibility analysis method based on event replay
CN110928772B (en) * 2019-11-05 2022-03-08 深圳前海微众银行股份有限公司 Test method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170264378A1 (en) * 2011-05-31 2017-09-14 Hewlett Packard Enterprise Development Lp Vulnerability detection
CN106133766A (en) * 2014-03-18 2016-11-16 谷歌公司 For calculating, apply and show the system and method for document increment
CN105740154A (en) * 2016-03-03 2016-07-06 北京白鹭时代信息技术有限公司 Webgame test script generation method and device
CN108415702A (en) * 2018-01-22 2018-08-17 北京奇艺世纪科技有限公司 A kind of mobile terminal application interface dynamic rendering intent and device
CN109144856A (en) * 2018-07-27 2019-01-04 北京皮尔布莱尼软件有限公司 A kind of UI automated testing method calculates equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
SMARTX: "《rrweb:打开web页⾯录制与回放的⿊盒⼦》", 《HTTPS://ZHUANLAN.ZHIHU.COM/P/60639266》 *

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021088724A1 (en) * 2019-11-05 2021-05-14 深圳前海微众银行股份有限公司 Testing method and apparatus
CN111767217B (en) * 2020-06-24 2024-02-02 中国工商银行股份有限公司 JS unit test case generation method and device
CN111767217A (en) * 2020-06-24 2020-10-13 中国工商银行股份有限公司 JS unit test case generation method and device
CN111881043B (en) * 2020-07-27 2022-10-14 山石网科通信技术股份有限公司 Page testing method and device, storage medium and processor
CN111857932A (en) * 2020-07-27 2020-10-30 成都安恒信息技术有限公司 Web substitution and filling method for operation and maintenance auditing system based on puppeteer
CN111881043A (en) * 2020-07-27 2020-11-03 山石网科通信技术股份有限公司 Page testing method and device, storage medium and processor
CN112116439A (en) * 2020-08-10 2020-12-22 杭州优行科技有限公司 Clearing and settlement testing method, device, terminal and storage medium
CN113032229A (en) * 2021-02-24 2021-06-25 山东英信计算机技术有限公司 JAVA performance test method, system and medium
CN112817866A (en) * 2021-02-25 2021-05-18 北京百家科技集团有限公司 Recording playback method, device, system, computer equipment and storage medium
CN113238949A (en) * 2021-05-19 2021-08-10 北京仁科互动网络技术有限公司 Test method, test device, electronic equipment and storage medium
CN113901365A (en) * 2021-05-29 2022-01-07 长沙市到家悠享家政服务有限公司 Performance pressure measurement platform and method, electronic equipment and readable medium
CN113901360A (en) * 2021-10-25 2022-01-07 联想(北京)有限公司 Data processing method and device and electronic equipment
CN114297076A (en) * 2021-12-30 2022-04-08 四川启睿克科技有限公司 Automatic testing method for Web website

Also Published As

Publication number Publication date
WO2021088724A1 (en) 2021-05-14
CN110928772B (en) 2022-03-08

Similar Documents

Publication Publication Date Title
CN110928772B (en) Test method and device
Zhou et al. Fault analysis and debugging of microservice systems: Industrial survey, benchmark system, and empirical study
US20220121410A1 (en) Technology add-on interface
US9727407B2 (en) Log analytics for problem diagnosis
US8667334B2 (en) Problem isolation in a virtual environment
US9612937B2 (en) Determining relevant events in source code analysis
US8731998B2 (en) Three dimensional visual representation for identifying problems in monitored model oriented business processes
CN109739855B (en) Method and system for realizing data sheet splicing and automatically training machine learning model
US20130061209A1 (en) Systems and methods for processing software application metadata associated with a software application
KR20120115477A (en) Visualizing transaction traces as flows through a map of logical subsystems
KR20120115478A (en) Visualizing realationships between a transaction trace graph and a map of logical subsystems
CN111108481B (en) Fault analysis method and related equipment
US10437717B2 (en) Defect reporting in application testing
CN109815119B (en) APP link channel testing method and device
US11436133B2 (en) Comparable user interface object identifications
JP2017539031A (en) Separation of test verification from test execution
US20070156742A1 (en) Visual modeling method and apparatus
US9164746B2 (en) Automatic topology extraction and plotting with correlation to real time analytic data
US11119899B2 (en) Determining potential test actions
EP3953836A1 (en) Systems and methods for hierarchical process mining
US20170285923A1 (en) Multi-perspective application components dependencies
Rabkin et al. A graphical representation for identifier structure in logs
Kuruba DevOps for IT service reliability and availability
US20070156755A1 (en) Data source mapping method and apparatus
JP2010128870A (en) Data processor

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