Summary of the invention
The shortcoming of prior art in view of the above, the object of the present invention is to provide a kind of performance test methods and system of mobile terminal, for solving identification and the connection that cannot carry out multiple Android device in prior art, the problem of multi-channel A ndroid equipment performance test cannot be carried out.
For achieving the above object and other relevant objects, one aspect of the present invention provides a kind of method of testing of mobile terminal performance, be applied to the communication network be made up of multiple mobile terminal and server, the method for testing of described intelligent terminal comprises the following steps: call the bridged protocol that prestores to establish a communications link between multiple mobile terminal and server; Wherein, described multiple mobile terminal comprises mobile terminal of the same name and mobile terminal not of the same name; Read the device name of the mobile terminal established a communications link with described server, and upgrade the device name of described multiple mobile terminal according to predefine naming method; The device name that described multiple mobile terminal to update is crossed is resetted again; The performance test script prerecorded is run in multithreading operation mode to the multiple mobile terminals after resetting.
Alternatively, the bridged protocol that prestores described in is ADB bridged protocol.
Alternatively, described predefine naming method refers to according to prefabricated title and the interfacing order of performance test interface that is connected with multiple mobile terminal number as the device name of the multiple mobile terminals be connected with server renames.
Alternatively, be come the step that the device name that described multiple mobile terminal to update is crossed resets again by calling reset instruction, described reset instruction is abdremount.
Alternatively, the performance test script prerecorded described in comprises: open setting by mobile terminal operating system bag name and interactive component name; Click the performance-relevant character with test; Search the switch module that ID is set to the test performance of switchWidget; Whether the switch module of checkout performance is opened, if so, then represents that test is passed through, and continues next step, if not, then represents that test is not passed through, and returns and opens setting steps; Search the switch module that ID is set to the performance of the test of switchWidget; Whether the switch module of checkout performance closes, if so, then represents that test is passed through, and terminates; If not, represent that test is not passed through, return and open setting steps.
The present invention also provides a kind of Performance Test System of mobile terminal on the other hand, be applied to the communication network be made up of multiple mobile terminal and server, the Performance Test System of described mobile terminal comprises: calling module, for calling the bridged protocol that prestores to establish a communications link between multiple mobile terminal and server; Wherein, described multiple mobile terminal comprises mobile terminal of the same name and mobile terminal not of the same name; Update module, is connected with described calling module, for reading the device name of the mobile terminal established a communications link with described server, and upgrades the device name of described multiple mobile terminal according to predefine naming method; Reseting module, is connected with described calling module and update module, again resets for the device name crossed by described multiple mobile terminal to update; Test module, is connected with described reseting module, for running to the multiple mobile terminals after reset the performance test script prerecorded in multithreading operation mode.
Alternatively, in order to prestore described in ADB bridged protocol, bridged protocol is pre-stored in described calling module, and described calling module is also for supporting described ADB bridged protocol.
Alternatively, one is also comprised in described update module in order to count the counter being connected to mobile terminal number on described server.
Alternatively, prestore reset instruction in described reseting module, described reseting module is also for having come again to reset by calling reset instruction, and described reset instruction is abdremount.
Another aspect of the invention also provides a kind of mobile terminal, and described mobile terminal comprises: the Performance Test System of described mobile terminal.
As mentioned above, the performance test methods of mobile terminal of the present invention and system, have following beneficial effect:
The performance test methods of mobile terminal of the present invention and system can carry out the performance test of multichannel mobile terminal device simultaneously, control the literary style of multiple mobile terminal device, can test multiple mobile device performance test in a set of Run Script.
Embodiment
Below by way of specific instantiation, embodiments of the present invention are described, those skilled in the art the content disclosed by this instructions can understand other advantages of the present invention and effect easily.The present invention can also be implemented or be applied by embodiments different in addition, and the every details in this instructions also can based on different viewpoints and application, carries out various modification or change not deviating under spirit of the present invention.It should be noted that, when not conflicting, the feature in following examples and embodiment can combine mutually.
It should be noted that, the diagram provided in following examples only illustrates basic conception of the present invention in a schematic way, then only the assembly relevant with the present invention is shown in graphic but not component count, shape and size when implementing according to reality is drawn, it is actual when implementing, and the kenel of each assembly, quantity and ratio can be a kind of change arbitrarily, and its assembly layout kenel also may be more complicated.
Embodiment one
The present embodiment provides a kind of performance test methods of mobile terminal.Described mobile terminal comprises smart mobile phone, panel computer, notebook computer etc.In the present embodiment, described mobile terminal is mobile phone.The principle of mobile phone automatized test is that the upper control end (testing tool) of PC is held with an agent on mobile phone, by serial ports, USB or wireless mode, PC is connected with mobile phone terminal, then application testing instrument sends request to mobile phone or orders, after mobile phone receives orders or asks, give agent end to resolve, then the order that each functional module that these orders of resolving are handed down to mobile phone by agent can identify, calls those functional module simulated operations.After completing these operations, mobile phone can return some information, and agent can capture these information, is then returned to PC end, this completes a complete mobile phone automatized test.Key point is agent, and some companies implant test procedure response code in the software function module of the mobile phone terminal of oneself, and some companies can utilize the mode of MMI_Command to control mobile phone terminal; Principle is exactly provide an interface responded to mobile phone.And automatic test be designed to the mechanism recorded, succeed in reaching an agreement popular point, record the operation information (LCD needs to use Intelligent Recognition mechanism) of manual keypad information or LCD exactly.The building method of automated test frame is general, needs oneself the carrying out smoothly of test frame guarantee automatic test a set of.
Refer to Fig. 1, be shown as the performance test methods schematic flow sheet of mobile terminal.As shown in Figure 1, the performance test methods of described mobile terminal comprises following step:
S1, calls the bridged protocol that prestores to establish a communications link between multiple mobile terminal and server.In the present embodiment, described in the bridged protocol that prestores be ADB bridged protocol, utilize described ADB bridged protocol that described multiple mobile terminal can be made to be connected with server simultaneously.Wherein, described multiple mobile terminal comprises mobile terminal of the same name and mobile terminal not of the same name (of the same name refer to that unit type is identical, not of the same name refer to that unit type is not identical).
S2, reads the device name of the mobile terminal established a communications link with described server, and upgrades the device name of described multiple mobile terminal according to predefine naming method.Described predefine naming method refers to according to prefabricated title and the interfacing order of performance test interface that is connected with multiple mobile terminal number as the device name of the multiple mobile terminals be connected with server renames.In this step, when being connected to first mobile terminal, described mobile terminal is defined implementor name, then rename is carried out according to the interfacing order in device name and server number, such as, striking news E651 mobile phone, to the interface command adbshellsetproppersist.usb.serialno " device [1] " of its rename, wherein, device [1] is rename.Then second android equipment connection service fee, counter adds one, second equipment called after " device [2] ", follow-uply so performs successively.Therefore, in this step, the mobile terminal also comprised being connected on described server counts.
S3, resets again by the device name that described multiple mobile terminal to update is crossed.In this step, after being connected to the complete device name of multiple mobile terminal to update on described server, needing built-in for described mobile terminal updated device name again to reset to make updated device name, thoroughly carry is on mobile terminals, be come the step that the device name that described multiple mobile terminal to update is crossed resets again by calling reset instruction, described reset instruction is abdremount.Can be demonstrated the android equipment of connection by this step, namely the title of mobile terminal redefines, there is not the problem of equipment None-identified of the same name.
S4, runs to the multiple mobile terminals after resetting the performance test script prerecorded in multithreading operation mode.In the present embodiment, such as, to server is connected with two mobile terminals to perform in multithreading operation mode simultaneously described in the performance test script prerecorded, described in the performance test script prerecorded specifically comprise following content:
Setting is opened by mobile terminal operating system bag name and interactive component name;
Click the performance-relevant character with test;
Search the switch module that ID is set to the test performance of switchWidget;
Whether the switch module of checkout performance is opened, if so, then represents that test is passed through, and continues next step, if not, then represents that test is not passed through, and returns and opens setting steps;
Search the switch module that ID is set to the performance of the test of switchWidget;
Whether the switch module of checkout performance closes, if so, then represents that test is passed through, and terminates; If not, represent that test is not passed through, return and open setting steps.
As shown in table 1, adopt two mobile terminals in the present embodiment, respectively WIFI switch is carried out to two mobile terminals and test, and Bluetooth switch is tested.
Table 1: the performance test script prerecorded
Device [1] APP:com.android.settings/.Settings//by android bag name and activity name opens and arranges module
Device [2] APP:com.android.settings/.Settings//by android bag name and activity name opens and arranges module
The character of Device [1] CText:WLAN//click WLAN, note: CText: the abbreviation being ClickText, clicks character
Device2] character of CText:WLAN//click bluetooth, note: CText: the abbreviation being ClickText, clicks character
Device [1] ID:android:id/switchWidget//search the WIFI switch module that id is switchWidget
Device [2] ID:android:id/switchWidget//search the Bluetooth switch assembly that id is switchWidget
WIFI switch module is opened in Device [1] Class:android.widget.Switch [1] Chick//click, and the sequence that [1] represents this assembly is 1
Bluetooth switch assembly is opened in Device [2] Class:android.widget.Switch [1] Chick//click, and the sequence that [2] represent this assembly is 2
Device [1] Class:android.widget.Switch [1] Checked, true//check whether WIFI state is opened, is opened for true
Device [2] Class:android.widget.Switch [1] Checked, true//check whether bluetooth state is opened, is opened for true
Device [1] ID:android:id/switchWidget//search the WIFI switch module that id is switchWidget
Device [2] ID:android:id/switchWidget//search the Bluetooth switch assembly that id is switchWidget
WIFI switch module is closed in Device [1] Class:android.widget.Switch [1] Chick//click, and the sequence that [1] represents this assembly is 1
Bluetooth switch assembly is closed in Device [2] Class:android.widget.Switch [1] Chick//click, and the sequence that [2] represent this assembly is 2
Device [1] Class:android.widget.Switch [1] Checked, false//check whether WIFI state closes, closes as false
Device [2] Class:android.widget.Switch [1] Checked, false//check whether bluetooth state closes, closes as false
Device [1] Back//return button
Device [2] Back//return button
Device [1] Back//return button
Device [2] Back//return button
Device [1] Home//backspace standby interface
Device [2] Home//backspace standby interface
The performance test methods of the mobile terminal described in the present embodiment can carry out the performance test of multichannel mobile terminal device simultaneously, controls the literary style of multiple mobile terminal device in a set of Run Script, can test multiple mobile device performance test.
Embodiment two
The present embodiment provides a kind of Performance Test System 1 of mobile terminal.Described mobile terminal comprises smart mobile phone, panel computer, notebook computer etc.In the present embodiment, described mobile terminal is mobile phone.The principle of mobile phone automatized test is that the upper control end (testing tool) of PC is held with an agent on mobile phone, by serial ports, USB or wireless mode, PC is connected with mobile phone terminal, then application testing instrument sends request to mobile phone or orders, after mobile phone receives orders or asks, give agent end to resolve, then the order that each functional module that these orders of resolving are handed down to mobile phone by agent can identify, calls those functional module simulated operations.After completing these operations, mobile phone can return some information, and agent can capture these information, is then returned to PC end, this completes a complete mobile phone automatized test.Key point is agent, and some companies implant test procedure response code in the software function module of the mobile phone terminal of oneself, and some companies can utilize the mode of MMI_Command to control mobile phone terminal; Principle is exactly provide an interface responded to mobile phone.And automatic test be designed to the mechanism recorded, succeed in reaching an agreement popular point, record the operation information (LCD needs to use Intelligent Recognition mechanism) of manual keypad information or LCD exactly.The building method of automated test frame is general, needs oneself the carrying out smoothly of test frame guarantee automatic test a set of.
Refer to Fig. 2, be shown as the theory structure schematic diagram of the test macro of mobile terminal performance.As shown in Figure 2, the Performance Test System 1 of described mobile terminal comprises: calling module 11, update module 12, reseting module 13 and test module 14.
Calling module 11 is for calling the bridged protocol that prestores to be established a communications link by USB data line between multiple mobile terminal and server.In the present embodiment, described in the bridged protocol that prestores be ADB bridged protocol, utilize described ADB bridged protocol that described multiple mobile terminal can be made to be connected with server simultaneously.Wherein, described multiple mobile terminal comprises mobile terminal of the same name and mobile terminal not of the same name (of the same name refer to that unit type is identical, not of the same name refer to that unit type is not identical).
The update module 12 be connected with described calling module 11 for reading the device name of the mobile terminal established a communications link with described server, and upgrades the device name of described multiple mobile terminal according to predefine naming method.Described predefine naming method refers to according to prefabricated title and the interfacing order of performance test interface that is connected with multiple mobile terminal number as the device name of the multiple mobile terminals be connected with server renames.In the present embodiment, when being connected to first mobile terminal, described mobile terminal is defined implementor name, then rename is carried out according to the interfacing order in device name and server number, such as, striking news E651 mobile phone, to the interface command adbshellsetproppersist.usb.serialno " device [1] " of its rename, wherein, device [1] is rename.Then second android equipment connection service fee, counter adds one, second equipment called after " device [2] ", follow-uply so performs successively.Therefore, in the present embodiment, described update module 12 is also for counting the mobile terminal be connected on described server.
The reseting module 13 be connected with described calling module 11 and update module 12 resets again for the device name crossed by described multiple mobile terminal to update.In this step, after being connected to the complete device name of multiple mobile terminal to update on described server, needing built-in for described mobile terminal updated device name again to reset to make updated device name, thoroughly carry is on mobile terminals, be come the step that the device name that described multiple mobile terminal to update is crossed resets again by calling reset instruction, described reset instruction is abdremount.Can be demonstrated the android equipment of connection by this step, namely the title of mobile terminal redefines, there is not the problem of equipment None-identified of the same name.
The test module 14 be connected with described reseting module 13 is for running to the multiple mobile terminals after resetting the performance test script prerecorded in multithreading operation mode.In the present embodiment, such as, to server is connected with two mobile terminals to perform in multithreading operation mode simultaneously described in the performance test script prerecorded, be pre-stored in the performance test script prerecorded described on described test module 14 and specifically comprise following content:
Setting is opened by mobile terminal operating system bag name and interactive component name;
Click the performance-relevant character with test;
Search the switch module that ID is set to the test performance of switchWidget;
Whether the switch module of checkout performance is opened, if so, then represents that test is passed through, and continues next step, if not, then represents that test is not passed through, and returns and opens setting;
Search the switch module that ID is set to the performance of the test of switchWidget;
Whether the switch module of checkout performance closes, if so, then represents that test is passed through, and terminates; If not, represent that test is not passed through, return and open setting.
As shown in table 1, adopt two mobile terminals in the present embodiment, respectively WIFI switch is carried out to two mobile terminals and test, and Bluetooth switch is tested.
Table 1: the performance test script prerecorded
Device [1] APP:com.android.settings/.Settings//by android bag name and activity name opens and arranges module
Device [2] APP:com.android.settings/.Settings//by android bag name and activity name opens and arranges module
The character of Device [1] CText:WLAN//click WLAN, note: CText: the abbreviation being ClickText, clicks character
Device2] character of CText:WLAN//click bluetooth, note: CText: the abbreviation being ClickText, clicks character
Device [1] ID:android:id/switchWidget//search the WIFI switch module that id is switchWidget
Device [2] ID:android:id/switchWidget//search the Bluetooth switch assembly that id is switchWidget
WIFI switch module is opened in Device [1] Class:android.widget.Switch [1] Chick//click, and the sequence that [1] represents this assembly is 1
Bluetooth switch assembly is opened in Device [2] Class:android.widget.Switch [1] Chick//click, and the sequence that [2] represent this assembly is 2
Device [1] Class:android.widget.Switch [1] Checked, true//check whether WIFI state is opened, is opened for true
Device [2] Class:android.widget.Switch [1] Checked, true//check whether bluetooth state is opened, is opened for true
Device [1] ID:android:id/switchWidget//search the WIFI switch module that id is switchWidget
Device [2] ID:android:id/switchWidget//search the Bluetooth switch assembly that id is switchWidget
WIFI switch module is closed in Device [1] Class:android.widget.Switch [1] Chick//click, and the sequence that [1] represents this assembly is 1
Bluetooth switch assembly is closed in Device [2] Class:android.widget.Switch [1] Chick//click, and the sequence that [2] represent this assembly is 2
Device [1] Class:android.widget.Switch [1] Checked, false//check whether WIFI state closes, closes as false
Device [2] Class:android.widget.Switch [1] Checked, false//check whether bluetooth state closes, closes as false
Device [1] Back//return button
Device [2] Back//return button
Device [1] Back//return button
Device [2] Back//return button
Device [1] Home//backspace standby interface
Device [2] Home//backspace standby interface
The present embodiment also provides a kind of mobile terminal 2, refers to Fig. 3, is shown as the theory structure schematic diagram of mobile terminal.As shown in Figure 3, described mobile terminal 2 comprises the Performance Test System 21 of the mobile terminal described in the present embodiment.
In sum, the performance test methods of mobile terminal of the present invention and system can carry out the performance test of multichannel mobile terminal device simultaneously, control the literary style of multiple mobile terminal device, can test multiple mobile device performance test in a set of Run Script.So the present invention effectively overcomes various shortcoming of the prior art and tool high industrial utilization.
Above-described embodiment is illustrative principle of the present invention and effect thereof only, but not for limiting the present invention.Any person skilled in the art scholar all without prejudice under spirit of the present invention and category, can modify above-described embodiment or changes.Therefore, such as have in art usually know the knowledgeable do not depart from complete under disclosed spirit and technological thought all equivalence modify or change, must be contained by claim of the present invention.