CN104820565A - Method and terminal for processing sliding operation instruction - Google Patents

Method and terminal for processing sliding operation instruction Download PDF

Info

Publication number
CN104820565A
CN104820565A CN201410849519.7A CN201410849519A CN104820565A CN 104820565 A CN104820565 A CN 104820565A CN 201410849519 A CN201410849519 A CN 201410849519A CN 104820565 A CN104820565 A CN 104820565A
Authority
CN
China
Prior art keywords
terminal
slide
point coordinate
mouse
coordinate
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.)
Granted
Application number
CN201410849519.7A
Other languages
Chinese (zh)
Other versions
CN104820565B (en
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201410849519.7A priority Critical patent/CN104820565B/en
Publication of CN104820565A publication Critical patent/CN104820565A/en
Application granted granted Critical
Publication of CN104820565B publication Critical patent/CN104820565B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The present invention discloses a method for processing a sliding operation instruction. The method for processing the sliding operation instruction comprises the following steps: when a first terminal receives a graphical interface, which is sent by a second terminal and is dipalyed when a to-be-tested application is run, displaying the graphical interface through a webpage; when a press-down instruction of a mouse is detected, setting, by the first terminal, current coordinate information of the mouse as start point coordinates; detecting, by the first terminal, whether the mouse is released in real time; when it is detected that the mouse is released, setting, by the first terminal, the current coordinate information of the mouse as end point coordinates; generating, by the first terminal, a sliding operation instruction according to the start point coordinates and the end point coordinates, and sending the sliding operation instruction to the second terminal, such that the second terminal tests the to-be-tested application according to the sliding operation instruction. The present invention further discloses a terminal for processing a sliding operation instruction. According to the method and the terminal for processing a sliding operation instruction provided by the present invention, the sliding operation instruction is input through the webpage and is issued, and difficulties in the application test are reduced.

Description

Slide command processing method and terminal
Technical field
The present invention relates to application testing technical field, particularly relate to slide command processing method and terminal.
Background technology
At present, smart machine adopts usually automatized script and recording and playback carry out application compatibility test, the code that this testing scheme must rely on application to write operates, and therefore higher to the requirement of test, the difficulty of test is larger.
Foregoing, only for auxiliary understanding technical scheme of the present invention, does not represent and admits that foregoing is prior art.
Summary of the invention
Fundamental purpose of the present invention is to provide a kind of slide command processing method and terminal, is intended to realize by the instruction of webpage input slide, and line slip operational order of going forward side by side issues, and reduces the difficulty of application testing.
For achieving the above object, a kind of slide command processing method provided by the invention comprises the following steps:
When first terminal receives the graphical interfaces shown by operation application to be tested of the second terminal transmission, by graphical interfaces described in web displaying;
When detect mouse by when giving an order, coordinate information current for mouse is set to starting point coordinate by described first terminal;
Whether described first terminal detecting real-time mouse is released;
When detecting mouse and being released, coordinate information current for mouse is set to terminal point coordinate by described first terminal;
Described first terminal generates slide instruction according to described starting point coordinate and terminal point coordinate and is sent to described second terminal, tests according to described slide instruction for described second terminal to described application to be tested.
Preferably, when described first terminal receives the graphical interfaces of the second terminal operating application to be tested, by also comprising before graphical interfaces described in web displaying:
Described first terminal obtains the second terminal be connected with described first terminal;
The described second terminal distribution uniquely identified port numbers that each gets by described first terminal;
Described first terminal selects the application to be tested obtained to be sent to described second terminal according to described port numbers by being entered predetermined directory by webpage, installs to control described second terminal and runs described application to be tested.
Preferably, describedly generate slide instruction according to starting point coordinate and terminal point coordinate and be sent to described second terminal and comprise:
According to the resolution of the resolution of the graphical interfaces of starting point coordinate, terminal point coordinate, described web displaying and the graphical interfaces of described second terminal demonstration, determine the direction of slide, origin coordinates and termination coordinate;
Generate described slide instruction according to the direction of described slide, origin coordinates and termination coordinate according to preset method, and described slide instruction is sent to the second corresponding terminal, perform corresponding slide to control the second terminal.
Preferably, described starting point coordinate is (x1, y1), and terminal point coordinate is (x2, y2);
Determine that the direction of slide comprises:
When described x1 is not equal to x2 and y1 is not equal to y2, according to size determine that described slide is horizontal slip or vertically slides; When x1 equals x2, determine that described slide is for vertically sliding; When y1 equals y2, determine that described slide is horizontal slip;
When slide is horizontal slip, determine to slide to the left or to the right according to the difference of x1 and x2;
When slide is for vertically sliding, determine to slide up or down according to the difference of y1 and y2.
Preferably, determine origin coordinates and stop coordinate to comprise:
Calculate the ratio of the resolution of the resolution of the graphical interfaces of described web displaying and the graphical interfaces of described second terminal demonstration;
Described origin coordinates is calculated according to described ratio and starting point coordinate;
Described termination coordinate is calculated according to described ratio and described terminal point coordinate.
In addition, for achieving the above object, the present invention also provides a kind of slide instruction process terminal to comprise:
Display module, for receive second terminal send operation application to be tested shown by graphical interfaces time, by graphical interfaces described in web displaying;
First arranges module, for when detect mouse by when giving an order, coordinate information current for mouse is set to starting point coordinate;
Whether detecting module, be released for detecting real-time mouse;
Second arranges module, for when detecting mouse and being released, coordinate information current for mouse is set to terminal point coordinate;
Processing module, being sent to described second terminal for generating slide instruction according to described starting point coordinate and terminal point coordinate, testing for described second terminal according to described slide instruction to described application to be tested.
Preferably, described slide instruction process terminal also comprises:
Acquisition module, for obtaining the second terminal be connected with described slide instruction process terminal;
Configuration module, for the described second terminal distribution uniquely identified port numbers each got;
Sending module, for selecting the application to be tested obtained to be sent to described second terminal according to described port numbers by being entered predetermined directory by webpage, being installed to control described second terminal and running described application to be tested.
Preferably, described processing module comprises:
Analytic unit, for the resolution of the resolution of the graphical interfaces according to starting point coordinate, terminal point coordinate, described web displaying and the graphical interfaces of described second terminal demonstration, determines the direction of slide, origin coordinates and termination coordinate;
Processing unit, described slide instruction is generated according to preset method for the direction according to described slide, origin coordinates and termination coordinate, and described slide instruction is sent to the second corresponding terminal, perform corresponding slide to control the second terminal.
Preferably, described starting point coordinate is (x1, y1), and terminal point coordinate is (x2, y2);
Described analytic unit specifically for:
When described x1 is not equal to x2 and y1 is not equal to y2, according to size determine that described slide is horizontal slip or vertically slides; When x1 equals x2, determine that described slide is for vertically sliding; When y1 equals y2, determine that described slide is horizontal slip;
When slide is horizontal slip, determine to slide to the left or to the right according to the difference of x1 and x2;
When slide is for vertically sliding, determine to slide up or down according to the difference of y1 and y2.
Preferably, analytic unit specifically for:
Calculate the ratio of the resolution of the resolution of the graphical interfaces of described web displaying and the graphical interfaces of described second terminal demonstration;
Described origin coordinates is calculated according to described ratio and starting point coordinate;
Described termination coordinate is calculated according to described ratio and described terminal point coordinate.
When the embodiment of the present invention receives the graphical interfaces of the second terminal operating application to be tested by first terminal, by graphical interfaces described in web displaying; When detect mouse by when giving an order, coordinate information current for mouse is set to starting point coordinate by described first terminal; Whether detecting real-time mouse is released; When detecting mouse and being released, coordinate information current for mouse is set to terminal point coordinate by described first terminal; Described first terminal generates slide instruction according to described starting point coordinate and terminal point coordinate and is sent to described second terminal.Thus achieve by the instruction of webpage input slide, line slip operational order of going forward side by side issues; Adopt relative to prior art and carry out slide instruction distribution by script, present invention reduces the difficulty of application testing.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of slide command processing method first embodiment of the present invention;
Fig. 2 is the schematic flow sheet of slide command processing method second embodiment of the present invention;
The refinement schematic flow sheet of slide instruction is generated in Fig. 3 slide command processing method one of the present invention embodiment;
Fig. 4 is the high-level schematic functional block diagram of slide instruction process terminal first embodiment of the present invention;
Fig. 5 is the high-level schematic functional block diagram of slide instruction process terminal second embodiment of the present invention;
Fig. 6 is the refinement high-level schematic functional block diagram of processing module in Fig. 5.
The realization of the object of the invention, functional characteristics and advantage will in conjunction with the embodiments, are described further with reference to accompanying drawing.
Embodiment
Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
The invention provides a kind of slide command processing method, with reference to Fig. 1, in one embodiment, this slide command processing method comprises:
Step S10, when first terminal receives the graphical interfaces shown by operation application to be tested of the second terminal transmission, by graphical interfaces described in web displaying;
The slide command processing method that the present embodiment provides is mainly used in the test to Mobile solution software in mobile terminal, particularly, the operational order that user inputs can be distributed to each mobile terminal.The second terminal quantity be connected with above-mentioned first terminal can be arranged according to actual needs, and in the present embodiment, above-mentioned first terminal can be PC, and above-mentioned second terminal can be mobile terminal (such as mobile phone, pad etc.).Second terminal connects by USB data line and first terminal.In the present embodiment, above-mentioned first terminal will obtain the corresponding information (type of such as mobile phone number and port numbers etc.) of the second terminal of current connection.
Above-mentioned second terminal is connected with first terminal, and after the second terminal operationally states the graphical interfaces shown by application to be tested, the graphical interfaces of display is sent to first terminal, after first terminal receives this graphic display interface, export this graphic display interface to webpage, show for webpage.
Step S20, when detect mouse by when giving an order, coordinate information current for mouse is set to starting point coordinate by described first terminal;
Step S30, whether described first terminal detecting real-time mouse is released;
Step S40, when detecting mouse and being released, coordinate information current for mouse is set to terminal point coordinate by described first terminal;
In the present embodiment, user carries out the input of slide instruction at the graphical interfaces of web displaying by mouse.Particularly, user can use the graphical interfaces that mouse webpage clicking shows, and drags mouse and move to target location under the state clicked, and then discharges clicking operation, thus the slide that analog subscriber carries out on mobile phone.Such as, when detecting user and pressing mouse, the coordinate information at record current mouse place, and current coordinate information is set to starting point coordinate; Whether detecting real-time user discharges mouse afterwards, user can drag mouse under the state pressing mouse, and after mouse is moved to target location, release mouse, now again obtain the coordinate information (i.e. the coordinate information of target location) of mouse, and the coordinate information again obtained is set to terminal point coordinate.
Step S50, described first terminal generates slide instruction according to described starting point coordinate and terminal point coordinate and is sent to described second terminal, tests according to described slide instruction for described second terminal to described application to be tested.
It should be noted that the quantity of above-mentioned second terminal can be arranged according to actual needs, do not limit further at this.In the present embodiment, after getting above-mentioned starting point coordinate and terminal point coordinate, slide instruction is formed by carrying out encapsulation according to the program of the executable operations instruction of mobile phone to it according to this starting point coordinate and terminal point coordinate, and send to the second corresponding terminal, perform this slide instruction for the second terminal.
When the embodiment of the present invention receives the graphical interfaces of the second terminal operating application to be tested by first terminal, by graphical interfaces described in web displaying; When detect mouse by when giving an order, coordinate information current for mouse is set to starting point coordinate by described first terminal; Whether detecting real-time mouse is released; When detecting mouse and being released, coordinate information current for mouse is set to terminal point coordinate by described first terminal; Described first terminal generates slide instruction according to described starting point coordinate and terminal point coordinate and is sent to described second terminal.Thus achieve by the instruction of webpage input slide, line slip operational order of going forward side by side issues; Adopt relative to prior art and carry out slide instruction distribution by script, present invention reduces the difficulty of application testing.
Further, with reference to Fig. 2, based on above-described embodiment, in the present embodiment, also comprise before above-mentioned steps S10:
Step S60, described first terminal obtains the second terminal be connected with described first terminal;
Step S70, the described second terminal distribution uniquely identified port numbers that each gets by described first terminal;
Step S80, described first terminal selects the application to be tested obtained to be sent to described second terminal according to described port numbers by being entered predetermined directory by webpage, installs to control described second terminal and runs described application to be tested.
First terminal is for computer, and the second terminal makes detailed description for mobile phone.Particularly, after mobile phone is normally connected with computer by the USB interface on computer, user can enter predetermined directory by webpage and select user to be uploaded to the application to be tested of this predetermined directory on first terminal.After user selects, based on the order of Android client service end debugging bridge funcation, debugging bridge adopts monitors the mode of designated port, allows ide on computer and mobile phone Android system Direct Communication, makes it possible to direct control and manages Android system and action command.Particularly, the mobile phone of each connection, starts a monitoring service, and Random assignment port numbers, the mobile phone that each random port numbers and access recognize is set to mapping relations one to one, and sets up according to mobile phone model and port numbers and preserve following form:
Mobile phone model Port numbers
Millet 3 4008
Huawei P7 3536
Hammer T1 7676
…… ……
Samsung Glaxy S4 9999
Then whether Real-Time Monitoring receives application transport instruction to be tested, when monitoring this transfer instruction, catalogue can be uploaded from the acquiescence of computer, the Files.copyFile method of JAVA programming language is used to be copied to the assigned catalogue of mobile phone, the user interface robotization framework of then initialization Android native applications, carry out corresponding application to be tested is installed, directly can run the application to be tested of having installed after installation is complete.After all mobile phones are all installed and run this application to be tested, by this application graph of a correspondence interface to be tested of operation receiving a preset mobile phone and send, and control this graphical interfaces and show on webpage.
Further, with reference to Fig. 3, based on above-described embodiment, in the present embodiment, above-mentioned steps S50 comprises:
Step S51, according to the resolution of the resolution of the graphical interfaces of starting point coordinate, terminal point coordinate, described web displaying and the graphical interfaces of described second terminal demonstration, determines the direction of slide, origin coordinates and termination coordinate;
Step S52, described slide instruction is generated according to preset method according to the direction of described slide, origin coordinates and termination coordinate, and described slide instruction is sent to the second corresponding terminal, perform corresponding slide to control the second terminal.
In the present embodiment, above-mentioned starting point coordinate is (x1, y1), and terminal point coordinate is (x2, y2);
Determine that the direction of slide comprises:
When described x1 is not equal to x2 and y1 is not equal to y2, according to size determine that described slide is horizontal slip or vertically slides; When x1 equals x2, determine that described slide is for vertically sliding; When y1 equals y2, determine that described slide is horizontal slip;
When slide is horizontal slip, determine to slide to the left or to the right according to the difference of x1 and x2;
When slide is for vertically sliding, determine to slide up or down according to the difference of y1 and y2.
Determine origin coordinates and stop coordinate to comprise:
Calculate the ratio of the resolution of the resolution of the graphical interfaces of described web displaying and the graphical interfaces of described second terminal demonstration;
Described origin coordinates is calculated according to described ratio and starting point coordinate;
Calculate according to described ratio and described terminal point coordinate and stop coordinate.
It should be noted that above-mentioned horizontal direction and vertical direction not spatially upper and lower, is that display plane sets up vertical coordinate system (orthogonal x-axis and y-axis) with graphical interfaces in the present embodiment; Wherein x-axis represents horizontal direction, and y-axis is expressed as vertical direction, slides as to slide to the right along x-axis forward, slides as to slide left along x-axis negative sense, slides as slide downward, slide as upward sliding along y-axis negative sense along y-axis forward.
In the present embodiment, when x1 is not equal to x2 and y1 is not equal to y2, can according to tan calculate the deflection angle [alpha] of starting point coordinate and terminal point coordinate when being partial to angle and being more than or equal to 45 degree, then can be defined as vertically sliding; When being partial to angle and being less than 45 degree, then can be defined as sliding in the horizontal direction.When slide is horizontal slip, if x2-x1>0, then assert that mouse slides to the right, if x2-x1<0, then assert that mouse slides left.When slide is for vertically sliding, if y2-y1>0, then assert mouse slide downward, if y2-y1<0, then assert mouse upward sliding.
The resolution corresponding due to different mobile phone is different, in order to realize the application distribution of different mobile phone, in the present embodiment, the relative coordinate values in each second terminal can be positioned at according to the ratio calculating mouse position of the resolution at display graphics interface on the resolution of the graphical interfaces of each second terminal demonstration and webpage, namely above-mentioned starting point coordinate corresponds to the relative coordinate in the second terminal is above-mentioned origin coordinates, and the relative coordinate that above-mentioned terminal point coordinate corresponds in the second terminal is above-mentioned termination coordinate.The resolution of the graphical interfaces such as shown on webpage is 300*500, and the resolution of the graphical interfaces that mobile phone shows is 150*250; If above-mentioned starting point coordinate is (100,200), terminal point coordinate is (150,300); Then can calculate and obtain above-mentioned origin coordinates for (50,100), stopping coordinate is (75,150).
It should be noted that in the present embodiment, complete slide by down, move, up method of program command TouchActions.Wherein the effect of each method and parameter as shown in the table:
The above-mentioned direction according to slide, origin coordinates and termination coordinate generate described slide instruction according to preset method and are specially and generate corresponding slide instruction for parameter according to down, move, up method with the direction of slide, origin coordinates and termination coordinate, perform this slide instruction to control the second terminal.
The present invention also provides a kind of slide instruction process terminal, and with reference to Fig. 4, in one embodiment, slide instruction process terminal provided by the invention comprises:
Display module 100, for receive second terminal send operation application to be tested shown by graphical interfaces time, by graphical interfaces described in web displaying;
The operational order that user inputs, mainly to the test of Mobile solution software, particularly, can be distributed to each mobile terminal by the slide instruction process terminal that the present embodiment provides.The second terminal quantity be connected with above-mentioned slide instruction process terminal can be arranged according to actual needs, in the present embodiment, above-mentioned slide instruction process terminal can be PC, and above-mentioned second terminal can be mobile terminal (such as mobile phone, pad etc.).Second terminal connects by USB data line and slide instruction process terminal.In the present embodiment, above-mentioned first terminal will obtain the corresponding information (type of such as mobile phone number and port numbers etc.) of the second terminal of current connection.The slide instruction process terminal that it should be noted that the present embodiment is above-mentioned first terminal.
Above-mentioned second terminal is connected with slide instruction process terminal, and after the second terminal operationally states the graphical interfaces shown by application to be tested, the graphical interfaces of display is sent to slide instruction process terminal, after slide instruction process terminal receives this graphic display interface, export this graphic display interface to webpage, show for webpage.
First arranges module 200, for when detect mouse by when giving an order, coordinate information current for mouse is set to starting point coordinate;
Whether detecting module 300, be released for detecting real-time mouse;
Second arranges module 400, for when detecting mouse and being released, coordinate information current for mouse is set to terminal point coordinate;
In the present embodiment, user carries out the input of slide instruction at the graphical interfaces of web displaying by mouse.Particularly, user can use the graphical interfaces that mouse webpage clicking shows, and drags mouse and move to target location under the state clicked, and then discharges clicking operation, thus the slide that analog subscriber carries out on mobile phone.Such as, when detecting user and pressing mouse, the coordinate information at record current mouse place, and current coordinate information is set to starting point coordinate; Whether detecting real-time user discharges mouse afterwards, user can drag mouse under the state pressing mouse, and after mouse is moved to target location, release mouse, now again obtain the coordinate information (i.e. the coordinate information of target location) of mouse, and the coordinate information again obtained is set to terminal point coordinate.
Processing module 500, being sent to described second terminal for generating slide instruction according to described starting point coordinate and terminal point coordinate, testing for described second terminal according to described slide instruction to described application to be tested.
It should be noted that the quantity of above-mentioned second terminal can be arranged according to actual needs, do not limit further at this.In the present embodiment, after getting above-mentioned starting point coordinate and terminal point coordinate, slide instruction is formed by carrying out encapsulation according to the program of the executable operations instruction of mobile phone to it according to this starting point coordinate and terminal point coordinate, and send to the second corresponding terminal, perform this slide instruction for the second terminal.
When the embodiment of the present invention receives the graphical interfaces of the second terminal operating application to be tested by slide instruction process terminal, by graphical interfaces described in web displaying; When detect mouse by when giving an order, coordinate information current for mouse is set to starting point coordinate by described slide instruction process terminal; Whether detecting real-time mouse is released; When detecting mouse and being released, coordinate information current for mouse is set to terminal point coordinate by described slide instruction process terminal; Described slide instruction process terminal generates slide instruction according to described starting point coordinate and terminal point coordinate and is sent to described second terminal.Thus achieve by the instruction of webpage input slide, line slip operational order of going forward side by side issues; Adopt relative to prior art and carry out slide instruction distribution by script, present invention reduces the difficulty of application testing.
Further, with reference to Fig. 5, based on above-described embodiment, in the present embodiment, above-mentioned slide instruction process terminal also comprises:
Acquisition module 600, for obtaining the second terminal be connected with described slide instruction process terminal;
Configuration module 700, for the described second terminal distribution uniquely identified port numbers each got;
Sending module 800, for selecting the application to be tested obtained to be sent to described second terminal according to described port numbers by being entered predetermined directory by webpage, being installed to control described second terminal and running described application to be tested.
Slide instruction process terminal is for computer, and the second terminal makes detailed description for mobile phone.Particularly, after mobile phone is normally connected with computer by the USB interface on computer, user can enter predetermined directory by webpage and select user to be uploaded to the application to be tested of this predetermined directory in slide instruction process terminal.After user selects, based on the order of Android client service end debugging bridge funcation, debugging bridge adopts monitors the mode of designated port, allows ide on computer and mobile phone Android system Direct Communication, makes it possible to direct control and manages Android system and action command.Particularly, the mobile phone of each connection, starts a monitoring service, and Random assignment port numbers, the mobile phone that each random port numbers and access recognize is set to mapping relations one to one, and sets up according to mobile phone model and port numbers and preserve following form:
Mobile phone model Port numbers
Millet 3 4008
Huawei P7 3536
Hammer T1 7676
…… ……
Samsung Glaxy S4 9999
Then whether Real-Time Monitoring receives application transport instruction to be tested, when monitoring this transfer instruction, catalogue can be uploaded from the acquiescence of computer, the Files.copyFile method of JAVA programming language is used to be copied to the assigned catalogue of mobile phone, the user interface robotization framework of then initialization Android native applications, carry out corresponding application to be tested is installed, directly can run the application to be tested of having installed after installation is complete.After all mobile phones are all installed and run this application to be tested, by this application graph of a correspondence interface to be tested of operation receiving a preset mobile phone and send, and control this graphical interfaces and show on webpage.
Further, with reference to Fig. 6, based on above-described embodiment, in the present embodiment, above-mentioned processing module 500 comprises:
Analytic unit 501, for the resolution of the resolution of the graphical interfaces according to starting point coordinate, terminal point coordinate, described web displaying and the graphical interfaces of described second terminal demonstration, determines the direction of slide, origin coordinates and termination coordinate;
Processing unit 502, described slide instruction is generated according to preset method for the direction according to described slide, origin coordinates and termination coordinate, and described slide instruction is sent to the second corresponding terminal, perform corresponding slide to control the second terminal.
In the present embodiment, above-mentioned starting point coordinate is (x1, y1), and terminal point coordinate is (x2, y2);
Described analytic unit 501 specifically for:
When described x1 is not equal to x2 and y1 is not equal to y2, according to size determine that described slide is horizontal slip or vertically slides; When x1 equals x2, determine that described slide is for vertically sliding; When y1 equals y2, determine that described slide is horizontal slip;
When slide is horizontal slip, determine to slide to the left or to the right according to the difference of x1 and x2;
When slide is for vertically sliding, determine to slide up or down according to the difference of y1 and y2.
Above-mentioned analytic unit 501 concrete also for:
Calculate the ratio of the resolution of the resolution of the graphical interfaces of described web displaying and the graphical interfaces of described second terminal demonstration;
Described origin coordinates is calculated according to described ratio and starting point coordinate;
Described termination coordinate is calculated according to described ratio and described terminal point coordinate.
It should be noted that above-mentioned horizontal direction and vertical direction not spatially upper and lower, is that display plane sets up vertical coordinate system (orthogonal x-axis and y-axis) with graphical interfaces in the present embodiment; Wherein x-axis represents horizontal direction, and y-axis is expressed as vertical direction, slides as to slide to the right along x-axis forward, slides as to slide left along x-axis negative sense, slides as slide downward, slide as upward sliding along y-axis negative sense along y-axis forward.
In the present embodiment, when x1 is not equal to x2 and y1 is not equal to y2, can according to tan calculate the deflection angle [alpha] of starting point coordinate and terminal point coordinate when being partial to angle and being more than or equal to 45 degree, then can be defined as vertically sliding; When being partial to angle and being less than 45 degree, then can be defined as sliding in the horizontal direction.When slide is horizontal slip, if x2-x1>0, then assert that mouse slides to the right, if x2-x1<0, then assert that mouse slides left.When slide is for vertically sliding, if y2-y1>0, then assert mouse slide downward, if y2-y1<0, then assert mouse upward sliding.
The resolution corresponding due to different mobile phone is different, in order to realize the application distribution of different mobile phone, in the present embodiment, the relative coordinate values in each second terminal can be positioned at according to the ratio calculating mouse position of the resolution at display graphics interface on the resolution of the graphical interfaces of each second terminal demonstration and webpage, namely above-mentioned starting point coordinate corresponds to the relative coordinate in the second terminal is above-mentioned origin coordinates, and the relative coordinate that above-mentioned terminal point coordinate corresponds in the second terminal is above-mentioned termination coordinate.The resolution of the graphical interfaces such as shown on webpage is 300*500, and the resolution of the graphical interfaces that mobile phone shows is 150*250; If above-mentioned starting point coordinate is (100,200), terminal point coordinate is (150,300); Then can calculate and obtain above-mentioned origin coordinates for (50,100), stopping coordinate is (75,150).
It should be noted that in the present embodiment, complete slide by down, move, up method of program command TouchActions.Wherein the effect of each method and parameter as shown in the table:
The above-mentioned direction according to slide, origin coordinates and termination coordinate generate described slide instruction according to preset method and are specially and generate corresponding slide instruction for parameter according to down, move, up method with the direction of slide, origin coordinates and termination coordinate, perform this slide instruction to control the second terminal.
These are only the preferred embodiments of the present invention; not thereby the scope of the claims of the present invention is limited; every utilize instructions of the present invention and accompanying drawing content to do equivalent structure or equivalent flow process conversion; or be directly or indirectly used in other relevant technical fields, be all in like manner included in scope of patent protection of the present invention.

Claims (10)

1. a slide command processing method, is characterized in that, described slide command processing method comprises the following steps:
When first terminal receives the graphical interfaces shown by operation application to be tested of the second terminal transmission, by graphical interfaces described in web displaying;
When detect mouse by when giving an order, coordinate information current for mouse is set to starting point coordinate by described first terminal;
Whether described first terminal detecting real-time mouse is released;
When detecting mouse and being released, coordinate information current for mouse is set to terminal point coordinate by described first terminal;
Described first terminal generates slide instruction according to described starting point coordinate and terminal point coordinate and is sent to described second terminal, tests according to described slide instruction for described second terminal to described application to be tested.
2. slide command processing method as claimed in claim 1, is characterized in that, when described first terminal receives the graphical interfaces of the second terminal operating application to be tested, by also comprising before graphical interfaces described in web displaying:
Described first terminal obtains the second terminal be connected with described first terminal;
The described second terminal distribution uniquely identified port numbers that each gets by described first terminal;
Described first terminal selects the application to be tested obtained to be sent to described second terminal according to described port numbers by being entered predetermined directory by webpage, installs to control described second terminal and runs described application to be tested.
3. slide command processing method as claimed in claim 2, is characterized in that, describedly generates slide instruction according to starting point coordinate and terminal point coordinate and is sent to described second terminal and comprises:
According to the resolution of the resolution of the graphical interfaces of starting point coordinate, terminal point coordinate, described web displaying and the graphical interfaces of described second terminal demonstration, determine the direction of slide, origin coordinates and termination coordinate;
Generate described slide instruction according to the direction of described slide, origin coordinates and termination coordinate according to preset method, and described slide instruction is sent to the second corresponding terminal, perform corresponding slide to control the second terminal.
4. slide command processing method as claimed in claim 3, it is characterized in that, described starting point coordinate is (x1, y1), and terminal point coordinate is (x2, y2);
Determine that the direction of slide comprises:
When described x1 is not equal to x2 and y1 is not equal to y2, according to size determine that described slide is horizontal slip or vertically slides; When x1 equals x2, determine that described slide is for vertically sliding; When y1 equals y2, determine that described slide is horizontal slip;
When slide is horizontal slip, determine to slide to the left or to the right according to the difference of x1 and x2;
When slide is for vertically sliding, determine to slide up or down according to the difference of y1 and y2.
5. slide command processing method as claimed in claim 3, is characterized in that, determines origin coordinates and stop coordinate to comprise:
Calculate the ratio of the resolution of the resolution of the graphical interfaces of described web displaying and the graphical interfaces of described second terminal demonstration;
Described origin coordinates is calculated according to described ratio and starting point coordinate;
Described termination coordinate is calculated according to described ratio and described terminal point coordinate.
6. a slide instruction process terminal, is characterized in that, described slide instruction process terminal comprises:
Display module, for receive second terminal send operation application to be tested shown by graphical interfaces time, by graphical interfaces described in web displaying;
First arranges module, for when detect mouse by when giving an order, coordinate information current for mouse is set to starting point coordinate;
Whether detecting module, be released for detecting real-time mouse;
Second arranges module, for when detecting mouse and being released, coordinate information current for mouse is set to terminal point coordinate;
Processing module, being sent to described second terminal for generating slide instruction according to described starting point coordinate and terminal point coordinate, testing for described second terminal according to described slide instruction to described application to be tested.
7. slide instruction process terminal as claimed in claim 6, it is characterized in that, described slide instruction process terminal also comprises:
Acquisition module, for obtaining the second terminal be connected with described slide instruction process terminal;
Configuration module, for the described second terminal distribution uniquely identified port numbers each got;
Sending module, for selecting the application to be tested obtained to be sent to described second terminal according to described port numbers by being entered predetermined directory by webpage, being installed to control described second terminal and running described application to be tested.
8. slide instruction process terminal as claimed in claim 7, it is characterized in that, described processing module comprises:
Analytic unit, for the resolution of the resolution of the graphical interfaces according to starting point coordinate, terminal point coordinate, described web displaying and the graphical interfaces of described second terminal demonstration, determines the direction of slide, origin coordinates and termination coordinate;
Processing unit, described slide instruction is generated according to preset method for the direction according to described slide, origin coordinates and termination coordinate, and described slide instruction is sent to the second corresponding terminal, perform corresponding slide to control the second terminal.
9. slide command processing method as claimed in claim 8, it is characterized in that, described starting point coordinate is (x1, y1), and terminal point coordinate is (x2, y2);
Described analytic unit specifically for:
When described x1 is not equal to x2 and y1 is not equal to y2, according to size determine that described slide is horizontal slip or vertically slides; When x1 equals x2, determine that described slide is for vertically sliding; When y1 equals y2, determine that described slide is horizontal slip;
When slide is horizontal slip, determine to slide to the left or to the right according to the difference of x1 and x2;
When slide is for vertically sliding, determine to slide up or down according to the difference of y1 and y2.
10. slide instruction process terminal as claimed in claim 8, is characterized in that, analytic unit specifically for:
Calculate the ratio of the resolution of the resolution of the graphical interfaces of described web displaying and the graphical interfaces of described second terminal demonstration;
Described origin coordinates is calculated according to described ratio and starting point coordinate;
Described termination coordinate is calculated according to described ratio and described terminal point coordinate.
CN201410849519.7A 2014-12-30 2014-12-30 Slide command processing method and terminal Active CN104820565B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410849519.7A CN104820565B (en) 2014-12-30 2014-12-30 Slide command processing method and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410849519.7A CN104820565B (en) 2014-12-30 2014-12-30 Slide command processing method and terminal

Publications (2)

Publication Number Publication Date
CN104820565A true CN104820565A (en) 2015-08-05
CN104820565B CN104820565B (en) 2018-09-04

Family

ID=53730873

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410849519.7A Active CN104820565B (en) 2014-12-30 2014-12-30 Slide command processing method and terminal

Country Status (1)

Country Link
CN (1) CN104820565B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107025158A (en) * 2017-04-28 2017-08-08 努比亚技术有限公司 A kind of slide method of testing, device and terminal
CN107368249A (en) * 2017-06-21 2017-11-21 维沃移动通信有限公司 A kind of touch control operation recognition methods, device and mobile terminal
CN108089953A (en) * 2016-11-21 2018-05-29 阿瓦亚公司 User interface function is tested by the actuating of piezoelectricity grid
CN109508219A (en) * 2018-11-09 2019-03-22 周鹏飞 It instructs and determines method, apparatus and touch apparatus
CN109670292A (en) * 2018-12-12 2019-04-23 北京云测信息技术有限公司 A kind of ios device gesture operation implementation method for prototype test
CN110007164A (en) * 2019-03-21 2019-07-12 岭南师范学院 A kind of mouse track device for detecting performance based on delta parallel-connection structure

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060168531A1 (en) * 2005-01-21 2006-07-27 Canon Kabushiki Kaisha Information processing apparatus and method for controlling the same
CN102609192A (en) * 2012-01-17 2012-07-25 华为终端有限公司 Mobile terminal operating method by computer and mobile terminal
CN102722282A (en) * 2012-06-06 2012-10-10 青岛海信移动通信技术股份有限公司 Touch screen detection method and electronic products
CN104239761A (en) * 2014-09-15 2014-12-24 西安交通大学 Continuous identity authentication method based on touch screen slip behavior characteristics

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060168531A1 (en) * 2005-01-21 2006-07-27 Canon Kabushiki Kaisha Information processing apparatus and method for controlling the same
CN102609192A (en) * 2012-01-17 2012-07-25 华为终端有限公司 Mobile terminal operating method by computer and mobile terminal
CN102722282A (en) * 2012-06-06 2012-10-10 青岛海信移动通信技术股份有限公司 Touch screen detection method and electronic products
CN104239761A (en) * 2014-09-15 2014-12-24 西安交通大学 Continuous identity authentication method based on touch screen slip behavior characteristics

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108089953A (en) * 2016-11-21 2018-05-29 阿瓦亚公司 User interface function is tested by the actuating of piezoelectricity grid
CN107025158A (en) * 2017-04-28 2017-08-08 努比亚技术有限公司 A kind of slide method of testing, device and terminal
CN107025158B (en) * 2017-04-28 2020-12-18 南京投知科技有限公司 Sliding operation testing method and device and terminal
CN107368249A (en) * 2017-06-21 2017-11-21 维沃移动通信有限公司 A kind of touch control operation recognition methods, device and mobile terminal
CN109508219A (en) * 2018-11-09 2019-03-22 周鹏飞 It instructs and determines method, apparatus and touch apparatus
CN109670292A (en) * 2018-12-12 2019-04-23 北京云测信息技术有限公司 A kind of ios device gesture operation implementation method for prototype test
CN110007164A (en) * 2019-03-21 2019-07-12 岭南师范学院 A kind of mouse track device for detecting performance based on delta parallel-connection structure

Also Published As

Publication number Publication date
CN104820565B (en) 2018-09-04

Similar Documents

Publication Publication Date Title
CN104820565A (en) Method and terminal for processing sliding operation instruction
KR102167879B1 (en) Test methods, systems, devices and readable storage media
CN108763086B (en) Script recording method, terminal and computer readable storage medium based on remote true machine
CN108959068B (en) Software interface testing method, device and storage medium
CN104331373A (en) Monkey test system and method
CN106649107B (en) Automatic testing method and device for stability of android system
CN107608609B (en) Event object sending method and device
CN103914375A (en) Method and device for testing owner-drawing interface software
CN111651366A (en) SDK test method, device, equipment and storage medium
CN103455403B (en) Method of testing and device
CN102830997A (en) Method, device and equipment for controlling plug-in installation
CN110490523B (en) Stock list generation method and device and electronic equipment
CN113282488B (en) Terminal test method and device, storage medium and terminal
CN105354138A (en) Method for determining specific control attribute of mobile phone page
MY189464A (en) Smart card read/write methods and apparatus
CN105653438A (en) Method and device for cross-process automated testing of Android device
CN104951380B (en) A kind of test method and system for being used to test online product
CN103902580A (en) Method and device for dragging multiple elements in webpage
CN105138463A (en) Testing method and system for mobile terminal software
CN109840201B (en) UI test method, device, electronic equipment and computer readable storage medium
CN107102937B (en) User interface testing method and device
CN103914212B (en) A kind of terminal device and its application configuration method
CN105808073A (en) Application operation instruction distribution method and terminal
CN105808419A (en) Application test method and terminal
CN106843975B (en) Method and device for extending HTML5 application function

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant