CN104615538A - Mobile phone application testing method based on mobile phone interface control elements - Google Patents

Mobile phone application testing method based on mobile phone interface control elements Download PDF

Info

Publication number
CN104615538A
CN104615538A CN201510061301.XA CN201510061301A CN104615538A CN 104615538 A CN104615538 A CN 104615538A CN 201510061301 A CN201510061301 A CN 201510061301A CN 104615538 A CN104615538 A CN 104615538A
Authority
CN
China
Prior art keywords
mobile phone
control
control element
testing method
application testing
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.)
Granted
Application number
CN201510061301.XA
Other languages
Chinese (zh)
Other versions
CN104615538B (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.)
COMCAT TECHNOLOGY Co Ltd
Original Assignee
COMCAT TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by COMCAT TECHNOLOGY Co Ltd filed Critical COMCAT TECHNOLOGY Co Ltd
Priority to CN201510061301.XA priority Critical patent/CN104615538B/en
Publication of CN104615538A publication Critical patent/CN104615538A/en
Application granted granted Critical
Publication of CN104615538B publication Critical patent/CN104615538B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)

Abstract

The invention provides a mobile phone application testing method based on mobile phone interface control elements. The method comprises the steps that a client program acquires the description information of all the control elements on a mobile phone interface, wherein the information includes ID, text, element size, element position and whether a control is clickable; a unique identification is generated for each control by means of the information; for each control, the unique identification and an operation instruction aiming at the control are sent to a mobile phone app, and then corresponding operation is conducted on the control by the mobile phone app. According to the method, each control is provided with a unique identification to be recognized, the unique identification of each control is unchanged on different mobile phones with different resolutions, a test case does not need to be rewritten, workload is small, the readability of the case is high, only a small part of system resources is occupied, and testing time is short.

Description

A kind of mobile phone application testing method based on mobile phone interface control element
Technical field
The invention belongs to mobile phone test field, especially relate to a kind of mobile phone application testing method based on mobile phone interface control element.
Background technology
The method of testing of current phone application program manipulates the element on mobile phone interface based on coordinate, and testing needle, to whole screen, as clicked certain button, needs the coordinate position of load button.
But use coordinate method to there is following defect:
When 1, using coordinate system, in same application, the size of same button on different resolution mobile phone is not identical with position, and when testing same being applied on different mobile phone, the coordinate of operation needs to recalculate acquisition, and it is large to write test case workload.
When 2, using coordinate system, write test case, control is by coordinates logo, and use-case is readable poor.
In order to solve the adaptation issues of different resolution mobile phone, and in order to reduce the workload of use-case author, when using coordinate system, control location is calculated by the method for picture comparison, although this method again can write test case on different resolution mobile phone, but all to carry out picture comparison before executable operations, take computational resource and consume the test duration.
Summary of the invention
In view of this, the present invention is intended to propose a kind of mobile phone application testing method based on mobile phone interface control element, and workload is little, and occupying system resources is little, and the test duration is short.
For achieving the above object, technical scheme of the present invention is achieved in that
Based on a mobile phone application testing method for mobile phone interface control element, it is characterized in that, comprise the steps:
(1) CLIENT PROGRAM of pc end and the app of mobile phone terminal manipulation mobile phone is set up;
(2) CLIENT PROGRAM obtains the descriptor of all control element on mobile phone interface;
(3) CLIENT PROGRAM utilizes the information obtained to generate a unique identification to each control;
(4) CLIENT PROGRAM is by unique identification and will be sent to mobile phone terminal app to the operational order of this control;
(5) mobile phone terminal app does corresponding operation to control;
(6) operational order is written as script by CLIENT PROGRAM by client, realizes the test of mobile phone and application.
Preferably, step (2) described CLIENT PROGRAM obtains the descriptor of all control element on mobile phone interface by the function that *** uiautomator framework provides.
Further, the descriptor of step (2) described control element comprises the ID of control, whether text, element size, element position, control can click.
Preferably, the described uniquely identified generation method of step (3) is hierarchical relationship method, and arrange mark with the hierarchical relationship of control element, level comprises framework, view, button.
Preferably, the described uniquely identified generation method of step (3) is class indexing method, and all control element classification, count the number of times that all elements type occurs, and number.
Preferably, the method for step (6) described compile script is visual script edit, and client just can realize quick compile script by clicking and pulling.
Relative to prior art, a kind of mobile phone application testing method based on mobile phone interface control element of the present invention has following advantage:
(1) the present invention uses unique identification to identify to control operation, and the unique identification of a control is identical on different resolution mobile phone, and do not need again to write test case, workload is little.
(2) when the present invention writes test case, control is identified by unique identification, and use-case readability is high.
(3) the present invention does not need picture comparison and directly just can determine control by unique identification, so occupying system resources is little, the test duration is short.
Accompanying drawing explanation
The accompanying drawing forming a part of the present invention is used to provide a further understanding of the present invention, and schematic description and description of the present invention, for explaining the present invention, does not form inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 is the step schematic diagram described in the embodiment of the present invention.
Embodiment
Below with reference to the accompanying drawings and describe the present invention in detail in conjunction with the embodiments.
As shown in Figure 1, components testing of the present invention is a kind of method of testing completing mobile phone application testing based on the control element on mobile phone interface, and it is mainly divided into two major parts, the CLIENT PROGRAM of pc end and the app of mobile phone terminal manipulation mobile phone;
Its groundwork mode summary is as follows:
CLIENT PROGRAM obtains the descriptor of all control element on mobile phone interface by the function that *** uiautomator framework provides, these information comprise ID, text, element size, element position, whether control the information such as can clicks, and then utilizes these information to generate a unique identification to each control, then by unique identification and will be sent to mobile phone terminal app to the operational order of this control, mobile phone terminal app does corresponding operation (as clicked operations such as pulling) to control;
Wherein, identification method has two kinds:
1. hierarchical relationship method (IndexList)
In device screen, all control element arrange with hierarchical relationship, two view are comprised in a such as frame, wherein comprise three button in second view, each control element has an index, identify its position (0-based) in father's element, three button such as, if think mark second button, so his IndexList is exactly: 011, the 1st button element in the 1st view in the 0th frame.
2. class indexing method (ClassIndex)
In device screen, all control element are all classification, and such as frame, view, button etc. can count the number of times that all elements type occurs, and number:
Frame:frame0,frame1,farem2...
View:view0,view1,view2,view3...
Button:button0,button1,button2,button3,button4...
In time resolving all elements, the element that each appearance one is of the same type, just add up the number of times that this element occurs, this number of times is exactly ClassIndex, the description shown of both having been clapped by hierarchical structure.
The 001button of the same mark of IndexList above, so just probably becomes Button [4] by ClassIndex mark.
The processing speed that this method describes than level when equipment end processes is fast, holds visual effect better at PC.
At present with ClassIndex method for main identification method, which kind of no matter uses identify, can process in equipment end.
Operational order is written as script by CLIENT PROGRAM by client, realizes the test of mobile phone and application.
The contrast of same method of testing in the past:
Method of testing in the past manipulates the element on mobile phone interface based on coordinate, and testing needle is to whole screen.As clicked certain button, need the coordinate position of load button.
Current method of testing manipulates the element on mobile phone interface with control, and testing needle, to interface element, as clicked certain button, needs the ID of load button.
Comparison:
1) when using coordinate system, in same application, the size of same button on different resolution mobile phone is not identical with position, and when testing same being applied on different mobile phone, the coordinate of operation needs to recalculate acquisition, and it is large to write test case workload.
When using control systems, use ID to identify to control operation, the ID of a control is identical on different resolution mobile phone, and do not need again to write test case, workload is little.
2) when using coordinate system, write test case, control is by coordinates logo, and use-case is readable poor.
When using control systems, write test case, control is identified by ID, and use-case readability is high.
3) in order to solve 1) described in the adaptation issues of different resolution mobile phone, when using coordinate system, in order to reduce the workload of use-case author, control location is calculated by the method for picture comparison, although this method again can write test case on different resolution mobile phone, but all to carry out picture comparison before executable operations, take computational resource and consume the test duration, and when using control systems, directly control just can be determined by ID because not needing picture comparison, so occupying system resources is little, the test duration is short.
CLIENT PROGRAM major function:
1) mobile phone interface is shown
2) all controls that can recognize are identified
3) can realize by mouse the function controlling mobile phone, as clicked the button on interface, mobile phone terminal can respond the operation of pressing.
4) provide visual script edit, user only need click and pull just can quick compile script.
5) attribute of all controls on mobile phone interface can conveniently be checked
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (6)

1., based on a mobile phone application testing method for mobile phone interface control element, it is characterized in that, comprise the steps:
(1) CLIENT PROGRAM of pc end and the app of mobile phone terminal manipulation mobile phone is set up;
(2) CLIENT PROGRAM obtains the descriptor of all control element on mobile phone interface;
(3) CLIENT PROGRAM utilizes the information obtained to generate a unique identification to each control;
(4) CLIENT PROGRAM is by unique identification and will be sent to mobile phone terminal app to the operational order of this control;
(5) mobile phone terminal app does corresponding operation to control;
(6) operational order is written as script by CLIENT PROGRAM by client, realizes the test of mobile phone and application.
2. a kind of mobile phone application testing method based on mobile phone interface control element according to claim 1, it is characterized in that, step (2) described CLIENT PROGRAM obtains the descriptor of all control element on mobile phone interface by the function that *** uiautomator framework provides.
3. a kind of mobile phone application testing method based on mobile phone interface control element according to claim 1 and 2, it is characterized in that, the descriptor of step (2) described control element comprises the ID of control, whether text, element size, element position, control can click.
4. a kind of mobile phone application testing method based on mobile phone interface control element according to claim 1, it is characterized in that, the described uniquely identified generation method of step (3) is for being hierarchical relationship method, arrange mark with the hierarchical relationship of control element, level comprises framework, view, button.
5. a kind of mobile phone application testing method based on mobile phone interface control element according to claim 1, it is characterized in that, the described uniquely identified generation method of step (3) is class indexing method, all control element classification, count the number of times that all elements type occurs, and number.
6. a kind of mobile phone application testing method based on mobile phone interface control element according to claim 1, it is characterized in that, the method of step (6) described compile script is visual script edit, and client just can realize quick compile script by clicking and pulling.
CN201510061301.XA 2015-02-05 2015-02-05 A kind of mobile phone application testing method based on mobile phone interface control element Active CN104615538B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510061301.XA CN104615538B (en) 2015-02-05 2015-02-05 A kind of mobile phone application testing method based on mobile phone interface control element

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510061301.XA CN104615538B (en) 2015-02-05 2015-02-05 A kind of mobile phone application testing method based on mobile phone interface control element

Publications (2)

Publication Number Publication Date
CN104615538A true CN104615538A (en) 2015-05-13
CN104615538B CN104615538B (en) 2018-01-16

Family

ID=53149995

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510061301.XA Active CN104615538B (en) 2015-02-05 2015-02-05 A kind of mobile phone application testing method based on mobile phone interface control element

Country Status (1)

