CN110879777A - Control testing method and device for application interface, computer equipment and storage medium - Google Patents

Control testing method and device for application interface, computer equipment and storage medium Download PDF

Info

Publication number
CN110879777A
CN110879777A CN201910969500.9A CN201910969500A CN110879777A CN 110879777 A CN110879777 A CN 110879777A CN 201910969500 A CN201910969500 A CN 201910969500A CN 110879777 A CN110879777 A CN 110879777A
Authority
CN
China
Prior art keywords
control
instruction
tested
test
acquiring
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
CN201910969500.9A
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.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN201910969500.9A priority Critical patent/CN110879777A/en
Publication of CN110879777A publication Critical patent/CN110879777A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Abstract

The invention discloses a control testing method and device of an application interface, computer equipment and a storage medium, which can reduce the professional requirements on testers, and can effectively improve the testing efficiency to a certain extent by reducing the professional requirements on the testers. The method comprises the following steps: acquiring a control acquiring instruction and a test function acquiring instruction triggered by a user, wherein the control acquiring instruction and the test function acquiring instruction are directed to the same control, and the user triggers the generated instruction; obtaining a test function according to the test function instruction; acquiring a control image corresponding to the tested control according to the control acquisition instruction; acquiring identification information corresponding to the tested control according to the control image; acquiring the position information of the tested control in the application interface according to the identification information; and when a test instruction of a user is received, executing the test function according to the position information so as to test the tested control.

Description

Control testing method and device for application interface, computer equipment and storage medium
Technical Field
The invention relates to the technical field of testing, in particular to a method and a device for testing a control of an application interface, computer equipment and a storage medium.
Background
UI testing, also known as User Interface (UI), is a process of testing UI controls on a user interface. For example, clicking a control on the user interface detects whether the clicked control triggers the desired result.
At present, when a control is tested, codes are generally required to be written to simulate operations such as clicking, and because the tested APPs have various controls and different types, writing different codes for different controls to perform simulation testing is heavy and professional work, that is, a large number of complex code sentences are generally required to be written to position the control, and the efficiency is affected. In addition, due to professional requirements, compiling of the test script requires that a tester has a certain code foundation and a certain code compiling capability, so that the test difficulty is improved to a certain extent, and the test efficiency is reduced.
Disclosure of Invention
The embodiment of the invention provides a control testing method and device of an application interface, computer equipment and a storage medium, which can reduce the professional requirements on testers and effectively improve the testing efficiency.
A control testing method of an application interface comprises the following steps:
acquiring a control acquiring instruction and a test function acquiring instruction triggered by a user, wherein the control acquiring instruction and the test function acquiring instruction are directed to the same control, and the user triggers the generated instruction;
obtaining a test function according to the test function instruction;
acquiring a control image corresponding to the tested control according to the control acquisition instruction;
acquiring identification information corresponding to the tested control according to the control image;
acquiring the position information of the tested control in the application interface according to the identification information;
and when a test instruction of a user is received, executing the test function according to the position information so as to test the tested control.
A control testing device of an application interface comprises:
the device comprises a first acquisition module, a second acquisition module and a control acquisition module, wherein the first acquisition module is used for acquiring a control acquisition instruction and a test function acquisition instruction which are triggered by a user, and the control acquisition instruction and the test function acquisition instruction are directed at the same control and are generated by user triggering;
the second obtaining module is used for obtaining a test function according to the test function instruction;
the third acquisition module is used for acquiring a control image corresponding to the tested control according to the control acquisition instruction;
the fourth obtaining module is used for obtaining the identification information corresponding to the tested control according to the control image;
a fifth obtaining module, configured to obtain, according to the identification information, position information of the tested control on the application interface;
and the execution module is used for executing the test function according to the position information when receiving a test instruction of a user so as to test the tested control.
A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the control testing method of the application interface when executing the computer program.
A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out the steps of the above-mentioned control testing method for an application interface.
In one scheme implemented by the method, the device, the computer equipment and the storage medium for testing the control of the application interface, a control obtaining instruction and a test function obtaining instruction triggered by a user are obtained, wherein the control obtaining instruction and the test function obtaining instruction are directed to the same control, the user triggers the generated instruction, and a test function is obtained according to the test function instruction; acquiring a control image corresponding to the tested control according to the control acquisition instruction; acquiring identification information corresponding to the tested control according to the control image; acquiring the position information of the tested control in the application interface according to the identification information; and when a test instruction of a user is received, executing a test function according to the position information so as to test the tested control. Therefore, the testing function and the tested control can be obtained according to the instruction triggered by the user, the position of the tested control on the application interface is identified according to the control screenshot corresponding to the tested control, the tested control is directly tested by using the position information of the tested control and the testing function, the tested control is not required to be positioned by writing a positioning statement, the professional requirement on a tester is reduced, and the testing efficiency can be effectively improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
FIG. 1 is a schematic structural diagram of a test system applied to a control testing method for an application interface according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a control testing method for an application interface according to an embodiment of the present invention;
FIG. 3 is another schematic flowchart of a control testing method for an application interface according to an embodiment of the present invention;
FIG. 4 is another schematic flowchart of a control testing method for an application interface according to an embodiment of the present invention;
FIG. 5 is another flowchart illustrating a control testing method for an application interface according to an embodiment of the present invention;
FIG. 6 is another flowchart illustrating a control testing method for an application interface according to an embodiment of the present invention;
FIG. 7 is a schematic structural diagram of a control testing apparatus of an application interface according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a computer device in the embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments obtained based on the embodiments of the present invention belong to the protection scope of the present invention.
The control testing method of the application interface provided by the embodiment of the invention is applied to the testing system shown in fig. 1, the testing system comprises a testing end and a tested end, the testing end and the tested end are communicated through a network, and the testing end is used for realizing the control testing method of the application interface provided by the invention. The tested terminal is also called a user terminal, and the tested terminal can be installed on, but not limited to, various personal computers, notebook computers, smart phones, tablet computers and portable wearable devices. The test end is a test device which is provided with a display interface and is used for synchronizing the application interface of the tested end. The following describes in detail embodiments of the present invention:
as shown in fig. 2, in an embodiment, an embodiment of the present invention provides a method for testing a control of an application interface, including the following steps:
s10: acquiring a control acquiring instruction and a test function acquiring instruction triggered by a user, wherein the control acquiring instruction and the test function acquiring instruction are directed to the same control, and the user triggers the generated instruction;
in the embodiment of the invention, when the tested control needs to be tested, a control obtaining instruction and a test function obtaining instruction triggered by a user can be obtained, and the control obtaining instruction is associated with the test function obtaining instruction. The control obtaining instruction is used for selecting a tested control, the test function obtaining instruction is used for selecting a test function, and the control obtaining instruction is associated with the test function obtaining instruction, namely, the control obtaining instruction and the test function obtaining instruction triggered by a current user are directed to the same tested control, namely, the control obtaining instruction and the test function obtaining instruction are directed to the same control, and the user triggers a generated instruction. In some embodiments, the tested control refers to any control of an application interface on the tested object, for example, the tested object may refer to a webpage or an APP, and the application interface of the tested object refers to a front-end interface of the webpage or a UI interface of the APP. It can be appreciated that, at present, in order to enrich the functionality of a web page or APP and improve the user experience, various controls are often integrated on the web page or APP to implement specific functionality. The tested controls refer to controls such as function icons, buttons, link icons and input boxes on an application interface of the webpage \ APP.
It should be noted that the test function refers to a pre-written script program for implementing automated testing. For example, a test function such as a touch () function and a skip () function, where touch () is a function simulating a single-click operation of a user and skip () is a function simulating a drag operation of the user. In the embodiments of the present invention, there are other test functions, which are not listed here.
S20: and acquiring a test function according to the test function instruction.
After the test function instruction triggered by the user is obtained, the required test function can be obtained according to the test function instruction.
S30: and acquiring a control image corresponding to the tested control according to the control acquisition instruction.
In the step, after a control obtaining instruction triggered by a user is obtained, a control image corresponding to the tested control is obtained according to the control obtaining instruction. It can be understood that the control is presented by a specific icon (frame, virtual button) and the like on the application interface, and in this step, the control image corresponding to the tested control can be acquired according to the control acquisition instruction.
S40: and acquiring identification information corresponding to the tested control according to the control image.
In the step, after the control image corresponding to the tested control is obtained according to the space obtaining instruction, the identification information corresponding to the tested control is obtained according to the control image. It should be understood that the control on the application interface has unique identification information, and the unique identification information of the tested control can be obtained through the control image in the step.
In an embodiment, as shown in fig. 3, in step S40, that is, obtaining the identification information corresponding to the tested control according to the control image, the method specifically includes the following steps:
s41: and identifying the control image by adopting an image identification technology to obtain the target control characteristic of the tested control.
S42: and acquiring identification information corresponding to the tested control according to the target control characteristics.
For steps S41-S42, it is understood that after the control image of the tested control is obtained, an image recognition technology, for example, TESSERACT-OCR image recognition technology, may be used to recognize the control image to obtain a target control feature of the tested control, and obtain identification information corresponding to the tested control according to the target control feature. Because the identification of the control on the application interface has uniqueness, the identification can be uniquely identified through the target control feature on the tested control, and therefore, the identification information corresponding to the tested control can be obtained by utilizing the target control feature of the tested control. Illustratively, the identification information may be uniquely identified by a character and/or a character string.
In some implementations, as shown in fig. 4, in step S42, that is, obtaining the identification information corresponding to the tested control according to the target control feature, the method specifically includes the following steps:
s421: and acquiring a preset control feature mapping table, wherein the control feature and the identification information of each control on the application interface are stored in the preset control feature mapping table in an associated manner.
S422: and matching the target control feature with the control feature in the preset control feature mapping table.
S423: and if the preset control feature mapping table has a control feature matched with the target control feature, taking the identification information corresponding to the control feature matched with the target control feature as the identification information corresponding to the tested control.
For step S421, in the embodiment of the present invention, a control-identification information mapping table is established in advance through all the controls on the application interface of the tested object, that is, a control characteristic mapping table is established in advance, and specifically, the control characteristic and the identification information of each control on the application interface are stored in the preset control characteristic mapping table in an associated manner. It should be noted that the control feature is a feature for characterizing the control. And firstly, acquiring a preset control feature mapping table between the control image of the tested control and the identification information of the tested control.
For steps S422 to S423, after the preset control feature table is obtained, the target control features are matched with the control features in the preset control feature mapping table one by one, and if the control features matched with the target control features exist in the preset control feature mapping table, the identification information corresponding to the control features matched with the target control features is used as the identification information corresponding to the tested control.
In some embodiments, the target control features include at least one of: control name, control shape, picture in control and control color. It will be appreciated that the target control feature may be one or more of the control features described above. For example, when the target control feature is one of the control features, for example, the target control feature is a control name of the tested control, the identification information corresponding to the tested control may be obtained according to the obtained control name of the control image of the tested control. In addition, the identification information of the tested control can be matched through other characteristics on the control, such as the shape of the control, the picture in the control, the color of the control and the like. It should be noted that, on the application interface, in order to distinguish the respective controls, different controls generally have different control names and are presented on the application interface, but it is not excluded that the control names of some of the controls are not presented on the application interface, or the controls to be tested have the same shape or the same color, and the like, and therefore, matching identification information through a single control feature may be inaccurate, and therefore, further, in order to improve the accuracy of the matched identification information, in some embodiments, identification information corresponding to the controls to be tested may be comprehensively determined through other control features of the controls to be tested, for example, control features of multiple dimensions such as pictures in the controls, control colors, and the like, so that the identification information of the controls to be tested may be accurately obtained. Specifically, the preset control feature mapping table stores identification information of each control and control features of multiple dimensions in an associated manner. And only when the control features of the multiple dimensions of the tested control are correspondingly matched with the control features of the multiple dimensions of a certain control in the preset control feature mapping table, the tested control is considered to be matched with the certain control, and then the identification information of the certain control is determined as the identification information of the tested control. Therefore, the method specifically identifies and determines the identification information of the tested control according to the control image of the tested control, and improves the implementation. For example, there are two submission buttons on the application interface, the control names of the two submission buttons are both "submission", but the submission button to be tested is only one of the two submission buttons, in order to accurately obtain the identification information corresponding to the button to be tested, the identification information of the two submission buttons may be located according to the color values of the two buttons, and the specific determination process may be to match the color values corresponding to all the "submission" controls from the preset control feature mapping table by using the "submission" two words as the keywords, and then match the identification information corresponding to the color value of the submission button from the identification information and the color values corresponding to all the "submission" controls in the preset control feature mapping table by using the color value and the identification information of the tested submission button, that is, the identification information of the control to be tested.
S50: and acquiring the position information of the tested control on the application interface according to the identification information.
In this step, after the identification information of the tested control is obtained, the position information of the tested control on the application interface is obtained according to the identification information. The application interface can be understood as a coordinate system, for each control on the application interface, there is position information corresponding to the control, and the position information of the tested control on the application interface can be obtained according to the identification information through the relevance between the identification information and the control.
In an embodiment, the obtaining of the position information of the tested control on the application interface according to the identification information specifically means that the identification information is used as a parameter to be transmitted to a PCCO control, so as to obtain the position information of the tested control on the application interface through the POCO control. It can be understood that the PCCO control is a plug-in for positioning control position information, and the PCCO control can be used for accurately positioning the position information of the tested control on the application interface.
In addition, in some embodiments in which the control is fixed, determining the position information of the control to be tested on the interface of the object to be tested according to the identification information may also be performed in the following manner: and finding a corresponding tested control from the source code of the object to be tested according to the identification information, and obtaining the pixel coordinate of the control to be tested from the source code of the tested control so as to obtain the position of the control to be tested on the interface of the object to be tested.
S60: and when a test instruction of a user is received, executing the test function according to the position information so as to test the tested control.
In this step, when the position information of the tested control is obtained according to the identification information and a test instruction of a user is received, the test function is executed according to the position information to test the tested control. For example, taking a touch () function as an example, since the touch () function is an instruction for simulating a click operation, after the position information of the tested control is determined, the click operation on the tested control can be simulated through the touch ().
In an embodiment, as shown in fig. 5, in step S10, that is, acquiring the control acquiring instruction and the test function acquiring instruction triggered by the user, the method includes the following steps:
s11: and after the connection with the tested end is detected, displaying a control test interface, wherein the control test interface comprises a test function option interface and a synchronous application interface of the tested end.
S12: and receiving the selection operation of the user on the test function option interface to generate the test function acquisition instruction.
S13: and receiving screenshot operation of the user on the synchronous application interface of the tested end to generate the control acquiring instruction.
For step S11, when testing the tested control, establishing a communication connection with the test terminal, that is, the tested terminal, and displaying a control test interface, where the control test interface includes a test function option interface and a synchronous application interface of the tested terminal. The test function option plane is provided with various test functions, such as the above touch () function, skip () function, etc., for the user to select. And the application interface is used for synchronizing the application interface of the tested end in real time.
For step S12, after the test function option plane is displayed, the user may select a test function on the test function option plane, and for the test end, may receive a screenshot operation of the user on the synchronous application interface of the mobile terminal to generate the test function obtaining instruction, so as to select a desired test function. Specifically, the test functions are presented in the form of a function list, and the user can select a desired test function through the function list.
For step S13, after the synchronous application interface of the tested end is displayed, the user may perform screenshot operation on the synchronous application interface, and for the testing end, the screenshot operation of the user on the synchronous application interface of the mobile terminal may be received to generate the control obtaining instruction. Specifically, in some embodiments, when a user selects a certain test function in a function list in a test function option interface, a screenshot frame is correspondingly generated, the range of the screenshot frame is adjustable, the user can capture a screenshot on a synchronous application interface through the screenshot frame, so as to capture a control image of a tested control, and an adjustable screenshot frame triggered correspondingly when the test function is selected is used to establish the relevance between a test function acquisition instruction and a control acquisition instruction.
In some embodiments, as shown in fig. 6, the method for testing a control of an application interface further includes the following steps:
s70: and sequentially capturing the trigger sequence of the control acquiring instruction and the test function acquiring instruction which are associated with each trigger of the user.
It can be understood that the user can trigger the control obtaining instruction and the test function obtaining instruction as required, and the control obtaining instruction triggered each time has relevance with the test function obtaining instruction. Taking a screenshot mode to obtain a control obtaining instruction and a test function obtaining instruction as an example, according to a test requirement, a user can select a test function and perform screenshot on a tested control, recording is performed for each operation of the user, and a trigger sequence of the control obtaining instruction and the test function obtaining instruction which are associated with each time of triggering of the user is captured in sequence.
S80: and generating a test case according to the triggering sequence and the tested control, the position information and the test function corresponding to the control acquiring instruction and the test function instruction which are associated with each triggering of the user.
In this step, a trigger sequence of the control obtaining instruction and the test function obtaining instruction which are associated with each time of triggering by the user is captured in sequence, and a test case is generated according to the trigger sequence and the tested control, the position information and the test function which are corresponding to the control obtaining instruction and the test function instruction which are associated with each time of triggering by the user. It can be understood that, during testing, in order to uniformly test the logic functions of each control or a certain control, a user may intercept a required tested control and a required test function in a screenshot manner, and finally, according to a trigger sequence, the control associated with each trigger of the user acquires an instruction and a tested control, position information, and a test function corresponding to the test function instruction to generate a test case. Through the step, the user can combine the test cases required for testing the tested control according to the test requirements, and a plurality of test cases can be conveniently tested at one time.
S90: and when a test instruction of a user is received, executing the test case to test the test control on the application interface.
And when a test instruction of a user is received, executing the test case to test the test control on the application interface according to the test logic of the test case, and the corresponding tested control, the position information and the test function in the test case. Because the test case contains the trigger sequence, that is, the test logic, the test function and the position information of each tested control of the tested control, when the test instruction of the user is received, the test case is executed so as to test the test control on the application interface according to the corresponding tested control, the position information and the test function. For example, in the screenshot mode, when the control on the application interface is tested, a user can test the function of a certain control in the screenshot mode, so that selection operations (such as clicking) for triggering the test by the user can be increased, in order to enrich the test scenario and further reduce the tedious operations, the screenshot is performed in sequence through the test logic and the test function of the tested control in sequence, so that the tested control and the required test function are selected out to generate the required test case, and the test case is triggered to test at last, so that the unified test of the control can be realized, the tedious operations brought by testing each control independently are reduced, and the test scenario is enriched.
In some embodiments, further, after the control to be tested is tested, a test result is generated, wherein if the test case runs incorrectly, case error information, such as identification information of the specific control to be tested, and a test function and test time used, is displayed in the test result, and if the test case runs normally, a test report is generated according to the test result.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
In an embodiment, a control testing apparatus of an application interface is provided, where the control testing apparatus of the application interface corresponds to the control testing method of the application interface in the above embodiment one to one. As shown in fig. 7, the control testing apparatus 10 of the application interface includes a first obtaining module 101, a second obtaining module 102, a third obtaining module 103, a fourth obtaining module 104, a fifth obtaining module 105, and an executing module 106. The functional modules are explained in detail as follows:
the first obtaining module 101 is configured to obtain a control obtaining instruction and a test function obtaining instruction triggered by a user, where the control obtaining instruction and the test function obtaining instruction are for the same control, and the user triggers a generated instruction;
a second obtaining module 102, configured to obtain a test function according to the test function instruction;
the third obtaining module 103 is configured to obtain a control image corresponding to the tested control according to the control obtaining instruction;
a fourth obtaining module 104, configured to obtain, according to the control image, identification information corresponding to the tested control;
a fifth obtaining module 105, configured to obtain, according to the identification information, position information of the tested control located in the application interface;
and the execution module 106 is configured to execute the test function according to the position information when a test instruction of the user is received, so as to test the tested control.
In an embodiment, the fourth obtaining module 104 is configured to obtain, according to the control image, identification information corresponding to the tested control, and specifically includes:
the fourth obtaining module 104 is configured to identify the control image by using an image identification technology, so as to obtain a target control feature of the tested control; and acquiring identification information corresponding to the tested control according to the target control characteristics.
In an embodiment, the fourth obtaining module 104 is configured to obtain, according to the target control feature, identification information corresponding to the tested control, and specifically includes:
the fourth obtaining module 104 is configured to:
acquiring a preset control feature mapping table, wherein the preset control feature mapping table stores control features and identification information of each control on the application interface in a related manner;
matching the target control feature with the control feature in the preset control feature mapping table;
and if the preset control feature mapping table has a control feature matched with the target control feature, taking the identification information corresponding to the control feature matched with the target control feature as the identification information corresponding to the tested control.
In one embodiment, the target control feature includes at least one of: control name, control shape, picture in control and control color.
In an embodiment, the fifth obtaining module 105 is configured to obtain, according to the identification information, position information of the control under test on the application interface, and specifically includes:
the fifth obtaining module 105 is configured to: and transmitting the identification information serving as a parameter to a PCCO control so as to obtain the position information of the tested control on the application interface through the POCO control.
In one embodiment, the execution module 106 is further configured to:
capturing the triggering sequence of the control acquiring instruction and the test function acquiring instruction which are associated with each triggering of the user in sequence;
generating a test case according to the triggering sequence and the tested control, the position information and the test function corresponding to the control acquiring instruction and the test function instruction which are associated with each triggering of the user;
and when a test instruction of a user is received, executing the test case to test the test control on the application interface.
In an embodiment, the first obtaining module 101 is specifically configured to:
after connection with a tested end is detected, a control test interface is displayed, wherein the control test interface comprises a test function option plane and a synchronous application interface of the tested end;
receiving the selection operation of the user on the test function option plane to generate the test function acquisition instruction;
and receiving screenshot operation of the user on a synchronous application interface of the mobile terminal to generate the control acquiring instruction.
For the specific definition of the control testing apparatus of the application interface, reference may be made to the above definition of the control testing method of the application interface, which is not described herein again. All or part of each module in the control testing device of the application interface can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a testing terminal, and its internal structure diagram may be as shown in fig. 8. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer equipment is used for communicating with the tested end through network connection. The computer program is executed by a processor to implement a control testing method for an application interface.
In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
acquiring a control acquiring instruction and a test function acquiring instruction triggered by a user, wherein the control acquiring instruction is associated with the test function acquiring instruction;
obtaining a test function according to the test function instruction;
acquiring a control image corresponding to the tested control according to the control acquisition instruction;
acquiring identification information corresponding to the tested control according to the control image;
acquiring the position information of the tested control in the application interface according to the identification information;
and when a test instruction of a user is received, executing the test function according to the position information so as to test the tested control.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring a control acquiring instruction and a test function acquiring instruction triggered by a user, wherein the control acquiring instruction is associated with the test function acquiring instruction;
obtaining a test function according to the test function instruction;
acquiring a control image corresponding to the tested control according to the control acquisition instruction;
acquiring identification information corresponding to the tested control according to the control image;
acquiring the position information of the tested control in the application interface according to the identification information;
and when a test instruction of a user is received, executing the test function according to the position information so as to test the tested control.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. A control testing method of an application interface is characterized by comprising the following steps:
acquiring a control acquiring instruction and a test function acquiring instruction triggered by a user, wherein the control acquiring instruction and the test function acquiring instruction are directed to the same control, and the user triggers the generated instruction;
obtaining a test function according to the test function instruction;
acquiring a control image corresponding to the tested control according to the control acquisition instruction;
acquiring identification information corresponding to the tested control according to the control image;
acquiring the position information of the tested control in the application interface according to the identification information;
and when a test instruction of a user is received, executing the test function according to the position information so as to test the tested control.
2. The method for testing the control of the application interface according to claim 1, wherein the obtaining the identification information corresponding to the tested control according to the control image comprises:
identifying the control image by adopting an image identification technology to obtain the target control characteristic of the tested control;
and acquiring identification information corresponding to the tested control according to the target control characteristics.
3. The control testing method of claim 2, wherein the obtaining of the identification information corresponding to the tested control according to the target control feature comprises:
acquiring a preset control feature mapping table, wherein the preset control feature mapping table stores control features and identification information of each control on the application interface in a related manner;
matching the target control feature with the control feature in the preset control feature mapping table;
and if the preset control feature mapping table has a control feature matched with the target control feature, taking the identification information corresponding to the control feature matched with the target control feature as the identification information corresponding to the tested control.
4. The control testing method of the application interface according to claim 2 or 3, wherein the target control feature at least comprises one of the following features: control name, control shape, picture in control and control color.
5. The method for testing the control of the application interface according to any one of claims 1 to 3, wherein the obtaining the position information of the tested control on the application interface according to the identification information comprises:
and transmitting the identification information serving as a parameter to a PCCO control so as to obtain the position information of the tested control on the application interface through the POCO control.
6. The method for testing the control of the application interface according to any one of claims 1 to 3, wherein the method for testing the control of the application interface further comprises:
capturing the triggering sequence of the control acquiring instruction and the test function acquiring instruction triggered by the user each time in sequence;
generating a test case according to the triggering sequence and the tested control, the position information and the test function corresponding to the control acquiring instruction and the test function instruction triggered by the user each time;
and when a test instruction of a user is received, executing the test case to test the test control on the application interface.
7. The control test method according to any one of claims 1 to 3, wherein the obtaining of the user-triggered control obtaining instruction and the test function obtaining instruction comprises:
after connection with a tested end is detected, a control test interface is displayed, wherein the control test interface comprises a test function option interface and a synchronous application interface of the tested end;
receiving the selection operation of the user on the test function option interface to generate the test function acquisition instruction;
and receiving screenshot operation of the user on the synchronous application interface of the tested end to generate the control acquiring instruction.
8. A control testing device of an application interface is characterized by comprising:
the device comprises a first acquisition module, a second acquisition module and a control acquisition module, wherein the first acquisition module is used for acquiring a control acquisition instruction and a test function acquisition instruction which are triggered by a user, and the control acquisition instruction and the test function acquisition instruction are directed at the same control and are generated by user triggering;
the second obtaining module is used for obtaining a test function according to the test function instruction;
the third acquisition module is used for acquiring a control image corresponding to the tested control according to the control acquisition instruction;
the fourth obtaining module is used for obtaining the identification information corresponding to the tested control according to the control image;
a fifth obtaining module, configured to obtain, according to the identification information, position information of the tested control on the application interface;
and the execution module is used for executing the test function according to the position information when receiving a test instruction of a user so as to test the tested control.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the control testing method of an application interface according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method for testing controls of an application interface according to any one of claims 1 to 7.
CN201910969500.9A 2019-10-12 2019-10-12 Control testing method and device for application interface, computer equipment and storage medium Pending CN110879777A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910969500.9A CN110879777A (en) 2019-10-12 2019-10-12 Control testing method and device for application interface, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910969500.9A CN110879777A (en) 2019-10-12 2019-10-12 Control testing method and device for application interface, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110879777A true CN110879777A (en) 2020-03-13

Family

ID=69727799

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910969500.9A Pending CN110879777A (en) 2019-10-12 2019-10-12 Control testing method and device for application interface, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110879777A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111767214A (en) * 2020-06-23 2020-10-13 中国工商银行股份有限公司 Automatic testing method and device for software UI
CN111858331A (en) * 2020-07-16 2020-10-30 安徽听见科技有限公司 Method, device and equipment for detecting coverage of front-end control
CN111897740A (en) * 2020-08-24 2020-11-06 北京字节跳动网络技术有限公司 User interface testing method and device, electronic equipment and computer readable medium
CN112180411A (en) * 2020-08-26 2021-01-05 深圳市广和通无线股份有限公司 Positioning test method and device, computer equipment and storage medium
CN112269577A (en) * 2020-10-26 2021-01-26 北京信而泰科技股份有限公司 Configuration method and device of control interface
CN112506778A (en) * 2020-12-10 2021-03-16 北京云测信息技术有限公司 WEB user interface automatic test method, device, equipment and storage medium
CN112732576A (en) * 2021-01-08 2021-04-30 网易(杭州)网络有限公司 Automatic testing method, device and equipment based on user interface
CN114463730A (en) * 2021-07-15 2022-05-10 荣耀终端有限公司 Page identification method and terminal equipment

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111767214A (en) * 2020-06-23 2020-10-13 中国工商银行股份有限公司 Automatic testing method and device for software UI
CN111767214B (en) * 2020-06-23 2023-08-11 中国工商银行股份有限公司 Automatic testing method and device for software UI
CN111858331A (en) * 2020-07-16 2020-10-30 安徽听见科技有限公司 Method, device and equipment for detecting coverage of front-end control
CN111897740A (en) * 2020-08-24 2020-11-06 北京字节跳动网络技术有限公司 User interface testing method and device, electronic equipment and computer readable medium
CN112180411A (en) * 2020-08-26 2021-01-05 深圳市广和通无线股份有限公司 Positioning test method and device, computer equipment and storage medium
CN112269577A (en) * 2020-10-26 2021-01-26 北京信而泰科技股份有限公司 Configuration method and device of control interface
CN112506778A (en) * 2020-12-10 2021-03-16 北京云测信息技术有限公司 WEB user interface automatic test method, device, equipment and storage medium
CN112732576A (en) * 2021-01-08 2021-04-30 网易(杭州)网络有限公司 Automatic testing method, device and equipment based on user interface
CN114463730A (en) * 2021-07-15 2022-05-10 荣耀终端有限公司 Page identification method and terminal equipment

Similar Documents

Publication Publication Date Title
CN110879777A (en) Control testing method and device for application interface, computer equipment and storage medium
CN102904996B (en) The method and device of a kind of handset touch panel performance test, system
CN111026645B (en) User interface automatic test method and device, storage medium and electronic equipment
TW201818242A (en) Plug-in packaging method, device, terminal and storage media
KR20140038381A (en) Systems and methods for testing content of mobile communication devices
WO2015000398A1 (en) Systems and methods for testing terminal applications
WO2019227708A1 (en) Online debugging apparatus and method for test case, and computer-readable storage medium
WO2018121582A1 (en) Script generation method and device
CN108089985B (en) Method, device and equipment for verifying interface return parameters and readable storage medium
CN103984626A (en) Method and device for generating test-case script
CN113138925A (en) Function test method and device of application program, computer equipment and storage medium
CN110489312A (en) Data correlation method and device for control trigger data acquisition
CN113934630A (en) Software testing method, device, equipment and medium based on image recognition
CN112231206A (en) Script editing method for application program test, computer readable storage medium and test platform
CN111414309A (en) Automatic test method of application program, computer equipment and storage medium
TW201324141A (en) Testing method and testing apparatus for testing function of electronic apparatus
CN106557411B (en) Method and system for testing Hybrid application in Android system
CN107911388B (en) Method and system for supervising mobile terminal application
WO2019019955A1 (en) Gesture test method and apparatus, computer device and storage medium
CN106302011B (en) Multi-terminal-based test method and terminal
CN109815127B (en) Automatic script conversion method and device, computer equipment and storage medium
CN111857803A (en) Page updating method, device, server and storage medium
CN110825370B (en) Mobile terminal application development method, device and system
CN109995931B (en) Method and device for realizing automatic calling
CN110598142A (en) Webpage calibration method and device, computer equipment and storage medium

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