Object interface test method and device

By automatically executing the test script set of the object to be tested, the problem of low efficiency of GUI testing in the existing technology is solved, and efficient interface testing is achieved without manual script writing.

CN120631770APending Publication Date: 2025-09-12BEIJING URBAN CONSTR INTELLIGENT CONTROL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510771190.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-10
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

In the existing technology, GUI testing is inefficient and requires manual writing of test scripts, which leads to high requirements for testers and great difficulty in script writing.

Method used

By obtaining a test script set of the object to be tested, including an initial test script and a first test script corresponding to each node to be tested, the test script is automatically executed based on the association relationship between the initial interface and the nodes to obtain the interface test result.

Benefits of technology

It eliminates the need to manually write test scripts and can perform overall interface testing on the entire object to be tested in one test process, thereby improving the execution efficiency of the test scripts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120631770A_ABST
    Figure CN120631770A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an object interface testing method and device.The method comprises the steps that a testing script set of a to-be-tested object is obtained, the to-be-tested object comprises at least one to-be-tested node, and the testing script set comprises an initial testing script and at least one first testing script; the first test script is obtained according to a test operation corresponding to one of the to-be-tested nodes; executing the initial test script, and logging in an initial interface of the to-be-tested object; and based on the initial interface, respectively executing the at least one first test script according to the association relationship among the to-be-tested nodes, and obtaining an interface test result of the to-be-tested object. According to the embodiment of the invention, at least one first test script is executed according to the association relationship among the to-be-tested nodes, and the to-be-tested nodes can be tested in sequence, so that the interface test of the whole to-be-tested object is realized in one test process, and the interface test result of the whole to-be-tested object is obtained; manual compiling of test scripts is not needed, and test script execution efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of automated testing technology, and more particularly to a method and apparatus for testing an interface of an object. Background Art

[0002] The GUI (Graphical User Interface) is the primary interface between users and applications. It displays information and receives user commands through graphical interface elements (such as windows, buttons, and menus), making it easier and more convenient for users to use applications. To ensure that application interface elements function as expected and perform correct processing and display operations, GUI testing is often required.

[0003] Currently, to improve testing efficiency, automated test scripts are typically written for the content to be tested and then tested using an automated testing framework. During the test execution process, if a complete GUI test of the entire application is required, manual test script writing is often required. This approach places high demands on testers and is difficult to write scripts, resulting in low testing efficiency. Therefore, a more efficient testing method is urgently needed. Summary of the Invention

[0004] In view of this, embodiments of this specification provide an object interface testing method. One or more embodiments of this specification also relate to an object interface testing apparatus, a computing device, a computer-readable storage medium, and a computer program product to address technical deficiencies in the prior art.

[0005] According to a first aspect of an embodiment of this specification, a method for testing an interface of an object is provided, comprising: Obtaining a test script set for the object to be tested, wherein the object to be tested includes at least one node to be tested, the test script set includes an initial test script and at least one first test script, and the first test script is obtained according to a test operation corresponding to one of the nodes to be tested; Execute the initial test script and log in to the initial interface of the object to be tested; Based on the initial interface, at least one first test script is executed respectively according to the association relationship between the nodes to be tested to obtain the interface test result of the object to be tested.

[0006] According to a second aspect of the embodiments of this specification, there is provided an interface testing device for an object, comprising: an acquisition module configured to acquire a test script set of an object to be tested, wherein the object to be tested includes at least one node to be tested, the test script set includes an initial test script and at least one first test script, and the first test script is obtained according to a test operation corresponding to one of the nodes to be tested; An execution module is configured to execute an initial test script and log in to the initial interface of the object to be tested; The testing module is configured to execute at least one first test script based on the initial interface and in accordance with the association relationship between the nodes to be tested, so as to obtain the interface test result of the object to be tested.

[0007] According to a third aspect of an embodiment of this specification, a computing device is provided, including: memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the interface testing method of the above-mentioned object are implemented.

[0008] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, which, when executed by a processor, implement the steps of the interface testing method of the above-mentioned object.

[0009] According to a fifth aspect of the embodiments of this specification, a computer program product is provided, comprising a computer program / instruction, which implements the steps of the interface testing method of the above-mentioned object when executed by a processor.

[0010] One embodiment of the present specification implements obtaining a test script set for an object to be tested, wherein the object to be tested includes at least one node to be tested, the test script set includes an initial test script and at least one first test script, the first test script is obtained based on a test operation corresponding to one of the nodes to be tested; the initial test script is executed to log in to the initial interface of the object to be tested; based on the initial interface, at least one first test script is executed respectively according to the association relationship between the nodes to be tested to obtain the interface test results of the object to be tested.

[0011] In this way, by executing the initial test script and logging into the initial interface of the object to be tested, each first test script can be executed based on the initial interface to realize the test of each node to be tested; by executing at least one first test script respectively according to the association relationship between each node to be tested, each node to be tested can be tested in sequence, so that in one test process, the interface test of the object to be tested as a whole can be realized, and the interface test results for the entire object to be tested can be obtained; there is no need to manually write test scripts, which can improve the efficiency of test script execution. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 This is a flowchart of an object interface testing method provided by one embodiment of this specification; Figure 2 This is a schematic diagram of a test script execution process of an object interface testing method provided by one embodiment of this specification; Figure 3 This is a schematic diagram of the execution process of a module to be tested in a method for testing an interface of an object provided by one embodiment of this specification; Figure 4 This is a schematic diagram of a test script execution process of an object interface testing method provided by another embodiment of this specification; Figure 5 This is a flow chart of a test script generation process of an object interface testing method provided by one embodiment of this specification; Figure 6 This is a schematic structural diagram of an interface testing device for an object provided by one embodiment of this specification; Figure 7 This is a structural block diagram of a computing device provided by one embodiment of this specification. DETAILED DESCRIPTION

[0013] The following description sets forth many specific details to facilitate a thorough understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the scope of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.

[0014] The terms used in one or more embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of this specification. The singular forms "a," "the," and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0015] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0016] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0017] In this specification, a method for testing an interface of an object is provided. This specification also relates to an interface testing device for an object, a computing device, a computer-readable storage medium, and a computer program product, which are described in detail one by one in the following embodiments.

[0018] See also Figure 1 , Figure 1 A flowchart of an object interface testing method provided according to an embodiment of the present specification is shown, which specifically includes the following steps.

[0019] Step 102: Obtain a test script set of the object to be tested, wherein the object to be tested includes at least one node to be tested, the test script set includes an initial test script and at least one first test script, and the first test script is obtained according to a test operation corresponding to one of the nodes to be tested.

[0020] In one or more optional embodiments of the present specification, the object interface testing method may include a test script generation process and a test script execution process.

[0021] The execution process of the test script is executed for the entire object to be tested, that is, the interface test of the entire object to be tested can be completed in one execution process.

[0022] Currently, interface testing for the entire object under test often requires testers to manually write test scripts to execute each test case in sequence. However, the object interface testing method provided in this specification, specifically for GUI automated testing of application programs, can execute the test scripts corresponding to each node under test in sequence based on the associations between the nodes under test in a single execution process, thereby achieving interface testing for the entire object under test without manually writing test scripts.

[0023] In practical applications, the purpose of GUI automation testing is to ensure that the application's GUI can run normally on various platforms and devices and meet user interaction expectations.

[0024] For example, the content of GUI automated testing covers various aspects of GUI, including but not limited to: Links, pop-up menus, drop-down menus, and buttons: These elements are common interactive components in GUIs and can be tested for their responsiveness, correctness, and consistency.

[0025] Forms and input boxes: Test form submission, input box alignment, character limits, special character processing, etc.

[0026] Layout and style: Verify whether the layout of the GUI meets the design specifications, including fonts, colors, alignment, etc.

[0027] Cross-platform and cross-device compatibility: Ensure that the GUI behaves consistently across different platforms and devices.

[0028] Optionally, the GUI testing method may include: a traditional manual testing method, a script-based automated testing method, and a testing method using a GUI automated testing tool. Among them, the testing method using a GUI automated testing tool is a relatively efficient and accurate method.

[0029] In one or more optional embodiments of this specification, an automated testing framework based on image recognition may be used, including but not limited to Airtest, Sikuli, and other frameworks. This automated testing framework can automatically generate test scripts based on image recognition, run the scripts to playback operations, and automatically verify and compare functional correctness, significantly reducing manual intervention and improving testing efficiency and accuracy.

[0030] Specifically, an application's GUI is a graphical interface that allows users to interact with the application. It allows users to operate and control the application through visual elements (such as windows, menus, buttons, icons, text boxes, etc.) without having to deeply understand the underlying code or commands.

[0031] The main purpose of a GUI is to provide an intuitive, easy-to-use, and attractive interface that enables users to easily complete various tasks. Through a GUI, users can perform operations such as opening files, editing text, saving data, launching programs, etc.

[0032] For example, a GUI generally includes the following key elements: Window: The main interface of an application, used to display information and receive user input.

[0033] Menu: Provides a series of commands and options that users can select to perform specific actions.

[0034] Toolbar: Typically contains a series of buttons and icons that provide quick access to frequently used commands and functions.

[0035] Dialog boxes: These are windows used for short-term interactions with the user, such as asking the user to save changes or confirm an action.

[0036] Status bar: Usually located at the bottom of the window, it displays the current status or progress information of the application.

[0037] Icon: A small image that represents a file, program, or command. Users can click the icon to start the program or open the file.

[0038] Text boxes and edit boxes: Allow users to enter text or numbers, such as usernames, passwords, or search queries.

[0039] According to an optional embodiment of the present specification, a test script set of the object to be tested may be obtained.

[0040] Specifically, the object to be tested can be understood as an object that requires interface testing. The object to be tested can be an application on a computer desktop or a web application.

[0041] A test script set can be understood as a collection of test scripts included in the object under test. A node under test can be understood as a function of the object under test, and a node under test can also be called the main test point of the object under test. The object under test can include one or more nodes under test, each of which implements different specific functions.

[0042] The initial test script can be understood as a test script for logging into the initial interface of the object to be tested, and can also be understood as a common initial interface login script for each node to be tested.

[0043] In actual applications, when logging into the initial interface of the object to be tested based on the initial test script, each node to be tested can be further tested based on the initial interface.

[0044] Specifically, the first test script can be understood as a test script corresponding to the node to be tested. One node to be tested can correspond to at least one first test script. The first test script can specifically include at least one of a pre-test script, a test script, and a reset test script.

[0045] Optionally, the pre-test script can be generated based on pre-operations to be performed before executing the test script. Specifically, the pre-operations can be understood as some preparation or setting operations.

[0046] For example, before executing a test script, it is necessary to enter a certain page, and the page entry operation is the pre-operation of the test script. The pre-test script is used to enter the page.

[0047] Optionally, the reset test script can be generated based on a reset operation to be performed after executing the test script. Specifically, the reset operation can be understood as restoring the test environment to an initial state, or resetting or restoring default settings.

[0048] Optionally, a test script may be generated based on at least one set of test operations included in the node to be tested. The at least one set of test operations may be determined based on a pre-written test case for the node to be tested. Specifically, a test operation may be understood as a test operation performed on the node to be tested, and may include operations such as mouse clicks and keyboard inputs.

[0049] For example, the test case may be: login function test; the corresponding test purpose is: to verify whether the login function of the application works as expected, including whether the correct username and password can successfully log in, and whether the incorrect username or password will cause login failure.

[0050] Test operations can include: Step 1: Launch the application: Open the GUI of the application under test.

[0051] Step 2: Locate the login screen: Find and click the login button or link to enter the login screen.

[0052] Step 3: Enter the correct username and password: Enter the correct username and password in the username and password input boxes respectively.

[0053] Step 4: Click the Login button: Click the Login button to submit the login request.

[0054] Step 5: Verify successful login: Check whether the page is successfully redirected to the main interface or a successful login prompt message is displayed.

[0055] Step 6: Reset the test environment: If the test environment needs to be kept clean, you can log out the current user or reset the test environment.

[0056] Step 7: Enter the wrong username: Enter the wrong username in the username input box and enter the correct password in the password input box.

[0057] Repeat step 4: Click the Login button again to submit the login request.

[0058] Step 8: Verify login failure: Check whether a login failure message is displayed and the login interface does not jump.

[0059] Step 9: Enter an incorrect password: Enter the correct user name in the Username input box and an incorrect password in the Password input box.

[0060] Repeat step 4: Click the Login button again to submit the login request.

[0061] Step 10: Verify login failure: Check whether a login failure message is displayed and the login interface does not jump.

[0062] Expected results of test operations can include: In step 5, you should be redirected to the main interface or a successful login prompt message should be displayed.

[0063] In step 10, a login failure message should be displayed, and the login interface should not be redirected.

[0064] In step 10, a login failure message should also be displayed, and the login interface should not be redirected.

[0065] In one or more optional embodiments of the present specification, the first test script can be obtained according to the test operation corresponding to one of the nodes to be tested. That is, the first test script is a test script generated according to the test operation of one of the nodes to be tested.

[0066] According to an optional embodiment of the present specification, before obtaining the test script set of the object to be tested, the following steps may also be included: Generate a first test script corresponding to each node to be tested.

[0067] In actual applications, when the object to be tested includes one or more nodes to be tested, a first test script corresponding to each node to be tested may be generated for each node to be tested.

[0068] Optionally, the first test script may specifically include at least one of a pre-test script, a test script, and a reset test script.

[0069] For example, if the object to be tested includes a node to be tested, a pre-test script, a test script, and a reset test script may be generated for the node to be tested. The test script set of the object to be tested then includes: an initial test script, a pre-test script, a test script, and a reset test script.

[0070] For example, if the object to be tested includes three nodes to be tested: node a, node b, and node c, then a pre-test script a, test script a, and reset test script a can be generated for node a; a pre-test script b, test script b, and reset test script b can be generated for node b; and a pre-test script c, test script c, and reset test script c can be generated for node c. The test script set for the object to be tested then includes: an initial test script, a pre-test script a, test script a, and reset test script a; pre-test script b, test script b, and reset test script b; and pre-test script c, test script c, and reset test script c.

[0071] By applying this embodiment, by generating a first test script corresponding to each node to be tested, a test script set for the object to be tested can be constructed based on the initial test script and at least one first test script, so that the interface test of the object to be tested as a whole can be realized based on the test script set, thereby improving the test efficiency.

[0072] According to an optional embodiment of the present specification, generating a first test script corresponding to each node to be tested may include the following steps: Determining at least one set of test operations included in a target node to be tested, wherein the target node to be tested is any one of the nodes to be tested; Execute at least one group of test operations respectively, and record the test operation content corresponding to each group of test operations; Based on the test operation content, a first test script corresponding to the target node to be tested is generated.

[0073] Specifically, the target node to be tested can be understood as any one of the nodes to be tested, and the target node to be tested can include one or more groups of test operations, each group of test operations including at least one mouse click operation and / or at least one keyboard operation.

[0074] Optionally, at least one set of test operations may be determined based on a test case of the target node to be tested, and the test case may be determined by a tester based on requirements in an actual application.

[0075] Specifically, the test operation content can be understood as the content recorded for the object under test during the test operation, which can specifically include the interface screen recording video, the test operation performed, and the operation execution time.

[0076] Optionally, the interface screen recording video can be obtained by the screen recording object recording the interface of the object to be tested during the execution of the test operation.

[0077] Specifically, a screen recording object can be understood as a tool that can record a video of the screen. The screen recording object can be a GUI automated testing tool, a screen recording component within a GUI automated testing tool, or a third-party screen recording tool, depending on the needs of the actual application.

[0078] Optionally, the test operation to be performed can be obtained by monitoring input signals of an input device. Specifically, the input device can include a mouse and a keyboard, etc., and the input signal can include a mouse input signal, a keyboard input signal, etc.

[0079] Optionally, the operation execution time may be determined according to the reception time of the monitored input signal.

[0080] This embodiment automatically generates a test script for the target node by determining at least one set of test operations included in the target node under test, executing the at least one set of test operations, and recording the test operation content during the test operation execution process. This eliminates the need for manual test script writing and improves test script generation efficiency.

[0081] According to an optional embodiment of the present specification, recording the test operation content corresponding to each group of test operations may include the following steps: During the execution of any set of test operations, the interface screen video of the object under test is recorded, and the input signal and the reception time of the input signal are monitored.

[0082] Specifically, a screen recording can be understood as a video recording of the interface of the object under test during the execution of a set of test operations. Input signals may include mouse input signals and / or keyboard input signals. Each input signal corresponds to a reception time. The reception time of the input signal can represent the execution time of the test operation.

[0083] Furthermore, before recording the screen video of the interface of the object to be tested, the following steps may also be included: Establish a connection between the GUI testing tool and the object to be tested, and start the interface recording function and input device monitoring function.

[0084] Optionally, the position information of the object to be measured on the screen may be obtained, so as to implement screen recording of the interface of the object to be measured based on the position information.

[0085] By applying this embodiment, by recording the interface screen video of the object to be tested and monitoring the input signal and the reception time of the input signal during the execution of any group of test operations, it is possible to generate test operation statements corresponding to each group of test operations based on the interface screen video, the input signal and the reception time of the input signal. Therefore, based on the test operation statements corresponding to each group of test operations, it is possible to obtain the test script corresponding to the target node to be tested, realize the automatic generation of test scripts for each node to be tested, and improve the generation efficiency and accuracy of the test script.

[0086] According to an optional embodiment of the present specification, generating a first test script corresponding to a target node to be tested based on the test operation content may include the following steps: Generate an operation control script statement and a time control script statement corresponding to the operation control script statement according to the input signal and the reception time of the input signal; Get the assertion script statement corresponding to the input signal; A first test script is obtained based on the operation control script statement, the time control script statement, and the assertion script statement.

[0087] Specifically, the operation control script statement can be used to simulate the test operations required to be performed on the GUI of the object under test. The time control script statement can be used to reserve sufficient jump reaction time for the interface after each test operation is performed.

[0088] Optionally, the operation control script statement can be generated according to the input signal; the time control script statement can be generated according to the time interval between two adjacent input signals.

[0089] Specifically, the assertion script statement can be used to determine whether the interface response of the object under test meets expectations, that is, to determine whether the application response is correct.

[0090] Optionally, obtaining the assertion script statement corresponding to the input signal may include: On the response interface after the test operation is completed, determine the correct response feature image and take a screenshot of the response feature area to generate an assertion script statement.

[0091] Specifically, the reaction interface can be understood as an interface after the object to be tested reacts based on the completed test operation.

[0092] Optionally, the reaction feature image can be understood as an interface screenshot of the correct reaction feature area in the reaction interface, which is captured by the tester in real time from the correct reaction interface of the object to be tested.

[0093] In practical applications, the object under test can also be understood as the software being tested, specifically a desktop application or web application. When the tester performs mouse or keyboard operations on the software under test, the software under test generates a corresponding interface response. The tester can then search for an image containing the correct action response feature area in the response interface, take a screenshot of the action response feature area in the image, obtain the response feature image, and then automatically generate assertion script statements based on the response feature image.

[0094] Specifically, the reaction feature area can be understood as the area in the interface screenshot where the reaction content exists. The screenshot operation can be understood as the operation of taking a screenshot of the reaction feature area in the reaction feature image.

[0095] In practical applications, the test script for the target node under test can include two types of script statements: one is the execution script statement, also known as the operation control script statement, and the other is the script statement for determining the execution result, also known as the assertion script statement. Within at least one set of test operations, a set of test operations can include both operation control script statements and assertion script statements, or it can include only operation control script statements. Furthermore, to reserve sufficient interface response time after executing the test operation, a corresponding time control script statement can be generated for each operation control script statement.

[0096] In actual applications, each group of test operations can be executed separately, and test script statements corresponding to each group of test operations can be automatically generated. Then, according to the test script statements corresponding to each group of test operations, a test script for the target node to be tested can be composed.

[0097] For example, assuming that the target node to be tested includes three groups of test operations, the first group of test operations can be executed first, and the interface screen video of the object to be tested can be recorded during the execution of the first group of test operations, and the input signal and the reception time of the input signal can be monitored to generate the test script statements corresponding to the first group of test operations; then the second group of test operations can be executed, and the interface screen video of the object to be tested can be recorded during the execution of the second group of test operations, and the input signal and the reception time of the input signal can be monitored to generate the test script statements corresponding to the second group of test operations; finally, the third group of test operations can be executed, and the interface screen video of the object to be tested can be recorded during the execution of the third group of test operations, and the input signal and the reception time of the input signal can be monitored to generate the test script statements corresponding to the third group of test operations. Based on the test script statements corresponding to the first group of test operations, the second group of test operations, and the third group of test operations, a test script for the target node to be tested is formed.

[0098] By applying this embodiment, by generating an operation control script statement and a time control script statement corresponding to the operation control script statement based on the input signal and the reception time of the input signal, it is possible to determine the test operation to be performed and the interval execution time between two adjacent test operations based on the input signal, thereby improving the efficiency of script statement generation. At the same time, the accuracy of the script statement is improved by taking into account the interface response time; by generating an assertion script statement based on the interface screen recording video, it is possible to generate an assertion statement for judging whether the execution result is accurate based on the response interface; based on the operation control script statement, the time control script statement and the assertion script statement, a first test script is obtained, which can improve the integrity and accuracy of the test script.

[0099] According to an optional embodiment of the present specification, the input signal includes a mouse input signal, the mouse input signal includes a mouse click position, and the operation control script statement includes a click control script statement.

[0100] Generating an operation control script statement and a time control script statement corresponding to the operation control script statement according to an input signal and a reception time of the input signal may include the following steps: According to the first receiving time of the mouse input signal, obtaining, from the interface screen recording video, a first interface screenshot at a preset time interval before the first receiving time; Identify the target operation control in the first interface screenshot based on the mouse click position; Generate click control script statements based on the target operation control; A time control script statement corresponding to the click control script statement is generated according to the time interval between the first receiving time and the second receiving time of the adjacent input signal.

[0101] Specifically, the first receiving time can be understood as the time at which a mouse click operation is executed. The first interface screenshot can be understood as a screenshot of the interface corresponding to a time interval preset before the first receiving time in the interface screen recording video. The click control script statement can be used to determine the mouse click operation that needs to be executed during this test operation, and specifically may include the target operation control that requires the mouse click.

[0102] Optionally, the preset time interval may be determined according to actual application requirements, for example, 0.1 s.

[0103] In actual applications, since the interface of the object to be tested may have responded at the first receiving time corresponding to the mouse click operation, and the interface content has changed, in order to obtain a screenshot of the interface that has not changed when clicked, a screenshot of the interface corresponding to the moment preset time interval before the first receiving time can be obtained.

[0104] Optionally, identifying a target operation control in the first interface screenshot according to the mouse click position may include: Performing morphological image operation processing on the first interface screenshot to obtain the outline position of each operation control in the first interface screenshot; Based on the outline position of each operation control, the outer rectangular frame of each operation control is determined respectively, and the size of the outer rectangular frame is fine-tuned and enlarged; The target control position of the target operation control is obtained according to the mouse click position and the external rectangular frames after fine-tuning and enlarging.

[0105] Specifically, the target operation control can be understood as the operation control clicked by the mouse click operation. The target control position can be understood as the position information of the target operation control's circumscribed rectangular frame after fine-tuning and enlargement.

[0106] Optionally, fine-tuning and enlarging the size of the circumscribed rectangular frame may include: multiplying the length and width of the circumscribed rectangular frame by a preset enlargement factor respectively.

[0107] The preset amplification factor can be determined according to the requirements of actual applications. For example, the value range of the preset amplification factor n can be 1.05-1.15.

[0108] Optionally, the mouse click position can be a coordinate , the coordinates of the upper left and lower right vertices of the enlarged rectangular frame are .

[0109] If the requirements of the following formula (a) are met and the area of ​​the fine-tuned and enlarged bounding rectangle is the smallest, the operation control j is determined to be the target operation control, and the position information of the fine-tuned and enlarged bounding rectangle of the operation control j is obtained.

[0110]

[0111] Furthermore, based on the target control position of the target operation control, a screenshot operation can be performed on the first interface screenshot, and a click script statement can be generated based on the screenshot.

[0112] According to an optional embodiment of the present specification, sufficient interface response time can be reserved for the object under test before executing the mouse click operation, thereby ensuring the accuracy of the test execution process. Based on the time interval between the first reception time and the second reception time of the adjacent input signal, a time control script statement corresponding to the click control script statement is generated, which may include: determining an adjacent input signal preceding the mouse input signal and a second receiving time of the adjacent input signal; A time control script statement corresponding to the click control script statement is generated according to the time interval between the first receiving time and the second receiving time.

[0113] Specifically, the adjacent input signal may be a mouse input signal or a keyboard input signal.

[0114] According to another optional embodiment of the present specification, sufficient interface response time can be reserved for the object under test after executing the mouse click operation, thereby ensuring the accuracy of the test execution process. Generating a time control script statement corresponding to the click control script statement based on the time interval between the first reception time and the second reception time of the adjacent input signal may include: determining an adjacent input signal subsequent to the mouse input signal and a second receiving time of the adjacent input signal; A time control script statement corresponding to the click control script statement is generated according to the time interval between the first receiving time and the second receiving time.

[0115] In practical applications, by determining the receiving time interval between two adjacent input signals, the operation time interval between two adjacent operations can be obtained, so that a time control script statement can be generated according to the operation time interval. After each test operation is executed, sufficient reaction time is reserved for the interface of the object to be tested to ensure the accuracy of the test process.

[0116] By applying this embodiment, a first interface screenshot at a preset time interval before the first receiving time is obtained from the interface screen recording video according to the first receiving time of the mouse input signal. The first interface screenshot before the interface reaction occurs can be obtained, so that the target operation control of the mouse click can be identified according to the first interface screenshot, and a click control script statement can be generated to realize the automatic generation of test script statements and improve the generation efficiency of test script statements; by generating a time control script statement corresponding to the click control script statement according to the time interval between the first receiving time and the second receiving time of the adjacent input signal, sufficient reaction time can be reserved for the interface of the object to be tested after each test operation is executed, thereby ensuring the accuracy of the test process.

[0117] According to an optional embodiment of the present specification, the input signal includes a keyboard input signal, and the operation control script statement includes a keyboard control script statement.

[0118] Generating an operation control script statement and a time control script statement corresponding to the operation control script statement according to an input signal and a reception time of the input signal may include the following steps: Generate keyboard control script statements according to keyboard input signals; A time control script statement corresponding to the keyboard control script statement is generated according to the time interval between the third receiving time of the keyboard input signal and the second receiving time of the adjacent input signal.

[0119] Specifically, the keyboard control script statement can be used to indicate the keyboard operations to be performed in this test operation, which can specifically include pressing the function keys and / or non-function keys on the keyboard. The adjacent input signal can be a mouse input signal or a keyboard input signal.

[0120] According to an optional embodiment of the present specification, sufficient interface response time can be reserved for the object under test before executing the keyboard operation, thereby ensuring the accuracy of the test execution process. Generating a time control script statement corresponding to the keyboard control script statement based on the time interval between the third reception time and the second reception time of the adjacent input signal may include: determining an adjacent input signal preceding the keyboard input signal and a second receiving time of the adjacent input signal; According to the time interval between the third receiving time and the second receiving time, a time control script statement corresponding to the keyboard control script statement is generated.

[0121] Specifically, the adjacent input signal may be a mouse input signal or a keyboard input signal.

[0122] According to another optional embodiment of the present specification, sufficient interface response time can be reserved for the object under test after the keyboard click operation is performed, thereby ensuring the accuracy of the test execution process. Generating a time control script statement corresponding to the keyboard control script statement based on the time interval between the third reception time and the second reception time of the adjacent input signal may include: determining an adjacent input signal following the keyboard input signal and a second receiving time of the adjacent input signal; According to the time interval between the third receiving time and the second receiving time, a time control script statement corresponding to the keyboard control script statement is generated.

[0123] In practical applications, by determining the receiving time interval between two adjacent input signals, the operation time interval between two adjacent operations can be obtained, so that a time control script statement can be generated according to the operation time interval. After each test operation is executed, sufficient reaction time is reserved for the interface of the object to be tested to ensure the accuracy of the test process.

[0124] By applying this embodiment, by generating keyboard control script statements based on keyboard input signals, the automatic generation of test script statements can be realized, thereby improving the efficiency of script statement generation; by generating time control script statements corresponding to the keyboard control script statements based on the time interval between the third receiving time of the keyboard input signal and the second receiving time of the adjacent input signal, sufficient reaction time can be reserved for the interface of the object to be tested after each test operation is executed, thereby ensuring the accuracy of the test process.

[0125] According to an optional embodiment of the present specification, obtaining an assertion script statement corresponding to an input signal may include the following steps: Obtaining a reaction characteristic image corresponding to the input signal, wherein the reaction characteristic image is obtained by taking a screenshot of the operation reaction characteristic area in the reaction interface, where the reaction interface is an interface displayed by the object to be tested based on the input signal; Generate assertion script statements corresponding to the input signal based on the response feature image.

[0126] Specifically, the input signal may include a mouse input signal, a keyboard input signal, or an input signal from other external devices, such as a handle, a microphone, a touch screen, etc. The specific signal may be determined based on the signals supported by the object to be tested in actual applications.

[0127] Specifically, the reaction interface can be understood as the interface that reacts to the operation corresponding to the input signal performed by the test subject, or the interface displayed after receiving the input signal. The operation reaction feature area can be understood as the area of ​​the reaction interface that contains the reaction content, for example, the area of ​​the interface that changes.

[0128] In actual applications, when a tester performs mouse or keyboard operations on the software under test, the software under test will generate relevant interface reactions based on the corresponding input signals. At this time, the tester can search for an image containing the operation reaction feature area in the reaction interface, take a screenshot of the operation reaction feature area in the image, obtain the reaction feature image, and then automatically generate assertion script statements based on the reaction feature image.

[0129] In an optional embodiment of the present specification, the reaction feature image includes the correct reaction content corresponding to the input signal, which can represent the correct reaction of the test object to operations such as mouse clicks and keyboard inputs. Specifically, it may include the correct display page, correct page elements, etc. The correct page elements may include the correct page element position, correct page element style, correct page element display content, etc.

[0130] In actual applications, after the tester performs operations such as mouse clicks and keyboard input on the tested software, if the software interface is correct (no bugs), the correct response interface will be displayed, and the response feature area in the response interface will contain the correct response content. At this time, the response feature area in the response interface can be screenshoted to obtain the first response feature image.

[0131] Specifically, the first reaction characteristic image is used to represent that the reaction content of the interface to the test operation is correct.

[0132] Furthermore, an assertion script statement corresponding to the correct response content can be automatically generated based on the first response feature image. This assertion script statement is hereinafter referred to as the first assertion script statement.

[0133] In the subsequent automated testing process, based on the first assertion script statement, it can be detected whether the interface response at the corresponding node to be tested is correct.

[0134] In another optional embodiment of the present specification, the reaction feature image includes an erroneous reaction content corresponding to the input signal, which is used to represent the erroneous reaction of the test object to an operation such as a mouse click or keyboard input. Specifically, it may include an erroneous display page, an erroneous page element, etc. The erroneous page element may include an erroneous page element position, an erroneous page element style, an erroneous page element display content, etc.

[0135] In practice, if a tester performs mouse clicks, keyboard input, or other operations on the software under test and there is a problem (bug) in the software interface, an incorrect response interface will be displayed. The response feature area in the response interface will contain incorrect response content. In this case, you can take a screenshot of the incorrect response feature area in the response interface to obtain a second response feature image.

[0136] Specifically, the second reaction characteristic image is used to represent that the reaction content of the interface to the test operation is wrong or abnormal.

[0137] Furthermore, an assertion script statement corresponding to the error response content can be automatically generated based on the second response feature image. This assertion script statement is hereinafter referred to as a second assertion script statement.

[0138] In the subsequent automated testing process, based on the second assertion script statement, it can be detected whether the interface response at the corresponding node to be tested has eliminated the error.

[0139] It should be noted that when the tester performs a test operation, the interface of the tested software will react based on the test operation, displaying a reaction interface. This reaction interface is either correct (the interface does not have a bug) or incorrect (the interface does have a bug). Therefore, if the interface does not have a bug, the first reaction feature image is obtained, and the first assertion script statement is automatically generated. If the interface has any bug, the second reaction feature image is obtained, and the second assertion script statement is automatically generated.

[0140] Furthermore, if the first test script includes a first assertion script statement, then in the subsequent testing process, it can be determined whether the interface response is correct based on the first assertion script statement; if the first test script includes a second assertion script statement, then in the subsequent testing process, it can be determined whether the error (bug) originally existing in the interface has been eliminated based on the second assertion script statement.

[0141] In actual applications, the first test script may include the first assertion script statement or the second assertion script statement, which can be determined based on whether the interface response is correct when the tester manually executes the test.

[0142] In another optional embodiment of the present specification, the assertion script statement may further include both a first assertion script statement and a second assertion script statement.

[0143] For example, if the interface is bug-free, the first reaction feature image is obtained and the first assertion script statement is automatically generated. The tester can then manually program to generate the second assertion script statement corresponding to the error-prone interface. If the interface contains a bug, the second reaction feature image is obtained and the second assertion script statement is automatically generated. After fixing the interface bug, the tester can obtain the first reaction feature image, and then the tool can automatically generate the first assertion script statement based on the first reaction feature image.

[0144] In both of the above examples, a test script corresponding to a node to be tested may include both the first assertion script statement and the second assertion script statement.

[0145] By applying this embodiment, by obtaining the reaction feature image corresponding to the input signal, and generating the assertion script statement corresponding to the input signal based on the reaction feature image, the reaction feature image can be obtained according to the correct operation reaction feature area corresponding to the input signal, and the corresponding assertion script statement can be automatically generated, so that in the subsequent test execution process, it can be judged whether the reaction content corresponding to each operation is correct, which is conducive to improving the accuracy of the test results.

[0146] Step 104: Execute the initial test script and log in to the initial interface of the object to be tested.

[0147] In actual applications, based on obtaining the test script set of the object to be tested, the initial test script can be executed to log in to the initial interface of the object to be tested.

[0148] Furthermore, when logging into the initial interface of the object to be tested, the first test script of each node to be tested may be executed to implement automated testing of each node to be tested.

[0149] Step 106: Based on the initial interface, at least one first test script is executed respectively according to the association relationship between the nodes to be tested to obtain the interface test result of the object to be tested.

[0150] In actual applications, based on the initial interface of logging into the object to be tested, at least one first test script can be executed based on the initial interface and in accordance with the association between the nodes to be tested to obtain the interface test results of the object to be tested.

[0151] According to an optional embodiment of the present specification, the association relationship includes: a first preset sequence between the nodes to be tested.

[0152] Based on the initial interface, executing at least one first test script respectively according to the association relationship between the nodes to be tested to obtain the interface test result of the object to be tested may include the following steps: Based on the initial interface, at least one first test script is executed in a first preset sequence to obtain an interface test result of the object to be tested.

[0153] In actual applications, if the object to be tested includes one or more nodes to be tested, the first test scripts corresponding to the nodes to be tested can be executed in sequence according to a first preset sequence between the nodes to be tested to obtain the interface test results for the entire object to be tested.

[0154] Furthermore, each first test script may include an operation control script statement and an assertion script statement, and the operation control script statement may also have its corresponding time control script statement. For any first test script, when all the assertion script statements in the first test script are executed to completion, it means that the test of the node to be tested corresponding to the first test script is completed. When all the first test scripts are executed, it means that the interface test of the object to be tested is completed.

[0155] Optionally, the first preset sequence can be any order, or it can be an order preset by the tester according to actual test requirements. The specific order can be determined according to the requirements of actual applications, and this specification does not impose any limitation on this.

[0156] See also Figure 2 , Figure 2 A schematic diagram of a test script execution process of an object interface testing method provided according to an embodiment of the present specification is shown.

[0157] The common initial interface login script is executed first, and then the scripts of the nodes to be tested are executed in sequence according to the first preset sequence among the nodes to be tested.

[0158] like Figure 2 As shown, the scripts of each node to be tested include a pre-test script, a test script and a reset test script. The nodes to be tested may include node 1 to node x.

[0159] If the first preset sequence is to execute from node 1 to node x, the automated execution process of the test script may include: Execute the common initial interface login script and log in to the initial interface; Execute the pre-test script of the node under test 1, and loop the test script of the node under test 1 and the reset test script of the node under test 1 for P1 times; Execute the pre-test script of the node under test 2, and loop the test script of the node under test 2 and the reset test script of the node under test 2 for P2 times; ......; Execute the pre-test script of the node to be tested x, and loop the test script of the node to be tested x and the reset test script of the node to be tested x P xSecond-rate.

[0160] Optionally, the number of cycles P1 to P x It can be determined according to the needs of actual applications, and the value is a positive integer greater than or equal to 1.

[0161] By applying this embodiment, at least one first test script is executed based on the initial interface in a first preset order to obtain the interface test results of the object to be tested. In the execution process of a test script, the test scripts corresponding to each node to be tested can be executed in sequence, thereby realizing the interface test of the entire object to be tested without the need for manual script writing, thereby improving test efficiency.

[0162] According to an optional embodiment of this specification, the object to be tested includes at least one module to be tested, the module to be tested includes at least one node to be tested, different modules to be tested include different nodes to be tested, and the first test script includes a common test script and a target test script.

[0163] Before obtaining the test script set of the object to be tested, the following steps may also be included: For any module to be tested, a common test script corresponding to each node to be tested in the module to be tested and a target test script corresponding to each node to be tested in the module to be tested are obtained.

