CN113722231A - 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
CN113722231A
CN113722231A CN202111054771.5A CN202111054771A CN113722231A CN 113722231 A CN113722231 A CN 113722231A CN 202111054771 A CN202111054771 A CN 202111054771A CN 113722231 A CN113722231 A CN 113722231A
Authority
CN
China
Prior art keywords
user
user operation
area covered
area
random
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111054771.5A
Other languages
Chinese (zh)
Other versions
CN113722231B (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

Images

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 for 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 a random operation position in the target area. According to the embodiment of the application, the simulated user operation is ensured to be in accordance with the real user operation, all user operations in the simulation process can be ensured to be successfully executed, and the simulation efficiency is improved.

Description

User operation simulation method and device, electronic equipment and storage medium
Technical Field
The application relates to the field of automated testing, in particular to a user operation simulation method and device, electronic equipment and a storage medium.
Background
Before an application APP is shipped to an application store, it is an essential step to test the operations that a user can perform with respect to the application. 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 on a certain button is tested, and in the related art, the test is usually performed according to an operation action of clicking a central coordinate point of the button. However, the actual user operation is not fixed, and therefore the test result of the related art is often inconsistent with the actual user operation.
Disclosure of Invention
An object of the present application is to provide a method, an apparatus, an electronic device, and a storage medium for simulating a user operation, which ensure that the simulated user operation is consistent with the real user operation, and also 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, a method for simulating a user operation is disclosed, the method including:
acquiring an operation type to be simulated for 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 a random operation position in the target area.
According to an aspect of an embodiment of the present application, a simulation apparatus for a user operation is disclosed, the apparatus including:
the first acquisition module is configured to acquire an operation type to be simulated for 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 obtaining module configured to obtain 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 the user operation of the operation type at a random operation position within the target area.
In an exemplary embodiment of the present application, the simulation module is configured to:
and simulating the user operation of the operation type in the target area at random operation positions and random operation interval duration.
In an exemplary embodiment of the 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 present application, when the click operation is a double click operation or a long press operation, the apparatus is configured to:
obtaining the effective operation duration of the current simulated click operation;
and simulating the current simulated click operation for the control at a random operation position in the target area and at a random operation time length in the effective operation time length.
In an exemplary embodiment of the 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 an area covered by user operation corresponding to a dragging start point in dragging operation, and taking the area dragged and reached by the control target as an area covered by user operation corresponding to a dragging end point in dragging operation;
the third obtaining module is configured to:
acquiring a first target area which is positioned in an area covered by the user operation corresponding to the dragging starting point and is empty in intersection with the boundary of the area covered by the user operation corresponding to the dragging 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 intersection with the boundary of the area covered by the user operation corresponding to the dragging terminal point;
the simulation module is configured to: simulating the dragging starting point for the control at a random operation position in the first target area, and simulating the dragging ending point for the control at a random operation position in the second target area.
In an exemplary embodiment of the 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 present application, the apparatus is configured to:
acquiring the effective disassembling step number of the sliding operation;
simulating a sliding operation at a random operating position within the target area and at a random number of defragmentation steps within the effective number of defragmentation steps.
According to an aspect of an embodiment of the present application, an electronic device is disclosed, including: 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 carry out the method of any preceding claim.
According to an aspect of embodiments herein, a computer program medium is disclosed, having computer readable instructions stored thereon, which, when executed by a processor of a computer, cause the computer to perform the method of any of the preceding claims.
According to an aspect of embodiments herein, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method provided in the various alternative implementations described above.
In the embodiment of the application, the method for simulating the user operation at the random operation position in the target area without the boundary of the area covered by the user operation ensures that the simulated user operation is consistent with the real user operation, and simultaneously ensures that all the user operations in the simulation process can be successfully executed, thereby improving the simulation efficiency.
Other features and advantages of the present application will be apparent from the following detailed description, or may be learned by 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.
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 shows a flow diagram of a method for simulating user operation according to one embodiment of the present application.
FIG. 2 shows a simulated practical flow diagram of user operations according to one embodiment of the present application.
FIG. 3 illustrates an operator interface diagram according to one embodiment of the present application.
FIG. 4 shows a block diagram of a simulation apparatus for user operation according to an embodiment of the present application.
FIG. 5 illustrates an electronic device hardware diagram according to one embodiment of the present application.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different 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 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 their repetitive description 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 present application. One skilled in the relevant art will recognize, however, that the subject matter of the present application can be practiced without one or more of the specific details, or with other methods, components, steps, and so forth. 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 the form of 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 user operation simulation method 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 computer, an intelligent watch and other equipment 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 or an operation interface of other systems; the simulation can be user operation executed on the operation interface by the user through touch, and can also be user operation executed on the operation interface by the user through mouse control.
Fig. 1 shows a flowchart of a simulation method for user operation according to an embodiment of the present application. Referring to fig. 1, the method includes:
step S110, acquiring an operation type to be simulated for an operation interface;
step S120, acquiring 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;
and step S140, simulating the user operation of the operation type in the 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 can be understood that the range of the covered area in the operation interface is different for the user operations of different operation types. For example: aiming at the clicking operation of a first control, the area covered by the first control in the operation interface is the area covered by the first control; aiming at the single-click operation of the second control, the covered area in the operation interface is the area covered by the second control.
After the area covered by the user operation is obtained, a target area which is located in the area covered by the user operation and is empty in intersection with the boundary of the area covered by the user operation is obtained. That is, the target area is located within the area covered by the user operation and does not include the boundary of the area covered by the user operation. And simulating the user operation of the operation type at random operation positions in the target area.
The user operation is simulated at a random operation position, because the user operation of a real user on the operation interface is usually not fixed and has certain randomness. In addition, the reason why the user operation is simulated in the target area not including the boundary of the area covered by the user operation is that the user operation simulated on the boundary of the area covered by the user operation cannot be successfully executed with a certain probability.
Therefore, in the embodiment of the application, the method for simulating the user operation in the random operation position in the target area without the boundary of the area covered by the user operation ensures that the simulated user operation is consistent with the real user operation, ensures that all user operations in the simulation process can be successfully executed, and improves the simulation efficiency.
It can be understood that when a certain operation type of user operation is simulated, the operation type of user operation is usually simulated for multiple times to ensure the reliability of the simulation. There is a certain operation interval duration between two adjacent user operations.
In one embodiment, user operations of the operation type are simulated at random operation positions and random operation interval durations in the target area.
For example: when the single-click operation is simulated, the operation position of each single-click operation in the target area corresponding to the single-click operation is random, and the operation interval duration between two adjacent single-click operations is also random.
The embodiment has the advantage that the fitting degree between the simulated user operation and the real user operation can be further improved by further simulating the user operation at the random operation interval duration in consideration of the fact that the operation interval duration between two adjacent user operations is not fixed in the operation process of the real user.
FIG. 2 shows a schematic diagram of a simulated practical flow of user operations according to an embodiment of the present application.
Referring to fig. 2, in this embodiment, after the operation type of the user operation to be simulated is selected, if the operation type is the user operation performed on the control in the operation interface, the parameter of the control is analyzed, so as to determine at least the area covered by the control.
And further acquiring a region covered by the user operation according to the region covered by the control, and further calculating a random operation position in the target region within the region covered by the user operation and without the target region of the boundary of the region covered by the user operation. And calculating the random operation interval duration between the current user operation to be simulated and the previous simulated user operation.
And then 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 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 comprises a single clicking operation, a double clicking operation, a long pressing operation and the like.
In an embodiment, when the click operation is a double-click operation or a long-click operation, the effective operation duration of the currently simulated click operation is obtained. And simulating the current simulated click operation for the control at a random operation position in the target area and at a random operation time length in the effective operation time length.
In this embodiment, an effective operation duration is set for the double-click operation or the long-press operation, so as 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 fitting degree between the simulated double-click operation or the simulated long-press operation and the real user operation can be further improved by further simulating the double-click operation or the long-press operation in a random operation time length in consideration of the fact that the time length spent by the double-click operation or the long-press operation by the real user in the operation process is not fixed.
In an embodiment, referring to the operation interface diagram shown in fig. 3, the user operation to be simulated is a single-click operation for the control a. The single click operation is simulated by the formula shown below:
x=Random((x3+1),(x4-1))
y=Random((y3-1),(y4+1))
d.click(x,y)
x represents the lateral coordinates of the control, y represents the longitudinal coordinates of the control, "+ 1" represents moving one pixel in the positive direction, "-1" represents moving one pixel in the negative direction, d represents the device object to be manipulated, click represents the api (Application Programming Interface) for a single click operation, and the Random () method represents taking a Random number between two parameters.
In an embodiment, referring to the operation interface 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 formula shown below:
x=Random((x3+1),(x4-1))
y=Random((y3-1),(y4+1))
duration=Random(1,10)
d.doubleClick(x,y,duration)
the duration represents an operation time period required for completing the double-click operation, the duration (Random (1, 10)) represents an operation time period randomly calculated from 1 second to 10 seconds, and the doubtleclick represents the api of the double-click operation.
In an embodiment, referring to the operation interface 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 formula shown below:
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 time length required for finishing the long press operation, and longClick represents the api of the long press operation.
In an embodiment, when the operation type is a drag operation to be simulated for a control in an operation interface, an area covered by the control is used as an area covered by a user operation corresponding to a drag start point in the drag operation, and an area dragged and reached by a control target is used as an area covered by a user operation corresponding to a drag end 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 dragging starting point and is empty in intersection with the boundary of the area covered by the user operation corresponding to the dragging starting point. And acquiring a second target area which is positioned in the area covered by the user operation corresponding to the dragging terminal and is empty in intersection with the boundary of the area covered by the user operation corresponding to the dragging terminal. And simulating a dragging starting point for the control at a random operation position in the first target area, and simulating a dragging ending point for the control at a random operation position in the second target area.
In this embodiment, the drag operation drags the corresponding control from the current position to another position, so that 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: and dragging the area covered by the user operation corresponding to the starting point and dragging the area covered by the user operation corresponding to the ending point. And the area covered by the user operation corresponding to the dragging 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 dragging starting point and does not contain the boundary of the area covered by the user operation corresponding to the dragging starting point, and the second target area is positioned in the area covered by the user operation corresponding to the dragging ending point and does not contain the boundary of the area covered by the user operation corresponding to the dragging ending point.
Further, the simulation drag operation in the target area is also divided into two parts: and simulating a dragging starting point in the first target area and simulating a dragging ending point in the second target area.
In an embodiment, referring to the operation interface diagram shown in fig. 3, the user operation to be simulated is a drag operation for the control a, and the drag operation is simulated by dragging the control a to the area B.
The drag operation is simulated by the formula shown below:
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 dragging start point for the control A, (xe, ye) represents a dragging end point for the control A, duration represents an operation duration required for completing a dragging operation, duration (3,8) represents an operation duration randomly calculated from 3 seconds to 8 seconds, and drags represents api of the dragging operation.
In one 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 effective disassembly steps for the sliding operation is obtained. The sliding operation is simulated at random operating positions within the target area and at random number of disassembly steps within the number of effective disassembly steps.
In this embodiment, the sliding operation is disassembled, and then the sliding operation is executed according to the number of disassembling steps. The more the number of disassembling steps is, the slower the sliding is; the fewer the number of disassembly steps, the faster the slide. Wherein the effective number of dismantling steps is used to limit the range of the number of dismantling steps. And then simulating the sliding operation at random operation positions in the target area and at random dismantling steps in the effective dismantling step number.
This embodiment has the advantage that it further takes into account that the sliding speed of the sliding operation is not fixed during the operation by the real user, so by further simulating the sliding operation in random number of disassembly steps, the degree of conformity between the simulated sliding operation and the real user operation can be further improved.
In an embodiment, referring to the operation interface 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 formula shown below:
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 a sliding starting point, (xe, ye) represents a sliding ending point, "+ 3" represents moving three pixels in a positive direction, "-3" represents moving three pixels in a negative direction, step represents the number of disassembly steps required to complete the sliding operation, step ═ Random (500,1000) represents randomly calculating a disassembly step number from 500 steps to 1000 steps, and swipe represents api of the sliding operation.
FIG. 4 shows a user-operated simulation device according to an embodiment of the present application, the device comprising:
a first obtaining module 210 configured to obtain an operation type to be simulated for an 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 the user operation of the operation type at a random operation position within the target area.
In an exemplary embodiment of the present application, the simulation module is configured to:
and simulating the user operation of the operation type in the target area at random operation positions and random operation interval duration.
In an exemplary embodiment of the 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 present application, when the click operation is a double click operation or a long press operation, the apparatus is configured to:
obtaining the effective operation duration of the current simulated click operation;
and simulating the current simulated click operation for the control at a random operation position in the target area and at a random operation time length in the effective operation time length.
In an exemplary embodiment of the 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 an area covered by user operation corresponding to a dragging start point in dragging operation, and taking the area dragged and reached by the control target as an area covered by user operation corresponding to a dragging end point in dragging operation;
the third obtaining module is configured to:
acquiring a first target area which is positioned in an area covered by the user operation corresponding to the dragging starting point and is empty in intersection with the boundary of the area covered by the user operation corresponding to the dragging 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 intersection with the boundary of the area covered by the user operation corresponding to the dragging terminal point;
the simulation module is configured to: simulating the dragging starting point for the control at a random operation position in the first target area, and simulating the dragging ending point for the control at a random operation position in the second target area.
In an exemplary embodiment of the 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 present application, the apparatus is configured to:
acquiring the effective disassembling step number of the sliding operation;
simulating a sliding operation at a random operating position within the target area and at a random number of defragmentation steps within the effective number of defragmentation steps.
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 only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 5, the electronic device 30 is in the form of a general purpose computing device. The components of the 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 that couples various system components including the memory unit 320 and the processing unit 310.
Wherein the storage unit stores program code executable by the processing unit 310 to cause the processing unit 310 to perform steps according to various exemplary embodiments of the present invention described in the description part of the above exemplary methods of the present specification. For example, the processing unit 310 may perform the various steps as shown in fig. 1.
The storage unit 320 may include readable media in the form of volatile storage units, such as a random access memory unit (RAM)3201 and/or a cache memory unit 3202, and may further include a read only memory unit (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 of which, or some combination thereof, may comprise 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.), with one or more devices that enable a user to interact with the electronic device 30, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 30 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 350. An input/output (I/O) interface 350 is connected to the display unit 340. Also, the electronic device 30 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 360. As shown, the network adapter 360 communicates with the other modules of the electronic device 30 via the bus 330. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with electronic device 30, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to make a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) execute the method according to the embodiments of the present application.
In an exemplary embodiment of the present 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 above method embodiment section.
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 include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present 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. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. 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 for aspects 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, as well as 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 and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, 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., through the internet using an internet service provider).
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Moreover, although the steps of the methods herein are depicted in the drawings in a particular order, this does not require or imply that the steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention 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 invention 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 (10)

