CN112667505A - Terminal testing method and device, storage medium and electronic device - Google Patents

Terminal testing method and device, storage medium and electronic device Download PDF

Info

Publication number
CN112667505A
CN112667505A CN202011568980.7A CN202011568980A CN112667505A CN 112667505 A CN112667505 A CN 112667505A CN 202011568980 A CN202011568980 A CN 202011568980A CN 112667505 A CN112667505 A CN 112667505A
Authority
CN
China
Prior art keywords
target
test
image
action
instruction
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.)
Pending
Application number
CN202011568980.7A
Other languages
Chinese (zh)
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.)
Hangzhou Qunhe Information Technology Co Ltd
Original Assignee
Hangzhou Qunhe Information 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 Hangzhou Qunhe Information Technology Co Ltd filed Critical Hangzhou Qunhe Information Technology Co Ltd
Priority to CN202011568980.7A priority Critical patent/CN112667505A/en
Publication of CN112667505A publication Critical patent/CN112667505A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention provides a terminal testing method, a terminal testing device, a storage medium and an electronic device, wherein the method comprises the following steps: acquiring a test instruction from an interactive end for indicating to test target equipment; analyzing the test instruction to obtain a target operation instruction; analyzing the received target script according to the target operation instruction to obtain a target action element; and executing test operation on the target equipment according to the target action element. By the method and the device, the problem of low testing efficiency is solved, and the effect of improving the testing efficiency is further achieved.

Description

Terminal testing method and device, storage medium and electronic device
Technical Field
The embodiment of the invention relates to the field of communication, in particular to a terminal testing method and device, a storage medium and an electronic device.
Background
The page of the current electronic product is often connected with a plurality of different systems to realize the content of the different systems at multiple ends, for example, the electronic product connected with iOS, Android, and Web pages; in order to provide better product experience for users, various tests need to be performed before the electronic products are online, so that the pages of the electronic products can be connected with the pages of different systems; however, the current testing process involves different electronic products, so that the process is more complicated when the page testing is performed, more manpower is consumed, and the testing efficiency and the testing precision are also reduced.
For example, regression testing is often performed manually by testers, which consumes a lot of manpower and has a problem of missing testing, so that the testing result cannot faithfully reflect the product performance.
Disclosure of Invention
The embodiment of the invention provides a terminal testing method, a terminal testing device, a storage medium and an electronic device, which are used for at least solving the problem of low testing efficiency caused by different types of devices to be tested in the related technology.
According to an embodiment of the present invention, there is provided a terminal testing method including:
acquiring a test instruction from an interactive end for indicating to test target equipment;
analyzing the test instruction to obtain a target operation instruction;
analyzing the received target script according to the target operation instruction to obtain a target action element, wherein the target action element is allowed to be identified by various different types of equipment;
and executing test operation on the target equipment according to the target action element.
In an exemplary embodiment, the performing a test operation on the target device according to the target action element:
executing a target operation indicated by the target action element on first target data stored in the target equipment to obtain a first operation result;
and determining an action test result of the test executed on the target equipment based on the first operation result.
In an exemplary embodiment, performing the target operation indicated by the target action element on the first target data stored in the target device to obtain the first operation result comprises:
determining operation authority allowed to be operated by the first target data;
and under the condition that the first target data is determined to be allowed to be executed with the target operation, executing the target operation on the first target data to obtain a first operation result.
In an exemplary embodiment, before parsing the received target script to obtain the target action element according to the target execution instruction, the method includes: analyzing the target data stored in the different types of equipment to respectively obtain a plurality of action languages; comparing the plurality of action languages to obtain a common language among the plurality of action languages; combining the common language and preset platform characteristics to obtain a target action language set suitable for the various different types of equipment;
analyzing the received target script according to the target operation instruction to obtain a target action element comprises: and analyzing the received target script according to the target operation instruction to obtain the target action elements contained in the target action language set.
In an exemplary embodiment, after parsing the test instruction to obtain the target execution instruction, the method further comprises:
analyzing the received target script according to the target operation instruction to obtain a target image element;
and executing test operation on the target equipment according to the target image element.
In one exemplary embodiment, performing a test operation on the target device according to the target image element includes:
according to the target image element, performing image recognition operation on second target data stored in the target equipment to obtain a second operation result;
determining a test result of performing a test on the target device based on the second operation result.
In an exemplary embodiment, performing an image recognition operation on second target data stored in the target device according to the target image element to obtain a second operation result comprises:
analyzing image data included in the second target data to obtain an initial image;
adjusting the resolution of the initial image to obtain a target image with the resolution meeting a target condition;
and matching the target image with the target image element to obtain the second operation result.
In an exemplary embodiment, the adjusting the resolution of the initial image to obtain the target image with the resolution satisfying the target condition includes: performing resolution adjustment on the initial image to obtain the target image with the resolution consistent with the resolution of the target image element;
matching the target image with the target image element to obtain the second operation result comprises: and matching a first sub-image in a predetermined area in the target image with a second sub-image in the predetermined area in the target image element to obtain the second operation result.
According to another embodiment of the present invention, there is provided a terminal test apparatus including:
the instruction receiving module is used for acquiring a test instruction which is from the interactive end and used for indicating the target equipment to be tested;
the instruction analysis module is used for analyzing the test instruction to obtain a target operation instruction;
the script analysis module is used for analyzing the received target script according to the target operation instruction to obtain a target action element, wherein the target action element is allowed to be identified by various types of equipment;
and the operation execution module is used for executing test operation on the target equipment according to the target action element.
According to a further embodiment of the present invention, there is also provided a computer-readable storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
According to the invention, the test operation of different devices can be adapted by analyzing the test instruction and the target script, so that the problem of low test efficiency caused by different types of devices to be tested can be solved, and the effect of improving the test efficiency is achieved.
Drawings
Fig. 1 is a block diagram of a hardware structure of a mobile terminal according to a terminal testing method of an embodiment of the present invention;
FIG. 2 is a flow chart of a method of testing a terminal according to an embodiment of the invention;
FIG. 3 is a block diagram of a terminal testing apparatus according to an embodiment of the present invention;
FIG. 4 is a flow diagram according to a specific embodiment of the present invention;
fig. 5 is a schematic structural diagram according to an embodiment of the present invention.
Detailed Description
Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings in conjunction with the embodiments.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
The method embodiments provided in the embodiments of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking an example of the operation on a mobile terminal, fig. 1 is a hardware structure block diagram of the mobile terminal of a terminal testing method according to an embodiment of the present invention. As shown in fig. 1, the mobile terminal may include one or more (only one shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), and a memory 104 for storing data, wherein the mobile terminal may further include a transmission device 106 for communication functions and an input-output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration, and does not limit the structure of the mobile terminal. For example, the mobile terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store a computer program, for example, a software program and a module of application software, such as a computer program corresponding to a terminal testing method in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, so as to implement the method described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the mobile terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In this embodiment, a terminal testing method is provided, and fig. 2 is a flowchart of a terminal testing method according to an embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
step S202, obtaining a test instruction from an interactive end for indicating to test the target equipment;
in this embodiment, the test instruction is obtained to start a test device or apparatus to test a target device.
The interactive end may be (but is not limited to) a UI (User Interface) interactive Interface, an interactive panel or an operation console provided with buttons, or other devices or apparatuses capable of transmitting instructions; the mode for receiving the test instruction can be a mode of receiving through wired connection, or through wireless networks such as Bluetooth, 3G/4G/5G and the like, or through quantum communication; the test instruction may be a trigger signaling for triggering a test action, or may be a data packet containing information such as a type and a test mode of the target device, or may be an instruction in another form; the generation of the test instruction may be generated by clicking a test button of the UI interactive interface, or by pressing or touching a control button of the console or the interactive panel, or may be automatically generated by a preset sensing device after sensing the connection of the target device.
For example, the test instruction may be a data packet which is loaded in yml format, tests an android system of a certain type of mobile phone, and includes information such as a test path, an address of a page to be tested, and a unique identification code of the mobile phone, and the test instruction may be transmitted from the UI interactive interface to the test device through the ethernet, and after receiving the test instruction, the corresponding test device starts to perform a page test on the target mobile phone.
Step S204, analyzing the test instruction to obtain a target operation instruction;
in this embodiment, because the interaction end and the test device or apparatus have a problem of different data formats, a target operation instruction which can be identified by the test device and can trigger the test device to operate needs to be obtained through an analysis step, so that the test device performs a corresponding test on the target device according to the target operation instruction.
The analysis of the test instruction can be realized by performing analysis calculation through a preset analysis algorithm, or by translating the test instruction according to a preset format, or by storing information in the test instruction to a corresponding position according to an arrangement mode; when the information in the test command is stored, the information may be (but is not limited to) classified and identified according to the identification code of the information and then stored, or may be classified and stored according to other manners; the target operation instruction may (but is not limited to) include information such as a trigger instruction for triggering the test device to operate according to a preset operation step and form, a type of the target device, a test mode, and the like; the device or apparatus for parsing the test instruction may be (but is not limited to) an apparatus or module located in the test apparatus, such as a logic computation module like a CPU, an FPGA, etc., or an external logic computation apparatus or apparatus, such as a cloud computing server, etc., or other apparatuses or apparatuses capable of performing logic computation; when the analysis device is an external device, the transmission of the test command and the transmission of the target operation command may be performed by wired and/or wireless transmission such as ethernet or bluetooth.
For example, the test instruction is analyzed through a preset algorithm stored in a logic computation module in the test equipment, so as to obtain a target operation instruction which triggers the test equipment to execute the test action.
Step S206, analyzing the received target script according to the target operation instruction to obtain a target action element, wherein the target action element is allowed to be identified by various different types of equipment;
in this embodiment, the obtaining of the target action element is to determine an action to be executed by the target script input by the user, so that whether the action execution condition of the target device meets the requirement can be determined, and the test on the target device is realized; and because the target action element can be identified by the equipment of multiple different types, therefore can realize the action test of crossing the platform, need not to test the equipment of multiple different types through different test equipment, reduced work load, simultaneously through test equipment by oneself to test the equipment of multiple different types and establish, reduced artifical participation, improved the measuring accuracy promptly, avoid appearing the condition of louing examining, also improved efficiency of software testing.
The target script may be (but is not limited to) input into the test device from the interaction end by a user, may also be input into the test device directly through an external storage device, for example, through a storage device such as a usb disk, a mobile hard disk, a Flash, etc. connected to an interface of the test device, and may also be obtained by wireless transmission from a cloud storage server through a wireless communication module; the target action element may (but is not limited to) be a certain code set for implementing an operation action, such as a "click" action, a "paste" action, etc., or a code set for implementing a certain system action, such as a "power off" action, a "restart" action, etc., or a function action, such as a "music play" action, a "light" action, etc.
For example, a user connects a mobile hard disk through an interface of the test equipment, and then transmits a target script stored in the mobile hard disk to the test equipment, so that the test equipment executes a test operation according to the target script.
And step S208, executing test operation on the target equipment according to the target action element.
In the embodiment, the purpose of executing the test operation on the target device according to the target action element is to reduce the interference of other elements on the test operation, thereby improving the test accuracy.
The test operation may be to drive the target device to execute the target action according to the target action element, and determine the action execution status of the target device according to the feedback information of the action execution, for example, determine whether the action execution status of the target device meets the requirement according to the state or parameter of whether the feedback action is successfully executed, the action execution consumes time, the action execution occupies memory, and the like; other testing modes are also possible; the target device may be a device supporting iOS, Android, Web, Symbian, and other pages, such as a mobile phone, a mobile PC computer, an industrial computer, and the like.
Through the steps, the target devices of various different types are tested through the test equipment, so that different devices do not need to be tested through special test equipment, the problem of low test efficiency is solved, and the test efficiency is improved.
The main body of the above steps may be a base station, a terminal, etc., but is not limited thereto.
In an alternative embodiment, according to the target action element, the test operation is performed on the target device:
step S2082, executing a target operation indicated by the target action element on first target data stored in the target device to obtain a first operation result;
step S2084, determining an action test result of the test performed on the target device based on the first operation result.
In this embodiment, the first target data stored in the target device includes data such as object information for executing the target operation, an object information storage area, and an action execution area, and thus executing the target operation using the first target data enables the target device to accurately execute the target operation, thereby improving test efficiency.
The first target data further includes data required for performing a target operation, such as the number of objects, a path executed by the objects, and the like, and the target operation may include (but is not limited to) reading the first target data, parsing the first target data, executing an action indicated by the target action element according to a parsing result, and the like; the first operation result includes (but is not limited to) states or parameters such as whether the action is executed successfully, time consumed for executing the action, memory occupied by executing the action, and the like; the process of obtaining the first operation result may be transmission through a network such as ethernet, or transmission through a wireless module such as bluetooth, or network transmission through a 3G/4G/5G network module, or transmission through quantum communication.
For example, after the first target data is read, information such as an object and the number of objects for executing a click action is determined, then the mobile phone to be tested is driven to execute the click action according to the read result, and a first operation result such as a successful state, time consumption, memory occupation and other state information or parameters for executing the click action is fed back to the test equipment, and then the test equipment feeds back the first operation result as an action test result to the interaction terminal through the ethernet and displays the first operation result at the interaction terminal.
In an alternative embodiment, performing the target operation indicated by the target action element on the first target data stored in the target device to obtain the first operation result comprises:
step S20822, determining the operation authority allowed to be operated by the first target data;
step S20824, in a case where it is determined that the first target data allows the target operation to be performed, performing the target operation on the first target data to obtain a first operation result.
In the embodiment, the operation authority of the first target data is determined to reduce the execution of unauthorized operations, thereby reducing the test time lengthening and test errors caused by the execution of unauthorized operations.
The process of determining the operation authority may (but is not limited to) determine according to a reading result of the first target data, for example, according to an identification code included in the first target number in the reading result, and it should be noted that different identification codes correspond to different operation authorities and actions corresponding to the operation authorities.
In an optional embodiment, before parsing the received target script according to the target execution instruction to obtain the target action element, the method includes:
step S20602, analyzing target data stored in a plurality of different types of equipment to respectively obtain a plurality of action languages;
step S20604, comparing the plurality of action languages to obtain a common language among the plurality of action languages;
step S20606, combining according to the common language and the preset platform characteristics to obtain a target action language set suitable for various different types of equipment;
analyzing the received target script according to the target operation instruction to obtain the target action element comprises:
step S2062, according to the target running instruction, parsing the received target script to obtain the target action element included in the target action language set.
In the present embodiment, the purpose of determining the target action language set suitable for different types of devices by comparing multiple action languages is to obtain target action elements that can be recognized by different types of devices.
The action language may be (but is not limited to) an action instruction in an XML format, and may also be an action instruction in another format; the common language among the multiple action languages can be the common part of the action instructions of the pages of iOS, Android, Web, Symbian and the like; the part for obtaining the action language can be an action instruction in an XML format for obtaining the page of the whole target device through getPageSource operation in a Webdriver protocol, and can also be obtained through other modes; it should be noted that, the number of the XML-format action instructions corresponding to one page may be (but is not limited to) 1, or may be multiple; the process of obtaining the target action language set may be obtained by recompiling the common language according to the common language and platform features of different platforms, or may be obtained by other means.
For example, the XML action instructions of the complete pages of different types of devices are obtained through getPageSource operation in the WebDriver protocol, then the common language in the XML action instructions of the complete pages of different types of devices is extracted through analyzing the XML action instructions, and then the Xpath information of the elements on the corresponding devices is assembled according to the characteristics of the different devices, wherein the Xpath information is used for positioning the target information.
In an optional embodiment, after parsing the test instruction to obtain the target operation instruction, the method further includes:
step S2010, analyzing the received target script according to the target operation instruction to obtain a target image element;
in step S2012, a test operation is performed on the target device according to the target image element.
In this embodiment, the target image element is obtained to determine an image indicated by a target script input by a user, so that whether the image display condition of the target device meets requirements can be determined, and a test on the target device is realized.
The target image element may be (but is not limited to) a still picture, a moving picture, a video, a game picture, etc.; the test operation may include, but is not limited to, flashing different pixel points for displaying the image, luminescence detection, and the like.
In an alternative embodiment, performing a test operation on the target device based on the target image element comprises:
step S20122, according to the target image element, performing image recognition operation on second target data stored in the target equipment to obtain a second operation result;
step S20124, determining a test result of performing the test on the target device based on the second operation result.
In the embodiment, the purpose of executing the test operation on the target device according to the target image element is to reduce the interference of other elements on the test operation, thereby improving the test accuracy.
The test operation may be to drive the target device to display the target image according to the target image element, and determine the action execution status of the target device according to the feedback information of image display, for example, determine whether the image display status of the target device meets the requirement according to the status or parameters of whether the feedback display is successfully executed, the image display consumes time, and the image display occupies memory.
In an alternative embodiment, performing the image recognition operation on the second target data stored in the target device according to the target image element to obtain the second operation result comprises:
step S201222, analyzing image data included in the second target data to obtain an initial image;
step S201224, the resolution of the initial image is adjusted to obtain a target image with the resolution meeting the target condition;
step S201226, matching the target image with the target image element to obtain a second operation result.
In this embodiment, the resolution adjustment of the initial image is performed to enable the initial image to be recognized by the testing device, so that the problem that the recognition calculation amount is increased due to different resolutions is reduced, the calculation amount is further reduced, and the testing efficiency is improved; the matching between the target image and the target image element is to determine whether the target device meets the requirements for processing and displaying the target image, so as to determine whether the image test is successful.
The matching of the target image and the target image element can be realized by matching the whole image data of the target image with the whole image data of the target image element, so that matching errors are avoided; it is also possible to match the partial image data of the target image with the partial image data of the target image elements, thereby reducing the amount of computation of the matching process.
It should be noted that, when matching local image data, it is necessary to establish an association mapping between image regions, so that the region of the target image can correspond to the region of the target image, thereby ensuring the accuracy of data matching.
In an optional embodiment, performing resolution adjustment on the initial image to obtain a target image with a resolution satisfying a target condition includes:
step S2012242, adjusting the resolution of the initial image to obtain a target image with the resolution consistent with the resolution of the target image element;
matching the target image with the target image element to obtain a second operation result comprises:
step S2012262, matching the first sub-image located in the predetermined area in the target image with the second sub-image located in the predetermined area in the target image element to obtain a second operation result.
In this embodiment, the adjustment of the resolution of the initial image to be consistent with the resolution of the target image element is to facilitate the matching between the initial image and the target image element, so as to improve the matching efficiency; and the matching of the first sub-image in the predetermined area in the target image with the second sub-image in the predetermined area in the target image element is to reduce the amount of calculation, thereby improving the testing efficiency.
The predetermined area may be any area such as the middle part, the upper left corner, the lower right corner, and the like in the image, and the number of the predetermined areas may be one, so as to reduce the amount of calculation, or may be multiple, so as to improve the accuracy of matching.
For example, in order to improve the matching accuracy of image recognition, a color picture captured from a target device is processed into a gray-scale picture, and then the gray-scale picture is converted into a picture depicting the outline of each content in the picture by using an edge detection algorithm. And then, carrying out template matching by using the target element picture (which is also processed by the steps) and the processed intercepted picture, wherein the resolution of the target element picture can be reduced within a certain range in the template matching process due to different equipment resolutions, the target element picture is compared for multiple times, and then the optimal solution is selected to return the corresponding picture element position information.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
In this embodiment, a terminal testing apparatus is further provided, and the apparatus is used to implement the foregoing embodiments and preferred embodiments, and the description of the apparatus is omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 3 is a block diagram of a terminal testing apparatus according to an embodiment of the present invention, as shown in fig. 3, the apparatus includes:
the instruction receiving module 32 is configured to obtain a test instruction from the interactive terminal, where the test instruction is used to instruct to test the target device;
the instruction analysis module 34 is used for analyzing the test instruction to obtain a target operation instruction;
a script parsing module 36, configured to parse the received target script according to the target operation instruction to obtain a target action element, where the target action element is allowed to be identified by multiple different types of devices;
and the operation execution module 38 is configured to execute a test operation on the target device according to the target action element.
In an alternative embodiment, the operation execution module 38 includes:
an operation execution unit 382, configured to execute a target operation indicated by the target action element on first target data stored in the target device to obtain a first operation result;
a result determination unit 384 for determining an action test result of the test performed on the target device based on the first operation result.
In an alternative embodiment, the operation performing unit 382 includes:
a permission determination subunit 3822 configured to determine an operation permission that the first target data is permitted to be operated;
a result determining subunit 3824, configured to, in a case that it is determined that the first target data allows the target operation to be performed, perform the target operation on the first target data to obtain a first operation result.
In an alternative embodiment of the method according to the invention,
the device also includes:
a data parsing unit 3602, configured to parse target data stored in multiple different types of devices to obtain multiple action languages respectively;
a language comparison unit 3604, configured to compare multiple action languages to obtain a common language among the multiple action languages;
a language combination unit 3606, configured to combine according to the common language and preset platform features to obtain a target action language set applicable to multiple different types of devices;
the script parsing module 36 further includes:
and an action parsing unit 362, configured to parse the received target script according to the target operation instruction to obtain the target action element included in the target action language set.
In an optional embodiment, the apparatus further comprises:
the image analysis module 310 is configured to analyze the received target script according to the target operation instruction to obtain a target image element;
and an image testing module 312, configured to perform a testing operation on the target device according to the target image element.
In an alternative embodiment, the image testing module 312 includes:
an image recognition unit 3122, configured to perform an image recognition operation on second target data stored in the target device according to the target image element to obtain a second operation result;
an image result determination unit 3124 configured to determine a test result of performing a test on the target device based on the second operation result.
In an alternative embodiment, the image recognition unit 3122 includes:
an image parsing subunit 3122, configured to parse image data included in the second target data to obtain an initial image;
a resolution adjustment subunit 3124, configured to perform resolution adjustment on the initial image to obtain a target image with a resolution that meets a target condition;
and the element matching subunit 3126 is configured to match the target image with the target image element to obtain a second operation result.
In an alternative embodiment of the method according to the invention,
the resolution adjustment subunit 3124 includes:
a target resolution adjustment subunit 31242, configured to perform resolution adjustment on the initial image to obtain a target image with a resolution consistent with the resolution of the target image element;
the element matching subunit 3126 includes:
a sub-image matching sub-unit 31262 for matching a first sub-image located in a predetermined area in the target image with a second sub-image located in a predetermined area in the target image element to obtain a second operation result.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
The present invention will be described with reference to specific examples.
As shown in fig. 4 and 5, a target device to be tested and a test device to be used for testing are determined (corresponding to step 3.1 in fig. 4), then a test instruction is input through a kooltest web module of a display layer of the test device (corresponding to step 6 in fig. 4), then the test instruction is run, and an input script is analyzed according to the run instruction (corresponding to step 3.2 in fig. 4), wherein the script is a script rule based on a set of class keywords of cuumber as a framework;
then, respectively executing image recognition test operation (corresponding to a corresponding step 3.4 in fig. 4) and/or executing action test through dynamic Xpath (corresponding to a corresponding step 3.3 in fig. 4) according to the analysis result, wherein the steps are respectively realized through a service layer and an execution layer in the test equipment, and the action test of the dynamic Xpath can be realized by firstly obtaining XML of the whole page through a method of getPageSource in WebDriver protocol, extracting commonalities therein through analysis, assembling corresponding Xpath files according to different platform characteristics, then obtaining target action elements according to the extracted Xpath, and executing the action test according to the target action elements; the image test can find a partial image of a predetermined area from an image and return the position information of the predetermined area. Before this, the resolution of the picture needs to be adjusted, and then the picture needs to be matched to obtain the image test result.
The test results are then displayed by the KoolTestWeb module of the presentation layer (corresponding to step 5.3 in fig. 4); it should be noted that, the execution steps of the service layer and the execution layer are as follows: the service layer triggers script analysis action according to the operation instruction, and then the execution layer carries out corresponding test action according to the analysis result.
It should be noted that KoolTestWeb in fig. 4 and 5 is a user interaction interface, and the interaction interface is used for selecting corresponding devices, packages, and scripts for testing and facilitating viewing of result reports; the KoolTestServer is mainly used for storing information such as running states of equipment, packages and test cases, and can operate Jenkins to perform functions such as task creation, deletion, starting and the like; the KoolTest is a main code running system and is mainly used for instruction running, namely responsible for script analysis and command running and responsible for communication in specific execution equipment; the KoolTest module runs on Jenkins, each execution device corresponds to a Jenkins task, and each task has a separate process to run the KoolTest. Therefore, the platform can efficiently and simultaneously execute a plurality of test tasks and return a plurality of results; the script manager is a script management system, and an execution layer is used for interacting with specific running equipment.
Embodiments of the present invention also provide a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
In an exemplary embodiment, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary embodiments, and details of this embodiment are not repeated herein.
It will be apparent to those skilled in the art that the various modules or steps of the invention described above may be implemented using a general purpose computing device, they may be centralized on a single computing device or distributed across a network of computing devices, and they may be implemented using program code executable by the computing devices, such that they may be stored in a memory device and executed by the computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into various integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A terminal testing method is characterized by comprising the following steps:
acquiring a test instruction from an interactive end for indicating to test target equipment;
analyzing the test instruction to obtain a target operation instruction;
analyzing the received target script according to the target operation instruction to obtain a target action element, wherein the target action element is allowed to be identified by various different types of equipment;
and executing test operation on the target equipment according to the target action element.
2. The method of claim 1, wherein the performing a test operation on the target device according to the target action element:
executing a target operation indicated by the target action element on first target data stored in the target equipment to obtain a first operation result;
and determining an action test result of the test executed on the target equipment based on the first operation result.
3. The method of claim 2, wherein performing the target operation indicated by the target action element on the first target data stored in the target device to obtain a first operation result comprises:
determining operation authority allowed to be operated by the first target data;
and under the condition that the first target data is determined to be allowed to be executed with the target operation, executing the target operation on the first target data to obtain a first operation result.
4. The method of claim 1,
before parsing the received target script according to the target operation instruction to obtain a target action element, the method includes: analyzing the target data stored in the different types of equipment to respectively obtain a plurality of action languages; comparing the plurality of action languages to obtain a common language among the plurality of action languages; combining the common language and preset platform characteristics to obtain a target action language set suitable for the various different types of equipment;
analyzing the received target script according to the target operation instruction to obtain a target action element comprises: and analyzing the received target script according to the target operation instruction to obtain the target action elements contained in the target action language set.
5. The method of claim 1, wherein after parsing the test instructions to obtain target run instructions, the method further comprises:
analyzing the received target script according to the target operation instruction to obtain a target image element;
and executing test operation on the target equipment according to the target image element.
6. The method of claim 5, wherein performing a test operation on the target device according to the target image element comprises:
according to the target image element, performing image recognition operation on second target data stored in the target equipment to obtain a second operation result;
determining a test result of performing a test on the target device based on the second operation result.
7. The method of claim 6,
according to the target image element, performing an image recognition operation on second target data stored in the target device to obtain a second operation result comprises:
analyzing image data included in the second target data to obtain an initial image;
adjusting the resolution of the initial image to obtain a target image with the resolution meeting a target condition;
and matching the target image with the target image element to obtain the second operation result.
8. The method of claim 7, wherein performing resolution adjustment on the initial image to obtain a target image with a resolution satisfying a target condition comprises: performing resolution adjustment on the initial image to obtain the target image with the resolution consistent with the resolution of the target image element;
matching the target image with the target image element to obtain the second operation result comprises: and matching a first sub-image in a predetermined area in the target image with a second sub-image in the predetermined area in the target image element to obtain the second operation result.
9. A terminal testing device, comprising:
the instruction receiving module is used for acquiring a test instruction which is from the interactive end and used for indicating the target equipment to be tested;
the instruction analysis module is used for analyzing the test instruction to obtain a target operation instruction;
the script analysis module is used for analyzing the received target script according to the target operation instruction to obtain a target action element, wherein the target action element is allowed to be identified by various types of equipment;
and the operation execution module is used for executing test operation on the target equipment according to the target action element.
10. A storage medium, in which a computer program is stored, wherein the computer program is arranged to perform the method of any of claims 1 to 8 when executed.
CN202011568980.7A 2020-12-25 2020-12-25 Terminal testing method and device, storage medium and electronic device Pending CN112667505A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011568980.7A CN112667505A (en) 2020-12-25 2020-12-25 Terminal testing method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011568980.7A CN112667505A (en) 2020-12-25 2020-12-25 Terminal testing method and device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN112667505A true CN112667505A (en) 2021-04-16

Family

ID=75409763

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011568980.7A Pending CN112667505A (en) 2020-12-25 2020-12-25 Terminal testing method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN112667505A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180137025A1 (en) * 2016-11-14 2018-05-17 Microsoft Technology Licensing, Llc Multi-language playback framework
CN108804305A (en) * 2017-05-05 2018-11-13 北京嘀嘀无限科技发展有限公司 A kind of method and device of automatic test
CN109144857A (en) * 2018-08-01 2019-01-04 武汉普利商用机器有限公司 Cross-platform test of heuristics method and system
US20190065354A1 (en) * 2016-02-24 2019-02-28 Entit Software Llc Application content display at target screen resolutions
CN109726107A (en) * 2018-06-01 2019-05-07 平安普惠企业管理有限公司 Test method, device, equipment and storage medium
CN110347603A (en) * 2019-07-12 2019-10-18 北京精密机电控制设备研究所 A kind of automation software testing system and method for artificial intelligence
CN110389900A (en) * 2019-07-10 2019-10-29 深圳市腾讯计算机系统有限公司 A kind of distributed experiment & measurement system test method, device and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190065354A1 (en) * 2016-02-24 2019-02-28 Entit Software Llc Application content display at target screen resolutions
US20180137025A1 (en) * 2016-11-14 2018-05-17 Microsoft Technology Licensing, Llc Multi-language playback framework
CN108804305A (en) * 2017-05-05 2018-11-13 北京嘀嘀无限科技发展有限公司 A kind of method and device of automatic test
CN109726107A (en) * 2018-06-01 2019-05-07 平安普惠企业管理有限公司 Test method, device, equipment and storage medium
CN109144857A (en) * 2018-08-01 2019-01-04 武汉普利商用机器有限公司 Cross-platform test of heuristics method and system
CN110389900A (en) * 2019-07-10 2019-10-29 深圳市腾讯计算机系统有限公司 A kind of distributed experiment & measurement system test method, device and storage medium
CN110347603A (en) * 2019-07-12 2019-10-18 北京精密机电控制设备研究所 A kind of automation software testing system and method for artificial intelligence

Similar Documents

Publication Publication Date Title
CN108804302B (en) Remote testing method, system and related equipment
CN111240973B (en) Equipment testing method and system based on simulation and readable storage medium
CN107957940B (en) Test log processing method, system and terminal
CN107688530A (en) Method for testing software and device
CN108763086A (en) Script method for recording, terminal and computer readable storage medium based on remote real machine
CN111813687A (en) Test method, test device, control terminal, test equipment and storage medium
CN111258913A (en) Automatic algorithm testing method and device, computer system and readable storage medium
CN108960587A (en) Evaluation method, device and the readable storage medium storing program for executing of purchase of property consulting services quality
CN114780377A (en) Method and device for determining software exception, storage medium and electronic device
CN111694550B (en) Page display control method, device and system
CN114186699A (en) Quality inspection node optimization method and device, computer equipment and storage medium
CN112765427A (en) Environment-friendly monitoring data processing method and device based on mqtt protocol
CN108898229B (en) Method and system for constructing machine learning modeling process
CN112256557B (en) Program regression testing method, device, system, computer equipment and storage medium
CN113407469A (en) Parameter configuration method and device, storage medium and electronic device
CN109740074B (en) Method, device and equipment for processing parameter configuration information
CN112667505A (en) Terminal testing method and device, storage medium and electronic device
CN116028367A (en) Automatic test system and method
CN111352023B (en) Crystal oscillator detection method and device and computer readable storage medium
CN114564387A (en) Scene type automatic testing method and system for OpenStack cloud platform
CN110968519A (en) Game testing method, device, server and storage medium
CN113157511B (en) Peripheral detection method, device and readable storage medium
CN113742553B (en) Data processing method and device
CN112150431B (en) UI vision walking method and device, storage medium and electronic device
CN113282502A (en) Script generation 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