Test script execution method and device
By receiving the storage address and web client identification of the mixed test script in the APP client, executing the APP script and remotely controlling the web client, the problem of low execution efficiency of hybrid test scripts in the existing technology is solved, and efficient hybrid test scripts are realized implement.
Patent Information
- Application Number
- CN202411111613.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-08-13
AI Technical Summary
Existing automated test platforms cannot efficiently execute hybrid test scripts, especially because they need to occupy multiple physical machines and mobile devices, limiting testing efficiency.
The APP client receives the storage address of the mixed test script sent by the server and the web client's identification, obtains the mixed test script, and executes the APP script process in the APP client, and at the same time, remotely controls the web client to execute the web script process to avoid the The web script is sent to the web client and gets a mixed test script.
It improves the execution efficiency of hybrid test scripts, reduces dependence on physical machines and mobile devices, and improves testing efficiency.
Smart Images

Figure CN119127670A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of software testing technology, and in particular to a method and device for executing a test script. Background Art
[0002] In the related art, the automated testing platform can only execute pure mobile terminal automated testing scripts or pure browser terminal automated testing scripts. If you want to execute mobile terminal + browser terminal hybrid process automated scripts, these scripts involve interleaved execution of mobile terminal and browser terminal, and each process needs to occupy a physical machine and a mobile terminal device. Due to the limitation of the number of physical machines and mobile terminal devices, testing can usually only be performed in a single machine environment, which restricts the efficiency of testing. Summary of the invention
[0003] The present application aims to solve one of the technical problems in the related art at least to some extent.
[0004] To this end, the first purpose of the present application is to propose a method for executing a test script, so that when the APP client detects that the hybrid test script contains a process that needs to be executed by the web client, the web script is run and the web client is remotely controlled to execute the corresponding process. The APP client does not need to send the web script to the web client, and the web client does not need to obtain the hybrid test script based on the storage address, so as to realize the execution of the hybrid test script, thereby improving the execution efficiency of the hybrid test script.
[0005] The second objective of the present application is to provide a test script execution device.
[0006] The third purpose of this application is to provide an APP client.
[0007] The fourth objective of this application is to provide a server.
[0008] A fifth objective of the present application is to provide a computer-readable storage medium.
[0009] A sixth object of the present application is to provide a computer program product.
[0010] To achieve the above-mentioned purpose, the first embodiment of the present application proposes a method for executing a test script, which is executed by an APP client, including:
[0011] Receive a first message sent by the server, wherein the first message includes a storage address of the hybrid test script and a first identifier of the web client;
[0012] Based on the storage address, obtaining the hybrid test script;
[0013] Based on the app script in the hybrid test script, control the tested app in the APP client to execute the process corresponding to the app script;
[0014] Based on the web script in the hybrid test script, the web client corresponding to the first identifier is remotely controlled to execute the process corresponding to the web script.
[0015] To achieve the above-mentioned purpose, the second embodiment of the present application proposes a method for executing a test script, which is executed by a server, including:
[0016] receiving a third message, wherein the third message includes a storage address of a hybrid test script;
[0017] Determine a first identifier corresponding to a web client and a second identifier corresponding to an APP client for executing the hybrid test script;
[0018] A first message is sent to the APP client corresponding to the second identifier, wherein the first message includes the storage address and the first identifier.
[0019] To achieve the above-mentioned purpose, the third aspect of the present application proposes a test script execution device, which is configured on the APP client side, including:
[0020] A receiving module, configured to receive a first message sent by a server, wherein the first message includes a storage address of a hybrid test script and a first identifier of a web client;
[0021] An acquisition module, used for acquiring the hybrid test script based on the storage address;
[0022] A first control module, configured to control the tested app in the APP client to execute a process corresponding to the app script based on the app script in the hybrid test script;
[0023] The second control module is used to remotely control the web client corresponding to the first identifier to execute the process corresponding to the web script based on the web script in the hybrid test script.
[0024] To achieve the above-mentioned purpose, the fourth aspect of the present application proposes a test script execution device, which is configured on the server side and includes:
[0025] A receiving module, used for receiving a third message, wherein the third message includes a storage address of a hybrid test script;
[0026] A determination module, used to determine a first identifier corresponding to a web client used to execute the hybrid test script, and a second identifier corresponding to an APP client;
[0027] A sending module is used to send a first message to the APP client corresponding to the second identifier, wherein the first message includes the storage address and the first identifier.
[0028] To achieve the above-mentioned purpose, the fifth aspect of the present application proposes an APP client, characterized in that it includes: a processor, and a memory communicatively connected to the processor;
[0029] The memory stores computer-executable instructions;
[0030] The processor executes the computer-executable instructions stored in the memory to implement the method as described in the embodiment of the first aspect.
[0031] To achieve the above-mentioned purpose, a sixth aspect of the present application provides a server, characterized in that it includes: a processor, and a memory communicatively connected to the processor;
[0032] The memory stores computer-executable instructions;
[0033] The processor executes the computer-executable instructions stored in the memory to implement the method as described in the embodiment of the second aspect.
[0034] To achieve the above-mentioned purpose, the seventh aspect embodiment of the present application proposes a computer-readable storage medium, in which computer execution instructions are stored. When the computer execution instructions are executed by a processor, they are used to implement the method described in the first aspect embodiment, or to implement the method described in the second aspect embodiment.
[0035] To achieve the above-mentioned objectives, the eighth aspect embodiment of the present application proposes a computer program product, a computer program, which, when executed by a processor, implements the method described in the first aspect embodiment, or implements the method described in the second aspect embodiment.
[0036] The test script execution method and device provided in the present application are as follows: an APP client receives a first message sent by a server, wherein the first message includes a storage address of a hybrid test script and a first identifier of a web client, and then obtains the hybrid test script based on the storage address, and controls the tested app in the APP client to execute a process corresponding to the app script based on the app script in the hybrid test script, and remotely controls the web client corresponding to the first identifier to execute a process corresponding to the web script based on the web script in the hybrid test script. Thus, when the APP client detects that the hybrid test script includes a process that needs to be executed by the web client, it runs the web script and remotely controls the web client to execute the corresponding process. The APP client does not need to send the web script to the web client, and the web client does not need to obtain the hybrid test script based on the storage address, and can realize the execution of the hybrid test script, thereby improving the execution efficiency of the hybrid test script.
[0037] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0039] Figure 1 A flowchart of a method for executing a test script provided in an embodiment of the present application;
[0040] Figure 2 A flowchart of another method for executing a test script provided in an embodiment of the present application;
[0041] Figure 3 A flowchart of a method for executing a test script provided in an embodiment of the present application;
[0042] Figure 4 A flowchart of another method for executing a test script provided in an embodiment of the present application;
[0043] Figure 5 An interactive schematic diagram of a test script execution method provided in an embodiment of the present application;
[0044] Figure 6 A schematic diagram of the structure of a test script execution device provided in an embodiment of the present application;
[0045] Figure 7 A schematic diagram of the structure of a test script execution device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0047] In order to better understand a test script execution method disclosed in an embodiment of the present disclosure, the test script execution system applicable to the embodiment of the present disclosure is first described below.
[0048] The execution system of the test script may include a server, one or more APP clients, and one or more web clients. Among them, APP clients include but are not limited to iOS and Android types. Web clients include but are not limited to IE, Firefox, Chrome, Edge and other types.
[0049] In some embodiments, the web client may be deployed on a virtual machine.
[0050] In some embodiments, one or more APP clients and one or more web clients are registered on the server and are centrally scheduled by the server.
[0051] The following describes the test script execution method and device of the embodiment of the present application with reference to the accompanying drawings.
[0052] Figure 1 A flowchart of a method for executing a test script provided in an embodiment of the present application. Executed by the app client, such as Figure 1 As shown, the execution method of the test script includes the following steps:
[0053] Step 101: Receive a first message sent by a server, wherein the first message includes a storage address of a hybrid test script and a first identifier of a web client.
[0054] The hybrid test script includes an app script and a web script. The app script is used to perform testing on the client app, and the web script is used to perform testing on the web client.
[0055] Among them, the first message can be used to instruct the APP client to obtain the hybrid test script and run the hybrid test script.
[0056] In some embodiments, after receiving the first message, the APP client can start appium, obtain the hybrid test script, and run the hybrid test script.
[0057] Among them, the hybrid test script can be stored in the server, that is, the storage address of the hybrid test script is in the server.
[0058] The web client may be a client determined by the server for executing the web script in the hybrid test script. The first identifier may be an Internet Protocol Address (IP address) of the web client. This disclosure does not limit this.
[0059] Step 102, based on the storage address, obtain the mixed test script.
[0060] In some embodiments, the APP client can pull the hybrid test script from the git repository based on the storage address.
[0061] Step 103, based on the app script in the hybrid test script, control the app under test in the APP client to execute the process corresponding to the app script.
[0062] The APP under test is an APP in the APP client that can execute the process corresponding to the APP script.
[0063] For example, the mixed test script includes app script A, app script B, web script C, and app script D in sequence. The APP client first controls the tested app to execute the processes corresponding to app script A and app script B.
[0064] Step 104: Based on the web script in the hybrid test script, remotely control the web client corresponding to the first identifier to execute the process corresponding to the web script.
[0065] In some embodiments, if the APP client detects that the process corresponding to a certain script is the process executed by the Web side when running the hybrid test script, the APP client runs the script and remotely controls the web client to execute the process corresponding to the web script.
[0066] For example, the mixed test script includes app script A, app script B, web script C, and app script D in sequence. The APP client first controls the app under test to execute the processes corresponding to app scripts A and app script B, then runs web script C, and remotely controls the web client corresponding to the first identifier to execute the process corresponding to web script C, and finally controls the app under test to execute the process corresponding to app script D.
[0067] In some embodiments, before remotely controlling the web client corresponding to the first identifier to execute the process corresponding to the web script based on the web script in the hybrid test script, the APP client can establish a communication connection with the web client based on the Hypertext Transfer Protocol (http) protocol and the first identifier. Thus, the web client can be remotely controlled to execute the process corresponding to the web script based on the established communication connection.
[0068] It should be noted that web scripts can be written using the selenium framework. Selenium has a remote control mechanism. Using selenium grid, after starting the grid, the selenium remote control web client mode is turned on. It should be noted that when remotely controlling the web client, a remote URL address (consisting of the web client's IP address and port number) is required. Specifically, the APP client executes the web script by writing the URL address into the url that starts the driver, and the web client is started.
[0069] In some embodiments, before the APP client remotely controls the web client corresponding to the first identifier to execute the process corresponding to the web script based on the web script in the hybrid test script, the web client corresponding to the first identifier has started the selenium grid service.
[0070] In some embodiments, after detecting the web script in the hybrid test script, the APP client can send a second instruction to the server based on the websocket protocol, and the second instruction is used to instruct the server to send a start instruction to the web client corresponding to the first identifier, wherein the start instruction is used to instruct the web client to start the selenium grid service.
[0071] In this embodiment, the APP client receives a first message sent by the server, wherein the first message includes the storage address of the hybrid test script and the first identifier of the web client, and then obtains the hybrid test script based on the storage address, and controls the tested app in the APP client to execute the process corresponding to the app script based on the app script in the hybrid test script, and remotely controls the web client corresponding to the first identifier to execute the process corresponding to the web script based on the web script in the hybrid test script. Thus, when the APP client detects that the hybrid test script includes a process that needs to be executed by the web client, it runs the web script and remotely controls the web client to execute the corresponding process. The APP client does not need to send the web script to the web client, and the web client does not need to obtain the hybrid test script based on the storage address, and can realize the execution of the hybrid test script, thereby improving the execution efficiency of the hybrid test script.
[0072] Figure 2 A flowchart of a method for executing a test script provided in an embodiment of the present application. Executed by an APP client, such as Figure 2 As shown, the execution method of the test script may include the following steps:
[0073] Step 201: Receive a first message sent by a server, wherein the first message includes a storage address of a hybrid test script and a first identifier of a web client.
[0074] Step 202, based on the storage address, obtain the hybrid test script.
[0075] Step 203, based on the app script in the hybrid test script, control the app under test in the APP client to execute the process corresponding to the app script.
[0076] Step 204: Based on the web script in the hybrid test script, remotely control the web client corresponding to the first identifier to execute the process corresponding to the web script.
[0077] The specific implementation forms of steps 201 to 204 can refer to the detailed descriptions in other embodiments of the present disclosure, and will not be described in detail here.
[0078] Step 205, when it is detected that the hybrid test script has finished running, a second message is sent to the server, wherein the second message includes the test running status and / or test results corresponding to the hybrid test script.
[0079] The test running status may include running success and running failure.
[0080] In some embodiments, the APP client can also close appium when detecting that the hybrid test script has finished running.
[0081] In some embodiments, the second message is also used to indicate that the hybrid test script has finished running, and the server can send a close instruction to the web client, where the close instruction is used to instruct the web client to close the selenium grid service.
[0082] In some embodiments, when it is detected that the hybrid test script has finished running, the APP client can also send a first instruction to the server based on the websocket protocol, wherein the first instruction is used to instruct the server to send a close instruction to the web client, and the close instruction is used to instruct the web client to close the selenium grid service.
[0083] In the disclosed embodiment, the APP client receives a first message sent by the server, wherein the first message includes the storage address of the hybrid test script and the first identifier of the web client, and then obtains the hybrid test script based on the storage address, and controls the tested app in the APP client to execute the process corresponding to the app script based on the app script in the hybrid test script, and remotely controls the web client corresponding to the first identifier to execute the process corresponding to the web script based on the web script in the hybrid test script, and then sends a second message to the server when it is detected that the hybrid test script has finished running, wherein the second message includes the test running status and / or test results corresponding to the hybrid test script. Thus, when the hybrid test script has finished running, the test running status and / or test results are sent to the server, which is stored and displayed by the server, so that the user can view the running data of the hybrid test script conveniently.
[0084] Figure 3 A flow chart of a method for executing a test script provided in an embodiment of the present application. Executed by the server, such as Figure 3 As shown, the execution method of the test script may include the following steps:
[0085] Step 301: Receive a third message, wherein the third message includes a storage address of a hybrid test script.
[0086] The third message may be a message triggered by a user and used to test the hybrid test script.
[0087] Among them, the storage address of the mixed test script can be selected by the user.
[0088] Step 302, determining a first identifier corresponding to a web client for executing a hybrid test script and a second identifier corresponding to an APP client.
[0089] In some embodiments, the first type supported by the web script and the second type supported by the app script in the hybrid test script are determined, and the IP address corresponding to any web client that is in an idle state and is the same as the first type is determined as the first identifier, and the device serial number corresponding to any APP client that is in an idle state and is the same as the second type is determined as the second identifier.
[0090] The first type may be a type of web client supported by the web script, for example, the first type may be one or more of IE, Firefox, Chrome, and Edge.
[0091] For example, if the first type supported by the web script in the hybrid test script is Edge, then an idle web client of Edge type is selected as the web client for executing the web script in the hybrid test script, and the IP address corresponding to the web client is used as the first identifier.
[0092] The second type may be a type of APP client supported by the APP script, for example, the second type may be one or more of Android, iOS, etc.
[0093] For example, if the second type supported by the app script in the hybrid test script is Android, then an idle Android-type APP client is selected as the APP client for executing the app script in the hybrid test script, and the device serial number corresponding to the APP client is used as the second identifier.
[0094] In some embodiments, after determining the first identifier corresponding to the web client used to execute the hybrid test script and the second identifier corresponding to the APP client, the running status of the web client and the APP client used to execute the hybrid test script can also be set to running, so as to avoid being occupied by other test scripts or affecting the test efficiency of other test scripts.
[0095] Step 303: Send a first message to the APP client corresponding to the second identifier, wherein the first message includes a storage address and a first identifier.
[0096] Among them, the first message is used to instruct the APP client to instruct the APP client to obtain the hybrid test script based on the storage address, and to gather the web client corresponding to the first identifier to execute the test process corresponding to the hybrid test script.
[0097] In the disclosed embodiment, the server receives a third message, wherein the third message includes a storage address of the hybrid test script, then determines a first identifier corresponding to the web client for executing the hybrid test script and a second identifier corresponding to the APP client, and finally sends a first message to the APP client corresponding to the second identifier, wherein the first message includes the storage address and the first identifier. Thus, the server can uniformly schedule the web client and the APP client, providing conditions for the execution of the hybrid test script without being limited by the number of physical machines, thereby improving the execution efficiency of the hybrid test script.
[0098] Figure 4 The following is a flow chart of a method for executing a test script provided in an embodiment of the present application. Figure 4 As shown, the execution method of the test script may include the following steps:
[0099] Step 401: Receive a third message, wherein the third message includes a storage address of a hybrid test script.
[0100] Step 402, determining a first identifier corresponding to a web client for executing a hybrid test script and a second identifier corresponding to an APP client.
[0101] Step 403: Send a first message to the APP client corresponding to the second identifier, wherein the first message includes a storage address and a first identifier.
[0102] The specific implementation forms of steps 401 to 403 can refer to the detailed descriptions in other embodiments of the present disclosure, and will not be described in detail here.
[0103] Step 404: Send a start instruction to the web client corresponding to the first identifier, wherein the start instruction is used to instruct the web client to start the selenium grid service.
[0104] In some embodiments, the server can autonomously send a startup instruction to the web client corresponding to the first identifier through the websocket protocol. Alternatively, the server can also send a startup instruction to the web client corresponding to the first identifier through the websocket protocol after receiving the second instruction sent by the APP client, wherein the second instruction is used to instruct the server to send a startup instruction to the web client corresponding to the first identifier. This disclosure does not limit this.
[0105] It should be noted that the web client can only be remotely controlled after the selenium grid service is started.
[0106] Step 405: Receive a second message sent by the APP client, wherein the second message includes a test running status and / or a test result corresponding to the hybrid test script.
[0107] The test run status in the test run result may include run success and run failure.
[0108] Step 406: Display the test running status and / or test results on the display interface.
[0109] Step 407: Based on the websocket protocol, a close instruction is sent to the web client, wherein the close instruction is used to instruct the web client to close the selenium grid service.
[0110] In some embodiments, the second message may also indicate that the hybrid test script has finished running, and the server may send a close instruction to the web client. Therefore, after receiving the second message, a close instruction may be sent to the web client based on the websocket protocol.
[0111] In some embodiments, upon receiving the first instruction sent by the APP client, a close instruction may be sent to the web client based on the websocket protocol, wherein the close instruction is used to instruct the web client to close the selenium grid service.
[0112] It should be noted that the execution order of step 407 may be before step 405 or after step 405. This disclosure does not limit this.
[0113] In the disclosed embodiment, the server receives a third message, wherein the third message includes a storage address of a hybrid test script, then determines a first identifier corresponding to a web client for executing the hybrid test script and a second identifier corresponding to an APP client, and finally sends a first message to the APP client corresponding to the second identifier, wherein the first message includes a storage address and a first identifier, and sends a start instruction to the web client corresponding to the first identifier, wherein the start instruction is used to instruct the web client to start the selenium grid service, and after the hybrid test script is run, a shutdown instruction is sent to the web client based on the websocket protocol, wherein the shutdown instruction is used to instruct the web client to shut down the selenium grid service. Thus, the opening and closing of the selenium grid service in the web client can be controlled in time, so that the APP client can run and control the web client, and after the control is completed, the selenium grid service is closed in time to prevent the web client from being remotely controlled by other devices, which not only ensures the smooth execution of the hybrid test script, but also ensures the security of the web client.
[0114] Figure 5 The following is an interactive diagram of a method for executing a test script provided in an embodiment of the present application. Figure 5 As shown, the execution method of the test script may include the following steps:
[0115] Step 501: The server receives a third message, wherein the third message includes a storage address of a hybrid test script.
[0116] Step 502, the server determines a first identifier corresponding to the web client for executing the hybrid test script, and a second identifier corresponding to the APP client.
[0117] Step 503: The server sends a first message to the APP client corresponding to the second identifier, wherein the first message includes a storage address and a first identifier.
[0118] Step 504: The server sends a start instruction to the web client corresponding to the first identifier, wherein the start instruction is used to instruct the web client to start the selenium grid service.
[0119] Step 505: The web client starts the selenium grid service.
[0120] Step 506: The APP client obtains the hybrid test script based on the storage address.
[0121] Step 507 , the APP client controls the tested app in the APP client to execute a process corresponding to the app script based on the app script in the hybrid test script.
[0122] Step 508: The APP client remotely controls the web client corresponding to the first identifier to execute the process corresponding to the web script based on the web script in the hybrid test script.
[0123] Step 509: When the APP client detects that the hybrid test script has finished running, it sends a second message to the server, wherein the second message includes the test running status and / or test results corresponding to the hybrid test script.
[0124] Step 510: The server displays the test running status and / or test results on the display interface.
[0125] Step 511, the server sends a close instruction to the web client based on the websocket protocol, wherein the close instruction is used to instruct the web client to close the selenium grid service.
[0126] It should be noted that step 511 may be performed before step 510 or after step 510. This disclosure does not limit this.
[0127] Step 512: The web client closes the selenium grid service.
[0128] In order to implement the above embodiment, the present application also proposes a test script execution device.
[0129] Figure 6 A schematic diagram of the structure of a test script execution device provided in an embodiment of the present application. It is configured on the APP client side, such as Figure 6 As shown, the execution device of the test script includes:
[0130] The receiving module 601 is used to receive a first message sent by the server, wherein the first message includes a storage address of the hybrid test script and a first identifier of the web client;
[0131] An acquisition module 602 is used to acquire a hybrid test script based on a storage address;
[0132] The first control module 603 is used to control the tested app in the APP client to execute the process corresponding to the app script based on the app script in the hybrid test script;
[0133] The second control module 604 is used to remotely control the web client corresponding to the first identifier to execute the process corresponding to the web script based on the web script in the hybrid test script.
[0134] In some embodiments, a sending module is also included for
[0135] When it is detected that the hybrid test script has finished running, a second message is sent to the server, wherein the second message includes the test running status and / or test results corresponding to the hybrid test script.
[0136] In some embodiments, the sending module is further configured to:
[0137] When it is detected that the hybrid test script has finished running, a first instruction is sent to the server based on the websocket protocol, wherein the first instruction is used to instruct the server to send a close instruction to the web client, and the close instruction is used to instruct the web client to close the selenium grid service.
[0138] In some embodiments, the system further includes a processing module for:
[0139] Based on the hypertext transfer protocol (http) and the first identifier, a communication connection is established with the web client.
[0140] It should be noted that the above explanation of the embodiment of the test script execution method is also applicable to the test script execution device of this embodiment, and will not be repeated here.
[0141] In the disclosed embodiment, the APP client receives a first message sent by the server, wherein the first message includes a storage address of a hybrid test script and a first identifier of a web client, and then obtains the hybrid test script based on the storage address, and controls the tested app in the APP client to execute a process corresponding to the app script based on the app script in the hybrid test script, and remotely controls the web client corresponding to the first identifier to execute a process corresponding to the web script based on the web script in the hybrid test script. Thus, when the APP client detects that the hybrid test script includes a process that needs to be executed by the web client, it runs the web script and remotely controls the web client to execute the corresponding process. The APP client does not need to send the web script to the web client, and the web client does not need to obtain the hybrid test script based on the storage address, and can realize the execution of the hybrid test script, thereby improving the execution efficiency of the hybrid test script.
[0142] Figure 7 A schematic diagram of the structure of a test script execution device provided in an embodiment of the present application. It is configured on the server side, such as Figure 7 As shown, the execution device of the test script includes:
[0143] The receiving module 701 is used to receive a third message, wherein the third message includes a storage address of a hybrid test script;
[0144] A determination module 702 is used to determine a first identifier corresponding to a web client for executing a hybrid test script and a second identifier corresponding to an APP client;
[0145] The sending module 703 is used to send a first message to the APP client corresponding to the second identifier, wherein the first message includes a storage address and a first identifier.
[0146] In some embodiments, the system further includes a processing module for:
[0147] Determine the first type supported by the web script and the second type supported by the app script in the hybrid test script;
[0148] Determine an IP address corresponding to any web client that is in an idle state and is of the same type as the first type as a first identifier;
[0149] The device serial number corresponding to any APP client that is in an idle state and is of the same type as the second type is determined as the second identifier.
[0150] In some embodiments, the sending module is further configured to:
[0151] A start instruction is sent to the web client corresponding to the first identifier, wherein the start instruction is used to instruct the web client to start the selenium grid service.
[0152] In some embodiments, a display module is further included for:
[0153] Receive a second message sent by the APP client, wherein the second message includes a test running status and / or a test result corresponding to the hybrid test script;
[0154] The test running status and / or test results are displayed on the display interface.
[0155] In some embodiments, the sending module is further configured to:
[0156] Based on the websocket protocol, a close instruction is sent to the web client, where the close instruction is used to instruct the web client to close the selenium grid service.
[0157] In some embodiments, the sending module is further configured to:
[0158] When receiving the first instruction sent by the APP client, a close instruction is sent to the web client based on the websocket protocol, wherein the close instruction is used to instruct the web client to close the selenium grid service.
[0159] It should be noted that the above explanation of the embodiment of the test script execution method is also applicable to the test script execution device of this embodiment, and will not be repeated here.
[0160] In the disclosed embodiment, the server receives a third message, wherein the third message includes a storage address of the hybrid test script, then determines a first identifier corresponding to the web client for executing the hybrid test script and a second identifier corresponding to the APP client, and finally sends a first message to the APP client corresponding to the second identifier, wherein the first message includes the storage address and the first identifier. Thus, the server can uniformly schedule the web client and the APP client, providing conditions for the execution of the hybrid test script without being limited by the number of physical machines, thereby improving the execution efficiency of the hybrid test script.
[0161] In order to implement the above embodiments, the present application also proposes an APP client, including: a processor, and a memory connected to the processor for communication; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory to implement the method provided by the above embodiments.
[0162] In order to implement the above embodiments, the present application also proposes a server, including: a processor, and a memory connected to the processor for communication; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory to implement the method provided by the above embodiments.
[0163] In order to implement the above embodiments, the present application also proposes a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the methods provided by the above embodiments.
[0164] In order to implement the above embodiments, the present application also proposes a computer program product, including a computer program, which implements the methods provided by the above embodiments when executed by a processor.
[0165] The collection, storage, use, processing, transmission, provision and disclosure of user personal information involved in this application are in compliance with relevant laws and regulations and do not violate public order and good morals.
[0166] It should be noted that personal information from users should be collected for legitimate and reasonable purposes and should not be shared or sold outside of these legitimate uses. In addition, such collection / sharing should be carried out after receiving the user's informed consent, including but not limited to notifying the user to read the user agreement / user notice and sign the agreement / authorization including authorization of relevant user information before the user uses the function. In addition, any necessary steps should be taken to protect and safeguard access to such personal information data and ensure that others who have access to personal information data comply with its privacy policy and procedures.
[0167] The present application is expected to provide an implementation scheme for users to selectively block the use or access of personal information data. That is, the present disclosure is expected to provide hardware and / or software to prevent or block access to such personal information data. Once the personal information data is no longer needed, the risk can be minimized by limiting data collection and deleting the data. In addition, when applicable, such personal information is de-identified to protect the privacy of the user.
[0168] In the description of the aforementioned embodiments, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0169] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0170] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0171] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0172] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0173] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0174] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0175] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A method for executing a test script, It is characterized in that Executed by the APP client, including the following steps: Receive a first message sent by the server, wherein the first message includes a storage address of the hybrid test script and a first identifier of the web client; Based on the storage address, obtaining the hybrid test script; Based on the app script in the hybrid test script, control the tested app in the APP client to execute the process corresponding to the app script; Based on the web script in the hybrid test script, the web client corresponding to the first identifier is remotely controlled to execute the process corresponding to the web script.
2. The method according to claim 1, It is characterized in that Also includes: When it is detected that the hybrid test script has finished running, a second message is sent to the server, wherein the second message includes the test running status and / or test results corresponding to the hybrid test script.
3. The method according to claim 1, It is characterized in that Also includes: When it is detected that the hybrid test script has finished running, a first instruction is sent to the server based on the websocket protocol, wherein the first instruction is used to instruct the server to send a close instruction to the web client, and the close instruction is used to instruct the web client to close the selenium grid service.
4. The method according to claim 1, It is characterized in that Before remotely controlling the web client corresponding to the first identifier to execute the process corresponding to the web script based on the web script in the hybrid test script, the method further includes: Based on the hypertext transfer protocol (http) and the first identifier, a communication connection is established with the web client.
5. A method for executing a test script, It is characterized in that Executed by the server, including the following steps: receiving a third message, wherein the third message includes a storage address of a hybrid test script; Determine a first identifier corresponding to a web client and a second identifier corresponding to an APP client for executing the hybrid test script; A first message is sent to the APP client corresponding to the second identifier, wherein the first message includes the storage address and the first identifier.
6. The method according to claim 5, It is characterized in that The determining of a first identifier corresponding to a web client for executing the hybrid test script and a second identifier corresponding to an APP client includes: Determine a first type supported by the web script and a second type supported by the app script in the hybrid test script; Determine the IP address corresponding to any web client that is in an idle state and is of the same type as the first type as the first identifier; The device serial number corresponding to any APP client that is in an idle state and is the same as the second type is determined as the second identifier.
7. The method according to claim 5, It is characterized in that After determining the first identifier corresponding to the web client and the second identifier corresponding to the APP client for executing the hybrid test script, the method further includes: Send a start instruction to the web client corresponding to the first identifier, wherein the start instruction is used to instruct the web client to start the selenium grid service.
8. The method according to claim 7, It is characterized in that After sending the first message to the APP client corresponding to the second identifier, the method further includes: Receive a second message sent by the APP client, wherein the second message includes a test running status and / or a test result corresponding to the hybrid test script; The test running status and / or test results are displayed on the display interface.
9. The method according to claim 8, It is characterized in that After receiving the second message sent by the APP client, the method further includes: Based on the websocket protocol, a close instruction is sent to the web client, wherein the close instruction is used to instruct the web client to close the selenium grid service.
10. The method according to claim 7, It is characterized in that After sending the first message to the APP client corresponding to the second identifier, the method further includes: When receiving the first instruction sent by the APP client, a close instruction is sent to the web client based on the websocket protocol, wherein the close instruction is used to instruct the web client to close the selenium grid service.
11. A test script execution device is configured on the APP client side. It is characterized in that include: A receiving module, configured to receive a first message sent by a server, wherein the first message includes a storage address of a hybrid test script and a first identifier of a web client; An acquisition module, used for acquiring the hybrid test script based on the storage address; A first control module, configured to control the tested app in the APP client to execute a process corresponding to the app script based on the app script in the hybrid test script; The second control module is used to remotely control the web client corresponding to the first identifier to execute the process corresponding to the web script based on the web script in the hybrid test script.
12. A test script execution device, configured on a web client side, It is characterized in that include: A receiving module, used for receiving a third message, wherein the third message includes a storage address of a hybrid test script; A determination module, used to determine a first identifier corresponding to a web client used to execute the hybrid test script, and a second identifier corresponding to an APP client; A sending module is used to send a first message to the APP client corresponding to the second identifier, wherein the first message includes the storage address and the first identifier.
13. An APP client, It is characterized in that include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 4.
14. A server, It is characterized in that include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 5 to 10.
15. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 10 when executed by a processor.
Citation Information
Patent Citations
Remote debugging method and device of intelligent equipment
CN108874651A
Automatic test method for WEB authentication process of PC terminal
CN113225223A
Automatic testing method and device for multi-terminal interaction and electronic equipment
CN115269375A
Browser based remote control of functional testing tool
US20070006036A1
