User interface test case generation method and device

By remotely accessing the user interface of the terminal device using the browser front-end page in user interface automation testing and generating test cases, the problem of high programming requirements for testers and limited test case execution in the prior art is solved, and simpler and more flexible test case generation and execution are achieved.

CN112685285BActive Publication Date: 2025-03-28BEIJING QIHOOD TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN201910995512.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-10-18
Publication Date
2025-03-28
Estimated Expiration
2039-10-18

AI Technical Summary

Technical Problem

The prior art requires testers to have a high programming level in user interface automation testing, and the script files of test cases must be executed inside the test machine, which is limited by system permissions and status, affecting the execution of test cases.

Method used

By remotely accessing the terminal device's user interface using the front-end page of the browser, displaying the user interface, and including action controls in the front-end page for screenshot operations, binding screenshot pictures and action controls, and generating test cases.

Benefits of technology

It reduces the difficulty of generating test cases, avoids dependence on the system permissions and status of the terminal device, and realizes test operations without installing a user interface client, so that what you see is what you get.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112685285B_ABST
    Figure CN112685285B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for generating user interface test cases, the method comprising: using the front-end page of a browser to remotely access the user interface to be tested of a terminal device, and displaying the user interface; the front-end page also includes at least one action control for generating test cases; selecting any action control in the front-end page, and taking a screenshot of any control to be tested in the user interface in the front-end page to obtain a corresponding screenshot image; binding the screenshot image and the action control to generate a corresponding test case. The front-end page remotely accesses the user interface of the terminal device, which may not be restricted by the authority of the terminal device system itself, nor be affected by the system status of the terminal device itself. Remote access through the front-end page, on the one hand, does not require the installation of the application corresponding to the user interface to be tested, and on the other hand, it is convenient to simulate the test operation of the user interface, so that what you see is what you get, and test cases can be directly generated, reducing the difficulty of test case generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of testing, and in particular to a method and device for generating user interface test cases, and a method and device for testing a user interface. Background Art

[0002] The UI (User Interface) includes multiple controls. When performing automated testing on the UI, testers are required to have a high level of programming skills, which results in a high threshold for the technical level of testers, making it slow for testers to get started during testing, affecting the progress of the test. At the same time, after generating the script file of the test case, the prior art stipulates that the script file of the test case must be executed inside the test machine, resulting in the script file of the test case being subject to the authority of the test machine system, affecting the execution of the script file of the test case, such as the script file of the test case being intercepted, etc. Moreover, when the test machine is restarted, the script file of the test case is interrupted and cannot be automatically continued to execute, etc. Summary of the invention

[0003] In view of the above problems, the present invention is proposed to provide a method, apparatus, computing device and computer storage medium for generating user interface test cases that overcome the above problems or at least partially solve the above problems.

[0004] According to one aspect of the present invention, a method for generating a user interface test case is provided, comprising:

[0005] Using the front-end page of the browser to remotely access the user interface to be tested of the terminal device and display the user interface; wherein the front-end page also includes at least one action control for generating a test case;

[0006] Select any action control in the front-end page, and take a screenshot of any control to be tested in the user interface in the front-end page to obtain the corresponding screenshot image;

[0007] Bind the screenshot image and action control to generate the corresponding test case.

[0008] According to another aspect of the present invention, there is provided a user interface testing method, comprising:

[0009] Get test cases;

[0010] Parse the test case and convert it into test case operation instructions for the control to be tested in the user interface of the terminal device;

[0011] The test case operation instructions are transmitted to the user interface of the terminal device through the remote management unit for execution, and a user interface screenshot of the user interface of the terminal device after executing the test case is obtained to verify whether the test case is executed successfully.

[0012] According to another aspect of the present invention, there is provided a user interface test case generating device, comprising:

[0013] An access module, adapted to remotely access the user interface to be tested of a terminal device using a front-end page of a browser, and to display the user interface; wherein the front-end page also includes at least one action control for generating a test case;

[0014] A screenshot module is suitable for selecting any action control in the front-end page, and taking a screenshot of any control to be tested in the user interface in the front-end page to obtain a corresponding screenshot image;

[0015] The first generating module is adapted to bind the screenshot image and the action control to generate a corresponding test case.

[0016] According to another aspect of the present invention, there is provided a user interface testing device, comprising:

[0017] Acquisition module, suitable for acquiring test cases;

[0018] A parsing module, adapted to parse the test case and convert it into a test case operation instruction for the control to be tested in the user interface of the terminal device;

[0019] The execution module is suitable for transmitting the test case operation instructions to the user interface of the terminal device through the remote management unit for execution, and obtaining a user interface screenshot of the user interface of the terminal device after executing the test case to verify whether the test case is executed successfully.

[0020] According to another aspect of the present invention, there is provided a computing device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;

[0021] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the above-mentioned user interface test case generation method.

[0022] According to another aspect of the present invention, a computer storage medium is provided, in which at least one executable instruction is stored, and the executable instruction enables a processor to execute operations corresponding to the above-mentioned user interface test case generation method.

[0023] According to another aspect of the present invention, there is provided a computing device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;

[0024] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the above-mentioned user interface testing method.

[0025] According to another aspect of the present invention, a computer storage medium is provided, in which at least one executable instruction is stored, and the executable instruction enables a processor to execute operations corresponding to the above-mentioned user interface testing method.

[0026] According to the user interface test case generation method, device, computing device and computer storage medium provided by the present invention, the user interface to be tested of the terminal device is remotely accessed by the front-end page of the browser, and the user interface is displayed; the front-end page also includes at least one action control for generating test cases; any action control in the front-end page is selected, and a screenshot operation is performed on any control to be tested in the user interface in the front-end page to obtain the corresponding screenshot image; the screenshot image and the action control are bound to generate the corresponding test case. The front-end page remotely accesses the user interface of the terminal device, which is not subject to the authority restrictions of the terminal device system itself, nor is it affected by the system status of the terminal device itself. Through remote access by the front-end page, on the one hand, there is no need to install the application corresponding to the user interface to be tested, and on the other hand, it is also convenient to simulate the test operation of the user interface, so that what you see is what you get, and test cases can be directly generated, reducing the difficulty of test case generation.

[0027] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0029] Figure 1 A schematic diagram showing a flow chart of a method for generating a user interface test case according to an embodiment of the present invention;

[0030] Figure 2 A schematic diagram of a front-end page according to an embodiment of the present invention is shown;

[0031] Figure 3 A schematic diagram showing a flow chart of a user interface testing method according to another embodiment of the present invention;

[0032] Figure 4A structural block diagram of a user interface test case generating device according to an embodiment of the present invention is shown;

[0033] Figure 5 A structural block diagram of a user interface testing device according to an embodiment of the present invention is shown;

[0034] Figure 6 A schematic diagram of the structure of a computing device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0035] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0036] Figure 1 A schematic diagram of a process for generating a user interface test case according to an embodiment of the present invention is shown. Figure 1 As shown, the method comprises the following steps:

[0037] Step S101: remotely access the user interface to be tested of the terminal device using the front-end page of the browser, and display the user interface.

[0038] This embodiment is implemented based on a framework system that can transmit remote desktop protocols, wherein the framework system includes a front-end page suitable for a browser, a back-end, and a remote management unit. The front-end page can be implemented in a language such as JavaScript, which interacts with the back-end through WebSocket, and the data transmitted between the two is screen drawing and event transmission protocol data. The back-end can be implemented in a language such as Java, which can be deployed as a Web application, and after reading the data transmitted by the front-end page, it is forwarded to the remote management unit. The remote management unit can be implemented in a language such as C, which translates the screen drawing and event transmission protocol data forwarded by the back-end into remote desktop protocol data, and transmits it remotely to the terminal device to realize remote interaction with the user interface to be tested of the terminal device. The remote desktop protocol can adopt a VNC protocol, etc.

[0039] By utilizing the architecture system that can transmit the remote desktop protocol, the front-end page of the browser can remotely access the user interface to be tested on the terminal device. Remote access can be convenient when generating test cases for the user interface, without having to install the client of the user interface, and without being able to configure the user interface operating environment. Use the front-end page of the browser to remotely access the user interface to be tested on the terminal device. Display the user interface directly on the front-end page, and operate the user interface on the front-end page. The front-end page operates the displayed user interface, and the test case of the user interface can be completed through simple operations. Figure 2 As shown, the user interface to be tested is displayed on the right side of the front-end page, and at least one action control for generating test cases is also included on the left side of the front-end page. Action controls include action controls such as single-click, double-click, right-click, scroll, and input, and the action controls can be used to complete the test of various actions in the user interface. The above is an example. During implementation, the action controls in the front-end page and the display position are set according to the specific situation, and are not limited here.

[0040] Step S102, select any action control in the front-end page, and perform a screenshot operation on any control to be tested in the user interface in the front-end page to obtain a corresponding screenshot image.

[0041] According to the test requirements, any action control in the front-end page and any control to be tested in the user interface can be selected, and the action test corresponding to the action control can be performed on any control to be tested in the user interface. If a single-click action control is selected, any control to be tested in the user interface such as the "one-key repair" control is selected, and a test case for a single-click operation on the "one-key repair" control is set. In the present embodiment, when a test case is generated for any control to be tested in the user interface, a screenshot image corresponding to the control to be tested is obtained by taking a screenshot of any control to be tested in the user interface. Any control to be tested in the user interface is recorded in the form of a screenshot image. Specifically, the screenshot image is set as the image parameter of the action control, and the action test corresponding to the action control is performed on the control to be tested. Other parameters are also included in the action control, such as timeout parameters, image sequence number, coordinate position (x, y) and other parameters, and the various parameters of the action control can be set accordingly according to the actual test situation.

[0042] When taking a screenshot of any control to be tested in the user interface on the front-end page, specifically, the user interface is operated on the front-end page to take a screenshot of any control to be tested in the user interface. Figure 2As shown, the "one-key repair" control can be directly screenshotted on the front-end page. The front-end page will transmit the screenshot operation to the back-end in the form of first protocol data, which will be converted by the back-end into second protocol data and transmitted to the user interface to be tested of the terminal device through the remote management unit. The user interface to be tested of the terminal device will execute the screenshot operation accordingly to obtain the corresponding screenshot image of the "one-key repair" control. After the screenshot operation of the terminal device, the remote management unit obtains the screenshot image transmitted by the terminal device in the form of second protocol data and returns it to the back-end. The back-end transmits the screenshot image to the front-end page in the form of first protocol data, and the front-end page saves the screenshot image of the "one-key repair" control. Among them, the first protocol data is the screen drawing and event transmission protocol data. The second protocol data is the remote desktop protocol data. The format of the first protocol data can be such as operation code, parameter 1, parameter 2, parameter 3, .... The internal composition of each element in the first protocol data is such as length. value. The first protocol data of the screenshot operation can be such as 5.mouse, 3.544, 2.53, 1.1; 3.key, 2.49, 1.0. That is, use the mouse to select the location information to be screenshotted, and use the keyboard to screenshot the selected location information. The first protocol data of the returned screenshot image can be, for example, 3.image, 1.1, 2.14, 1.0, 9.image / png, 3.737, 2.21; 4.blob, 1.1, 5132.ivborwo...; 3.end, 1.1. The above first protocol data is for illustration only and is not limited here.

[0043] When the remote management unit converts the first protocol data into the second protocol data, it is necessary to parse the first protocol data and convert it into the second protocol data that conforms to the second protocol data format. Conversely, when the remote management unit converts the second protocol data into the first protocol data, it is necessary to parse the second protocol data and convert it into the first protocol data that conforms to the first protocol data format. The specific conversion process can be converted according to the format of the remote desktop protocol data corresponding to the screen drawing and event transmission protocol data in the prior art, which will not be described in detail here.

[0044] Furthermore, when selecting any action control in the front-end page, if the action control does not involve a specific control to be tested in the user interface, the parameters corresponding to the action control can be directly set without taking a screenshot of the control to be tested. Figure 2 The sleep action control shown in the figure can be used to set the sleep time. This action control is for the entire user interface, rather than for the specific control to be tested in the user interface.

[0045] Step S103, binding the screenshot image and the action control to generate a corresponding test case.

[0046] Set the screenshot image as the image parameter of the action control, and then bind it to the action control, that is, bind the specific control to be tested in the user interface to the action corresponding to the action control. When the test case generation operation containing the screenshot image and the action control is received, such as clicking Figure 2 The saved case on the front-end page triggers the test case generation operation, and the back-end converts the screenshot image and the action control into a test case operation instruction, generates and saves the corresponding test case, and the test case can be saved in the database. When the back-end converts the screenshot image and the action control into a test case operation instruction, the screenshot image can be first identified by using image recognition technology such as an image recognition engine, and the specific control to be tested in the user interface corresponding to the screenshot image can be determined, and the control to be tested and the action control can be bound, that is, the test case operation instruction is to perform the corresponding action on the control to be tested.

[0047] Furthermore, if a test case includes multiple action controls, a test case including multiple action controls is generated according to the order of the selected multiple action controls. That is, the test case is to execute multiple actions in the user interface in sequence, wherein the multiple actions can correspond to one control to be tested or multiple controls to be tested, which is not limited here.

[0048] Furthermore, in this embodiment, the backend can adopt an asynchronous non-blocking execution mode for the first protocol data transmitted by the front-end page and the second protocol data transmitted by the remote management unit, thereby greatly improving processing efficiency.

[0049] According to the user interface test case generation method provided by the present invention, the user interface to be tested of the terminal device is remotely accessed by the front-end page of the browser, and the user interface is displayed; the front-end page also includes at least one action control for generating test cases; any action control in the front-end page is selected, and a screenshot operation is performed on any control to be tested in the user interface in the front-end page to obtain a corresponding screenshot image; the screenshot image and the action control are bound to generate a corresponding test case. The front-end page remotely accesses the user interface of the terminal device, which is not subject to the authority restrictions of the terminal device system itself, nor is it affected by the system status of the terminal device itself. Through remote access by the front-end page, on the one hand, there is no need to install the application corresponding to the user interface to be tested, and on the other hand, it is also convenient to simulate the test operation of the user interface, so that what you see is what you get, and test cases can be directly generated, reducing the difficulty of test case generation.

[0050] Figure 3 A flow chart of a user interface testing method according to another embodiment of the present invention is shown. Figure 3 As shown, the method comprises the following steps:

[0051] Step S301, obtaining a test case.

[0052] The test case is to use Figure 1 The embodiment described above generates Figure 2 In the front-end page shown, you can select the test case to be executed, such as clicking on the execution case to start the test of the user interface. When the test case contains one or more test actions, that is, one or more action controls, the test case can be stored in a pre-established storage queue in the order of the action controls. The storage queue can use a first-in-first-out queue such as redis. When storing test cases in the storage queue, the test case name can be stored, so that the corresponding saved test case can be obtained from the database according to the test case name stored in the storage queue.

[0053] Step S302: parsing the test case and converting it into a test case operation instruction for the control to be tested in the user interface of the terminal device.

[0054] Read the test case from the storage queue and parse the test case. Specifically, determine the screenshot image contained in the test case. Use image recognition technology such as image recognition engine to identify the screenshot image and determine the control to be tested in the user interface of the terminal device corresponding to the screenshot image. Specifically, compare the screenshot image with the entire user interface to find the matching position of the screenshot image in the user interface, so as to determine the control to be tested in the user interface of the terminal device corresponding to the screenshot image. Then, according to the parameters of the action control in the test case, determine the test case operation instructions for the control to be tested in the user interface.

