UI Remote Testing Method, Client, Remote Server and System
By introducing a collaborative working mechanism between back-end services and remote servers in the UI automation test platform, the problems of poor testing flexibility, high cost and no remote debugging in the existing technology are solved, and high flexibility and low cost UI remote testing are achieved.
Patent Information
- Application Number
- CN202111107767.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-22
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2041-09-22
AI Technical Summary
The existing UI automation test platform has problems such as poor flexibility, high cost and no remote debugging during the writing and debugging of cases.
Send remote test information to the remote server through the backend service. The remote server executes the test case and suspends the process when it fails, sending exception information to the client. The client modifys the test cases based on exception information and updates the test cases stored in the database through the backend service. The client sends the test case step ID to the remote server, which repacks and continues to execute the test case from the specified steps.
It improves the flexibility and control capabilities of automated testing, reduces testing costs, and realizes the function of UI remote testing.
Smart Images

Figure CN114036037B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of automated testing, and particularly to a UI remote testing method, a client, a remote server and a system. Background Art
[0002] UI automated testing refers to an automated testing method that realizes automated operation and verification in a code manner by simulating the manual operation of the user UI interface. The biggest challenge faced by automated testing is the change of the UI interface. The change of the UI interface will cause the test case execution to fail, so it is necessary to continuously debug the UI automated script.
[0003] In the existing UI automated testing platform, during the process of writing and executing test cases for debugging, when an error occurs in the intermediate step, the test case process stops. The error cause is judged according to the exception information and screenshots returned by the backend, and after modifying the test case and submitting it for execution, it runs from the first step. The debugging cost is high. The existing blocking UI automated script testing tool requires the user to download a debugging tool kit, with high cost; and it must start execution at the error step. If there are problems in the previous steps of the error step during the design of the automated test case, it is impossible to add, delete, or modify the previous steps and then execute any specified step, with poor flexibility. Moreover, the existing UI automated testing does not support remote debugging of UI automated test cases.
[0004] Therefore, how to improve the flexibility and control of automated testing and reduce the cost of automated testing is a challenge for automated testing tools. Summary of the Invention
[0005] To solve the problems in the prior art, the present invention provides a UI remote testing method, a client, a remote server and a system.
[0006] The present invention provides a UI remote testing method, including: sending remote test information to a remote server through a backend service, so that the remote server obtains corresponding test cases from a database according to the remote test information and executes them, and suspends the test process when the execution fails; wherein, the remote test information includes a test case ID; receiving the exception information sent by the remote server through the backend service, modifying the test case according to the exception information, and updating the test case stored in the database through the backend service; sending a test case step ID to the remote server through the backend service, so that the remote server obtains the corresponding test case from the database according to the test case ID, repackages the test case, and then continues to execute the test case from the step corresponding to the test case step ID.
[0007] A UI remote testing method provided by the present invention. After sending remote test information to a remote server through a backend service, the method further includes: receiving synchronous test control information sent by the remote server through the backend service, and synchronously executing the test case with the remote server according to the synchronous test control information.
[0008] The present invention also provides another UI remote testing method, which is applicable to a remote server and includes: receiving remote test information sent by a client through a backend service; wherein, the remote test information includes a test case ID; obtaining a corresponding test case from a database according to the test case ID and executing it; if information indicating that the execution of the test case fails is obtained, obtaining exception information, suspending the test process, and sending the exception information to the client through the backend service; receiving a test case step ID sent by the client through the backend service, obtaining a corresponding test case from the database according to the test case ID, repackaging the test case, and then continuing to execute the test case from the step corresponding to the test case step ID.
[0009] A UI remote testing method provided by the present invention. After receiving remote test information sent by a client through a backend service, the method further includes: sending synchronous test control information to the client through the backend service for the client to synchronously execute the test case.
[0010] The present invention also provides a client, which includes: a test initiation module for: sending remote test information to a remote server through a backend service, so that the remote server obtains a corresponding test case from a database according to the remote test information and executes it, and obtaining exception information and suspending the test process when the execution fails; wherein, the remote test information includes a test case ID; a use case debugging module for: receiving the exception information sent by the remote server through the backend service, modifying the test case according to the exception information, and updating the test case stored in the database through the backend service; a retesting module for: sending a test case step ID to the remote server through the backend service, so that the remote server obtains a corresponding test case from the database according to the test case ID, repackages the test case, and then continues to execute the test case from the step corresponding to the test case step ID.
[0011] The present invention also provides a remote server, which includes: a receiving module, configured to: receive remote test information sent by a client through a backend service; wherein, the remote test information includes a test case ID; an initial test module, configured to: obtain a corresponding test case from a database according to the test case ID and execute it; an exception handling module, configured to: if information indicating that the execution of the test case fails is obtained, obtain exception information, suspend the test process, and send the exception information to the client through the backend service; a re-testing module, configured to: receive a test case step ID sent by the client through the backend service, obtain a corresponding test case from the database according to the test case ID, re-encapsulate the test case, and then continue to execute the test case from the step corresponding to the test case step ID.
[0012] The present invention also provides a UI remote test system, which includes a client and a remote server; wherein: the client is configured to send remote test information to the remote server through a backend service; wherein, the remote test information includes a test case ID; the remote server is configured to obtain a corresponding test case from a database according to the test case ID and execute it, and if information indicating that the execution of the test case fails is obtained, obtain exception information, suspend the test process, and send the exception information to the client through the backend service; the client is further configured to modify the test case according to the exception information, update the test case stored in the database through the backend service, and send a test case step ID to the remote server through the backend service; the remote server is further configured to obtain a corresponding test case from the database according to the test case ID, re-encapsulate the test case, and then continue to execute the test case from the step corresponding to the test case step ID.
[0013] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the program, the steps of any of the above-mentioned UI remote test methods are implemented.
[0014] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the above-mentioned UI remote test methods are implemented.
[0015] The present invention also provides a computer program product, including a computer program / instructions, and when the computer program / instructions are executed by a processor, the steps of any of the above-mentioned UI remote test methods are implemented.
[0016] The UI remote testing method, client, remote server, and system provided by the present invention execute test cases by connecting a remote server via a backend service through the client. After a test case execution fails, the remote server suspends the process and sends an exception message to the client via the backend service. The client modifies the test case based on the exception message and sends the test case step ID for retesting to the remote server via the backend service. The remote server continues to execute the test case based on the test case step ID, realizing UI remote testing, suspending the process after an exception occurs, and continuing to execute the test case based on the specified step, improving flexibility and reducing testing costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] To more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0018] Figure 1 is one of the flow diagrams of the UI remote testing method provided by the present invention;
[0019] Figure 2 is another flow diagram of the UI remote testing method provided by the present invention;
[0020] Figure 3 is yet another flow diagram of the UI remote testing method provided by the present invention;
[0021] Figure 4 is the structural diagram of the client provided by the present invention;
[0022] Figure 5 is the structural diagram of the remote server provided by the present invention;
[0023] Figure 6 is the structural diagram of the UI remote testing system provided by the present invention;
[0024] Figure 7 is the structural diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0025] To make the objectives, technical solutions, and advantages of the present invention clearer, the following will clearly and completely describe the technical solutions in the present invention in conjunction with the drawings in the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments in the present invention fall within the scope of protection of the present invention.
[0026] The following combines Figures 1-7 to describe the UI remote testing method, client, remote server and system of the present invention.
[0027] Figure 1 is one of the flow schematic diagrams of the UI remote testing method provided by the present invention. As Figure 1 shown, the method is applicable to the client, and the method includes:
[0028] Step 101, send remote test information to the remote server through the backend service, so that the remote server can obtain the corresponding test case from the database according to the remote test information and execute it, and obtain the exception information and suspend the test process when the execution fails; wherein, the remote test information includes the test case ID.
[0029] The functions of the client and the backend service can be implemented based on the existing WebUI class automation platform. Among them, the backend service can retain some service support functions for the client in the existing WebUI class automation platform. For example, test cases are edited on the case editing page of the client, and the backend service updates the storage of the test cases in the database according to the changed content of the test cases. In addition, the backend service is also used to build a bridge for the request transmission between the client and the remote server in the UI remote testing provided by the present invention to implement UI remote testing. The backend service can be deployed on the remote server, the client or the intermediate device. To save equipment costs and improve processing speed, the backend service can be deployed on the remote server.
[0030] The client sends remote test information to the remote server through the backend service, wherein the remote test information includes the test case ID. The test case ID is the unique identifier of the test case and is used to distinguish different test cases. The client sends remote test information to the remote server through the backend service, so that the remote server can obtain the corresponding test case from the database according to the test case ID after receiving the remote test information and execute it. The backend service can generate a control instruction for executing the test case corresponding to the test case ID and send the corresponding control instruction to the remote server. This control instruction includes the information of the test case ID. Or, the backend service can directly forward the test case ID to the remote server, and the remote server generates the corresponding instruction according to the test case ID and then executes the corresponding test case.
[0031] The database storing the test cases can be deployed on an independent device. If the test case execution fails, the remote server obtains the exception information and suspends the test process. Suspending the test process can intercept the error step through a decorator. After throwing the exception information, it will not cause the program to exit abnormally.
[0032] Step 102: Receive the exception information sent by the remote server through the backend service, modify the test case according to the exception information, and update the test case stored in the database through the backend service.
[0033] The client receives the exception information sent by the remote server through the backend service. The exception information may include the steps where errors occur and the specific command information executed in each step. The client modifies the test case according to the exception information, and can complete the operations of adding, deleting, and modifying steps through the use case editing page of the UI automation platform. After the modification is completed, the backend service updates the storage information of the test case in the database according to the modified content.
[0034] Step 103: Send the test case step ID to the remote server through the backend service, so that the remote server can obtain the corresponding test case from the database according to the test case ID, repackage the test case, and then continue to execute the test case from the step corresponding to the test case step ID.
[0035] When the remote server fails to execute, it obtains the exception information and suspends the test process. After throwing the exception information, it will not cause the program to exit abnormally, but waits for the client to complete the operations of adding, deleting, and modifying steps on the use case editing page of the UI automation platform. After receiving the test case step ID to be executed, it repackages the use case and continues to execute.
[0036] The client can enter the command line input page by triggering the "Step-by-step Debugging" button, input the test case step ID on the command line input page, and send the test case step ID to the backend service. The backend service can generate a control instruction to execute the step corresponding to the test case step ID according to the test case step ID, and send the corresponding control instruction to the remote server. This control instruction includes the information of the test case step ID. Or, the backend service can directly forward the test case step ID to the remote server, and the remote server generates the corresponding instruction according to the test case step ID and then executes the corresponding step.
[0037] After receiving the test case step ID, the remote server obtains the test case ID that has not been tested yet, obtains the corresponding test case from the database according to the test case ID, repackages the test case, and executes the test case from the step corresponding to the test case step ID.
[0038] If the execution fails again, repeat the above steps 102 and 103. If the execution is successful, the remote server sends a message indicating successful execution to the client through the backend service, and the test ends.
[0039] The UI remote testing method provided by the present invention connects to a remote server through a client via a backend service to execute test cases. After a test case execution fails, the remote server suspends the process and sends an exception message to the client via the backend service. The client modifies the test case according to the exception message and sends the test case step ID for retesting to the remote server via the backend service. The remote server continues to execute the test case based on the test case step ID, realizing UI remote testing, suspending the process after an exception occurs, and continuing to execute the test case based on the specified steps, improving flexibility and reducing testing costs.
[0040] According to a UI remote testing method provided by the present invention, after sending remote test information to the remote server through the backend service, the method further includes: receiving synchronous test control information sent by the remote server through the backend service, and synchronously executing the test case with the remote server according to the synchronous test control information.
[0041] During the testing process, the client can achieve synchronous testing with the remote server to display the corresponding UI test interface of the remote server for testers to observe. By means of seleniumGrid distribution, a hub node and a node proxy node can be registered on the remote server, and a node proxy node can be registered on the client. After receiving the synchronous test information sent by the client through the backend service, the remote server invokes the local node proxy node of the remote server and the node proxy node of the client through the backend service, that is, invokes the local browser of the remote server and the local browser of the client to achieve synchronous execution of test cases by the client and the remote server. Of course, there may be a time difference when the client and the remote server perform UI testing synchronously.
[0042] In addition, the remote server can also send the process information of invoking the local browser of the client to the client. The client can print the received relevant information, including the process information of the remote server invoking the local browser of the client, the specific command information for each step of the test case execution, etc.
[0043] The UI remote testing method provided by the present invention realizes the visualization of remote testing by receiving synchronous test control information sent by the remote server through the backend service after sending remote test information to the remote server through the backend service, and synchronously executing the test case with the remote server according to the synchronous test control information.
[0044] Figure 2 It is the second flow schematic diagram of the UI remote testing method provided by the present invention. As Figure 2 shown, the method includes:
[0045] Step S1: Receive the remote test information sent by the client through the backend service; wherein, the remote test information includes the test case ID.
[0046] The remote server receives the remote test information sent by the client through the backend service; wherein, the remote test information includes the test case ID.
[0047] Step S2: Obtain the corresponding test case from the database according to the test case ID and execute it.
[0048] The remote server obtains the corresponding test case from the database according to the test case ID and executes it.
[0049] Step S3: If the information indicating that the execution of the test case fails is obtained, obtain the exception information, suspend the test process, and send the exception information to the client through the backend service.
[0050] If the remote server obtains the information indicating that the execution of the test case fails, it obtains the exception information, suspends the test process, and sends the exception information to the client through the backend service. The exception information may include the steps where errors occur and the specific command information executed in each step. The remote server can suspend the test process by using a decorator to intercept the error steps. After throwing the exception information, it will not cause the program to exit abnormally.
[0051] Step S4: Receive the test case step ID sent by the client through the backend service, obtain the corresponding test case from the database according to the test case ID, re-encapsulate the test case, and then continue to execute the test case from the step corresponding to the test case step ID.
[0052] After receiving the test case step ID, the remote server obtains the ID of the currently untested test case, obtains the corresponding test case from the database according to the test case ID, re-encapsulates the test case, and executes the test case from the step corresponding to the test case step ID.
[0053] The UI remote test method provided by the present invention connects to the remote server through the client via the backend service to execute the test case. After the execution of the test case fails, the remote server suspends the process and sends the exception information to the client through the backend service. The client modifies the test case according to the exception information and sends the test case step ID for retesting to the remote server through the backend service. The remote server continues to execute the test case according to the test case step ID, realizing the UI remote test, suspending the process after an exception occurs, and continuing to execute the test case based on the specified steps, improving the flexibility and reducing the test cost.
[0054] According to a UI remote testing method provided by the present invention, after receiving remote testing information sent by a backend service at the receiving client, the method further includes: sending synchronous test control information to the client through the backend service for the client to synchronously execute the test cases.
[0055] During the testing process, the client can achieve synchronous testing with the remote server to display the corresponding UI testing interface of the remote server for testers to observe. By means of seleniumGrid distribution, a hub node and node proxy nodes can be registered on the remote server, and node proxy nodes can be registered on the client. After the remote server receives the synchronous testing information sent by the client through the backend service, it invokes the node proxy node on the local remote server and the node proxy node on the client through the backend service, that is, invokes the browser on the local remote server and the local browser on the client to achieve synchronous execution of test cases by the client and the remote server. Of course, there can be a time difference when the client and the remote server perform UI testing synchronously.
[0056] In addition, the remote server can also send the process information of invoking the local browser of the client to the client.
[0057] The UI remote testing method provided by the present invention realizes the visualization of remote testing by sending synchronous test control information to the client through the backend service after receiving the remote testing information sent by the client through the backend service for the client to synchronously execute the test cases.
[0058] Figure 3 It is the third flow schematic diagram of the UI remote testing method provided by the present invention. As Figure 3 shown, a Python Django framework + Mysql is selected to develop a WebUI-based automated management platform. The instant communication between the client and the remote server uses websocket + paramiko to build a request transmission bridge. Websocket communication is adopted between the client and the Django backend (providing the backend service). Communication is established between the Django backend and the remote server through a paramiko ssh channel. Among them, the client performs related operations based on a Web browser. As Figure 3 shown, it simulates the interface corresponding to the terminal, that is, a command-line input interface (which can be represented as Xterm, or also called a terminal interface or a simulated terminal, virtual terminal) for inputting information such as test case step IDs. The client modifies the test cases on the use case editing page and sends the relevant information to the Django backend in the form of an http request after the modification is completed.
[0059] As Figure 3As shown in the figure, the UI remote testing method provided by the present invention includes:
[0060] Establish communication connections between the client and the Django backend, and between the Django backend and the remote server. The client sends a request to invoke the remote server to the Django backend through the websocket channel via a web browser. The request for the remote server includes remote testing information, and the remote testing information includes a test case ID. The Django backend forwards the request for the remote server to the remote server through the paramiko ssh channel. After receiving the request to invoke the remote server, the remote server invokes the local browser of the client according to the node proxy node registered by the client, so that the client and the remote server perform synchronous testing and display the corresponding UI test interface.
[0061] The remote server obtains the corresponding test case according to the test case ID in the remote testing information and executes the test. If an exception occurs during the execution process, the exception information is obtained, and the exception is intercepted through a decorator, and the test process is suspended, waiting for the client to modify and obtain the latest steps. The remote server feeds back the exception information to the client through the Django backend. The exception information includes the steps where the exception occurred. The client modifies the case steps on the case editing page according to the exception information, and after the modification is completed, sends an http request to the Django backend to request the Django backend to update the test cases stored in the database. On the command line input page, enter the test case step ID, and send the test case step ID to the Django backend. The Django backend generates a control instruction to execute the corresponding step according to the test case step ID and sends it to the remote server. After receiving the control instruction to execute the corresponding step, the remote server obtains the corresponding test case according to the test case ID, repackages the test case, and starts executing the test case from the step corresponding to the test case step ID.
[0062] If the execution fails, repeat the above process for handling the exception information. If all steps are executed successfully, the message of successful execution is fed back to the client through the Django backend, and the connections between the client and the Django backend, and between the Django backend and the remote server are closed.
[0063] The requests from the client to invoke the remote server and the test case step IDs are sent to the Django backend via WebSocket. Among them, the request to invoke the remote server is a request to connect to the remote server and start testing a certain test case. When the client sends the test case step ID to the Django backend, it is actually in the debugging phase when a failure occurs during the testing process of a certain test case, and the request is to start executing the test case from the step corresponding to the test case step ID. After receiving the request from the client to invoke the remote server, the Django backend determines whether the connection to the remote server is successful. If it is not successful, it throws an information of connection exception. If it is successful, the Django backend determines whether to initiate testing or perform use case debugging according to the type of information received from the client (the request to invoke the remote server or the test case step ID). If the received information is the request to invoke the remote server, it connects to the remote server to execute the test case and listens to the return information from the remote server. If the received information is the test case step ID, it transmits the instruction to execute the test case step ID to the remote server, so that the remote server executes the test case from the step corresponding to the test case step ID and listens to the return information.
[0064] The UI remote testing method provided by the present invention is developed based on the Python Django framework + Mysql to support the functions of quickly locating problems and debugging for WebUI - type automation platforms. It utilizes Selenium Grid distribution to enable the remote server to invoke the local browser of the client when executing use cases. It builds an instant communication between the client and the remote server through WebSocket + Paramiko, and uses a decorator to intercept error steps and re - encapsulate the use cases after modification to achieve the single - step debugging function of use cases (the test case can be executed from the specified step). This method can retain the error scene of the browser when executing UI automation use cases, and the front - end page edits and saves the error steps, flexibly supporting users to input the step ID they want to re - execute in the terminal debugging page, which is more flexible. This technical method is compatible with the existing Automagic - type webUI automation management platform.
[0065] The client, remote server, and UI remote testing system provided by the present invention are described below. The client, remote server, and UI remote testing system described below can be correspondingly referred to the UI remote testing method described above.
[0066] Figure 4 is a schematic structural diagram of the client provided by the present invention. As Figure 4As shown in the figure, the client 1 includes a test initiation module 10, a test case debugging module 20, and a retest module 30, where: The test initiation module 10 is configured to: send remote test information to a remote server through a backend service, so that the remote server can obtain corresponding test cases from a database according to the remote test information and execute them, and obtain exception information and suspend the test process when the execution fails; where the remote test information includes a test case ID; The test case debugging module 20 is configured to: receive the exception information sent by the remote server through the backend service, modify the test case according to the exception information, and update the test case stored in the database through the backend service; The retest module 30 is configured to: send a test case step ID to the remote server through the backend service, so that the remote server can obtain the corresponding test case from the database according to the test case ID, repackage the test case, and then continue to execute the test case from the step corresponding to the test case step ID.
[0067] The client provided by the present invention connects to a remote server through a backend service via the client to execute test cases. When the execution of the test case fails, the remote server suspends the process and sends exception information to the client through the backend service. The client modifies the test case according to the exception information and sends the test case step ID for retesting to the remote server through the backend service. The remote server continues to execute the test case according to the test case step ID, realizing UI remote testing, suspending the process when an exception occurs, and continuing to execute the test case based on the specified steps, improving flexibility and reducing test costs.
[0068] According to a client provided by the present invention, the client 1 further includes a synchronous test module. After the test initiation module 10 sends remote test information to the remote server through the backend service, the synchronous test module is configured to: receive synchronous test control information sent by the remote server through the backend service and synchronously execute the test case with the remote server according to the synchronous test control information.
[0069] The client provided by the present invention realizes the visualization of remote testing by receiving synchronous test control information sent by the remote server through the backend service after sending remote test information to the remote server through the backend service and synchronously executing the test case with the remote server according to the synchronous test control information.
[0070] Figure 5 is a schematic structural diagram of the remote server provided by the present invention. As Figure 5As shown in the figure, the remote server 2 includes a receiving module 100, an initial test module 200, an exception handling module 300, and a re-testing module 400, where: The receiving module 100 is configured to: receive remote test information sent by the client through the backend service; wherein, the remote test information includes a test case ID; The initial test module 200 is configured to: obtain the corresponding test case from the database according to the test case ID and execute it; The exception handling module 300 is configured to: if the information indicating that the test case execution fails is obtained, obtain the exception information, suspend the test process, and send the exception information to the client through the backend service; The re-testing module 400 is configured to: receive the test case step ID sent by the client through the backend service, obtain the corresponding test case from the database according to the test case ID, re-encapsulate the test case, and then continue to execute the test case from the step corresponding to the test case step ID.
[0071] The remote server provided by the present invention connects to the remote server through the client via the backend service to execute test cases. After the test case execution fails, the remote server suspends the process and sends the exception information to the client via the backend service. The client modifies the test case according to the exception information and sends the test case step ID for re-testing to the remote server via the backend service. The remote server continues to execute the test case according to the test case step ID, realizing UI remote testing, suspending the process after an exception occurs, and continuing to execute the test case based on the specified steps, improving flexibility and reducing test costs.
[0072] According to a remote server provided by the present invention, the remote server 3 further includes a synchronous test control module. After the receiving module 100 receives the remote test information sent by the client through the backend service, the synchronous test control module is configured to: send synchronous test control information to the client through the backend service for the client to synchronously execute the test case.
[0073] The remote server provided by the present invention realizes the visualization of remote testing by sending synchronous test control information to the client through the backend service after receiving the remote test information sent by the client through the backend service for the client to synchronously execute the test case.
[0074] Figure 6 It is a schematic structural diagram of the UI remote testing system provided by the present invention. As Figure 6As shown in the figure, the UI remote test system includes a client 1 and a remote server 2. Among them: the client 1 is used to send remote test information to the remote server 2 through the backend service. Among them, the remote test information includes a test case ID. The remote server 2 is used to obtain the corresponding test case from the database according to the test case ID and execute it. If the information indicating that the test case execution fails is obtained, abnormal information is obtained, the test process is suspended, and the abnormal information is sent to the client 1 through the backend service. The client 1 is also used to modify the test case according to the abnormal information, update the test case stored in the database through the backend service, and send the test case step ID to the remote server 2 through the backend service. The remote server 2 is also used to obtain the corresponding test case from the database according to the test case ID, re-encapsulate the test case, and then continue to execute the test case from the step corresponding to the test case step ID.
[0075] The UI remote test system provided by the present invention connects to a remote server through a client via a backend service to execute a test case. After the test case execution fails, the remote server suspends the process and sends abnormal information to the client via the backend service. The client modifies the test case according to the abnormal information and sends the test case step ID for re-testing to the remote server via the backend service. The remote server continues to execute the test case according to the test case step ID, realizing UI remote testing, suspending the process when an abnormality occurs, and continuing to execute the test case based on the specified steps, improving flexibility and reducing test costs.
[0076] Figure 7 An example of the entity structure diagram of an electronic device is shown in Figure 7As shown in the figure, the electronic device may include: a processor 710, a communications interface 720, a memory 730, and a communication bus 740. Among them, the processor 710, the communications interface 720, and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call logic instructions in the memory 730 to execute the UI remote test method, which includes: sending remote test information to a remote server through a backend service for the remote server to obtain corresponding test cases from a database according to the remote test information and execute them, and obtaining exception information and suspending the test process when the execution fails; where the remote test information includes a test case ID; receiving the exception information sent by the remote server through the backend service, modifying the test case according to the exception information, and updating the test case stored in the database through the backend service; sending a test case step ID to the remote server through the backend service for the remote server to obtain the corresponding test case from the database according to the test case ID, re-encapsulating the test case, and then continuing to execute the test case from the step corresponding to the test case step ID; or the method includes: receiving remote test information sent by a client through a backend service; where the remote test information includes a test case ID; obtaining the corresponding test case from the database according to the test case ID and executing it; if information indicating that the execution of the test case fails is obtained, obtaining exception information, suspending the test process, and sending the exception information to the client through the backend service; receiving the test case step ID sent by the client through the backend service, obtaining the corresponding test case from the database according to the test case ID, re-encapsulating the test case, and then continuing to execute the test case from the step corresponding to the test case step ID.
[0077] In addition, when the logical instructions in the above-mentioned memory 730 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.
[0078] On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the UI remote testing method provided by the above-mentioned various methods. The method includes: sending remote test information to a remote server through a backend service for the remote server to obtain corresponding test cases from a database according to the remote test information and execute them, and obtaining exception information and suspending the test process when the execution fails; wherein the remote test information includes a test case ID; receiving the exception information sent by the remote server through the backend service, modifying the test case according to the exception information, and updating the test case stored in the database through the backend service; sending a test case step ID to the remote server through the backend service for the remote server to obtain the corresponding test case from the database according to the test case ID, re-encapsulating the test case, and then continuing to execute the test case from the step corresponding to the test case step ID; or the method includes: receiving remote test information sent by a client through a backend service; wherein the remote test information includes a test case ID; obtaining the corresponding test case from the database according to the test case ID and executing it; if information indicating that the execution of the test case fails is obtained, obtaining exception information, suspending the test process, and sending the exception information to the client through the backend service; receiving the test case step ID sent by the client through the backend service, obtaining the corresponding test case from the database according to the test case ID, re-encapsulating the test case, and then continuing to execute the test case from the step corresponding to the test case step ID.
[0079] In another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the UI remote test method provided above. The method includes: sending remote test information to a remote server through a backend service, so that the remote server can obtain a corresponding test case from a database according to the remote test information and execute it. When the execution fails, obtain exception information and suspend the test process; wherein, the remote test information includes a test case ID; receive the exception information sent by the remote server through the backend service, modify the test case according to the exception information, and update the test case stored in the database through the backend service; send a test case step ID to the remote server through the backend service, so that the remote server can obtain a corresponding test case from the database according to the test case ID, repackage the test case, and then continue to execute the test case from the step corresponding to the test case step ID; or the method includes: receiving remote test information sent by a client through a backend service; wherein, the remote test information includes a test case ID; obtain a corresponding test case from the database according to the test case ID and execute it; if information indicating that the execution of the test case fails is obtained, obtain exception information, suspend the test process, and send the exception information to the client through the backend service; receive the test case step ID sent by the client through the backend service, obtain a corresponding test case from the database according to the test case ID, repackage the test case, and then continue to execute the test case from the step corresponding to the test case step ID.
[0080] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative labor.
[0081] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0082] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A UI remote testing method, characterized in that, Including: Step 101: Send remote test information to a remote server through a backend service, so that the remote server can obtain corresponding test cases from a database according to the remote test information and execute them. When the execution fails, obtain exception information and suspend the test process; wherein, the remote test information includes a test case ID. Step 102: Receive the exception information sent by the remote server through the backend service, modify the test case according to the exception information, and update the test case stored in the database through the backend service; wherein, the modification of the test case includes performing addition, deletion, and modification operations on steps through a use case editing page. Step 103: Enter a command line input page by triggering the "single-step debugging" button, input a test case step ID on the command line input page, and send the test case step ID to the remote server through the backend service, so that the remote server can obtain the corresponding test case from the database according to the test case ID, re-encapsulate the test case, and then continue to execute the test case starting from the step corresponding to the test case step ID. Step 104: If the execution of the test case fails when continuing to execute from the step corresponding to the test case step ID, repeat the above Step 102 and Step 103. If the execution is successful, the test ends.
2. The UI remote testing method according to claim 1, wherein After sending the remote test information to the remote server through the backend service, the method further includes: Receiving synchronous test control information sent by the remote server through the backend service, and synchronously executing the test case with the remote server according to the synchronous test control information.
3. A UI remote testing method, characterized in that, Including: Step S1: Receive remote test information sent by a client through a backend service; wherein, the remote test information includes a test case ID. Step S2: Obtain the corresponding test case from the database according to the test case ID and execute it. Step S3: If information indicating that the execution of the test case fails is obtained, obtain exception information, suspend the test process, and send the exception information to the client through the backend service, so that the client can modify the test case according to the exception information and update the test case stored in the database through the backend service; wherein, the modification of the test case includes performing addition, deletion, and modification operations on steps through a use case editing page. Step S4: Receive the test case step ID sent by the client through the backend service, obtain the corresponding test case from the database according to the test case ID, re-encapsulate the test case, and then continue to execute the test case starting from the step corresponding to the test case step ID; wherein, the test case step ID is input on the command line input page when the client enters the command line input page by triggering the "single-step debugging" button. Step S5: If the execution of the test case fails when continuing to execute from the step corresponding to the test case step ID, repeat the above Step S3 and Step S4. If the execution is successful, the test ends.
4. The UI remote testing method according to claim 3, wherein After the receiving client sends the remote test information sent by the backend service, the method further includes: Sending synchronization test control information to the client through the backend service for the client to synchronously execute the test case.
5. A client, characterized in that, Including: A test initiation module, configured to: send remote test information to a remote server through a backend service for the remote server to obtain a corresponding test case from a database according to the remote test information and execute it, and obtain exception information and suspend the test process when the execution fails; wherein, the remote test information includes a test case ID; A use case debugging module, configured to: receive the exception information sent by the remote server through the backend service, modify the test case according to the exception information, and update the test case stored in the database through the backend service; wherein, the modification of the test case includes performing addition, deletion, and modification operations on steps through a use case editing page; A retest module, configured to: enter a command line input page by triggering a "single-step debugging" button, input a test case step ID on the command line input page, and send the test case step ID to the remote server through the backend service for the remote server to obtain a corresponding test case from the database according to the test case ID, repackage the test case, and then continue to execute the test case starting from the step corresponding to the test case step ID; An iterative test module, configured to: if the execution of the test case continues to fail starting from the step corresponding to the test case step ID, repeat the execution steps of the use case debugging module and the retest module; if the execution is successful, the test ends.
6. A remote server, characterized in that, Including: A receiving module, configured to: receive remote test information sent by a client through a backend service; wherein, the remote test information includes a test case ID; An initial test module, configured to: obtain a corresponding test case from a database according to the test case ID and execute it; An exception handling module, configured to: if information indicating that the execution of the test case fails is obtained, obtain exception information, suspend the test process, and send the exception information to the client through the backend service for the client to modify the test case according to the exception information and update the test case stored in the database through the backend service; wherein, the modification of the test case includes performing addition, deletion, and modification operations on steps through a use case editing page; A re-test module, configured to: receive the test case step ID sent by the client through the backend service, obtain a corresponding test case from the database according to the test case ID, repackage the test case, and then continue to execute the test case starting from the step corresponding to the test case step ID; wherein, the test case step ID is input by the client on a command line input page entered by triggering a "single-step debugging" button; A loop test module, configured to: if the execution of the test case fails when continuing from the step corresponding to the test case step ID, repeat the execution steps of the exception handling module and the retest module; if the execution is successful, the test ends.
7. A UI remote test system, characterized in that, It includes a client and a remote server; wherein: The client is used to send remote test information to the remote server through the backend service; wherein, the remote test information includes a test case ID. The remote server is used to obtain the corresponding test case from the database according to the test case ID and execute it. If the information indicating that the execution of the test case fails is obtained, exception information is obtained, the test process is suspended, and the exception information is sent to the client through the backend service. The client is further used to modify the test case according to the exception information, update the test case stored in the database through the backend service, enter the command line input page by triggering the "single-step debugging" button, input the test case step ID on the command line input page, and send the test case step ID to the remote server through the backend service; wherein, modifying the test case includes performing operations of adding, deleting, and modifying steps through the use case editing page. The remote server is further used to obtain the corresponding test case from the database according to the test case ID, re-encapsulate the test case, and then continue to execute the test case starting from the step corresponding to the test case step ID; if the execution of the test case fails when continuing from the step corresponding to the test case step ID, repeat the execution steps of the client for modifying the test case according to the exception information, updating the test case stored in the database through the backend service, entering the command line input page by triggering the "single-step debugging" button, inputting the test case step ID on the command line input page, and sending the test case step ID to the remote server, and the execution steps of the remote server for obtaining the corresponding test case from the database according to the test case ID, re-encapsulating the test case, and then continuing to execute the test case starting from the step corresponding to the test case step ID.
8. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the UI remote test method according to any one of claims 1 to 4.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the UI remote test method according to any one of claims 1 to 4.
10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, it implements the steps of the UI remote test method according to any one of claims 1 to 4.
Citation Information
Patent Citations
A method and apparatus for phase test
CN109189690A
Blocking type debugging method and debugging tool for UI automatic script
CN109857642A
Test service platform, electronic equipment and test service method
CN112749087A
Test method, related device and computer medium
CN113282483A
Method and device for automatic testing of vehicle
CN113419943A