Country Link
CN (1) CN104615538B (en)

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105095088A (en) * 2015-09-02 2015-11-25 厦门美图移动科技有限公司 Calculator automatic test method and test system based on uiautomator test framework
CN105159992A (en) * 2015-09-01 2015-12-16 北京瑞汛世纪科技有限公司 Method and device for detecting page contents and network behaviors of application program
CN105279093A (en) * 2015-11-26 2016-01-27 上海斐讯数据通信技术有限公司 Software test method, device and equipment
CN106021099A (en) * 2016-05-12 2016-10-12 上海联彤网络通讯技术有限公司 System and method for achieving UI automatic test of intelligent terminal
CN106055468A (en) * 2016-04-25 2016-10-26 乐视控股(北京)有限公司 Method and system for automatic testing of interface
CN106155863A (en) * 2016-07-25 2016-11-23 北京小米移动软件有限公司 Terminal anticipatory behavior control method and terminal
CN106201895A (en) * 2016-07-25 2016-12-07 东软集团股份有限公司 Application testing method and device
CN108089967A (en) * 2017-12-12 2018-05-29 成都睿码科技有限责任公司 A kind of method for crawling Android mobile phone App data
CN105988934B (en) * 2016-02-01 2018-07-27 腾讯科技(深圳)有限公司 Hand swims automated detection method and device
CN108345485A (en) * 2018-01-30 2018-07-31 口碑(上海)信息技术有限公司 identification method and device for interface view
CN109117324A (en) * 2017-06-26 2019-01-01 深圳回收宝科技有限公司 Endpoint detection methods, device, terminal and storage medium
CN109117035A (en) * 2017-06-26 2019-01-01 深圳回收宝科技有限公司 Hidden method, terminal recovery system and the storage medium of suspension icon
CN110502421A (en) * 2018-05-17 2019-11-26 长沙博为软件技术股份有限公司 A kind of automated testing method based on work process flow configuration
CN110888573A (en) * 2019-11-08 2020-03-17 爱钱进(北京)信息科技有限公司 Method and device for identifying control and storage medium
CN111694752A (en) * 2020-07-28 2020-09-22 中移(杭州)信息技术有限公司 Application testing method, electronic device and storage medium
CN112783764A (en) * 2021-01-08 2021-05-11 展讯通信(上海)有限公司 Automatic testing method and device for application program, storage medium and terminal
CN112905451A (en) * 2021-02-02 2021-06-04 北京罗克维尔斯科技有限公司 Automatic testing method and device for application program
US11106571B2 (en) 2019-12-12 2021-08-31 Micro Focus Llc Identification of input object in a graphical user interface
CN117873907A (en) * 2024-03-12 2024-04-12 麒麟软件有限公司 Control element testing method and device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110016453A1 (en) * 2009-07-16 2011-01-20 Accenture Global Services Gmbh Modularizing and aspectizing graphical user interface directed test scripts
CN103164300A (en) * 2011-12-13 2013-06-19 腾讯科技(深圳)有限公司 Mobile terminal touch screen automatic testing method and device
CN103914375A (en) * 2013-01-07 2014-07-09 百度国际科技(深圳)有限公司 Method and device for testing owner-drawing interface software

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110016453A1 (en) * 2009-07-16 2011-01-20 Accenture Global Services Gmbh Modularizing and aspectizing graphical user interface directed test scripts
CN103164300A (en) * 2011-12-13 2013-06-19 腾讯科技(深圳)有限公司 Mobile terminal touch screen automatic testing method and device
CN103914375A (en) * 2013-01-07 2014-07-09 百度国际科技(深圳)有限公司 Method and device for testing owner-drawing interface software

