CN110781089B - Method and device for automatically testing UI of equipment, electronic equipment and medium - Google Patents
Method and device for automatically testing UI of equipment, electronic equipment and medium Download PDFInfo
- Publication number
- CN110781089B CN110781089B CN201911049257.5A CN201911049257A CN110781089B CN 110781089 B CN110781089 B CN 110781089B CN 201911049257 A CN201911049257 A CN 201911049257A CN 110781089 B CN110781089 B CN 110781089B
- Authority
- CN
- China
- Prior art keywords
- web
- browser
- equipment
- click
- service application
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3692—Test management for test results analysis
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 invention provides a method, a device, electronic equipment and a medium for automatically testing a UI of equipment, wherein the method comprises the steps of running a Python script to start a browser, and sending a UI test request to an equipment webpage service application of a web end through the browser; receiving a message of requesting interface html data, which is sent by equipment webpage service application responding to the UI test request, through an interface management application; the interface management application responds to the message, traverses all controls displayed on the current interface to generate html interface data, and returns the html interface data to the equipment webpage service application; the browser receives web data to be displayed, which is returned after the html interface data and the web resources are integrated by the device web service application; and the browser analyzes the web data to be displayed, displays the web data and returns a display result to the Python script. The invention has the advantages that: the method can replace manual work to carry out automatic test of the display and control of the LCD UI of the terminal equipment and the click events such as touch screen click and key click, and can greatly improve the overall test efficiency of the terminal equipment.
Description
Technical Field
The invention relates to the field of automatic testing, in particular to a method and a device for automatically testing a UI of equipment, electronic equipment and a medium.
Background
A terminal device is a device that inputs programs and data to a computer or receives a result of processing output from the computer via a communication facility. The terminal equipment is usually arranged in a convenient place which can be connected with a remote computer for work by utilizing a communication facility, and mainly comprises a communication interface control device and a special or selected input/output device; a system in which a plurality of distributed terminal apparatuses are connected to a computer via a communication facility is called an online system.
With the rapid development of computer technology, terminal devices are widely used in daily life of people at present, and bring convenience to the life of people. In order to ensure that the terminal devices can be normally used, each terminal device needs to pass through a testing link before entering the market, and the automatic testing of the terminal devices is always an industry difficult problem, particularly, the tests of LCD UI (interface) display, touch screen clicking, key clicking and the like on the embedded terminal devices need to be manually operated, so that the overall testing efficiency is extremely low.
Of course, there are also a few specific UI automation test tools, such as UI automation and Appnium, where UI automation is a native test tool issued simultaneously when google issues an android system, and Appnium is a test tool packaged based on UI automation. However, the UI Automator and the Appinum test are pure background data, and whether display abnormality exists is inconvenient to check; and both the UI Automator and the Appinum are only suitable for the UI automatic test of the terminal equipment of the android system, and the universality is extremely poor.
Disclosure of Invention
The invention aims to solve the technical problem of providing a method, a device, an electronic device and a medium for automatically testing a UI of a device, and solves the problem of low testing efficiency caused by the fact that the UI of the existing terminal device needs to depend on manual operation.
In a first aspect, the present invention provides a method for automatically testing a UI of a device, where the method includes:
running a Python script to start a browser, and sending a UI test request to the equipment webpage service application of the web end through the browser;
receiving a message of requesting interface html data, which is sent by a device webpage service application of a web end in response to the UI test request, through an interface management application;
the interface management application responds to the message of requesting the html data of the interface, traverses all controls displayed on the current interface to generate html interface data, and returns the html interface data to the equipment webpage service application of the web end;
the browser receives web data to be displayed, which is returned after html interface data and web resources are integrated by equipment web page service application of a web end;
and the browser analyzes the web data to be displayed, displays the web data and returns a display result to the Python script.
Further, the method further comprises:
running a Python script to send a click event to a browser, constructing a click test request by the browser, and sending the click test request to an equipment webpage service application of a web end;
receiving a response of the equipment webpage service application of the web end to the click test request through an interface management application and analyzing the sent parameters;
the interface management application finds out the corresponding control coordinates through the parameters, informs a hardware management layer of triggering a click event according to the control coordinates, and returns a click result to the equipment webpage service application of the web end;
and the browser receives a click result returned by the equipment webpage service application of the web end, and returns the click result to the Python script.
Further, the running of the Python script starts the browser, and sending the UI test request to the device web service application of the web end through the browser specifically includes:
and running a Python script, starting the browser through a selenium test tool, automatically inputting the terminal equipment IP in an address bar by the browser, and sending a UI test request to the equipment webpage service application of the web end in an HTTP request mode according to the terminal equipment IP.
Further, the browser constructs a click test request, and the device web service application that sends the click test request to the web side specifically includes: after receiving a click event sent by a Python script, a browser triggers the click event of a control and acquires control parameters of the click event to construct a click test request, wherein the control parameters at least comprise a control ID; and the browser sends the constructed click test request to the equipment webpage service application of the web end in an HTTP request mode.
In a second aspect, the invention provides an automatic UI testing device for equipment, which comprises a first testing request module, a message receiving module, an interface data returning module, a web data receiving module and a web data display module;
the first test request module is used for running a Python script to start a browser and sending a UI test request to the equipment webpage service application of the web end through the browser;
the message receiving module is used for receiving a message of requesting interface html data, which is sent by a device webpage service application of a web end in response to the UI test request, through an interface management application;
the interface data returning module is used for the interface management application to respond to the message of requesting the html data of the interface, traverse all the controls displayed on the current interface to generate the html interface data, and return the html interface data to the equipment webpage service application of the web end;
the web data receiving module is used for the browser to receive the web data to be displayed, which is returned after the html interface data and the web resources are integrated by the equipment web service application of the web end;
and the web data display module is used for the browser to analyze and display the web data to be displayed and returning a display result to the Python script.
Furthermore, the device also comprises a second test request module, a parameter receiving module, an event triggering module and a result returning module;
the second test request module is used for running a Python script to send a click event to the browser, the browser constructs a click test request and sends the click test request to the equipment webpage service application of the web end;
the parameter receiving module is used for receiving the parameters sent by the equipment webpage service application of the web end through the interface management application in response to the click test request and analyzing the click test request;
the event triggering module is used for finding out the corresponding control coordinates through the parameters by the interface management application, informing the hardware management layer of triggering a clicking event according to the control coordinates and returning a clicking result to the equipment webpage service application of the web end;
and the result returning module is used for receiving the click result returned by the equipment webpage service application of the web end by the browser and returning the click result to the Python script by the browser.
Further, the running of the Python script starts the browser, and sending the UI test request to the device web service application of the web end through the browser specifically includes:
and running a Python script, starting a browser through a selenium test tool, automatically inputting a terminal equipment IP in an address bar by the browser, and sending a UI test request to the equipment webpage service application of the web end in an HTTP request mode according to the terminal equipment IP.
Further, the browser constructs a click test request, and the device web service application that sends the click test request to the web side specifically includes: after receiving a click event sent by a Python script, a browser triggers the click event of a control and acquires control parameters of the click event to construct a click test request, wherein the control parameters at least comprise a control ID; and the browser sends the constructed click test request to the equipment webpage service application of the web end in an HTTP request mode.
In a third aspect, the present invention provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of the first aspect when executing the program.
In a fourth aspect, the invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the method of the first aspect.
One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages:
the method, the device, the equipment and the medium provided by the embodiment of the invention can replace manual operation to carry out automatic test on the display and control of the LCD UI of the terminal equipment and the click events such as touch screen click, key click and the like, and can greatly improve the overall test efficiency of the terminal equipment.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
The invention will be further described with reference to the following examples and figures.
Fig. 1 is a system framework diagram of a terminal device in the present invention.
FIG. 2 is a functional block diagram of the communication between the interface management application, the device web service application, and the Python script of the present invention.
Fig. 3 is a timing diagram of a method for automatically testing a UI of a device according to an embodiment of the invention.
Fig. 4 is a schematic structural diagram of a device according to a second embodiment of the present invention when performing a UI display test.
FIG. 5 is a schematic structural diagram illustrating a device according to a second embodiment of the present invention when a click event test is performed.
Detailed Description
The embodiment of the invention provides a method and a device for automatically testing a UI of equipment, electronic equipment and a medium, which are used for solving the problem of low testing efficiency caused by dependence on manual operation in the UI testing of the existing terminal equipment and can greatly improve the overall testing efficiency.
The technical scheme in the embodiment of the invention has the following general idea:
according to the fact that the attributes of elements of an LCD UI (liquid Crystal display) of the terminal equipment and the attributes of elements of a web UI are basically consistent, the elements displayed by the UI of the terminal equipment are mapped into the elements of the web UI, so that coordinates, color matching, sizes and the like can be displayed in the web end without moving, and meanwhile, a click event is injected into a touch screen device/dev/input/evenX according to the UI coordinates; the UI display and click events are then tested using the mature rich web UI automation test tool Selenium. In other words, the core idea of the present invention is actually: the UI control of the terminal equipment is dynamically generated into the html control to be displayed on the web server, and the process is a pure software processing process.
Before introducing the specific embodiment, a system framework of the terminal device corresponding to the method of the embodiment of the present invention is introduced, as shown in fig. 1, for an existing terminal device, whether the terminal device is a terminal device of an android system or a terminal device of a linux system, the existing terminal device basically includes hardware, a linux system kernel, a device hardware control layer, and an application program; the hardware refers to electronic materials forming the terminal equipment, and comprises LCD liquid crystal, a touch screen, a network card and the like; the linux system kernel is a system issued by linux organization, and comprises a touch screen driver, an LCD (liquid crystal display) driver, a network protocol stack and the like; the device hardware control layer refers to the interface provided to facilitate application control of the underlying hardware.
In the technical scheme of the invention, the device mainly comprises three components: an interface management application, a device web service application and a Python script; the communication among the three components is shown in fig. 2, wherein the Python script communicates with a browser (such as google browser) through a selenium test tool, the browser communicates with the device web service application through an HTTP protocol, and the device web service application communicates through IPC: the unix socket communicates with the interface management application.
The interface management application refers to an application for displaying an interface on an LCD (liquid crystal display) of terminal equipment, and is divided into three functions of interface drawing, interface control management and interface switching of service logic according to service functions, and the three functions are realized by using an MVC (model view controller) framework to call each other according to service requirements.
The device web service application refers to a web portal provided for facilitating user management of the terminal device, and a user can open a terminal device web page by using a browser and configure or control the terminal device. The equipment Web service application mainly comprises a Web server, a Web interface control and Web resources, wherein the Web server is a background service for responding to a browser request, and the Web server can analyze the request to generate an environment variable after receiving the request; the Web interface control means that the Web interface control is used for responding to the environment variable generated by the Web server and calling internal logic to generate an html page to be displayed by the browser; the Web resource means a resource for providing an icon, an HTML static page, and the like.
The Python script is a control entry of an automated test, and can be specifically realized according to business needs.
Embodiments of the invention will now be described:
example one
The embodiment provides an automatic device UI testing method, as shown in fig. 3, the method includes:
running a Python script to start a browser, and sending a UI test request to the equipment webpage service application of the web end through the browser;
receiving a message of requesting interface html data, which is sent by a device webpage service application of a web end in response to the UI test request, through an interface management application; in specific implementation, after the equipment webpage service application at the web end receives the UI test request, the equipment webpage service application analyzes the UI test request and acquires a parameter table, and then sends a request message of interface html data to an interface management application according to the acquired parameter table;
the interface management application responds to the message of requesting the html data of the interface, traverses all the controls displayed on the current interface to generate the html interface data, and returns the html interface data to the equipment webpage service application of the web end; in specific implementation, after receiving a request message of interface html data, the interface management application traverses all controls displayed on the current interface to generate html interface data, so that elements displayed on a terminal device UI are mapped to elements of a web UI;
the browser receives web data to be displayed, which is returned after html interface data and web resources are integrated by equipment web page service application of a web end; in specific implementation, after the html interface data is received by the device Web service application at the Web end, the Web interface is notified to control integration of the html interface data, the static html data and other Web resources to generate Web data to be displayed (i.e., complete html data).
And the browser analyzes the web data to be displayed and displays the web data, and returns a display result to the Python script, so that the test of UI display is completed.
In the first embodiment, the method further includes:
running a Python script to send a click event to a browser, constructing a click test request by the browser, and sending the click test request to an equipment webpage service application of a web end; the click event may include various click events such as key click and input click of an input box;
receiving a response of a device webpage service application of a web end to the click test request through an interface management application and analyzing the sent parameters; in specific implementation, after receiving a click test request, a device web service application at a web end analyzes the click test request and acquires parameters, and then sends the acquired parameters to an interface management application, wherein the parameters comprise a control ID and other parameters;
the interface management application finds out the corresponding control coordinates through the parameters (namely, the control ID and other parameters), informs a hardware management layer of triggering a click event according to the control coordinates, and simultaneously returns a click result to the equipment webpage service application of the web end;
and the browser receives a click result returned by the equipment webpage service application of the web end, and returns the click result to the Python script, so that the test of the click event is completed.
In this embodiment one, the running a Python script to start a browser, and sending a UI test request to the device web service application at the web end through the browser specifically includes:
and running a Python script, starting a browser through a selenium test tool, automatically inputting a terminal equipment IP in an address bar by the browser, and sending a UI test request to the equipment webpage service application of the web end in an HTTP request mode according to the terminal equipment IP.
In this embodiment one, the browser constructs a click test request, and the device web service application that sends the click test request to the web side specifically includes: after receiving a click event sent by a Python script, a browser triggers the click event of a control and acquires control parameters of the click event to construct a click test request, wherein the control parameters at least comprise a control ID; and the browser sends the constructed click test request to the equipment webpage service application of the web end in an HTTP request mode.
Based on the same inventive concept, the invention also provides a device corresponding to the method in the first embodiment, which is shown in the second embodiment in detail.
Example two
In this embodiment, an apparatus for automated testing of a UI of a device is provided, as shown in fig. 4, the apparatus includes a first test request module, a message receiving module, an interface data returning module, a web data receiving module, and a web data displaying module;
the first test request module is used for running a Python script to start a browser and sending a UI test request to the equipment webpage service application of the web end through the browser;
the message receiving module is used for receiving a message of requesting interface html data, which is sent by a device webpage service application of a web end in response to the UI test request, through an interface management application; in specific implementation, after the equipment webpage service application at the web end receives the UI test request, the equipment webpage service application analyzes the UI test request and acquires a parameter table, and then sends a request message of interface html data to an interface management application according to the acquired parameter table;
the interface data returning module is used for the interface management application to respond to the message of requesting the html data of the interface, traverse all the controls displayed on the current interface to generate the html interface data, and return the html interface data to the equipment webpage service application of the web end; in specific implementation, after receiving a request message of interface html data, the interface management application traverses all controls displayed on the current interface to generate html interface data, so that elements displayed on a terminal device UI are mapped to elements of a web UI;
the web data receiving module is used for the browser to receive the web data to be displayed, which is returned after the html interface data and the web resources are integrated by the equipment web service application of the web end; in specific implementation, after receiving html interface data, the device Web service application at the Web end informs the Web interface to control integration of the html interface data, static html data and other Web resources to generate Web data to be displayed (namely complete html data);
and the web data display module is used for the browser to analyze and display the web data to be displayed and returning a display result to the Python script, so that the test of UI display is completed.
In the second embodiment of the present invention, as shown in fig. 5, the apparatus further includes a second test request module, a parameter receiving module, an event triggering module, and a result returning module;
the second test request module is used for running a Python script to send a click event to the browser, the browser constructs a click test request and sends the click test request to the equipment webpage service application of the web end; the click event may include various click events such as a key click and an input click of an input box;
the parameter receiving module is used for receiving the parameters which are sent by the equipment webpage service application of the web end responding to the click test request and analyzing through the interface management application; in specific implementation, after receiving a click test request, a device web service application of a web end analyzes the click test request and acquires parameters, and then sends the acquired parameters to an interface management application, wherein the parameters comprise a control ID and other parameters;
the event triggering module is used for finding out corresponding control coordinates through parameters (namely control IDs and other parameters) by the interface management application, informing a hardware management layer to trigger a click event according to the control coordinates, and simultaneously returning a click result to the equipment webpage service application of the web end;
and the result returning module is used for receiving the click result returned by the equipment webpage service application of the web end by the browser and returning the click result to the Python script by the browser, so that the test of the click event is completed.
In the second embodiment, the running of the Python script starts the browser, and sending the UI test request to the device web service application at the web end through the browser specifically includes:
and running a Python script, starting a browser through a selenium test tool, automatically inputting a terminal equipment IP in an address bar by the browser, and sending a UI test request to the equipment webpage service application of the web end in an HTTP request mode according to the terminal equipment IP.
In the second embodiment, the browser constructs a click test request, and the device web service application that sends the click test request to the web side specifically includes: after receiving a click event sent by a Python script, a browser triggers the click event of a control and acquires control parameters of the click event to construct a click test request, wherein the control parameters at least comprise a control ID; and the browser sends the constructed click test request to the equipment webpage service application of the web end in an HTTP request mode.
Based on the same inventive concept, the invention provides an electronic device embodiment corresponding to the first embodiment, which is detailed in the third embodiment.
EXAMPLE III
The embodiment provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the implementation manner in the first embodiment may be implemented.
Since the electronic device described in this embodiment is a device used for implementing the method in the first embodiment of the present invention, based on the method described in the first embodiment of the present invention, a specific implementation manner of the electronic device in this embodiment and various variations thereof can be understood by those skilled in the art, and therefore, how to implement the method in the first embodiment of the present invention by the electronic device is not described in detail herein. The equipment used by those skilled in the art to implement the method in the embodiments of the present invention is within the scope of the present invention.
Based on the same inventive concept, the invention provides a storage medium corresponding to the fourth embodiment, which is described in detail in the fourth embodiment.
Example four
The present embodiment provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the implementation manner in the first embodiment can be realized.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In summary, the technical solution provided in the embodiments of the present invention at least has the following technical effects or advantages: the method, the device, the electronic equipment and the medium provided by the embodiment of the invention can replace manual operation to carry out automatic test on the display and control of the LCD UI of the terminal equipment and the click events such as touch screen click, key click and the like, and can greatly improve the overall test efficiency of the terminal equipment. Meanwhile, the technical scheme of the invention has the following advantages in specific use:
convenience is realized, the automatic testing scheme can almost display the UI and specific element attributes of the terminal equipment on the web in real time, and abnormal display check can be very conveniently carried out; unlike the android device automation tools, namely, the applium and the UiAutomator, which belong to pure background data, the display abnormality is not convenient to check.
Secondly, integration is easy, and a web UI automation tool (selenium) is used in the automatic test scheme, so that the same tool and interface can be used in the automatic test scheme with the existing web automation test without learning other tools.
And thirdly, the transplantation is easy to realize, only the UI mapping function needs to be realized on different terminal equipment, and other parts are multiplexed.
And fourthly, the expansion is easy, the mapping function can be realized for the functions which are not related to the UI, and the testing or the control can be carried out at the web end.
While specific embodiments of the invention have been described, it will be understood by those skilled in the art that the specific embodiments described are illustrative only and are not limiting upon the scope of the invention, as equivalent modifications and variations as will be made by those skilled in the art in light of the spirit of the invention are intended to be included within the scope of the appended claims.
Claims (10)
1. An automatic UI test method for equipment is characterized in that: the method comprises the following steps:
running a Python script to start a browser, and sending a UI test request to the equipment webpage service application of the web end through the browser;
receiving a message of requesting interface html data, which is sent by a device webpage service application of a web end in response to the UI test request, through an interface management application; the interface management application refers to an application for displaying an interface on an LCD (liquid crystal display) of the terminal equipment, and the equipment webpage service application refers to a web portal provided for facilitating the management of the terminal equipment by a user;
the interface management application responds to the message of requesting the html data of the interface, traverses all controls displayed on the current interface to generate the html interface data, so that the elements displayed on the UI of the terminal equipment are mapped into the elements of the web UI, and the html interface data are returned to the equipment webpage service application of the web end;
the browser receives web data to be displayed, which is returned after html interface data and web resources are integrated by equipment web page service application of a web end;
and the browser analyzes the web data to be displayed, displays the web data and returns a display result to the Python script.
2. The method for automated testing of the UI of a device according to claim 1, wherein: the method further comprises the following steps:
running a Python script to send a click event to a browser, constructing a click test request by the browser, and sending the click test request to the equipment webpage service application of the web end;
receiving a response of the equipment webpage service application of the web end to the click test request through an interface management application and analyzing the sent parameters;
the interface management application finds out the corresponding control coordinates through the parameters, informs a hardware management layer of triggering a click event according to the control coordinates, and simultaneously returns a click result to the equipment webpage service application of the web end;
and the browser receives a click result returned by the equipment webpage service application of the web end, and returns the click result to the Python script.
3. The method for automated testing of the UI of a device according to claim 1, wherein: the Python script is run to start the browser, and the specific steps of sending the UI test request to the equipment webpage service application of the web end through the browser are as follows:
and running a Python script, starting a browser through a selenium test tool, automatically inputting a terminal equipment IP in an address bar by the browser, and sending a UI test request to the equipment webpage service application of the web end in an HTTP request mode according to the terminal equipment IP.
4. The method for automatically testing the UI of the device according to claim 2, wherein: the browser constructs a click test request, and the equipment webpage service application for sending the click test request to the web end specifically comprises the following steps: after receiving a click event sent by a Python script, a browser triggers the click event of a control, acquires control parameters of the click event and constructs a click test request, wherein the control parameters at least comprise a control ID; and the browser sends the constructed click test request to the equipment webpage service application of the web end in an HTTP request mode.
5. The utility model provides an equipment UI automation test device which characterized in that: the device comprises a first test request module, a message receiving module, an interface data returning module, a web data receiving module and a web data display module;
the first test request module is used for running a Python script to start a browser and sending a UI test request to the equipment webpage service application of the web end through the browser;
the message receiving module is used for receiving a message of requesting interface html data, which is sent by a device webpage service application of a web end in response to the UI test request, through an interface management application; the interface management application refers to an application for displaying an interface on an LCD of the terminal equipment, and the equipment web service application refers to a web portal provided for facilitating the management of the terminal equipment by a user;
the interface data returning module is used for the interface management application to respond to the message of requesting the interface html data, traverse all the controls displayed on the current interface to generate the html interface data, so that the elements displayed on the terminal equipment UI are mapped into the elements of the web UI, and the html interface data are returned to the equipment webpage service application of the web end;
the web data receiving module is used for the browser to receive the web data to be displayed, which is returned after the html interface data and the web resources are integrated by the equipment web page service application of the web end;
and the web data display module is used for the browser to analyze and display the web data to be displayed and returning a display result to the Python script.
6. The device UI automation test apparatus of claim 5, wherein: the device also comprises a second test request module, a parameter receiving module, an event triggering module and a result returning module;
the second test request module is used for running a Python script to send a click event to the browser, the browser constructs a click test request and sends the click test request to the equipment webpage service application of the web end;
the parameter receiving module is used for receiving the parameters sent by the equipment webpage service application of the web end through the interface management application in response to the click test request and analyzing the click test request;
the event triggering module is used for finding out the corresponding control coordinates through the parameters by the interface management application, informing the hardware management layer of triggering a clicking event according to the control coordinates and returning a clicking result to the equipment webpage service application of the web end;
and the result returning module is used for receiving the click result returned by the equipment webpage service application of the web end by the browser and returning the click result to the Python script by the browser.
7. The device UI automation test apparatus of claim 5, wherein: the running of the Python script starts a browser, and the specific steps of sending the UI test request to the equipment webpage service application of the web end through the browser are as follows:
and running a Python script, starting a browser through a selenium test tool, automatically inputting a terminal equipment IP in an address bar by the browser, and sending a UI test request to the equipment webpage service application of the web end in an HTTP request mode according to the terminal equipment IP.
8. The device UI automation test apparatus of claim 6, wherein: the browser constructs a click test request, and the equipment webpage service application for sending the click test request to the web end specifically comprises the following steps: after receiving a click event sent by a Python script, a browser triggers the click event of a control and acquires control parameters of the click event to construct a click test request, wherein the control parameters at least comprise a control ID; and the browser sends the constructed click test request to the equipment webpage service application of the web end in an HTTP request mode.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 4 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911049257.5A CN110781089B (en) | 2019-10-31 | 2019-10-31 | Method and device for automatically testing UI of equipment, electronic equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911049257.5A CN110781089B (en) | 2019-10-31 | 2019-10-31 | Method and device for automatically testing UI of equipment, electronic equipment and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110781089A CN110781089A (en) | 2020-02-11 |
CN110781089B true CN110781089B (en) | 2022-08-19 |
Family
ID=69387938
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911049257.5A Active CN110781089B (en) | 2019-10-31 | 2019-10-31 | Method and device for automatically testing UI of equipment, electronic equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110781089B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP4158455A4 (en) | 2020-05-25 | 2024-02-07 | Microsoft Technology Licensing, LLC | A crawler of web automation scripts |
CN112115062A (en) * | 2020-09-28 | 2020-12-22 | 海尔优家智能科技(北京)有限公司 | Method and device for detecting attribute information, storage medium and electronic device |
CN112131124A (en) * | 2020-09-28 | 2020-12-25 | 平安国际智慧城市科技股份有限公司 | Page element positioning method, device, equipment and storage medium |
CN112486826B (en) * | 2020-11-30 | 2023-08-01 | 北京字跳网络技术有限公司 | Test method, test device, electronic equipment and computer readable medium |
CN113094281B (en) * | 2021-04-28 | 2024-05-03 | 杭州网易云音乐科技有限公司 | Test method and device for hybrid App |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102594587B (en) * | 2012-01-17 | 2014-08-20 | 京信通信系统(中国)有限公司 | Embedded WEB debugging and testing maintenance method and debugging and testing maintenance system |
WO2016046824A1 (en) * | 2014-09-22 | 2016-03-31 | Melzer Roy S | Interactive user interface based on analysis of chat messages content |
CN107688539A (en) * | 2017-09-08 | 2018-02-13 | 郑州云海信息技术有限公司 | A kind of BMC Web test systems |
CN108628741B (en) * | 2018-04-10 | 2021-10-01 | 平安科技(深圳)有限公司 | Webpage testing method and device, electronic equipment and medium |
CN110096659B (en) * | 2019-03-27 | 2021-08-20 | 北京三快在线科技有限公司 | Page display method, device and equipment and readable storage medium |
-
2019
- 2019-10-31 CN CN201911049257.5A patent/CN110781089B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN110781089A (en) | 2020-02-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110781089B (en) | Method and device for automatically testing UI of equipment, electronic equipment and medium | |
CN109634728B (en) | Job scheduling method and device, terminal equipment and readable storage medium | |
CN107608901B (en) | Jmeter-based testing method and device, storage medium and electronic equipment | |
CN106326104B (en) | Terminal control testing method and device | |
CN104579822A (en) | Automatic performance test system and method of mobile application based on Http protocol | |
CN104679659A (en) | Testing method and testing device of application program as well as electronic equipment | |
CN111752843B (en) | Method, apparatus, electronic device and readable storage medium for determining influence surface | |
CN105302722B (en) | CTS automatic testing method and device | |
WO2019227708A1 (en) | Online debugging apparatus and method for test case, and computer-readable storage medium | |
CN110659198A (en) | Application program test case execution method and device and software test system | |
CN105491140A (en) | Remote testing method and system for terminal | |
CN104935639A (en) | Intelligent terminal, and applied distributed exploitation system and method | |
CN113535567B (en) | Software testing method, device, equipment and medium | |
CN115016321A (en) | Hardware-in-loop automatic testing method, device and system | |
CN115935035A (en) | RPA flow visualization management method, device, equipment and readable storage medium | |
CN110750453B (en) | HTML 5-based intelligent mobile terminal testing method, system, server and storage medium | |
CN111367802B (en) | Web automatic test method, device and computer readable storage medium | |
CN113515462B (en) | Method, apparatus, device and storage medium for testing | |
CN112416762B (en) | API test method and device, equipment and computer readable storage medium | |
CN105138458A (en) | Method and system for recording automatic testing scripts by combining intelligent terminal and computer terminal | |
CN107220290B (en) | Method, device, server and terminal for displaying electronic billboard | |
CN114050909B (en) | Exercise method, system and electronic equipment for simulating mail | |
CN112241359B (en) | Equipment testing method and equipment | |
CN110347409B (en) | Automatic control method, client and server | |
CN113535590A (en) | Program testing method and 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 |