CN113722231B - User operation simulation method and device, electronic equipment and storage medium - Google Patents

User operation simulation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113722231B
CN113722231B CN202111054771.5A CN202111054771A CN113722231B CN 113722231 B CN113722231 B CN 113722231B CN 202111054771 A CN202111054771 A CN 202111054771A CN 113722231 B CN113722231 B CN 113722231B
Authority
CN
China
Prior art keywords
user operation
user
area covered
area
drag
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
CN202111054771.5A
Other languages
Chinese (zh)
Other versions
CN113722231A (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.)
Tongdun Technology Co ltd
Original Assignee
Tongdun 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 Tongdun Technology Co ltd filed Critical Tongdun Technology Co ltd
Priority to CN202111054771.5A priority Critical patent/CN113722231B/en
Publication of CN113722231A publication Critical patent/CN113722231A/en
Application granted granted Critical
Publication of CN113722231B publication Critical patent/CN113722231B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3644Software debugging by instrumenting at runtime
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs
    • G06F11/3612Software analysis for verifying properties of programs by runtime analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04845Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/0485Scrolling or panning

Abstract

The application provides a user operation simulation method, a user operation simulation device, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring an operation type to be simulated aiming at an operation interface; acquiring an area covered by the user operation of the operation type in the operation interface; acquiring a target area which is positioned in the area covered by the user operation and has an empty intersection with the boundary of the area covered by the user operation; and simulating the user operation of the operation type in the target area by using random operation positions. The embodiment of the application ensures that the simulated user operation accords with the actual user operation, and simultaneously ensures that all user operations can be successfully executed in the simulation process, thereby improving the simulation efficiency.

Description

User operation simulation method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of automated testing, and in particular, to a user operation simulation method, apparatus, electronic device, and storage medium.
Background
Testing the operation that a user can perform for an application is an essential step before the application APP is put on the application store. In the related art, testing is generally performed according to a fixed operation action or operation flow based on an automation script. For example, a click operation of a button is tested, and in the related art, the test is generally performed according to an operation action of clicking a center coordinate point of the button. However, the actual user operation is not fixed in practice, and thus the test result of the related art often does not coincide with the actual user operation.
Disclosure of Invention
The application aims to provide a user operation simulation method, a device, electronic equipment and a storage medium, which ensure that the simulated user operation accords with the actual user operation, and simultaneously ensure that all user operations can be successfully executed in the simulation process, thereby improving the simulation efficiency.
According to an aspect of an embodiment of the present application, there is disclosed a user operation simulation method, including:
acquiring an operation type to be simulated aiming at an operation interface;
Acquiring an area covered by the user operation of the operation type in the operation interface;
acquiring a target area which is positioned in the area covered by the user operation and has an empty intersection with the boundary of the area covered by the user operation;
And simulating the user operation of the operation type in the target area by using random operation positions.
According to an aspect of an embodiment of the present application, there is disclosed a user-operated simulation apparatus, the apparatus including:
the first acquisition module is configured to acquire an operation type to be simulated aiming at the operation interface;
The second acquisition module is configured to acquire an area covered by the user operation of the operation type in the operation interface;
A third acquisition module configured to acquire a target area which is located within the area covered by the user operation and whose intersection with the boundary of the area covered by the user operation is empty;
and the simulation module is configured to simulate the user operation of the operation type at random operation positions in the target area.
In an exemplary embodiment of the application, the simulation module is configured to:
and simulating the user operation of the operation type in the target area by using a random operation position and a random operation interval duration.
In an exemplary embodiment of the present application, when the operation type is a click operation to be simulated for a control in the operation interface, the second obtaining module is configured to: and taking the area where the control is located as the area covered by the user operation.
In an exemplary embodiment of the application, when the click operation is a double click operation or a long press operation, the apparatus is configured to:
Acquiring effective operation duration of the current simulated click operation;
And simulating the current simulated clicking operation for the control by using a random operation position in the target area and using a random operation duration in the effective operation duration.
In an exemplary embodiment of the present application, when the operation type is a drag operation to be simulated for a control in the operation interface, the second obtaining module is configured to: taking the area covered by the control as the area covered by the user operation corresponding to the drag starting point in the drag operation, and taking the area where the control target is dragged to reach as the area covered by the user operation corresponding to the drag finishing point in the drag operation;
The third acquisition module is configured to:
Acquiring a first target area which is positioned in an area covered by the user operation corresponding to the drag starting point and is empty in intersection of boundaries of the area covered by the user operation corresponding to the drag starting point;
acquiring a second target area which is positioned in the area covered by the user operation corresponding to the dragging terminal point and is empty in the intersection of the boundaries of the area covered by the user operation corresponding to the dragging terminal point;
The simulation module is configured to: simulating the drag starting point for the control with a random operation position in the first target area, and simulating the drag ending point for the control with a random operation position in the second target area.
In an exemplary embodiment of the present application, when the operation type is a sliding operation for the operation interface, the second obtaining module is configured to: and taking the area where the operation interface is located as the area covered by the user operation.
In an exemplary embodiment of the application, the apparatus is configured to:
acquiring the effective disassembly steps of sliding operation;
And simulating sliding operation in a random operation position in the target area and in a random disassembly step number in the effective disassembly step number.
According to an aspect of an embodiment of the present application, an electronic device is disclosed, including: one or more processors; and storage means for storing one or more programs that, when executed by the one or more processors, cause the electronic device to implement the methods provided in the various alternative implementations described above.
According to an aspect of embodiments of the present application, a computer program medium having computer readable instructions stored thereon, which when executed by a processor of a computer, cause the computer to perform the methods provided in the various alternative implementations described above is disclosed.
According to an aspect of embodiments of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The computer instructions are read from the computer-readable storage medium by a processor of a computer device, and executed by the processor, cause the computer device to perform the methods provided in the various alternative implementations described above.
In the embodiment of the application, the method of simulating the user operation by the random operation position in the target area which does not contain the boundary of the area covered by the user operation ensures that the simulated user operation accords with the actual user operation, and simultaneously ensures that all the user operations can be successfully executed in the simulation process, thereby improving the simulation efficiency.
Other features and advantages of the application will be apparent from the following detailed description, or may be learned by the practice of the application.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application as claimed.
Drawings
The above and other objects, features and advantages of the present application will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings.
FIG. 1 illustrates a flow chart of a simulation method of user operation according to one embodiment of the application.
FIG. 2 shows a schematic diagram of a simulated practice flow of user operations according to one embodiment of the application.
FIG. 3 illustrates an operator interface diagram according to one embodiment of the application.
FIG. 4 shows a block diagram of a user operated simulation device in accordance with one embodiment of the present application.
Fig. 5 shows a hardware diagram of an electronic device according to an embodiment of the application.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The drawings are merely schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus a repetitive description thereof will be omitted.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more example embodiments. In the following description, numerous specific details are provided to give a thorough understanding of example embodiments of the application. One skilled in the relevant art will recognize, however, that the application may be practiced without one or more of the specific details, or with other methods, components, steps, etc. In other instances, well-known structures, methods, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the application.
Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software or in one or more hardware modules or integrated circuits or in different networks and/or processor devices and/or microcontroller devices.
The application provides a simulation method of user operation, which is mainly used for simulating various operations executed by a user on an operation interface of a terminal. The terminal comprises a mobile phone, a personal computer, a tablet personal computer, a smart watch and other devices which provide an operation interface for a user; the operation interface can be an operation interface of an android system, an operation interface of a WINDOWS system, and an operation interface of other systems; the simulated operation can be the user operation performed on the operation interface by touching the operation interface by the user or the user operation performed on the operation interface by the user through the mouse control.
FIG. 1 shows a flow chart of a simulation method of user operation provided by an embodiment of the application. Referring to fig. 1, the method includes:
step S110, obtaining an operation type to be simulated aiming at an operation interface;
step S120, obtaining an area covered by the user operation of the operation type in the operation interface;
Step S130, acquiring a target area which is positioned in the area covered by the user operation and has an empty intersection with the boundary of the area covered by the user operation;
step S140, simulating the user operation of the operation type with a random operation position in the target area.
In the embodiment of the application, after the operation type of the user operation to be simulated is obtained, the area covered by the user operation of the operation type in the operation interface is obtained. It will be appreciated that the range of coverage in the operator interface may vary from one type of user operation to another. For example: aiming at the clicking operation of the first control, the coverage area in the operation interface is the coverage area of the first control; and aiming at the clicking operation of the second control, the coverage area in the operation interface is the coverage area of the second control.
After the area covered by the user operation is acquired, a target area which is positioned in the area covered by the user operation and has an empty intersection with the boundary of the area covered by the user operation is acquired. That is, the target area is located within the area covered by the user operation and does not contain the boundary of the area covered by the user operation. And then simulate the user operation of the operation type with random operation positions in the target area.
The user operation is simulated by a random operation position, because the user operation of a real user on an operation interface is usually not fixed and has certain randomness. And, the user operation is simulated in the target area that does not include the boundary of the area covered by the user operation, because the simulated user operation on the boundary of the area covered by the user operation cannot be successfully performed with a certain probability.
Therefore, in the embodiment of the application, the user operation is simulated by the random operation position in the target area which does not contain the boundary of the area covered by the user operation, so that the simulated user operation is ensured to be consistent with the actual user operation, all the user operations in the simulation process can be successfully executed, and the simulation efficiency is improved.
It will be appreciated that when simulating a user operation of a certain type of operation, the user operation of that type of operation is typically simulated multiple times to ensure the reliability of the simulation. There is a certain duration of operation interval between two adjacent user operations.
In one embodiment, the user operation of the operation type is simulated at random operation positions and random operation interval durations within the target area.
For example: in simulating a click operation, the operation position of each click operation within the target area corresponding to the click operation is random, and the operation interval duration between two adjacent click operations is also random.
The embodiment has the advantage that the fit between the simulated user operation and the actual user operation can be further improved by further simulating the user operation with a random operation interval duration, further taking into account that the operation interval duration between two adjacent user operations is not fixed during the operation by the actual user.
FIG. 2 shows a schematic diagram of a simulated practice flow of user operation in accordance with an embodiment of the present application.
Referring to fig. 2, in this embodiment, after an operation type of user operation to be simulated is selected, if the operation type is a user operation for a control in an operation interface, parameters of the control are parsed to at least determine an area covered by the control.
And further acquiring an area covered by the user operation according to the area covered by the control, further calculating a random operation position in a target area which is within the area covered by the user operation and does not contain the boundary of the area covered by the user operation. And, calculating a random operation interval duration between the current user operation to be simulated and the previous simulated user operation.
And further, executing a corresponding operation command according to the calculated random operation position and the random operation interval duration, and simulating the user operation of the operation type.
In an embodiment, when the operation type is a click operation to be simulated for the control in the operation interface, the area where the control is located is used as the area covered by the user operation. The clicking operation includes a single click operation, a double click operation, a long press operation, and the like.
In an embodiment, when the click operation is a double click operation or a long press operation, a valid operation duration of the currently simulated click operation is obtained. And simulating the current simulated clicking operation for the control by using random operation positions in the target area and random operation duration in the effective operation duration.
In this embodiment, an effective operation duration is set for the double-click operation or the long-press operation to limit that the double-click operation or the long-press operation should be completed within the corresponding effective operation duration.
The embodiment has the advantage that the fit between the simulated double-click operation or the simulated long-press operation and the actual user operation can be further improved by further simulating the double-click operation or the long-press operation with a random operation duration, further considering that the time spent by the actual user on the double-click operation or the long-press operation is not fixed during the operation.
In an embodiment, referring to the operation interface schematic diagram shown in fig. 3, the user operation to be simulated is a click operation for the control a. The single click operation is simulated by the following formula:
x=Random((x3+1),(x4-1))
y=Random((y3-1),(y4+1))
d.click(x,y)
x represents the horizontal coordinates of the control, y represents the vertical coordinates of the control, "+1" represents one pixel in the positive direction, "-1" represents one pixel in the negative direction, d represents the device object to be operated on, click represents the api (Application Programming Interface, application interface) of a single click operation, and the Random () method represents taking a Random number between two parameters.
In an embodiment, referring to the operation interface schematic diagram shown in fig. 3, the user operation to be simulated is a double click operation for the control a. The double-click operation is simulated by the following formula:
x=Random((x3+1),(x4-1))
y=Random((y3-1),(y4+1))
duration=Random(1,10)
d.doubleClick(x,y,duration)
The duration represents the operation duration required to complete the double-click operation, the duration=random (1, 10) represents an operation duration randomly calculated from 1 second to 10 seconds, and doubleClick represents the api of the double-click operation.
In an embodiment, referring to the operation interface schematic diagram shown in fig. 3, the user operation to be simulated is a long press operation for the control a. The long press operation is simulated by the following formula:
x=Random((x3+1),(x4-1))
y=Random((y3-1),(y4+1))
duration=Random(1,10)
d.longClick(x,y,duration)
Wherein duration represents the operation duration required for completing the long press operation, longClick represents the api of the long press operation.
In an embodiment, when the operation type is a drag operation to be simulated for the control in the operation interface, taking an area covered by the control as an area covered by a user operation corresponding to a drag starting point in the drag operation, and taking an area reached by a target drag of the control as an area covered by a user operation corresponding to a drag ending point in the drag operation. And acquiring a first target area which is positioned in the area covered by the user operation corresponding to the drag starting point and is empty to the intersection of the boundaries of the area covered by the user operation corresponding to the drag starting point. And acquiring a second target area which is positioned in the area covered by the user operation corresponding to the dragging terminal point and is empty to the intersection of the boundaries of the area covered by the user operation corresponding to the dragging terminal point. And simulating a drag starting point for the control at a random operation position in the first target area, and simulating a drag finishing point for the control at a random operation position in the second target area.
In this embodiment, the drag operation drags the control from the current position to another position, so the drag operation is divided into two parts based on the start point and the end point. Correspondingly, the area covered by the user operation is also divided into two parts: the area covered by the user operation corresponding to the drag starting point and the area covered by the user operation corresponding to the drag ending point. The area covered by the user operation corresponding to the drag starting point is the area covered by the control.
Further, the target area within the area covered by the user operation is also divided into two parts: the first target area is positioned in the area covered by the user operation corresponding to the drag starting point and does not contain the boundary of the area covered by the user operation corresponding to the drag starting point, and the second target area is positioned in the area covered by the user operation corresponding to the drag ending point and does not contain the boundary of the area covered by the user operation corresponding to the drag ending point.
Further, the simulated drag operation in the target area is also divided into two parts: the drag start point is simulated in the first target area and the drag end point is simulated in the second target area.
In an embodiment, referring to the operation interface schematic shown in fig. 3, the user operation to be simulated is a drag operation for the control a, which is simulated as dragging the control a to the area B. The drag operation is simulated by the following formula:
xs=Random((x3+1),(x4-1))
ys=Random((y3-1),(y4+1))
xe=Random((x5+1),(x6-1))
ye=Random((y5-1),(y6+1))
duration=Random(3,8)
d.drag(xs,ys,xe,ye,duration)
(xs, ys) represents a drag start point for the control a, (xe, ye) represents a drag end point for the control a, duration represents an operation duration required for completing a drag operation, duration=random (3, 8) represents an operation duration randomly calculated from 3 seconds to 8 seconds, and drag represents an api of the drag operation.
In an embodiment, when the operation type is a sliding operation for the operation interface, the area where the operation interface is located is used as the area covered by the user operation.
In one embodiment, the number of valid disassembly steps of the sliding operation is obtained. The sliding operation is simulated with random operating positions within the target area and random number of disassembly steps within the effective number of disassembly steps.
In this embodiment, the sliding operation is disassembled, and then the sliding operation is performed in accordance with the number of disassembling steps. The more the number of disassembly steps, the slower the sliding; the fewer the number of disassembly steps, the faster the slip. Wherein the effective number of disassembly steps is used to limit the range of the number of disassembly steps. Further, the sliding operation is simulated by a random operation position in the target area and a random disassembly step number in the effective disassembly step number.
The embodiment has the advantage that the fit between the simulated sliding operation and the actual user operation can be further improved by further simulating the sliding operation with a random number of disassembling steps, further taking into account that the sliding speed of the sliding operation is not fixed during the operation by the actual user.
In an embodiment, referring to the operation interface schematic diagram shown in fig. 3, the user operation to be simulated is a sliding operation for the operation interface area C. The sliding operation is simulated by the following formula:
xs=Random((x1+3),x2/3)
ys=Random(y1/3,2*y2/3)
xe=Random(x2/3,(x2-3))
ye=Random(y1/3,2*y2/3)
step=Random(500,1000)
d.swipe(xs,ys,xe,ye,step)
(xs, ys) represents the start point, (xe, ye) represents the end point of sliding, "+3" represents three pixels in the positive direction, "-3" represents three pixels in the negative direction, step represents the number of disassembly steps required to complete the sliding operation, step=random (500, 1000) represents one number of disassembly steps calculated randomly from 500 steps to 1000 steps, and swipe represents the api of the sliding operation.
FIG. 4 shows a user-operated simulation apparatus according to an embodiment of the present application, the apparatus comprising:
a first obtaining module 210 configured to obtain an operation type to be simulated for the operation interface;
a second obtaining module 220 configured to obtain an area covered by the user operation of the operation type in the operation interface;
A third obtaining module 230 configured to obtain a target area that is located within the area covered by the user operation and whose intersection with the boundary of the area covered by the user operation is empty;
a simulation module 240 configured to simulate user operations of the operation type with random operation positions within the target area.
In an exemplary embodiment of the application, the simulation module is configured to:
and simulating the user operation of the operation type in the target area by using a random operation position and a random operation interval duration.
In an exemplary embodiment of the present application, when the operation type is a click operation to be simulated for a control in the operation interface, the second obtaining module is configured to: and taking the area where the control is located as the area covered by the user operation.
In an exemplary embodiment of the application, when the click operation is a double click operation or a long press operation, the apparatus is configured to:
Acquiring effective operation duration of the current simulated click operation;
And simulating the current simulated clicking operation for the control by using a random operation position in the target area and using a random operation duration in the effective operation duration.
In an exemplary embodiment of the present application, when the operation type is a drag operation to be simulated for a control in the operation interface, the second obtaining module is configured to: taking the area covered by the control as the area covered by the user operation corresponding to the drag starting point in the drag operation, and taking the area where the control target is dragged to reach as the area covered by the user operation corresponding to the drag finishing point in the drag operation;
The third acquisition module is configured to:
Acquiring a first target area which is positioned in an area covered by the user operation corresponding to the drag starting point and is empty in intersection of boundaries of the area covered by the user operation corresponding to the drag starting point;
acquiring a second target area which is positioned in the area covered by the user operation corresponding to the dragging terminal point and is empty in the intersection of the boundaries of the area covered by the user operation corresponding to the dragging terminal point;
The simulation module is configured to: simulating the drag starting point for the control with a random operation position in the first target area, and simulating the drag ending point for the control with a random operation position in the second target area.
In an exemplary embodiment of the present application, when the operation type is a sliding operation for the operation interface, the second obtaining module is configured to: and taking the area where the operation interface is located as the area covered by the user operation.
In an exemplary embodiment of the application, the apparatus is configured to:
acquiring the effective disassembly steps of sliding operation;
And simulating sliding operation in a random operation position in the target area and in a random disassembly step number in the effective disassembly step number.
An electronic device 30 according to an embodiment of the present application is described below with reference to fig. 5. The electronic device 30 shown in fig. 5 is merely an example and should not be construed as limiting the functionality and scope of use of embodiments of the present application.
As shown in fig. 5, the electronic device 30 is in the form of a general purpose computing device. Components of electronic device 30 may include, but are not limited to: the at least one processing unit 310, the at least one memory unit 320, and a bus 330 connecting the various system components, including the memory unit 320 and the processing unit 310.
Wherein the storage unit stores program code that is executable by the processing unit 310 such that the processing unit 310 performs the steps according to various exemplary embodiments of the present invention described in the description of the exemplary methods described above in this specification. For example, the processing unit 310 may perform the various steps as shown in fig. 1.
Storage unit 320 may include readable media in the form of volatile storage units, such as Random Access Memory (RAM) 3201 and/or cache memory 3202, and may further include Read Only Memory (ROM) 3203.
The storage unit 320 may also include a program/utility 3204 having a set (at least one) of program modules 3205, such program modules 3205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
Bus 330 may be one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 30 may also communicate with one or more external devices 400 (e.g., keyboard, pointing device, bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 30, and/or any device (e.g., router, modem, etc.) that enables the electronic device 30 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 350. An input/output (I/O) interface 350 is connected to the display unit 340. Also, electronic device 30 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through network adapter 360. As shown, the network adapter 360 communicates with other modules of the electronic device 30 over the bus 330. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 30, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, and includes several instructions to cause a computing device (may be a personal computer, a server, a terminal device, or a network device, etc.) to perform the method according to the embodiments of the present application.
In an exemplary embodiment of the application, there is also provided a computer-readable storage medium having stored thereon computer-readable instructions, which, when executed by a processor of a computer, cause the computer to perform the method described in the method embodiments section above.
According to an embodiment of the present application, there is also provided a program product for implementing the method in the above method embodiment, which may employ a portable compact disc read only memory (CD-ROM) and comprise program code and may be run on a terminal device, such as a personal computer. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable signal medium may include a data signal propagated in baseband or as part of a carrier wave with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
Furthermore, although the steps of the methods of the present application are depicted in the accompanying drawings in a particular order, this is not required to or suggested that the steps must be performed in this particular order or that all of the steps shown be performed in order to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform, etc.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, and includes several instructions to cause a computing device (may be a personal computer, a server, a mobile terminal, or a network device, etc.) to perform the method according to the embodiments of the present application.
Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.

Claims (9)

1. A method of simulating a user operation, the method comprising:
acquiring an operation type to be simulated aiming at an operation interface;
Acquiring a user operation coverage area corresponding to the operation type in the operation interface;
acquiring a target area which is positioned in the area covered by the user operation and has an empty intersection with the boundary of the area covered by the user operation;
simulating user operation of the operation type with random operation positions in the target area;
Wherein when the operation type is a drag operation to be simulated for the control in the operation interface,
The step of obtaining the coverage area of the user operation corresponding to the operation type in the operation interface comprises the following steps: taking the area covered by the control as the area covered by the user operation corresponding to the drag starting point in the drag operation, and taking the area reached by the control through drag as the area covered by the user operation corresponding to the drag finishing point in the drag operation;
Acquiring a target area which is positioned in an area covered by the user operation and has a null intersection with a boundary of the area covered by the user operation, wherein the method comprises the following steps:
Acquiring a first target area which is positioned in an area covered by the user operation corresponding to the drag starting point and is empty in intersection of boundaries of the area covered by the user operation corresponding to the drag starting point;
acquiring a second target area which is positioned in the area covered by the user operation corresponding to the dragging terminal point and is empty in the intersection of the boundaries of the area covered by the user operation corresponding to the dragging terminal point;
Simulating user operation of the operation type with random operation positions in the target area comprises: simulating the drag starting point for the control with a random operation position in the first target area, and simulating the drag ending point for the control with a random operation position in the second target area.
2. The method of claim 1, wherein simulating user operation of the operation type with a random operation location within the target area comprises:
and simulating the user operation of the operation type in the target area by using a random operation position and a random operation interval duration.
3. The method of claim 1, wherein when the operation type is a click operation to be simulated for a control in the operation interface, obtaining an area covered by a user operation of the operation type in the operation interface comprises: and taking the area where the control is located as the area covered by the user operation.
4. A method according to claim 3, wherein when the click operation is a double click operation or a long press operation, the method further comprises:
Acquiring effective operation duration of the current simulated click operation;
And simulating the current simulated clicking operation for the control by using a random operation position in the target area and using a random operation duration in the effective operation duration.
5. The method according to claim 1, wherein when the operation type is a sliding operation for the operation interface, acquiring an area covered by a user operation of the operation type in the operation interface includes: and taking the area where the operation interface is located as the area covered by the user operation.
6. The method of claim 5, wherein the method further comprises:
acquiring the effective disassembly steps of sliding operation;
And simulating sliding operation in a random operation position in the target area and in a random disassembly step number in the effective disassembly step number.
7. A user operated simulation device, the device comprising:
the first acquisition module is configured to acquire an operation type to be simulated aiming at the operation interface;
the second acquisition module is configured to acquire an area covered by user operation corresponding to the operation type in the operation interface;
A third acquisition module configured to acquire a target area which is located within the area covered by the user operation and whose intersection with the boundary of the area covered by the user operation is empty;
A simulation module configured to simulate user operations of the operation type with random operation positions within the target area;
Wherein when the operation type is a drag operation to be simulated for the control in the operation interface,
The second acquisition module is configured to: taking the area covered by the control as the area covered by the user operation corresponding to the drag starting point in the drag operation, and taking the area reached by the control through drag as the area covered by the user operation corresponding to the drag finishing point in the drag operation;
The third acquisition module is configured to: acquiring a first target area which is positioned in an area covered by the user operation corresponding to the drag starting point and is empty in intersection of boundaries of the area covered by the user operation corresponding to the drag starting point; acquiring a second target area which is positioned in the area covered by the user operation corresponding to the dragging terminal point and is empty in the intersection of the boundaries of the area covered by the user operation corresponding to the dragging terminal point;
The simulation module is configured to: simulating the drag starting point for the control with a random operation position in the first target area, and simulating the drag ending point for the control with a random operation position in the second target area.
8. An electronic device, comprising:
One or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the electronic device to implement the method of any of claims 1-6.
9. A computer readable storage medium having stored thereon computer readable instructions which, when executed by a processor of a computer, cause the computer to perform the method of any of claims 1 to 6.
CN202111054771.5A 2021-09-09 2021-09-09 User operation simulation method and device, electronic equipment and storage medium Active CN113722231B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111054771.5A CN113722231B (en) 2021-09-09 2021-09-09 User operation simulation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111054771.5A CN113722231B (en) 2021-09-09 2021-09-09 User operation simulation method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113722231A CN113722231A (en) 2021-11-30
CN113722231B true CN113722231B (en) 2024-04-26

Family

ID=78682958

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111054771.5A Active CN113722231B (en) 2021-09-09 2021-09-09 User operation simulation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113722231B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5943048A (en) * 1997-11-19 1999-08-24 Microsoft Corporation Method and apparatus for testing a graphic control area
CN109144881A (en) * 2018-09-07 2019-01-04 东软集团股份有限公司 Monkey test method, device, terminal device and storage medium
WO2019090691A1 (en) * 2017-11-10 2019-05-16 华为技术有限公司 Monkey testing method and terminal
CN109828918A (en) * 2019-01-16 2019-05-31 深圳壹账通智能科技有限公司 Applied program testing method, device, computer equipment and storage medium
CN110135487A (en) * 2019-05-09 2019-08-16 国网山东省电力公司滨州供电公司 A kind of computer user mouse Behavior modeling method
CN111078556A (en) * 2019-12-17 2020-04-28 腾讯科技(深圳)有限公司 Application testing method and device
CN112308069A (en) * 2020-10-29 2021-02-02 恒安嘉新(北京)科技股份公司 Click test method, device, equipment and storage medium for software interface
CN112988586A (en) * 2021-03-25 2021-06-18 腾讯科技(深圳)有限公司 Control testing method and device, electronic equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200301807A1 (en) * 2019-03-18 2020-09-24 Simudyne Ltd. Method and System for Operating a Computer Simulation

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5943048A (en) * 1997-11-19 1999-08-24 Microsoft Corporation Method and apparatus for testing a graphic control area
WO2019090691A1 (en) * 2017-11-10 2019-05-16 华为技术有限公司 Monkey testing method and terminal
CN109144881A (en) * 2018-09-07 2019-01-04 东软集团股份有限公司 Monkey test method, device, terminal device and storage medium
CN109828918A (en) * 2019-01-16 2019-05-31 深圳壹账通智能科技有限公司 Applied program testing method, device, computer equipment and storage medium
CN110135487A (en) * 2019-05-09 2019-08-16 国网山东省电力公司滨州供电公司 A kind of computer user mouse Behavior modeling method
CN111078556A (en) * 2019-12-17 2020-04-28 腾讯科技(深圳)有限公司 Application testing method and device
CN112308069A (en) * 2020-10-29 2021-02-02 恒安嘉新(北京)科技股份公司 Click test method, device, equipment and storage medium for software interface
CN112988586A (en) * 2021-03-25 2021-06-18 腾讯科技(深圳)有限公司 Control testing method and device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
面向安卓模拟器的自动化交互的设计与实现;蔡方达;;电子设计工程(第19期);77-80 *

Also Published As

Publication number Publication date
CN113722231A (en) 2021-11-30

Similar Documents

Publication Publication Date Title
CN108287657B (en) Skill applying method and device, storage medium and electronic equipment
US9519401B2 (en) Providing context menu based on predicted commands
CN107122119B (en) Information processing method, information processing device, electronic equipment and computer readable storage medium
US20130321314A1 (en) Method and terminal for activating application based on handwriting input
CN110090444B (en) Game behavior record creating method and device, storage medium and electronic equipment
CN109857403B (en) Page updating method and device, page processing method and device
CN108553894B (en) Display control method and device, electronic equipment and storage medium
US20210073108A1 (en) Virtualized device-based test system and method thereof
CN108415657B (en) Message sending method, device, medium and electronic equipment
CN109865285B (en) Information processing method and device in game and computer storage medium
US20210326151A1 (en) Methods, devices and computer-readable storage media for processing a hosted application
CN107608609B (en) Event object sending method and device
Wang et al. Automatic Android GUI traversal with high coverage
CN109542272A (en) Touch screen scanning method and device, electronic equipment and computer readable storage medium
CN107918555A (en) The method and apparatus for handling data based on physical host
CN110850982B (en) AR-based man-machine interaction learning method, system, equipment and storage medium
CN112306447A (en) Interface navigation method, device, terminal and storage medium
CN105453033A (en) Program testing service
CN108815843B (en) Control method and device of virtual rocker
CN111367799B (en) Method, device, medium and electronic equipment for locating source code breakdown position
CN112882953A (en) Automatic demonstration method and system for application program based on android debugging bridge
CN113722231B (en) User operation simulation method and device, electronic equipment and storage medium
CN115510508A (en) Page information protection method and device and electronic equipment
CN112131092A (en) Page debugging method and device
CN104407763A (en) Content input method and system

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