[0164] In practical applications, the object to be tested can be divided into at least one module to be tested according to its function. Each module to be tested can include at least one node to be tested, and different modules to be tested can include different nodes to be tested.

[0165] Furthermore, a module under test may include one or more nodes under test, and each node under test in a module under test may include the same shared test script and different private test scripts. A shared test script may be understood as a test script used in common by each node under test, and may include a shared pre-test script and / or a shared reset test script. A private test script may be understood as a test script corresponding to each node under test and having different test contents, and is also referred to as a "target test script" in this specification, and may include at least one of a pre-test script, a test script, and a reset test script.

[0166] The first test script may include the above-mentioned shared test script and target test script. Each first test script may include an operation control script statement and an assertion script statement, and the operation control script statement may also have its corresponding time control script statement. For any first test script, when all the assertion script statements in the first test script are executed to completion, it means that the test of the node to be tested corresponding to the first test script is completed. When all the first test scripts in the module to be tested are executed, it means that the interface test of the module to be tested is completed.

[0167] Optionally, a common pre-test script may be generated based on a common pre-test operation of each node under test in the module under test; a common reset test script may be generated based on a common reset operation of each node under test in the module under test.

[0168] Exemplarily, each node to be tested in the module to be tested needs to enter the target page for testing, and the operation of entering the target page is a common pre-operation for each node to be tested in the module to be tested.

[0169] By applying this embodiment, by obtaining the common test script corresponding to each node to be tested in the module to be tested and the target test script corresponding to each node to be tested in the module to be tested, a test script set corresponding to each module to be tested can be constructed for each module to be tested; for each node to be tested in the same module to be tested, a common test script is generated, thereby reducing the repeated execution of the same test operations during the test process and further improving the test efficiency.

[0170] According to an optional embodiment of the present specification, the association relationship includes: a second preset sequence between the modules to be tested.

[0171] Based on the initial interface, executing at least one first test script respectively according to the association relationship between the nodes to be tested to obtain the interface test result of the object to be tested may include the following steps: Based on the initial interface, the common test scripts and target test scripts included in each module to be tested are executed in sequence according to a second preset sequence.

[0172] Optionally, the second preset sequence represents the execution order between the modules to be tested, which can be any order or can be pre-set by the tester according to actual test requirements. The specific order can be determined according to the needs of actual applications, and this specification does not impose any restrictions on this.

[0173] In actual applications, when logging into the initial interface, the common test scripts and target test scripts corresponding to each node to be tested in each module to be tested can be executed in sequence according to the second preset order; when the test operations for each module to be tested are completed, the interface test results for the object to be tested are obtained.

[0174] Furthermore, for any module to be tested, a common pre-test script can be executed first, and then the test operations for each node to be tested can be performed in sequence according to a third preset sequence between the nodes to be tested in the module to be tested, and finally a common reset test script can be executed to obtain the test results for the module to be tested.

[0175] Optionally, the shared pre-test script is determined based on pre-operations that all nodes under test in the module under test need to perform in common. Furthermore, the shared pre-test script can be determined based on pre-operations that any node under test in the module under test needs to perform before executing a test operation. That is, for a module under test, the shared pre-test script can be obtained by simply recording the pre-test operations once for one of the nodes under test, without having to record them once for each node under test.

[0176] Optionally, the common reset test script is determined based on a reset operation that all nodes under test in the module under test need to perform. Furthermore, the common reset test script can be determined based on a reset operation that any node under test in the module under test needs to perform after performing a test operation. That is, for a module under test, the common reset test script can be obtained by recording a reset test operation based on only one node under test, without having to record it for each node under test.

[0177] See also Figure 3 , Figure 3 A schematic diagram of the execution process of a module to be tested in a method for testing an interface of an object provided according to an embodiment of the present specification is shown.

[0178] The object to be tested includes module 1 to module n to be tested.

[0179] The common initial interface login script is executed first, and then the test script set of each module to be tested is executed in sequence according to a second preset sequence between the modules to be tested.

[0180] like Figure 3 As shown, if the second preset sequence is to execute from module 1 to module n, the automated execution process of the modules may include: Execute the common initial interface login script and log in to the initial interface; Execute the test script set of module 1 under test, and execute it in a loop L times; Execute the test script set of module 2 to be tested, and execute it in a loop Q times; ......; Execute the set of test scripts for the module to be tested, and execute it in a loop N times.

[0181] Optionally, the number of cycles L, Q, ..., N can be determined according to requirements in actual applications and can be a positive integer greater than or equal to 1.

[0182] Furthermore, the module to be tested includes at least one node to be tested. During the execution of the module to be tested, each node to be tested may be executed in sequence according to a third preset sequence among the nodes to be tested in the module to be tested.

[0183] See also Figure 4, Figure 4 A schematic diagram of a test script execution process of an object interface testing method provided according to another embodiment of this specification is shown.

[0184] The object to be tested includes module 1 to module Y. Module 1 includes nodes 1 to m, module 2 includes nodes 1 to n, and module Y includes nodes 1 to y.

[0185] The common initial interface login script is executed first, and then the test script set of each module to be tested is executed in sequence according to a second preset sequence between the modules to be tested.

[0186] During the execution of the test script set of any module to be tested, the common pre-test script is executed first, and then the pre-test script, test script and reset test script of each node to be tested are executed in sequence according to the third preset sequence between the nodes to be tested, and then the common reset test script is executed.

[0187] like Figure 4 As shown, the test script execution process may include: Execute the common initial interface login script.

[0188] Enter the test script set execution process of module 1 under test, where module 1 under test includes nodes 1-m under test: Execute the pre-test script shared by nodes 1-m under test; Execute the pre-test script, test script and reset test script corresponding to the nodes 1-m to be tested respectively in sequence; Execute the common reset test script for nodes 1-m under test.

[0189] Enter the test script set execution process of module 2 to be tested, where module 2 to be tested includes nodes 1-n to be tested: Execute the pre-test script shared by nodes 1-n to be tested; Execute the pre-test script, test script and reset test script corresponding to the nodes 1-n to be tested in sequence; Execute the reset test script shared by nodes 1-n to be tested. ......; Enter the test script set execution process of the module to be tested Y, where the module to be tested Y includes the nodes to be tested 1-y: Execute the pre-test script shared by nodes 1-y under test; Execute the pre-test script, test script and reset test script corresponding to the nodes 1-y to be tested respectively in sequence; Execute the common reset test script of node 1-y under test; The test script execution process ends.

[0191] Optionally, the number of cycles L1 to L m , Q1 to Q n 、N1 to N y It can be determined according to the needs of actual applications and its value is a positive integer greater than or equal to 1.

[0192] By applying this embodiment, by sequentially executing the common test scripts and target test scripts included in each module to be tested, the nodes to be tested that have the same pre-test operations and reset test operations can be divided into the same module to be tested, and each module to be tested can be executed sequentially, thereby reducing the number of repeated executions of the same test operation, further improving the execution efficiency of the test script, and realizing interface testing of the entire object to be tested.

[0193] The interface testing method of an object provided in an embodiment of this specification obtains a test script set of the object to be tested, wherein the object to be tested includes at least one node to be tested, and the test script set includes an initial test script and at least one first test script, and the first test script is obtained according to a test operation corresponding to one of the nodes to be tested; the initial test script is executed to log in to the initial interface of the object to be tested; based on the initial interface, at least one first test script is executed respectively according to the association relationship between the nodes to be tested to obtain the interface test result of the object to be tested.