Cited By (26)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105159992A (en) * 2015-09-01 2015-12-16 北京瑞汛世纪科技有限公司 Method and device for detecting page contents and network behaviors of application program
CN105095088A (en) * 2015-09-02 2015-11-25 厦门美图移动科技有限公司 Calculator automatic test method and test system based on uiautomator test framework
CN105279093A (en) * 2015-11-26 2016-01-27 上海斐讯数据通信技术有限公司 Software test method, device and equipment
CN105279093B (en) * 2015-11-26 2018-04-06 上海斐讯数据通信技术有限公司 Method for testing software, device and equipment
CN105988934B (en) * 2016-02-01 2018-07-27 腾讯科技(深圳)有限公司 Hand swims automated detection method and device
CN106055468A (en) * 2016-04-25 2016-10-26 乐视控股(北京)有限公司 Method and system for automatic testing of interface
CN106021099A (en) * 2016-05-12 2016-10-12 上海联彤网络通讯技术有限公司 System and method for achieving UI automatic test of intelligent terminal
CN106201895B (en) * 2016-07-25 2018-10-23 东软集团股份有限公司 Application testing method and device
CN106155863A (en) * 2016-07-25 2016-11-23 北京小米移动软件有限公司 Terminal anticipatory behavior control method and terminal
CN106201895A (en) * 2016-07-25 2016-12-07 东软集团股份有限公司 Application testing method and device
CN109117324A (en) * 2017-06-26 2019-01-01 深圳回收宝科技有限公司 Endpoint detection methods, device, terminal and storage medium
CN109117035A (en) * 2017-06-26 2019-01-01 深圳回收宝科技有限公司 Hidden method, terminal recovery system and the storage medium of suspension icon
CN108089967A (en) * 2017-12-12 2018-05-29 成都睿码科技有限责任公司 A kind of method for crawling Android mobile phone App data
CN108345485B (en) * 2018-01-30 2021-05-07 口碑(上海)信息技术有限公司 Identification method and device for interface view
CN108345485A (en) * 2018-01-30 2018-07-31 口碑(上海)信息技术有限公司 identification method and device for interface view
CN110502421A (en) * 2018-05-17 2019-11-26 长沙博为软件技术股份有限公司 A kind of automated testing method based on work process flow configuration
CN110888573A (en) * 2019-11-08 2020-03-17 爱钱进(北京)信息科技有限公司 Method and device for identifying control and storage medium
US11106571B2 (en) 2019-12-12 2021-08-31 Micro Focus Llc Identification of input object in a graphical user interface
CN111694752A (en) * 2020-07-28 2020-09-22 中移(杭州)信息技术有限公司 Application testing method, electronic device and storage medium
CN111694752B (en) * 2020-07-28 2023-09-05 中移(杭州)信息技术有限公司 Application testing method, electronic device and storage medium
CN112783764A (en) * 2021-01-08 2021-05-11 展讯通信(上海)有限公司 Automatic testing method and device for application program, storage medium and terminal
CN112783764B (en) * 2021-01-08 2022-07-19 展讯通信(上海)有限公司 Automatic testing method and device for application program, storage medium and terminal
CN112905451A (en) * 2021-02-02 2021-06-04 北京罗克维尔斯科技有限公司 Automatic testing method and device for application program
CN112905451B (en) * 2021-02-02 2023-08-25 北京罗克维尔斯科技有限公司 Automatic testing method and device for application program
CN117873907A (en) * 2024-03-12 2024-04-12 麒麟软件有限公司 Control element testing method and device and storage medium
CN117873907B (en) * 2024-03-12 2024-06-07 麒麟软件有限公司 Control element testing method and device and storage medium

Also Published As

Publication number Publication date
CN104615538B (en) 2018-01-16

Similar Documents

Publication Publication Date Title
CN104615538A (en) Mobile phone application testing method based on mobile phone interface control elements
CN110704136B (en) Method for rendering applet components, client, electronic device and storage medium
CN113259224B (en) Method and device for sending customer service data
CN109089044A (en) Portable communication device for image procossing
CN108021583B (en) Page loading method and client
CN106250520A (en) Geographical track query and indication method based on time shaft and device
CN107040574B (en) Screenshot and data processing method and device
CN103164300A (en) Mobile terminal touch screen automatic testing method and device
CN103914375A (en) Method and device for testing owner-drawing interface software
US9372777B2 (en) Collecting and attaching a bug trace to a problem information technology ticket
US10656806B2 (en) Display interface systems and methods
US9454667B2 (en) Granting object authority via a multi-touch screen to a collaborator
CN104301788A (en) Method and device for providing video interaction
CN105138463A (en) Testing method and system for mobile terminal software
CN102946334A (en) Method and system for acquiring valid image verification code
CN104063071A (en) Content input method and device
CN105354138A (en) Method for determining specific control attribute of mobile phone page
CN110532159A (en) Data decryptor method, apparatus, equipment and computer readable storage medium
CN110825594B (en) Data reporting and issuing method, client and server
CN103369140A (en) Display font amplification method, system and communication terminal
CN105847319A (en) Mobile terminal network request method and system
CN103198125B (en) The control method of page data loading and system
CN110727383A (en) Touch interaction method and device based on small program, electronic equipment and storage medium
CN105068718A (en) Information processing method and electronic device
CN104978171A (en) Output method and device of recognizable identifier

Legal Events

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