CN101237662B - Method and device for generating automatic test cases of mobile phone - Google Patents

Method and device for generating automatic test cases of mobile phone Download PDF

Info

Publication number
CN101237662B
CN101237662B CN2008100076062A CN200810007606A CN101237662B CN 101237662 B CN101237662 B CN 101237662B CN 2008100076062 A CN2008100076062 A CN 2008100076062A CN 200810007606 A CN200810007606 A CN 200810007606A CN 101237662 B CN101237662 B CN 101237662B
Authority
CN
China
Prior art keywords
menu
mobile phone
test cases
submenu
automatic test
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
CN2008100076062A
Other languages
Chinese (zh)
Other versions
CN101237662A (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.)
Huawei Device Co Ltd
Original Assignee
Huawei Device 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 Huawei Device Co Ltd filed Critical Huawei Device Co Ltd
Priority to CN2008100076062A priority Critical patent/CN101237662B/en
Publication of CN101237662A publication Critical patent/CN101237662A/en
Application granted granted Critical
Publication of CN101237662B publication Critical patent/CN101237662B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment of the invention provides a method and a device used to generate a mobile phone automatic testing sample, relating to the testing technical field and designed to increase the establishing efficiency of the mobile phone automatic testing sample. The method comprises the following steps: the cascade connection relation between each main menu and the submenu thereof is established; through the cascade connection relation, a path used to search an object menu is acquired; finally, the searching path of the object menu is stored as a record. The embodiment of the method and the device is mainly used in the testing field of terminal products such as a mobile phone.

Description

Generate the method and the device of automatic test cases of mobile phone
Technical field
The present invention relates to measuring technology, relate in particular to a kind of method and device that generates automatic test cases of mobile phone.
Background technology
In recent years, along with development of Communication Technique, the model of end products such as mobile phone is more and more abundanter, and function becomes increasingly complex.For the testing cost that reduces mobile phone, shorten test period, each mobile phone development merchant just invests sight on the automatization testing technique of mobile phone, and is doing a large amount of trials aspect radio frequency, the function/performance test.
In cell-phone function/automatic performance test, in order more to press close to real user, industry-wide adoption is based on UI (User Interface, user interface) automated testing method, promptly, grasp the mobile phone screen picture, on PC, these screen shots are analyzed then by button (analogue-key) operating handset, relatively wait as the identification of OCR literal, picture, judge whether test case is feasible.
In the automatization testing technique of mobile phone, the mode that is based on operation note that generally adopts generates the UI automatic test cases at present.Mode based on operation note can be divided into two kinds: manual creation test case and record the test case mode.
Wherein, manual creation test case mode is meant, uses the implementation of test cases of manual mode operating handset, by the mobile phone test personnel automatic test cases is translated in these operations then; Record the test case mode and be meant, when utilizing the implementation of test cases of manual mode operating handset, by logging software manual process record is got off, and generate automatic test cases with this.So, if when needing again the mobile phone of same model tested, then can mobile phone be tested by carrying out described automatic test cases.
In realizing process of the present invention, the inventor finds that there are the following problems in the prior art:
No matter be to utilize manual mode of operation to generate automatic test cases, still generate automatic test cases by recording the test case mode, all need the manual operating handset implementation of test cases of mobile phone test personnel, could obtain the operation note in the automatic test cases.If the mobile phone to different model is tested, need constantly repeat mode by the implementation of test cases of mobile phone operation mobile phone, generate the process of automatic test cases.Therefore, when adopting above-mentioned dual mode to test, the inefficiency of mobile phone test, and flexibility is relatively poor.
Summary of the invention
Embodiments of the invention provide a kind of method and device that generates automatic test cases of mobile phone, to improve the establishment efficient of automatic test cases of mobile phone.
The method that embodiments of the invention are a kind of to generate automatic test cases of mobile phone is by the following technical solutions:
A kind of method that generates automatic test cases of mobile phone, described method comprises the steps:
Set up the cascade connection between each father's menu and its submenu;
By described cascade connection, obtain to find the path of target menu;
As record storage, and the record that utilizes described storage is as test case with the described path of searching.
The embodiment of the invention generates the method for automatic test cases of mobile phone, by each father's menu of foundation and the cascade connection between its submenu, can obtain to find the path of searching of target menu, and the described path of searching is stored as record.Like this, when mobile phone is tested, just can utilize the record of storage as test case.
Generate automatic test cases in a manner mentioned above, avoided in the prior art owing to need the implementation of test cases of tester's manual operations mobile phone, then manual operations is formed automatic test cases and the not high problem of testing efficiency brought.Therefore, utilize the test case of the described method generation of the embodiment of the invention, can improve the establishment efficient of automatic test cases of mobile phone.
The device that embodiments of the invention are a kind of to generate automatic test cases of mobile phone is by the following technical solutions:
A kind of device that generates automatic test cases of mobile phone, described device comprises:
Associative cell is used to set up the cascade connection between each father's menu and its submenu;
Acquiring unit is used for by described cascade connection, obtains to find the path of target menu;
Memory cell is used to store the record that the path forms of searching by described target menu, and the record that utilizes described storage is as test case.
The embodiment of the invention generates the device of automatic test cases of mobile phone, by each father's menu of associative cell foundation and the cascade connection between its submenu, can obtain to find the path of searching of target menu by acquiring unit, and the described path of searching be stored as record by memory cell.Like this, when mobile phone is tested, just can utilize the record of storage as test case.
Generate automatic test cases in a manner mentioned above, avoided in the prior art owing to need the implementation of test cases of tester's manual operations mobile phone, then manual operations is formed automatic test cases and the not high problem of testing efficiency brought.Therefore, utilize the test case of the described method generation of the embodiment of the invention, can improve the establishment efficient of automatic test cases of mobile phone.
Description of drawings
Fig. 1 is the flow chart that embodiments of the invention generate the method for automatic test cases of mobile phone;
Fig. 2 is the schematic diagram that embodiments of the invention generate the method for automatic test cases of mobile phone;
Fig. 3 is the test case schematic diagram of tree in the embodiments of the invention;
Fig. 4 is the test case of utilizing the described method of the embodiment of the invention the to generate schematic diagram when testing;
Fig. 5 is the schematic diagram when utilizing manual operations generation test case of the prior art to test;
Fig. 6 is the schematic diagram that embodiments of the invention generate the device of automatic test cases of mobile phone;
Fig. 7 is the schematic representation of apparatus that embodiments of the invention generate automatic test cases of mobile phone.
Embodiment
In order to be illustrated more clearly in the technical scheme of the embodiment of the invention, the accompanying drawing of required use is done an introduction simply in will describing embodiment below, apparently, accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
For solving the lower problem of mobile phone test efficient in the prior art, embodiments of the invention provide a kind of method that generates automatic test cases of mobile phone.As shown in Figure 1, described method comprises the steps:
101, set up cascade connection between each father's menu and its submenu;
102,, obtain to find the path of target menu by described cascade connection;
103, the path of searching of described target menu is stored as record.
As can be seen from the above step, the embodiment of the invention generates the method for automatic test cases of mobile phone, by each father's menu of foundation and the cascade connection between its submenu, can obtain to find the path of searching of target menu, and the described path of searching is stored as record.Like this, the record of storage just can be used as test case and comes mobile phone is tested.
Generate automatic test cases in a manner mentioned above, avoided in the prior art owing to need the implementation of test cases of tester's manual operations mobile phone, then manual operations is formed automatic test cases and the not high problem of testing efficiency brought.Therefore, utilize the test case of the described method generation of the embodiment of the invention, can improve the establishment efficient of automatic test cases of mobile phone.
For raising finds the speed of target menu, in an embodiment of the present invention, described cascade connection is a tree.In described tree, described father's menu is as root node, and described submenu is as leaf node.By the path between described father's menu and its submenu, just can find target menu by father's menu.
Certainly, described cascade connection also can be other forms, as long as can embody the relation of getting in touch between father's menu and the submenu, is not limited to cited in an embodiment of the present invention.
In order to improve the test case that generates, as shown in Figure 2, the method that embodiments of the invention generate automatic test cases of mobile phone also comprises the steps:
101a, the property parameters of described each father's menu and submenu is set.
Described property parameters comprises: the test zone in the target menu, test-types, the test result of expectation, and button attribute information at least a that enters into target menu, or its combination in any.
After being provided with above-mentioned property parameters, the described method of the embodiment of the invention also comprises:
104, with described property parameters as record storage, and described property parameters is kept in the described record, under described each father's menu and the corresponding leaf node of submenu.
So like this, when mobile phone is tested, after the automatic test cases that utilization generates according to the described mode of the embodiment of the invention is tested, not only can find target menu faster by described cascade connection, can also be when finding target menu, obtain its corresponding property parameters, described target menu is tested with convenient.
In concrete the application, can utilize multiple programming language to describe automatic test cases in the embodiment of the invention.In an embodiment of the present invention, being that example describes with XML language (extend markup language).
Figure 3 shows that the automatic test cases that utilizes the XML language description.For ease of test, the order of the submenu under same father's menu is with the sequence consensus of the menu item of reality in the mobile phone.And as seen from Figure 3, each father's menu, or under the pairing node of submenu (root node or leaf node), all be provided with the property parameters of this menu, as the test zone in the target menu (checkArea), test-types (checkType), the test result of expectation (expectResult), and enter into button attribute information (key) of target menu etc.
In order to reduce the maintenance cost to test case, the described representation that enters into the button attribute information of target menu is: the location index of the leaf node of described target menu under the root node of its corresponding father's menu.
With test case shown in Figure 3 is example, and the key in each father's menu/submenu attribute information is to utilize the mode of upper and lower key to represent, also, calculates the location index of each submenu under its corresponding father's menu.If need utilize a plurality of buttons to represent the location index of described submenu, the form of then available CSV (CommaSeparated Values) is represented described location index.
As the position of submenu speedDail under the root node of his father's menu phonebook is 4, so press 3 down Arrows under father's menu phonebook, one time left Arrow can enter into submenu speedDail.Therefore, the key attribute of submenu speedDail correspondence is: key=" down-times 3, lsk ", its implication for uncle's menu phonebook enters submenu speedDail need be by down (down Arrow) 3 times, lsk (left Arrow) is once.Wherein, times represents touch potential; Delay represents the dead time behind the button.
In addition, also available digital is represented the key attribute.Be example with the speedDail submenu equally, calculate its location index under the root node of phonebook under father's menu of correspondence, index increases 1 successively from 1 open numbering.As the position of speedDail submenu under phonebook father's menu root node is 4, so digital shortcut keys is exactly 4, therefore, the key attribute of submenu speedDail correspondence is: key=" 4 ".Certainly, also can obtain the key attribute of father's menu or submenu with other modes.
In test case shown in Figure 3, the mode of the upper and lower key of employing is represented the key in each father's menu/submenu attribute information in the menu menu, and the message menu then is to utilize the form of numerical key to represent.By the described test case of Fig. 3 as can be seen, wherein also the physical button of mobile phone is defined.
It should be noted that in test case shown in Figure 3, just listed the relevant information of wherein a part of father's menu and submenu.The describing mode of other menus does not repeat them here with shown in Figure 3 identical.
After utilizing the described method of the embodiment of the invention to generate automatic test cases of mobile phone, when certain target menu of mobile phone is tested, can be by the above-mentioned automatic test cases that generates based on the menu path mode, directly find described target menu, and obtain property parameters under the pairing node of described target menu, described target menu is tested.
AddNew is an example with the test submenu, can pass through the test of following procedure section realization to submenu addNew:
GotoMenu/menu/phonebook/addNew; // entering the addNew menu, parameter is a menu path
GrabScreen; // extracting mobile phone current screen
CheckScreen; // according to the property parameters of definition, check picture.
By carrying out top program, can be among the submenu addNew, the character of test zone in " 00 100 100 " scope tested.If test result is " addNew ", then the test to submenu addNew is correct, otherwise test errors.
Fig. 4 and Fig. 5 shown respectively when the test case of utilizing the described method of embodiments of the invention to generate is tested, and the operation chart during with method generation test case of the prior art.As shown in Figure 4, when the test case of utilizing the described method of the embodiment of the invention to generate is tested, can can enter into corresponding target menu, so that described target menu is tested by the path of searching of the target menu preserved in GotoMenu statement and the described test case.And as seen in Figure 5,, then need constantly to repeat to enter into the manual operations of target menu if will certain target menu be tested.
Therefore, by above-mentioned description as can be seen, when the test case of utilizing the described method of the embodiment of the invention to generate is carried out mobile phone test, can improve the testing efficiency of mobile phone.Simultaneously, the test case of utilizing the described method of the embodiment of the invention to generate is based on that the mode of searching the path creates, so its maintainability is good, can reuse when the mobile phone of same type is tested.
The method that generates automatic test cases of mobile phone with the embodiment of the invention is corresponding, and embodiments of the invention also provide a kind of device that generates automatic test cases of mobile phone.
As shown in Figure 6, the embodiment of the invention generates the device of automatic test cases of mobile phone, comprising: associative cell, acquiring unit, and memory cell.
Associative cell is used to set up the cascade connection between each father's menu and its submenu;
Acquiring unit is used for by described cascade connection, obtains to find the path of target menu;
Memory cell is used to store by described and searches the record that the path forms.
The embodiment of the invention generates the device of automatic test cases of mobile phone, by each father's menu of associative cell foundation and the cascade connection between its submenu, can obtain to find the path of searching of target menu by acquiring unit, and the described path of searching be stored as record by memory cell.Like this, the record of storage just can be used as test case and comes mobile phone is tested.
Generate automatic test cases in a manner mentioned above, avoided in the prior art owing to need the implementation of test cases of tester's manual operations mobile phone, then manual operations is formed automatic test cases and the not high problem of testing efficiency brought.Therefore, utilize the test case of the described method generation of the embodiment of the invention, can improve the establishment efficient of automatic test cases of mobile phone.
In order to improve the test case that generates, as shown in Figure 7, the described device of embodiments of the invention also comprises: the unit is set, is used to be provided with the property parameters of described each father's menu and submenu.
Equally, in this embodiment, described property parameters comprises: the test zone in the target menu, test-types, the test result of expectation, and button attribute information at least a that enters into target menu, or its combination in any.
Therefore, described memory cell also needs described property parameters as the record storage, and described property parameters is kept in the record, under described each father's menu and the corresponding node of submenu.
Like this, when certain target menu is tested, this target menu that can be by obtaining cell stores search the path, and the property parameters that is provided with down of the pairing node of this target menu is tested described target menu.
Therefore, utilize the test case of the described method generation of the embodiment of the invention, can improve the establishment efficient of automatic test cases of mobile phone.And the test case of utilizing the described method of the embodiment of the invention to generate is based on that the mode of searching the path creates, so its maintainability is good, can reuse when the mobile phone of same type is tested.
It should be noted that and one of ordinary skill in the art will appreciate that all or part of step that realizes in the foregoing description is to instruct relevant hardware to finish by program.Described program can be stored in the computer-readable recording medium.Described storage medium can comprise ROM/RAM, magnetic disc, CD etc.
Certainly; embodiments of the invention also can have a variety of; under the situation that does not deviate from embodiments of the invention spirit and essence thereof; those skilled in the art work as can make various corresponding changes and distortion according to embodiments of the invention, but these corresponding changes and distortion all should belong to the protection range of the appended claim of embodiments of the invention.

Claims (10)

1. a method that generates automatic test cases of mobile phone is characterized in that, described method comprises the steps:
Set up the cascade connection between each father's menu and its submenu;
By described cascade connection, obtain to find the path of target menu;
With described target menu search the path as record storage, and the record that utilizes described storage is as test case.
2. the method for generation automatic test cases of mobile phone according to claim 1 is characterized in that, described cascade connection is a tree, and described father's menu is as root node, and described submenu is as leaf node.
3. the method for generation automatic test cases of mobile phone according to claim 2 is characterized in that, behind the cascade connection of setting up between each father's menu and its submenu, described method comprises the steps:
The property parameters of described each father's menu and submenu is set.
4. the method for generation automatic test cases of mobile phone according to claim 3 is characterized in that, with described search the step of path as record storage after, described method also comprises:
As record storage, and described property parameters is kept in the record of searching the path of the described target menu of described storage with described property parameters, under described each father's menu or corresponding root node of submenu or leaf node.
5. the method for generation automatic test cases of mobile phone according to claim 3, it is characterized in that described property parameters comprises: the test zone in the target menu, test-types, the test result of expectation, and button attribute information at least a that enters into target menu.
6. the method for generation automatic test cases of mobile phone according to claim 5 is characterized in that, the representation of described button attribute information is: the location index of the leaf node of described target menu under the root node of its corresponding father's menu.
7. a device that generates automatic test cases of mobile phone is characterized in that, described device comprises:
Associative cell is used to set up the cascade connection between each father's menu and its submenu;
Acquiring unit is used for by described cascade connection, obtains to find the path of target menu;
Memory cell is used to store the record that the path forms of searching by described target menu, and the record that utilizes described storage is as test case.
8. the device of generation automatic test cases of mobile phone according to claim 7 is characterized in that, described device also comprises:
The unit is set, is used to be provided with the property parameters of described each father's menu and submenu.
9. the device of generation automatic test cases of mobile phone according to claim 8, it is characterized in that described memory cell also is used for the memory attribute parameter, and described property parameters is kept in the described record, under described each father's menu or the corresponding node of submenu.
10. according to Claim 8 or the device of 9 described generation automatic test cases of mobile phone, it is characterized in that,
Described property parameters comprises: the test zone in the target menu, test-types, the test result of expectation, and button attribute information at least a that enters into target menu.
CN2008100076062A 2008-02-29 2008-02-29 Method and device for generating automatic test cases of mobile phone Active CN101237662B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008100076062A CN101237662B (en) 2008-02-29 2008-02-29 Method and device for generating automatic test cases of mobile phone

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008100076062A CN101237662B (en) 2008-02-29 2008-02-29 Method and device for generating automatic test cases of mobile phone

Publications (2)

Publication Number Publication Date
CN101237662A CN101237662A (en) 2008-08-06
CN101237662B true CN101237662B (en) 2011-09-14

Family

ID=39920960

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008100076062A Active CN101237662B (en) 2008-02-29 2008-02-29 Method and device for generating automatic test cases of mobile phone

Country Status (1)

Country Link
CN (1) CN101237662B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101706799B (en) * 2009-11-20 2013-04-10 中兴通讯股份有限公司 Method and device for realizing automated testing
CN104346279A (en) * 2014-10-27 2015-02-11 百度在线网络技术(北京)有限公司 Method and device for software testing
CN106021102B (en) * 2016-05-16 2019-05-28 北京奇虎科技有限公司 The generation method and device of automatic test file
CN107027063B (en) * 2017-04-19 2020-03-20 广州视源电子科技股份有限公司 Recording playback method and system for detecting television menu function
CN107786869B (en) * 2017-12-11 2020-03-17 深圳Tcl数字技术有限公司 Method, device and storage medium for generating menu path of television equipment
CN108304329B (en) * 2018-02-13 2020-12-15 论客科技(广州)有限公司 Test case design method and device, terminal and readable storage medium
CN109614329B (en) * 2018-12-06 2021-11-02 中国航空工业集团公司洛阳电光设备研究所 Software test case aided design method based on interface control file
CN112905483A (en) * 2021-03-25 2021-06-04 杭州迪普科技股份有限公司 Automatic testing method and device based on webpage

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007014521A1 (en) * 2005-08-01 2007-02-08 Tong Wang A method for designing test case and a system thereof
CN101060372A (en) * 2007-06-26 2007-10-24 华为技术有限公司 A method and system for rapid creating the automation test script

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007014521A1 (en) * 2005-08-01 2007-02-08 Tong Wang A method for designing test case and a system thereof
CN101060372A (en) * 2007-06-26 2007-10-24 华为技术有限公司 A method and system for rapid creating the automation test script

Also Published As

Publication number Publication date
CN101237662A (en) 2008-08-06

Similar Documents

Publication Publication Date Title
CN101237662B (en) Method and device for generating automatic test cases of mobile phone
CN107861870B (en) Interface test and test data generation method, device, terminal and storage medium
CN103136471B (en) A kind of malice Android application program detection method and system
CN102438055A (en) Mobile phone automated testing method based on bluetooth communication
CN105677306A (en) Automation script compiling method and device
CN105611491B (en) A kind of Bluetooth connecting method and device
CN106326120B (en) Regression testing method and device for application software and electronic equipment
CN110244967A (en) Method for updating edition and device
CN102707712B (en) Electronic equipment fault diagnosis method and system
CN108255699A (en) regression testing method and device
CN112069068A (en) Automatic test data processing method, device, equipment and readable storage medium
CN100512458C (en) Method for prior triggering of multi-service for mobile intelligent network
CN104572999A (en) Heterogeneous data based detecting method and device for fault data
CN106528429A (en) UI testing method and device
CN104808808A (en) Information processing method and electronic device
CN101102579A (en) A method and device for knowing and positioning UI in test
CN105760300B (en) A kind of automated testing method and test macro of STK/UTK business
CN103246663A (en) Searching method and communication terminal
CN116261091B (en) Bluetooth testing system and method capable of customizing testing flow
CN103942305B (en) The calibration information acquisition methods and system of a kind of mobile terminal
CN109344058A (en) A kind of small routine automated testing method
CN105786508A (en) Method for generating form page for equipment patrol and patrol system
CN104834612A (en) Method for enabling USB debugging mode in Android mobile phone
CN105512276A (en) Method and device for constructing junk file and electronic equipment
CN105933518B (en) A kind of operator's icon display method and mobile terminal

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20171107

Address after: Metro Songshan Lake high tech Industrial Development Zone, Guangdong Province, Dongguan City Road 523808 No. 2 South Factory (1) project B2 -5 production workshop

Patentee after: HUAWEI terminal (Dongguan) Co., Ltd.

Address before: 518129 Longgang District, Guangdong, Bantian HUAWEI base B District, building 2, building No.

Patentee before: Huawei Device Co., Ltd.

CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 523808 Southern Factory Building (Phase I) Project B2 Production Plant-5, New Town Avenue, Songshan Lake High-tech Industrial Development Zone, Dongguan City, Guangdong Province

Patentee after: Huawei Device Co., Ltd.

Address before: 523808 Southern Factory Building (Phase I) Project B2 Production Plant-5, New Town Avenue, Songshan Lake High-tech Industrial Development Zone, Dongguan City, Guangdong Province

Patentee before: HUAWEI terminal (Dongguan) Co., Ltd.