CN109871172B - Mouse clicking method and device in automatic test and readable storage medium - Google Patents

Mouse clicking method and device in automatic test and readable storage medium Download PDF

Info

Publication number
CN109871172B
CN109871172B CN201910064281.XA CN201910064281A CN109871172B CN 109871172 B CN109871172 B CN 109871172B CN 201910064281 A CN201910064281 A CN 201910064281A CN 109871172 B CN109871172 B CN 109871172B
Authority
CN
China
Prior art keywords
desktop
click
window
percentage
clicking
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.)
Active
Application number
CN201910064281.XA
Other languages
Chinese (zh)
Other versions
CN109871172A (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.)
Guangzhou Jiesai Communication Planning And Design Institute Co ltd
GCI Science and Technology Co Ltd
Original Assignee
Guangzhou Jiesai Communication Planning And Design Institute Co ltd
GCI Science and 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 Guangzhou Jiesai Communication Planning And Design Institute Co ltd, GCI Science and Technology Co Ltd filed Critical Guangzhou Jiesai Communication Planning And Design Institute Co ltd
Priority to CN201910064281.XA priority Critical patent/CN109871172B/en
Publication of CN109871172A publication Critical patent/CN109871172A/en
Application granted granted Critical
Publication of CN109871172B publication Critical patent/CN109871172B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses a mouse clicking method, a mouse clicking device and a readable storage medium in an automatic test, which comprise the following steps: responding to a mouse clicking instruction, and acquiring clicking position data; the preset click position data comprises a second window click position and position percentage thereof, a second desktop click position and position percentage thereof, and a position and percentage of a second window on the desktop; when the current click position data is verified to be inconsistent with the preset click position data, the preset click position data is calculated according to the current click position data to obtain the actual click position data, and the click operation is executed according to the actual click position data, so that the occurrence of mouse invalid click and error click events during playback of an automatic test can be effectively reduced.

Description

Mouse clicking method and device in automatic test and readable storage medium
Technical Field
The invention relates to the technical field of automatic testing, in particular to a mouse clicking method and device in automatic testing and a readable storage medium.
Background
With the increase of the scale and complexity of software systems, the role of software testing in software development is more and more important, and the enhancement and simplification of software testing are more beneficial to the improvement of software quality. Typically, after a test case is designed and passes review, the test is performed step by a tester according to the procedures described in the test case, resulting in a comparison of the actual results with the expected results. In the process, in order to save manpower, time or hardware resources and improve the testing efficiency, an automatic testing concept is introduced; i.e. a process that translates human-driven test behavior into machine execution. The software testing automation is more and more important in the software testing, the automatic testing is one of the important ways for reducing the testing cost, and meanwhile, the software testing automation system has advantages in the aspects of automation degree, testing coverage rate, testing cost and the like.
In the existing several related automatic testing tools or mouse automatic clicking tools, the clicking position of the mouse is determined to be a single reference object (based on the desktop), and when the size of the desktop changes or the position of a pop-up window changes, the conditions of invalid clicking, wrong clicking and the like can occur when a manufactured script is played back.
Disclosure of Invention
The embodiment of the invention provides a mouse clicking method and device in an automatic test and a readable storage medium, which can effectively reduce the occurrence of mouse invalid clicking and wrong clicking events during playback of an automatic test script and can effectively improve the efficiency of the automatic test.
An embodiment of the present invention provides a method for mouse clicking in an automated test, including:
responding to a mouse clicking instruction, and acquiring clicking position data; the click position data comprises current click position data and preset click position data, the current click position data comprises a first window click position and position percentage thereof, a first desktop click position and position percentage thereof, and the position and percentage of a first window on the desktop, and the preset click position data comprises a second window click position and position percentage thereof, a second desktop click position and position percentage thereof, and the position and percentage of a second window on the desktop;
and when the current click position data is verified to be inconsistent with the preset click position data, calculating the preset click position data according to the current click position data to obtain actual click position data, and executing click operation according to the actual click position data.
As an improvement of the above solution, the method further includes acquiring the click position data by:
establishing a rectangular coordinate system in the desktop by taking the top point of the upper left corner of the desktop as an origin to obtain a desktop coordinate model;
inputting pre-acquired window data and desktop data into the desktop coordinate model to obtain a coordinate corresponding to the click position of the desktop and a coordinate corresponding to the position of the window on the desktop; the window data comprise the width and the height of the window and the window clicking position, and the desktop data comprise the width and the height of the desktop and the desktop clicking position;
and calculating the position percentage of the desktop clicking position and the position percentage of the window on the desktop according to the coordinate corresponding to the desktop clicking position and the coordinate corresponding to the position of the window on the desktop.
As an improvement of the above solution, the method further includes acquiring the click position data by:
establishing a rectangular coordinate system in the window by taking the top left corner vertex of the window as an origin point according to the window clicking position to obtain a window coordinate model, and determining a coordinate corresponding to the window clicking position according to the window coordinate model;
and calculating the position percentage of the window clicking position according to the corresponding coordinate of the window clicking position.
As an improvement of the above solution, the method further includes verifying whether the current click position data is consistent with the preset click position data by:
judging whether the position percentage of the click position of the first window, the position percentage of the click position of the first desktop, the percentage of the position of the first window on the desktop is consistent with the position percentage of the click position of the second window, the position percentage of the click position of the second desktop and the percentage of the position of the second window on the desktop or not; if yes, executing clicking operation according to the first window clicking position; if not, calculating the preset click position data according to the current click position data to obtain actual click position data, and executing click operation according to the actual click position data.
As an improvement of the above scheme, the calculating the preset click position data according to the current click position data to obtain actual click position data, and executing a click operation according to the actual click position data specifically includes:
and performing conversion in the same proportion on the coordinate corresponding to the second desktop click position and the coordinate corresponding to the position of the second window on the desktop by adopting the desktop coordinate model according to the position percentage of the first desktop click position and the percentage of the first window on the desktop, so as to obtain the coordinate corresponding to the actual desktop click position.
As an improvement of the above scheme, the calculating the preset click position data according to the current click position data to obtain actual click position data, and executing a click operation according to the actual click position data specifically includes:
according to the percentage of the position of the first window on the desktop and the percentage of the position of the click position of the first window, carrying out conversion in the same proportion on the coordinate corresponding to the click position of the second window by adopting the window coordinate model to obtain the coordinate corresponding to the actual click position of the window;
and obtaining actual click position data according to the coordinate corresponding to the actual desktop click position and the coordinate corresponding to the actual desktop click position, and executing click operation according to the actual click position data.
Another embodiment of the present invention correspondingly provides a mouse pointing device in an automated test, including:
the data acquisition module is used for responding to a mouse click command and acquiring click position data; the click position data comprises current click position data and preset click position data, the current click position data comprises a first window click position and position percentage thereof, a first desktop click position and position percentage thereof, and the position and percentage of a first window on the desktop, and the preset click position data comprises a second window click position and position percentage thereof, a second desktop click position and position percentage thereof, and the position and percentage of a second window on the desktop;
and the clicking module is used for calculating the preset clicking position data according to the current clicking position data to obtain actual clicking position data and executing clicking operation according to the actual clicking position data when the current clicking position data is verified to be inconsistent with the preset clicking position data.
Compared with the prior art, the mouse clicking method and the device in the automatic test disclosed by the embodiment of the invention have the advantages that the clicking position data is obtained by responding to the mouse clicking instruction; the click position data comprises current click position data and preset click position data, the current click position data comprises a first window click position and position percentage thereof, a first desktop click position and position percentage thereof, and the position and percentage of a first window on the desktop, and the preset click position data comprises a second window click position and position percentage thereof, a second desktop click position and position percentage thereof, and the position and percentage of a second window on the desktop; when the current click position data is verified to be inconsistent with the preset click position data, the preset click position data is calculated according to the current click position data to obtain actual click position data, and click operation is executed according to the actual click position data, so that the occurrence of mouse invalid click and error click events during playback of the automatic test script can be effectively reduced, the effectiveness of the mouse click events is ensured, the effective execution rate of the playback script can be effectively improved, and the efficiency and the quality of automatic test can be improved.
Another embodiment of the present invention provides a mouse clicking device in an automated test, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, where the processor executes the computer program to implement the mouse clicking method in the automated test according to the embodiment of the present invention.
Another embodiment of the present invention provides a storage medium, where the computer-readable storage medium includes a stored computer program, where when the computer program runs, a device where the computer-readable storage medium is located is controlled to execute the mouse clicking method in the automated testing described in the above embodiment of the present invention.
Drawings
FIG. 1 is a flowchart illustrating a method for mouse clicking in an automated test according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a mouse pointing device in an automation test according to an embodiment of 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. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, a schematic flow chart of a mouse clicking method in an automated test according to an embodiment of the present invention is shown, including:
s11, responding to the mouse click command, and acquiring click position data; the click position data comprises current click position data and preset click position data, the current click position data comprises a first window click position and position percentage thereof, a first desktop click position and position percentage thereof, and a position of a first window on the desktop and percentage thereof, and the preset click position data comprises a second window click position and position percentage thereof, a second desktop click position and position percentage thereof, and a position of a second window on the desktop and percentage thereof.
The method comprises the following steps of obtaining click position data with a desktop as a reference system:
establishing a rectangular coordinate system in the desktop by taking the top point of the upper left corner of the desktop as an origin to obtain a desktop coordinate model;
inputting pre-acquired window data and desktop data into the desktop coordinate model to obtain a coordinate corresponding to the click position of the desktop and a coordinate corresponding to the position of the window on the desktop; the window data comprise the width and the height of the window and the window clicking position, and the desktop data comprise the width and the height of the desktop and the desktop clicking position;
and calculating the position percentage of the desktop clicking position and the position percentage of the window on the desktop according to the coordinate corresponding to the desktop clicking position and the coordinate corresponding to the position of the window on the desktop.
Acquiring click position data with a window as a reference frame by the following steps:
establishing a rectangular coordinate system in the window by taking the top left corner vertex of the window as an origin point according to the window clicking position to obtain a window coordinate model, and determining a coordinate corresponding to the window clicking position according to the window coordinate model;
and calculating the position percentage of the window clicking position according to the corresponding coordinate of the window clicking position.
It can be understood that a rectangular coordinate system is established for the positive direction of the Y axis for the vertical downward side in the desktop by taking the upper left corner of the desktop as the origin, and the side which is horizontally rightward in the desktop as the positive direction of the X axis, so as to obtain a desktop coordinate model taking the desktop as a reference system. And inputting the name, the width and the height of the window, the click position of the desktop and the width and the height of the desktop into the desktop coordinate model for coordinate positioning to obtain a coordinate corresponding to the click position of the desktop and a coordinate corresponding to the top left corner vertex of the window at the position of the desktop. And then, calculating the percentage of the obtained coordinates corresponding to the desktop clicking positions and the coordinates corresponding to the positions of the windows on the desktop to obtain the percentage of the positions of the desktop clicking positions and the percentage of the positions of the windows on the desktop. And establishing a rectangular coordinate system by taking the upper left corner of the window as an origin, the side of the window which is transversely rightward as the positive direction of the X axis and the side of the window which is vertically downward as the positive direction of the Y axis to obtain a window coordinate model by taking the window as a reference system. And inputting the window clicking position into the window coordinate model for coordinate positioning to obtain a coordinate corresponding to the window clicking position, and then calculating the percentage of the coordinate corresponding to the window clicking position to obtain the position percentage of the window clicking position. The percentage of the position of the window on the desktop is composed of an abscissa of a vertex at the upper left corner of the window divided by the width of the desktop and an ordinate of the vertex at the upper left corner of the window divided by the height of the desktop, and the percentage of the position of the window on the desktop may include a percentage of the width and the height of the window and a percentage of an absolute distance between the vertex at the upper left corner of the window and the vertex at the upper left corner of the desktop.
Further, in the playback process, the width and the height of the window, the width and the height of the desktop, and the first desktop click position which are currently acquired are input into the desktop coordinate model for coordinate positioning, so that a coordinate corresponding to the first desktop click position, the position percentage of the first desktop click position, the coordinate corresponding to the position of the first window on the desktop, and the percentage of the position of the first window on the desktop are obtained. And inputting the currently acquired first window clicking position into the window coordinate model for coordinate positioning to obtain a coordinate corresponding to the first window clicking position and the position percentage of the first window clicking position. And acquiring corresponding data recorded and stored according to the name of the current window. Preferably, in the recording process, the width and the height of the corresponding window, the width and the height of the desktop, and the second desktop click position are input into the desktop coordinate model for coordinate positioning, so as to obtain a coordinate corresponding to the second desktop click position, a position percentage of the second desktop click position, a coordinate corresponding to the position of the second window on the desktop, and a percentage of the position of the second window on the desktop. And inputting the clicking position of the second window into the window coordinate model for coordinate positioning to obtain a coordinate corresponding to the clicking position of the second window and the position percentage of the clicking position of the second window.
S12, when the current click position data is not consistent with the preset click position data, calculating the preset click position data according to the current click position data to obtain actual click position data, and executing click operation according to the actual click position data.
Preferably, it is verified whether the current click position data is consistent with the preset click position data by the following steps:
judging whether the position percentage of the click position of the first window, the position percentage of the click position of the first desktop, the percentage of the position of the first window on the desktop is consistent with the position percentage of the click position of the second window, the position percentage of the click position of the second desktop and the percentage of the position of the second window on the desktop or not; if yes, executing clicking operation according to the first window clicking position; if not, calculating the preset click position data according to the current click position data to obtain actual click position data, and executing click operation according to the actual click position data.
It should be noted that, in the script playback process, when a mouse click event is encountered, it is verified whether the absolute position percentage and the relative position percentage of the current click position are consistent with the absolute position percentage and the relative position percentage of the preset click position, where the absolute position percentage is the position percentage of the desktop click position and the position percentage of the window on the desktop, where the desktop is used as a reference frame, and the relative position percentage is the position percentage of the window click position, where the window is used as a reference frame.
In an optional embodiment, when the current click position is consistent with the absolute position percentage and the relative position percentage of the preset click position, the click operation is executed according to the current first window click position.
In an optional embodiment, when the absolute position percentage and the relative position percentage of the current click position and the preset click position are not consistent, the preset click position data is calculated according to the current click position data to obtain actual click position data, and click operation is executed according to the actual click position data. For example, when the coordinate recording of the click position is based on only a single reference system, such as a desktop or a window, the actual click position needs to be determined again, which may cause the situations of desktop width and height change and pop-up window position change during the playback process.
Further, the actual click position of the desktop is determined by taking the desktop as a reference system:
and performing conversion in the same proportion on the coordinate corresponding to the second desktop click position and the coordinate corresponding to the position of the second window on the desktop by adopting the desktop coordinate model according to the position percentage of the first desktop click position and the percentage of the first window on the desktop, so as to obtain the coordinate corresponding to the actual desktop click position.
Further, the actual click position of the window is determined by taking the window as a reference frame:
and performing same-proportion conversion on the coordinate corresponding to the click position of the second window by adopting the window coordinate model according to the percentage of the position of the first window on the desktop and the position percentage of the click position of the first window, so as to obtain the coordinate corresponding to the actual window click position.
And obtaining actual click position data according to the coordinate corresponding to the actual desktop click position and the coordinate corresponding to the actual desktop click position, and executing click operation according to the actual click position data.
For example, the position of the top left corner of the window is taken as an example, when recording, the width and the height of the desktop are 16:8, the width and the height of the window are 8:4, the coordinates of the top left corner of the window on the desktop are (2,1), and the percentage of the position of the window on the desktop is (1/8 ). When the desktop is played back, the width and the height of the desktop are 8:4, the width and the height of the window are 4:2, the percentage of the position of the window on the desktop is still (1/8 ), and the coordinate of the vertex at the upper left corner of the window on the desktop is (1,0.5) after scaling.
According to the mouse clicking method in the automatic test, provided by the embodiment of the invention, clicking position data is obtained by responding to a mouse clicking instruction; the click position data comprises current click position data and preset click position data, the current click position data comprises a first window click position and position percentage thereof, a first desktop click position and position percentage thereof, and the position and percentage of a first window on the desktop, and the preset click position data comprises a second window click position and position percentage thereof, a second desktop click position and position percentage thereof, and the position and percentage of a second window on the desktop; when the current click position data is verified to be inconsistent with the preset click position data, the preset click position data is calculated according to the current click position data to obtain actual click position data, and click operation is executed according to the actual click position data, so that the occurrence of mouse invalid click and error click events during playback of the automatic test script can be effectively reduced, the effectiveness of the mouse click events is ensured, the effective execution rate of the playback script can be effectively improved, and the efficiency and the quality of automatic test can be improved.
Referring to fig. 2, a schematic structural diagram of a mouse pointing device in an automation test according to an embodiment of the present invention is shown, including:
the data acquisition module 1 is used for responding to a mouse click command and acquiring click position data; the click position data comprises current click position data and preset click position data, the current click position data comprises a first window click position and position percentage thereof, a first desktop click position and position percentage thereof, and the position and percentage of a first window on the desktop, and the preset click position data comprises a second window click position and position percentage thereof, a second desktop click position and position percentage thereof, and the position and percentage of a second window on the desktop;
and the clicking module 2 is used for calculating the preset clicking position data according to the current clicking position data to obtain actual clicking position data and executing clicking operation according to the actual clicking position data when the current clicking position data is verified to be inconsistent with the preset clicking position data.
Preferably, the data acquisition module 1 comprises:
the desktop coordinate model building unit is used for building a rectangular coordinate system in the desktop by taking the top point of the upper left corner of the desktop as an origin to obtain a desktop coordinate model;
the desktop coordinate unit is used for inputting pre-acquired window data and desktop data into the desktop coordinate model to obtain a coordinate corresponding to the desktop clicking position and a coordinate corresponding to the position of the window on the desktop; the window data comprise the width and the height of the window and the window clicking position, and the desktop data comprise the width and the height of the desktop and the desktop clicking position;
the desktop percentage calculating unit is used for calculating the position percentage of the desktop clicking position and the position percentage of the window on the desktop according to the coordinate corresponding to the desktop clicking position and the coordinate corresponding to the position of the window on the desktop;
the window coordinate model building unit is used for building a rectangular coordinate system in the window by taking the top point of the upper left corner of the window as an origin point according to the window clicking position to obtain a window coordinate model, and determining a coordinate corresponding to the window clicking position according to the window coordinate model;
and the window percentage calculating unit is used for calculating the position percentage of the window clicking position according to the corresponding coordinate of the window clicking position.
Preferably, the click module 2 includes:
the judging unit is used for judging whether the position percentage of the first window clicking position, the position percentage of the first desktop clicking position, the percentage of the position of the first window on the desktop is consistent with the position percentage of the second window clicking position, the position percentage of the second desktop clicking position and the percentage of the position of the second window on the desktop or not; if yes, executing clicking operation according to the first window clicking position; if not, calculating the preset click position data according to the current click position data to obtain actual click position data, and executing click operation according to the actual click position data.
Preferably, the click module 2 further comprises:
the actual desktop click position calculation unit is used for carrying out conversion on the coordinate corresponding to the second desktop click position and the coordinate corresponding to the position of the second window on the desktop in the same proportion by adopting the desktop coordinate model according to the position percentage of the first desktop click position and the position percentage of the first window on the desktop, so as to obtain the coordinate corresponding to the actual desktop click position;
the actual window clicking position calculating unit is used for carrying out same-proportion conversion on the coordinate corresponding to the second window clicking position by adopting the window coordinate model according to the percentage of the position of the first window on the desktop and the position percentage of the first window clicking position so as to obtain the coordinate corresponding to the actual window clicking position;
and the clicking unit is used for obtaining actual clicking position data according to the coordinate corresponding to the actual desktop clicking position and the coordinate corresponding to the actual desktop clicking position, and executing clicking operation according to the actual clicking position data.
Referring to fig. 2, a schematic structural diagram of a mouse pointing device in an automation test according to an embodiment of the present invention is shown, including: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the mouse click method embodiments in the above-mentioned various automatic tests are implemented, for example, in step S12 shown in fig. 1, when it is verified that the current click position data is inconsistent with the preset click position data, the preset click position data is calculated according to the current click position data to obtain actual click position data, and a click operation is executed according to the actual click position data. Or, the processor implements the functions of the modules/units in the embodiments of the apparatuses when executing the computer program, for example, the click module 2 is configured to calculate the preset click position data according to the current click position data when it is verified that the current click position data is inconsistent with the preset click position data, to obtain actual click position data, and execute a click operation according to the actual click position data.
Illustratively, the computer program may be partitioned into one or more modules/units that are stored in the memory and executed by the processor to implement the invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program in the mouse pointing device under automated testing. For example, the computer program may be divided into a data acquisition module 1 and a click module 2.
The mouse clicking device in the automatic test can be a desktop computer, a notebook, a palm computer, a cloud server and other computing equipment. The mouse-clicking device in the automated test may include, but is not limited to, a processor, a memory. Those skilled in the art will appreciate that the schematic diagram is merely an example of a mouse pointing device under automated testing and does not constitute a limitation of the mouse pointing device under automated testing, and may include more or fewer components than those shown, or some components in combination, or different components, for example, the mouse pointing device under automated testing may also include input and output devices, network access devices, buses, etc.
The Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like that is the control center for the mouse pointing device under automated testing and connects the various parts of the mouse pointing device under automated testing using various interfaces and wires.
The memory may be configured to store the computer program and/or module, and the processor may implement various functions of the mouse pointing device under automated testing by executing or executing the computer program and/or module stored in the memory and invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
Wherein, the mouse click device integrated module/unit in the automatic test can be stored in a computer readable storage medium if it is realized in the form of software functional unit and sold or used as an independent product. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
It should be noted that the above-described device embodiments are merely illustrative, where the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. In addition, in the drawings of the embodiment of the apparatus provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, and may be specifically implemented as one or more communication buses or signal lines. One of ordinary skill in the art can understand and implement it without inventive effort.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.

Claims (6)

1. A mouse clicking method in an automatic test is characterized by comprising the following steps:
responding to a mouse clicking instruction, and acquiring clicking position data; the click position data comprises current click position data and preset click position data, the current click position data comprises a first window click position and position percentage thereof, a first desktop click position and position percentage thereof, and the position and percentage of a first window on the desktop, and the preset click position data comprises a second window click position and position percentage thereof, a second desktop click position and position percentage thereof, and the position and percentage of a second window on the desktop;
when the current click position data is verified to be inconsistent with the preset click position data, calculating the preset click position data according to the current click position data to obtain actual click position data, and executing click operation according to the actual click position data; verifying whether the current click position data is consistent with preset click position data or not through the following steps: judging whether the position percentage of the click position of the first window, the position percentage of the click position of the first desktop, the percentage of the position of the first window on the desktop is consistent with the position percentage of the click position of the second window, the position percentage of the click position of the second desktop and the percentage of the position of the second window on the desktop or not; if yes, executing clicking operation according to the first window clicking position; if not, calculating the preset click position data according to the current click position data to obtain actual click position data, and executing click operation according to the actual click position data; according to the position percentage of the first desktop clicking position and the position percentage of the first window on the desktop, carrying out conversion on the coordinate corresponding to the second desktop clicking position and the coordinate corresponding to the position of the second window on the desktop in the same proportion by adopting the desktop coordinate model to obtain the coordinate corresponding to the actual desktop clicking position; according to the percentage of the position of the first window on the desktop and the percentage of the position of the click position of the first window, carrying out same-proportion conversion on the coordinate corresponding to the click position of the second window by adopting the window coordinate model to obtain the coordinate corresponding to the actual click position of the window; and obtaining actual click position data according to the coordinate corresponding to the actual desktop click position and the coordinate corresponding to the actual desktop click position, and executing click operation according to the actual click position data.
2. The method of mouse clicking in an automated test according to claim 1, further comprising obtaining the click location data by:
establishing a rectangular coordinate system in the desktop by taking the top point of the upper left corner of the desktop as an origin to obtain a desktop coordinate model;
inputting pre-acquired window data and desktop data into the desktop coordinate model to obtain a coordinate corresponding to the click position of the desktop and a coordinate corresponding to the position of the window on the desktop; the window data comprise the width and the height of the window and the window clicking position, and the desktop data comprise the width and the height of the desktop and the desktop clicking position;
and calculating the position percentage of the desktop clicking position and the position percentage of the window on the desktop according to the coordinate corresponding to the desktop clicking position and the coordinate corresponding to the position of the window on the desktop.
3. The method of mouse clicking in an automated test according to claim 2, further comprising obtaining the click location data by:
establishing a rectangular coordinate system in the window by taking the top left corner vertex of the window as an origin point according to the window clicking position to obtain a window coordinate model, and determining a coordinate corresponding to the window clicking position according to the window coordinate model;
and calculating the position percentage of the window clicking position according to the corresponding coordinate of the window clicking position.
4. A mouse pointing device in an automated test, comprising:
the data acquisition module is used for responding to a mouse click command and acquiring click position data; the click position data comprises current click position data and preset click position data, the current click position data comprises a first window click position and position percentage thereof, a first desktop click position and position percentage thereof, and the position and percentage of a first window on the desktop, and the preset click position data comprises a second window click position and position percentage thereof, a second desktop click position and position percentage thereof, and the position and percentage of a second window on the desktop;
the clicking module is used for calculating the preset clicking position data according to the current clicking position data to obtain actual clicking position data and executing clicking operation according to the actual clicking position data when the current clicking position data is verified to be inconsistent with the preset clicking position data; verifying whether the current click position data is consistent with preset click position data or not through the following steps: judging whether the position percentage of the click position of the first window, the position percentage of the click position of the first desktop, the percentage of the position of the first window on the desktop is consistent with the position percentage of the click position of the second window, the position percentage of the click position of the second desktop and the percentage of the position of the second window on the desktop or not; if yes, executing clicking operation according to the first window clicking position; if not, calculating the preset click position data according to the current click position data to obtain actual click position data, and executing click operation according to the actual click position data; according to the position percentage of the first desktop clicking position and the position percentage of the first window on the desktop, carrying out conversion on the coordinate corresponding to the second desktop clicking position and the coordinate corresponding to the position of the second window on the desktop in the same proportion by adopting the desktop coordinate model to obtain the coordinate corresponding to the actual desktop clicking position; according to the percentage of the position of the first window on the desktop and the percentage of the position of the click position of the first window, carrying out same-proportion conversion on the coordinate corresponding to the click position of the second window by adopting the window coordinate model to obtain the coordinate corresponding to the actual click position of the window; and obtaining actual click position data according to the coordinate corresponding to the actual desktop click position and the coordinate corresponding to the actual desktop click position, and executing click operation according to the actual click position data.
5. A mouse-clicking device under automated testing, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, the processor implementing the mouse-clicking method under automated testing as claimed in any one of claims 1 to 3 when executing the computer program.
6. A computer-readable storage medium, comprising a stored computer program, wherein the computer program, when executed, controls an apparatus in which the computer-readable storage medium is located to perform the mouse click method in the automated test according to any one of claims 1 to 3.
CN201910064281.XA 2019-01-23 2019-01-23 Mouse clicking method and device in automatic test and readable storage medium Active CN109871172B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910064281.XA CN109871172B (en) 2019-01-23 2019-01-23 Mouse clicking method and device in automatic test and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910064281.XA CN109871172B (en) 2019-01-23 2019-01-23 Mouse clicking method and device in automatic test and readable storage medium

Publications (2)

Publication Number Publication Date
CN109871172A CN109871172A (en) 2019-06-11
CN109871172B true CN109871172B (en) 2020-09-15

Family

ID=66917875

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910064281.XA Active CN109871172B (en) 2019-01-23 2019-01-23 Mouse clicking method and device in automatic test and readable storage medium

Country Status (1)

Country Link
CN (1) CN109871172B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113555131A (en) * 2021-05-20 2021-10-26 浙江警察学院 Psychophysical testing method, apparatus and medium for rewarding motivation of drug addict
CN113391752B (en) * 2021-06-21 2023-11-14 昆明理工大学 Interaction method of touch interaction equipment based on mouse

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103678106A (en) * 2012-09-19 2014-03-26 腾讯科技(深圳)有限公司 Method and device for content recording
CN105138463A (en) * 2015-09-25 2015-12-09 成都中科创达软件有限公司 Testing method and system for mobile terminal software
US9424167B2 (en) * 2014-05-21 2016-08-23 Cgi Technologies And Solutions Inc. Automated testing of an application system
CN106095666A (en) * 2016-06-02 2016-11-09 腾讯科技(深圳)有限公司 Game automated testing method and relevant apparatus

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101242621A (en) * 2008-01-21 2008-08-13 中兴通讯股份有限公司 An automatic testing method and system based on interface
US9355015B2 (en) * 2012-09-26 2016-05-31 Dynatrace Llc Technique for simulating an orientation change event in a test environment
CN103543923B (en) * 2013-07-23 2017-08-08 Tcl集团股份有限公司 The click event-handling method and system of control
CN104849576B (en) * 2014-02-13 2018-06-22 广东小天才科技有限公司 A kind of automatization test system and test method
CN105022687B (en) * 2014-04-22 2018-10-26 腾讯科技(深圳)有限公司 The implementation method and device of slide in automatic test scheme
CN105138316A (en) * 2015-07-23 2015-12-09 中山大学深圳研究院 Automatic clicking method and device based on super sketchpad
CN105183599B (en) * 2015-09-08 2018-07-13 上海斐讯数据通信技术有限公司 script recording system and method
CN105740153A (en) * 2016-02-29 2016-07-06 网易(杭州)网络有限公司 Cloud testing method and device
CN105740874B (en) * 2016-03-04 2019-04-16 网易(杭州)网络有限公司 Determine the method and device of operation coordinate when automatic test script playback
CN105866574B (en) * 2016-03-29 2018-07-17 东莞华贝电子科技有限公司 Automatic test assists in identifying method and assists in identifying system
CN105955881B (en) * 2016-04-22 2019-02-12 百度在线网络技术(北京)有限公司 A kind of automatic test step is recorded and back method and device
CN106445816B (en) * 2016-09-07 2019-01-25 美的智慧家居科技有限公司 Control executes method and apparatus
CN106897225A (en) * 2017-02-27 2017-06-27 网易(杭州)网络有限公司 Record method, device and the electronic equipment of test script

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103678106A (en) * 2012-09-19 2014-03-26 腾讯科技(深圳)有限公司 Method and device for content recording
US9424167B2 (en) * 2014-05-21 2016-08-23 Cgi Technologies And Solutions Inc. Automated testing of an application system
CN105138463A (en) * 2015-09-25 2015-12-09 成都中科创达软件有限公司 Testing method and system for mobile terminal software
CN106095666A (en) * 2016-06-02 2016-11-09 腾讯科技(深圳)有限公司 Game automated testing method and relevant apparatus

Also Published As

Publication number Publication date
CN109871172A (en) 2019-06-11

Similar Documents

Publication Publication Date Title
CN107341098B (en) Software performance testing method, platform, equipment and storage medium
CN107193750B (en) Script recording method and device
CN109871172B (en) Mouse clicking method and device in automatic test and readable storage medium
CN109753641B (en) Method and device for changing object position, electronic equipment and storage medium
CN109408361A (en) Monkey tests restored method, device, electronic equipment and computer readable storage medium
CN111061489A (en) Multi-platform compiling detection method, device, equipment and medium
CN111291443B (en) Automatic generation method, device and equipment for I/O module model of vehicle control unit software
CN111382643B (en) Gesture detection method, device, equipment and storage medium
CN111240923A (en) Automatic test method and device for recurring problems of vehicle navigation system and storage medium
CN116738091A (en) Page monitoring method and device, electronic equipment and storage medium
CN109496284B (en) Method for recording machining track by bitmap and numerical control equipment
CN110806981B (en) Application program testing method, device, equipment and storage medium
CN112527631A (en) bug positioning method, system, electronic equipment and storage medium
CN114442930A (en) Method and device for controlling group disk array, electronic equipment and readable storage medium
CN108446064B (en) Writing whiteboard-based area saving method and device, terminal equipment and medium
CN113760696A (en) Program problem positioning method and device, electronic equipment and storage medium
CN113722203A (en) Program testing method and device, electronic device and computer readable storage medium
CN113722231B (en) User operation simulation method and device, electronic equipment and storage medium
CN113886745B (en) Page picture testing method and device and electronic equipment
CN117648696B (en) Software security testing method and device
CN117112446B (en) Editor debugging method and device, electronic equipment and medium
JP7306022B2 (en) Data recording device, data recording method and program
US11599702B2 (en) Excitation source planning method for electrical simulation and system thereof
CN114528366A (en) Map information tracing method, device, equipment, storage medium and program product
CN112906362A (en) Report summarizing method, device, equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant