CN116908586A - Physical clicker and automatic test method, system and device based on physical clicker - Google Patents

Physical clicker and automatic test method, system and device based on physical clicker Download PDF

Info

Publication number
CN116908586A
CN116908586A CN202310855699.9A CN202310855699A CN116908586A CN 116908586 A CN116908586 A CN 116908586A CN 202310855699 A CN202310855699 A CN 202310855699A CN 116908586 A CN116908586 A CN 116908586A
Authority
CN
China
Prior art keywords
clicker
screen
initial
physical
clicked
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310855699.9A
Other languages
Chinese (zh)
Inventor
师江帆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Longce Technology Co ltd
Original Assignee
Hangzhou Longce 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 Hangzhou Longce Technology Co ltd filed Critical Hangzhou Longce Technology Co ltd
Priority to CN202310855699.9A priority Critical patent/CN116908586A/en
Publication of CN116908586A publication Critical patent/CN116908586A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01MTESTING STATIC OR DYNAMIC BALANCE OF MACHINES OR STRUCTURES; TESTING OF STRUCTURES OR APPARATUS, NOT OTHERWISE PROVIDED FOR
    • G01M11/00Testing of optical apparatus; Testing structures by optical methods not otherwise provided for
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R1/00Details of instruments or arrangements of the types included in groups G01R5/00 - G01R13/00 and G01R31/00
    • G01R1/02General constructional details
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/24Arrangements for testing

Abstract

The invention discloses a physical clicker, and an automatic testing method, system and device based on the physical clicker, wherein the method comprises the steps of providing a clicker array containing a plurality of physical clickers for a screen to be clicked, and respectively carrying out position planning and coordinate mapping on the clicker array based on the screen to be clicked to obtain an initial clicker array; providing a preset test script, and determining an initial clicker of the initial clicker array at each moment and a corresponding initial operation instruction according to the preset test script; and respectively controlling each initial clicker to operate on the screen to be clicked according to the corresponding moment of each initial clicker and the corresponding initial operation instruction of each initial clicker, so as to complete the automatic test. The invention realizes high-speed and high-precision screen clicking operation, simplifies the complexity of the operation, truly simulates the operation of a real user, has high reliability and low safety risk rate, and effectively saves the testing cost in the automatic testing process of the whole screen clicking.

Description

Physical clicker and automatic test method, system and device based on physical clicker
Technical Field
The invention relates to the technical field of automatic testing, in particular to a physical clicker and an automatic testing method, system and device based on the physical clicker.
Background
With the popularity of mobile devices and computers, the number of software applications is increasing. To ensure the quality and stability of software, developers need to conduct software automation tests. In the process of software automated testing, it is important to simulate the operation of a user, which includes various clicking operations on devices such as mobile phones, tablets, computer screens and the like; therefore, the screen clicking operation needs to be simulated to truly realize reliable automatic testing.
There are some solutions on the market today that simulate screen clicks, mainly including software simulation and mechanical robotic arms. Software simulation schemes are divided into two types, one of which is applied to a desktop environment and the other of which is applied to mobile equipment.
For the first application software simulation scheme in a desktop environment, the operating system and application programs provide interfaces and tools that enable developers to simulate mouse clicks and keyboard inputs to achieve automated testing. The following are some of the usual tools and techniques:
(1) GUI (graphical user interface) automation tool: such as Selenium and SikuliX, which provide a cross-platform GUI automation framework that allows developers to simulate mouse clicks and keyboard inputs by writing scripts. These tools use the API of the underlying operating system to interact with the application and simulate the operation of the user.
(2) An interface provided by an operating system: different operating systems, such as Windows, macOS and Linux, each provide a corresponding API interface, allowing developers to write code to simulate click and input operations. For example, on a Windows platform, a WinAPI or UI Automation may be used to simulate mouse clicks and keyboard inputs.
For software simulation schemes applied on mobile devices, common automated test frameworks such as app ium, UI Automator, XCUITest, etc., provide API interfaces to simulate touch events of a user. The following are some major techniques and tools:
(1) An Appium automation test framework: the app is an open-source mobile application automation test framework that supports a variety of mobile platforms (Android and iOS) and a variety of programming languages. Through the app ium, a developer can write a test script, and simulate operations such as clicking, sliding, zooming and the like of a finger on a screen.
(2) UI Automator and XCUITest automated test framework: the UI Automator is an automation test framework of the Android platform, and the XCUITest is an automation test framework of the iOS platform. They provide an API interface and tools that can simulate a user's touch events and interact with an application.
The two technical schemes of software simulation have the following defects:
(1) The limitation is strong: the software simulation scheme cannot completely simulate the clicking operation of a real user, and can not accurately reproduce the clicking effect under special conditions, such as multi-point touch, clicking with different forces and the like. In addition, the physical response of the screen, the touch pressure, and other factors cannot be accurately simulated by software simulation.
(2) Stability is poor: by means of software simulation clicking, the execution stability and the execution efficiency are limited by the influence of a technical bottom layer scheme, and the requirement of automatic testing on stability execution cannot be met.
For the scheme of mechanical arm simulation, the mechanical arm is equipment capable of simulating the movement of a human hand, and clicking operation on a mobile phone, a computer and a flat screen can be realized by controlling the movement of the mechanical arm. The following are several functional modules in the robotic arm simulation scheme:
(1) And (3) motor control: the robotic arm is typically composed of a plurality of motors, each controlling one joint, so that the robotic arm can move in three dimensions. The movement track and the gesture of the mechanical arm can be controlled by controlling the rotation angle and the rotation speed of the motor.
(2) Sensor feedback: to achieve accurate clicking operations, robotic arms are often equipped with various sensors, such as force sensors, visual sensors, and the like. The sensors can provide real-time position and force information, so that the mechanical arm can accurately simulate the clicking action of a human hand.
The scheme of the mechanical arm simulation has the following defects:
(1) High cost and high complexity: the mechanical arm is a physical device, and is relatively high in manufacturing, purchasing and maintaining cost. For some small or budget limited projects, it may not be cost effective to introduce a robotic arm as a test tool. Furthermore, the use of robotic arms requires specialized knowledge and skills, including fields of mechanical engineering, electronic engineering, and control systems, which increase the technical requirements and training costs of the test team.
(2) Limited by the physical operating speed and accuracy: the physical operating speed and accuracy of the robotic arm may be limited. Despite the high speed and accuracy of motion of modern robotic arms, in some cases, it is still not possible to match exactly the actual user's clicking operation. Particularly in situations where a quick continuous click or complex gesture needs to be simulated, the robotic arm may not achieve the desired speed and accuracy of operation.
(3) The safety risk rate is high: the mechanical arm needs to accurately position and control the force when clicking the screen, which may cause some potential safety hazards. If the control of the robotic arm becomes problematic, it may result in an erroneous clicking operation or damage to the device.
Therefore, it is needed to provide a new automatic test scheme for simulating clicking, which can simulate real physical response, realize high-speed and high-precision operation, simplify operation, reduce cost, improve reliability and reduce safety risk.
Disclosure of Invention
In view of the above, the invention provides a physical clicker and an automatic testing method, system and device based on the physical clicker, so as to solve the problems of low speed, low precision, complex operation, high cost, poor reliability and high safety risk of the existing automatic testing scheme for simulating clicking.
The invention provides a physical clicker, which is used in the automatic test process of screen clicking and comprises the following steps:
the click head is in physical contact with the screen to be clicked;
the control unit is used for acquiring an operation instruction of the click head, and the operation instruction is used for controlling the click head to operate according to the corresponding operation parameters;
the driving unit is electrically connected with the control unit and is used for receiving the operation instruction and generating a driving signal of the click head according to the operation instruction;
The click head is also electrically connected with the driving unit and is used for receiving the driving signal, and operating on the screen to be clicked in physical contact according to the driving signal so as to simulate a human hand to click the screen to be clicked.
Optionally, the method further comprises:
the sensor assembly is electrically connected with the control unit and is used for detecting actual operation parameters of the click head when the click head operates on the screen to be clicked and feeding back the actual operation parameters to the control unit.
Optionally, the operation parameter and the actual operation parameter each include a click position, a click action, and a click force.
In addition, the invention also provides an automatic testing method based on the physical clicker, which adopts a plurality of the physical clickers to automatically test the clicking process of the screen to be clicked, and the method comprises the following steps:
providing a clicker array containing a plurality of physical clickers for the screen to be clicked, and respectively carrying out position planning and coordinate mapping on the clicker array based on the screen to be clicked to obtain an initial clicker array; wherein each of the physical clickers in the initial clicker array is in physical contact with the screen to be clicked;
Providing a preset test script, and determining an initial clicker of the initial clicker array at each moment and a corresponding initial operation instruction according to the preset test script; the initial operation instruction is used for controlling the initial clicker to operate according to corresponding initial operation parameters;
and respectively controlling each initial clicker to operate on the screen to be clicked according to the moment corresponding to each initial clicker and the initial operation instruction corresponding to each initial clicker, and completing the automatic test of the screen to be clicked under the preset test script.
Optionally, the performing, based on the screen to be clicked, position planning and coordinate mapping on the clicker array respectively includes:
acquiring size information and layout information of the screen to be clicked;
performing position planning on each physical clicker in the clicker array according to the size information and the layout information;
and establishing a coordinate system based on the screen to be clicked, and carrying out coordinate mapping on each physical clicker after position planning to obtain the center coordinate of each physical clicker under the coordinate system.
Optionally, the determining, according to the preset test script, an initial clicker of the initial clicker array at each time and a corresponding initial operation instruction includes:
acquiring the preset test script and a test screen shot of the preset test script at each time by using an automation engine;
analyzing the test screen shots at each moment to obtain screen click coordinate information at each moment;
analyzing the preset test script to obtain screen clicking operation corresponding to the screen clicking coordinate information at each moment;
determining the initial clicker at each moment according to the screen click coordinate information at each moment and the central coordinates of all the physical clickers in the coordinate system;
determining the initial operation parameters corresponding to the initial clicker at each moment according to the screen clicking operation corresponding to the screen clicking coordinate information at each moment; and generating the initial operation instruction corresponding to the initial clicker at each moment according to the initial operation parameter corresponding to the initial clicker at each moment.
Optionally, the physical clicker further comprises a sensor assembly electrically connected to the control unit; the method further comprises the steps of respectively controlling each initial clicker after the screen to be clicked operates according to the initial operation instruction corresponding to each initial clicker according to the time corresponding to each initial clicker, wherein the method comprises the following steps:
detecting actual operation parameters of the initial clicker at each moment in real time when the initial clicker operates on the screen to be clicked by using the sensor assembly;
and correcting the position planning of the initial clicker array according to the actual operation parameters and the corresponding initial operation parameters when the initial clicker at each moment operates on the screen to be clicked, so as to obtain a target clicker array.
Optionally, after the automatic testing of the screen to be clicked under the preset test script is completed, the method further includes:
providing an automatic test case, and determining a target clicker of the target clicker array at each moment and a corresponding target operation instruction according to the automatic test case; the target operation instruction is used for controlling the target clicker to operate according to corresponding target operation parameters;
And respectively controlling each target clicker to operate on the screen to be clicked according to the corresponding moment of each target clicker and the corresponding target operation instruction of each target clicker, and completing the automatic test of the screen to be clicked under the automatic test case.
In addition, the invention also provides an automatic testing system based on the physical clicker, which comprises the following steps:
a plurality of the aforementioned physical clickers;
the planning and mapping module is used for providing a clicker array containing a plurality of physical clickers for a screen to be clicked, and respectively carrying out position planning and coordinate mapping on the clicker array based on the screen to be clicked to obtain a target clicker array; wherein each physical clicker in the target clicker array is in physical contact with the screen to be clicked;
the target clicker determining module is in communication connection with the planning and mapping module and is used for providing a preset test script, and determining a target clicker of the target clicker array at each moment and target operation parameters corresponding to the target clicker according to the preset test script; and
and the clicker control module is in communication connection with the target clicker determining module and is also electrically connected with each physical clicker, and is used for respectively controlling each target clicker according to the corresponding time of each target clicker, operating on the screen to be clicked and completing the automatic test of the screen to be clicked under the preset test script.
In addition, the invention also provides an automatic testing device which comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein the computer program realizes the method steps in the automatic testing method based on the physical clicker when running.
The invention has the beneficial effects that: the click head is in physical contact with the screen to be clicked, a corresponding operation instruction is obtained through the control unit, the driving unit generates a driving signal according to the operation instruction, and the physical clicker can be driven to operate on the physically contacted screen to be clicked according to the operation parameter corresponding to the operation instruction, so that the action of simulating the screen clicking by a human hand through physical response can be realized; laying out an initial clicker array on a screen to be clicked based on the plurality of physical clickers; because the initial clicker array is obtained through position planning and coordinate mapping, the behavior corresponding to screen clicking in the preset test script can be simulated based on the initial clicker array, and the automatic test of the preset test script is realized by determining the initial clickers and corresponding initial operation instructions at each moment and operating on the screen to be clicked according to the initial clickers and the corresponding initial operation instructions, namely, the real simulation of screen clicking in the preset test script is realized;
According to the physical clicker and the automatic testing method, system and device based on the physical clicker, full-range coverage of a screen can be realized through layout of a plurality of physical clickers; the high-speed and high-precision screen clicking operation is realized based on the layout and the control mechanism of the physical clicker, the complexity of the operation is greatly simplified, the operation of a real user is truly simulated, the reliability is high, and the safety risk rate is low; based on the small cost of the physical clicker, the test cost in the automatic test process of the whole screen click is effectively saved.
Drawings
The features and advantages of the present invention will be more clearly understood by reference to the accompanying drawings, which are illustrative and should not be construed as limiting the invention in any way, in which:
FIG. 1 is a block diagram of a physical clicker in accordance with a first embodiment of the present invention;
FIG. 2 is a flow chart of an automated testing method based on a physical clicker in a second embodiment of the invention;
FIG. 3 is a block diagram of an automated testing system based on a physical clicker in accordance with a third embodiment of the present invention;
fig. 4 shows a practical model diagram of an automated test system in a third embodiment of the invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to fall within the scope of the invention.
Example 1
As shown in fig. 1, a physical clicker is used in an automatic testing process of screen clicking, and includes:
the click head is in physical contact with the screen to be clicked;
the control unit is used for acquiring an operation instruction of the click head, and the operation instruction is used for controlling the click head to operate according to the corresponding operation parameters;
the driving unit is electrically connected with the control unit and is used for receiving the operation instruction and generating a driving signal of the click head according to the operation instruction;
the click head is also electrically connected with the driving unit and is used for receiving the driving signal, and operating on the screen to be clicked in physical contact according to the driving signal so as to simulate a human hand to click the screen to be clicked.
According to the physical clicker provided by the embodiment, the click head is in physical contact with the screen to be clicked, the control unit obtains the corresponding operation instruction, the driving unit generates the driving signal according to the operation instruction, and the physical clicker can be driven to operate on the physically contacted screen to be clicked according to the operation parameter corresponding to the operation instruction, so that the behavior of simulating the screen clicking by a human hand through physical response can be realized. Based on the physical clicker, high-speed and high-precision screen clicking operation is convenient to realize, the complexity of the operation is simplified, the operation of a real user is truly simulated, the safety risk rate is reduced, and the reliability is high; and based on the small cost of the physical clicker, the test cost in the automatic test process of the whole screen click can be conveniently saved.
Preferably, as shown in fig. 1, further comprising:
the sensor assembly is electrically connected with the control unit and is used for detecting actual operation parameters of the click head when the click head operates on the screen to be clicked and feeding back the actual operation parameters to the control unit.
Through the sensor assembly, the real-time feedback of operation parameters such as position coordinates can be carried out when the whole physical clicker is operated, the correction of the physical clicker is convenient to realize through feedback, and then the accuracy of the physical clicker for simulating screen clicking is improved.
Preferably, the operation parameter and the actual operation parameter each include a click position, a click action, and a click force.
Through the operation parameters and the real-time operation parameters, accurate screen clicking operation can be realized based on the physical response of the physical clicker.
In this embodiment, the click head, the control unit, the driving unit and the sensor assembly are integrated in one housing, which maintains proper physical contact with the screen to be clicked. The click head can be made of plastic, the shape of the click head can be any regular shape or irregular shape, the shape in the embodiment is square, and the specific size of the click head can be adjusted according to the screen to be clicked. The screen to be clicked comprises a screen of terminal equipment such as a mobile phone, a tablet and the like, and the sensor assembly comprises a position sensor, a pressure sensor, a pose sensor and the like.
Example two
As shown in fig. 2, an automatic testing method based on a physical clicker, which adopts the physical clicker of the first embodiment to automatically test a clicking process of a screen to be clicked, includes:
s1: providing a clicker array containing a plurality of physical clickers for the screen to be clicked, and respectively carrying out position planning and coordinate mapping on the clicker array based on the screen to be clicked to obtain an initial clicker array; wherein each of the physical clickers in the initial clicker array is in physical contact with the screen to be clicked;
S2: providing a preset test script, and determining an initial clicker of the initial clicker array at each moment and a corresponding initial operation instruction according to the preset test script; the initial operation instruction is used for controlling the initial clicker to operate according to corresponding initial operation parameters;
s3: and respectively controlling each initial clicker to operate on the screen to be clicked according to the moment corresponding to each initial clicker and the initial operation instruction corresponding to each initial clicker, and completing the automatic test of the screen to be clicked under the preset test script.
Laying out an initial clicker array on a screen to be clicked based on the plurality of physical clickers in the first embodiment; because the initial clicker array is obtained through position planning and coordinate mapping, the behavior corresponding to screen clicking in the preset test script can be simulated based on the initial clicker array, and the automatic test of the preset test script is realized by determining the initial clickers and corresponding initial operation instructions at each time and operating on the screen to be clicked according to the initial clickers and the corresponding initial operation instructions, namely, the real simulation of screen clicking in the preset test script is realized.
According to the automatic testing method based on the physical clickers, full-range coverage of the screen can be achieved through layout of a plurality of physical clickers; the high-speed and high-precision screen clicking operation is realized based on the layout and the control mechanism of the physical clicker, the complexity of the operation is greatly simplified, the operation of a real user is truly simulated, the reliability is high, and the safety risk rate is low; based on the small cost of the physical clicker, the test cost in the automatic test process of the whole screen click is effectively saved.
Preferably, in S1, based on the screen to be clicked, the position planning and the coordinate mapping are performed on the clicker array respectively, including:
s11: acquiring size information and layout information of the screen to be clicked;
s12: performing position planning on each physical clicker in the clicker array according to the size information and the layout information;
s13: and establishing a coordinate system based on the screen to be clicked, and carrying out coordinate mapping on each physical clicker after position planning to obtain the center coordinate of each physical clicker under the coordinate system.
The position planning is carried out based on the size information and the layout information, so that the clicker array is adapted to the screen to be clicked as much as possible, and the coverage of the whole screen range is realized; the method comprises the steps of establishing a coordinate system with a screen to be clicked and carrying out coordinate mapping, finding out a mapping relation between the screen and the positions of the physical clickers, and obtaining the central coordinate of each physical clicker in the whole clicker array under the coordinate system, so that the position coordinates of the physical clickers on the screen to be clicked can be conveniently controlled subsequently, and the physical clickers can be ensured to truly and accurately simulate the operation behaviors of clicking the screen by hands of people in a preset test script.
Specifically, the size information of the present embodiment refers to the size of the length, width (for a square screen to be clicked) or diameter (for a round screen to be clicked) of the screen to be clicked, and the number of physical clickers of the clicker array on each row, each column (for a square screen to be clicked) or circumference (for a round screen to be clicked) can be determined. The layout information refers to information such as edge data of a screen to be clicked and element data inherent to the screen to be clicked; the edge data refer to the shape, size and other data of the edge of the screen, for example, when four corners of the edge of the screen to be clicked are rounded corners, the edge data refer to the shape and size of the rounded corners; the inherent element data of the screen to be clicked refers to the shape, the size and the like of the touch keys, if 3 touch keys are arranged on the screen to be clicked, the element data is the shape and the size of the 3 touch keys.
It should be understood that, since the physical clicker itself has a certain size, the coordinates (i.e., center coordinates) of the center of the physical clicker in the coordinate system obtained by the coordinate mapping are referred to as center coordinates in the following description of the coordinates of the physical clicker.
Preferably, in S2, the determining, according to the preset test script, an initial clicker of the initial clicker array at each time and a corresponding initial operation instruction includes:
S21: acquiring the preset test script and a test screen shot of the preset test script at each time by using an automation engine;
s22: analyzing the test screen shots at each moment to obtain screen click coordinate information at each moment;
s23: analyzing the preset test script to obtain screen clicking operation corresponding to the screen clicking coordinate information at each moment;
s24: determining the initial clicker at each moment according to the screen click coordinate information at each moment and the central coordinates of all the physical clickers in the coordinate system;
s25: determining the initial operation parameters corresponding to the initial clicker at each moment according to the screen clicking operation corresponding to the screen clicking coordinate information at each moment; and generating the initial operation instruction corresponding to the initial clicker at each moment according to the initial operation parameter corresponding to the initial clicker at each moment.
An automation engine, referred to as an Agent in a computer system, is a software entity with adaptability and intelligence that can perform a task in an active service manner on behalf of a user or other program. The Agent should have at least the following key attributes: (1) autonomy: the Agent has its own computing resources and a mechanism local to its own behavior control, and can determine and control its own behavior according to its internal state and perceived (external) environmental information without external direct manipulation. (2) Interactivity: can interact with other agents in various forms and can effectively cooperate with other agents. (3) Reactivity: the environment can be perceived and the related events can be timely responded. (4) Initiative is that: active action can be taken following the commitment, exhibiting goal-oriented behavior. (5) Reasoning and planning capabilities: agents have the ability to learn knowledge and experience and make relevant inferences and intelligent calculations.
In this embodiment, an automation engine (Agent) may automatically obtain a preset test script in a computer and a corresponding test screenshot at each moment; specific screen clicking operations (such as single click, double click, long press and the like) at each moment can be known through analysis of the whole preset test script, and screen clicking coordinate information for executing the screen clicking operations at each moment can be determined through analysis of test screen shots; because of the mapping relation between the position coordinates of the screen and the physical clicker, the corresponding initial clicker (namely which physical clicker is used for executing the operation) can be determined based on the screen click coordinate information, and the initial operation instruction (for controlling the click position, the click action and the click force of the initial clicker) corresponding to the initial clicker can be generated based on the screen click operation; based on the determined initial clicker at each time and the corresponding initial operation instruction, the automatic test of the preset test script is facilitated, and the real simulation of screen clicking in the preset test script is realized by controlling the initial clicker at each time, so that the accurate and reliable automatic test is realized.
It should be understood that, the screen clicking operation refers to a specific operation (such as a single click, a double click or a long press) of clicking the screen by a human hand in the preset test case, and the screen clicking coordinate information refers to a specific position coordinate of clicking the screen by the human hand in the preset test case; the initial operation parameters comprise the clicking position, clicking action and clicking force of the initial clicker, and the parameters are closely related to specific operations of clicking a screen by a human hand in a preset test case, so that the initial operation parameters corresponding to the initial clicker at each moment can be analyzed according to the screen clicking operation corresponding to the screen clicking coordinate information at each moment; the specific location coordinates of the screen clicked by the human hand may determine an initial clicker, which may be the physical clicker closest to the specific location coordinates of the screen clicked by the human hand.
Preferably, the physical clicker further comprises a sensor assembly electrically connected to the control unit; in S3, according to the time corresponding to each initial clicker, according to the initial operation instruction corresponding to each initial clicker, each initial clicker is controlled to operate on the screen to be clicked, where the method further includes:
Detecting actual operation parameters of the initial clicker at each moment in real time when the initial clicker operates on the screen to be clicked by using the sensor assembly;
and correcting the position planning of the initial clicker array according to the actual operation parameters and the corresponding initial operation parameters when the initial clicker at each moment operates on the screen to be clicked, so as to obtain a target clicker array.
The sensor component is utilized to detect the actual operation parameters of the initial clicker in real time and feed back the actual operation parameters, and the screen click simulation process of the initial click head can be corrected by utilizing the difference between the actual operation parameters and the initial operation parameters, so that the feedback adjustment is realized; the difference between the actual operation parameters and the initial operation parameters is mainly reflected on the position planning of the initial clicker array, namely, the layout of the initial clicker array is not optimal, so that the obtained target clicker array can effectively realize the layout optimization of the clicker array by correcting the position planning of the initial clicker array, and further, the accuracy of screen clicking based on the physical clicker simulation is further improved.
Preferably, after S3, the method further comprises:
Providing an automatic test case, and determining a target clicker of the target clicker array at each moment and a corresponding target operation instruction according to the automatic test case; the target operation instruction is used for controlling the target clicker to operate according to corresponding target operation parameters;
and respectively controlling each target clicker to operate on the screen to be clicked according to the corresponding moment of each target clicker and the corresponding target operation instruction of each target clicker, and completing the automatic test of the screen to be clicked under the automatic test case.
According to the same simulation and automation test method of the preset test script, one or more automatic test cases are adopted, the target clicker and the corresponding target operation instruction of the operation behavior of clicking the screen by the hand in the automatic test cases at each moment are determined based on the optimized target clicker array and the automatic test cases, then the target clicker array is controlled based on the target clicker and the target operation instruction, so that the automatic test of high-speed, high-precision, low-complexity, low-cost, low-safety risk and high-reliability automatic test is truly realized, and the automatic test of screen clicking under different environments can be adapted.
The structure of the physical clicker in this embodiment is the same as that of one of the embodiments, so that details of this embodiment are not fully described in detail in the first embodiment and the detailed description of fig. 1, and are not repeated here.
Example III
As shown in fig. 3, an automated testing system based on a physical clicker includes:
a physical clicker of embodiment one;
the planning and mapping module is used for providing a clicker array containing a plurality of physical clickers for a screen to be clicked, and respectively carrying out position planning and coordinate mapping on the clicker array based on the screen to be clicked to obtain a target clicker array; wherein each physical clicker in the target clicker array is in physical contact with the screen to be clicked;
the target clicker determining module is in communication connection with the planning and mapping module and is used for providing a preset test script, and determining a target clicker of the target clicker array at each moment and target operation parameters corresponding to the target clicker according to the preset test script; and
and the clicker control module is in communication connection with the target clicker determining module and is also electrically connected with each physical clicker, and is used for respectively controlling each target clicker according to the corresponding time of each target clicker, operating on the screen to be clicked and completing the automatic test of the screen to be clicked under the preset test script.
The automatic testing system based on the physical clickers can realize full-range coverage of the screen through the layout of a plurality of physical clickers; the high-speed and high-precision screen clicking operation is realized based on the layout and the control mechanism of the physical clicker, the complexity of the operation is greatly simplified, the operation of a real user is truly simulated, the reliability is high, and the safety risk rate is low; based on the small cost of the physical clicker, the test cost in the automatic test process of the whole screen click is effectively saved.
In a specific embodiment, in the planning and mapping module, the position planning of the clicker array on the screen to be clicked can be realized manually, the coordinate mapping can be realized by a computer, and the center coordinates of the physical clickers in the target clicker array obtained after the coordinate mapping are stored in the computer; the target clicker determining module is realized by a computer, and functional units such as a screen capture recording unit, an Agent, an intelligent positioning unit, a data transmission unit and the like are integrated in the computer; the clicker control module can be realized by a main control board, the main control board comprises an MCU and a plurality of interfaces, the number of the interfaces is the same as that of the physical clickers, all the interfaces are in one-to-one correspondence with all the physical clickers, and each physical clicker is electrically connected with the main control board through the corresponding interface.
A complete model diagram of the physical clicker-based automated test system in this embodiment is shown in fig. 4 (screen recording unit and data transmission unit, not shown).
The functions of the automatic testing system based on the physical clicker in this embodiment correspond to the steps of the automatic testing method based on the physical clicker in the second embodiment, where the physical clicker is the same as the physical clicker in the first embodiment, and details of the details in this embodiment are described in detail in the first embodiment, the second embodiment, and fig. 1 to 2, which are not described herein again.
Example IV
An automated physical clicker-based testing apparatus includes a processor, a memory, and a computer program stored in the memory and executable on the processor, the computer program when run implementing the method steps in the automated physical clicker-based testing method of embodiment one.
The high-speed and high-precision screen clicking operation is realized through the computer program stored in the memory and operated on the processor, so that the complexity of the operation is greatly simplified, the operation of a real user is truly simulated, the reliability is high, and the safety risk rate is low; based on the small cost of the physical clicker, the test cost in the automatic test process of the whole screen click is effectively saved.
The processor may be a central processing unit (Central Processing Unit, CPU), other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, the processor being a control center of the computer device, and the various interfaces and lines connecting the various parts of the overall computer device.
The memory may be used to store computer programs and/or models, and the processor implements various functions of the computer device by running or executing the computer programs and/or models stored in the memory, and invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (e.g., a sound playing function, an image playing function, etc.); the storage data area may store data (e.g., audio data, video data, etc.) created according to the use of the handset. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart Media Card (SMC), secure Digital (SD) Card, flash Card (Flash Card), at least one disk storage device, flash memory device, or other volatile solid-state storage device.
It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer programs. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer programs may also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer programs may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Similarly, the details of the embodiment are not fully described in detail in the first embodiment, the second embodiment, the third embodiment and fig. 1 to 4, and are not repeated here.
A specific embodiment will be provided below to demonstrate the contents and functions of the present invention.
Implementation case:
in the embodiment, the method is applied to the mobile phone/tablet/computer screen simulated click, and a technical product named as' Octopus by simulating the screen click through physical response is designed. First, the "Octopus" consists of a number of small physical clickers arranged on the cell phone screen to completely cover the screen range.
The operating principle of the 'Bazhulong' is to simulate the clicking operation of a real user through the contact with a mobile phone screen. The eight-claw dragon comprises a plurality of small physical clickers and a main control board, each small physical clicker is connected to the main control board, the main control board detects operation parameters such as the position, the touch strength and the like of a target screen through a built-in intelligent algorithm and a sensor, and the main control board is connected with a USB interface of a computer to realize communication interaction between the two; the computer can adjust the arrangement of the physical clickers based on the operation parameters, thereby realizing accurate clicking operation.
In the test scenario, "octopus" may also be integrated with automated test software in a computer, integrating the automated test software into a control unit for touch control (control unit called touch master) in the main control board. The user may load test cases into the control unit using test scripts or test tools. The control unit can control each small physical clicker to perform clicking operation according to the test script instruction, and the target area on the screen is completely covered.
For example:
a mobile application program to be tested has a login page including user name, cipher input box and login button. The process of automated testing using "Bazhulong" is as follows:
firstly, loading a test script into a control unit for touch control in a main control board of 'Bazhulong', wherein the script designates a position, the clicking times and the clicking force for clicking operation on a landing page (wherein the clicking times and the clicking force jointly determine whether clicking is single click, double click or long press).
Then, when the test starts, the control unit of the 'Bazhulong' identifies and positions target elements on a screen in the script instruction according to the script instruction and a built-in intelligent algorithm, ensures accurate clicking to a target position, controls each small physical clicker to position to a designated position, and simulates clicking operation of a user. For example, one physical clicker is positioned on the user name input box, another physical clicker is positioned on the password input box, and a third physical clicker is positioned on the login button.
Finally, the control unit sequentially activates each physical clicker to finish clicking operation according to a preset sequence, clicking times and clicking force.
In this embodiment, a click operation with full coverage on the cell phone screen can be achieved through the physical response clicker scheme of "Octopus". Whether the test is a landing page or other pages, accurate and efficient automatic test can be realized by controlling a small physical clicker.
The physical clicker and the automatic testing method, system and device based on the physical clicker have the following advantages:
a. full coverage screen scope
The physical clickers are arranged on the mobile phone screen, so that the whole screen range can be covered, and clicking operation can be performed at any position. Through the whole coverage, any screen area can not be missed, and the comprehensiveness and accuracy of the test are ensured.
b. High precision click operation
Each physical clicker can be precisely controlled, and high-precision clicking operation can be realized. Through accurate location and control, can ensure that the clicker can click the target position accurately, realize accurate screen operation, can improve automated testing's accuracy and reliability.
c. High speed click operation
The arrangement and control mechanism of the physical clicker can realize high-speed clicking operation; the physical clicker can click fast, realize the quick continuous click action, can improve speed and efficiency of test, can save time and resource greatly to extensive automation test task.
d. Simulating real user operation
Because the clicker based on physical response simulates the touch operation of human fingers, the operation behavior of a user can be more truly simulated. Compared with the traditional software simulation scheme, the physical response clicker scheme is closer to the interaction mode of a real user, can better simulate the operation path and gestures of the user, and improves the authenticity of the test.
e. The cost is saved:
compared with the traditional mechanical arm simulation scheme, the cost of using the physical clicker is only about 1/10 of that of the mechanical arm scheme, so that the test cost is greatly saved, and the mechanical arm simulation system is more suitable for small and medium enterprises.
Although embodiments of the present invention have been described in connection with the accompanying drawings, various modifications and variations may be made by those skilled in the art without departing from the spirit and scope of the invention, and such modifications and variations are within the scope of the invention as defined by the appended claims.

Claims (10)

1. A physical clicker for use in an automated testing process for screen clicking, comprising:
the click head is in physical contact with the screen to be clicked;
the control unit is used for acquiring an operation instruction of the click head, and the operation instruction is used for controlling the click head to operate according to the corresponding operation parameters;
the driving unit is electrically connected with the control unit and is used for receiving the operation instruction and generating a driving signal of the click head according to the operation instruction;
the click head is also electrically connected with the driving unit and is used for receiving the driving signal, and operating on the screen to be clicked in physical contact according to the driving signal so as to simulate a human hand to click the screen to be clicked.
2. The physical clicker of claim 1 further comprising:
the sensor assembly is electrically connected with the control unit and is used for detecting actual operation parameters of the click head when the click head operates on the screen to be clicked and feeding back the actual operation parameters to the control unit.
3. The physical clicker of claim 1 or 2 wherein the operating parameter and the actual operating parameter each comprise a click location, a click action and a click force.
4. An automated testing method based on a physical clicker, wherein a plurality of physical clickers according to any one of claims 1 to 3 are used to automatically test a clicking process of a screen to be clicked, the method comprising:
providing a clicker array containing a plurality of physical clickers for the screen to be clicked, and respectively carrying out position planning and coordinate mapping on the clicker array based on the screen to be clicked to obtain an initial clicker array; wherein each of the physical clickers in the initial clicker array is in physical contact with the screen to be clicked;
providing a preset test script, and determining an initial clicker of the initial clicker array at each moment and a corresponding initial operation instruction according to the preset test script; the initial operation instruction is used for controlling the initial clicker to operate according to corresponding initial operation parameters;
and respectively controlling each initial clicker to operate on the screen to be clicked according to the moment corresponding to each initial clicker and the initial operation instruction corresponding to each initial clicker, and completing the automatic test of the screen to be clicked under the preset test script.
5. The method of claim 4, wherein the performing location planning and coordinate mapping on the clicker array based on the screen to be clicked comprises:
acquiring size information and layout information of the screen to be clicked;
performing position planning on each physical clicker in the clicker array according to the size information and the layout information;
and establishing a coordinate system based on the screen to be clicked, and carrying out coordinate mapping on each physical clicker after position planning to obtain the center coordinate of each physical clicker under the coordinate system.
6. The method of claim 5, wherein determining the initial clicker of the initial clicker array at each time instant and the corresponding initial operation instructions according to the preset test script comprises:
acquiring the preset test script and a test screen shot of the preset test script at each time by using an automation engine;
analyzing the test screen shots at each moment to obtain screen click coordinate information at each moment;
analyzing the preset test script to obtain screen clicking operation corresponding to the screen clicking coordinate information at each moment;
Determining the initial clicker at each moment according to the screen click coordinate information at each moment and the central coordinates of all the physical clickers in the coordinate system;
determining the initial operation parameters corresponding to the initial clicker at each moment according to the screen clicking operation corresponding to the screen clicking coordinate information at each moment; and generating the initial operation instruction corresponding to the initial clicker at each moment according to the initial operation parameter corresponding to the initial clicker at each moment.
7. The method of claim 4, wherein the physical clicker further comprises a sensor assembly electrically connected to the control unit; the method further comprises the steps of respectively controlling each initial clicker after the screen to be clicked operates according to the initial operation instruction corresponding to each initial clicker according to the time corresponding to each initial clicker, wherein the method comprises the following steps:
detecting actual operation parameters of the initial clicker at each moment in real time when the initial clicker operates on the screen to be clicked by using the sensor assembly;
And correcting the position planning of the initial clicker array according to the actual operation parameters and the corresponding initial operation parameters when the initial clicker at each moment operates on the screen to be clicked, so as to obtain a target clicker array.
8. The method of claim 7, wherein after the automated testing of the screen to be clicked under the preset test script is completed, the method further comprises:
providing an automatic test case, and determining a target clicker of the target clicker array at each moment and a corresponding target operation instruction according to the automatic test case; the target operation instruction is used for controlling the target clicker to operate according to corresponding target operation parameters;
and respectively controlling each target clicker to operate on the screen to be clicked according to the corresponding moment of each target clicker and the corresponding target operation instruction of each target clicker, and completing the automatic test of the screen to be clicked under the automatic test case.
9. An automated testing system based on a physical clicker, comprising:
A plurality of physical clickers according to any one of claims 1 to 3;
the planning and mapping module is used for providing a clicker array containing a plurality of physical clickers for a screen to be clicked, and respectively carrying out position planning and coordinate mapping on the clicker array based on the screen to be clicked to obtain a target clicker array; wherein each physical clicker in the target clicker array is in physical contact with the screen to be clicked;
the target clicker determining module is in communication connection with the planning and mapping module and is used for providing a preset test script, and determining a target clicker of the target clicker array at each moment and target operation parameters corresponding to the target clicker according to the preset test script; and
and the clicker control module is in communication connection with the target clicker determining module and is also electrically connected with each physical clicker, and is used for respectively controlling each target clicker according to the corresponding time of each target clicker, operating on the screen to be clicked and completing the automatic test of the screen to be clicked under the preset test script.
10. An automated test apparatus comprising a processor, a memory and a computer program stored in the memory and executable on the processor, the computer program when run implementing the method steps of any one of claims 4 to 8.
CN202310855699.9A 2023-07-13 2023-07-13 Physical clicker and automatic test method, system and device based on physical clicker Pending CN116908586A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310855699.9A CN116908586A (en) 2023-07-13 2023-07-13 Physical clicker and automatic test method, system and device based on physical clicker

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310855699.9A CN116908586A (en) 2023-07-13 2023-07-13 Physical clicker and automatic test method, system and device based on physical clicker

Publications (1)

Publication Number Publication Date
CN116908586A true CN116908586A (en) 2023-10-20

Family

ID=88362243

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310855699.9A Pending CN116908586A (en) 2023-07-13 2023-07-13 Physical clicker and automatic test method, system and device based on physical clicker

Country Status (1)

Country Link
CN (1) CN116908586A (en)

Similar Documents

Publication Publication Date Title
US20230364799A1 (en) Touch Screen Testing Platform for Engaging a Dynamically Positioned Target Feature
Lin et al. On the accuracy, efficiency, and reusability of automated test oracles for android devices
Gomez et al. Reran: Timing-and touch-sensitive record and replay for android
US9747191B1 (en) Tool to replicate actions across devices in real time for improved efficiency during manual application testing
CN108959068B (en) Software interface testing method, device and storage medium
Mao et al. Robotic testing of mobile apps for truly black-box automation
CN106687922B (en) Parametric inertia and API
CN105824755B (en) A kind of automated testing method, device and mobile terminal
CN107666987A (en) Robotic process automates
US20110310041A1 (en) Testing a Touch-Input Program
CN108351828A (en) Technology for device-independent automatic application test
CN107395844B (en) Test device, method, system, medium, apparatus, and computing device
US20190303110A1 (en) Virtual reality integrated development environment
Wang et al. Automatic Android GUI traversal with high coverage
CN103984626A (en) Method and device for generating test-case script
CN113934630A (en) Software testing method, device, equipment and medium based on image recognition
US20230035104A1 (en) Verification method, apparatus and device, and storage medium
CA3185359A1 (en) Intelligent automation of ui interactions
US20080154573A1 (en) Simulating new input devices using old input devices
JP2016525731A (en) Program test service
CN111190826A (en) Testing method and device for virtual reality immersive tracking environment, storage medium and equipment
Choi et al. Emulating your extended world: An emulation environment for xr app development
US20160252974A1 (en) Communicating with an unsupported input device
CN116908586A (en) Physical clicker and automatic test method, system and device based on physical clicker
US20230169399A1 (en) System and methods for robotic process automation

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