[0194] In this way, by executing the initial test script and logging into the initial interface of the object to be tested, each first test script can be executed based on the initial interface to realize the test of each node to be tested; by executing at least one first test script respectively according to the association relationship between each node to be tested, each node to be tested can be tested in sequence, so that in one test process, the interface test of the object to be tested as a whole can be realized, and the interface test results for the entire object to be tested can be obtained; there is no need to manually write test scripts, which can improve the efficiency of test script execution.

[0195] The following combined Figure 5 , taking the application of the object interface testing method provided in this specification in the GUI automated testing of the automated testing framework based on image recognition as an example, the interface testing method of the object is further explained. Optionally, take the Airtest framework as an example. Among them, Figure 5 A flow chart of a test script generation process of an object interface testing method provided by an embodiment of this specification is shown, which specifically includes the following steps.

[0196] Step 502: Determine and connect the application to be tested.

[0197] Optionally, the application to be tested is an application that needs to be tested and is selected from various applications on the computer desktop.

[0198] In practical applications, based on determining the application to be tested, a connection between the GUI automated testing tool and the application to be tested can be established.

[0199] Furthermore, the position information of the application to be tested on the screen can be obtained.

[0200] Optionally, the location information can be used to determine the location of the application to be tested on the computer screen, so that a screen recording operation of the interface of the application to be tested can be achieved based on the location information.

[0201] Step 504: Record a test operation video for a current set of test operations of the node to be tested.

[0202] Step 504 ′: monitor input signals from the mouse and keyboard.

[0203] Step 504": Record the test operation time corresponding to each test operation.

[0204] Optionally, the test operation time corresponding to the mouse click operation can be determined according to the reception time of the mouse input signal; the test operation time corresponding to the keyboard operation can be determined according to the reception time of the keyboard input signal.

[0205] Step 506: Generate a click control script statement and a corresponding operation time control script statement based on a screenshot of the operation control at time t before the mouse click operation in the test operation video.

[0206] Step 508: Obtain a first operation feature area image based on a reaction interface corresponding to the mouse click operation; take a screenshot of the feature area in the first operation feature area image to obtain a reaction feature image corresponding to the mouse click operation; and generate an assertion script statement corresponding to the mouse click operation based on the reaction feature image corresponding to the mouse click operation.

[0207] Optionally, the first operation feature area image may be a correct response interface, which includes correct response content for the mouse click operation; or an incorrect response interface, which includes incorrect response content for the mouse click operation.

[0208] Step 506 ′: Generate keyboard control script statements and corresponding operation time control script statements according to keyboard operations.

[0209] Step 508': obtain a second operation feature area image based on the reaction interface corresponding to the keyboard operation; take a screenshot of the feature area in the second operation feature area image to obtain a reaction feature image corresponding to the keyboard operation; generate an assertion script statement corresponding to the keyboard operation based on the reaction feature image corresponding to the keyboard operation.

[0210] Optionally, the second operation feature area image may be a correct response interface, which includes correct response content for keyboard operation; or an incorrect response interface, which includes incorrect response content for keyboard operation.

[0211] Return to step 504 and continue until all test operations for the current node to be tested are completed.

[0212] Step 510: Generate an automated test script for the node to be tested based on the test script statements of each group of test operations.

[0213] By applying this embodiment, it is possible to realize automatic generation of test scripts for nodes to be tested, and it is possible to take into account the interface response time during the execution of each test operation, thereby improving the test success rate.

[0214] Corresponding to the above method embodiment, this specification also provides an object interface testing device embodiment, Figure 6 FIG. 1 shows a schematic diagram of a device for testing an interface of an object provided by an embodiment of the present specification. Figure 6 As shown, the device includes: Acquisition module 602: configured to acquire a test script set of the object to be tested, wherein the object to be tested includes at least one node to be tested, the test script set includes an initial test script and at least one first test script, and the first test script is obtained according to a test operation corresponding to one of the nodes to be tested.

[0215] Execution module 604: configured to execute the initial test script and log in to the initial interface of the object to be tested.

[0216] The testing module 606 is configured to execute at least one first test script based on the initial interface and in accordance with the association relationship between the nodes to be tested, to obtain the interface test result of the object to be tested.

[0217] Optionally, the object interface testing device further includes a generation module configured to: Generate a first test script corresponding to each node to be tested.

[0218] Optionally, the generation module is further configured to: Determining at least one set of test operations included in a target node to be tested, wherein the target node to be tested is any one of the nodes to be tested; Execute at least one group of test operations respectively, and record the test operation content corresponding to each group of test operations; Based on the test operation content, a first test script corresponding to the target node to be tested is generated.

[0219] Optionally, the generation module is further configured to: During the execution of any set of test operations, the interface screen video of the object under test is recorded, and the input signal and the reception time of the input signal are monitored.

[0220] Optionally, the generation module is further configured to: Generate an operation control script statement and a time control script statement corresponding to the operation control script statement according to the input signal and the reception time of the input signal; Get the assertion script statement corresponding to the input signal; A first test script is obtained based on the operation control script statement, the time control script statement, and the assertion script statement.

[0221] Optionally, the input signal includes a mouse input signal, the mouse input signal includes a mouse click position, and the operation control script statement includes a click control script statement; the generating module is further configured to: According to the first receiving time of the mouse input signal, obtaining, from the interface screen recording video, a first interface screenshot at a preset time interval before the first receiving time; Identify the target operation control in the first interface screenshot based on the mouse click position; Generate click control script statements based on the target operation control; A time control script statement corresponding to the click control script statement is generated according to the time interval between the first receiving time and the second receiving time of the adjacent input signal.

[0222] Optionally, the input signal includes a keyboard input signal, and the operation control script statement includes a keyboard control script statement; the generation module is further configured to: Generate keyboard control script statements according to keyboard input signals; A time control script statement corresponding to the keyboard control script statement is generated according to the time interval between the third receiving time of the keyboard input signal and the second receiving time of the adjacent input signal.

[0223] Optionally, the generation module is further configured to: Obtaining a reaction characteristic image corresponding to the input signal, wherein the reaction characteristic image is obtained by taking a screenshot of the operation reaction characteristic area in the reaction interface, where the reaction interface is an interface displayed by the object to be tested based on the input signal; Generate assertion script statements corresponding to the input signal based on the response feature image.

[0224] Optionally, the association relationship includes: a first preset sequence between the nodes to be tested; the testing module 606 is further configured to: Based on the initial interface, at least one first test script is executed in a first preset sequence to obtain an interface test result of the object to be tested.

[0225] Optionally, the object to be tested includes at least one module to be tested, the module to be tested includes at least one node to be tested, different modules to be tested include different nodes to be tested, and the first test script includes a common test script and a target test script; the generation module is further configured to: For any module to be tested, a common test script corresponding to each node to be tested in the module to be tested and a target test script corresponding to each node to be tested in the module to be tested are obtained.

[0226] Optionally, the association relationship includes: a second preset sequence between the modules to be tested; the testing module 606 is further configured to: Based on the initial interface, the common test scripts and target test scripts included in each module to be tested are executed in sequence according to a second preset sequence.

[0227] By applying this embodiment, by executing the initial test script and logging into the initial interface of the object to be tested, each first test script can be executed based on the initial interface to implement the test of each node to be tested; by executing at least one first test script according to the association relationship between each node to be tested, each node to be tested can be tested in sequence, so that in one test process, the interface test of the object to be tested as a whole can be implemented, and the interface test results for the entire object to be tested can be obtained; there is no need to manually write test scripts, which can improve the efficiency of test script execution.

[0228] The above is a schematic scheme of an interface testing device for an object of this embodiment. It should be noted that the technical scheme of the interface testing device for this object and the technical scheme of the interface testing method for the object described above are of the same concept. For details not described in detail in the technical scheme of the interface testing device for the object, please refer to the description of the technical scheme of the interface testing method for the object described above.

[0229] Figure 7 7 shows a block diagram of a computing device 700 according to one embodiment of the present disclosure. Components of the computing device 700 include, but are not limited to, a memory 710 and a processor 720. The processor 720 is connected to the memory 710 via a bus 730, and a database 750 is used to store data.

[0230] Computing device 700 also includes an access device 740 that enables computing device 700 to communicate via one or more networks 760. Examples of such networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. Access device 740 may include one or more of any type of network interface (e.g., a network interface controller (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, or a near field communication (NFC) interface.

[0231] In one embodiment of the present specification, the above components of the computing device 700 and Figure 7 Other components not shown in the figure may also be connected to each other, for example, via a bus. Figure 7 The computing device structure block diagram shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art may add or replace other components as needed.

[0232] Computing device 700 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, personal digital assistant, laptop computer, notebook computer, netbook computer, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or personal computer (PC). Computing device 700 can also be a mobile or stationary server.

[0233] The processor 720 is configured to execute the following computer executable instructions, which, when executed by the processor, implement the steps of the interface testing method of the above-mentioned object.

[0234] The above is a schematic diagram of a computing device according to this embodiment. It should be noted that the technical solution of the computing device and the technical solution of the interface testing method for the object described above are of the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the interface testing method for the object described above.

[0235] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the interface testing method of the above-mentioned object.

[0236] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the object interface testing method described above are based on the same concept. For details not described in detail in the technical scheme of the storage medium, please refer to the description of the technical scheme of the object interface testing method described above.

[0237] An embodiment of the present specification further provides a computer program product, including a computer program / instruction, which implements the steps of the interface testing method of the above-mentioned object when executed by a processor.

[0238] The above is a schematic scheme of a computer program product of this embodiment. It should be noted that the technical scheme of this computer program product and the technical scheme of the object interface testing method described above are based on the same concept. For details not described in detail in the technical scheme of the computer program product, please refer to the description of the technical scheme of the object interface testing method described above.

[0239] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0240] The computer instructions include computer program code, which may be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium may include any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium. It should be noted that the content of the computer-readable medium may be appropriately increased or decreased based on the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media does not include electric carrier signals and telecommunication signals.

[0241] It should be noted that for the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.

[0242] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0243] The preferred embodiments disclosed above are intended only to help illustrate this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made based on the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that those skilled in the art can better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. A method for testing an interface of an object, characterized in that: include: Obtaining a test script set of an object to be tested, wherein the object to be tested includes at least one node to be tested, the test script set includes an initial test script and at least one first test script, and the first test script is obtained according to a test operation corresponding to one of the nodes to be tested; Execute the initial test script and log in to the initial interface of the object to be tested; Based on the initial interface, and according to the association relationship between the nodes to be tested, the at least one first test script is executed respectively to obtain the interface test result of the object to be tested.

2. The method according to claim 1, characterized in that Before obtaining the test script set of the object to be tested, the method further includes: Generate first test scripts corresponding to each of the nodes to be tested.

3. The method according to claim 2, characterized in that The generating of the first test scripts corresponding to the nodes to be tested includes: Determining at least one set of test operations included in a target node to be tested, wherein the target node to be tested is any one of the nodes to be tested; Executing the at least one group of test operations respectively, and recording the test operation content corresponding to each group of test operations; Based on the test operation content, a first test script corresponding to the target node to be tested is generated.

4. The method according to claim 3, characterized in that The recording of the test operation content corresponding to each group of test operations includes: During the execution of any set of test operations, the interface screen video of the object to be tested is recorded, and the input signal and the reception time of the input signal are monitored.

5. The method according to claim 4, characterized in that The generating, based on the test operation content, a first test script corresponding to the target node to be tested includes: Generate an operation control script statement and a time control script statement corresponding to the operation control script statement according to the input signal and the reception time of the input signal; Obtaining the assertion script statement corresponding to the input signal; A first test script is obtained based on the operation control script statement, the time control script statement, and the assertion script statement.

6. The method according to claim 5, characterized in that The input signal includes a mouse input signal, the mouse input signal includes a mouse click position, and the operation control script statement includes a click control script statement; The step of generating an operation control script statement and a time control script statement corresponding to the operation control script statement according to the input signal and the reception time of the input signal includes: According to the first receiving time of the mouse input signal, obtaining, from the interface screen recording video, a first interface screenshot at a preset time interval before the first receiving time; Identifying a target operation control in the first interface screenshot according to the mouse click position; Based on the target operation control, generate a click control script statement; According to the time interval between the first receiving time and the second receiving time of the adjacent input signal, a time control script statement corresponding to the click control script statement is generated.

7. The method according to claim 5, characterized in that The input signal includes a keyboard input signal, and the operation control script statement includes a keyboard control script statement; The step of generating an operation control script statement and a time control script statement corresponding to the operation control script statement according to the input signal and the reception time of the input signal includes: Generate a keyboard control script statement according to the keyboard input signal; A time control script statement corresponding to the keyboard control script statement is generated according to the time interval between the third receiving time of the keyboard input signal and the second receiving time of the adjacent input signal.

8. The method according to claim 5, characterized in that The obtaining of the assertion script statement corresponding to the input signal includes: Obtaining a reaction characteristic image corresponding to the input signal, wherein the reaction characteristic image is obtained based on a screenshot of an operation reaction characteristic area in a reaction interface, where the reaction interface is an interface displayed by the subject to be tested based on the input signal; Generate an assertion script statement corresponding to the input signal according to the reaction feature image.

9. The method according to any one of claims 1 to 8, characterized in that The association relationship includes: a first preset sequence between the nodes to be tested; The step of executing the at least one first test script based on the initial interface and according to the association relationship between the nodes to be tested to obtain the interface test result of the object to be tested includes: Based on the initial interface, the at least one first test script is executed respectively in accordance with the first preset sequence to obtain an interface test result of the object to be tested.

10. The method according to claim 1, characterized in that The object to be tested includes at least one module to be tested, the module to be tested includes at least one node to be tested, different modules to be tested include different nodes to be tested, and the first test script includes a common test script and a target test script; Before obtaining the test script set of the object to be tested, the method further includes: For any module to be tested, a common test script corresponding to each node to be tested in the module to be tested and a target test script corresponding to each node to be tested in the module to be tested are obtained.

11. The method according to claim 10, characterized in that The association relationship includes: a second preset sequence between the modules to be tested; The step of executing the at least one first test script based on the initial interface and according to the association relationship between the nodes to be tested to obtain the interface test result of the object to be tested includes: Based on the initial interface, the common test scripts and target test scripts included in each module to be tested are executed in sequence according to the second preset sequence.

12. An interface testing device for an object, characterized in that: include: an acquisition module configured to acquire a test script set of an object to be tested, wherein the object to be tested includes at least one node to be tested, the test script set includes an initial test script and at least one first test script, the first test script being acquired based on a test operation corresponding to one of the nodes to be tested; An execution module is configured to execute the initial test script and log in to the initial interface of the object to be tested; The testing module is configured to execute the at least one first test script based on the initial interface and in accordance with the association relationship between the nodes to be tested, so as to obtain the interface test result of the object to be tested.

13. A computing device, characterized in that include: memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the interface testing method of the object described in any one of claims 1-11 are implemented.

14. A computer-readable storage medium, characterized in that It stores a computer program / instruction, which, when executed by a processor, implements the steps of the interface testing method for the object described in any one of claims 1-11.

15. A computer program product, characterized in that The invention comprises a computer program / instruction, which, when executed by a processor, implements the steps of the interface testing method of the object described in any one of claims 1 to 11.