1. A method for simulating user operation, the method comprising:
acquiring an operation type to be simulated for 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 a random operation position in the target area.
2. The method of claim 1, wherein simulating the type of manipulation of the user within the target area at random manipulation positions comprises:
and simulating the user operation of the operation type in the target area at random operation positions and random operation interval duration.
3. The method according to claim 1, wherein when the operation type is a click operation to be simulated for a control in the operation interface, acquiring an area covered by a user operation of the operation type in the operation interface, including: and taking the area where the control is located as the area covered by the user operation.
4. The method of claim 3, wherein when the click operation is a double click operation or a long press operation, the method further comprises:
obtaining the effective operation duration of the current simulated click operation;
and simulating the current simulated click operation for the control at a random operation position in the target area and at a random operation time length in the effective operation time length.
5. The method of claim 1, wherein when the operation type is a drag operation to be simulated for a control in the operation interface,
acquiring an area covered by the user operation of the operation type in the operation interface, wherein the area includes: taking the area covered by the control as an area covered by user operation corresponding to a dragging start point in dragging operation, and taking the area dragged and reached by the control target as an area covered by user operation corresponding to a dragging end point in dragging operation;
acquiring a target area which is located in the area covered by the user operation and has an empty intersection with the boundary of the area covered by the user operation, including:
acquiring a first target area which is positioned in an area covered by the user operation corresponding to the dragging starting point and is empty in intersection with the boundary of the area covered by the user operation corresponding to the dragging 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 intersection with the boundary of the area covered by the user operation corresponding to the dragging terminal point;
simulating user operation of the operation type at random operation positions within the target area, including: simulating the dragging starting point for the control at a random operation position in the first target area, and simulating the dragging ending point for the control at a random operation position in the second target area.
6. 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 comprises: and taking the area where the operation interface is located as the area covered by the user operation.
7. The method of claim 6, further comprising:
acquiring the effective disassembling step number of the sliding operation;
simulating a sliding operation at a random operating position within the target area and at a random number of defragmentation steps within the effective number of defragmentation steps.
8. A user-operated simulation apparatus, the apparatus comprising:
the first acquisition module is configured to acquire an operation type to be simulated for 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 obtaining module configured to obtain 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 the user operation of the operation type at a random operation position within the target area.
9. 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 carry out the method of any one of claims 1 to 7.
10. 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 one of claims 1 to 7.
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 true CN113722231A (en) 2021-11-30
CN113722231B 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 (9)

* 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
US20200301807A1 (en) * 2019-03-18 2020-09-24 Simudyne Ltd. Method and System for Operating a Computer Simulation
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

Patent Citations (9)

* 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
US20200301807A1 (en) * 2019-03-18 2020-09-24 Simudyne Ltd. Method and System for Operating a Computer Simulation
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
蔡方达;: "面向安卓模拟器的自动化交互的设计与实现", 电子设计工程, no. 19, pages 77 - 80 *

Also Published As

Publication number Publication date
CN113722231B (en) 2024-04-26

Similar Documents

Publication Publication Date Title
US9703681B2 (en) Performance optimization tip presentation during debugging
CN108287657B (en) Skill applying method and device, storage medium and electronic equipment
CN107122119B (en) Information processing method, information processing device, electronic equipment and computer readable storage medium
CN107992251B (en) Skill control method, skill control device, electronic equipment and storage medium
US9519401B2 (en) Providing context menu based on predicted commands
CN108037888B (en) Skill control method, skill control device, electronic equipment and storage medium
CN107506300B (en) User interface testing method, device, server and storage medium
WO2016206113A1 (en) Technologies for device independent automated application testing
CN110090444B (en) Game behavior record creating method and device, storage medium and electronic equipment
CN107656620B (en) Virtual object control method and device, electronic equipment and storage medium
CN109865285B (en) Information processing method and device in game and computer storage medium
CN108553894B (en) Display control method and device, electronic equipment and storage medium
KR101118602B1 (en) Method and system for gui testing with scene-driven scenario
CN110624241A (en) Information processing method and device, electronic equipment and storage medium
CN108415657B (en) Message sending method, device, medium and electronic equipment
CN113449877B (en) Method and system for demonstrating machine learning modeling process
CN103984626A (en) Method and device for generating test-case script
US20210326151A1 (en) Methods, devices and computer-readable storage media for processing a hosted application
CN109542272A (en) Touch screen scanning method and device, electronic equipment and computer readable storage medium
CN110850982B (en) AR-based man-machine interaction learning method, system, equipment and storage medium
CN105453033A (en) Program testing service
CN108815843B (en) Control method and device of virtual rocker
CN112214416A (en) Method and device for debugging small program, electronic equipment and storage medium
CN113722231B (en) User operation simulation method and device, electronic equipment and storage medium
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