[0055] When this step is executed, the backend can directly read the test cases in the storage queue and perform operations such as parsing and conversion on them.

[0056] Step S303: transmit the test case operation instruction to the user interface of the terminal device through the remote management unit for execution, and obtain a user interface screenshot of the user interface of the terminal device after executing the test case to verify whether the test case is successfully executed.

[0057] The backend forwards the converted test case operation instruction to the remote management unit in the first protocol data, and the remote management unit converts it into the second protocol data and transmits it to the user interface of the terminal device for execution. The user interface of the terminal device executes the corresponding action according to the corresponding control to be tested in the test case operation instruction to complete the action test of the control to be tested, or the user interface of the terminal device executes the corresponding action according to the action control to complete the action test of the user interface, etc.

[0058] After the user interface of the terminal device completes the test case operation instruction, in order to facilitate the verification of the result of the test case execution, a corresponding test report is generated for the test case. When generating the corresponding test report, it is necessary to base it on the return result after the user interface is executed or the execution status of the user interface. If the corresponding control to be tested is not found in the user interface of the terminal device for testing, the verification fails; if the user interface of the terminal device does not return the corresponding user interface picture after executing the test case, the verification fails, etc. After the user interface of the terminal device executes the test case, a new connection can be established between the back end and the user interface of the terminal device through the remote management unit. The connection is used to send an instruction to the user interface of the terminal device to take a screenshot of the entire user interface of the terminal device, and obtain a screenshot of the user interface of the terminal device after the test case is executed. The user interface screenshot is used to verify the execution of the test case on the user interface of the terminal device, verify whether it achieves the effect after executing the test case, and thus verify whether the test case execution result is successful or failed.

[0059] Furthermore, in this embodiment, the backend can adopt an asynchronous non-blocking execution mode to facilitate the establishment of multiple connections with the user interface of the terminal device. Different connections can process different test cases concurrently, thereby improving the test efficiency. Through the architecture system based on the transmittable remote desktop protocol, the test case is no longer required to be placed on the terminal device where the user interface is located for execution. It can be remotely transmitted to the user interface of the terminal device through the remote management unit for execution. It is not affected by the system permissions of the terminal device and will not cause problems such as interception. When the terminal device is shut down, has a blue screen, or crashes, the normal execution of the test case will not be interrupted. After the terminal device is normal, the test case operation instructions can continue to be received and executed.

[0060] According to the user interface testing method provided by the present invention, a test case is obtained; the test case is parsed and converted into a test case operation instruction for the control to be tested in the user interface of the terminal device; the test case operation instruction is transmitted to the user interface of the terminal device through the remote management unit for execution, and a user interface screenshot of the user interface of the terminal device after executing the test case is obtained to verify whether the test case is successfully executed. The user interface is tested based on the architecture system of the transmittable remote desktop protocol, and the user interface can be transmitted to the terminal device remotely through the remote management unit for execution, which is not affected by the system permissions of the terminal device and will not cause problems such as interception. When the terminal device has problems such as shutdown, blue screen, and crash, the normal execution of the test case will not be interrupted, and the test case operation instruction can continue to be received and executed after the terminal device is normal.

[0061] Figure 4 FIG. 4 shows a structural block diagram of a user interface test case generating device according to an embodiment of the present invention. Figure 4As shown, the device comprises:

[0062] The access module 410 is adapted to: remotely access the user interface to be tested of the terminal device using the front-end page of the browser, and display the user interface; wherein the front-end page also includes at least one action control for generating a test case;

[0063] The screenshot module 420 is adapted to: select any action control in the front-end page, and perform a screenshot operation on any control to be tested in the user interface in the front-end page to obtain a corresponding screenshot image;

[0064] The first generating module 430 is adapted to: bind the screenshot image and the action control to generate a corresponding test case.

[0065] Optionally, the screenshot module 420 is further suitable for: performing a screenshot operation on any control to be tested in the user interface in the front-end page, and transmitting the screenshot operation to the back-end in the form of first protocol data, which is converted by the back-end into second protocol data through the remote management unit and transmitted to the user interface to be tested of the terminal device, so that the user interface to be tested of the terminal device performs a screenshot operation and obtains a corresponding screenshot image; the remote management unit obtains the screenshot image transmitted by the terminal device in the form of second protocol data, and returns it to the back-end; the back-end transmits the screenshot image to the front-end page in the form of first protocol data; the first protocol data is screen drawing and event transmission protocol data; the second protocol data is remote desktop protocol data.

[0066] Optionally, the screenshot module 420 is further adapted to: select any action control in the front-end page, and set various parameters of the action control; wherein the screenshot image is set as the image parameter of the action control;

[0067] The first generating module 430 is further adapted to: generate a test case corresponding to the action control.

[0068] Optionally, the first generating module 430 is further adapted to: receive a test case generating operation including a screenshot image and an action control triggered by a front-end page, convert it into a test case operating instruction by the back-end, and generate and save a corresponding test case.

[0069] Optionally, the device further includes: a second generating module 440 adapted to: select any action control in the front-end page, set parameters corresponding to the action control, and generate a test case for the action control.

[0070] Optionally, the apparatus further comprises: a third generating module 450 adapted to: generate a test case including a plurality of action controls according to a front-to-back order of the selected plurality of action controls.

[0071] The description of each module above refers to the corresponding description in the method embodiment and will not be repeated here.

[0072] Figure 5 FIG. 4 shows a structural block diagram of a user interface testing device according to an embodiment of the present invention. Figure 5 As shown, the device comprises:

[0073] The acquisition module 510 is adapted to: acquire a test case;

[0074] The parsing module 520 is adapted to: parse the test case and convert it into a test case operation instruction for the control to be tested in the user interface of the terminal device;

[0075] The execution module 530 is adapted to: transmit the test case operation instruction to the user interface of the terminal device through the remote management unit for execution, and obtain a user interface screenshot of the user interface of the terminal device after executing the test case to verify whether the test case is executed successfully.

[0076] Optionally, the acquisition module 510 is further adapted to: select a test case to be executed and store it in a pre-established storage queue; and acquire a corresponding test case from a database according to the test case name stored in the storage queue.

[0077] Optionally, the parsing module 520 is further adapted to: read the test case to obtain the screenshot image contained in the test case; identify the screenshot image to determine the control to be tested in the user interface of the terminal device corresponding to the screenshot image; and determine the test case operation instructions for the control to be tested in the user interface based on the parameters in the test case.

[0078] The description of each module above refers to the corresponding description in the method embodiment and will not be repeated here.

[0079] The present invention also provides a non-volatile computer storage medium, which stores at least one executable instruction, and the executable instruction can execute the user interface test case generation method in any of the above method embodiments.

[0080] Figure 6 A schematic diagram of the structure of a computing device according to an embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the computing device.

[0081] like Figure 6 As shown, the computing device may include: a processor (processor) 602 , a communication interface (Communications Interface) 604 , a memory (memory) 606 , and a communication bus 608 .

[0082] in:

[0083] The processor 602 , the communication interface 604 , and the memory 606 communicate with each other via a communication bus 608 .

[0084] The communication interface 604 is used to communicate with other devices such as clients or other servers.

[0085] The processor 602 is used to execute the program 610, and specifically can execute the relevant steps in the above-mentioned user interface test case generation method embodiment.

[0086] Specifically, the program 610 may include program codes, which include computer operation instructions.

[0087] The processor 602 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the computing device may be processors of the same type, such as one or more CPUs; or may be processors of different types, such as one or more CPUs and one or more ASICs.

[0088] The memory 606 is used to store the program 610. The memory 606 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0089] Program 610 can be specifically used to enable processor 602 to execute the user interface test case generation method in any of the above method embodiments. The specific implementation of each step in program 610 can refer to the corresponding description in the corresponding steps and units in the above user interface test case generation embodiment, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the above-mentioned method embodiment, which will not be repeated here.

[0090] The present invention also provides a non-volatile computer storage medium, which stores at least one executable instruction, and the executable instruction can execute the user interface testing method in any of the above method embodiments.

[0091] The present invention also provides a computing device, including: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the operation corresponding to the above-mentioned user interface testing method. Figure 6The structural schematic diagram of the computing device shown is the same and will not be repeated here.

[0092] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages ​​can be utilized to realize the content of the present invention described herein, and the description of the above specific languages ​​is for disclosing the best mode of the present invention.

[0093] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0094] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the intention that the claimed invention requires more features than those explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.

[0095] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0096] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.

[0097] The various component embodiments of the present invention can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all of the functions of some or all of the components in the embodiments of the present invention. The present invention can also be implemented as a device or apparatus program (e.g., computer program and computer program product) for executing part or all of the methods described herein. Such a program implementing the present invention can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0098] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.

Claims

1. A method for generating a user interface test case, comprising: Using the front-end page of the browser to remotely access the user interface to be tested of the terminal device, and display the user interface; wherein the front-end page also includes at least one action control for generating a test case; Select any action control in the front-end page, and take a screenshot of any control to be tested in the user interface in the front-end page to obtain a corresponding screenshot image; Bind the screenshot image to the action control to generate a corresponding test case; The selecting any action control in the front-end page, and taking a screenshot of any control to be tested in the user interface in the front-end page to obtain a corresponding screenshot image; and binding the screenshot image to the action control to generate a corresponding test case further comprises: Select any action control in the front-end page, and set various parameters of the action control; wherein the screenshot image is set as the image parameter of the action control; Generate a test case corresponding to the action control.

2. The method according to claim 1, wherein: Binding the screenshot image to the action control to generate a corresponding test case further includes: A test case generation operation including the screenshot image and the action control triggered by the front-end page is received, and the back-end converts the operation instruction into a test case operation instruction, and generates and saves the corresponding test case.

3. The method according to claim 1, wherein: The method further comprises: Select any action control in the front-end page, set parameters corresponding to the action control, and generate a test case for the action control.

4. The method according to claim 1, wherein: When selecting multiple action controls in the front-end page, the method further includes: A test case including multiple action controls is generated according to the sequence of the selected multiple action controls.

5. The method according to claim 2, wherein: The backend adopts an asynchronous non-blocking execution mode.

6. A user interface testing method, comprising: Get test cases; Parsing the test case and converting it into a test case operation instruction for the control to be tested in the user interface of the terminal device; Transmitting the test case operation instruction to the user interface of the terminal device through the remote management unit for execution, and obtaining a user interface screenshot of the user interface of the terminal device after executing the test case to verify whether the test case is successfully executed; The obtaining of test cases further comprises: Select the test cases to be executed and store them in the pre-established storage queue; According to the test case name stored in the storage queue, obtaining the corresponding test case from the database; Wherein, the test case is generated using the user interface test case generation method described in any one of claims 1-5.

7. The method according to claim 6, wherein: The parsing of the test case and converting it into a test case operation instruction for the control to be tested in the user interface further includes: Read the test case and obtain the screenshot image contained in the test case; Identify the screenshot image, and determine a control to be tested in a user interface of a terminal device corresponding to the screenshot image; According to the parameters in the test case, a test case operation instruction for the control to be tested in the user interface is determined.

8. The method according to claim 6, wherein: The step of transmitting the test case operation instruction to the user interface of the terminal device through the remote management unit for execution, and obtaining a user interface screenshot of the user interface of the terminal device after executing the test case to verify whether the test case is successfully executed further includes: The test case operation instruction is transmitted to the user interface of the terminal device via the remote management unit in the form of second protocol data for execution, and a user interface screenshot of the user interface of the terminal device after executing the test case is obtained to verify whether the test case is successfully executed; the user interface screenshot is obtained by the remote management unit and transmitted to the back end in the form of first protocol data; the first protocol data is screen drawing and event transmission protocol data; the second protocol data is remote desktop protocol data.

9. The method according to claim 8, wherein: The backend adopts an asynchronous non-blocking execution mode.

10. A user interface test case generating device, comprising: An access module, adapted to remotely access a user interface to be tested of a terminal device using a front-end page of a browser, and display the user interface; wherein the front-end page also includes at least one action control for generating a test case; A screenshot module, adapted to select any action control in the front-end page, and perform a screenshot operation on any control to be tested in the user interface in the front-end page to obtain a corresponding screenshot image; A first generating module, adapted to bind the screenshot image and the action control to generate a corresponding test case; The screenshot module is further adapted to: Select any action control in the front-end page, and set various parameters of the action control; wherein the screenshot image is set as the image parameter of the action control; The first generating module is further adapted to: generate a test case corresponding to the action control.

11. The device according to claim 10, wherein: The first generation module is further adapted to: A test case generation operation including the screenshot image and the action control triggered by the front-end page is received, and the back-end converts the operation instruction into a test case operation instruction, and generates and saves the corresponding test case.

12. The device according to claim 10, wherein: The device also includes: The second generating module is adapted to select any action control in the front-end page, set parameters corresponding to the action control, and generate a test case for the action control.

13. The device according to claim 10, wherein: The device also includes: The third generating module is adapted to generate a test case including a plurality of action controls according to the sequence of the selected plurality of action controls.

14. The device according to claim 11, wherein: The backend adopts an asynchronous non-blocking execution mode.

15. A user interface testing device, comprising: Acquisition module, suitable for acquiring test cases; A parsing module, adapted to parse the test case and convert it into a test case operation instruction for a control to be tested in a user interface of a terminal device; An execution module, adapted to transmit the test case operation instruction to the user interface of the terminal device through the remote management unit for execution, and obtain a user interface screenshot of the user interface of the terminal device after executing the test case, so as to verify whether the test case is successfully executed; Wherein, the acquisition module is further adapted to: Select the test cases to be executed and store them in the pre-established storage queue; According to the test case name stored in the storage queue, obtaining the corresponding test case from the database; Wherein, the test case is generated using the user interface test case generating device described in any one of claims 10-14.

16. The device according to claim 15, wherein: The parsing module is further adapted to: Read the test case and obtain the screenshot image contained in the test case; Identify the screenshot image, and determine a control to be tested in a user interface of a terminal device corresponding to the screenshot image; According to the parameters in the test case, a test case operation instruction for the control to be tested in the user interface is determined.

17. The device according to claim 15, wherein: The execution module is further adapted to: The test case operation instruction is transmitted to the user interface of the terminal device via the remote management unit in the second protocol data for execution, and a user interface screenshot of the user interface of the terminal device after executing the test case is obtained to verify whether the test case is successfully executed; the user interface screenshot is obtained by the remote management unit and transmitted to the back end in the first protocol data; the first protocol data is screen drawing and event transmission protocol data; The second protocol data is remote desktop protocol data.

18. The device according to claim 17, wherein: The backend adopts an asynchronous non-blocking execution mode.

19. A computing device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the user interface test case generation method according to any one of claims 1-5.

20. A computer storage medium, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to execute operations corresponding to the user interface test case generation method according to any one of claims 1 to 5.

21. A computing device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the user interface testing method according to any one of claims 6-9.

22. A computer storage medium, wherein at least one executable instruction is stored in the storage medium, and wherein the executable instruction enables a processor to execute an operation corresponding to the user interface testing method according to any one of claims 6 to 9.

Citation Information

Patent Citations

  • Method and device for testing web page

    CN105528297A