Method and apparatus for testing script execution

CN119127670BActive Publication Date: 2026-10-27PEOPLE'S INSURANCE COMPANY OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411111613.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2026-10-27
Estimated Expiration
2044-08-13

AI Technical Summary

Technical Problem

由于受到物理机和移动端设备数量的限制,通常只能在单机环境下进行测试,制约了测试的效率

Benefits of technology

[0036]本申请提供的测试脚本的执行方法及装置,APP客户端接收服务端发送的第一消息,其中,第一消息中包含混合测试脚本的存储地址及web客户端的第一标识,之后基于存储地址,获取混合测试脚本,并基于混合测试脚本中的app脚本,控制APP客户端中的被测app执行app脚本对应的流程,基于混合测试脚本中的web脚本,远程控制第一标识对应的web客户端执行web脚本对应的流程。由此,APP客户端在检测到混合测试脚本包含需要web客户端执行的流程的情况下,运行web脚本,远程控制web客户端执行对应流程,APP客户端无需将web脚本发送给web客户端,web客户端也无需基于存储地址获取混合测试脚本,即可实现混合测试脚本的执行,从而提升了混合测试脚本的执行效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127670B_ABST
    Figure CN119127670B_ABST
Patent Text Reader

Abstract

The application provides a test script execution method and device. The method comprises the following steps: receiving a first message sent by a server, wherein the first message comprises a storage address of a mixed test script and a first identifier of a web client; obtaining the mixed test script based on the storage address; controlling a measured app in an APP client to execute a process corresponding to an app script based on the app script in the mixed test script; and remotely controlling the web client corresponding to the first identifier to execute a process corresponding to a web script based on the web script in the mixed test script. Thus, when the APP client detects that the mixed test script comprises a process that needs to be executed by the web client, the APP client 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 mixed test script based on the storage address, so that the execution of the mixed test script is realized, and the execution efficiency of the mixed test script is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of software testing technology, and in particular to a method and apparatus for executing test scripts. Background Technology

[0002] In related technologies, automated testing platforms can only execute purely mobile-side automated test scripts or purely browser-side automated test scripts. If a hybrid mobile / browser-side automated process script is desired, these scripts require a physical machine and a mobile device for each process due to the interleaved execution of mobile and browser-side tasks. Because of the limitations in the number of physical machines and mobile devices, testing is typically limited to a single-machine environment, hindering testing efficiency. Summary of the Invention

[0003] This application aims to at least partially address one of the technical problems in the related art.

[0004] Therefore, the first objective of this application is to propose a method for executing test scripts, which allows the APP client to run the web script when it detects that the mixed test script contains a process that needs to be executed by the web client, and remotely control 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 mixed test script based on the storage address, thereby realizing the execution of the mixed test script and improving the execution efficiency of the mixed test script.

[0005] The second objective of this application is to provide a test script execution device.

[0006] The third objective of this application is to propose an APP client.

[0007] The fourth objective of this application is to propose a server-side solution.

[0008] The fifth objective of this application is to provide a computer-readable storage medium.

[0009] The sixth objective of this application is to provide a computer program product.

[0010] To achieve the above objectives, the first aspect of this 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 contains the storage address of the mixed test script and the first identifier of the web client;

[0012] Based on the storage address, obtain the hybrid test script;

[0013] Based on the app script in the hybrid test script, the tested app in the APP client is controlled 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 objectives, a second aspect of this application provides a method for executing a test script, which is executed by a server, including:

[0016] Receive a third message, wherein the third message contains the storage address of the mixed test script;

[0017] Determine the first identifier corresponding to the web client used to execute the hybrid test script, and the second identifier corresponding to the APP client;

[0018] Send a first message to the APP client corresponding to the second identifier, wherein the first message contains the storage address and the first identifier.

[0019] To achieve the above objectives, a third aspect of this application provides a test script execution device configured on the APP client side, comprising:

[0020] The receiving module is used to receive a first message sent by the server, wherein the first message contains the storage address of the mixed test script and the first identifier of the web client;

[0021] The acquisition module is used to acquire the hybrid test script based on the storage address;

[0022] The first control module is used to control the app under test in the APP client to execute the 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 objectives, a fourth aspect of this application provides a test script execution device configured on a server side, comprising:

[0025] A receiving module is used to receive a third message, wherein the third message contains the storage address of the mixed test script;

[0026] The determination module is used to determine the first identifier corresponding to the web client used to execute the hybrid test script, and the second identifier corresponding to the APP client;

[0027] The sending module is used to send a first message to the APP client corresponding to the second identifier, wherein the first message contains the storage address and the first identifier.

[0028] To achieve the above objectives, a fifth aspect of this application provides an APP client, characterized in that it includes: a processor, and a memory communicatively connected to the processor;

[0029] The memory stores computer-executed instructions;

[0030] The processor executes computer execution instructions stored in the memory to implement the method as described in the first aspect embodiment.

[0031] To achieve the above objectives, a sixth aspect of this application provides a server, characterized in that it includes: a processor, and a memory communicatively connected to the processor;

[0032] The memory stores computer-executed instructions;

[0033] The processor executes computer execution instructions stored in the memory to implement the method as described in the second aspect embodiment.

[0034] To achieve the above objectives, a seventh aspect of this application provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, are used to implement the method described in the first aspect embodiment or the method described in the second aspect embodiment.

[0035] To achieve the above objectives, an eighth aspect of this application provides a computer program product, a computer program that, 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 apparatus provided in this application involve an APP client receiving a first message sent by a server. This first message contains the storage address of a mixed test script and a first identifier of a web client. Then, based on the storage address, the mixed test script is retrieved. Based on the app script within the mixed test script, the APP client controls the tested app to execute the corresponding process of the app script. Based on the web script within the mixed test script, the APP client remotely controls the web client corresponding to the first identifier to execute the process of the web script. Therefore, when the APP client detects that the mixed test script contains 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 retrieve the mixed test script based on the storage address to achieve the execution of the mixed test script, thereby improving the execution efficiency of the mixed test script.

[0037] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0038] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:

[0039] Figure 1 A flowchart illustrating a test script execution method provided in an embodiment of this application;

[0040] Figure 2 A flowchart illustrating another method for executing a test script provided in an embodiment of this application;

[0041] Figure 3 A flowchart illustrating a test script execution method provided in an embodiment of this application;

[0042] Figure 4 A flowchart illustrating another method for executing a test script provided in an embodiment of this application;

[0043] Figure 5 An interactive schematic diagram illustrating a test script execution method provided in an embodiment of this application;

[0044] Figure 6 A schematic diagram of the structure of a test script execution device provided in an embodiment of this application;

[0045] Figure 7 This is a schematic diagram of the structure of a test script execution device provided in an embodiment of this application. Detailed Implementation

[0046] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.

[0047] To better understand the test script execution method disclosed in this embodiment, the test script execution system applicable to this embodiment will be described below.

[0048] The execution system for the test script may include a server, one or more mobile app clients, or one or more web clients. Mobile app clients include, but are not limited to, iOS and Android clients. Web clients include, but are not limited to, IE, Firefox, Chrome, Edge, and other similar browsers.

[0049] In some embodiments, the web client can be deployed on a virtual machine.

[0050] In some embodiments, one or more APP clients and one or more web clients register with the server and are uniformly scheduled by the server.

[0051] The execution method and apparatus for test scripts according to embodiments of this application are described below with reference to the accompanying drawings.

[0052] Figure 1 This is a flowchart illustrating a test script execution method provided in an embodiment of this application. It is executed by an app client, such as... Figure 1 As shown, the execution method of this test script includes the following steps:

[0053] Step 101: Receive the first message sent by the server, wherein the first message contains the storage address of the mixed test script and the first identifier of the web client.

[0054] The hybrid test script includes app scripts and web scripts. The app scripts are used to test on the client app, and the web scripts are used to test on the web client.

[0055] The first message can be used to instruct the APP client to obtain and run the hybrid test script.

[0056] In some embodiments, after receiving the first message, the APP client can launch Appium, thereby obtaining and running the hybrid test script.

[0057] The mixed test scripts can be stored on the server side; that is, the storage address of the mixed test scripts is on the server side.

[0058] The web client can be a client determined by the server for executing web scripts in the hybrid test script. The first identifier can be the web client's Internet Protocol Address (IP address). This disclosure does not limit this.

[0059] Step 102: Obtain the hybrid test script based on the storage address.

[0060] In some embodiments, the APP client can pull hybrid test scripts from a Git repository based on the storage address.

[0061] Step 103: Based on the app script in the mixed test script, control the process corresponding to the app script executed by the app under test in the APP client.

[0062] The tested APP is an APP client that can execute the process corresponding to the app script.

[0063] For example, if a mixed test script contains app script A, app script B, web script C, and app script D in sequence, then the APP client will first control the app under test 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 a certain script's corresponding process is a process executed on the web client when running a 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, if a mixed test script contains 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 script 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. This allows the APP client to remotely control the web client to execute the process corresponding to the web script based on the established communication connection.

[0068] It's worth noting that web scripts can be written using the Selenium framework. Selenium has a remote control mechanism called Selenium Grid. Starting the grid opens the Selenium remote control web client mode. It's important to note that remote control of the web client requires a remote URL address (composed of the web client's IP address and port number). Specifically, when the app client executes the web script, it adds the URL address to the driver's startup URL, thus launching the web client.

[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 already started the Selenium Grid service.

[0070] In some embodiments, after detecting the web script in the mixed test script, the APP client can send a second instruction to the server based on the WebSocket protocol. The second instruction is used to instruct the server to send a start instruction to the web client corresponding to the first identifier. 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. This first message contains the storage address of the hybrid test script and a first identifier of the web client. Then, based on the storage address, the APP client retrieves the hybrid test script. Based on the app script within the hybrid test script, the APP client controls the tested app to execute the corresponding process of the app script. Based on the web script within the hybrid test script, the APP client remotely controls the web client corresponding to the first identifier to execute the process of the web script. Therefore, when the APP client detects that the hybrid test script contains 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 retrieve the hybrid test script based on the storage address to achieve the execution of the hybrid test script, thereby improving the execution efficiency of the hybrid test script.

[0072] Figure 2 This is a flowchart illustrating a test script execution method provided in an embodiment of this application. It is executed by an APP client, such as... Figure 2 As shown, the execution method of this test script may include the following steps:

[0073] Step 201: Receive the first message sent by the server, wherein the first message contains the storage address of the mixed test script and the first identifier of the web client.

[0074] Step 202: Obtain the hybrid test script based on the storage address.

[0075] Step 203: Based on the app script in the mixed test script, control the process corresponding to the app script executed by the app under test in the APP client.

[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 of steps 201 to 204 can be found in the detailed descriptions of other embodiments in this disclosure, and will not be repeated here.

[0078] Step 205: Upon detecting that the mixed 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 mixed test script.

[0079] The test running status can include successful running and running failure.

[0080] In some embodiments, the APP client can also close Appium if it detects 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 shutdown command to the web client, which instructs the web client to shut down the Selenium Grid service.

[0082] In some embodiments, upon detecting the completion of the hybrid test script execution, the APP client may also send a first instruction to the server based on the WebSocket protocol. The first instruction is used to instruct the server to send a shutdown instruction to the web client, which instructs the web client to shut down the Selenium Grid service.

[0083] In this embodiment, the APP client receives a first message sent by the server. This first message contains the storage address of the hybrid test script and a first identifier of the web client. Then, based on the storage address, the hybrid test script is retrieved. Based on the app script within the hybrid test script, the APP client controls the tested app to execute the process corresponding to the app script. Based on the web script within the hybrid test script, the web client corresponding to the first identifier is remotely controlled to execute the process corresponding to the web script. After detecting that the hybrid test script has finished running, a second message is sent to the server. This second message includes the test running status and / or test results corresponding to the hybrid test script. Thus, upon the hybrid test script's completion, the test running status and / or test results are sent to the server for storage and display, allowing users to easily view the hybrid test script's running data.

[0084] Figure 3 This is a flowchart illustrating a method for executing a test script according to an embodiment of this application. It is executed by the server, such as... Figure 3 As shown, the execution method of this test script may include the following steps:

[0085] Step 301: Receive a third message, which contains the storage address of the mixed test script.

[0086] The third message can be a user-triggered message used to test the hybrid test script.

[0087] The storage location for the mixed test scripts can be selected by the user.

[0088] Step 302: Determine the first identifier corresponding to the web client used to execute the hybrid test script and the second identifier corresponding to the APP client.

[0089] In some embodiments, a first type of web script supported by the hybrid test script and a second type of app script supported are determined. 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 can be the type of web client supported by the web script. For example, the first type can be one or more of IE, Firefox, Chrome, and Edge.

[0091] For example, if the first type of web script supported in the mixed test script is Edge, then select an idle web client of type Edge as the web client to execute the web script in the mixed test script, and use the IP address corresponding to this web client as the first identifier.

[0092] The second type can be the type of APP client supported by the APP script, such as one or more of Android, iOS, etc.

[0093] For example, if the second type of the app script in the hybrid test script is Android, then select an idle Android app client as the app client to execute the app script in the hybrid test script, and use the device serial number corresponding to the app client 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 be set to running, thereby avoiding being occupied by other test scripts or affecting the testing 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 contains the storage address and the first identifier.

[0096] The first message is used to instruct the APP client to obtain the hybrid test script based on the storage address, and to execute the test process corresponding to the hybrid test script by the web client corresponding to the first identifier.

[0097] In this embodiment, the server receives a third message containing the storage address of the hybrid test script. Then, it determines a first identifier corresponding to the web client used to execute the hybrid test script and a second identifier corresponding to the APP client. Finally, it sends a first message to the APP client corresponding to the second identifier, containing the storage address and the first identifier. This allows the server to uniformly schedule the web client and APP client, providing the conditions for the execution of the hybrid test script without being limited by the number of physical machines, thus improving the execution efficiency of the hybrid test script.

[0098] Figure 4 This is a flowchart illustrating a method for executing a test script provided in an embodiment of this application. Figure 4 As shown, the execution method of this test script may include the following steps:

[0099] Step 401: Receive a third message, which contains the storage address of the mixed test script.

[0100] Step 402: Determine the first identifier corresponding to the web client used to execute the hybrid test script and the second identifier corresponding to the APP client.

[0101] Step 403: Send a first message to the APP client corresponding to the second identifier, wherein the first message contains the storage address and the first identifier.

[0102] The specific implementation of steps 401 to 403 can be found in the detailed descriptions of other embodiments in this disclosure, and will not be repeated here.

[0103] Step 404: Send a startup command to the web client corresponding to the first identifier, wherein the startup command is used to instruct the web client to start the Selenium Grid service.

[0104] In some embodiments, the server can independently send a startup command to the web client corresponding to the first identifier via the WebSocket protocol. Alternatively, the server can also send a startup command to the web client corresponding to the first identifier via the WebSocket protocol after receiving a second command from the APP client, wherein the second command instructs the server to send a startup command to the web client corresponding to the first identifier. This disclosure does not limit this aspect.

[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 the test running status and / or test results corresponding to the mixed test script.

[0107] The test run results can include test run status as either successful or failed.

[0108] Step 406: Display the test running status and / or test results on the display interface.

[0109] Step 407: Based on the WebSocket protocol, send a shutdown command to the web client, whereby the shutdown command instructs the web client to shut down 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 can send a shutdown command to the web client. Therefore, after receiving the second message, a shutdown command can be sent to the web client based on the WebSocket protocol.

[0111] In some embodiments, upon receiving a first instruction from the APP client, a shutdown instruction can be 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.

[0112] It should be noted that the execution order of step 407 can be before or after step 405. This disclosure does not limit this.

[0113] In this embodiment, the server receives a third message containing the storage address of the hybrid test script. Then, it determines a first identifier corresponding to the web client executing the hybrid test script and a second identifier corresponding to the APP client. Finally, it sends a first message to the APP client corresponding to the second identifier, containing the storage address and the first identifier, and sends a start command to the web client corresponding to the first identifier. This start command instructs the web client to start the Selenium Grid service. After the hybrid test script finishes running, a stop command is sent to the web client based on the WebSocket protocol, instructing the web client to stop the Selenium Grid service. This allows for timely control of the Selenium Grid service's startup and shutdown within the web client, enabling the APP client to run and control the web client. After control is complete, the Selenium Grid service is promptly shut down, preventing the web client from being remotely controlled by other devices. This not only ensures the smooth execution of the hybrid test script but also guarantees the security of the web client.

[0114] Figure 5 This is an interactive schematic diagram illustrating a test script execution method provided in an embodiment of this application. Figure 5 As shown, the execution method of this test script may include the following steps:

[0115] Step 501: The server receives a third message, which contains the storage address of the mixed test script.

[0116] Step 502: The server determines the first identifier corresponding to the web client used to execute the hybrid test script and the 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 contains the storage address and the first identifier.

[0118] Step 504: The server sends a startup command to the web client corresponding to the first identifier. The startup command is used to instruct the web client to start the Selenium Grid service.

[0119] Step 505: Start the Selenium Grid service in the web client.

[0120] Step 506: The APP client retrieves the hybrid test script based on the storage address.

[0121] Step 507: The APP client controls the execution of the process corresponding to the app script in the test app client based on the app script in the mixed test script.

[0122] Step 508: The APP client, based on the web script in the mixed test script, remotely controls the web client corresponding to the first identifier to execute the process corresponding to the web script.

[0123] Step 509: When the APP client detects that the mixed test script has finished running, it sends a second message to the server. The second message includes the test running status and / or test results corresponding to the mixed 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 shutdown command to the web client based on the WebSocket protocol. The shutdown command is used to instruct the web client to shut down the Selenium Grid service.

[0126] It should be noted that step 511 can be performed before or after step 510. This disclosure does not limit this.

[0127] Step 512: The web client shuts down the Selenium Grid service.

[0128] To implement the above embodiments, this application also proposes a test script execution device.

[0129] Figure 6 This is a schematic diagram of a test script execution device provided in an embodiment of this application. It is configured on the APP client side, such as... Figure 6 As shown, the execution device for this test script includes:

[0130] The receiving module 601 is used to receive a first message sent by the server, wherein the first message contains the storage address of the mixed test script and the first identifier of the web client;

[0131] Module 602 is used to retrieve the mixed test script based on the storage address;

[0132] The first control module 603 is used to control the execution of the process corresponding to the app script in the APP client based on the app script in the mixed 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 mixed test script.

[0134] In some embodiments, a sending module is also included, for...

[0135] Upon detecting the completion of the mixed test script execution, a second message is sent to the server, which includes the test execution status and / or test results corresponding to the mixed test script.

[0136] In some embodiments, the sending module is further configured to:

[0137] Upon detecting the completion of the hybrid test script execution, a first instruction is sent to the server based on the WebSocket protocol. This first instruction instructs the server to send a shutdown instruction to the web client, which in turn instructs the web client to shut down the Selenium Grid service.

[0138] In some embodiments, a processing module is further included for:

[0139] A communication connection is established with the web client based on the Hypertext Transfer Protocol (HTTP) and the first identifier.

[0140] It should be noted that the foregoing explanation of the test script execution method embodiment also applies to the test script execution device of this embodiment, and will not be repeated here.

[0141] In this embodiment, the APP client receives a first message sent by the server. This first message contains the storage address of the hybrid test script and a first identifier of the web client. Then, based on the storage address, the APP client retrieves the hybrid test script. Based on the app script within the hybrid test script, the APP client controls the tested app to execute the process corresponding to the app script. Based on the web script within the hybrid test script, the APP client remotely controls the web client corresponding to the first identifier to execute the process corresponding to the web script. Therefore, when the APP client detects that the hybrid test script contains 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 retrieve the hybrid test script based on the storage address to achieve the execution of the hybrid test script, thereby improving the execution efficiency of the hybrid test script.

[0142] Figure 7 This is a schematic diagram of a test script execution device provided in an embodiment of this application. It is configured on the server side, such as... Figure 7 As shown, the execution device for this test script includes:

[0143] The receiving module 701 is used to receive a third message, wherein the third message contains the storage address of the mixed test script;

[0144] The determination module 702 is used to determine the first identifier corresponding to the web client used to execute the hybrid test script and the second identifier corresponding to the 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 contains the storage address and the first identifier.

[0146] In some embodiments, a processing module is further included for:

[0147] Determine the first type supported by the web script and the second type supported by the app script in the mixed test script;

[0148] The IP address of any web client that is in an idle state and is of the same type as the first type is determined as the first identifier;

[0149] 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.

[0150] In some embodiments, the sending module is further configured to:

[0151] Send a startup command to the web client corresponding to the first identifier. The startup command 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 the test running status and / or test results corresponding to the mixed test script;

[0154] The display interface shows the test running status and / or test results.

[0155] In some embodiments, the sending module is further configured to:

[0156] Based on the WebSocket protocol, a shutdown command is sent to the web client, which instructs the web client to shut down the Selenium Grid service.

[0157] In some embodiments, the sending module is further configured to:

[0158] Upon receiving the first instruction from the APP client, a shutdown instruction is sent to the web client based on the WebSocket protocol. The shutdown instruction is used to instruct the web client to shut down the Selenium Grid service.

[0159] It should be noted that the foregoing explanation of the test script execution method embodiment also applies to the test script execution device of this embodiment, and will not be repeated here.

[0160] In this embodiment, the server receives a third message containing the storage address of the hybrid test script. Then, it determines a first identifier corresponding to the web client used to execute the hybrid test script and a second identifier corresponding to the APP client. Finally, it sends a first message to the APP client corresponding to the second identifier, containing the storage address and the first identifier. This allows the server to uniformly schedule the web client and APP client, providing the conditions for the execution of the hybrid test script without being limited by the number of physical machines, thus improving the execution efficiency of the hybrid test script.

[0161] To implement the above embodiments, this application also proposes an APP client, including: a processor and a memory communicatively connected to the processor; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory to implement the method provided in the foregoing embodiments.

[0162] To implement the above embodiments, this application also proposes a server, including: 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 provided in the foregoing embodiments.

[0163] To implement the above embodiments, this application also proposes a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the methods provided in the foregoing embodiments.

[0164] To implement the above embodiments, this application also proposes a computer program product, including a computer program that, when executed by a processor, implements the methods provided in the foregoing embodiments.

[0165] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in this application comply with relevant laws and regulations and do not violate public order and good morals.

[0166] It should be noted that personal information collected from users should be used for legitimate and reasonable purposes and should not be shared or sold outside of these legitimate uses. Furthermore, such collection / sharing should only be conducted after receiving the user's informed consent, including but not limited to notifying the user to read the user agreement / user notice and sign an agreement / authorization that includes authorization of relevant user information before the user uses the function. In addition, any necessary steps must be taken to protect and safeguard access to such personal information data and ensure that others with access to personal information data comply with their privacy policies and procedures.

[0167] This application is intended to provide an implementation scheme for users to selectively prevent the use or access to their personal information data. Specifically, this disclosure is intended to provide hardware and / or software to prevent or block access to such personal information data. Once personal information data is no longer needed, risks can be minimized by restricting data collection and deleting data. Furthermore, where applicable, such personal information is de-identified to protect user privacy.

[0168] In the foregoing descriptions of the embodiments, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0169] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0170] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.

[0171] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

[0172] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0173] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0174] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0175] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.

Claims

1. A method for executing a test script, characterized in that, Executed by the APP client, including the following steps: Receive a first message sent by the server, wherein the first message contains the storage address of the mixed test script and the first identifier of the web client; Based on the storage address, obtain the hybrid test script; Based on the app script in the hybrid test script, the tested app in the APP client is controlled to execute the process corresponding to the app script; Run the web script in the hybrid test script and remotely control the web client corresponding to the first identifier to execute the process corresponding to the web script, wherein the web script is not sent to the web client.

2. The method according to claim 1, characterized in that, Also includes: Upon detecting 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, characterized in that, Also includes: Upon detecting the completion of the hybrid test script, a first instruction is sent to the server based on the WebSocket protocol. This first instruction instructs the server to send a shutdown instruction to the web client, which instructs the web client to shut down the Selenium Grid service.

4. The method according to claim 1, characterized in that, Before running the web script in the hybrid test script and remotely controlling the web client corresponding to the first identifier to execute the process corresponding to the web script, the method further includes: A communication connection is established with the web client based on the Hypertext Transfer Protocol (HTTP) and the first identifier.

5. A method for executing a test script, characterized in that, Executed by the server, including the following steps: Receive a third message, wherein the third message contains the storage address of the mixed test script; Determine the first identifier corresponding to the web client used to execute the hybrid test script, and the second identifier corresponding to the APP client; A first message is sent to the APP client corresponding to the second identifier. The first message contains the storage address and the first identifier. The first message is used to instruct the APP client to obtain the hybrid test script based on the storage address. The APP client runs the app script in the hybrid test script, controls the app under test in the APP client to execute the process corresponding to the app script, and runs the web script in the hybrid test script, remotely controlling the web client corresponding to the first identifier to execute the process corresponding to the web script. The web script is not sent to the web client.

6. The method according to claim 5, characterized in that, The determination of the first identifier corresponding to the web client used to execute the hybrid test script and the second identifier corresponding to the APP client includes: Determine the first type supported by the web script and the second type supported by the app script in the hybrid test script; The IP address corresponding to any web client that is in an idle state and is of the same type as the first identifier is determined as the first identifier; 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.

7. The method according to claim 5, characterized in that, 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 method further includes: A startup command is sent to the web client corresponding to the first identifier, wherein the startup command is used to instruct the web client to start the Selenium Grid service.

8. The method according to claim 7, 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 the test running status and / or test results 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, characterized in that, After receiving the second message sent by the APP client, the method further includes: Based on the WebSocket protocol, a shutdown command is sent to the web client, wherein the shutdown command is used to instruct the web client to shut down the Selenium Grid service.

10. The method according to claim 7, characterized in that, After sending the first message to the APP client corresponding to the second identifier, the method further includes: Upon receiving the first instruction sent by the APP client, 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.

11. A test script execution device, configured on the APP client side, characterized in that, include: The receiving module is used to receive a first message sent by the server, wherein the first message contains the storage address of the mixed test script and the first identifier of the web client; The acquisition module is used to acquire the hybrid test script based on the storage address; The first control module is used to control the app under test in the APP client to execute the process corresponding to the app script based on the app script in the hybrid test script; The second control module is used to run the web script in the hybrid test script and remotely control the web client corresponding to the first identifier to execute the process corresponding to the web script, wherein the web script is not sent to the web client.

12. A test script execution device, configured on the server side, characterized in that, include: A receiving module is used to receive a third message, wherein the third message contains the storage address of the mixed test script; The determination module is used to determine 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 sending module is used to send a first message to the APP client corresponding to the second identifier. The first message contains the storage address and the first identifier. The first message is used to instruct the APP client to obtain the hybrid test script based on the storage address, and to run the app script in the hybrid test script to control the tested app in the APP client to execute the process corresponding to the app script. The APP client also runs the web script in the hybrid test script to remotely control the web client corresponding to the first identifier to execute the process corresponding to the web script. The web script is not sent to the web client.

13. An APP client, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-4.

14. A server, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 5-10.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-10.

Citation Information

Patent Citations

  • Automatic testing method and device for multi-terminal interaction and electronic equipment

    CN115269375A

  • Browser based remote control of functional testing tool

    US20070006036A1