CN111078556B - Application testing method and device - Google Patents

Application testing method and device Download PDF

Info

Publication number
CN111078556B
CN111078556B CN201911304618.6A CN201911304618A CN111078556B CN 111078556 B CN111078556 B CN 111078556B CN 201911304618 A CN201911304618 A CN 201911304618A CN 111078556 B CN111078556 B CN 111078556B
Authority
CN
China
Prior art keywords
control
interface
application
application interface
attribute
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911304618.6A
Other languages
Chinese (zh)
Other versions
CN111078556A (en
Inventor
王明星
黄晶
罗勇冠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201911304618.6A priority Critical patent/CN111078556B/en
Publication of CN111078556A publication Critical patent/CN111078556A/en
Application granted granted Critical
Publication of CN111078556B publication Critical patent/CN111078556B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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 embodiment of the application discloses an application testing method and device, wherein in the process of testing an application, the method acquires the control attribute of an application interface of the application to be tested and the control attribute of a candidate interface, then determines a target interface corresponding to the application interface from the candidate interface according to the control attribute of the application interface and the control attribute of the candidate interface, then determines an operation instruction corresponding to the application interface according to the target interface, wherein the operation instruction comprises an operation position and operation content, and finally executes the operation content at the operation position corresponding to the application interface according to the operation instruction so as to finish automatic test of the application; the control attributes of different application interfaces are different, even if the different application interfaces have the same activity name, the operation instructions corresponding to the application interfaces are determined based on the interface control attributes, and the technical problem that the same operation instructions are called for the different application interfaces with the same activity name in the current test method is solved.

Description

Application testing method and device
Technical Field
The application relates to the field of application testing, in particular to an application testing method and device.
Background
At present, the types of terminals (such as a PC (personal computer) and an intelligent terminal) in the market are very different, and as the hardware and the software used by different types are different, compatibility tests are required to be carried out on the main stream types in the development process and before the game and other applications are marketed, so as to verify whether the game and the like can normally run. In some application test scenarios, multiple different interfaces have the same Activity (Activity is one of four most basic and common components in Android components, in an Android application, an Activity is usually a single screen, and some controls can be displayed and also can monitor and process events of a user to respond) names, for example, in a chat application provided by a message, the Activity names of a group chat search page and a search result page are both searched.
In an automatic test complex scene, when a use case fails, determining the name of a current application interface so as to facilitate problem positioning; the traditional testing method is to determine the activity names of the application interfaces as application interface names, so that the application interfaces with the same activity names can give the same application interface names, and further the phenomena of positioning errors of the application interfaces and the like occur.
Disclosure of Invention
The embodiment of the application provides an application testing method and device, which are used for solving the technical problem that different application interfaces with the same activity name are named identically in the current testing method.
In order to solve the technical problems, the embodiment of the application provides the following technical scheme:
the embodiment of the application provides an application testing method, which comprises the following steps:
acquiring control attributes of an application interface of an application to be tested;
acquiring control attributes of candidate interfaces;
determining a target interface corresponding to the application interface from the candidate interfaces according to the control attribute of the application interface and the control attribute of the candidate interfaces;
and determining the identification of the application interface according to the identification of the target interface.
The embodiment of the application provides an application testing device, which comprises:
the acquisition module is used for acquiring control attributes of an application interface of the application to be tested;
the calling module is used for acquiring the control attribute of the candidate interface;
the matching module is used for determining a target interface corresponding to the application interface from the candidate interfaces according to the control attribute of the application interface and the control attribute of the candidate interfaces;
and the determining module is used for determining the identification of the application interface according to the identification of the target interface.
An embodiment of the present application provides an electronic device, including a processor and a memory, where the memory stores a plurality of instructions, and the instructions are adapted to be loaded by the processor to perform the steps in the application test method.
An embodiment of the present application provides a computer readable storage medium, where a plurality of instructions are stored, where the instructions are adapted to be loaded by a processor to perform the steps in the application test method described above.
The embodiment of the application provides a new application testing method and a device, wherein in the process of testing an application, the method acquires the control attribute of an application interface of the application to be tested and the control attribute of a candidate interface, then determines a target interface corresponding to the application interface from the candidate interface according to the control attribute of the application interface and the control attribute of the candidate interface, and then determines the identification of the application interface according to the identification of the target interface so as to finish naming the current application interface; according to the control attribute of the application interface of the application to be tested and the control attribute of the candidate interface, the target interface corresponding to the application interface is determined from the candidate interfaces, and the control attribute of different application interfaces is different even if the different application interfaces with the same activity names are provided, so that the determination of the interface names of the application interfaces based on the interface control attribute is realized, the accuracy of the interface names is ensured, the technical problem that the different application interfaces with the same activity names are named identically in the current test method is solved, the extra cost caused by the positioning error of the application interfaces is reduced, and the application test speed is accelerated.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a networking schematic diagram of an application test system according to an embodiment of the present application.
Fig. 2 is a schematic flow chart of a first method for testing applications according to an embodiment of the present application.
Fig. 3 is a second flowchart of an application test method according to an embodiment of the present application.
Fig. 4 is a third flowchart of an application test method according to an embodiment of the present application.
Fig. 5 is a schematic structural diagram of an application testing apparatus according to an embodiment of the present application.
Fig. 6 is a schematic structural diagram of a terminal according to an embodiment of the present application.
Fig. 7 is a schematic structural diagram of a server according to an embodiment of the present application.
Fig. 8 to 17 are schematic views of interfaces according to embodiments of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to fall within the scope of the application.
For convenience of the following description, terms related to the present application will now be described.
In the embodiment of the application, the application to be tested refers to an application to be tested, and can be various applications such as a communication application client, a payment application client, a game application client, a browser application client and the like; the application terminal refers to an entity or virtual terminal device on which an application to be tested is installed, and the test terminal refers to a terminal having all or part of the functions of the application test method, which can be implemented by means of the test application.
The compatibility test is that the intelligent mobile phone with android operating system is taken as an example, the intelligent mobile phone has thousands of models, and the compatibility test is needed to be carried out on the main stream model in the development process and before marketing because the hardware and the software used by different models are different, so that whether the intelligent mobile phone can normally operate is verified. The following description will take application of the android operating system as an example, and applications and types of other operating systems may be implemented with reference to the following description.
In the application testing process such as compatibility testing, when a problem occurs in a certain application interface, the interface needs to be positioned and occurred so as to solve the problem later.
When an application to be tested is used, each application interface corresponds to different operation instructions, a plurality of application interfaces appear according to different orders of the operation instructions, and taking a certain communication application client as an example, the application interfaces comprise an update interface, a protocol interface, a registration login interface, a login page interface, a login interface, a discovery page interface, a message page interface, a search result interface, a group chat window page interface, a group video hall interface and the like, wherein the different interfaces correspond to different operation instructions; the login interface, the login page interface and the login interface have the same activity name of login, and the search page interface and the search result interface have the same activity name of search.
In the embodiment of the application, the application test is realized through UI (User Interface), namely an application Interface in the application, the operation position (such as a certain picture, a certain text box and the like) and the corresponding operation content (including clicking once, inputting a certain account and the like) of the control in the corresponding operation instruction of the UI are mainly determined, and the corresponding operation content is executed based on the control of the operation position in the corresponding position of the UI, so that the application automation test is completed.
In the embodiment of the application, the control is an important component of the UI, and can be divided into an available control and an unavailable control according to whether the control can be operated, for example, whether the control can be clicked, checked, scrolled and the like in the initial control attribute of the control, and the initial control attribute of the control can be obtained by analyzing the interface layout file corresponding to the application interface. For example, for an Android operating system, UI controls refer to interactive components in an Android application user interface, android provides various controls that can be used in the UI, such as buttons, text fields, a toolbar, check boxes, zoom buttons, toggle buttons, and the like, and ui.xml is an XML-format interface layout file derived by a test tool uiautopilor provided by an Android SDK, and includes initial control attribute information of all control nodes of the current interface.
Taking an interface layout file of a certain application interface as an example, table 1 below shows:
TABLE 1
In table 1, "1" indicates a determination, "0" indicates a negation, text is a Text value, the name, the action, etc. of the control are indicated, the class name refers to a class identifier to which the control belongs, the resource identifier refers to a resource identifier called by the control, and the boundary value refers to a position of the control in the whole application interface, typically a range value.
However, in some scenarios, different application interfaces may have more similar controls, where the differences between the similar controls are merely the difference in size, the difference in aspect ratio, and the difference in control patterns, and for these controls, the initial control attribute shown in table 1 may not well reflect the differences between the similar controls, and based on this, in the embodiment of the present application, in order to distinguish between the similar controls, the attributes of the controls are supplemented, and the enhanced control attribute shown in the following table 2:
TABLE 2
In table 2, the aspect ratio refers to the ratio of the width to the height of the control screenshot, the area ratio refers to the ratio of the area of the control screenshot to the area of the interface screenshot, and the picture fingerprint refers to the fingerprint information of the control screenshot, for example, the picture fingerprint may be information calculated according to the gray average information and the color average information of the control screenshot. For convenience of the following description, the attributes available according to table 1 (i.e., the interface layout file of the application interface) are taken as initial control attributes of the control, and the attributes obtained according to table 2 are taken as enhanced control attributes of the control.
In the embodiment of the application, the interface screenshot is obtained by screenshot of the application interface through various tools, and the control screenshot is obtained by screenshot of the interface according to the boundary value of the control.
In the embodiment of the application, the control attributes of the interface are different according to different settings, for example, the control attributes can comprise initial control attributes of all the controls of the application interface, can also comprise initial control attributes of only available controls, can comprise initial control attributes and enhanced control attributes of all the controls of the application interface, and can also comprise initial control attributes and enhanced control attributes of only available controls.
In the embodiment of the present application, the control similarity refers to weights occupied by all controls or all available controls of a first interface (in the embodiment of the present application, the first interface is an interface needing to determine a name, that is, an application interface of an application to be tested) and all controls or all available controls of a second interface (in the embodiment of the present application, the second interface is an interface having determined a name, that is, a history application interface of an application to be tested) that are the same controls or all available controls. For example, weights can be set to 0.2 for 5 available controls of the first interface, and if the 5 available controls of the first interface are the same as the available controls of the second interface, the similarity of the controls between the first interface and the second interface is 1; for example, weights of 0.1 can be set for 10 available controls of the first interface, and if only 5 available controls of the first interface are the same as available controls of the second interface, the control similarity between the first interface and the second interface is 0.5.
In the embodiment of the application, the controls are the same or available controls are the same, which means that the weight occupied by the same item in the initial control attribute and/or the enhanced control attribute of the two controls is greater than a preset value, for example, 0.8 and the like. For example, the control OOXX1 and the control OOXO1 both comprise 7 initial control attributes and 3 enhanced control attributes, the weight of each of the 7 initial control attributes is 0.05,3, the weight of 2 enhanced control attributes in the enhanced control attributes is 0.25, the weight of the other enhanced control attribute is 0.15, if the control OOXX1 and the control OOXO1 have the same 7 initial control attributes, the weight of the same item is 0.35 and is smaller than a preset value, and the control OOXX1 and the control OOXO1 are different; the control OOXX2 and the control OOXO2 comprise 7 initial control attributes and 3 enhanced control attributes, the weight of each of the 7 initial control attributes is 0.05,3, the weight of 2 enhanced control attributes in the enhanced control attributes is 0.25, the weight of the other enhanced control attribute is 0.15, if the 7 initial control attributes of the control OOXX2 and the control OOXO2 and the 3 enhanced control attributes are the same, the weight of the same item is 1 and is larger than a preset value, and the control OOXX2 and the control OOXO2 are the same.
In the embodiment of the application, the history application interface refers to an application interface of an application to be tested in a history test, and the application interface refers to an application interface currently displayed by the application to be tested, for example, an application interface with a problem. The candidate interfaces or the target interfaces belong to one or more interfaces in the historical application interfaces, and only the distinction is made between different calls in different time periods, and the identification of the historical application interfaces can be determined according to the test instruction which is required to be completed, the appearance time sequence, the classification of all the controls or all the available controls in the interfaces and the labels, so that the identification of one interface is uniquely identified. The control or a label of the available control can be used as the name of the control for data storage and for user lookup.
In the embodiment of the application, if a certain activity name corresponds to only one interface, the interface can be identified by using the activity name. When different functional tests are executed on the application to be tested, a series of different application interfaces appear on the application, so that in order to narrow the range of candidate interfaces, screening can be performed based on key instructions corresponding to each historical application interface.
Referring to fig. 1, fig. 1 is a schematic view of a scenario of an application testing system provided by an embodiment of the present application, where the system may include a user side device and a service side device, and the user side device and the service side device are connected by means of the internet formed by various gateways, and are not described in detail, where the user side device includes a plurality of terminals 11, and the service side device includes a plurality of servers 12; wherein:
The terminal 11 includes, but is not limited to, portable terminals provided with instant messaging applications such as mobile phones, tablets, fixed terminals such as computers, inquiries, advertising players, and virtual terminals for test applications, etc., for example, the terminal 11 includes application terminals such as mobile phones installed with chat applications, game applications waiting for test applications, test terminals such as mobile phones installed with test applications, and developer terminals used by developers; the test application has all or part of functions of the application test method provided by the application, and the application terminal and the test terminal can be the same terminal; the developer terminal provides various configuration windows for developers such as operation and maintenance personnel, and the developer terminal can be the same terminal with the application terminal and the test terminal;
the server 12 includes a local server and/or a remote server, etc., provides various data support services, interface analysis services, etc. for application testing, and has all or part of the functions of the application testing method provided by the present application; when the server 12 is a local server and has all the functions of the application test method provided by the application, it is the test terminal in the foregoing; when the server 12 is a remote server and has all the functions of the application test method provided by the present application, it is a test server in the following description, and the terminal 11 side includes a test terminal.
It should be noted that, the schematic system scenario shown in fig. 1 is only an example, and the servers and the scenarios described in the embodiments of the present application are for more clearly describing the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application, and those skilled in the art can know that, with the evolution of the system and the appearance of a new service scenario, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.
The application test method provided by the application is described in detail below.
Fig. 2 is a first flowchart of an application testing method provided in an embodiment of the present application, please refer to fig. 2, the application testing method includes the following steps:
201: and acquiring the control attribute of the application interface of the application to be tested.
In one embodiment, the step includes: acquiring an interface layout file of an application interface; analyzing the interface layout file to obtain a control list of the application interface, wherein the control list comprises control identifications and initial control attributes of the controls; and determining the initial control attribute of the control as the control attribute of the application interface.
In one embodiment, in order to reduce the comparison workload, only the initial control attribute of the available controls may be used as the control attribute of the interface, where the step further includes: screening the controls in the control list according to the initial control attribute corresponding to each control to obtain available controls; and determining the initial control attribute of the available control as the control attribute of the application interface.
In one embodiment, in order to more accurately distinguish the difference between different controls, the embodiment of the present application may further introduce an enhanced control attribute, where the step further includes: obtaining a boundary value in an initial control attribute of an available control, and performing screenshot processing on an interface screenshot of an application interface to obtain a control screenshot of the available control; determining the enhanced control attribute of the available control according to the control screenshot of the available control and the interface screenshot; and determining the initial control attribute and the enhanced control attribute of the available control as the control attribute of the application interface.
For example, when the execution subject of the present step is a terminal device on the terminal side, the present step includes: the testing terminal obtains an interface screenshot of an application interface currently displayed by the application to be tested from the application terminal through technologies such as a minicap technology and the like; or the test terminal captures an interface screenshot of an application interface displayed by the application to be tested and displayed by the application terminal through the camera. And then, the testing terminal obtains initial control attributes corresponding to the controls in the application interface through an XML format interface layout file of the currently displayed application interface derived by a testing tool uiAutoator, takes clickable/checkable/scrollable controls as available controls, obtains enhanced control attributes of the available controls, and takes the initial control attributes and the enhanced control attributes of the available controls as control attributes of the interface.
For example, when the execution subject of the present step is a test server on the server side, the present step includes: the server receives an operation request sent by a test terminal; analyzing the operation request to obtain an interface screenshot of the application interface and an interface layout file in an XML format, further obtaining initial control attributes corresponding to the controls in the application interface, taking clickable/dischargeable/scrollable controls as available controls, then obtaining enhanced control attributes of the available controls, and taking the initial control attributes and the enhanced control attributes of the available controls as control attributes of the interface.
202: and acquiring the control attribute of the candidate interface.
The candidate interfaces are one or more of the historical application interfaces of the application to be tested, and the test server or the test terminal can execute the operation of the embodiment shown in fig. 3 for all the historical application interfaces of the application to be tested in the test process to obtain the control attribute of each historical application interface.
In one embodiment, the step includes: acquiring an interface layout file and an interface screenshot of a history application interface of an application to be tested; analyzing an interface layout file of the history application interface to obtain a control list of the history application interface, wherein the control list comprises control identifications of controls and initial control attributes, and the initial control attributes comprise boundary values; performing screenshot processing on the interface screenshot of the historical application interface according to the boundary value of the control in the historical application interface to obtain the control screenshot of the control in the historical application interface; determining the enhanced control attribute of the control in the history application interface according to the control screenshot of the control in the history application interface and the interface screenshot of the history application interface; updating and storing a control list of the history application interface, wherein the updated control list comprises a control identifier, an initial control attribute and an enhanced control attribute of the control; and screening the historical application interface to obtain a candidate interface, and further obtaining the control attribute of the candidate interface. In one embodiment, the updated control list is stored in a different location than the interface layout file.
In one embodiment, the historical application interface may be filtered based on the activity identification to obtain candidate interfaces, where the steps include: acquiring an activity identifier of an application interface; acquiring an activity identifier of a historical application interface of an application to be tested; and screening the historical application interface according to the activity identification of the application interface and the activity identification of the historical application interface to obtain a candidate interface.
In one embodiment, the historical application interface may be screened based on the key instruction corresponding to the interface to obtain a candidate interface, where the step includes: acquiring a key instruction for triggering an application interface; acquiring a key instruction of a history application interface of an application to be tested; and screening the historical application interface according to the key instructions of the application interface and the key instructions of the historical application interface to obtain candidate interfaces.
203: and determining a target interface corresponding to the application interface from the candidate interfaces according to the control attribute of the application interface and the control attribute of the candidate interfaces.
In one embodiment, the step includes: obtaining the control similarity between the application interface and the candidate interface according to the control attribute of the application interface and the control attribute of the candidate interface; and determining a target interface corresponding to the application interface from the candidate interfaces according to the control similarity, for example, determining the candidate interface with the maximum control similarity as the target interface corresponding to the application interface, or determining the candidate interface with the control similarity as a specified value (for example, 1) as the target interface corresponding to the application interface.
In one embodiment, the step of obtaining the control similarity between the application interface and the candidate interface according to the control attribute of the application interface and the control attribute of the candidate interface includes: acquiring weight values of all controls in an application interface; acquiring weight values of all controls in the candidate interface; and obtaining the control similarity between the application interface and the candidate interface according to the initial control attribute and the enhanced control attribute of each control in the application interface and the candidate interface, the weight value of each control in the application interface and the weight value of each control in the candidate interface.
This step will be described in detail in the embodiment shown in fig. 4 below.
204: and determining the identification of the application interface according to the identification of the target interface.
The step may be to directly determine the identifier of the target interface as the identifier of the application interface, or use a digest algorithm such as MD5 (Message Digest Algorithm MD, fifth version of the message digest algorithm) to digest the identifier of the target interface to obtain the identifier of the application interface, etc.
The embodiment provides an application testing method, which determines a target interface corresponding to an application interface from candidate interfaces according to control attributes of the application interface of an application to be tested and control attributes of the candidate interfaces, wherein the control attributes of different application interfaces are different even though the application interfaces have the same activity name, so that the determination of the interface name of the application interface based on the interface control attributes is realized, the accuracy of the interface name is ensured, the technical problem that the application interfaces with the same activity name are named identically in the current testing method is solved, the additional cost caused by the positioning error of the application interfaces is reduced, and the application testing speed is accelerated.
FIG. 3 is a second flowchart of an application testing method according to an embodiment of the present application, where the embodiment describes in detail how to obtain relevant attributes of a history application interface of an application to be tested; referring to fig. 3, the application testing method includes the following steps:
301: a target historical application interface that needs to acquire enhanced control attributes is determined.
The number of interfaces of the application interfaces to be tested of each application to be tested is hundreds of thousands or even tens of thousands, if the acquisition operation of the control attribute is executed for each application interface, the data workload will be great, so that some application interfaces can be selected in a targeted manner as target historical application interfaces needing to acquire the enhanced control attribute.
In one embodiment, the step comprises: all the application interfaces to be tested are the target historical application interfaces so as to ensure the comprehensiveness of the data.
In one embodiment, the step comprises: and acquiring the activity names of the application interfaces, and taking a plurality of application interfaces with the same activity names as target historical application interfaces.
In one embodiment, the step comprises: obtaining the testing abnormality probability of the key instructions corresponding to each application interface, and taking the application interface corresponding to the key instructions with the testing abnormality probability larger than the preset value as the target historical application interface. The preset value may be 10%, for example, 100 times of testing of a certain key instruction, and if the number of times of abnormality occurrence of the test is greater than 10 times, an application interface corresponding to the key instruction needs to be used as a target historical application interface.
Taking an instant messaging application as an example, the embodiment takes an update interface shown in fig. 8, a protocol interface shown in fig. 9, a registration login interface shown in fig. 10, a login page interface shown in fig. 11, an in-login interface shown in fig. 12, a message page interface shown in fig. 13, a discovery page interface shown in fig. 14, a search result page interface shown in fig. 15, a group chat window page interface shown in fig. 16, a group video lobby interface shown in fig. 17, and the like as target historical application interfaces.
302: executing an operation instruction to the application to be tested, and generating a target historical application interface.
And determining an operation instruction to be executed by the application to be tested according to the first target historical application interface to be displayed, and executing the operation instruction to enable the application to be tested to generate and display the first target historical application interface, for example, displaying an updating interface as shown in fig. 8.
303: and acquiring activity information, interface layout files and interface screenshots of the target historical application interface.
The testing device performs a series of processing on the current UI according to the executed instruction, including obtaining the Activity information of the current page, obtaining a UI.xml file from the installation position of the application to be tested, and obtaining a current interface screenshot.
304: and obtaining a control list of the target historical application interface according to the interface layout file of the target historical application interface.
The testing device reads the nodes in the UI.xml file and converts the nodes into a control list ui-list shown in table 1, wherein the control list shown in table 1 comprises control identifications and initial control attributes of the controls.
305: the boundary values of the controls are obtained from the list of controls.
The testing device obtains the boundary value of the control from the initial control attribute shown in the control list ui-list shown in table 1.
306: and obtaining a control screenshot corresponding to the control.
And the testing device intercepts the interface screenshot according to the boundary value of the control to obtain a control screenshot corresponding to the control.
307: and obtaining the enhanced control attribute of the control according to the control screenshot and the interface screenshot.
And the testing device calculates the enhanced control attribute of the control shown in the table 2 according to the control screenshot and the interface screenshot.
308: and updating and storing a control list corresponding to the target historical application interface.
The testing device adds the enhanced control attribute shown in the table 2 into the control list ui-list shown in the table 1, namely, updates the control list to obtain an updated control list ui-list, wherein the updated control list comprises control identifications, initial control attributes and enhanced control attributes of the controls and stores the control identifications, the initial control attributes and the enhanced control attributes into files which can be subsequently called by other programs, and the storage positions of the updated control list are different from those of the layout files.
For example, the testing device captures a position of a control represented by the node at the current UI using a clipping algorithm. After the screenshot of the control is obtained, 3 items of attributes can be additionally added to strengthen the accuracy of control attribute comparison, the ui_list is rewritten to finish the update of the ui_list, and finally the updated ui_list is converted into a node.
309: and adding weights for different attributes of the controls, and classifying the controls.
The testing device adds weight to different attributes of the control (including initial control attribute and enhanced control attribute) so as to compare whether the control is the same control; meanwhile, according to the initial control attributes of the controls in the updated control list, for example, according to attributes such as 'whether the controls can slide' in the initial control attributes, the controls are divided into available controls and unavailable controls, so that the workload of comparison of the follow-up controls is reduced.
310: the label attribute is added to the control to name the control.
The testing device adds different label attributes for different controls according to the initial control attributes of the controls in the updated control list, for example, adds label attributes such as 'account number', 'text input' and the like for the controls corresponding to the account number input box, and realizes naming of the controls.
After this step is performed, the relevant attributes of each target historical application interface include: the interface activity name, the operation instruction corresponding to the interface, the control attribute of the interface, and the like.
311: traversing through all of the subject historical application interfaces.
The embodiment realizes the acquisition of the control attribute and other related attributes of the historical application interface and provides a basis for the positioning of the subsequent abnormal interface.
FIG. 4 is a third flow chart of an application testing method according to an embodiment of the present application, which is described in detail with respect to how to locate an identifier of an abnormal interface; referring to fig. 4, the application testing method includes the following steps:
401: a test operation is performed.
The testing device determines an operation instruction corresponding to the keyword in an operation instruction database according to the keyword of the test of the application to be tested, and executes the operation instruction of the application to be tested so as to perform application test.
402: and acquiring an interface screenshot of the current application interface and an interface layout file.
When the testing device performs automatic testing on the application and executes the application to the current UI, the interface screenshot corresponding to the current UI and the interface layout file UI.
In one embodiment, the testing device may perform this step only when an abnormality occurs in the current UI to reduce the testing burden.
403: and acquiring the control attribute of the current application interface.
The testing device reads nodes in the UI.xml file according to the position of the application to be tested, converts the nodes into a control list UI-list shown in the table 1, further determines available controls according to initial control attributes of the controls, obtains boundary values of the available controls from the control list UI-list, intercepts an interface screenshot according to the boundary values of the available controls to obtain control screenshots corresponding to the available controls, calculates to obtain enhanced control attributes of the controls shown in the table 2 according to the control screenshots and the interface screenshots, and adds the enhanced control attributes shown in the table 2 into the control list UI-list shown in the table 1 to obtain a control list UI-list updated by the current UI, wherein the updated control list comprises control identifications, initial control attributes and enhanced control attributes of the controls in the current UI.
404: and setting weight for each control in the current application interface.
The testing device sets the same or different weights for all the controls in the current application interface so as to obtain the probability that the current UI is the same as that of all the historical UI on the premise of determining the same control.
405: the control attributes of the history application interface are invoked.
The test device invokes the control attributes of the historical application interface obtained by the embodiment shown in FIG. 3.
406: and screening by the testing device to obtain the control attribute of the candidate interface.
As shown in fig. 4, this step results in UI1 and UI2 as candidate interfaces.
407: weight 1 of the current UI as UI1 and weight 2 of the current UI as UI2 are obtained respectively.
The testing device respectively compares the attributes of each control or available controls in the current UI, such as a control OOXX2 with all the controls in the UI 1; if any control exists in the UI1, for example, 7 initial control attributes of the control OOXX2 and 3 enhanced control attributes are the same, the weight occupied by the same item is 1 and is larger than a preset value, the control OOXX2 and the control OOXX2 are the same, and the control OOXX2 of the current UI can be considered to be the same as the control in the UI 1; on this basis, for example, the weight of 5 available controls of the current UI is set to 0.2 respectively, if all 5 available controls are the same as available controls in UI1, the weight (i.e., control similarity) 1 between the current UI and UI1 is 1, and if only 1 available control is the same as available controls in UI1, the weight 1 between the current UI and UI1 is 0.2. By analogy, a weight of 2 between the current UI and UI2 is available.
408: the weight 1 is compared with the weight 2.
The test apparatus compares the weight 1 with the weight 2, and performs step 409 when the weight 1 is greater than the weight 2, and performs step 410 when the weight 1 is less than the weight 2.
409: the current UI is identified as UI1.
The test means sets the identity of the current UI to the identity of UI1.
410: the current UI is identified as UI2.
The test means sets the identity of the current UI to the identity of UI2.
For example, when the current UI is as shown in fig. 8, the weight of the current UI being the update interface is 1, and the current UI is determined as the update interface.
When the current UI is as shown in fig. 9, the weight of the current UI being a protocol interface is 0.8, the weight of the current UI being an in-login interface is 0.2, and the current UI is determined as the protocol interface.
When the current UI is as shown in fig. 10, the weight of the current UI being the registered login interface is 1, and the current UI is determined as the registered login interface.
When the current UI is as shown in fig. 11, the weight of the current UI being a login page interface is 0.9, the weight of the current UI being an in-login interface is 0.1, and the current UI is determined as a login page interface.
When the current UI is as shown in fig. 12, the weight of the current UI being the in-login interface is 1, and the current UI is determined as the in-login interface.
When the current UI is as shown in fig. 13, the weight of the current UI being a message page interface is 0.97, the weight of the current UI being a discovery page interface is 0.03, and the current UI is determined as a message page interface.
When the current UI is as shown in fig. 14, the weight of the current UI being the discovery page interface is 0.97, the message page weight of the current UI being the interface is 0.03, and the current UI is determined as the discovery page interface.
When the current UI is as shown in fig. 15, the weight of the current UI being the search result page interface is 1, and the current UI is determined as the search result page interface.
When the current UI is as shown in fig. 16, the weight of the current UI being the group chat window page interface is 1, and the current UI is determined as the group chat window page interface.
When the current UI is as shown in fig. 17, the weight of the current UI being the group video lobby interface is 1, and the current UI is determined as the group video lobby interface.
The present embodiment completes the identification of the current UI, that is, the embodiment shown in fig. 3 and fig. 4 provides a scheme for intelligently identifying the current UI, and ensures the accuracy of determining the current UI in each UI automation test process by means of classifying, marking and naming the controls in the interface, so that the UI automation test flow is clearer and more transparent.
Accordingly, fig. 5 is a schematic structural diagram of an application testing apparatus according to an embodiment of the present application, please refer to fig. 5, the application testing apparatus includes the following modules:
the acquiring module 501 is configured to acquire a control attribute of an application interface of an application to be tested;
a calling module 502, configured to obtain a control attribute of the candidate interface;
a matching module 503, configured to determine, according to the control attribute of the application interface and the control attribute of the candidate interface, a target interface corresponding to the application interface from the candidate interfaces;
A determining module 504, configured to determine an identifier of the application interface according to the identifier of the target interface.
In one embodiment, the calling module 502 is configured to: acquiring an interface layout file and an interface screenshot of a history application interface of an application to be tested; analyzing an interface layout file of the history application interface to obtain a control list of the history application interface, wherein the control list comprises control identifications of controls and initial control attributes, and the initial control attributes comprise boundary values; performing screenshot processing on the interface screenshot of the historical application interface according to the boundary value of the control in the historical application interface to obtain the control screenshot of the control in the historical application interface; determining the enhanced control attribute of the control in the history application interface according to the control screenshot of the control in the history application interface and the interface screenshot of the history application interface; according to the initial control attribute and the enhanced control attribute of the control in the history application interface, updating and storing a control list of the history application interface; the updated control list includes the control identification of the control, the initial control attribute, and the enhanced control attribute.
In one embodiment, the calling module 502 is further configured to: according to the initial control attribute of the control in the updated control list, the control is divided into an available control or an unavailable control; and adding the label attribute for the control according to the initial control attribute of the control in the updated control list.
In one embodiment, the obtaining module 501 is configured to: acquiring an interface layout file of an application interface; analyzing the interface layout file to obtain a control list of the application interface, wherein the control list comprises control identifications and initial control attributes of the controls; and determining the initial control attribute of the control as the control attribute of the application interface.
In one embodiment, the obtaining module 501 is configured to: screening the controls in the control list according to the control attributes corresponding to the controls to obtain available controls; and determining the initial control attribute of the available control as the control attribute of the application interface.
In one embodiment, the obtaining module 501 is configured to: obtaining a boundary value in an initial control attribute of an available control, and performing screenshot processing on an interface screenshot of an application interface to obtain a control screenshot of the available control; determining the enhanced control attribute of the available control according to the control screenshot of the available control and the interface screenshot; and determining the initial control attribute and the enhanced control attribute of the available control as the control attribute of the application interface.
In one embodiment, the calling module 502 is configured to: acquiring an activity identifier of an application interface; acquiring an activity identifier of a historical application interface of an application to be tested; and screening the historical application interface according to the activity identification of the application interface and the activity identification of the historical application interface to obtain a candidate interface.
In one embodiment, the calling module 502 is configured to: acquiring a key instruction for triggering an application interface; acquiring a key instruction of a history application interface of an application to be tested; and screening the historical application interface according to the key instructions of the application interface and the key instructions of the historical application interface to obtain candidate interfaces.
In one embodiment, the matching module 503 is configured to: obtaining the control similarity between the application interface and the candidate interface according to the control attribute of the application interface and the control attribute of the candidate interface; and determining a target interface corresponding to the application interface from the candidate interfaces according to the control similarity.
In one embodiment, the matching module 503 is configured to: acquiring weight values of all controls in an application interface; acquiring weight values of all controls in the candidate interface; and obtaining the control similarity between the application interface and the candidate interface according to the initial control attribute and the enhanced control attribute of each control in the application interface and the candidate interface, the weight value of each control in the application interface and the weight value of each control in the candidate interface.
Meanwhile, the application provides an electronic device, which comprises a processor and a memory, wherein the memory stores a plurality of instructions, and the instructions are suitable for loading by the processor so as to execute the steps in the application testing method.
Accordingly, embodiments of the present application also provide a terminal, as shown in fig. 6, which may include a Radio Frequency (RF) circuit 601, a memory 602 including one or more computer readable storage media, an input unit 603, a display unit 604, a sensor 605, an audio circuit 606, a wireless fidelity (WiFi, wireless Fidelity) module 607, a processor 608 including one or more processing cores, and a power supply 609. It will be appreciated by those skilled in the art that the terminal structure shown in fig. 6 is not limiting of the terminal and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components. Wherein:
the RF circuit 601 may be used for receiving and transmitting signals during a message or a call, and in particular, after receiving downlink information of a base station, the downlink information is processed by one or more processors 608; in addition, data relating to uplink is transmitted to the base station. Typically, RF circuitry 601 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a subscriber identity module (SIM, subscriber Identity Module) card, a transceiver, a coupler, a low noise amplifier (LNA, low Noise Amplifier), a duplexer, and the like. In addition, the RF circuitry 601 may also communicate with networks and other devices through wireless communications. The wireless communication may use any communication standard or protocol including, but not limited to, global system for mobile communications (GSM, global System of Mobile communication), general packet radio service (GPRS, general Packet Radio Service), code division multiple access (CDMA, code Division Multiple Access), wideband code division multiple access (WCDMA, wideband Code Division Multiple Access), long term evolution (LTE, long Term Evolution), email, short message service (SMS, short Messaging Service), and the like.
The memory 602 may be used to store software programs and modules that are stored in the memory 602 for execution by the processor 608 to perform various functional applications and data processing. The memory 602 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the terminal, etc. In addition, the memory 602 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 602 may also include a memory controller to provide access to the memory 602 by the processor 608 and the input unit 603.
The input unit 603 may be used to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, in one particular embodiment, the input unit 603 may include a touch-sensitive surface, as well as other input devices. The touch-sensitive surface, also referred to as a touch display screen or a touch pad, may collect touch operations thereon or thereabout by a user (e.g., operations thereon or thereabout by a user using any suitable object or accessory such as a finger, stylus, etc.), and actuate the corresponding connection means according to a predetermined program. In an embodiment, the touch-sensitive surface may comprise two parts, a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 608, and can receive commands from the processor 608 and execute them. In addition, touch sensitive surfaces may be implemented in a variety of types, such as resistive, capacitive, infrared, and surface acoustic waves. The input unit 603 may comprise other input devices in addition to a touch sensitive surface. In particular, other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc.
The display unit 604 may be used to display information input by a user or information provided to the user and various graphical user interfaces of the terminal, which may be composed of graphics, text, icons, video and any combination thereof. The display unit 604 may include a display panel, which in one embodiment may be configured in the form of a liquid crystal display (LCD, liquid Crystal Display), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch-sensitive surface may overlay a display panel, and upon detection of a touch operation thereon or thereabout, the touch-sensitive surface is passed to the processor 608 to determine the type of touch event, and the processor 608 then provides a corresponding visual output on the display panel based on the type of touch event. Although in fig. 6 the touch sensitive surface and the display panel are implemented as two separate components for input and output functions, in some embodiments the touch sensitive surface may be integrated with the display panel to implement the input and output functions.
The terminal may also include at least one sensor 605, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel according to the brightness of ambient light, and a proximity sensor that may turn off the display panel and/or backlight when the terminal moves to the ear. The gravity acceleration sensor can detect the acceleration in all directions (generally three axes), can detect the gravity and the direction when the mobile phone is stationary, can be used for identifying the gesture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration identification related functions (such as pedometer and knocking), and other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor and the like which are also configured by the terminal are not repeated herein.
Audio circuitry 606, speakers, and a microphone may provide an audio interface between the user and the terminal. The audio circuit 606 may transmit the received electrical signal after audio data conversion to a speaker, where the electrical signal is converted to a sound signal for output; on the other hand, the microphone converts the collected sound signals into electrical signals, which are received by the audio circuit 606 and converted into audio data, which are processed by the audio data output processor 608 for transmission to, for example, another terminal via the RF circuit 601, or which are output to the memory 602 for further processing. The audio circuit 606 may also include an ear bud jack to provide communication of the peripheral ear bud with the terminal.
The WiFi belongs to a short-distance wireless transmission technology, and the terminal can help the user to send and receive e-mail, browse web pages, access streaming media and the like through the WiFi module 607, so that wireless broadband internet access is provided for the user. Although fig. 6 shows a WiFi module 607, it is understood that it does not belong to the essential constitution of the terminal, and can be omitted entirely as required within a range that does not change the essence of the application.
The processor 608 is a control center of the terminal, and connects various parts of the entire mobile phone using various interfaces and lines, and performs various functions of the terminal and processes data by running or executing software programs and/or modules stored in the memory 602, and calling data stored in the memory 602, thereby performing overall detection of the mobile phone. In an embodiment, the processor 608 may include one or more processing cores; preferably, the processor 608 may integrate an application processor that primarily handles operating systems, user interfaces, applications, etc., with a modem processor that primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 608.
The terminal also includes a power supply 609 (e.g., a battery) for powering the various components, which may be logically connected to the processor 608 via a power management system so as to provide for managing charging, discharging, and power consumption by the power management system. The power supply 609 may also include one or more of any components, such as a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown, the terminal may further include a camera, a bluetooth module, etc., which will not be described herein. Specifically, in this embodiment, the processor 608 in the terminal loads executable files corresponding to the processes of one or more application programs into the memory 602 according to the following instructions, and the processor 608 executes the application programs stored in the memory 602, so as to implement various functions:
acquiring control attributes of an application interface of an application to be tested;
acquiring control attributes of candidate interfaces;
determining a target interface corresponding to the application interface from the candidate interfaces according to the control attribute of the application interface and the control attribute of the candidate interfaces;
and determining the identification of the application interface according to the identification of the target interface.
In one embodiment, the following functions are implemented:
acquiring an interface layout file and an interface screenshot of a history application interface of an application to be tested;
analyzing an interface layout file of the history application interface to obtain a control list of the history application interface, wherein the control list comprises control identifications of controls and initial control attributes, and the initial control attributes comprise boundary values;
performing screenshot processing on the interface screenshot of the historical application interface according to the boundary value of the control in the historical application interface to obtain the control screenshot of the control in the historical application interface;
determining the enhanced control attribute of the control in the history application interface according to the control screenshot of the control in the history application interface and the interface screenshot of the history application interface;
according to the initial control attribute and the enhanced control attribute of the control in the history application interface, updating and storing a control list of the history application interface; the updated control list includes the control identification of the control, the initial control attribute, and the enhanced control attribute.
In one embodiment, the following functions are implemented:
according to the initial control attribute of the control in the updated control list, the control is divided into an available control or an unavailable control; and
And adding a label attribute for the control according to the initial control attribute of the control in the updated control list.
In one embodiment, the following functions are implemented:
acquiring an interface layout file of an application interface;
analyzing the interface layout file to obtain a control list of the application interface, wherein the control list comprises control identifications and initial control attributes of the controls;
and determining the initial control attribute of the control as the control attribute of the application interface.
In one embodiment, the following functions are implemented:
screening the controls in the control list according to the control attributes corresponding to the controls to obtain available controls;
and determining the initial control attribute of the available control as the control attribute of the application interface.
In one embodiment, the following functions are implemented:
obtaining a boundary value in an initial control attribute of an available control, and performing screenshot processing on an interface screenshot of an application interface to obtain a control screenshot of the available control;
determining the enhanced control attribute of the available control according to the control screenshot of the available control and the interface screenshot;
and determining the initial control attribute and the enhanced control attribute of the available control as the control attribute of the application interface.
In one embodiment, the following functions are implemented:
Acquiring an activity identifier of an application interface;
acquiring an activity identifier of a historical application interface of an application to be tested;
and screening the historical application interface according to the activity identification of the application interface and the activity identification of the historical application interface to obtain a candidate interface.
In one embodiment, the following functions are implemented:
acquiring a key instruction for triggering an application interface;
acquiring a key instruction of a history application interface of an application to be tested;
and screening the historical application interface according to the key instructions of the application interface and the key instructions of the historical application interface to obtain candidate interfaces.
In one embodiment, the following functions are implemented:
obtaining the control similarity between the application interface and the candidate interface according to the control attribute of the application interface and the control attribute of the candidate interface;
and determining a target interface corresponding to the application interface from the candidate interfaces according to the control similarity.
In one embodiment, the following functions are implemented:
acquiring weight values of all controls in an application interface;
acquiring weight values of all controls in the candidate interface;
and obtaining the control similarity between the application interface and the candidate interface according to the initial control attribute and the enhanced control attribute of each control in the application interface and the candidate interface, the weight value of each control in the application interface and the weight value of each control in the candidate interface.
Correspondingly, the embodiment of the application also provides a server, as shown in fig. 7, which shows a schematic structural diagram of the server according to the embodiment of the application, specifically:
the server may include one or more processors 701 of a processing core, memory 702 of one or more computer readable storage media, power supply 703, and input unit 704, among other components. Those skilled in the art will appreciate that the server architecture shown in fig. 7 is not limiting of the server and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components. Wherein:
the processor 701 is a control center of the server, connects respective portions of the entire server using various interfaces and lines, and performs various functions of the server and processes data by running or executing software programs and/or modules stored in the memory 702, and calling data stored in the memory 702, thereby performing overall monitoring of the server. Optionally, processor 701 may include one or more processing cores; preferably, the processor 701 may integrate an application processor and a modem processor, wherein the application processor primarily handles operating systems, user interfaces, applications, etc., and the modem processor primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 701.
The memory 702 may be used to store software programs and modules, and the processor 701 executes various functional applications and data processing by executing the software programs and modules stored in the memory 702. The memory 702 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the server, etc. In addition, the memory 702 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 702 may also include a memory controller to provide access to the memory 702 by the processor 701.
The server also includes a power supply 703 for powering the various components, preferably, the power supply 703 is logically connected to the processor 701 via a power management system, such that functions such as charge, discharge, and power consumption management are performed by the power management system. The power supply 703 may also include one or more of any component, such as a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, etc.
The server may further comprise an input unit 704, which input unit 704 may be used for receiving input digital or character information and generating keyboard, mouse, joystick, optical or trackball signal inputs in connection with user settings and function control.
Although not shown, the server may further include a display unit or the like, which is not described herein. In this embodiment, the processor 701 in the server loads executable files corresponding to the processes of one or more application programs into the memory 702 according to the following instructions, and the processor 701 executes the application programs stored in the memory 702, so as to implement various functions as follows:
acquiring control attributes of an application interface of an application to be tested;
acquiring control attributes of candidate interfaces;
determining a target interface corresponding to the application interface from the candidate interfaces according to the control attribute of the application interface and the control attribute of the candidate interfaces;
and determining the identification of the application interface according to the identification of the target interface.
In one embodiment, the following functions are implemented:
acquiring an interface layout file and an interface screenshot of a history application interface of an application to be tested;
analyzing an interface layout file of the history application interface to obtain a control list of the history application interface, wherein the control list comprises control identifications of controls and initial control attributes, and the initial control attributes comprise boundary values;
Performing screenshot processing on the interface screenshot of the historical application interface according to the boundary value of the control in the historical application interface to obtain the control screenshot of the control in the historical application interface;
determining the enhanced control attribute of the control in the history application interface according to the control screenshot of the control in the history application interface and the interface screenshot of the history application interface;
according to the initial control attribute and the enhanced control attribute of the control in the history application interface, updating and storing a control list of the history application interface; the updated control list includes the control identification of the control, the initial control attribute, and the enhanced control attribute.
In one embodiment, the following functions are implemented:
according to the initial control attribute of the control in the updated control list, the control is divided into an available control or an unavailable control; and
and adding a label attribute for the control according to the initial control attribute of the control in the updated control list.
In one embodiment, the following functions are implemented:
acquiring an interface layout file of an application interface;
analyzing the interface layout file to obtain a control list of the application interface, wherein the control list comprises control identifications and initial control attributes of the controls;
And determining the initial control attribute of the control as the control attribute of the application interface.
In one embodiment, the following functions are implemented:
screening the controls in the control list according to the control attributes corresponding to the controls to obtain available controls;
and determining the initial control attribute of the available control as the control attribute of the application interface.
In one embodiment, the following functions are implemented:
obtaining a boundary value in an initial control attribute of an available control, and performing screenshot processing on an interface screenshot of an application interface to obtain a control screenshot of the available control;
determining the enhanced control attribute of the available control according to the control screenshot of the available control and the interface screenshot;
and determining the initial control attribute and the enhanced control attribute of the available control as the control attribute of the application interface.
In one embodiment, the following functions are implemented:
acquiring an activity identifier of an application interface;
acquiring an activity identifier of a historical application interface of an application to be tested;
and screening the historical application interface according to the activity identification of the application interface and the activity identification of the historical application interface to obtain a candidate interface.
In one embodiment, the following functions are implemented:
Acquiring a key instruction for triggering an application interface;
acquiring a key instruction of a history application interface of an application to be tested;
and screening the historical application interface according to the key instructions of the application interface and the key instructions of the historical application interface to obtain candidate interfaces.
In one embodiment, the following functions are implemented:
obtaining the control similarity between the application interface and the candidate interface according to the control attribute of the application interface and the control attribute of the candidate interface;
and determining a target interface corresponding to the application interface from the candidate interfaces according to the control similarity.
In one embodiment, the following functions are implemented:
acquiring weight values of all controls in an application interface;
acquiring weight values of all controls in the candidate interface;
and obtaining the control similarity between the application interface and the candidate interface according to the initial control attribute and the enhanced control attribute of each control in the application interface and the candidate interface, the weight value of each control in the application interface and the weight value of each control in the candidate interface.
In the foregoing embodiments, the descriptions of the embodiments are focused on, and the portions of an embodiment that are not described in detail in the foregoing embodiments may be referred to in the foregoing detailed description of the application test method, which is not repeated herein.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present application provide a computer readable storage medium having stored therein a plurality of instructions capable of being loaded by a processor to perform the steps of any of the methods provided by the embodiments of the present application. For example, the instructions may perform the steps of:
acquiring control attributes of an application interface of an application to be tested;
acquiring control attributes of candidate interfaces;
determining a target interface corresponding to the application interface from the candidate interfaces according to the control attribute of the application interface and the control attribute of the candidate interfaces;
and determining the identification of the application interface according to the identification of the target interface.
In one embodiment, the following functions are implemented:
acquiring an interface layout file and an interface screenshot of a history application interface of an application to be tested;
analyzing an interface layout file of the history application interface to obtain a control list of the history application interface, wherein the control list comprises control identifications of controls and initial control attributes, and the initial control attributes comprise boundary values;
Performing screenshot processing on the interface screenshot of the historical application interface according to the boundary value of the control in the historical application interface to obtain the control screenshot of the control in the historical application interface;
determining the enhanced control attribute of the control in the history application interface according to the control screenshot of the control in the history application interface and the interface screenshot of the history application interface;
according to the initial control attribute and the enhanced control attribute of the control in the history application interface, updating and storing a control list of the history application interface; the updated control list includes the control identification of the control, the initial control attribute, and the enhanced control attribute.
In one embodiment, the following functions are implemented:
according to the initial control attribute of the control in the updated control list, the control is divided into an available control or an unavailable control; and
and adding a label attribute for the control according to the initial control attribute of the control in the updated control list.
In one embodiment, the following functions are implemented:
acquiring an interface layout file of an application interface;
analyzing the interface layout file to obtain a control list of the application interface, wherein the control list comprises control identifications and initial control attributes of the controls;
And determining the initial control attribute of the control as the control attribute of the application interface.
In one embodiment, the following functions are implemented:
screening the controls in the control list according to the control attributes corresponding to the controls to obtain available controls;
and determining the initial control attribute of the available control as the control attribute of the application interface.
In one embodiment, the following functions are implemented:
obtaining a boundary value in an initial control attribute of an available control, and performing screenshot processing on an interface screenshot of an application interface to obtain a control screenshot of the available control;
determining the enhanced control attribute of the available control according to the control screenshot of the available control and the interface screenshot;
and determining the initial control attribute and the enhanced control attribute of the available control as the control attribute of the application interface.
In one embodiment, the following functions are implemented:
acquiring an activity identifier of an application interface;
acquiring an activity identifier of a historical application interface of an application to be tested;
and screening the historical application interface according to the activity identification of the application interface and the activity identification of the historical application interface to obtain a candidate interface.
In one embodiment, the following functions are implemented:
Acquiring a key instruction for triggering an application interface;
acquiring a key instruction of a history application interface of an application to be tested;
and screening the historical application interface according to the key instructions of the application interface and the key instructions of the historical application interface to obtain candidate interfaces.
In one embodiment, the following functions are implemented:
obtaining the control similarity between the application interface and the candidate interface according to the control attribute of the application interface and the control attribute of the candidate interface;
and determining a target interface corresponding to the application interface from the candidate interfaces according to the control similarity.
In one embodiment, the following functions are implemented:
acquiring weight values of all controls in an application interface;
acquiring weight values of all controls in the candidate interface;
and obtaining the control similarity between the application interface and the candidate interface according to the initial control attribute and the enhanced control attribute of each control in the application interface and the candidate interface, the weight value of each control in the application interface and the weight value of each control in the candidate interface.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Wherein the computer-readable storage medium may comprise: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
The steps in any method provided by the embodiment of the present application may be executed by the instructions stored in the storage medium, so that the beneficial effects that any method provided by the embodiment of the present application may be achieved, which are detailed in the previous embodiments and are not repeated herein.
The application testing method, the application testing device, the terminal, the server and the computer readable storage medium provided by the embodiment of the application are described in detail, and specific examples are applied to illustrate the principle and the implementation of the application, and the description of the above embodiments is only used for helping to understand the method and the core idea of the application; meanwhile, as those skilled in the art will vary in the specific embodiments and application scope according to the ideas of the present application, the present description should not be construed as limiting the present application in summary.

Claims (12)

1. An application testing method, comprising:
the method for acquiring the control attribute of the application interface of the application to be tested comprises the following steps: obtaining a boundary value in an initial control attribute of an available control, and performing screenshot processing on an interface screenshot of the application interface to obtain a control screenshot of the available control; determining the enhanced control attribute of the available control according to the control screenshot of the available control and the interface screenshot; determining the initial control attribute and the enhanced control attribute of the available control as the control attribute of the application interface; wherein, the control attribute of the application interface comprises: initial control attributes and enhanced control attributes;
Obtaining control attributes of candidate interfaces, wherein the control attributes of the candidate interfaces comprise: initial control attributes and enhanced control attributes;
according to the control attribute of the application interface and the control attribute of the candidate interface, determining a target interface corresponding to the application interface from the candidate interface comprises the following steps: obtaining the control similarity between the application interface and the candidate interface according to the control attribute of the application interface and the control attribute of the candidate interface; determining a target interface corresponding to the application interface from the candidate interfaces according to the control similarity;
and determining the identification of the application interface according to the identification of the target interface.
2. The application testing method according to claim 1, further comprising, before the step of acquiring the control attribute of the application interface of the application to be tested:
acquiring an interface layout file and an interface screenshot of a history application interface of the application to be tested;
analyzing an interface layout file of the history application interface to obtain a control list of the history application interface, wherein the control list comprises control identifications of controls and initial control attributes, and the initial control attributes comprise boundary values;
Performing screenshot processing on the interface screenshot of the historical application interface according to the boundary value of the control in the historical application interface to obtain the control screenshot of the control in the historical application interface;
determining the enhanced control attribute of the control in the history application interface according to the control screenshot of the control in the history application interface and the interface screenshot of the history application interface;
according to the initial control attribute and the enhanced control attribute of the control in the history application interface, updating and storing a control list of the history application interface; the updated control list includes the control identification of the control, the initial control attribute, and the enhanced control attribute.
3. The application testing method of claim 2, further comprising, after the step of updating and storing the control list of the history application interface:
dividing the control into available control or unavailable control according to the initial control attribute of the control in the updated control list; and
and adding label attributes to the control according to the initial control attributes of the control in the updated control list.
4. The application testing method according to claim 1, wherein the initial control attribute is obtained by:
Acquiring an interface layout file of the application interface;
analyzing the interface layout file to obtain a control list of the application interface, wherein the control list comprises control identifications and initial control attributes of the controls.
5. The application testing method of claim 4, further comprising, after the step of obtaining the control list of the application interface:
and screening the controls in the control list according to the initial control attributes corresponding to the controls to obtain available controls.
6. The application testing method according to claim 1, further comprising, after the step of acquiring the control attribute of the application interface of the application to be tested:
acquiring an activity identifier of the application interface;
acquiring an activity identifier of a history application interface of the application to be tested;
and screening the historical application interface according to the activity identification of the application interface and the activity identification of the historical application interface to obtain the candidate interface.
7. The application testing method according to claim 1, further comprising, after the step of acquiring the control attribute of the application interface of the application to be tested:
Acquiring a key instruction for triggering the application interface;
acquiring a key instruction of a history application interface of the application to be tested;
and screening the historical application interface according to the key instructions of the application interface and the key instructions of the historical application interface to obtain the candidate interface.
8. The application testing method according to claim 1, wherein the step of obtaining the control similarity between the application interface and the candidate interface according to the control attribute of the application interface and the control attribute of the candidate interface includes:
acquiring weight values of all controls in the application interface;
acquiring weight values of all controls in the candidate interface;
and obtaining the control similarity between the application interface and the candidate interface according to the initial control attribute and the enhanced control attribute of each control in the application interface and the candidate interface, the weight value of each control in the application interface and the weight value of each control in the candidate interface.
9. An application testing apparatus, comprising:
the acquisition module is used for acquiring the control attribute of the application interface of the application to be tested, and comprises the following steps: obtaining a boundary value in an initial control attribute of an available control, and performing screenshot processing on an interface screenshot of the application interface to obtain a control screenshot of the available control; determining the enhanced control attribute of the available control according to the control screenshot of the available control and the interface screenshot; determining the initial control attribute and the enhanced control attribute of the available control as the control attribute of the application interface; wherein, the control attribute of the application interface comprises: initial control attributes and enhanced control attributes;
The calling module is used for acquiring the control attribute of the candidate interface, wherein the control attribute of the candidate interface comprises: initial control attributes and enhanced control attributes;
the matching module is configured to determine, from the candidate interfaces, a target interface corresponding to the application interface according to the control attribute of the application interface and the control attribute of the candidate interface, where the matching module includes: obtaining the control similarity between the application interface and the candidate interface according to the control attribute of the application interface and the control attribute of the candidate interface; determining a target interface corresponding to the application interface from the candidate interfaces according to the control similarity;
and the determining module is used for determining the identification of the application interface according to the identification of the target interface.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when run on a computer, causes the computer to perform the application test method according to any one of claims 1-8.
11. A terminal, comprising: comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 8 when the computer program is executed.
12. A server, comprising: comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 8 when the computer program is executed.
CN201911304618.6A 2019-12-17 2019-12-17 Application testing method and device Active CN111078556B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911304618.6A CN111078556B (en) 2019-12-17 2019-12-17 Application testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911304618.6A CN111078556B (en) 2019-12-17 2019-12-17 Application testing method and device

Publications (2)

Publication Number Publication Date
CN111078556A CN111078556A (en) 2020-04-28
CN111078556B true CN111078556B (en) 2023-10-13

Family

ID=70315356

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911304618.6A Active CN111078556B (en) 2019-12-17 2019-12-17 Application testing method and device

Country Status (1)

Country Link
CN (1) CN111078556B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111767224A (en) * 2020-06-29 2020-10-13 浙江中控技术股份有限公司 Method, device and equipment for automatic testing and computer storage medium
CN111984476B (en) * 2020-06-29 2023-08-01 百度在线网络技术(北京)有限公司 Test method and device
CN113094257B (en) * 2021-03-08 2024-04-05 上海硬通网络科技有限公司 Application testing method and device and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108628732A (en) * 2017-03-16 2018-10-09 腾讯科技(深圳)有限公司 A kind of application interface control visiting test method and device
CN110457214A (en) * 2019-07-30 2019-11-15 腾讯科技(深圳)有限公司 Application testing method and device, electronic equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108628732A (en) * 2017-03-16 2018-10-09 腾讯科技(深圳)有限公司 A kind of application interface control visiting test method and device
CN110457214A (en) * 2019-07-30 2019-11-15 腾讯科技(深圳)有限公司 Application testing method and device, electronic equipment

Also Published As

Publication number Publication date
CN111078556A (en) 2020-04-28

Similar Documents

Publication Publication Date Title
CN111078556B (en) Application testing method and device
CN108287706B (en) Data processing method and device
CN111666222A (en) Test method and related device
CN111222563A (en) Model training method, data acquisition method and related device
CN112749074B (en) Test case recommending method and device
EP3105912B1 (en) Application-based service providing method and system
CN108874653B (en) Task testing method, tester, shared server and readable storage medium
CN111359210B (en) Data processing method and device, electronic equipment and storage medium
CN112199246A (en) Terminal testing method and device, storage medium and mobile terminal
CN116303085A (en) Test reason analysis method, device, equipment and storage medium
CN115600213A (en) Vulnerability management method, device, medium and equipment based on application program
CN112667868B (en) Data detection method and device
CN114490307A (en) Unit testing method, device and storage medium
CN114064447A (en) Interface test method and device, storage medium and terminal
CN108572858B (en) Method and device for loading notification bar
CN115080411A (en) Interface test case generation method and device, electronic equipment and storage medium
CN117787207A (en) Standard cell library verification method and device, storage medium and electronic equipment
CN116383053A (en) Software code defect detection method, device, medium and equipment
CN115640081A (en) Business case decision method and device, electronic equipment and storage medium
CN115543314A (en) Report generation method, device, equipment and storage medium
CN117806942A (en) Interface element processing method and device and storage medium
CN116881143A (en) Data object copying abnormality investigation method, device, equipment and storage medium
CN115878457A (en) Test data verification method and device, electronic equipment and storage medium
CN115858331A (en) Task testing method and device, storage medium and electronic equipment
CN115905008A (en) Method, device, equipment and storage medium for automatically generating test case

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40022468

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant