CN107231272A - Automatic test device and method that a kind of wireless messages are obtained - Google Patents

Automatic test device and method that a kind of wireless messages are obtained Download PDF

Info

Publication number
CN107231272A
CN107231272A CN201710383795.2A CN201710383795A CN107231272A CN 107231272 A CN107231272 A CN 107231272A CN 201710383795 A CN201710383795 A CN 201710383795A CN 107231272 A CN107231272 A CN 107231272A
Authority
CN
China
Prior art keywords
wireless
automatic test
test device
flow
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710383795.2A
Other languages
Chinese (zh)
Inventor
陈琳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Feixun Data Communication Technology Co Ltd
Original Assignee
Shanghai Feixun Data Communication Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Feixun Data Communication Technology Co Ltd filed Critical Shanghai Feixun Data Communication Technology Co Ltd
Priority to CN201710383795.2A priority Critical patent/CN107231272A/en
Publication of CN107231272A publication Critical patent/CN107231272A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/08Testing, supervising or monitoring using real traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/24Arrangements for testing

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Environmental & Geological Engineering (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

Automatic test device and method that a kind of wireless messages of the present invention are obtained, the automatic test device are arranged at mobile device end, including:Connection establishment unit, the connection request of setting up for receiving client sends corresponding response message to client and is connected with being set up with client;Wireless messages acquiring unit, the wireless messages for receiving client obtain request, and obtaining request to the wireless messages is handled, and the multiple interfaces provided using the automatic test device obtain corresponding wireless messages;Wireless messages feedback unit, for the wireless messages of acquisition to be fed back into the client.By the present invention, the purpose of the wireless messages such as PC ends monitoring mobile phone wireless flow, PING packet loss, PING time delays, connection speed, signal intensity may be implemented in.

Description

Automatic test device and method that a kind of wireless messages are obtained
Technical field
The present invention relates to a kind of automated testing method and system, the automation that more particularly to a kind of wireless messages are obtained Test device and method.
Background technology
As increasing cell phone manufacturer, operator, developer add Android camps, the application in Android markets Quantity rapid development.However, this all be unable to do without test, therefore the demand of Android automatic tests is further urgent.
The instrument of current automatic test mobile phone has a lot, for example:Monkey、MonkeyRunner、 Instrumentation, UiAutomator, Appium etc..These instruments may serve to analogue-key press, lift, screen The events such as click, rolling, but believe for mobile phone wireless flow, PING packet loss, PING time delays, connection speed, signal intensity etc. The test of breath is less applicable.
The content of the invention
To overcome the shortcomings of that above-mentioned prior art is present, the purpose of the present invention is to provide oneself that a kind of wireless messages obtain Dynamicization test device and method, mobile phone wireless flow, PING packet loss, PING time delays, connection are achieved that at PC ends to reach The purpose of the wireless messages automatic test such as speed, signal intensity.
For up to above-mentioned purpose, the present invention proposes the automatic test device that a kind of wireless messages are obtained, it is arranged at movement and sets Standby end, for carrying out data transmission with client, including:
Connection establishment unit, the connection request of setting up for receiving client sends corresponding response message to client It is connected with being set up with client;
Wireless messages acquiring unit, obtains request, the wireless messages are obtained please in the wireless messages for receiving client Ask and handled, the multiple interfaces provided using the automatic test device obtain corresponding wireless messages;
Wireless messages feedback unit, for the wireless messages of acquisition to be fed back into the client;
The wireless messages include wireless flow, the packet loss of PING networks, PING network delays, wireless link rate with And wireless signal strength etc. is part or all of.
Further, the wireless messages that the wireless messages acquiring unit is obtained by multiple interfaces include wireless flow, Packet loss, PING network delays, wireless link rate and the wireless signal strength of PING networks etc. it is part or all of.
Further, the wireless messages acquiring unit further comprises:
Wireless connection information acquiring unit, when obtaining request for the wireless messages for wireless connection information acquisition request, Then handled to obtain wireless connection information;
Descending wireless flow acquiring unit, when obtaining request for the wireless messages for the acquisition request of descending wireless flow, Then handled to obtain descending wireless flow;
Up-link wireless flow acquiring unit, when obtaining request for the wireless messages for the acquisition request of up-link wireless flow, Then handled to obtain up-link wireless flow;
Ping network delays/packet loss acquiring unit, obtain request for Ping network delays for the wireless messages or lose When bag rate obtains request, then it is handled to obtain Ping network delays or packet loss.
Further, the descending wireless flow acquiring unit is obtained after automatic test device connection is upper wirelessly first The total flow of reception, and obtain the total flow received again after next second, then value twice is subtracted each other, obtained under this Row wireless flow.
Further, the up-link wireless flow acquiring unit is obtained after automatic test device connection is upper wirelessly first The total flow of transmission, and the total flow of transmission is obtained after next second again, then value twice is subtracted each other, this is obtained up Wireless flow.
Further, the client includes:
Connection closed unit, connection request is closed for being sent to automatic test device, and is surveyed in receiving automation The connection with automatic test device is closed after the response message that trial assembly is put, terminates test;
Broadcast transmission unit, is broadcasted for being sent to automatic test device, and the automatic test device receives the visitor The broadcast that family end is sent, is screened by filter and broadcasted, and performs corresponding action according to broadcast;Corresponding action includes Wireless enable and wireless connection.
To reach above-mentioned purpose, the present invention also provides the automated testing method that a kind of wireless messages are obtained, including as follows Step:
Step one, the connection request that client is sent is received, connection request is responded and is connected with being set up with client;
Step 2, receives the wireless messages acquisition request that client is sent, utilizes what the automatic test device was provided Multiple interfaces obtain corresponding wireless messages;
The wireless messages of acquisition are fed back to client by step 3;
The wireless messages include wireless flow, the packet loss of PING networks, PING network delays, wireless link rate with And wireless signal strength etc. is part or all of.
Further, step 2 further comprises:
If the wireless messages obtain request for wireless connection information acquisition request, handled it wireless to obtain Link information;
If the wireless messages obtain request for the acquisition request of descending wireless flow, handled it descending to obtain Wireless flow;
If the wireless messages obtain request for the acquisition request of up-link wireless flow, handled it up to obtain Wireless flow;
If the wireless messages obtain request when obtaining request for Ping network delays or packet loss, it is handled with Obtain Ping network delays or packet loss.
Further, the step of acquisition downlink traffic is upper wireless from automatic test device connection to obtain first The total flow received afterwards, and obtain the total flow received again after next second, then value twice is subtracted each other, is somebody's turn to do Descending wireless flow.
Further, the step of acquisition uplink traffic is upper wireless from automatic test device connection to obtain first The total flow sent afterwards, and the total flow of transmission is obtained after next second again, then value twice is subtracted each other, obtained on this Row wireless flow.
Further, before step one, client sends to automatic test device and broadcasted, the automatic test device The broadcast of client transmission is received, is screened and broadcasted by filter, and corresponding action is performed according to broadcast, it is corresponding Action includes wireless enable and wireless connection;
Connection request is closed Step 4: being sent to automatic test device, and in the sound for receiving automatic test device The connection closed after information with automatic test device is answered, terminates test.
Compared with prior art, a kind of wireless messages of the invention are obtained automatic test device and method are by using setting The automatic test device for being placed in mobile phone terminal sets multiple interfaces, be respectively intended to obtain mobile phone wireless flow, PING packet loss, PING time delays, connection speed, signal intensity, and filled using the wireless client and the automatic test of mobile phone terminal for being arranged at PC ends Put and communicated, calling interface, which is realized, obtains related wireless messages, realize the wireless router of testing mobile phone connection performance and The purpose of function, and then reach and can just monitor mobile phone wireless flow, wireless signal strength and connection speed, acquisition at PC ends The purpose of ping network delays and ping packet loss, and can just control connection and the switch of mobile phone wireless at PC ends.
Brief description of the drawings
The system architecture diagram for the automatic test device that Fig. 1 obtains for a kind of wireless messages of the invention;
Fig. 2 is the detail structure chart of wireless messages acquiring unit 102 in the specific embodiment of the invention
The system architecture diagram for the test system that Fig. 3 applies for the automatic test device of the present invention;
Fig. 4 is the detail structure chart of client 20 in the specific embodiment of the invention;
Fig. 5 is the socket interaction diagrams of automatic test device and wireless client in the specific embodiment of the invention;
Fig. 6 is that the automatic test device of Android mobile phone in the specific embodiment of the invention obtains the flow chart of wireless messages;
Fig. 7 sends broadcast, automatic test device end listening broadcast for wireless client in the specific embodiment of the invention and held Row wireless switching and the flow chart being connected;;
The step flow chart for the automated testing method that Fig. 8 obtains for a kind of wireless messages of the invention;
Fig. 9 is the step flow chart of the automated testing method of the specific embodiment of the invention.
Embodiment
Below by way of specific instantiation and embodiments of the present invention are described with reference to the drawings, those skilled in the art can Understand the further advantage and effect of the present invention easily by content disclosed in the present specification.The present invention can also pass through other differences Instantiation implemented or applied, the various details in this specification also can based on different viewpoints with application, without departing substantially from Various modifications and change are carried out under the spirit of the present invention.
The system architecture diagram for the automatic test device that Fig. 1 obtains for a kind of wireless messages of the invention.As shown in figure 1, this The automatic test device that a kind of wireless messages are obtained is invented, applied to mobile device end, including:Connection establishment unit 101, nothing Line information acquisition unit 102 and wireless messages feedback unit 103.
Wherein, connection establishment unit 101, the connection request of setting up for receiving client sends corresponding response message It is connected to client with being set up with client;Wireless messages acquiring unit 102, the wireless messages for receiving client are obtained The wireless messages are obtained request and handled, obtain corresponding wireless messages, wireless messages here include wireless streams by request Amount, the packet loss of PING networks, PING network delays, wireless link rate and wireless signal strength etc. it is part or all of; Wireless messages feedback unit 103, for the wireless messages of acquisition to be fed back into client, in the specific embodiment of the invention, visitor Family end is arranged at PC computer ends, so can just monitor mobile phone wireless flow, wireless signal strength and connection speed at PC ends, obtain Take ping network delays and ping packet loss
Specifically, as shown in Fig. 2 wireless messages acquiring unit 102 further comprises:
Wireless connection information acquiring unit 1020, it is wireless connection information acquisition request to obtain request for the wireless messages When, then handled to obtain wireless connection information;So that the automatic test device is arranged at Android mobile phone as an example, work as client By socket by character string " after the automatic test devices that are sent in Android mobile phone of connInfo ", wireless connection information is obtained Unit 1020 is taken then to call android.net.wifi.WifiManager method getConnectionInfo () to obtain Wireless connection information is taken, such as wireless signal strength, wireless title, wireless MAC address, wireless link rate.
Descending wireless flow acquiring unit 1021, it is the acquisition request of descending wireless flow to obtain request for the wireless messages When, then obtain first from automatic test device and connect the upper wireless rear total flow received, and obtained again after next second This value, then subtracts each other value twice, obtains descending wireless flow, specifically, when client by socket by character string " RxBytes " is sent to after the automatic test device in Android mobile phone, and descending wireless flow acquiring unit 1021 can then be called The getTotalRxBytes () of android.net.TrafficStats classes connects upper wireless rear reception to obtain from mobile phone Total flow, and this value is obtained again after next second, then two sub-values are subtracted each other, that is, obtain descending wireless flow.
Up-link wireless flow acquiring unit 1022, it is the acquisition request of up-link wireless flow to obtain request for the wireless messages When, then obtain first from automatic test device and connect the upper wireless rear total flow sent, and obtained again after next second This value, then subtracts each other value twice, obtains up-link wireless flow, when client by socket by character string " TxBytes " It is sent to after the automatic test device in Android mobile phone, up-link wireless flow acquiring unit 1022 can then be called The getTotalTxBytes () of android.net.TrafficStats classes connects upper wireless rear transmission to obtain from mobile phone This value is obtained after total flow, and Yu Yimiao again, then subtracts each other two values, that is, obtains up-link wireless flow.
Ping network delays/packet loss acquiring unit 1023, it is Ping network delays to obtain request for the wireless messages Or packet loss is obtained when asking, then it is handled to obtain Ping network delays or packet loss.In present invention specific implementation In example, Ping network delays/packet loss acquiring unit 1023 can call python subprocess popen storehouses and mobile phone Adb command interface adb ping*.*.*.* obtain ping network delays, or call python subprocess popen storehouses Ping packet loss is obtained with the adb command interface adb ping*.*.*.* of mobile phone.
The system architecture diagram for the test system that Fig. 3 applies for the automatic test device of the present invention.The present invention is applied Test system, including:Client 20 and automatic test device 21.
Wherein, client 20, are arranged at PC computer ends, for automatic test device 21 send connection request, and in Set up and be connected with automatic test device 21 when receiving the response message of automatic test device 21, filled with automatic test Put after 21 foundation connection, sending wireless messages to automatic test device 21 obtains request with acquisition request automatic test device 21 wireless messages, receive the wireless messages that automatic test device 21 feeds back, wireless messages here include wireless flow, It is part or all of in packet loss, PING network delays, wireless link rate and wireless signal strength of PING networks etc., In the specific embodiment of the invention, client 20 is arranged at PC computer ends, and it can be wireless client, it is preferred that client 20 It is additionally operable to send to automatic test device 21 and closes connection request, and in the response message for receiving automatic test device 21 The connection with automatic test device 21 is closed afterwards, terminates test.Client 20 is additionally operable to send to automatic test device 21 Broadcast, by automatic test device 21 is that broadcast recipients screen broadcast by filter, and holds according to the broadcast listened to The corresponding action of row, in the specific embodiment of the invention, broadcast is then defined as wireless enable and wireless connection, so in PC Computer end can just control connection and the switch of mobile device such as mobile phone wireless.
Automatic test device 21, is connected for sending response message to client 20 with being set up with client 20, in connecing Receive wireless messages obtain request when, the request is handled, obtain comprising wireless flow, the packet loss of PING networks, All or part of wireless messages in PING network delays, wireless link rate and wireless signal strength etc., and its is anti- It is fed to client 20.
Fig. 4 is the detail structure chart of client 20 in the specific embodiment of the invention.As shown in figure 4, client 20 is further Including:Radio connection request unit 201, for sending connection request to automatic test device, and is surveyed in receiving automation Set up and be connected with automatic test device during the response message that trial assembly is put, in the specific embodiment of the invention, automatic test dress Install and be placed in mobile device such as mobile phone terminal;Wireless messages request unit 202, after being connected with automatic test device foundation, Wireless messages are sent to automatic test device and obtain request, with the wireless messages of acquisition request automatic test device, here Wireless messages include wireless flow, the packet loss of PING networks, PING network delays, wireless link rate and wireless signal It is part or all of in intensity etc.;Response data acquiring unit 203, the wireless communication for receiving automatic test device feedback Breath, that is to say, that automatic test device obtains request in the wireless messages for receiving the transmission of wireless messages request unit 202 When, that is, handle the wireless messages and obtain request, acquisition includes wireless flow, the packet loss of PING networks, PING network delays, nothing All or part of wireless messages in line connection speed and wireless signal strength etc., and fed back to response data acquisition Unit 203, can thus be monitored according to the wireless messages of acquisition mobile phone wireless flow, wireless signal strength and connection speed, Obtain ping network delays and ping packet loss.
It is preferred that client 20 also includes connection closed unit, asked for sending to close to connect to automatic test device Ask, and in receiving closing and the connection of automatic test device after the response message of automatic test device, terminate test.
It is preferred that the client 20 also includes broadcast transmission unit, broadcasted for being sent to automatic test device, automatically Change test device to receive after broadcast, first pass through filter screening broadcast, corresponding action is then performed according to broadcast, in this hair In bright specific embodiment, broadcast is then defined as wireless enable and wireless connection.
Fig. 5 is the socket interaction diagrams of automatic test device and wireless client in the specific embodiment of the invention. In the specific embodiment of the invention, automatic test device is arranged in Android mobile phone, and its interface provided has wireless network stream Amount acquisition, wireless link rate acquisition, wireless signal strength acquisition, wireless Push And Release, wireless connection, PING networks prolong The acquisition of slow and packet loss, wireless client is arranged at PC computer ends, client and the automatic test device in Android mobile phone Between set up socket communication.
Automatic test device installed in Android mobile phone end monitors the port specified, and waits the wireless client for operating in PC End connection, after connection is set up, automatic test device can read the request that wireless client sends always, and (request is without line number According to), automatic test device can handle request, obtain wireless messages by multiple interfaces, and wireless messages are replied to wirelessly Client, wireless client may proceed to send a request to automatic test device after reading the wireless messages of feedback, follow always Ring is reciprocal, closes connection request until wireless client is sent, whole interaction terminates.
Fig. 6 is that the automatic test device of Android mobile phone in the specific embodiment of the invention obtains the flow chart of wireless messages, When the wireless client on PC by socket by character string " automatic tests that are sent in Android mobile phone of connInfo " fill Postpone, automatic test device will call android.net.wifi.WifiManager method GetConnectionInfo () obtains wireless connection information, and wireless connection information here includes wireless signal strength, nothing Line title, wireless MAC address, wireless link rate etc..
When the wireless client on PC by socket by character string " RxBytes " is sent to automation in Android mobile phone After test device, automatic test device will call the getTotalRxBytes of android.net.TrafficStats classes () connects the upper wireless rear total flow received to obtain from mobile phone, obtains this value after next second again, then subtracts each other, is Descending wireless flow.
When the wireless client on PC by socket by character string " TxBytes " is sent to automation in Android mobile phone After test device, automatic test device will call the getTotalTxBytes of android.net.TrafficStats classes () come obtain from mobile phone connect it is upper wireless after the total flow that sends, obtain this value again after one second, then subtract each other, be on Row wireless flow.
In addition, the wireless client at PC ends sends oneself in broadcast, Android mobile phone by adb shell ambroadcast Dynamicization test device is that broadcast recipients screen broadcast by action in filter.These broadcast are defined as wireless enable With wireless connection.Android mobile phone will go to perform corresponding action after listening to broadcast.Fig. 7 is in the specific embodiment of the invention Wireless client sends broadcast, automatic test device end listening broadcast and performs wireless switching and the flow chart being connected.Android hand Meeting listening broadcast after automatic test device operation on machine, these broadcast are defined as " wifi-enable ", " wifi- Disable ", " wifi-connect ", specifically,
The wireless client at PC ends passes through adb orders " adb am broadcast-a wifi-enable " control Android Automatic test device on mobile phone removes the method setWifiEnabled by android.net.wifi.WifiManager (true) it is wireless to open.
The wireless client at PC ends passes through adb orders " adb am broadcast-a wifi-disable " come control peace Automatic test device on Zhuo Shouji goes the method by android.net.wifi.WifiManager SetWifiEnabled (false) is wireless to close.
The wireless client at PC ends passes through adb orders " adb am broadcast-a wifi-connect " come control peace Automatic test device on Zhuo Shouji removes the method enableNetwork by android.net.wifi.WifiManager (netID, true) is wireless to connect.
The step flow chart for the automated testing method that Fig. 8 obtains for a kind of wireless messages of the invention.As shown in figure 8, this The automated testing method that a kind of wireless messages are obtained is invented, applied to automatic test device, is comprised the following steps:
Step 801, the connection request that client is sent is received using automatic test device, connection request is responded It is connected with being set up with client.In the specific embodiment of the invention, automatic test device is arranged at mobile device such as mobile phone End, client is arranged at PC ends;
Step 802, the automatic test device receives the wireless messages acquisition request that client is sent, and is passed through according to request Multiple interfaces obtain the wireless messages of automatic test devices, and wireless messages here include wireless flow, PING networks and lost It is part or all of in bag rate, PING network delays, wireless link rate and wireless signal strength etc.;
Step 803, the corresponding wireless messages of acquisition are fed back to client to obtain the wireless messages.Here wireless Information includes wireless flow, the packet loss of PING networks, PING network delays, wireless link rate and wireless signal strength etc. It is part or all of.
Specifically, step 802 further comprises:
If the wireless messages obtain request for wireless connection information acquisition request, handled it wireless to obtain Link information, the wireless connection information includes wireless signal strength, wireless title, wireless MAC address, wireless link rate etc. Partly or entirely;So that automatic test device is arranged at Android mobile phone as an example, when receiving what client was sent by socket Wireless messages obtain request be character string " connInfo " when, then the method for calling android.net.wifi.WifiManager GetConnectionInfo () obtains wireless connection information, for example wireless signal strength, wireless title, wireless MAC address, Wireless link rate etc..
If the wireless messages obtain request for the acquisition request of descending wireless flow, obtain first from automatic test dress The upper wireless rear total flow received of connection is put, and this value is obtained again after next second, then value twice is subtracted each other, obtained Descending wireless flow.That is, being character string when receiving client to obtain request by the socket wireless messages sent " During RxBytes ", then call the getTotalRxBytes () of android.net.TrafficStats classes and connect to obtain from mobile phone The wireless rear total flow received is connected, and this value is obtained again after next second, then two sub-values are subtracted each other, that is, obtain descending Wireless flow.
If the wireless messages obtain request for the acquisition request of up-link wireless flow, obtain first from automatic test dress The upper wireless rear total flow sent of connection is put, and this value is obtained again after next second, then value twice is subtracted each other, obtained Up-link wireless flow.That is, being character string when receiving client to obtain request by the socket wireless messages sent " During TxBytes ", then call the getTotalTxBytes () of android.net.TrafficStats classes and connect to obtain from mobile phone The wireless rear total flow sent is connected, and obtains this value after Yu Yimiao again, then two values are subtracted each other, that is, obtain up-link wireless Flow.
If the wireless messages obtain request for the acquisition request of Ping network delays, python subprocess is called The adb command interface adb ping*.*.*.* of popen storehouses and mobile phone obtain ping network delays, and preserve local.
If the wireless messages obtain request for the acquisition request of Ping packet loss, python subprocess is called The adb command interface adb ping*.*.*.* of popen storehouses and mobile phone obtain ping packet loss, and are stored in local.
It is preferred that after step 803, in addition to:
The client receives the wireless messages of automatic test device feedback, and is back to step 802, until test knot Beam.
It is preferred that the automated testing method that the wireless messages of the present invention are obtained also comprises the following steps:
The connection closed request that client is sent is received, and connection closed request is responded with closing and client Connection, terminate test.
It is preferred that before step 802, the automated testing method of the wireless messages acquisition of the present invention, in addition to it is as follows Step:
Receive the broadcast sent to client;
Corresponding action is performed according to broadcast.It is first after the broadcast with receiving client in the specific embodiment of the invention Broadcast can be first screened by action in filter, corresponding action is performed further according to broadcast after screening.Here broadcast then fixed Justice is wireless enable and wireless connection.
Fig. 9 is the step flow chart of the automated testing method of the specific embodiment of the invention.In the specific embodiment of the invention In, the automatic test device is arranged at Android mobile phone end, and wireless client is arranged at PC ends, as shown in figure 9, the automation is surveyed Method for testing is as follows:
1st, the automatic test device of wireless client and mobile phone terminal sets up connection, sets up Socket communications;
2nd, judge whether mobile phone electricity is less than 5%, if less than 5%, terminating test, otherwise into 3;
3rd, current time time1 is determined;
4th, wireless client sends Broadcasting Control by adb shell ambroadcast and sets automatic test device Mobile phone wireless is enabled;
5th, wireless client sends Broadcasting Control by adb shell ambroadcast and sets automatic test device Mobile phone connection is wireless;
6th, the automatic test device of mobile phone terminal calls python subprocess popen storehouses and the adb orders of mobile phone Interface adb ping*.*.*.* obtain ping network delays, and preserve local;
7th, the automatic test device of mobile phone terminal calls python subprocess popen storehouses and the adb orders of mobile phone Interface adb ping*.*.*.* obtain ping packet loss, and preserve local;
8th, the wireless client at PC ends sends character string by socket " automatic test dresses of the RxBytes " to mobile phone Put, automatic test device obtains downlink traffic, and preserves local;
9th, the wireless client at PC ends sends character string by socket " automatic test dresses of the TxBytes " to mobile phone Put, automatic test device obtains uplink traffic, and preserves local;
10th, the wireless client at PC ends sends character string by socket " automatic test dresses of the connInfo " to mobile phone Put, obtain wireless signal strength and connection speed
11st, current time time2 is write down, 60s-time2-time1 is waited, and is back to 2, in the specific embodiment of the invention In, calculate circulation starts to circulation end how many second used, in order to ensure that whole circulation was maintained in 1 minute, so being subtracted with 60s Go the used time, then wait so long.
In summary, a kind of wireless messages of the invention are obtained automatic test device and method are by using being arranged at hand The automatic test device of generator terminal sets multiple interfaces, when being respectively intended to obtain mobile phone wireless flow, PING packet loss, PING Prolong, connection speed, signal intensity, and utilize the wireless client and mobile phone terminal for being arranged at PC ends automatic test device carry out Communication, calling interface is realized obtains related wireless messages, realizes the performance and function of the wireless router of testing mobile phone connection Purpose, so reach can just be monitored at PC ends mobile phone wireless flow, wireless signal strength and connection speed, obtain ping networks Delay and the purpose of ping packet loss, and can just control connection and the switch of mobile phone wireless at PC ends.
Any those skilled in the art can repair under the spirit and scope without prejudice to the present invention to above-described embodiment Decorations are with changing.Therefore, the scope of the present invention, should be as listed by claims.

Claims (10)

1. the automatic test device that a kind of wireless messages are obtained, is arranged at mobile device end, for carrying out data with client Transmission, including:
Connection establishment unit, the connection request of setting up for receiving client, send corresponding response message to client with Client sets up connection;
Wireless messages acquiring unit, the wireless messages for receiving client obtain request, and the wireless messages are obtained and asked Handled, the multiple interfaces provided using the automatic test device obtain corresponding wireless messages;
Wireless messages feedback unit, for the wireless messages of acquisition to be fed back into the client;
The wireless messages include wireless flow, the packet loss of PING networks, PING network delays, wireless link rate and nothing Line signal intensity etc. it is part or all of.
2. the automatic test device that a kind of wireless messages as claimed in claim 1 are obtained, it is characterised in that the wireless communication Breath acquiring unit further comprises:
Wireless connection information acquiring unit, when obtaining request for the wireless messages for wireless connection information acquisition request, then enters Row handles to obtain wireless connection information;
Descending wireless flow acquiring unit, when obtaining request for the wireless messages for the acquisition request of descending wireless flow, then enters Row handles to obtain descending wireless flow;
Up-link wireless flow acquiring unit, when obtaining request for the wireless messages for the acquisition request of up-link wireless flow, then enters Row handles to obtain up-link wireless flow;
Ping network delays/packet loss acquiring unit, it is Ping network delays or packet loss to obtain request for the wireless messages When obtaining request, then it is handled to obtain Ping network delays or packet loss.
3. the automatic test device that a kind of wireless messages as claimed in claim 2 are obtained, it is characterised in that:This is descending wireless Flow acquiring unit obtains from the automatic test device and connects the upper wireless rear total flow received first, and after next second The total flow received is obtained again, then subtracts each other value twice, obtains the descending wireless flow.
4. the automatic test device that a kind of wireless messages as claimed in claim 3 are obtained, it is characterised in that:The up-link wireless Flow acquiring unit obtains from the automatic test device and connects the upper wireless rear total flow sent first, and after next second The total flow of transmission is obtained again, then subtracts each other value twice, obtains the up-link wireless flow.
5. the automatic test device that a kind of wireless messages as described in claim 1-4 are obtained, it is characterised in that the client End further comprises:
Connection closed unit, connection request is closed for being sent to automatic test device, and is filled in receiving automatic test The connection with automatic test device is closed after the response message put, terminates test;
Broadcast transmission unit, is broadcasted for being sent to automatic test device, and the automatic test device receives the client The broadcast of transmission, is screened by filter and broadcasted, and performs corresponding action according to broadcast;Corresponding action includes wireless Enable and wireless connection.
6. the automated testing method that a kind of wireless messages are obtained, comprises the following steps:
Step one, the connection request that client is sent is received, connection request is responded and is connected with being set up with client;
Step 2, receives the wireless messages acquisition request that client is sent, utilizes the multiple of automatic test device offer Interface obtains corresponding wireless messages;
The wireless messages of acquisition are fed back to client by step 3, and are back to step 2, until test terminates.
The wireless messages include wireless flow, the packet loss of PING networks, PING network delays, wireless link rate and nothing Line signal intensity etc. it is part or all of.
7. the automated testing method that a kind of wireless messages as claimed in claim 6 are obtained, it is characterised in that step 2 enters one Step includes:
If the wireless messages obtain request for wireless connection information acquisition request, it is handled to obtain wireless connection Information;
If the wireless messages obtain request for the acquisition request of descending wireless flow, handled it descending wireless to obtain Flow;
If the wireless messages obtain request for the acquisition request of up-link wireless flow, it is handled to obtain up-link wireless Flow;
If it is that Ping network delays or packet loss are obtained when asking that the wireless messages, which obtain request, it is handled to obtain Ping network delays or packet loss.
8. the automated testing method that a kind of wireless messages as claimed in claim 7 are obtained, it is characterised in that:Under the acquisition The step of row flow for obtain first from the automatic test device connect it is upper wireless after the total flow that receives, and in next second it Obtain the total flow received again afterwards, then subtract each other value twice, obtain the descending wireless flow.
9. the automated testing method that a kind of wireless messages as claimed in claim 7 are obtained, it is characterised in that:In the acquisition The step of row flow for obtain first from the automatic test device connect it is upper wireless after the total flow that sends, and in next second it Obtain the total flow of transmission again afterwards, then subtract each other value twice, obtain the up-link wireless flow.
10. the automated testing method that a kind of wireless messages as described in claim 6-9 are obtained, it is characterised in that further Including:
Step 1: between step 2, client sends to automatic test device and broadcasted, the automatic test device is received The broadcast that the client is sent, is screened by filter and broadcasted, and performs corresponding action, corresponding action according to broadcast Including wireless enable and wireless connection;
Connection request is closed Step 4: being sent to automatic test device, and is believed in the response for receiving automatic test device The connection with automatic test device is closed after breath, terminates test.
CN201710383795.2A 2017-05-26 2017-05-26 Automatic test device and method that a kind of wireless messages are obtained Pending CN107231272A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710383795.2A CN107231272A (en) 2017-05-26 2017-05-26 Automatic test device and method that a kind of wireless messages are obtained

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710383795.2A CN107231272A (en) 2017-05-26 2017-05-26 Automatic test device and method that a kind of wireless messages are obtained

Publications (1)

Publication Number Publication Date
CN107231272A true CN107231272A (en) 2017-10-03

Family

ID=59934365

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710383795.2A Pending CN107231272A (en) 2017-05-26 2017-05-26 Automatic test device and method that a kind of wireless messages are obtained

Country Status (1)

Country Link
CN (1) CN107231272A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108667536A (en) * 2018-04-26 2018-10-16 国网冀北电力有限公司秦皇岛供电公司 A kind of test method and device for analog signal communication system
CN109144850A (en) * 2018-07-23 2019-01-04 上海携程商务有限公司 The test method interactively communicated and system of mobile terminal
CN109739711A (en) * 2019-01-04 2019-05-10 广州虎牙信息科技有限公司 A kind of interface test method, device, equipment and storage medium
CN110972196A (en) * 2018-09-29 2020-04-07 中国移动通信有限公司研究院 Information acquisition method and network element equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102917095A (en) * 2012-10-10 2013-02-06 青岛海信移动通信技术股份有限公司 Method and device for testing terminal based on Android
US20130212559A1 (en) * 2012-02-14 2013-08-15 Appgyver Oy Method and System for Developing Applications for Portable Communication Devices
CN103399814A (en) * 2013-07-16 2013-11-20 西安Tcl软件开发有限公司 Automated testing method and automated testing device
CN104601768A (en) * 2014-12-22 2015-05-06 上海斐讯数据通信技术有限公司 Android mobile phone automatic testing system and testing method thereof
CN106535240A (en) * 2015-09-11 2017-03-22 飞思达技术(北京)有限公司 Mobile APP centralized performance analysis method based on cloud platform

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130212559A1 (en) * 2012-02-14 2013-08-15 Appgyver Oy Method and System for Developing Applications for Portable Communication Devices
CN102917095A (en) * 2012-10-10 2013-02-06 青岛海信移动通信技术股份有限公司 Method and device for testing terminal based on Android
CN103399814A (en) * 2013-07-16 2013-11-20 西安Tcl软件开发有限公司 Automated testing method and automated testing device
CN104601768A (en) * 2014-12-22 2015-05-06 上海斐讯数据通信技术有限公司 Android mobile phone automatic testing system and testing method thereof
CN106535240A (en) * 2015-09-11 2017-03-22 飞思达技术(北京)有限公司 Mobile APP centralized performance analysis method based on cloud platform

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108667536A (en) * 2018-04-26 2018-10-16 国网冀北电力有限公司秦皇岛供电公司 A kind of test method and device for analog signal communication system
CN109144850A (en) * 2018-07-23 2019-01-04 上海携程商务有限公司 The test method interactively communicated and system of mobile terminal
CN109144850B (en) * 2018-07-23 2022-02-11 上海携程商务有限公司 Method and system for testing interactive communication of mobile terminal
CN110972196A (en) * 2018-09-29 2020-04-07 中国移动通信有限公司研究院 Information acquisition method and network element equipment
CN109739711A (en) * 2019-01-04 2019-05-10 广州虎牙信息科技有限公司 A kind of interface test method, device, equipment and storage medium
CN109739711B (en) * 2019-01-04 2023-02-28 广州虎牙信息科技有限公司 Interface test method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107231272A (en) Automatic test device and method that a kind of wireless messages are obtained
US8019333B2 (en) Apparatus and methods for product acceptance testing on a wireless device
US9538404B2 (en) Apparatus and methods for product acceptance testing on a wireless device
JP4607970B2 (en) Apparatus and method for determining voice and / or data processing performance of a wireless device
CN106254348B (en) A kind of Wireless LAN communication method based on Android
JP6722681B2 (en) Network testing for telecommunications
CN103369581B (en) A kind of obtain the method and apparatus that terminal minimizes drive test data
CN103945443B (en) A kind of TD-LTE wireless network traffic performance test methods and system
CN106534289A (en) Automatic testing method, device and system
CN112333019B (en) Router configuration and test method and system and readable storage medium
CN110602726A (en) Method and system for testing automatic distribution network of intelligent equipment
CN105873011B (en) The transmission of group service data, control method, device and equipment
US20150081758A1 (en) Testing a network using a communication device
US7623856B2 (en) Method for testing communication protocol having collection of internal information of a mobile communication terminal by an external module
CN110167026A (en) A kind of method for switching network and device, private network application server and storage medium
CN114124267B (en) Method and system for testing satellite communication system
US8441935B2 (en) Method and apparatus to distribute signaling data for parallel analysis
CN110392347A (en) Data transmission method and device
CN102917386B (en) Device and method for consistency protocol verification of interfaces S1 of LTE (Long Term Evolution) wireless network
WO2016206229A1 (en) System and method for telephone traffic test
CN112702759B (en) Vertical industry-oriented data link performance testing method and system
CN100518212C (en) Method and apparatus for call testing of speech apparatus
CN101616367B (en) Call tracing method and call tracing device
CN103079218B (en) Auto-dial testing control method and equipment
KR100603767B1 (en) Apparatus and method for testing a base-station with smart antenna, and a protocol structure

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20171003