Computer devices typically include a user interface (UI) to interact with one or more applications or programs. An example user interface is a graphical user interface generated on a display device such a display screen or monitor. A user interacts with the user interface via various input devices such as a keyboard, keypad, mouse or other input device to activate functions or features of the user interface. During use, it is important that the user interface execute actions corresponding to the activated function or features of the user interface.
Operation of the user interface is typically tested during development or during later use. Prior test applications typically provide a UI specific test platform. The UI specific test platform is not typically adaptable to changes in the UI. Additionally, prior test platforms do not provide a record of the recorded dialogue to facilitate repeat testing of the same test input or dialogue.
The discussion above is merely provided for general background information and is not intended to be used as an aid in determining the scope of the claimed subject matter.
Embodiments of the application disclose an automation tool for generating test input or code for a UI for a dialogue exchange between a user or tester and a computer generated user interface UI. In embodiments disclosed, the automation tool includes a recording function and a generator component. In illustrated embodiments, the recording function includes a processing component and a collector component for processing an input dialogue and collecting data associated with the input dialogue. The generator component utilizes an object based code generator to generate UI test code for a recorded dialogue and data. The generated test code includes calls to invoke methods to implement specific UI actions of the user dialogue and in illustrated embodiments is used to replay the dialogue or exchange.
This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used as an aid in determining the scope of the claimed subject matter. The claimed subject matter is not limited to implementations that solve any or all disadvantages noted in the background.
During development, operation of the user interface is typically tested using test inputs 116 as schematically illustrated in
In the embodiment illustrated in
In the illustrated embodiment shown, the automation tool 120 includes a recording function which is used to record a test dialogue exchange. As shown, the recording function includes a processing component 130 and a collector component 132. The processing component 130 processes the dialogue input 122 to determine the control types for UI inputs or events. The collection component 132 is configured to retrieve data or information based upon the control type or class of the events or inputs of the UI dialogue exchange. The recorded dialogue of events and associated metadata 134 is outputted to a computer readable file or data store.
As shown, the automation tool 120 of
As shown in
Also as shown in
In the checkforeground thread 152, the tool checks if the foreground of the UI has changed as illustrated by checkforeground procedure 190. If the foreground has changed, checkforeground procedure 190 creates a foreground change event, which is added to queue 156. The foreground change event is used to generate code that provides an interrupt or pause to synchronize execution of the UI with UI changes when the test code is used to test or replay the user dialogue.
The tool control procedures 154 determine if any of the tool control inputs have been activated or selected. If a tool control has been selected or activated, the tool control is processed by procedure 194. The tool control is processed to determine the tool control type as illustrated by decision block 195. Depending upon the tool control type, a particular tool control procedure is used to generate an event for the queue 156.
In the particular embodiment shown, the tool control inputs include stop and pause inputs. Upon activation of the stop input, the tool control procedure activates a stop control procedure that adds a stop event to the event queue as shown. Alternatively upon activation of other tool controls various other events are added to the event queue 156. In the illustrated embodiment shown in
In the illustrated embodiment, the tool control procedures include a stop procedure 228 and change test section procedure 230. Although illustrated tool controls are disclosed in the application, other tool controls and implementing procedures can be used and application is not limited to the particular tool controls described.
If the event is not a tool control, A create generator procedure “Create Generator” 240 is invoked to create a currgenerator object 242 for a particular control or event type to implement code generating procedures based upon the control class or type. The create generator procedure 240 uses a table or other structure to map the control classes to a generator class. The create generator procedure 240 tries to find the most appropriate generator class for the control type based upon the data provided by the collector.
In an illustrated example, if the UI dialogue includes a “button click” event, the generator component would invoke a button generator class. In another illustrated example, if the UI dialogue exchange includes a “list view” event, a list view generator class is invoked.
As illustrated in
As illustrated in decision block 270, the generator procedures determine if an object is necessary for the event based upon the generator class or action type. Some events such as a foreground change do not require an object. If the object is needed, a Createobject name method 271 is invoked to generate an object name for event code 272. The event code 272 is a class which bundles the objects, data and code to invoke the UI actions of the dialogue exchange.
If the object for the class exist in the library 140, the generator procedures use the existing object from the library 140 to generate the event code 272. Otherwise, if the object does not exist in the library 140, the object generator portion 210 (shown in
As illustrated, parameters values 274 for the event or class are populated by a populate parameter procedure 275. As shown, the generate objects procedure 273 uses the parameter values to generate the object for the event code 272. The generate code procedures 278 create code to call methods to invoke the context appropriate actions based upon the class and action type. If no appropriate action method is found for the control type a generic click( ) or sendkey( ) method is used depending upon the event type. The generate code procedures 278 generate the meta data 218 and lines of code 280 to invoke context appropriate actions of the dialogue exchange.
In the illustrated embodiment, the event code 272 is used to generate the UI test code 124 via an add test code procedure 282. Also, the event code 272 is used to generate the XML file or output 214 via an add XML elements procedure 284. As shown in
If the event is a string event as illustrated by decision block 252 (for example a readable character is entered into a textbox), the component adds the characters of the string to a buffer 254 and saves the event as a FirstString event 258. Each successive string event (e.g. each additional character entered into the same textbox) is then added to the string buffer 254. When the string is complete (for example the textbox loses focus), a generator “Previous Generator” 264 is created via create generator procedure 240 using both the saved Firststring event 258 and the string buffer 254 as illustrated by flush string buffer 260. Create Generator 240 also creates generator “CurrentGenerator” 242 for the current event or action on the string (for example the event is the click which resulted in the textbox losing focus. Both the Current generator 242 and Previous generator 264 are used to generate the event code 272 or the UI test code 124 as previously described.
As described, the UI object library code 140 provides an abstract layer separate from the UI test code 124 that models the UI component 102. The generation component 136 can reuse objects from the UI Object Library code 140 for subsequent code generation. Since the UI test code 124 utilizes the abstract UI object library code 140, the test code 124 is adaptable to changes in the UI via changes to the UI object library code 140.
In an embodiment illustrated in
As described, the tool enables the creation of test automation quickly. Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.