CN103135986B - A kind of operation acquisition method and system - Google Patents
A kind of operation acquisition method and system Download PDFInfo
- Publication number
- CN103135986B CN103135986B CN201310031157.6A CN201310031157A CN103135986B CN 103135986 B CN103135986 B CN 103135986B CN 201310031157 A CN201310031157 A CN 201310031157A CN 103135986 B CN103135986 B CN 103135986B
- Authority
- CN
- China
- Prior art keywords
- information
- control
- window
- message
- identity information
- 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.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 22
- 230000000977 initiatory effect Effects 0.000 claims abstract description 123
- 230000009471 action Effects 0.000 claims description 24
- 238000002372 labelling Methods 0.000 claims description 20
- 230000008569 process Effects 0.000 claims description 6
- 238000010230 functional analysis Methods 0.000 abstract 1
- 230000006870 function Effects 0.000 description 66
- 238000012360 testing method Methods 0.000 description 29
- 238000013515 script Methods 0.000 description 14
- 238000011161 development Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 108700031196 mouse lisch-like Proteins 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 230000004913 activation Effects 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Telephonic Communication Services (AREA)
Abstract
The invention discloses a kind of operation acquisition method and system, wherein, described operation acquisition method comprises the identity information and auxiliary descriptor that obtain control, by the identity information of described control and auxiliary descriptor write interface database; Obtain the initiation message of input equipment operational motion, according to the Functional Analysis of described initiation message call, cause message, obtain the identity information of the source control of described initiation message; The identity information of source control causing message is mated with the identity information in interface database, if the match is successful, then obtain the auxiliary descriptor associated with the identity information of the source control of described initiation message in interface database, call function obtains the operation information of described initiation message, according to the operation information generating run record of described auxiliary descriptor and described initiation message.Adopt operation acquisition method of the present invention and system, achieve the operation collection to form control and non-form control, promote the experience of user.
Description
Technical Field
The invention relates to the field of data acquisition, in particular to an operation acquisition method and system.
Background
Currently, a common operation acquisition tool mainly integrates an operation recording function into a test automation tool, and realizes automatic execution of a User Interface (UI) test by recording operation of an application and generating a test script. Typical tools are RatinalFunctionTestter from International Business Machines (IBM), QuickTestProfesial from Hewlett packard, and TestQuestPro from TestQuest.
The ratiofencationlteterter of IBM corporation is an automated testing tool that a user can use to record the running of an application and generate a test script. The user may select the scripting language and development environment of the tool, including Java in the Eclipse framework or microsoft visual basic. net in the microsoft visual studio. net development environment. When recording the script, the RationalFunctionalTester automatically creates a test object map for the application under test, i.e., the test object. The test object map includes an identification attribute for each test object. When the user updates the recorded information in the test object map, any script using the test object map shares the updated information, thereby reducing the maintenance cost and the complexity of the whole script development. The test object map also provides a way for the user to quickly add test objects to the script. Verification points may be inserted into the script during logging to determine the state of the test object during the build of the application under test.
The QuickTestProfectional is a functional regression testing tool provided by Hewlett-packard company, can record the operation of a user, is automatically compiled into a testing script by using a VBScript language, and the user can play back the testing script by modifying the testing script and parameterizing testing data, so that the input and clicking of the user are simulated, and the aim of automatic testing is fulfilled.
TestQuestPro is an automated testing tool that also provides script recording functionality. The TestQuestPro comprises three main modules, namely a script recorder, a test information manager and a test execution controller, and the integration of the three modules can create test work, integrate into a test state and execute a test. The script recorder is the core of TestQuestPro, which creates test scripts and defines instances by recording key presses.
However, although the above three operation acquisition tools can record operations to a certain extent, they can only identify window controls and cannot identify non-window controls, and the conventional military command system software largely adopts non-window controls, so that the conventional operation acquisition tools cannot be applied to operation acquisition of the military command system.
Disclosure of Invention
In view of this, the main objective of the present invention is to provide an operation acquisition method and system, which achieve operation acquisition of window controls and non-window controls, and improve user experience.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
the invention provides an operation acquisition method, which comprises the following steps:
acquiring identity information and auxiliary description information of a control, and writing the identity information and the auxiliary description information of the control into an interface library;
acquiring an initiation message of an operation action of input equipment, calling a function according to the initiation message, analyzing the initiation message, and acquiring identity information of a source control of the initiation message;
matching the identity information of the source control of the initiation message with the identity information in the interface library, if the matching is successful, acquiring auxiliary description information associated with the identity information of the source control of the initiation message in the interface library, calling a function to acquire operation information of the initiation message, and generating an operation record according to the auxiliary description information and the operation information of the initiation message.
In the foregoing solution, the acquiring the identity information and the auxiliary description information of the control includes:
for a window control, calling a function to acquire a window handle of the window control, and acquiring identity information of the window control by using the window handle, wherein the identity information comprises application program information of an application program to which the window control belongs and window information of the window control;
for a non-window control, calling a function to acquire a window handle of a window to which the non-window control belongs, and acquiring identity information of the window to which the non-window control belongs by using the window handle of the window to which the non-window control belongs, wherein the identity information comprises application information of a subordinate application program of the window to which the non-window control belongs and window information of the window to which the non-window control belongs; identifying the region of the non-window control in the subordinate window through a control marking tool, and acquiring the region information of the non-window control in the subordinate window; forming the identity information of the non-window control by the identity information of the window to which the non-window control belongs and the area information of the non-window control in the subordinate window;
and setting auxiliary description information of the control, including the type and the title of the control.
In the foregoing solution, the writing the identity information and the auxiliary description information of the control into the interface library includes:
writing the application program information into an application program table in an interface library;
writing the form information into an identification control table in an interface library;
and for the non-form control, further writing the area information of the control in the attached form into a labeling control table in an interface library.
In the above scheme, the invoking a function according to the triggering message to analyze the triggering message, and acquiring the identity information of the source control of the triggering message includes:
calling a system programming interface function according to the triggering message to analyze the triggering message, and if the source control of the triggering message is a window control, acquiring application program information of an application program to which the source control of the triggering message belongs and the window information of the source control of the triggering message as identity information of the source control of the triggering message;
and if the source control for triggering the message is a non-window control, acquiring application program information of a subordinate application program of a window to which the source control for triggering the message belongs and window information of the window to which the source control for triggering the message belongs as identity information of the source control for triggering the message.
In the above scheme, the matching the identity information of the source control that causes the message with the identity information in the interface library includes:
matching the application program information in the identity information of the source control which causes the message with the application program information in an application program table in an interface library;
if the matching is successful, matching the form information in the identity information of the source control of the triggering message with an identification control table in an interface library;
if the window information in the identity information of the source control initiating the message is successfully matched with the window information corresponding to the application program information in the identification control table, judging whether the source control initiating the message is a non-window control, and if the judgment result is negative, ending the matching process;
if the judgment result is yes, acquiring position information of the operation action by calling a system programming interface function according to the operation action, matching the position information with a labeling control table in an interface library, and if the position information is in the region information corresponding to the window information in the labeling control table, successfully matching and ending the matching process.
In the above scheme, the obtaining auxiliary description information associated with the identity information of the source control of the initiation message in the interface library, calling a function to obtain operation information of the initiation message, and generating an operation record according to the auxiliary description information and the operation information of the initiation message includes:
acquiring auxiliary description information associated with identity information of a source control of the initiation message in an interface library, wherein the auxiliary description information comprises the type and the title of the source control of the initiation message;
calling a function to obtain operation information of the triggering message, wherein the operation information of the triggering message comprises operation occurrence time, an Internet Protocol (IP) address of a terminal where the operation occurs, control operation of the triggering message, operation content of a triggering message control and software information of the control;
and generating an operation record according to the auxiliary description information and the operation information of the triggering message.
The invention provides an operation acquisition system, which comprises an information acquisition end, an interface library and an operation acquisition end, wherein the information acquisition end is connected with the interface library; wherein,
the information acquisition terminal is used for acquiring the identity information and the auxiliary description information of the control and writing the identity information and the auxiliary description information into an interface library;
the interface library is used for storing the identity information and the auxiliary description information sent by the information acquisition end;
the operation acquisition terminal acquires an initiation message of an operation action of the input equipment, calls a function according to the initiation message and analyzes the initiation message to acquire identity information of a source control of the initiation message; matching the identity information of the source control of the initiation message with the identity information in the interface library, if the matching is successful, acquiring auxiliary description information associated with the identity information of the source control of the initiation message in the interface library, calling a function to acquire operation information of the initiation message, and generating an operation record according to the auxiliary description information and the operation information of the initiation message.
In the scheme, the information acquisition end comprises an information identification module, an information labeling module and an information setting module; wherein,
the information identification module is used for calling a function to acquire a window handle of the window control when the control type is the window control, acquiring the identity information of the window control by using the window handle and writing the identity information of the window control into an interface library; when the control type is a non-window control, calling a function to acquire a window handle of a window to which the non-window control belongs, acquiring identity information of the window to which the non-window control belongs by using the handle of the window to which the control belongs, and writing the identity information of the window to which the non-window control belongs into an interface library; the identity information of the form control comprises application program information and form information of an application program to which the form control belongs;
the information marking module is used for marking the area of the non-window control in the subordinate window when the control type is the non-window control, acquiring the area information of the non-window control in the subordinate window, and writing the area information of the non-window control in the subordinate window into an interface library;
the information setting module is used for setting the auxiliary description information of the control, including the type and the title of the control, and writing the auxiliary description information of the control into an interface library.
In the above scheme, the interface library is specifically configured to store an application table, an identification control table, a labeling control table, and auxiliary description information of the control; wherein,
the application program table stores the application program information;
the identification control table stores the form information;
and the labeling control table stores the area information of the non-form control in the affiliated form.
In the above scheme, the operation acquisition end comprises an operation message acquisition module, an operation message analysis module, an operation message matching module and an operation message generation module; wherein,
the operation message acquisition module is used for acquiring an initiation message of an operation action of the input equipment and sending the initiation message to the operation message analysis module;
the operation message analysis module is used for calling a function to analyze the triggering message according to the triggering message sent by the operation message acquisition module, acquiring the identity information of the source control of the triggering message and sending the identity information of the source control to the operation message matching module;
the operation message matching module is used for matching the identity information of the source control sent by the operation message analysis module with the identity information in the interface library, sending a notification message to the operation message analysis module when the matching is successful, acquiring auxiliary description information associated with the identity information of the source control initiating the message in the interface library, and sending the auxiliary description information to the operation message generation module;
correspondingly, the operation message analysis module is further configured to receive a matching success notification message sent by the operation message matching module, call a function to obtain operation information of the initiation message, where the operation information includes time when the operation occurs, an IP address of a terminal where the operation occurs, a control operation of the initiation message, operation content of the control of the initiation message, and software information to which the control belongs, and send the operation information to the operation message generation module;
the operation message generating module is used for generating an operation record according to the auxiliary description information associated with the identity information of the source control of the initiation message sent by the operation message matching module and the operation information of the initiation message sent by the operation message analyzing module.
According to the operation acquisition method and system provided by the invention, the identity information and the auxiliary description information of the window body control and the non-window body control are acquired and written into an interface library; the method comprises the steps of obtaining an initiation message of an operation action of input equipment, analyzing the initiation message according to the initiation message calling function to obtain identity information of a source control of the initiation message, matching the identity information of the source control of the initiation message with identity information in an interface library, and if the matching is successful, indicating that the initiation message is operation information needing to be collected and generating an operation record.
Drawings
FIG. 1 is a schematic flow diagram of an operational acquisition method of the present invention;
FIG. 2 is a schematic flow chart of a method for matching identity information of a source control initiating a message with identity information in an interface library according to the present invention;
FIG. 3 is a schematic illustration of an operation record generated in the present invention;
fig. 4 is a schematic structural diagram of the operation acquisition system of the present invention.
Detailed Description
The basic idea of the invention is: dividing the control types into a window control and a non-window control, wherein the non-window control is subordinate to a certain window control; acquiring identity information and auxiliary description information of a window control and a non-window control, and writing the identity information and the auxiliary description information into an interface library; acquiring an initiation message of an operation action of input equipment, calling a function according to the initiation message to analyze the initiation message, matching the identity information of a source window of the initiation message with the identity information in an interface library, and if the matching is successful, indicating that the operation information needs to be acquired, and generating an operation record.
The present invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
Fig. 1 is a schematic flow chart of the operation acquisition method of the present invention, as shown in fig. 1, including the following steps:
step 101: acquiring identity information and auxiliary description information of a control, and writing the identity information and the auxiliary description information of the control into an interface library;
here, the obtaining the identity information and the auxiliary description information of the control includes:
for the window control, calling a function to acquire a window handle of the window control, and acquiring identity information of the window control by using the window handle, wherein the identity information comprises application program information of an application program to which the window control belongs and window information of the window control, and at the moment, the identity information of the window is the identity information of the control;
for a non-window control, calling a function to acquire a window handle of a window to which the non-window control belongs, and acquiring identity information of the window to which the non-window control belongs by using the window handle of the window to which the non-window control belongs, wherein the identity information comprises application information of a subordinate application program of the window to which the non-window control belongs and window information of the window to which the non-window control belongs; identifying the region of the non-window control in the subordinate window through a control marking tool, and acquiring the region information of the non-window control in the subordinate window; forming the identity information of the non-window control by the identity information of the window to which the non-window control belongs and the area information of the non-window control in the subordinate window;
and setting auxiliary description information of the control, including the type and the title of the control.
Here, the control type is a form control or a non-form control, which can be identified by a system programming interface function;
the form control can be a Windows control such as a button, an edit box, a check box, a toolbar, a list box, a combination box and the like or a control provided by a high-level language such as VC and the like.
Further, the writing the identity information and the auxiliary description information of the control into the interface library includes:
writing the application program information into an application program table in an interface library;
writing the form information into an identification control table in an interface library;
for the non-form control, further, the area information of the control in the attached form needs to be written into a labeling control table in the interface library.
Specifically, if the control type is a window, executing a system programming interface function by using a window handle (Hwnd) to acquire application program information of a subordinate application program in the identity information of the window control; acquiring the form information in the identity information of the form control by using an Hwnd execution system programming interface function;
the application program information of the subordinate application program comprises a catalog of the application program and a name of the application program;
the window information comprises a layer count value, a window layer title, a window layer class name, a window preorder and a window postorder;
the window layer level titles are the titles of the windows and all the titles of the subordinate windows which are combined according to the level;
the window level class names are class names of the windows and class names of all subordinate windows which are combined according to levels;
and the layer count value is the layer information of the window in the parent window tree.
If the control type is a non-window, executing a system programming interface function by using a handle (Hwnd) of a window to which the non-window control belongs to obtain application program information of a subordinate application program in the identity information of the window to which the non-window control belongs; acquiring window information in the identity information of a window to which the non-window control belongs by using an Hwnd execution system programming interface function of the window to which the non-window control belongs;
installing a WH _ MOUSE _ LL hook, acquiring operation messages of pressing, lifting and moving messages of a MOUSE, sending the operation messages to a control marking tool by the WH _ MOUSE _ LL hook, processing the operation messages to obtain the initial position and the end position of MOUSE input, and acquiring the region information of the non-window control in a subordinate window;
the area information of the non-form control in the membership form comprises an upper left point X coordinate, an upper left point Y coordinate, the length of the non-form control and the width of the non-form control.
Step 102: acquiring an initiation message of an operation action of input equipment, calling a function according to the initiation message, analyzing the initiation message, and acquiring identity information of a source control of the initiation message;
here, the obtaining of the trigger message of the input device operation action, and analyzing the trigger message according to the trigger message calling function, and obtaining the identity information of the source control of the trigger message includes:
acquiring an initiation message of an operation action of input equipment by using a system hook mechanism, acquiring a source control handle according to the initiation message, executing a corresponding hook callback function according to the source control handle, analyzing the initiation message and acquiring identity information of a source control of the initiation message; wherein,
the source control type of the triggering message comprises a form control and a non-form control;
if the source control for triggering the message is a window control, acquiring identity information of the source control for triggering the message, wherein the identity information comprises application program information of an application program to which the source control for triggering the message belongs and window information of the source control for triggering the message, and the window information is used as the identity information of the source control for triggering the message; wherein,
the application program information of the application program affiliated to the source control triggering the message comprises a catalog of the application program and a name of the application program;
the window information of the source control triggering the message comprises a layer count value, a window layer title, a window layer class name, a window preorder and a window postorder;
if the source control for triggering the message is a non-window control, acquiring identity information of the source control for triggering the message, wherein the identity information comprises application program information of a subordinate application program of a window to which the source control for triggering the message belongs and window information of a subordinate window to the source control for triggering the message as identity information of the source control for triggering the message; wherein,
the application program information of the subordinate application program of the source control subordinate form for triggering the message comprises an application program catalog and an application program name of the subordinate application program of the source control subordinate form;
the window information of the window to which the source control triggering the message belongs comprises a layer count value, a window layer title, a window layer class name, a window preorder and a window postorder of the window to which the source control belongs.
Specifically, the acquisition of the initiation message of the operation action of the input device is realized by acquiring various types of operation action initiation messages through Windows Hooks (Hooks); the hook types mainly comprise the following types:
the WH _ CALLNDPROC hook acquires a message sent to a target window;
the WH _ GETMESSAGE hook acquires a message returned from a GetMessage function or a PeekMessage function, namely acquires a message sent to a message queue;
the WH _ KEYBOARD hook is used for acquiring the KEYBOARD operation related information returned by the GetMessage function or the PeekMessage function, namely acquiring the KEYBOARD operation information input into the information queue;
the WH _ MOUSE hook is used for acquiring related information of MOUSE input returned by a GetMessage function or a PeekMessage function, namely acquiring MOUSE input information input into a message queue;
the WH _ SHELL hook is used for acquiring a message triggered when a Windows SHELL application program is activated and a top-layer window is established or closed;
WH _ SYSMSGFILTER hook acquires messages that are caused by all operations on dialog boxes, message boxes, menu bars, and scroll bars in all applications.
All or one of the hook types can be selected and installed through system control, and the hook types are used for acquiring operation actions corresponding to the hook types.
Further, the hook callback functions corresponding to the six hook types include:
an lresultca llbackcallwnproc (intnCode, wparamwparamwparam, lpaaramlparam) function, which executes the callback function, analyzes the message sent to the destination control;
a lresultca llbackgetcmsgpro (intcode, wparamwparamwparam, lpaaramlparamipam) function, which executes the callback function, analyzes the message returned from the GetMessage function or the PeekMessage function, that is, analyzes the message sent to the message queue;
an lresultca llbackkeyboardproc (intocode, WPARAMwParam, lpaaramlparam) function, which executes the callback function, analyzes the keyboard operation related messages returned by the GetMessage function or the PeekMessage function, that is, analyzes the keyboard operation messages input into the message queue;
an lresultca llbackmoueproc (intcode, wparamwparamwparam, lpaaramlparam) function, executes the callback function, analyzes a message related to a mouse operation returned by the GetMessage function or the PeekMessage function, that is, analyzes a message caused by the mouse operation input to the message queue;
LRESULTCALLBACKShellPro (intCode, WPARAMwParam, LPAARAMlParam) function, executes the callback function, analyzes the message caused by activation of the Windows shell application program and establishment or closing of the top-layer window;
lresultca llbacksysmsgsproc (intnCode, wparamwparamwparam param, lpaaramlparamipam) function, which executes the callback function, analyzes messages that are caused by all operations of dialog boxes, message boxes, menu bars, scroll bars in all applications.
Further, for some trigger message operation information, an auxiliary message needs to be sent to the source control window to obtain the trigger message operation information. For example, the operating information of the RichEdit control needs to send a WM _ GETTEXT message to a source control window to return text information input into the RichEdit control and obtain the operating content triggering the message control;
for another example, in order to obtain the tree node information, a TVM _ get message needs to be sent to the source control window, so as to obtain the tree node information of the operation action initiation position.
Step 103 to step 104: matching the identity information of the source control of the initiation message with the identity information in an interface library, if the matching is successful, acquiring auxiliary description information associated with the identity information of the source control of the initiation message in the interface library, calling a function to acquire operation information of the initiation message, and generating an operation record according to the auxiliary description information and the operation information of the initiation message;
here, the method for matching the identity information of the source control causing the message with the identity information in the interface library is shown in fig. 2, and includes the following steps:
step 103 a: matching the application program information in the identity information of the source control initiating the message with the application program information in the application program table in the interface library, and executing the step 103b if the matching is successful;
here, first, matching application program information in the identity information, and if information consistent with the application program information in the identity information of the source control initiating the message exists in an application program table in the interface library, indicating that the matching is successful;
wherein the matched application information comprises: a directory of the application, a name of the application.
Step 103 b: matching the form information in the identity information of the source control initiating the message with the identification control table information in the interface library, and executing step 103c if the form information in the identity information of the source control initiating the message is successfully matched with the form information corresponding to the application program information in the identification control table;
here, if the form information corresponding to the application information in the identification control table in the interface library has information consistent with the form information in the identity information of the source control initiating the message, the matching is successful;
wherein the form information includes: the layer count value, the window header layer, the window class name layer, the window preorder and the window postorder.
Step 103 c: judging whether the source control initiating the message is a non-window control, and if so, executing the step 103 d-the step 103 e; otherwise, step 103e is performed directly: finishing the matching process, and successfully matching;
step 103 d: acquiring position information of an operation action by calling a system programming interface function according to the operation action, matching the position information with the information of a labeling control table in an interface library, and executing step 103e if the position information is in the area information corresponding to the window information in the labeling control table: finishing the matching process, and successfully matching;
here, if the source control of the initiation message is a non-window control, the area information of the source control of the initiation message needs to be further matched.
Specifically, according to the position of the operation action point, whether the point is in the area information corresponding to the form information in the labeling control table in the interface library is verified by calling a system programming interface PtInRect function, and if the point is in the area information, the matching is successful.
Further, after the identity information of the source control of the initiation message is successfully matched with the identity information in the interface library, acquiring auxiliary description information associated with the identity information of the source control of the initiation message in the interface library, calling a function to acquire operation information of the initiation message, and generating an operation record according to the auxiliary description information and the operation information of the initiation message includes:
acquiring auxiliary description information associated with identity information of a source control of the initiation message in an interface library, wherein the auxiliary description information comprises the type and the title of the source control of the initiation message;
calling a function to obtain operation information of the triggering message, wherein the operation information of the triggering message comprises operation occurrence time, an IP address of a terminal where the operation occurs, control operation of the triggering message, operation content of a control of the triggering message and software information of the control;
and generating an operation record according to the auxiliary description information and the operation information of the triggering message.
Specifically, the following data format may be used to form the operation record to obtain the corresponding operation information, and generate the operation record:
the specific operation record can be as shown in fig. 3.
For example, for the formation of an operation record of keyboard operation input into a message queue, the attribute value obtained by a corresponding hook callback function is specifically assigned by combining the data number as:
assigning an attribute strIPAddr to the IP address of the host where the operation occurs;
the attribute m _ time is assigned as the time when the operation occurs;
the attribute strWndObject is assigned as Window (strClassName), wherein the variable strClassName is obtained by executing a system programming interface function GetClassName;
the attributes strEventID, strEventPara1, strObjectID, and strObjPara1 are assigned as "keyboard event", "keyboard event parameter 1", "keyboard object", and "keyboard object parameter 1", respectively.
Fig. 4 is a schematic diagram of the structure of the operation collection system of the present invention, and as shown in fig. 4, the system includes an information collection end 41, an interface library 42 and an operation collection end 43; wherein,
the information acquisition terminal 41 is configured to acquire identity information and auxiliary description information of the control, and write the identity information and the auxiliary description information into the interface library 42;
the interface library 42 is configured to store the identity information and the auxiliary description information sent by the information acquisition terminal 41;
the operation acquisition terminal 43 acquires an initiation message of an operation action of the input device, calls a system programming interface function according to the initiation message, analyzes the initiation message, and acquires identity information of a source control of the initiation message; matching the identity information of the source control of the initiation message with the identity information in the interface library 42, if the matching is successful, acquiring auxiliary description information associated with the identity information of the source control of the initiation message in the interface library 42, calling a function to acquire operation information of the initiation message, and generating an operation record according to the auxiliary description information and the operation information of the initiation message.
Further, the information collecting terminal 41 includes an information identifying module 411, an information labeling module 412 and an information setting module 413; wherein,
the information identifying module 411 is configured to, when the control type is a form control, call a function to obtain a form handle of the form control, obtain identity information of the form control by using the form handle, and write the identity information of the form control into the interface library 42; when the control type is a non-window control, calling a function to acquire a window handle of a window to which the non-window control belongs, acquiring identity information of the window to which the non-window control belongs by using the handle of the window to which the control belongs, and writing the identity information of the window to which the non-window control belongs into the interface library 42; the identity information of the form control comprises application program information and form information of an application program to which the form control belongs;
the information labeling module 412 is configured to label, when the control type is a non-window control, a region of the non-window control in a subordinate window, obtain region information of the non-window control in the subordinate window, and write the region information of the non-window control in the subordinate window into the interface library 42, so that the identity information of the non-window control is composed of the identity information of the control in the subordinate window written in the interface library 42 and the region information of the control in the subordinate window;
the information setting module 413 is configured to set the auxiliary description information of the control, including the type and title of the control, and write the auxiliary description information of the control into the interface library 42.
Further, the interface library 42 is specifically configured to store an application table, an identification control table, a labeling control table, and auxiliary description information of the control; wherein,
the application program table stores the application program information;
the identification control table stores the form information;
and the labeling control table stores the area information of the non-form control in the affiliated form.
Further, the operation collection terminal 43 includes an operation message obtaining module 431, an operation message analyzing module 432, an operation message matching module 433, and an operation message generating module 434; wherein,
the operation message acquiring module 431 is configured to acquire a trigger message of an operation action of the input device, and send the trigger message to the operation message analyzing module 432;
the operation message analyzing module 432 is configured to invoke a function according to the triggering message sent by the operation message obtaining module 431 to analyze the triggering message, obtain the identity information of the source control of the triggering message, and send the identity information of the source control to the operation message matching module 433;
the operation message matching module 433 is configured to match the identity information of the source control sent by the operation message analysis module 432 with the identity information in the interface library 42, send a notification message to the operation message analysis module 432 when matching is successful, obtain auxiliary description information associated with the identity information of the source control that causes the message in the interface library 42, and send the auxiliary description information to the operation message generation module 434;
correspondingly, the operation message analyzing module 432 is further configured to, when receiving the matching success notification message sent by the operation message matching module 433, call a function to obtain the operation information of the initiation message, where the operation information includes the time when the operation occurs, the IP address of the terminal where the operation occurs, the control operation of the initiation message, the operation content of the control of the initiation message, and the software information to which the control belongs, and send the operation information to the operation message generating module 434;
the operation message generating module 434 is configured to generate an operation record according to the auxiliary description information associated with the identity information of the source control of the trigger message sent by the operation message matching module 433 and the operation information of the trigger message sent by the operation message analyzing module 432.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, and improvement made within the spirit and scope of the present invention are included in the protection scope of the present invention.
Claims (2)
1. An operational acquisition method, the method comprising:
acquiring identity information and auxiliary description information of a control, and writing the identity information and the auxiliary description information of the control into an interface library;
acquiring an initiation message of an operation action of input equipment, calling a function according to the initiation message, analyzing the initiation message, and acquiring identity information of a source control of the initiation message;
matching the identity information of the source control of the initiation message with the identity information in an interface library, if the matching is successful, acquiring auxiliary description information associated with the identity information of the source control of the initiation message in the interface library, calling a function to acquire operation information of the initiation message, and generating an operation record according to the auxiliary description information and the operation information of the initiation message;
wherein, the acquiring the identity information and the auxiliary description information of the control comprises:
for a window control, calling a function to acquire a window handle of the window control, and acquiring identity information of the window control by using the window handle, wherein the identity information comprises application program information of an application program to which the window control belongs and window information of the window control;
for a non-window control, calling a function to acquire a window handle of a window to which the non-window control belongs, and acquiring identity information of the window to which the non-window control belongs by using the window handle of the window to which the non-window control belongs, wherein the identity information comprises application information of a subordinate application program of the window to which the non-window control belongs and window information of the window to which the non-window control belongs; identifying the region of the non-window control in the subordinate window through a control marking tool, and acquiring the region information of the non-window control in the subordinate window; forming the identity information of the non-window control by the identity information of the window to which the non-window control belongs and the area information of the non-window control in the subordinate window;
setting auxiliary description information of the control, including the type and the title of the control;
writing the identity information and the auxiliary description information of the control into an interface library comprises:
writing the application program information into an application program table in an interface library;
writing the form information into an identification control table in an interface library;
for the non-window control, further writing the area information of the control in the affiliated window into a labeling control table in an interface library;
wherein, the calling a function according to the triggering message to analyze the triggering message, and acquiring the identity information of the source control of the triggering message comprises:
calling a system programming interface function according to the triggering message to analyze the triggering message, and if the source control of the triggering message is a window control, acquiring application program information of an application program to which the source control of the triggering message belongs and the window information of the source control of the triggering message as identity information of the source control of the triggering message;
if the source control of the initiation message is a non-window control, acquiring application program information of a subordinate application program of a window to which the source control of the initiation message belongs and window information of a window to which the source control of the initiation message belongs as identity information of the source control of the initiation message;
wherein matching the identity information of the source control that caused the message with the identity information in the interface library comprises:
matching the application program information in the identity information of the source control which causes the message with the application program information in an application program table in an interface library;
if the matching is successful, matching the form information in the identity information of the source control of the triggering message with an identification control table in an interface library;
if the window information in the identity information of the source control initiating the message is successfully matched with the window information corresponding to the application program information in the identification control table, judging whether the source control initiating the message is a non-window control, and if the judgment result is negative, ending the matching process;
if the judgment result is yes, acquiring position information of the operation action by calling a system programming interface function according to the operation action, matching the position information with a labeling control table in an interface library, and if the position information is in the region information corresponding to the window information in the labeling control table, successfully matching, and ending a matching process;
the obtaining of the auxiliary description information associated with the identity information of the source control of the initiation message in the interface library, calling a function to obtain the operation information of the initiation message, and generating an operation record according to the auxiliary description information and the operation information of the initiation message includes:
acquiring auxiliary description information associated with identity information of a source control of the initiation message in an interface library, wherein the auxiliary description information comprises the type and the title of the source control of the initiation message;
calling a function to obtain operation information of the triggering message, wherein the operation information of the triggering message comprises operation occurrence time, an Internet Protocol (IP) address of a terminal where the operation occurs, control operation of the triggering message, operation content of a triggering message control and software information of the control;
and generating an operation record according to the auxiliary description information and the operation information of the triggering message.
2. An operation acquisition system is characterized by comprising an information acquisition end, an interface library and an operation acquisition end; wherein,
the information acquisition terminal is used for acquiring the identity information and the auxiliary description information of the control and writing the identity information and the auxiliary description information into an interface library;
the interface library is used for storing the identity information and the auxiliary description information sent by the information acquisition end;
the operation acquisition terminal acquires an initiation message of an operation action of the input equipment, calls a function according to the initiation message and analyzes the initiation message to acquire identity information of a source control of the initiation message; matching the identity information of the source control of the initiation message with the identity information in an interface library, if the matching is successful, acquiring auxiliary description information associated with the identity information of the source control of the initiation message in the interface library, calling a function to acquire operation information of the initiation message, and generating an operation record according to the auxiliary description information and the operation information of the initiation message;
the information acquisition terminal comprises an information identification module, an information labeling module and an information setting module; wherein,
the information identification module is used for calling a function to acquire a window handle of the window control when the control type is the window control, acquiring the identity information of the window control by using the window handle and writing the identity information of the window control into an interface library; when the control type is a non-window control, calling a function to acquire a window handle of a window to which the non-window control belongs, acquiring identity information of the window to which the non-window control belongs by using the handle of the window to which the control belongs, and writing the identity information of the window to which the non-window control belongs into an interface library; the identity information of the form control comprises application program information and form information of an application program to which the form control belongs;
the information marking module is used for marking the area of the non-window control in the subordinate window when the control type is the non-window control, acquiring the area information of the non-window control in the subordinate window, and writing the area information of the non-window control in the subordinate window into an interface library;
the information setting module is used for setting the auxiliary description information of the control, including the type and the title of the control, and writing the auxiliary description information of the control into an interface library;
the interface library is specifically used for storing an application program table, an identification control table, a labeling control table and auxiliary description information of the control; wherein the application table stores the application information; the identification control table stores the form information; the labeling control table stores the area information of the non-window control in the affiliated window;
the operation acquisition end comprises an operation message acquisition module, an operation message analysis module, an operation message matching module and an operation message generation module; wherein,
the operation message acquisition module is used for acquiring an initiation message of an operation action of the input equipment and sending the initiation message to the operation message analysis module;
the operation message analysis module is used for calling a function to analyze the triggering message according to the triggering message sent by the operation message acquisition module, acquiring the identity information of the source control of the triggering message and sending the identity information of the source control to the operation message matching module;
the operation message matching module is used for matching the identity information of the source control sent by the operation message analysis module with the identity information in the interface library, sending a notification message to the operation message analysis module when the matching is successful, acquiring auxiliary description information associated with the identity information of the source control initiating the message in the interface library, and sending the auxiliary description information to the operation message generation module;
correspondingly, the operation message analysis module is further configured to receive a matching success notification message sent by the operation message matching module, call a function to obtain operation information of the initiation message, where the operation information includes time when the operation occurs, an IP address of a terminal where the operation occurs, a control operation of the initiation message, operation content of the control of the initiation message, and software information to which the control belongs, and send the operation information to the operation message generation module;
the operation message generating module is used for generating an operation record according to the auxiliary description information associated with the identity information of the source control of the initiation message sent by the operation message matching module and the operation information of the initiation message sent by the operation message analyzing module.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310031157.6A CN103135986B (en) | 2013-01-25 | 2013-01-25 | A kind of operation acquisition method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310031157.6A CN103135986B (en) | 2013-01-25 | 2013-01-25 | A kind of operation acquisition method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103135986A CN103135986A (en) | 2013-06-05 |
CN103135986B true CN103135986B (en) | 2015-11-25 |
Family
ID=48495858
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310031157.6A Expired - Fee Related CN103135986B (en) | 2013-01-25 | 2013-01-25 | A kind of operation acquisition method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103135986B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104881350B (en) * | 2015-04-30 | 2019-03-19 | 百度在线网络技术(北京)有限公司 | For determining user experience and assisting the method and apparatus for determining user experience |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101241466A (en) * | 2007-02-08 | 2008-08-13 | 深圳迈瑞生物医疗电子股份有限公司 | Embedded software test method and system |
CN101930399A (en) * | 2010-08-16 | 2010-12-29 | 于秀山 | Method for recording software test |
CN102664910A (en) * | 2012-03-07 | 2012-09-12 | 深圳市深信服电子科技有限公司 | Method, client and server for correction of remote application user operation |
CN102830958A (en) * | 2011-06-16 | 2012-12-19 | 奇智软件(北京)有限公司 | Method and system for obtaining interface control information |
-
2013
- 2013-01-25 CN CN201310031157.6A patent/CN103135986B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101241466A (en) * | 2007-02-08 | 2008-08-13 | 深圳迈瑞生物医疗电子股份有限公司 | Embedded software test method and system |
CN101930399A (en) * | 2010-08-16 | 2010-12-29 | 于秀山 | Method for recording software test |
CN102830958A (en) * | 2011-06-16 | 2012-12-19 | 奇智软件(北京)有限公司 | Method and system for obtaining interface control information |
CN102664910A (en) * | 2012-03-07 | 2012-09-12 | 深圳市深信服电子科技有限公司 | Method, client and server for correction of remote application user operation |
Non-Patent Citations (1)
Title |
---|
《基于模型的软件测试》;杨朝红 等;《北京化工大学学报》;20071231;第34卷(第S1期);第85-88页 * |
Also Published As
Publication number | Publication date |
---|---|
CN103135986A (en) | 2013-06-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9465726B2 (en) | Abstract layer for automatic user interface testing | |
CN110244942B (en) | Page generation method, device and system | |
CN101930399A (en) | Method for recording software test | |
CN101025686A (en) | Automation test system and test script generating and operating method | |
CN103164300A (en) | Mobile terminal touch screen automatic testing method and device | |
CN108845940A (en) | A kind of enterprise information system automated function test method and system | |
US9053241B2 (en) | Scripting application with role identification | |
CN104268241B (en) | Attribute display method in a kind of configuration database | |
CN100555219C (en) | Atom manipulation encapsulation apparatus and method | |
CN105320589A (en) | Automatic analysis system for testing scripts in cloud testing environments and realization method thereof | |
CN101853157A (en) | Automatic identification method for application software GUI object | |
CN109857462B (en) | Background Docker task mapping method of remote sensing image visual editor | |
US20090132994A1 (en) | Automation tool and method for generating test code | |
CN112506778A (en) | WEB user interface automatic test method, device, equipment and storage medium | |
CN109491884A (en) | Code method for testing performance, device, computer equipment and medium | |
CN114185795A (en) | Embedded point configuration method and device, electronic equipment and storage medium | |
CN111382424A (en) | Mobile application sensitive behavior detection method and system based on controlled environment | |
CN108090355B (en) | APK automatic triggering tool | |
CN103135986B (en) | A kind of operation acquisition method and system | |
CN114895884B (en) | Method and system for writing and executing RPA script of terminal equipment | |
CN106897387B (en) | Service detection method based on action simulation | |
US20220272009A1 (en) | Incorporation of a trace visualization with a traffic graph visualization in a service mesh | |
CN115587028A (en) | Interface automation test method, system, medium and terminal | |
CN110569187B (en) | Automatic testing method, device and equipment for multi-platform system application | |
CN109032907B (en) | Data monitoring method and system for equipment application |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20151125 Termination date: 20200125 |