CN115842884A - Method for completing mobile phone test based on recording mobile phone interface coordinates - Google Patents

Method for completing mobile phone test based on recording mobile phone interface coordinates Download PDF

Info

Publication number
CN115842884A
CN115842884A CN202211685707.1A CN202211685707A CN115842884A CN 115842884 A CN115842884 A CN 115842884A CN 202211685707 A CN202211685707 A CN 202211685707A CN 115842884 A CN115842884 A CN 115842884A
Authority
CN
China
Prior art keywords
mobile phone
completing
test
interface
test based
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
CN202211685707.1A
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.)
Rivotek Technology Jiangsu Co Ltd
Original Assignee
Rivotek Technology Jiangsu 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 Rivotek Technology Jiangsu Co Ltd filed Critical Rivotek Technology Jiangsu Co Ltd
Priority to CN202211685707.1A priority Critical patent/CN115842884A/en
Publication of CN115842884A publication Critical patent/CN115842884A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a method for completing mobile phone test based on recording mobile phone interface coordinates, which comprises the following steps: s1, starting USB debugging by a mobile phone, connecting a PC end with a mobile phone A, and starting a test tool by the PC end; s2, the PC end obtains time sequence graph files of click, sliding and key events of the mobile phone A through an abd shell gettevent-t command; s3, synchronously reading a sequence diagram file of the mobile phone A by the PC side through python multithreading; s4, realizing the functions of clicking, sliding and keying through a click method, a swipe _ points method and a keyevent method in the uiautomator2 frame; and S5, if the PC continues to synchronously operate the mobile phone B and the mobile phone C, returning to the step S2 to continue to execute the operation, and if the PC does not continue to synchronously operate the mobile phone B and the mobile phone C any more, terminating the test program by the PC test tool. The invention can obviously improve the testing efficiency of the mobile phone, can synchronously operate and test a plurality of mobile phones at one time, greatly reduces the delay time during synchronous operation and has low error rate; the execution operation threshold is low, the usability is strong, and an executive person is not required to have code debugging capability.

Description

Method for completing mobile phone test based on recording mobile phone interface coordinates
Technical Field
The invention relates to the technical field of mobile phone testing, in particular to a method for completing mobile phone testing based on recording mobile phone interface coordinates.
Background
In the process of mobile phone research and development, a series of function tests need to be performed on the mobile phone in research and development to ensure the product quality. Due to market demands, current mobile phone products generally have a plurality of configurations, and hardware manufacturers using the products with the plurality of configurations have some differences, like the mobile phone products have high and low configurations, wherein the mobile phone cameras, fingerprints and sensor suppliers with the high configurations are inconsistent with the mobile phones with the low configurations, so that the mobile phones of different hardware suppliers need to perform one-time function test related to hardware difference, and the test efficiency is influenced due to more repetitive work.
For the related operations (such as clicking, sliding and long pressing) of testing the mobile phone interface coordinates through recording and synchronously replaying the operations to other mobile phone testing equipment, the following defects of the prior art exist: 1. there is a five to eight second delay in synchronizing the operations; 2. during recording, the sliding operation needs to be kept horizontal or vertical sliding as much as possible, and the sliding time exceeds two seconds as much as possible, otherwise, errors are easy to occur during synchronous operation.
Therefore, a method for completing the mobile phone test based on recording the mobile phone interface coordinates is designed to solve the problems.
Disclosure of Invention
The invention aims to solve the defects that the mobile phone test synchronization operation in the prior art has time delay and the operation time needs to be kept for a long time, and provides a method for completing the mobile phone test based on the recording of mobile phone interface coordinates, which aims to: the testing efficiency is improved by optimizing the mobile phone testing method.
In order to achieve the purpose, the invention adopts the following technical scheme:
a method for completing mobile phone test based on recording mobile phone interface coordinates comprises the following steps:
s1, starting USB debugging by a mobile phone, connecting a PC end with a mobile phone A, and starting a test tool by the PC end;
s2, the PC end obtains time sequence graph files of click, sliding and key events of the mobile phone A through an abd shell gettevent-t command;
s3, synchronously reading a timing chart file of the mobile phone A by the PC side through python multithreading;
s4, realizing the functions of clicking, sliding and keying through a click method, a swipe _ points method and a keyevent method in the uiautomator2 frame;
and S5, if the PC side continues to synchronously operate the mobile phone B and the mobile phone C, returning to the step S2 to continue to execute the operation, and if the PC side does not continue to synchronously operate the mobile phone B and the mobile phone C, terminating the test program by the PC side test tool.
Further, the manner of starting the USB debugging by the mobile phone is as follows: the method comprises the steps of firstly finding the system setting of the mobile phone, finding and entering system management in a setting interface, continuously clicking the version number of the mobile phone in the mobile phone interface to enter a developer mode, clicking the option of a developer in the system and an updating setting interface, and setting the USB debugging to be in an open state in the option interface of the developer.
Furthermore, the time sequence graph file is a txt text format file.
Further, in S1, the PC is connected to the mobile phone terminal a, and obtains the device ID number of the mobile phone a to be recorded and operated through the adb devices command, inputs the device ID number in the program of the PC test tool, and starts the program of the PC test tool.
Further, in S5, if the PC end continues to synchronously operate the mobile phone B and the mobile phone C, case use operation is executed on the mobile phone A, and the PC end inputs a shell get-t command through the adb-S equipment ID number to continuously acquire the step time sequence diagram file on the mobile phone A.
Further, when the shell gettent-t command is input to continuously acquire the step timing chart file on the mobile phone a, the operation on the mobile phone a is recorded and output to the program directory of the PC terminal.
Furthermore, the operation on the mobile phone a is recorded and output to the program directory of the PC side, the operation on the mobile phone a includes steps of performing clicking, sliding, and long-pressing a volume up key, and each step is started from the corresponding time ID to a point where the instruction code is 0.
Further, the meaning of the instruction code represents a mark of the start of the touch screen time, an X-axis event, a Y-axis event and a time end mark.
Furthermore, the PC side synchronously reads the sequence diagram file of the mobile phone A through python multithreading, analyzes the corresponding application type and the corresponding coordinate, realizes clicking, sliding and long-pressing of the volume up-keying event by using the click, the swap _ points and the keyence methods in the uiautomator2 framework, and synchronizes the event to the mobile phone B and the mobile phone C through the USB.
Compared with the prior art, the invention has the beneficial effects that: the method for completing the mobile phone test based on the recorded mobile phone interface coordinates can remarkably improve the mobile phone test efficiency, can synchronously operate and test a plurality of mobile phones at one time, greatly reduces delay time during synchronous operation, does not need to keep a test device in a horizontal or vertical posture and operation time during test operation, and has low synchronous operation error rate; the method has low execution operation threshold and strong usability, does not need an executive worker to have code debugging capability, and is beneficial to application and popularization.
Drawings
Fig. 1 is a schematic flow chart of a method for completing a mobile phone test based on recording mobile phone interface coordinates according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments.
The embodiment is as follows:
a method for completing mobile phone test based on recording mobile phone interface coordinates comprises the following steps:
s1, starting USB debugging by a mobile phone, connecting a PC end with a mobile phone A, and starting a test tool by the PC end;
the method for starting the USB debugging of the mobile phone is as follows: the method comprises the steps of firstly finding the system setting of the mobile phone, finding and entering system management in a setting interface, continuously clicking the version number of the mobile phone in the mobile phone interface to enter a developer mode, clicking the option of a developer in the system and an updating setting interface, and setting the USB debugging to be in an open state in the option interface of the developer.
The USB debugging mode is a function provided by Android for development work, and data can be copied between a computer and Android equipment, an application program can be installed on mobile equipment, log data can be read, and the like by using the function; by default, the USB debug mode is off, so it needs to be turned on manually; the USB debugging application is wide, and various mobile phone assistant software can be normally used only by starting a USB debugging mode when performing normal functions. The functions of software downloading, one-key root, contact person backup and the like can be carried out only when the USB debugging mode is started and the computer is connected, the USB debugging is a mode of the Android system for opening the authority of an external program, and the USB debugging mode needs to be opened if the external program needs to participate in system control.
After the PC end is connected with the mobile phone end A, the device ID number of the mobile phone A needing to be recorded and operated is obtained through an adb devices command, the mobile phone A does not need to be required to be kept in a horizontal or vertical sliding posture during sliding operation during recording, the sliding time is extremely short, the error probability during subsequent synchronous operation is low, the device ID number is input into a program of the PC end testing tool, and the program of the PC end testing tool is started.
S2, the PC side obtains time sequence graph files of clicking, sliding and key-pressing events of the mobile phone A through an abd shell get-t command, the time sequence graph files are files in a txt text format, and when the shell get-t command is input to continuously obtain the time sequence graph files in the step of the mobile phone A, the operation on the mobile phone A is recorded and output to a program directory of the PC side.
S3, the PC side synchronously reads the sequence diagram file of the mobile phone A through python multithreading: and the PC side synchronously reads the sequence diagram file of the mobile phone A through python multithreading, analyzes the corresponding application type and the corresponding coordinate, realizes clicking, sliding and long-pressing volume up-keying events by using a click method, a switch _ point method and a keyence method in a uiautomator2 framework, and synchronizes the events to the mobile phone B and the mobile phone C through a USB.
The uiautomator2 is an automatic testing open source tool, supports native application testing of an Android platform, is a Java library of automatic testing provided by Google, develops python-uiautomator2, encapsulates a uiautomator testing frame carried by Google, provides a convenient python interface, and can be used for conveniently writing a python script to realize automatic testing of apps.
And S4, realizing the functions of clicking, sliding and pressing keys by means of a click method, a swipe _ points method and a keyevent method in the uiautomator2 frame.
S5, if the PC end continues to synchronously operate the mobile phone B and the mobile phone C, directly returning to the step S2 to continue to execute the operation, executing the case operation on the mobile phone A, inputting a shell gettent-t command by the PC end through an adb-S equipment ID number to continuously acquire a step timing chart file on the mobile phone A, wherein the operation delay time is far shorter than the delay time of five to eight seconds, and almost no delay exists; and if the PC end does not continue to synchronously operate the mobile phone B and the mobile phone C, the PC end testing tool terminates the testing program.
In the above steps, the operation on the mobile phone a is recorded and output to the program directory of the PC terminal, the operation on the mobile phone a includes the steps of clicking, sliding, and long-pressing a volume up key, and each step starts from the corresponding time ID to the point where the instruction code is 0.
This embodiment takes the click step as an example:
[ 92950.167952] /dev/input/event3: 0003 0039 0000011f
[ 92950.167952] /dev/input/event3: 0003 0035 000001b9
[ 92950.167952] /dev/input/event3: 0003 0036 000002bb
......
[ 92950.195555] /dev/input/event3: 0000 0000 00000000
0039, 0035, 0036 and 0000 are instruction codes, 0039 instruction codes represent marks of the beginning of touch screen time, 0035 instruction codes represent X-axis events, 0036 instruction codes represent Y-axis events, 0000 instruction codes represent time ending marks, 000001b9 and 000002bb are coordinate values of X and Y axes respectively, and here, hexadecimal is needed to be converted into decimal, and the specific algorithm for converting the hexadecimal into the decimal is as follows:
1. first, it is understood that 16-system numbers (from right to left, the 0 th, 1 st, 2 nd bits \8230; 8230; the 0 th bit of the number is weighted to the 0 th power of 16, the 1 st bit is weighted to the 1 st power of 16, and the 2 nd bit is weighted to the 2 nd power of 16) are arranged in this order.
2. It is then to be understood that the binary digits denoted ABCDEF are 10, 11, 12, 13, 14, 15;
3. the formula for hexadecimal conversion to decimal is: each number in the binary system is multiplied by the corresponding power of 16 from right to left, and then the numbers are added.
The above 000001b9 is converted into 10-system as a calculation mode
Bit 0: 9 x 16^0=9
1 st position: b 16^1=11 ^ 16^1=176
Position 2: 1 x 16^2=256
The result is: 9+176+256=441
Similarly, the result of converting 000002bb to decimal can be calculated to be 699;
the final decimal X-axis and Y-axis coordinate values are therefore (441, 699).
The present embodiment takes the sliding step as an example:
[ 92952.686566] /dev/input/event3: 0003 0039 00000120
[ 92952.686566] /dev/input/event3: 0003 0035 000001e6
[ 92952.686566] /dev/input/event3: 0003 0036 000002b8
......
[ 92952.847786] /dev/input/event3: 0003 0035 000001e9
[ 92952.847786] /dev/input/event3: 0003 0036 000003b7
......
[ 92952.875321] /dev/input/event3: 0000 0000 00000000
the calculation method is the same as the click step, and after hexadecimal is converted into decimal, the meaning of the representation is that the coordinates are slid from (486, 696) to (489, 951) on the screen coordinates of the mobile phone.
Similarly, for a long press of a volume up key event, the instruction code 0073 means a volume up key event, the value 00000001 indicates press, and 00000000 indicates release.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art should be considered to be within the technical scope of the present invention, and the technical solutions and the inventive concepts thereof according to the present invention should be equivalent or changed within the scope of the present invention.
There is a five to eight second delay in synchronizing the operations; 2. during recording, the sliding operation needs to be kept horizontal or vertical sliding as much as possible, and the sliding time exceeds two seconds as much as possible, otherwise, errors are easy to occur during synchronous operation.

Claims (9)

1. A method for completing mobile phone test based on recording mobile phone interface coordinates is characterized by comprising the following steps:
s1, starting USB debugging by a mobile phone, connecting a PC end with a mobile phone A, and starting a test tool by the PC end;
s2, the PC end obtains time sequence graph files of click, sliding and key events of the mobile phone A through an abd shell gettevent-t command;
s3, synchronously reading a sequence diagram file of the mobile phone A by the PC side through python multithreading;
s4, realizing the functions of clicking, sliding and keying through a click method, a swipe _ points method and a keyevent method in the uiautomator2 frame;
and S5, if the PC continues to synchronously operate the mobile phone B and the mobile phone C, returning to the step S2 to continue to execute the operation, and if the PC does not continue to synchronously operate the mobile phone B and the mobile phone C any more, terminating the test program by the PC test tool.
2. The method for completing the mobile phone test based on the recorded mobile phone interface coordinates of claim 1, wherein the mobile phone starts the USB debugging in the following manner: the method comprises the steps of firstly finding the system setting of the mobile phone, finding and entering system management in a setting interface, continuously clicking the version number of the mobile phone in the mobile phone interface to enter a developer mode, clicking the option of a developer in the system and an updating setting interface, and setting the USB debugging to be in an open state in the option interface of the developer.
3. The method as claimed in claim 1, wherein the time-sequence chart file is a txt text format file.
4. The method for completing the mobile phone test based on the recorded mobile phone interface coordinates as claimed in claim 1, wherein in S1, the PC terminal is connected to the mobile phone terminal a, obtains the device ID number of the mobile phone a to be recorded and operated through an adb devices command, inputs the device ID number in the program of the PC terminal test tool, and starts the program of the PC terminal test tool.
5. The method for completing the mobile phone test based on the mobile phone interface coordinate recording of claim 1, wherein in S5, if the PC continues to synchronously operate the mobile phone B and the mobile phone C, the case operation is executed on the mobile phone a, and the PC inputs a shell get-t command to continuously obtain the step timing diagram file on the mobile phone a through an adb-S device ID number.
6. The method for completing the mobile phone test based on the recorded mobile phone interface coordinates as claimed in claim 5, wherein when the shell gettent-t command is input to continuously obtain the step timing chart file on the mobile phone A, the operation on the mobile phone A is recorded and output to the PC side program directory.
7. The method as claimed in claim 6, wherein the operations on the mobile phone a are recorded and output to the PC program directory, and the operations on the mobile phone a include steps of clicking, sliding, and long-pressing a volume up key, and each step is started from the corresponding time ID to the end where the command code is 0.
8. The method for completing mobile phone test based on recording mobile phone interface coordinates as claimed in claim 7, wherein the meaning of the command code represents a mark of touch screen time start, an X-axis event, a Y-axis event and a time end mark.
9. The method for completing the mobile phone test based on the recorded mobile phone interface coordinates is characterized in that the PC side synchronously reads a sequence diagram file of the mobile phone A through python multithreading, analyzes the corresponding application type and coordinates, realizes clicking, sliding and long-time pressing of volume up-keying events by using methods of click, switch _ points and keyence in a uiautomator2 frame, and synchronizes the events to the mobile phone B and the mobile phone C through a USB.
CN202211685707.1A 2022-12-27 2022-12-27 Method for completing mobile phone test based on recording mobile phone interface coordinates Pending CN115842884A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211685707.1A CN115842884A (en) 2022-12-27 2022-12-27 Method for completing mobile phone test based on recording mobile phone interface coordinates

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211685707.1A CN115842884A (en) 2022-12-27 2022-12-27 Method for completing mobile phone test based on recording mobile phone interface coordinates

Publications (1)

Publication Number Publication Date
CN115842884A true CN115842884A (en) 2023-03-24

Family

ID=85579317

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211685707.1A Pending CN115842884A (en) 2022-12-27 2022-12-27 Method for completing mobile phone test based on recording mobile phone interface coordinates

Country Status (1)

Country Link
CN (1) CN115842884A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104407980A (en) * 2014-12-17 2015-03-11 用友软件股份有限公司 Mobile application automated testing device and method
CN104461894A (en) * 2014-12-17 2015-03-25 用友软件股份有限公司 Android App operating recording device and method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104407980A (en) * 2014-12-17 2015-03-11 用友软件股份有限公司 Mobile application automated testing device and method
CN104461894A (en) * 2014-12-17 2015-03-25 用友软件股份有限公司 Android App operating recording device and method

Similar Documents

Publication Publication Date Title
CN102521118B (en) Automatic testing method of Android program
CN101175284A (en) Function testing method of portable electronic apparatus
US8797338B2 (en) Platform agnostic screen capture tool
CN105824755A (en) Automation test method, automation test device and mobile terminal
CN103019721B (en) The implementation method of automation mechanized operation and mobile terminal
JP2008293486A (en) Source code analysis device, analysis program, and analysis method
CN111723002A (en) Code debugging method and device, electronic equipment and storage medium
US8230206B2 (en) Bios parameter erasing method and apparatus applied to computer system
CN110688305B (en) Test environment synchronization method, device, medium and electronic equipment
CN115842884A (en) Method for completing mobile phone test based on recording mobile phone interface coordinates
CN110888656B (en) Multifunctional programming device and programming method
CN110703948B (en) Touch screen operation recording and broadcasting system and method
RU2566966C2 (en) Method and device for keystroke acceleration
CN116541032A (en) Data burning method, device, equipment and computer storage medium
CN110659036A (en) Method and system for automatically burning Google key in Windows system
CN110750310A (en) Binary and source code switching method based on IOS system componentization development
JP5204343B1 (en) Test system and program
CN111258875A (en) Interface test method and system, electronic device and storage medium
CN111596203B (en) Chip testing device, platform and method
CN111026651B (en) Test method, device, storage medium and electronic equipment
CN115494369A (en) Chip testing device
CN110851332A (en) Log file processing method, device, equipment and medium
CN114385500A (en) Serial port based test automation method and electronic equipment
CN111562956B (en) Theme switching method and device for terminal, storage medium and electronic equipment
JP6911082B2 (en) How to generate scripts for mobile terminals based on actual use with status information

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