Disclosure of Invention
The invention aims to overcome the defect that the comprehensive tester in the prior art cannot realize full-automatic conflict test, and provides an automatic test method and system for terminal equipment.
The invention solves the technical problems through the following technical scheme:
an automatic test method of a terminal device is characterized by comprising the following steps:
creating at least one test script, wherein the test script comprises a test scene and test parameters;
reading the test script;
testing the terminal equipment by using a comprehensive tester according to the test script;
the step of testing the terminal equipment by using the comprehensive tester according to the test script comprises the following steps:
setting a comprehensive tester according to the test parameters in the test script;
setting the terminal equipment according to the test scene in the test script;
connecting the comprehensive tester and the terminal equipment;
and testing the terminal equipment through the comprehensive tester.
Optionally, when the number of created test scripts exceeds one, after the step of testing the terminal device according to the test scripts by using the comprehensive tester, the automated testing method further includes:
judging whether the at least one test script is read or not;
and if not, reading a test script which is not read, and continuously executing the step that the comprehensive tester tests the terminal equipment according to the test script.
Optionally, the step of setting the terminal device according to the test scenario in the test script includes:
calling a test scene script corresponding to the test scene according to the test scene in the test script, wherein the test scene script is used for setting the scene of the terminal equipment as the test scene;
and executing the test scenario script on the terminal equipment.
Optionally, after the step of connecting the comprehensive tester and the terminal device, the step of testing the terminal device by using the comprehensive tester according to the test script further includes:
detecting whether the comprehensive tester and the terminal equipment are successfully connected;
if yes, continuing to execute the step of testing the terminal equipment through the comprehensive tester;
if not, setting the terminal equipment to recheck network connection;
judging whether the frequency of executing the step of setting the network connection to be rechecked by the terminal equipment is less than a preset threshold value;
if yes, continuing to execute the step of detecting whether the connection between the comprehensive tester and the terminal equipment is successful;
if not, recording that the connection between the comprehensive tester and the terminal equipment is unsuccessful.
Optionally, the step of testing the terminal device by the comprehensive tester includes:
and testing the lowest receivable transmitting power of the terminal equipment by the comprehensive tester under the condition of ensuring that the packet loss rate is not higher than the preset maximum packet loss rate.
An automated test system for a terminal device, the automated test system comprising:
the system comprises a creating module, a setting module and a processing module, wherein the creating module is used for creating at least one test script, and the test script comprises a test scene and test parameters;
the reading module is used for reading the test script;
the testing module is used for testing the terminal equipment by using the comprehensive tester according to the testing script;
the test module includes:
the first setting unit is used for setting the comprehensive tester according to the test parameters in the test script;
the second setting unit is used for setting the terminal equipment according to the test scene in the test script;
the connecting unit is used for connecting the comprehensive tester and the terminal equipment;
and the test unit is used for testing the terminal equipment through the comprehensive tester.
Optionally, when the number of the test scripts created by the creating module exceeds one, the automated test system further includes:
the judging module is used for judging whether the at least one test script is read or not;
if not, calling the reading module to read a test script which is not read, and continuing to call the test module.
Optionally, the second setting unit is specifically configured to invoke a test scenario script corresponding to the test scenario according to the test scenario in the test scenario, where the test scenario script is used to set the scenario of the terminal device as the test scenario;
the second setting unit is further specifically configured to execute the test scenario script on the terminal device.
Optionally, the test module further comprises: detection element, third setting element, judgement unit, record unit, wherein:
the detection unit is used for detecting whether the comprehensive tester and the terminal equipment are successfully connected;
if yes, continuing to call the test unit;
if not, calling the third setting unit, wherein the third setting unit is used for setting the terminal equipment to recheck the network connection;
the judging unit is used for judging whether the number of times of calling the third setting unit is less than a preset threshold value or not;
if yes, continuing to call the detection unit;
if not, the recording unit is called and used for recording that the connection between the comprehensive tester and the terminal equipment is unsuccessful.
Optionally, the testing unit is specifically configured to test, by the integrated tester, a lowest receivable transmission power of the terminal device under a condition that it is ensured that the packet loss rate is not higher than a preset maximum packet loss rate.
The positive progress effects of the invention are as follows: the test script created in the invention not only comprises test parameters such as bandwidth and channel, but also comprises a test scene of the terminal equipment, so that the execution of the test script can set the test parameters of the comprehensive tester and can set the test scene of the terminal equipment to be tested, the comprehensive tester can be used for testing the terminal equipment, the test scene of the terminal equipment does not need to be manually switched by a tester, and the automatic test of the terminal equipment can be realized based on the comprehensive tester.
Detailed Description
The invention is further illustrated by the following examples, which are not intended to limit the scope of the invention.
Example 1
The embodiment provides an automated testing method for terminal equipment, and fig. 1 shows a flowchart of the embodiment. Referring to fig. 1, the automated testing method of the present embodiment includes:
step 1, creating at least one test script;
in this step, the test script includes test scenarios and test parameters, which may include but are not limited to bandwidth, channel.
Step 2, reading a test script;
step 3, testing the terminal equipment by using the comprehensive tester according to the test script;
specifically, in this embodiment, step 3 specifically includes:
step 31, setting the comprehensive tester according to the test parameters in the test script;
step 32, setting terminal equipment according to the test scene in the test script;
step 33, connecting the comprehensive tester and the terminal equipment;
and step 34, testing the terminal equipment through the comprehensive tester.
When the number of the test scripts created in step 1 exceeds one, after step 3, the automated testing method of the present embodiment further includes:
step 4, judging whether at least one test script is read;
if the test script is judged to be yes, all the test scripts are read;
if not, returning to continue to execute the step 2, reading a test script which is not read, and continuing to execute the step 3, so as to automatically finish the test of all the test scripts.
Further, in this embodiment, the wired connection between the terminal device and other devices (such as the connection via USB (Universal Serial Bus)) may be disconnected to stop the communication and power transmission of the terminal device that are not related to the automated test, so as to improve the accuracy of the test.
Compared with a test script only with test parameters, the test script is redefined in the embodiment and is enabled to have a test scene besides the test script, so that the execution of the test script can set the test parameters of the comprehensive tester and can also set the test scene of the terminal equipment to be tested, the comprehensive tester can be used for testing the terminal equipment, the test scene of the terminal equipment is not required to be manually switched by a tester, and the automatic test of the terminal equipment can be realized based on the comprehensive tester.
Example 2
The automatic testing method for the terminal device provided in this embodiment is a further improvement of embodiment 1, and fig. 2 shows a flowchart of step 3 in this embodiment. Referring to fig. 2, the improvement of this embodiment over embodiment 1 is that step 3 in the automated testing method of this embodiment further includes, after step 33:
step 35, detecting whether the comprehensive tester and the terminal equipment are successfully connected;
if yes, go to step 34;
if not, go to step 36;
step 36, setting the terminal device to recheck the network connection;
in this step, the terminal device may be controlled to switch between the flight mode and the test scenario through an ADB (Android Debug Bridge) instruction and a test script, so as to cause the terminal device to recheck the network connection.
Step 37, judging whether the number of times of executing the previous step is less than a preset threshold value;
if yes, go to step 35;
if not, go to step 38;
in this step, it is determined whether the number of times of executing step 36 is less than a preset threshold, where the threshold may be set by a user according to a specific application.
And step 38, recording that the connection between the comprehensive tester and the terminal equipment is unsuccessful.
In this step, the comprehensive tester and the terminal device are unsuccessfully connected for many times, which belongs to an abnormal situation, and the comprehensive tester can be switched to a preset abnormal handling mechanism for handling.
In addition, referring to fig. 3, in this embodiment, step 32 may specifically include:
step 321, calling a test scenario script corresponding to the test scenario according to the test scenario in the test scenario;
in this step, the test scenario script is used to set the scenario of the terminal device as the test scenario.
Step 322, executing the test scenario script on the terminal device.
In this embodiment, on the basis of embodiment 1, the connection condition between the integrated tester and the terminal device is further detected, and the terminal device that has failed in connection is reset, so that the integrated tester and the terminal device are successfully connected, thereby further promoting the automation of the test and improving the efficiency of the automated test.
Example 3
The automatic testing method for the terminal device provided in this embodiment is a further improvement of embodiment 1, and specifically, in this embodiment, step 34 specifically includes: and testing the lowest receivable transmitting power of the terminal equipment by using the comprehensive tester under the condition of ensuring that the packet loss rate is not higher than the preset maximum packet loss rate.
In this embodiment, the test parameter includes an initial transmission power, and referring to fig. 4, step 34 may specifically use the following steps to test, by using the integrated tester, a lowest transmission power that can be received by the terminal device under the condition that it is ensured that the packet loss rate is not higher than the preset maximum packet loss rate:
step 341, the comprehensive tester sends a test data packet to the terminal device according to the test transmitting power;
in the step, the initial value of the transmission power is tested to be the initial transmission power;
step 342, detecting the packet loss rate of the transmitted test data packet;
step 343, judging whether the detected packet loss rate is not higher than a preset maximum packet loss rate;
if yes, go to step 344;
if not, go to step 345;
344, reducing the test transmitting power, and continuing to execute 341, 342, 343 until 343, turning to 346;
step 345, increasing the test transmitting power, and continuing to execute steps 341, 342, 343 until step 343 is judged yes, going to step 347;
step 346, making the lowest transmitting power be the last testing transmitting power;
and step 347, the lowest transmitting power is the testing transmitting power.
In this embodiment, steps 344 and 345, the transmit power may be, but is not limited to, decreased or increased in an equally spaced manner.
On the basis of embodiment 1, the present embodiment provides an implementation manner for testing the minimum acceptable transmission power of the terminal device under the condition of ensuring the packet loss rate, so as to further promote the automation of the test and improve the efficiency of the automated test.
Example 4
The automatic testing method for the terminal device provided by the embodiment is a further improvement of the embodiment 3.
After step 344, when step 343 is determined as no, step 34 in this embodiment further includes: increasing the test transmitting power, and continuing to execute steps 341, 342, 343 until step 343 determines yes, making the lowest transmitting power the test transmitting power.
It should be appreciated that in this case the step size for increasing the test power may be smaller than the step size for decreasing the test power.
After step 345 is executed, if yes in step 343, step 34 in this embodiment further includes: the test transmit power is decreased, and steps 341, 342, and 343 are continued until step 343 determines no, and the lowest transmit power is the last test transmit power.
It should be appreciated that in this case the step size for decreasing the test power may be smaller than the step size for increasing the test power.
It should be understood that in the present embodiment, the transmission power may be decreased or increased in an equally spaced manner, but is not limited thereto.
In this embodiment, on the basis of embodiment 3, a manner of combining coarse tuning and fine tuning is provided to provide a more accurate implementation manner for testing the minimum acceptable transmission power of the terminal device under the condition of ensuring the packet loss rate, so as to further promote the automation of the test and improve the efficiency of the automated test.
Example 5
The present embodiment provides an automated testing system for terminal equipment, and fig. 5 shows a module diagram of the present embodiment. Referring to fig. 5, the automated test system of the present embodiment includes:
a creating module 5, configured to create at least one test script, where the test script includes a test scenario and test parameters, and the test parameters may include, but are not limited to, bandwidth and channel.
And the reading module 6 is used for reading the test script.
And the test module 7 is used for testing the terminal equipment by utilizing the comprehensive tester according to the test script. Specifically, the test module 7 includes:
and the first setting unit 71 is used for setting the comprehensive tester according to the test parameters in the test script.
And a second setting unit 72, configured to set the terminal device according to the test scenario in the test script.
And the connection unit 73 is used for connecting the comprehensive tester and the terminal equipment.
And the testing unit 74 is used for testing the terminal equipment through the comprehensive tester.
When the number of the test scripts created by the creating module 5 exceeds one, the automated test system of this embodiment further includes:
the judging module 8 is configured to judge whether the at least one test script has been read;
if yes, all the test scripts are read; if not, calling the reading module 6 to read a test script which is not read, and continuing to call the test module 7, so as to automatically complete the test of all the test scripts.
Further, in this embodiment, the wired connection of the terminal device to other devices (such as through USB) may be disconnected to stop the communication and power transmission of the terminal device unrelated to the automated test, so as to improve the accuracy of the test.
Compared with a test script only with test parameters, the test script is redefined in the embodiment and is enabled to have a test scene besides the test script, so that the execution of the test script can set the test parameters of the comprehensive tester and can also set the test scene of the terminal equipment to be tested, the comprehensive tester can be used for testing the terminal equipment, the test scene of the terminal equipment is not required to be manually switched by a tester, and the automatic test of the terminal equipment can be realized based on the comprehensive tester.
Example 6
The automated testing system of the terminal device provided in this embodiment is a further improvement of embodiment 5, and fig. 6 shows a module diagram of the testing module in this embodiment. Referring to fig. 6, the improvement of this embodiment over embodiment 5 is that, in the automated testing system of this embodiment, the testing module 7 further includes: a detection unit 75, a third setting unit 76, a judgment unit 77, and a recording unit 78, wherein:
the detection unit 75 is configured to detect whether the integrated tester and the terminal device are successfully connected; if yes, continuing to call the test unit 74; if not, the third setting unit 76 is invoked.
The third setting unit 76 is configured to set the terminal device to re-check the network connection, and specifically, may control the terminal device to switch between the flight mode and the test scenario through the ADB command and the test script, so as to prompt the terminal device to re-check the network connection.
The judging unit 77 is configured to judge whether the number of times of calling the third setting unit 76 is less than a preset threshold; if yes, the detection unit 75 is continuously called; if not, the recording unit 78 is invoked. The threshold value can be set in a self-defined mode according to specific applications.
The recording unit 78 is configured to record that the connection between the comprehensive tester and the terminal device is unsuccessful. The comprehensive tester and the terminal equipment are unsuccessfully connected for many times, belong to an abnormal situation, and can be switched to a preset abnormal handling mechanism for handling.
In addition, in this embodiment, the second setting unit 72 is specifically configured to invoke a test scenario script corresponding to the test scenario according to the test scenario in the test scenario, where the test scenario script is used to set the scenario of the terminal device as the test scenario. The second setting unit 72 is further configured to execute the test scenario script on the terminal device.
In this embodiment, on the basis of embodiment 5, the connection condition between the integrated tester and the terminal device is further detected, and the terminal device that has failed in connection is reset, so that the integrated tester and the terminal device are successfully connected, thereby further promoting the automation of the test and improving the efficiency of the automated test.
Example 7
The automatic test system for a terminal device provided in this embodiment is a further improvement of embodiment 5, and specifically, in this embodiment, the test unit 74 is specifically configured to test, by using the comprehensive tester, a minimum transmission power that can be received by the terminal device under the condition that it is ensured that a packet loss rate is not higher than a preset maximum packet loss rate.
In this embodiment, the test parameter includes initial transmission power, and referring to fig. 7, the test unit 74 specifically includes a sending subunit 741, a detecting subunit 742, a determining subunit 743, an adjusting subunit 744, and a transmission power determining subunit 745. Wherein:
and a sending subunit 741, configured to send, by the integrated tester, the test data packet to the terminal device according to the test transmission power, where an initial value of the test transmission power is the initial transmission power.
A detecting subunit 742 is configured to detect a packet loss rate of the transmitted test packet.
A determining subunit 743, configured to determine whether the detected packet loss rate is not higher than a preset maximum packet loss rate;
if yes, the adjusting subunit 744 is invoked to reduce the test transmission power, and the sending subunit 741, the detecting subunit 742, and the determining subunit 743 are continuously invoked, until the determining subunit 743 judges no, the transmission power determining subunit 745 is invoked to set the lowest transmission power as the last test transmission power;
if not, the adjusting subunit 744 is invoked to increase the test transmission power, and the sending subunit 741, the detecting subunit 742, and the determining subunit 743 are continuously invoked, until the determining subunit 743 determines yes, the transmission power determining subunit 745 is invoked to set the lowest transmission power as the test transmission power.
In this embodiment, invoking the adjustment sub-unit 744 may, but is not limited to, decrease or increase the transmit power in an equally spaced manner.
On the basis of embodiment 5, the present embodiment provides an implementation manner for testing the minimum acceptable transmit power of the terminal device under the condition of ensuring the packet loss rate, so as to further promote the automation of the test and improve the efficiency of the automated test.
Example 8
The automatic test system for terminal equipment provided in this embodiment is a further improvement of embodiment 7.
After the adjusting subunit 744 is invoked to reduce the test transmission power, if the judging subunit 743 determines that the test transmission power is negative, in this embodiment, the adjusting subunit 744 is continuously invoked to increase the test transmission power, and the sending subunit 741, the detecting subunit 742, and the judging subunit 743 are continuously invoked, until the judging subunit 743 determines that the test transmission power is positive, the transmission power determining subunit 745 is invoked to set the lowest transmission power as the test transmission power.
It should be appreciated that in this case, the step size of the adjustment sub-unit 744 increasing the test power may be smaller than the step size of the decreasing test power.
After the adjusting subunit 744 is invoked to increase the test transmission power, if the judging subunit 743 determines that it is, in this embodiment, the adjusting subunit 744 is continuously invoked to decrease the test transmission power, and the sending subunit 741, the detecting subunit 742, and the judging subunit 743 are continuously invoked, until the judging subunit 743 determines that it is not, the transmission power determining subunit 745 is invoked to set the lowest transmission power as the previous test transmission power.
It will be appreciated that in this case the step size of the adjustment sub-unit 744 decreasing the test power may be smaller than the step size of increasing the test power.
It should be appreciated that in this embodiment, the adjustment sub-unit 744 may, but is not limited to, decrease or increase the transmit power in an equally spaced manner.
In this embodiment, on the basis of embodiment 7, a manner of combining coarse tuning and fine tuning is provided to more accurately implement the lowest receivable transmit power of the test terminal device under the condition of ensuring the packet loss rate, so as to further promote the automation of the test and improve the efficiency of the automated test.
While specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that this is by way of example only, and that the scope of the invention is defined by the appended claims. Various changes and modifications to these embodiments may be made by those skilled in the art without departing from the spirit and scope of the invention, and these changes and modifications are within the scope of the invention.