CN105354138A - Method for determining specific control attribute of mobile phone page - Google Patents

Method for determining specific control attribute of mobile phone page Download PDF

Info

Publication number
CN105354138A
CN105354138A CN201510658566.8A CN201510658566A CN105354138A CN 105354138 A CN105354138 A CN 105354138A CN 201510658566 A CN201510658566 A CN 201510658566A CN 105354138 A CN105354138 A CN 105354138A
Authority
CN
China
Prior art keywords
node
control
mobile phone
sequential value
type information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510658566.8A
Other languages
Chinese (zh)
Inventor
陈潇潞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Feixun Data Communication Technology Co Ltd
Original Assignee
Shanghai Feixun Data Communication 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 Shanghai Feixun Data Communication Technology Co Ltd filed Critical Shanghai Feixun Data Communication Technology Co Ltd
Priority to CN201510658566.8A priority Critical patent/CN105354138A/en
Publication of CN105354138A publication Critical patent/CN105354138A/en
Pending legal-status Critical Current

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/3684Test management for test design, e.g. generating new test cases

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention provides a method for determining a specific control attribute of a mobile phone page through mobile phone image capture coordinates and a control sequence. The method is characterized by comprising: performing image capture on the mobile phone page, recording a position clicked by a user through a mouse, and comparing the position with an extracted corresponding attribute value in a page layout file to determine that a control is clicked by the user; performing comparison on a class value of the control in xml, and if the same class value occurs before the control, increasing sequence numbers in sequence; and importing obtained type names and sequence numbers through a UIautomator tool to determine the control, so that the control can be operated. Compared with single transmission of a coordinate instruction, a state after execution can be judged and an attribute value can be read; and compared with judgment by single text information, the problem of incapability of determining the control due to no text information is avoided.

Description

A kind of method determining particular control attribute on the mobile phone page
Technical field
The present invention relates to technical field of mobile terminals, particularly relate to a kind of method determining particular control attribute on the mobile phone page, in particular to the method being determined particular control attribute on the mobile phone page by mobile phone picture sectional drawing coordinate and control sequence, for the automatic test of smart mobile phone.
Background technology
Smart mobile phone is being carried out in the process of automatic test, needing to record execution script.When recording execution script, following two kinds of methods are adopted to operate the control on mobile phone interface:
The first, after tester obtains current phone interface sectional drawing, the control pattern that the control that click will operate on the sectional drawing of current phone interface is again corresponding, obtain click coordinate by computer program, then allow mobile phone click this coordinate by corresponding order (such as adb order).
Although this method can allow mobile phone occur click action, the attribute of clicked control cannot be obtained, thus cannot judge to click effect.Further, the versatility of this method is poor.
After the second, tester obtain current phone interface sectional drawing and the interface layout files corresponding to current phone interface that draws off, the control pattern that the control that click will operate on the sectional drawing of current phone interface is again corresponding, text message is obtained by computer program, by text message compared with the content in text message section each in interface layout files, thus obtain control corresponding to control pattern.
This method has many restrictions in actual applications, such as: if control does not have text message, then cannot determine corresponding control; If when the multiple controls on current phone interface have identical text message, then can judge by accident when determining corresponding control.
Summary of the invention
The object of this invention is to provide a kind of method determining particular control attribute on the mobile phone page, particularly relate to mobile phone screen shot coordinate and control sequence to determine the method for particular control attribute on the mobile phone page
In order to achieve the above object, technical scheme of the present invention there is provided a kind of method determining particular control attribute on the mobile phone page, comprises the following steps:
Step 1, obtain current phone interface sectional drawing and with the interface layout files corresponding with current phone interface phase drawn off, in interface layout files, each control on current phone interface is defined as a node, and each node at least comprises the boundary information of record present node coordinate range;
Step 2, the control pattern that the control that click will operate on sectional drawing is corresponding;
It is characterized in that, also comprise:
The position coordinates of click place in step 3, obtaining step 2, according to the boundary information of node each in interface layout files, determines the node that this position coordinates is corresponding;
Step 4, the control corresponding to control pattern according to result obtained in the previous step operate accordingly.
Preferably, it is characterized in that:
In described step 1, described node also comprises the type information of record present node type;
After described step 3, and before described step 4, also comprise:
Steps A, obtain the type information of the node determined in described step 3;
In step B, traversal interface layout files, the type information of all nodes, compared with the type information obtain, thus obtains sequential value by itself and steps A.
Preferably, corresponding operation described in step 4 comprises: the sequential value that the type information obtained according to described steps A and described step B obtain, obtain in step 2 sequential value that the control property of control corresponding to the control pattern clicked and/or the type information obtained according to described steps A and described step B obtain, the control corresponding to control pattern clicked in operation steps 2.
Preferably, described step 3 comprises:
Step 3.1, first node in interface layout files is set to present node;
The position coordinates of click place in step 3.2, determining step 2 in the coordinate range that records of the no boundary information falling into present node, if so, present node is the node corresponding with this position coordinates, be designated as control node, enter described step 4, if not, then enter step 3.3;
Step 3.3, next node is set to present node, returns step 3.2, until all nodes in traversal interface layout files.
Preferably, described step B comprises:
B.1, by sequential value step is initialized as a, a be not less than 1 integer, and a upper node of control node is set to present node;
Step B.2, type information that described steps A obtained compared with the type information of present node, if identical, then by sequential value increasing or decreasing, enter step B.3, if different, then directly enter step B.3;
B.3, by a upper node of present node step is set to present node, returns step B.2, until all nodes in traversal interface layout files, obtains final sequential value.
Preferably, described step B.2 in, described sequential value increases progressively 1, then described step B.3 in, the final sequential value=sequential value-a+1 obtained.
Compared with prior art, the invention has the advantages that:
1, compared with simple transmission coordinate instruction, the present invention really achieves user and clicks control, and can judge like this to perform rear state, reading attributes value, intellectuality improves greatly;
2, judge compared with by simple text message, the present invention stops the problem cannot determining control because not having text message, further, can stop the misjudgment phenomenon caused because text message is identical by determining sequence.
Accompanying drawing explanation
Fig. 1 is a kind of process flow diagram being determined the method for particular control attribute on the mobile phone page by mobile phone picture sectional drawing coordinate and control sequence provided by the invention.
Embodiment
For making the present invention become apparent, hereby with preferred embodiment, and accompanying drawing is coordinated to be described in detail below.
As shown in Figure 1, the invention provides a kind of method being determined particular control attribute on the mobile phone page by mobile phone picture sectional drawing coordinate and control sequence, the steps include:
Step 1, obtain current phone interface sectional drawing and with the interface layout files corresponding with current phone interface phase drawn off.
For running the smart mobile phone of android system, its interface layout files is generally XML format.In interface layout files, each upper control of the mobile phone interface corresponding to it represents with node, and each node at least comprises following information:
Boundary information, the coordinate range on the border, upper and lower, left and right of the control of record corresponding to node is nodebounds property value in the interface layout files of android system;
Type information, corresponding to record node, the type of control, is class property value in the interface layout files of android system.For different nodes, its type information, namely class property value may be identical, in the case, in order to be distinguished the different controls representated by different nodes, sequential value is introduced, have the different nodes of identical class property value, its sequential value is not identical.Typically, from the position of the top of mobile phone interface, from top to bottom, the sequential value corresponding to node having identical class property value increases progressively, and increases progressively 1 at every turn, and the sequential value corresponding to the node of the top is then set to 1 usually.
Step 2, the control pattern that the control utilizing mouse or other modes to click on sectional drawing will to operate is corresponding.
The position coordinates of click place in step 3, obtaining step 2, according to the boundary information of node each in interface layout files, i.e. nodebounds property value, determines specifically to comprise the steps: the node that this position coordinates is corresponding
Step 3.1, first node in interface layout files is set to present node;
The position coordinates of click place in step 3.2, determining step 2 the no nodebounds property value falling into present node, if so, present node is the node corresponding with this position coordinates, is designated as control node, enters described step 4, if not, then enters step 3.3;
Step 3.3, next node is set to present node, returns step 3.2, until all nodes in traversal interface layout files.
The type information of step 4, acquisition control node, i.e. class property value, by it compared with the class property value of nodes all in interface layout files, thus obtains sequential value, specifically comprises the steps:
Step 4.1, sequential value is initialized as 1, and a upper node of control node is set to present node;
Step 4.2, by the class property value of control node compared with the class property value of present node, if identical, then sequential value increases progressively 1, enters step 4.3, if different, then directly enters step 4.3;
Step 4.3, a upper node of present node is set to present node, returns step 4.2, until all nodes in traversal interface layout files, obtain final sequential value.
Step 5, the class property value obtained by UIautomator instrument steps for importing 4 and sequential value, thus the control that in determining step 2, control pattern is corresponding, after this control is operated, can the control property of read control, thus click effect is judged.
The problem that the present invention can stop not have text message by judging type and cannot determine control; Misjudgment phenomenon can be stopped by determining sequence.By providing the typonym determined and sequential value and can obtain corresponding control by UIautomator instrument thus operational controls or judge control property.

Claims (6)

1. determine a method for particular control attribute on the mobile phone page, comprise the following steps:
Step 1, obtain current phone interface sectional drawing and with the interface layout files corresponding with current phone interface phase drawn off, in interface layout files, each control on current phone interface is defined as a node, and each node at least comprises the boundary information of record present node coordinate range;
Step 2, the control pattern that the control that click will operate on sectional drawing is corresponding;
It is characterized in that, also comprise:
The position coordinates of click place in step 3, obtaining step 2, according to the boundary information of node each in interface layout files, determines the node that this position coordinates is corresponding;
Step 4, the control corresponding to control pattern according to the node of described correspondence operate accordingly.
2. a kind of method determining particular control attribute on the mobile phone page as claimed in claim 1, is characterized in that:
In described step 1, described node also comprises the type information of record present node type;
After described step 3, and before described step 4, also comprise:
Steps A, obtain the type information of the node determined in described step 3;
In step B, traversal interface layout files, the type information of all nodes, compared with the type information obtain, thus obtains sequential value by itself and steps A.
3. a kind of method determining particular control attribute on the mobile phone page as claimed in claim 2, it is characterized in that, corresponding operation described in step 4 comprises: the sequential value that the type information obtained according to described steps A and described step B obtain, obtain in step 2 sequential value that the control property of control corresponding to the control pattern clicked and/or the type information obtained according to described steps A and described step B obtain, the control corresponding to control pattern clicked in operation steps 2.
4. a kind of method determining particular control attribute on the mobile phone page as claimed in claim 2, it is characterized in that, described step 3 comprises:
Step 3.1, first node in interface layout files is set to present node;
The position coordinates of click place in step 3.2, determining step 2 in the coordinate range that records of the no boundary information falling into present node, if so, present node is the node corresponding with this position coordinates, be designated as control node, enter described step 4, if not, then enter step 3.3;
Step 3.3, next node is set to present node, returns step 3.2, until all nodes in traversal interface layout files.
5. a kind of method determining particular control attribute on the mobile phone page as claimed in claim 4, it is characterized in that, described step B comprises:
B.1, by sequential value step is initialized as a, a be not less than 1 integer, and a upper node of control node is set to present node;
Step B.2, type information that described steps A obtained compared with the type information of present node, if identical, then by sequential value increasing or decreasing, enter step B.3, if different, then directly enter step B.3;
B.3, by a upper node of present node step is set to present node, returns step B.2, until all nodes in traversal interface layout files, obtains final sequential value.
6. a kind of method determining particular control attribute on the mobile phone page as claimed in claim 5, is characterized in that:
Described step B.2 in, described sequential value increases progressively 1, then described step B.3 in, the final sequential value=sequential value-a+1 obtained.
CN201510658566.8A 2015-10-12 2015-10-12 Method for determining specific control attribute of mobile phone page Pending CN105354138A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510658566.8A CN105354138A (en) 2015-10-12 2015-10-12 Method for determining specific control attribute of mobile phone page

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510658566.8A CN105354138A (en) 2015-10-12 2015-10-12 Method for determining specific control attribute of mobile phone page

Publications (1)

Publication Number Publication Date
CN105354138A true CN105354138A (en) 2016-02-24

Family

ID=55330112

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510658566.8A Pending CN105354138A (en) 2015-10-12 2015-10-12 Method for determining specific control attribute of mobile phone page

Country Status (1)

Country Link
CN (1) CN105354138A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106021102A (en) * 2016-05-16 2016-10-12 北京奇虎科技有限公司 Automated test file generation method and apparatus
CN106339452A (en) * 2016-08-25 2017-01-18 北京小米移动软件有限公司 Event responding method and device
CN108984239A (en) * 2018-05-29 2018-12-11 北京五八信息技术有限公司 Select processing method, device, equipment and the storage medium of control
CN109299960A (en) * 2017-07-24 2019-02-01 Tcl集团股份有限公司 Monitor the method, apparatus and computer readable storage medium, terminal device of advertisement
CN109614169A (en) * 2018-12-29 2019-04-12 上海上讯信息技术股份有限公司 Window client application program automatic operation method based on pixel coordinate mode
CN114025210A (en) * 2021-11-01 2022-02-08 深圳小湃科技有限公司 Popup shielding method, equipment, storage medium and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102004633A (en) * 2009-09-03 2011-04-06 阿里巴巴集团控股有限公司 Method and device for processing control property
CN103309797A (en) * 2012-03-09 2013-09-18 阿里巴巴集团控股有限公司 Automatic testing method and device of user interface
US8689189B1 (en) * 2008-02-15 2014-04-01 Amazon Technologies, Inc. Systems and methods for testing widgets
US8832590B1 (en) * 2007-08-31 2014-09-09 Google Inc. Dynamically modifying user interface elements
CN104881364A (en) * 2015-06-26 2015-09-02 上海斐讯数据通信技术有限公司 Automated testing method and system applied to Android system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8832590B1 (en) * 2007-08-31 2014-09-09 Google Inc. Dynamically modifying user interface elements
US8689189B1 (en) * 2008-02-15 2014-04-01 Amazon Technologies, Inc. Systems and methods for testing widgets
CN102004633A (en) * 2009-09-03 2011-04-06 阿里巴巴集团控股有限公司 Method and device for processing control property
CN103309797A (en) * 2012-03-09 2013-09-18 阿里巴巴集团控股有限公司 Automatic testing method and device of user interface
CN104881364A (en) * 2015-06-26 2015-09-02 上海斐讯数据通信技术有限公司 Automated testing method and system applied to Android system

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106021102A (en) * 2016-05-16 2016-10-12 北京奇虎科技有限公司 Automated test file generation method and apparatus
CN106339452A (en) * 2016-08-25 2017-01-18 北京小米移动软件有限公司 Event responding method and device
CN109299960A (en) * 2017-07-24 2019-02-01 Tcl集团股份有限公司 Monitor the method, apparatus and computer readable storage medium, terminal device of advertisement
CN109299960B (en) * 2017-07-24 2024-02-02 Tcl科技集团股份有限公司 Method and device for monitoring advertisement, computer readable storage medium and terminal equipment
CN108984239A (en) * 2018-05-29 2018-12-11 北京五八信息技术有限公司 Select processing method, device, equipment and the storage medium of control
CN108984239B (en) * 2018-05-29 2021-07-20 北京五八信息技术有限公司 Processing method, device and equipment for selecting control and storage medium
CN109614169A (en) * 2018-12-29 2019-04-12 上海上讯信息技术股份有限公司 Window client application program automatic operation method based on pixel coordinate mode
CN114025210A (en) * 2021-11-01 2022-02-08 深圳小湃科技有限公司 Popup shielding method, equipment, storage medium and device

Similar Documents

Publication Publication Date Title
CN110297759B (en) Method, device, equipment and storage medium for manufacturing test page script
CN105354138A (en) Method for determining specific control attribute of mobile phone page
US11561887B2 (en) Test script debugging using an automated testing framework and UI rendering tree
CN107861655B (en) Control matching method and device, computer equipment and storage medium
US8219582B2 (en) System, method, and computer readable media for identifying a user-initiated log file record in a log file
CN104679658A (en) Test method and test system for WEB pages
CN104252410A (en) Method and equipment for testing control in page
CN103377119A (en) Automatic nonstandard control testing method and device
CN112597014B (en) Automatic test method and device based on data driving, medium and electronic equipment
CN104035867A (en) Android-based application function traverse test method
CN104615538A (en) Mobile phone application testing method based on mobile phone interface control elements
CN104980552B (en) Realize the method and system of Android mobile terminal automatic test
CN109656652B (en) Webpage chart drawing method, device, computer equipment and storage medium
CN113076257B (en) Test script recording method, device, medium and computer equipment
CN111124888A (en) Method and device for generating recording script and electronic device
CN103365967A (en) Automatic difference detection method and device based on crawler
CN105183291A (en) Method and system for extracting information in display interface
CN102622233A (en) System and method for automatically generating user interface applicable to certain interactive terminal equipment
KR102635847B1 (en) Apparatus and method for application test automation
CN103677518B (en) Touch message responding method on a kind of mobile terminal and device
CN103279420B (en) The application program for mobile terminal automated testing method optimized and system
CN107871128A (en) A kind of high robust image-recognizing method based on SVG dynamic charts
CN105446752A (en) Triggering method and device of control in application program and mobile terminal
CN105306928A (en) Method and device for testing set top box browser
JP2009223568A (en) Scenario-generating device and program

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20160224

RJ01 Rejection of invention patent application after publication