[go: up one dir, main page]

CN113326183B - UI testing method, electronic device and storage medium - Google Patents

UI testing method, electronic device and storage medium Download PDF

Info

Publication number
CN113326183B
CN113326183B CN202110485718.4A CN202110485718A CN113326183B CN 113326183 B CN113326183 B CN 113326183B CN 202110485718 A CN202110485718 A CN 202110485718A CN 113326183 B CN113326183 B CN 113326183B
Authority
CN
China
Prior art keywords
test
connection
client
server
instruction server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110485718.4A
Other languages
Chinese (zh)
Other versions
CN113326183A (en
Inventor
邢晓菲
郑雷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hefei Yirui Communication Technology Co Ltd
Original Assignee
Hefei Yirui Communication Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hefei Yirui Communication Technology Co Ltd filed Critical Hefei Yirui Communication Technology Co Ltd
Priority to CN202110485718.4A priority Critical patent/CN113326183B/en
Publication of CN113326183A publication Critical patent/CN113326183A/en
Application granted granted Critical
Publication of CN113326183B publication Critical patent/CN113326183B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention relates to the field of testing and discloses a UI testing method, electronic equipment and a storage medium. The UI testing method is applied to a client of the UI automation testing tool and comprises the steps of sending a testing request of a UI element to a connected instruction server according to a testing script, receiving a testing result message which is returned by the instruction server and indicates a UI testing result, wherein the testing result message comprises any one of a testing success message and a testing failure message, checking whether the connection with the instruction server is normal or not after receiving the testing failure message, judging that the UI element fails to test and tests the next UI element if the connection is normal, and reconnecting with the instruction server and retesting the UI element if the connection is abnormal. The UI testing method can reduce the workload of UI testing and improve the efficiency of UI testing.

Description

UI testing method, electronic device and storage medium
Technical Field
The embodiment of the invention relates to the field of testing, in particular to a UI testing method, electronic equipment and a storage medium.
Background
A User Interface (UI) is a medium for interaction and exchange of information between a system and a User, which enables conversion between an internal form of information and a human-acceptable form. The user interface test, namely the UI test, is used for testing whether the layout of the functional modules of the user interface is reasonable, whether the overall style is consistent with the placement positions of all the controls, whether the placement positions of all the controls accord with the use habit of a customer, more importantly, the user interface test is convenient to operate, the navigation is simple and easy to understand, whether the characters in the interface are correct, the naming is uniform, the page is attractive, the combination of the characters and the pictures is perfect, and the like.
In the related UI test, an automatic test tool is used for realizing the UI automatic test. The automatic testing tool is provided with an instruction server and a client, the client is connected with the instruction server, a test script imported by the client is transmitted to the instruction server through a connection interface, the instruction server performs positioning and testing of each UI element, and positioning and testing result information is returned to the client.
However, the related UI test method has the problems that in order to explore the cause of UI element test failure, a tester can only manually repeat UI test to find the cause of the test failure, so that the UI test workload is large and the efficiency is low.
Disclosure of Invention
The embodiment of the invention aims to provide a UI testing method, electronic equipment and a storage medium, which can reduce UI testing workload and improve UI testing efficiency.
In order to solve the technical problems, the embodiment of the invention provides a UI test method which is applied to a client of an UI automation test tool, wherein the automation test tool is provided with an instruction server and a client, the instruction server is connected with the client through a first port, the instruction server is connected with the UI test tool of a mobile terminal through a second port, the client sends a test request to the instruction server, the instruction server sends a test instruction to the UI test tool of the mobile terminal according to the test request, the UI test tool of the mobile terminal receives the test instruction, UI tests according to the test instruction and returns a UI test result to a server, the instruction server returns the received UI test result to the client, the method comprises the steps of sending the test request of the UI element to the connected instruction server according to a test script, receiving a test result message which indicates the UI test result and is returned by the instruction server, wherein the test result message comprises any one of a test success message and a test failure message, after the test failure message is received, checking whether the connection with the instruction server is normal, if the connection is normal, judging that the UI element test fails, testing the next UI element is tested, if the connection is abnormal, and the UI element is reconnected with the instruction server.
The embodiment of the invention also provides electronic equipment, which comprises at least one processor, a memory in communication with the at least one processor, and instructions which can be executed by the at least one processor and are stored in the memory, so that the at least one processor can execute the UI testing method.
The embodiment of the invention also provides a computer readable storage medium which stores a computer program, and the computer program realizes the UI test method when being executed by a processor.
Compared with the prior art, the method and the device have the advantages that the client side sends the test command of the UI element to the instruction server according to the test script, receives the test result message returned by the instruction server, checks whether the connection with the instruction server is normal after receiving the test failure message returned by the instruction server, judges that the UI element fails to test, tests the next UI element if the connection is abnormal, reconnects with the instruction server and retests the UI element, and can cause the UI element test failure due to the fact that the test code of the UI element in the test script is wrongly written and the connection between the client side of the automatic test tool and the instruction server is abnormal, therefore, when the test fails, the client side and the instruction server are reconnected and tested, whether the connection problem between the client side and the instruction server causes the test failure can be automatically checked, the test is not needed to be repeated manually by a tester, the test failure reason is searched, the workload of UI test is reduced, and the UI test efficiency is improved.
In addition, whether the connection with the instruction server is normal is checked, and the method comprises the steps of connecting with a pre-established detection process through a socket, indicating the detection process to return the connection information of the instruction server, acquiring the connection information, judging whether the connection is normal according to the connection information, wherein the detection process is pre-established and used for starting the instruction server, acquiring the connection information and sending the connection information to a client. The client is connected with the socket of the pre-established detection process, the detection process acquires the connection information and sends the connection information to the client, the client can acquire the connection abnormality when the connection between the client and the instruction server is abnormal, the socket is an inter-process communication mode of the face-to-face network, as long as the network exists, the socket can span any limit, the inter-process communication under various conditions can be realized, and the reliability of the connection can be ensured by utilizing the socket for communication.
In addition, the connection information comprises whether the first port is in a monitoring state or not, judging whether the connection is normal or not according to the connection information, wherein the judging of the connection is normal if the first port is in the monitoring state, the judging of the connection is abnormal if the first port is in an idle state, and the judging of the connection is also comprising the step of indicating a detection process to send a restarting instruction server before reconnecting with the instruction server. When the connection port is in abnormal connection, the detection process is instructed to restart the instruction server, the detection process is reconnected with the instruction server, and the UI element is retested, so that the possibility that the client is normally connected with the instruction server after reconnection can be improved, retested times are reduced, UI test workload is reduced, and UI test efficiency is improved.
In addition, after receiving the test result message returned by the instruction server, the method also comprises the steps of recording the times of the received test failure message, and before checking whether the connection with the server is normal, confirming that the UI element is the first test failure. The client only checks whether the connection with the instruction server is normal when the UI element fails to be tested for the first time, and because the probability that the client is unavailable for being connected with the instruction server twice continuously is low, the client checks whether the connection with the instruction server is normal when the UI element fails to be tested for the first time, so that the calculation resources and the testing time can be saved, and the UI testing efficiency is improved.
Drawings
One or more embodiments are illustrated by way of example and not limitation in the figures of the accompanying drawings, in which like references indicate similar elements, and in which the figures of the drawings are not to be taken in a limiting sense, unless otherwise indicated.
FIG. 1 is a flow chart of a UI testing method provided in accordance with one embodiment of the invention;
FIG. 2 is a flow chart of UI element positioning using a UI testing method provided in accordance with one embodiment of the invention;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the following detailed description of the embodiments of the present application will be given with reference to the accompanying drawings. However, those of ordinary skill in the art will understand that in various embodiments of the present application, numerous technical details have been set forth in order to provide a better understanding of the present application. The claimed application may be practiced without these specific details and with various changes and modifications based on the following embodiments. The following embodiments are divided for convenience of description, and should not be construed as limiting the specific implementation of the present application, and the embodiments can be mutually combined and referred to without contradiction.
The embodiment of the invention relates to a UI test method which is applied to a client, and the specific flow is shown in figure 1:
Step 101, sending a test request of a UI element to a connected instruction server according to a test script, and receiving a test result message which is returned by the instruction server and indicates a UI test result, wherein the test result message comprises any one of a test success message and a test failure message;
step 102, after receiving a test failure message returned by the instruction server, checking whether the connection with the instruction server is normal;
Step 103, if the connection is normal, judging that the UI element test fails, testing the next UI element, and if the connection is abnormal, reconnecting with the instruction server and retesting the UI element.
The UI testing method of the embodiment is applied to the client of the UI automation testing software. The automatic testing tool is provided with an instruction server and a client, the instruction server is connected with the client through a first port, the instruction server is connected with the mobile terminal UI testing tool through a second port, the client sends a testing request to the instruction server, the instruction server sends a testing instruction to the mobile terminal UI testing tool according to the testing request, the mobile terminal UI testing tool receives the testing instruction, UI tests according to the testing instruction, returns a UI testing result to the server, the instruction server returns the received UI testing result to the client, and all UI elements are tested in sequence. In this embodiment, taking the use of automated test software Appium supporting multiple languages as an example, appium is an automated test tool, which supports native applications, web applications, and hybrid applications on iOS platforms and Android platforms. Appium employs a Client-Client (C/S) architecture, including a Client and a Client Server. Depending on the programming language of the test script, appium clients may be installed in different integrated development environments, such as IntelliJ IDEA, eclipse, etc., depending on the different programming languages used. If the test script, i.e., the test code, is written using the Python language, the client may be installed in the Python language development environment PyCharm. The command server Appium-server is connected with the Python-Appium-client, namely the client through a 4723 port, a tester imports a test script to the client, and the client sends a test command of the UI elements to the command server according to the test script, receives a test result message returned by the command server, and sequentially tests all the UI elements.
According to the UI test method of the embodiment, the client sends a test command of the UI element to the instruction server according to the test script, receives a test result message returned by the instruction server, and after receiving a test failure message returned by the instruction server, checks whether the connection with the instruction server is normal, if the connection is normal, judges that the test of the UI element fails, tests the next UI element, and if the connection is abnormal, reconnects with the instruction server and retests the UI element.
Implementation details of the UI test method of the present embodiment are specifically described below, and the following is merely implementation details provided for convenience of understanding, and is not necessary to implement the present embodiment.
In step 101, the client needs to establish a connection with the instruction server in advance, and log in to the instruction server. Taking Appium as an example, the Appium instruction server is an HTTP instruction server realized based on node. Js, and is connected with the Appium client through a Web interface, and when in UI test, the Appium client initiates connection, and the Appium instruction server accepts connection. Specifically, appium client requests Appium to instruct server to create a session, appium client sends request to Appium instruct server through HTTP in the session after session creation is completed, appium instructs server to parse request, and returns test result message to Appium client through session. After the connection is established with the Appium client, appium instructs the server to monitor the UI element test request sent from the Appium client, sends the UI element test request to an acceptance program boottrap. Jar or boottrap. Js on the mobile phone, and the acceptance program converts the request into a command that the mobile terminal UI test tool can execute the UI element test, and sends the command to the mobile terminal UI test tool to execute. The boottrap. Jar is an application program running on the Android mobile phone, and the boottrap. Js is an application program running on the IOS mobile phone and plays a role of a TCP instruction server on the mobile phone. In this embodiment, an Android mobile phone is taken as an example to describe the present embodiment, when Appium instructs a server to execute a command, the Appium instructs the server to establish TCP communication with a boottrap. Jar through 4724 port, and sends the command to the boottrap. Jar, and the boottrap. Jar monitors 4724 port to obtain a command sent by the Appium instruction server, and converts the command into a command that can be identified by the mobile UI test tool UiAutomator and sends the command to UiAutomator for execution, uiAutomator is the UI test tool of the Android mobile phone, and then the boottrap. Jar returns an execution result to the Appium instruction server, and then Appium instructs the server to feedback a test result message of a test request sent by the Appium client to the Appium client through HTTP response, so that the Appium client can receive the test result message returned by the Appium instruction server. The test result message may be a test success or a test failure. The mobile terminal UI test tool may be installed in a mobile terminal device, such as a mobile phone, or a virtual mobile terminal device, such as an android virtual machine on a PC terminal.
In step 102, after receiving Appium the test failure message returned by the command server at Appium client, it is immediately checked whether the connection with the command server is normal. For example, communication between Appium clients and Appium instruction servers may be by way of shared memory or named pipes, etc.
In one example, after receiving the test failure message returned by the instruction server, the Appium client also records the number of times of test failure messages of the UI element, and the Appium client may record the number of times of test failure messages of the UI element by using a test variable, and when the Appium client receives the current test failure message of the UI element once, the value of the test variable is increased by 1. When the tested UI element is changed, the value of the test variable is also changed to 0, and the number of times of test failure information is calculated for the new UI element. Before checking if the connection with the instruction server is normal, appium client also confirms that this UI element is the first test failure, i.e. the value of the test variable is 1. If the UI element fails the non-first test, the UI element is determined to fail the test.
In this embodiment, the Appium client only checks whether the connection with the Appium instruction server is normal when the UI element fails to test for the first time, and because the probability that the Appium client is unavailable for connection with the Appium instruction server twice continuously is low, checking whether the connection with the Appium instruction server is normal when the UI element fails to test for the first time can save computing resources and test time, and improve UI test efficiency.
In one example, appium client may also send a command to Appium to instruct server, instruct Appium to instruct server how to answer, and check if the connection is normal. If Appium instructs the server to answer within the preset time, the connection between the Appium client and the Appium instruction server is judged to be normal, and if Appium instructs the server to answer within the preset time, the connection between the Appium client and the Appium instruction server is judged to be abnormal.
In one example, appium the client is further connected with a pre-created detection process through a socket, and instructs the detection process to return the connection information of the instruction server, obtain the connection information, and determine whether the connection is normal according to the connection information, wherein the detection process is pre-established for starting the instruction server, obtaining the connection information, and sending the connection information to the client. For example, a user datagram protocol (User Datagram Protocol, abbreviated as "UDP") connection may be established between the client and the detection process, with the client socket sending a UDP datagram to the detection process socket indicating that the detection process returns an instruction server connection information. After the detection process receives the indication of the client socket, the detection process acquires the connection information of the instruction server and returns the connection information to the client socket in the form of UDP datagram. And Appium, the connection information received by the client is judged whether the connection is normal or not according to the connection information, wherein the socket of the client is pre-established, the life cycle of the socket of the client can be the same as that of the Appium client, the socket of the detection process is pre-established, the life cycle of the socket of the detection process can be the same as that of the detection process, the socket of the detection process is used for acquiring the connection information and transmitting the connection information to the socket of the client, and the detection process starts the instruction server after the socket of the client is established.
Specifically, the instruction server connection information may be whether or not a connection port (default 4723 port) of the instruction server and the client is in a listening state. If the connection port is in the listening state, appium the client determines that the connection between the instruction server and the client is normal, and if the connection port is in the idle state, appium the client determines that the connection between the instruction server and the client is abnormal.
In one example, appium the client, when connecting with the pre-created detection process through the socket, will create a connection between the client socket and the pre-created server socket in the detection process, and Appium the client disconnects the client socket from the server socket and closes the client socket after determining that the UI element test fails or after reconnecting with the command server and retesting the UI element.
In this embodiment, the Appium client creates the client socket immediately, and after determining that the UI element fails to test or reconnects with the instruction server and retests the UI element, the client socket is closed, that is, when Appium client and Appium instruction server need to communicate, the client socket is created and connected with the server socket, so that communication resources can be saved.
In one example, the connection established between the client socket and the service socket is a transmission control protocol (Transmission Control Protocol, abbreviated as "TCP") connection, and the TCP connection uses a three-way handshake protocol to establish the connection, so that an erroneous connection can be prevented, and the connection-oriented reliable connection mode can ensure the correctness of transmission.
In step 103, if the connection between the Appium client and the Appium instruction server is normal, the Appium client determines that the UI element test fails, tests the next UI element, and if the connection between the Appium client and the Appium instruction server is abnormal, the Appium client and the Appium instruction server reconnect and retest the UI element.
Specifically, the Appium client may close the created session, again sending a session creation request to the Appium instruction server, creating a new session, sending a test request through the new session, and instructing the server to retest the UI element with Appium. If Appium client determines that the UI element fails to test, the test code of the UI element may be marked in the test script display interface of Appium for the tester to quickly locate the error code.
In one example, appium the client is connected to a pre-created detection process through a socket, the detection process is pre-established, and is used for starting Appium the instruction server, obtaining connection information, and sending the connection information to Appium the client, and Appium the client instructs the detection process to send a restart Appium the instruction server after determining that the connection with Appium the instruction server is abnormal.
In this embodiment, when the connection port is not in the connection state, the client socket is called to send a restart message to the server socket, so that the server socket is instructed to notify the instruction server to restart, and the client socket is reconnected with the instruction server and retests the UI element, that is, before reconnection, the instruction server is restarted, so that the possibility that the client is normally connected with the instruction server after reconnection can be improved, retesting times are reduced, workload of UI testing is reduced, and UI testing efficiency is improved.
In one example, the test failure message may be an element positioning failure message, and determining that the UI element fails the test is specifically determining that the positioning expression of the UI element is set wrong, and marking the positioning expression in the display interface of the test script. The test staff can quickly locate the wrong locating expression, and the UI test efficiency is improved.
One embodiment of the present invention uses the above-described UI test method to perform UI element positioning, as shown in fig. 2, including:
Step 201, a client is connected with an instruction server and logs in the instruction server;
Step 202, the client sends a positioning request (i.e. a test request) of a UI element to be tested to a connected instruction server according to a test script, and receives a positioning result message (i.e. a test result message) returned by the instruction server;
Step 203-1, the client determines whether positioning is successful according to the positioning result message, if positioning is successful, step 203-1 is executed, and if positioning is failed, step 204 is executed;
Step 203-2, after obtaining the next UI element to be tested, executing step 202 again;
Step 204, the client judges whether the UI element is failed in the first positioning, if not, step 207 is executed to position the next UI element, if so, step 205 is executed;
Step 205-1, the client establishes a TCP client (i.e., a client socket) and connects with a TCP server (i.e., a server socket) created in a pre-created detection process;
Step 205-2, detecting the state of the process detection port 4723, and sending the state to the TCP client through the TCP server, if the state is the monitoring state, the connection between the client and the instruction server is normal, otherwise, the connection is abnormal;
in step 205-3, the client obtains the message sent to the TCP client by the TCP server, disconnects the TCP client from the TCP server, and closes the TCP client.
Step 206, the client determines whether the connection between the instruction server and the client is normal, if the connection between the instruction server and the client is normal, the client executes step 207, and if the connection between the instruction server and the client is abnormal, the client re-executes step 201;
in step 207, the client determines that the UI element positioning fails.
The above steps of the methods are divided into only for clarity of description, and may be combined into one step or split into multiple steps when implemented, so long as the steps include the same logic relationship, and all the steps are within the protection scope of the patent, and adding insignificant modification or introducing insignificant design to the algorithm or the process, but not changing the core design of the algorithm and the process, and all the steps are within the protection scope of the patent.
The embodiment of the invention also relates to an electronic device, as shown in fig. 3, comprising at least one processor 301, and a memory 302 in communication with the at least one processor, wherein the memory 302 stores instructions executable by the at least one processor 301, the instructions being executed by the at least one processor 301 to perform the UI test method described above.
Where the memory 302 and the processor 301 are connected by a bus, the bus may comprise any number of interconnected buses and bridges, the buses connecting the various circuits of the one or more processors 301 and the memory 302 together. The bus may also connect various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art, and therefore, will not be described any further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or may be a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The information processed by the processor 301 is transmitted over a wireless medium via an antenna, which in turn receives the information and communicates the information to the processor 301.
The processor 301 is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And memory 302 may be used to store information used by the processor in performing operations.
Embodiments of the present invention also relate to a computer-readable storage medium storing a computer program. The computer program implements the above-described method embodiments when executed by a processor.
That is, it will be understood by those skilled in the art that all or part of the steps in implementing the methods of the embodiments described above may be implemented by a program stored in a storage medium, where the program includes several instructions for causing a device (which may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps in the methods of the embodiments of the application. The storage medium includes a U disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, an optical disk, or other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples of carrying out the invention and that various changes in form and details may be made therein without departing from the spirit and scope of the invention.

Claims (7)

1.一种UI测试方法,其特征在于,应用于UI自动化测试工具的客户端,所述自动化测试工具设置有指令服务器和所述客户端,所述指令服务器通过第一端口与所述客户端连接,所述指令服务器通过第二端口与移动端UI测试工具连接,所述客户端将测试请求发送给所述指令服务器,所述指令服务器根据所述测试请求向所述移动端UI测试工具发送测试指令,所述移动端UI测试工具接收所述测试指令,根据所述测试指令进行UI测试,并将UI测试结果返回给所述指令服务器,所述指令服务器将接收的所述UI测试结果返回给所述客户端,方法包括:1. A UI testing method, characterized in that it is applied to a client of a UI automated testing tool, the automated testing tool is provided with an instruction server and the client, the instruction server is connected to the client through a first port, the instruction server is connected to a mobile UI testing tool through a second port, the client sends a test request to the instruction server, the instruction server sends a test instruction to the mobile UI testing tool according to the test request, the mobile UI testing tool receives the test instruction, performs a UI test according to the test instruction, and returns a UI test result to the instruction server, the instruction server returns the received UI test result to the client, and the method comprises: 根据测试脚本向连接的指令服务器发送UI元素的测试请求,接收所述指令服务器返回的指示所述UI测试结果的测试结果消息,所述测试结果消息包括测试成功消息和测试失败消息中的任意一项;Send a test request for the UI element to a connected instruction server according to the test script, and receive a test result message indicating the UI test result returned by the instruction server, wherein the test result message includes any one of a test success message and a test failure message; 在接收到所述测试失败消息后,检查与所述指令服务器的连接是否正常;After receiving the test failure message, checking whether the connection with the instruction server is normal; 在所述接收所述指令服务器返回的测试结果消息后,还包括:记录接收的测试失败消息次数;After receiving the test result message returned by the instruction server, the method further includes: recording the number of test failure messages received; 在所述检查与所述指令服务器的连接是否正常前,还包括:确认所述UI元素是首次测试失败;Before checking whether the connection with the instruction server is normal, the method further includes: confirming that the UI element has failed the first test; 若所述连接正常,则判定所述UI元素测试失败,测试下一个UI元素;If the connection is normal, determine that the UI element test fails, and test the next UI element; 若所述连接异常,则与所述指令服务器重新连接并重新测试所述UI元素;If the connection is abnormal, reconnect to the instruction server and retest the UI element; 其中,所述检查与指令服务器的连接是否正常,包括:The step of checking whether the connection with the command server is normal includes: 与预先创建的检测进程通过套接字连接,并指示所述检测进程返回指令服务器连接信息;Connecting to a pre-created detection process via a socket, and instructing the detection process to return command server connection information; 获取所述连接信息;Acquire the connection information; 根据所述连接信息,判断所述连接是否正常;According to the connection information, determining whether the connection is normal; 其中,所述检测进程预先建立,用于启动所述指令服务器,获取所述连接信息,并发送给所述客户端。The detection process is pre-established and used to start the instruction server, obtain the connection information, and send it to the client. 2.根据权利要求1所述的UI测试方法,其特征在于,所述连接信息,包括:所述第一端口是否处于监听状态;2. The UI testing method according to claim 1, wherein the connection information comprises: whether the first port is in a listening state; 所述根据所述连接信息,判断所述连接是否正常,包括:若所述第一端口处于监听状态,则判定所述连接正常;若所述第一端口处于空闲状态,则判定所述连接异常;The determining whether the connection is normal according to the connection information includes: if the first port is in a listening state, determining that the connection is normal; if the first port is in an idle state, determining that the connection is abnormal; 在所述与所述指令服务器重新连接前,还包括:Before reconnecting with the instruction server, the method further includes: 指示所述检测进程发送重启所述指令服务器。Instruct the detection process to send a restart instruction to the server. 3.根据权利要求1所述的UI测试方法,其特征在于,所述与预先创建的检测进程通过套接字连接,包括:3. The UI testing method according to claim 1, wherein the connecting with the pre-created detection process via a socket comprises: 创建所述客户端套接字与检测进程中预先创建的服务端套接字连接;Creating a connection between the client socket and the server socket pre-created in the detection process; 在所述判定所述UI元素测试失败,或者,在所述与所述指令服务器重新连接并重新测试所述UI元素后,还包括:After determining that the UI element test fails, or after reconnecting with the instruction server and retesting the UI element, the method further includes: 将所述客户端套接字与所述服务端套接字断开连接,关闭所述客户端套接字。The client socket is disconnected from the server socket and the client socket is closed. 4.根据权利要求1至3中任一项所述的UI测试方法,其特征在于,所述测试失败消息包括:元素定位失败消息;4. The UI testing method according to any one of claims 1 to 3, characterized in that the test failure message comprises: an element positioning failure message; 所述判定所述UI元素测试失败,包括:The determining that the UI element test fails includes: 判定所述UI元素的定位表达式设置错误,并在所述测试脚本的显示界面中标记所述定位表达式。It is determined that the positioning expression of the UI element is set incorrectly, and the positioning expression is marked in the display interface of the test script. 5.根据权利要求1所述的UI测试方法,其特征在于,检查与所述指令服务器的连接是否正常,包括:5. The UI testing method according to claim 1, wherein checking whether the connection with the instruction server is normal comprises: 向所述指令服务器发送连接测试消息,所述连接测试消息中指示所述指令服务器进行回复;Sending a connection test message to the instruction server, wherein the connection test message instructs the instruction server to reply; 若在预设时间内接受到所述指令服务器的回复消息,则判定所述连接正常;If a reply message from the command server is received within a preset time, it is determined that the connection is normal; 若在预设时间内未接受到所述指令服务器的回复消息,则判定所述连接异常。If no reply message from the instruction server is received within a preset time, it is determined that the connection is abnormal. 6.一种电子设备,其特征在于,包括:6. An electronic device, comprising: 至少一个处理器;at least one processor; 与所述至少一个处理器通信连接的存储器;a memory communicatively coupled to the at least one processor; 所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如权利要求1至5中任一所述的UI测试方法。The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the UI testing method according to any one of claims 1 to 5. 7.一种计算机可读存储介质,存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至5中任一所述的UI测试方法。7. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the computer program implements the UI testing method according to any one of claims 1 to 5.
CN202110485718.4A 2021-04-30 2021-04-30 UI testing method, electronic device and storage medium Active CN113326183B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110485718.4A CN113326183B (en) 2021-04-30 2021-04-30 UI testing method, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110485718.4A CN113326183B (en) 2021-04-30 2021-04-30 UI testing method, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN113326183A CN113326183A (en) 2021-08-31
CN113326183B true CN113326183B (en) 2024-12-24

Family

ID=77414200

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110485718.4A Active CN113326183B (en) 2021-04-30 2021-04-30 UI testing method, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN113326183B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113886231B (en) * 2021-09-28 2025-05-23 厦门立林科技有限公司 A continuous clicking method, system and storage medium for APP interface elements
CN114443486A (en) * 2022-01-29 2022-05-06 携程旅游网络技术(上海)有限公司 UI test case generation method, system, electronic device and medium
CN117149638B (en) * 2023-09-01 2024-09-03 镁佳(北京)科技有限公司 UI (user interface) automatic testing method and device, computer equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111538650A (en) * 2020-03-24 2020-08-14 中国平安人寿保险股份有限公司 User interface automated testing method and related equipment

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101916224A (en) * 2010-08-20 2010-12-15 迈普通信技术股份有限公司 Test progress abnormality detection method and automatic test control device
CN107894950A (en) * 2017-10-30 2018-04-10 北京奇虎科技有限公司 A kind of equipment detection method, device, server and storage medium
CN108287789A (en) * 2017-12-29 2018-07-17 五八有限公司 Batch-automated test method, device and electronic equipment
CN109669867B (en) * 2018-12-11 2024-03-12 平安科技(深圳)有限公司 Test apparatus, automated test method, and computer-readable storage medium
CN112241356B (en) * 2019-07-16 2024-05-10 腾讯科技(深圳)有限公司 Page test method, device, equipment and storage medium
CN112269744A (en) * 2020-10-30 2021-01-26 深圳壹账通智能科技有限公司 System abnormity testing method and device, computer equipment and storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111538650A (en) * 2020-03-24 2020-08-14 中国平安人寿保险股份有限公司 User interface automated testing method and related equipment

Also Published As

Publication number Publication date
CN113326183A (en) 2021-08-31

Similar Documents

Publication Publication Date Title
CN113326183B (en) UI testing method, electronic device and storage medium
CN106681924A (en) Software testing method and software testing system
CN113849356B (en) Equipment testing method and device, electronic equipment and storage medium
CN112988485A (en) Simulation test method and device for power Internet of things equipment
CN114679380B (en) Method and related device for creating edge cluster
CN113382056A (en) Data reporting method, device, equipment, storage medium and system
CN113238780A (en) Upgrading method and equipment of cloud server and cloud server
US9935867B2 (en) Diagnostic service for devices that employ a device agent
CN111416882A (en) BMC IP setting method and device, electronic equipment and system
CN119402446A (en) A network card automatic binding method, device, equipment, medium and program product
WO2025118967A1 (en) Big data access method based on protocol adaptation and scheduling in seismological industry
CN114095343A (en) Disaster recovery method, device, equipment and storage medium based on double-active system
CN111338642B (en) Method, device, terminal and storage medium for determining application download path
CN106878379B (en) Start control method and device
CN115134838B (en) UPF fault detection method, device, electronic device and storage medium based on 5G
EP4529085A1 (en) Data access method and apparatus, electronic device and storage medium
CN111858100A (en) A kind of BMC message transmission method and related device
CN114844859B (en) Domain name configuration method, device, electronic equipment and storage medium
CN117978792B (en) Interaction method, device, equipment and medium of application program and Web terminal
CN119127723B (en) Interface test method, system, terminal and medium for connecting multiple hong-Mongolian devices
CN114780424A (en) Module testing method, system, storage medium and electronic device
CN117896421A (en) Robot testing method, device, storage medium and computer equipment
CN115118757A (en) Network remote calling method and device, computer equipment and storage medium
CN117349264A (en) Data migration method, device, equipment and storage medium
CN119512578A (en) Middleware installation method, device, storage medium and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant