The automated testing method and system of terminal device
Technical field
The present invention relates to automatic test field more particularly to the automated testing methods and system of a kind of terminal device.
Background technique
In hardware testing, conflict test mainly utilizes comprehensive test instrument, under specified bandwidth and channel, is emitted by control
Power come obtain mobile phone receive data when packet loss, the antenna performance of mobile phone is verified in a manner of constantly bottoming out.But it is existing
The software that some comprehensive test instruments are installed can only control comprehensive test instrument itself, and can not control the state of mobile phone, so, in reality
In the test process of border, it is still desirable to which tester manually carries out such as switch mobile phone scene, the mobile phones behaviour such as switch offline mode
Make, cannot achieve full automatic unattended automatic test.
Summary of the invention
The technical problem to be solved by the present invention is in order to overcome in the prior art comprehensive test instrument cannot achieve full automatic conflict
The defect of test provides the automated testing method and system of a kind of terminal device.
The present invention is to solve above-mentioned technical problem by following technical proposals:
A kind of automated testing method of terminal device, it is characterized in that, the automated testing method includes:
An at least test script is created, the test script includes test scene and test parameter;
Read the test script;
The terminal device is tested according to the test script using comprehensive test instrument;
Described the step of being tested according to the test script the terminal device using comprehensive test instrument includes:
According to the test parameter in the test script, comprehensive test instrument is set;
According to the test scene in the test script, the terminal device is set;
Connect the comprehensive test instrument and the terminal device;
The terminal device is tested by the comprehensive test instrument.
Optionally, when the quantity of the test script of creation is more than one, utilize comprehensive test instrument according to the test described
After the step of script tests the terminal device, the automated testing method further include:
Judge whether an at least test script has been read;
If it is not, then reading a test script not being read, and the comprehensive test instrument is continued to execute according to the test
The step of script tests the terminal device.
Optionally, the step of terminal device is arranged in the test scene according in the test script include:
Test scene script corresponding with the test scene is transferred according to the test scene in the test script, it is described
Test scene script is used to the scene setting of the terminal device be the test scene;
The test scene script is executed on the terminal device.
Optionally, described to utilize comprehensive test instrument root after the connection comprehensive test instrument and the terminal device the step of
The step of terminal device is tested according to the test script further include:
Detect the comprehensive test instrument and the terminal device whether successful connection;
If so, continuing to execute described the step of testing by the comprehensive test instrument the terminal device;
If it is not, the terminal device, which is then arranged, reexamines network connection;
It is default to judge whether the number for executing the step of setting terminal device reexamines network connection is less than
Threshold value;
If so, continue to execute the detection comprehensive test instrument and the terminal device whether successful connection the step of;
If it is not, then record the comprehensive test instrument connected with the terminal device it is unsuccessful.
Optionally, described the step of being tested by the comprehensive test instrument the terminal device, includes:
By comprehensive test instrument test, in the case where ensuring packet loss not higher than default maximum packet loss, the terminal is set
Standby receivable minimum transmission power.
A kind of automatization test system of terminal device, it is characterized in that, the automatization test system includes:
Creation module, for creating an at least test script, the test script includes test scene and test parameter;
Read module, for reading the test script;
Test module, for being tested according to the test script the terminal device using comprehensive test instrument;
The test module includes:
First setting unit, for comprehensive test instrument to be arranged according to the test parameter in the test script;
Second setting unit, for the terminal device to be arranged according to the test scene in the test script;
Connection unit, for connecting the comprehensive test instrument and the terminal device;
Test cell, for being tested by the comprehensive test instrument the terminal device.
Optionally, when the quantity of the test script of creation module creation is more than one, the automatic test system
System further include:
Judgment module, for judging whether an at least test script has been read;
If it is not, the read module is then called to read a test script not being read, and continue to call the survey
Die trial block.
Optionally, second setting unit be specifically used for according to the test scene in the test script transfer with it is described
The corresponding test scene script of test scene, the test scene script are used to the scene setting of the terminal device be described
Test scene;
Second setting unit is specifically also used to execute the test scene script on the terminal device.
Optionally, the test module further include: detection unit, third setting unit, judging unit, recording unit,
In:
The detection unit for detect the comprehensive test instrument and the terminal device whether successful connection;
If so, continuing to call the test cell;
If it is not, then calling the third setting unit, the third setting unit is for being arranged the terminal device again
Check network connection;
The judging unit is for judging whether the number for calling the third setting unit is less than preset threshold;
If so, continuing to call the detection unit;
If it is not, then calling the recording unit, the recording unit is for recording the comprehensive test instrument and the terminal device
It connects unsuccessful.
Optionally, the test cell is specifically used for, and is ensuring packet loss not higher than default by comprehensive test instrument test
The receivable minimum transmission power of terminal device in the case where maximum packet loss.
The positive effect of the present invention is that: the test script created in the present invention not only includes bandwidth, channel etc.
Test parameter further includes the test scene of terminal device, thus, the survey of comprehensive test instrument can either be arranged in the execution of the test script
Parameter is tried, and the test scene of terminal device to be measured can be set, and then can use comprehensive test instrument and test terminal device,
Without the test scene of tester's manual switching setting terminal device, can be realized based on comprehensive test instrument to the automatic of terminal device
Change test.
Detailed description of the invention
Fig. 1 is the flow chart according to the automated testing method of the terminal device of the embodiment of the present invention 1.
Fig. 2 is the flow chart according to step 3 in the automated testing method of the terminal device of the embodiment of the present invention 2.
Fig. 3 is the flow chart according to step 32 in the automated testing method of the terminal device of the embodiment of the present invention 2.
Fig. 4 is the partial process view according to step 34 in the automated testing method of the terminal device of the embodiment of the present invention 3.
Fig. 5 is the module diagram according to the automatization test system of the terminal device of the embodiment of the present invention 5.
Fig. 6 is to be illustrated according to the module of test module in the automatization test system of the terminal device of the embodiment of the present invention 6
Figure.
Fig. 7 is to be illustrated according to the module of test cell in the automatization test system of the terminal device of the embodiment of the present invention 7
Figure.
Specific embodiment
The present invention is further illustrated below by the mode of embodiment, but does not therefore limit the present invention to the reality
It applies among a range.
Embodiment 1
The present embodiment provides a kind of automated testing method of terminal device, Fig. 1 shows the flow chart of the present embodiment.Ginseng
According to Fig. 1, the automated testing method of the present embodiment includes:
Step 1, a creation at least test script;
In this step, test script includes test scene and test parameter, and test parameter can include but is not limited to band
Wide, channel.
Step 2, read test script;
Step 3 tests terminal device according to test script using comprehensive test instrument;
Specifically, in the present embodiment, step 3 specifically includes:
Comprehensive test instrument is arranged according to the test parameter in test script in step 31;
Terminal device is arranged according to the test scene in test script in step 32;
Step 33, connection comprehensive test instrument and terminal device;
Step 34 tests terminal device by comprehensive test instrument.
When the quantity of the test script created in step 1 is more than one, after step 3, the automation of the present embodiment
Test method further include:
Whether step 4, a judgement at least test script have been read;
If being judged as YES, all test scripts are read;
If being judged as NO, return continues to execute step 2, reads a test script not being read, and continue to hold
Row step 3, in this way, to be automatically performed the test to all test scripts.
Further, in the present embodiment, can with the wired connections of disconnected end equipment and other equipment (such as, via
The connection of USB (Universal Serial Bus, universal serial bus)), it is unrelated with automatic test to stop terminal device
Communication and charge transport, with improve test accuracy.
Compared with the test script only with test parameter, the present embodiment has redefined test script, is allowed to including surveying
Except training sheet, also there is test scene, thus, the test parameter of comprehensive test instrument can either be arranged, again in the execution of the test script
The test scene of terminal device to be measured can be set, and then can use comprehensive test instrument and terminal device is tested, without test
The test scene of terminal device is arranged in personnel's manual switching, and the automatic test to terminal device can be realized based on comprehensive test instrument.
Embodiment 2
The automated testing method of terminal device provided in this embodiment, is the further improvement to embodiment 1, and Fig. 2 shows
The flow chart of the step 3 of the present embodiment is gone out.Referring to Fig. 2, improvement of the present embodiment compared with embodiment 1 is, the present embodiment
Step 3 is after step 33 in automated testing method further include:
Step 35, detection comprehensive test instrument and terminal device whether successful connection;
If so, going to step 34;
If it is not, then going to step 36;
Step 36, setting terminal device reexamine network connection;
In this step, ADB (Android Debug Bridge, Android debug bridge) instruction and test foot can be passed through
This controlling terminal equipment switches in offline mode and test scene, to promote terminal device to reexamine network connection.
Step 37 judges whether the number for executing previous step is less than preset threshold;
If so, going to step 35;
If it is not, then going to step 38;
In this step, namely judge whether the number for executing step 36 is less than preset threshold, wherein threshold value can basis
The customized setting of concrete application.
Step 38, record comprehensive test instrument connect unsuccessful with terminal device.
In this step, comprehensive test instrument and terminal device repeatedly connect unsuccessful, belong to abnormal case, can go to preset
Exception handling is handled.
In addition, step 32 can specifically include in the present embodiment referring to Fig. 3:
Step 321 transfers test scene script corresponding with test scene according to the test scene in test script;
In this step, test scene script is used to the scene setting of terminal device be test scene.
Step 322 executes test scene script on the terminal device.
The present embodiment on the basis of embodiment 1, further detects the connection of comprehensive test instrument and terminal device, and to even
It connects unsuccessful terminal device to be reset, to promote comprehensive test instrument and terminal device successful connection, to further promote
The automation of test improves the efficiency of automatic test.
Embodiment 3
The automated testing method of terminal device provided in this embodiment is the further improvement to embodiment 1, specifically
Ground, in the present embodiment, step 34 specifically include: ensuring packet loss not higher than default maximum packet loss by comprehensive test instrument test
In the case where the receivable minimum transmission power of terminal device.
In the present embodiment, test parameter includes Initial Trans, and referring to Fig. 4, step 34 specifically can use following
The terminal device in the case where ensuring packet loss not higher than default maximum packet loss is receivable most by comprehensive test instrument test for step
Low transmitting power:
Step 341, comprehensive test instrument send test data packet to terminal device according to test transmission power;
In this step, the initial value for testing transmission power is Initial Trans;
The packet loss for the test data packet that step 342, detection are sent;
Whether the packet loss that step 343, judgement detect is not higher than default maximum packet loss;
If so, going to step 344;
If it is not, then going to step 345;
Step 344 reduces test transmission power, and continues to execute step 341,342,343, until step 343 is judged as
When no, step 346 is gone to;
Step 345 increases test transmission power, and continues to execute step 341,342,343, until step 343 is judged as
When being, step 347 is gone to;
Step 346 enables minimum transmission power be upper test transmission power;
Step 347 enables minimum transmission power for test transmission power.
In the present embodiment step 344 and 345, it can be, but not limited to reduce or increase transmitting function in a manner of equally spaced
Rate.
The present embodiment on the basis of embodiment 1, provides one kind and tests terminal device in the case where ensuring packet loss
The implementation of receivable minimum transmission power improves the effect of automatic test to further promote the automation of test
Rate.
Embodiment 4
The automated testing method of terminal device provided in this embodiment is the further improvement to embodiment 3.
After executing step 344, when step 343 is judged as NO, step 34 in the present embodiment further include: increase test hair
Power is penetrated, and continues to execute step 341,342,343, until enabling minimum transmission power for test hair when step 343 is judged as YES
Penetrate power.
It should be appreciated that in the case, the step-length for increasing measured power can be less than the step-length for reducing measured power.
After executing step 345, when step 343 is judged as YES, step 34 in the present embodiment further include: reduce test hair
Power is penetrated, and continues to execute step 341,342,343, until enabling minimum transmission power is a upper survey when step 343 is judged as NO
Try transmission power.
It should be appreciated that in the case, the step-length for reducing measured power can be less than the step-length for increasing measured power.
It should be appreciated that in the present embodiment, can be, but not limited to reduce or increase transmission power in a manner of equally spaced.
The present embodiment is on the basis of embodiment 3, in a manner of combining coarse adjustment and fine tuning, provides a kind of more accurate
The implementation of the receivable minimum transmission power of terminal device is tested, thus further in the case where ensuring packet loss in ground
The automation for promoting test, improves the efficiency of automatic test.
Embodiment 5
The present embodiment provides a kind of automatization test system of terminal device, Fig. 5 shows the module signal of the present embodiment
Figure.Referring to Fig. 5, the automatization test system of the present embodiment includes:
Creation module 5, for creating an at least test script, the test script includes test scene and test parameter,
Test parameter can include but is not limited to bandwidth, channel.
Read module 6, for reading the test script.
Test module 7, for being tested according to the test script the terminal device using comprehensive test instrument.Specifically
Ground, test module 7 include:
First setting unit 71, for comprehensive test instrument to be arranged according to the test parameter in the test script.
Second setting unit 72, for the terminal device to be arranged according to the test scene in the test script.
Connection unit 73, for connecting the comprehensive test instrument and the terminal device.
Test cell 74, for being tested by the comprehensive test instrument the terminal device.
When the quantity of the test script of the creation module 5 creation is more than one, the automatic test system of the present embodiment
System further include:
Judgment module 8, for judging whether an at least test script has been read;
If so, all test scripts have been read;If it is not, then call the read module 6 read one not by
The test script of reading, and continue to call the test module 7, in this way, to be automatically performed the test to all test scripts.
Further, in the present embodiment, (can such as be passed through with the wired connection of disconnected end equipment and other equipment
USB), to stop the terminal device communication unrelated with automatic test and charge transport, to improve the accuracy of test.
Compared with the test script only with test parameter, the present embodiment has redefined test script, is allowed to including surveying
Except training sheet, also there is test scene, thus, the test parameter of comprehensive test instrument can either be arranged, again in the execution of the test script
The test scene of terminal device to be measured can be set, and then can use comprehensive test instrument and terminal device is tested, without test
The test scene of terminal device is arranged in personnel's manual switching, and the automatic test to terminal device can be realized based on comprehensive test instrument.
Embodiment 6
The automatization test system of terminal device provided in this embodiment, is the further improvement to embodiment 5, and Fig. 6 shows
The module diagram of test module in the present embodiment is gone out.Referring to Fig. 6, improvement of the present embodiment compared with embodiment 5 is, this reality
Apply in the automatization test system of example, test module 7 further include: detection unit 75, third setting unit 76, judging unit 77,
Recording unit 78, in which:
Detection unit 75 for detect the comprehensive test instrument and the terminal device whether successful connection;If so, continuing to adjust
With the test cell 74;If it is not, then calling the third setting unit 76.
The third setting unit 76 reexamines network connection, specifically, Ke Yitong for the terminal device to be arranged
It crosses ADB instruction and test script controlling terminal equipment switches in offline mode and test scene, to promote terminal to set
It is standby to reexamine network connection.
The judging unit 77 is for judging whether the number for calling the third setting unit 76 is less than preset threshold;If
It is then to continue to call the detection unit 75;If it is not, then calling the recording unit 78.Wherein, threshold value can be according to specifically answering
With customized setting.
The recording unit 78 for record the comprehensive test instrument connected with the terminal device it is unsuccessful.Wherein, comprehensive test instrument
It is repeatedly connected with terminal device unsuccessful, belongs to abnormal case, preset exception handling can be gone to and handled.
In addition, in the present embodiment, the second setting unit 72 is specifically used for according to the test scene in the test script
Transfer test scene script corresponding with the test scene, wherein the test scene script is used for the terminal device
Scene setting be the test scene.Second setting unit 72 is also used to execute the test on the terminal device
Scene script.
The present embodiment further detects the connection of comprehensive test instrument and terminal device on the basis of embodiment 5, and to even
It connects unsuccessful terminal device to be reset, to promote comprehensive test instrument and terminal device successful connection, to further promote
The automation of test improves the efficiency of automatic test.
Embodiment 7
The automatization test system of terminal device provided in this embodiment is the further improvement to embodiment 5, specifically
Ground, in the present embodiment, test cell 74 are specifically used for, by comprehensive test instrument test ensure packet loss not higher than it is default most
The receivable minimum transmission power of terminal device in the case where big packet loss.
In the present embodiment, test parameter includes Initial Trans, and referring to Fig. 7, test cell 74 specifically includes transmission
Subelement 741, detection sub-unit 742, judgment sub-unit 743, adjustment subelement 744, transmission power determine subelement 745.Its
In:
Transmission sub-unit 741 sends test data packet to terminal device according to test transmission power for comprehensive test instrument,
In, the initial value for testing transmission power is Initial Trans.
Detection sub-unit 742, for detecting the packet loss of the test data packet sent.
Judgment sub-unit 743, for judging whether the packet loss detected is not higher than default maximum packet loss;
If so, calling adjustment subelement 744 to reduce test transmission power, and continue to call transmission sub-unit 741, inspection
Subelement 742, judgment sub-unit 743 are surveyed, until calling transmission power to determine subelement when judgment sub-unit 743 is judged as NO
745 to be upper test transmission power for enabling minimum transmission power;
If it is not, then calling adjustment subelement 744 to increase test transmission power, and continue to call transmission sub-unit 741, inspection
Subelement 742, judgment sub-unit 743 are surveyed, until calling transmission power to determine subelement when judgment sub-unit 743 is judged as YES
745 for enabling minimum transmission power for test transmission power.
In the present embodiment, adjustment subelement 744 is called to can be, but not limited to reduce in a manner of equally spaced or increase
Transmission power.
The present embodiment provides one kind and tests terminal device in the case where ensuring packet loss on the basis of embodiment 5
The implementation of receivable minimum transmission power improves the effect of automatic test to further promote the automation of test
Rate.
Embodiment 8
The automatization test system of terminal device provided in this embodiment is the further improvement to embodiment 7.
After calling adjustment subelement 744 to reduce test transmission power, when judgment sub-unit 743 is judged as NO, this
In embodiment, continue to call adjustment subelement 744 to increase test transmission power, and continues to call transmission sub-unit 741, detection
Subelement 742, judgment sub-unit 743, until calling transmission power to determine subelement 745 when judgment sub-unit 743 is judged as YES
For enabling minimum transmission power for test transmission power.
It should be appreciated that in the case, the step-length that adjustment subelement 744 increases measured power, which can be less than, reduces test function
The step-length of rate.
After calling adjustment subelement 744 to increase test transmission power, when judgment sub-unit 743 is judged as YES, this
In embodiment, continue to call adjustment subelement 744 to reduce test transmission power, and continues to call transmission sub-unit 741, detection
Subelement 742, judgment sub-unit 743, until calling transmission power to determine subelement 745 when judgment sub-unit 743 is judged as NO
To be upper test transmission power for enabling minimum transmission power.
It should be appreciated that in the case, the step-length that adjustment subelement 744 reduces measured power, which can be less than, increases test function
The step-length of rate.
It should be appreciated that in the present embodiment, adjustment subelement 744 can be, but not limited to reduce in a manner of equally spaced or
Increase transmission power.
The present embodiment is on the basis of embodiment 7, in a manner of combining coarse adjustment and fine tuning, provides a kind of more accurate
The implementation of the receivable minimum transmission power of terminal device is tested, thus further in the case where ensuring packet loss in ground
The automation for promoting test, improves the efficiency of automatic test.
Although specific embodiments of the present invention have been described above, it will be appreciated by those of skill in the art that this is only
For example, protection scope of the present invention is to be defined by the appended claims.Those skilled in the art without departing substantially from
Under the premise of the principle and substance of the present invention, many changes and modifications may be made, but these change and
Modification each falls within protection scope of the present invention.