Almost, if not all, modern operating systems are multi-threaded. Furthermore, more and more systems allow concurrent applications, each with their own threads, to be running using multi-processors. At the same time, the rise of graphical user interface applications which use the threads, have allowed users to interface with both the operating system and whatever applications may be running on it in an astounding number of ways. For example, multiple applications, each application with multiple windows, can be running simultaneously. The user is presented with an almost unlimited number of paths through the feature sets. Using input devices, such as a mouse or keyboard, the user can impulsively switch from window to window, and treenode to text box.
When testing applications with graphical user interfaces (GUIs), a tester must take both the user-driven nature of GUIs and the many choices offered to the user at any time—the multiple paths problem—into account. However, sometimes such needs are contradictory. For example, one solution to the multiple paths program is to automate the GUI testing. As automated testing programs can be run at computer speed, many more pathways through a GUI can be tested than is reasonable when using human testers. But, computers and humans each have their own strengths, and one thing humans excel at is the ability to discern the difference between a minor hiccup in a program and an actual code bug.
Due to the complex interaction between the many threads running on even a modest GUI application and the interaction between those threads, the operating system threads, and the threads of any other applications running, certain actions may fail not because of any underlying problems with the software, but merely because of timing issues. A human tester will most likely ignore a mouse click that does not select an object, but an automated tester will consider such an event as a failure.
For example, if the keyboard focus changes, keyboard input can end up being delivered to the wrong element, or be ignored altogether. If elements move, mouse input can end up being delivered to the wrong element. These problems are a side effect of how input management works. Input is not processed with a specific target in mind. Rather, input is received from a source without any information indicating what the target element is. A given computer system then determines the target for that input at a later stage, taking keyboard focus, mouse state, system hooks, and other factors into account. In other words, a variety of fluid factors end up determining which target element ends up receiving the input message.
These problems become most noticeable in the world of assisted technologies, including with automated testing applications previously mentioned. When sending input programmatically to a target user interface element, a separate program or process is typically used than the application that is being tested. As noted earlier, this means that there is no guarantee that the input will end up being delivered to the target user interface element for which it was intended. In the case of an automated testing program, this can mean that the test may report that a bug or other problem is present, when the only problem was simply that the input was received by the wrong element due to the various factors noted earlier, and that the actual test path was never really processed.
A similar problem exists in the case of assisted technologies that are used by people with disabilities. An assisted technology program may be provided to a user with low vision to allow that user to execute a script that automates various parts of the user interface for which the user would otherwise be unable to see and navigate. Suppose the automated script fails at one point because a mouse click input was not delivered to an OK button (i.e. not received by the target user interface element). It is extremely difficult for the assisted technology program to determine a next proper course of action because it is unknown whether a program bug was encountered, whether the input was simply not delivered properly, and so on.
Various technologies and techniques are disclosed for providing direct synchronous input. An input monitor determines where an input from a sender that is directed to a target element is about to be delivered. One example for providing an input monitor includes using a system hook. If the input monitor determines that the input is about to be delivered to the target element, the input is delivered to the target element, and the sender is notified that delivery to the target element succeeded.
In one implementation, an interface for providing a direct synchronous input is also provided. The interface has a start method for monitoring inputs being sent to target elements from a sender. The interface also has a received event for notifying the sender when a particular input is received by the target element.
In another inplementation, a wait notification process can be performed to wait a pre-determined period of time before determining whether the particular input had an opportunity to reach the target element.
In yet another implementation, combinations of a direct synchronous input process and a wait notification process are provided.
This Summary was 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 technologies and techniques herein may be described in the general context as an application that facilitates direct synchronous input with user interface elements, but the technologies and techniques also serve other purposes in addition to these. In one implementation, one or more of the techniques described herein can be implemented as features within an operating system such as MICROSOFT® WINDOWS® or Linux, or from any other type of program or service that delivers and/or interacts with inputs between threads and/or applications. In another implementation, one or more of these the techniques described herein can be implemented as features within applications that provide assisted technologies.
As noted in the background section, graphical user interface automation often produces spurious failures due to synchronization problems with the myriad of threads running at any given time on an operating system. One implementation disclosed herein synchronizes user interface elements directly by using an input monitor to monitor inputs being sent to a target element of interest and then determining whether the input reached the target element. The term “input” as used herein refers to an input that is directed to a target element for which some action should be taken upon receipt. The term “element” as used herein is meant to include any user interface object, such as listboxes, combo boxes, tree structures, radio buttons, calendars, windows, forms, panels, and combinations thereof. New implementations of user interface objects are being constantly created and these examples disclosed also embrace user interface elements that have not specially been named. The term “target element” as used herein is meant to include any of these aforementioned user interface objects defined previously that are an intended recipient of an input. Some aspects of these technologies and techniques are described in further detail in
Another implementation disclosed herein utilizes a wait notification process to synchronize user interface elements specifically to ensure that a target element will not fail when attempting to accept user input. Yet another implementation disclosed herein in
Turning now to
With reference to
A computing environment may have additional features. For example, the computing environment 100 includes storage 140, one or more input devices 150, one or more output devices 160, and one or more communication connections 170. An interconnection mechanism (not shown) such as a bus, controller, or network interconnects the components of the computing environment 100. Typically, operating system software (not shown) provides an operating environment for other software executing in the computing environment 100, and coordinates activities of the components of the computing environment 100.
The storage 140 may be removable or non-removable, and includes magnetic disks, magnetic tapes or cassettes, CD-ROMs, DVDs, or any other medium which can be used to store information and which can be accessed within the computing environment 100. The storage 140 stores instructions for the software 180 implementing the synchronizer.
The input device(s) 150 may be a touch input device such as a keyboard, mouse, pen, trackball, a voice input device, a scanning device, or another device that provides input to the computing environment 100. For audio or video encoding, the input device(s) 150 may be a sound card, video card, TV tuner card, or similar device that accepts audio or video input in analog or digital form, or a CD-ROM or CD-RW that reads audio or video samples into the computing environment 100. The output device(s) 160 may be a display, printer, speaker, CD-writer, or another device that provides output from the computing environment 100.
The communication connection(s) 170 enable communication over a communication medium to another computing entity. The communication medium conveys information such as computer-executable instructions, audio or video input or output, or other data in a modulated data signal. A modulated data signal is a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal. By way of example, and not limitation, communication media include wired or wireless techniques implemented with an electrical, optical, RF, infrared, acoustic, or other carrier.
The techniques and tools can be described in the general context of computer-readable media. Computer-readable media are any available media that can be accessed within a computing environment. By way of example, and not limitation, with the computing environment 100, computer-readable media include memory 100, storage 140, communication media, and combinations of any of the above.
The techniques and tools can be described in the general context of computer-executable instructions, such as those included in program modules, being executed in a computing environment 100 on a target real or virtual processor. Generally, program modules include routines, programs, libraries, objects, classes, components, data structures, etc. that performs particular tasks or implement particular abstract data types. The functionality of the program modules may be combined or split between program modules as desired in various implementations. Computer-executable instructions for program modules may be executed within a local or distributed computing environment.
Turning now to
Input monitoring application 200 includes program logic 204, which is responsible for carrying out some or all of the techniques described herein. Program logic 204 includes logic for using an input monitor to determine where an input is about to be delivered 206 (as described below with respect to
Turning now to
The input is sent, and the framework uses an input monitor to determine to what target element, if any, the input is about to be delivered (stage 246). One implementation of how such monitoring can be provided is described in further detail in
If the input was not delivered to the target element, then delivery of the input is cancelled (i.e. the input is discarded), and the sender is notified that the input delivery failed (stage 250). The sender can then take any suitable action that is proper after failure, such as to re-try sending the input, handle an error, and so on. If the input was delivered to the target element (decision point 248), then finish delivery of the input to the target element and notify the sender that the delivery was successful (stage 252). The sender can then take any suitable action that is proper after success, such as to move on to another interaction with the target UI element, wait for a result generated by the target element in response to processing of the input, and so on. The process ends at end point 254.
Turning now to
If the monitoring being performed reveals that the input from the sender was received by the target element (decision point 276), then the sender is notified that the input was received (stage 280). In one implementation, to determine that the input was received by the target element, the system hook procedure can check its window handle parameter (hWND) to determine the actual target window handle and confirm it matches with the target element. The sender can then proceed by taking any action that is appropriate after the input was successfully delivered, such as moving on to another input, waiting for a result that occurs after the target element processes the input, and so on.
However, if the monitoring being performed (such as through a system hook or HTML event handler) reveals that the input from the sender was not received by the target element (decision point 276), but instead the input was received by a different element (decision point 278), then the input is discarded and the sender is notified of the failure (stage 282). If the input was not received by another element (decision point 278), then a wait notification process is performed (stage 284). Note that in some implementations, stage 278 is not present, since it is not always possibly to verify whether or not input was received by another element. In such cases, the input can simply be discarded and/or the wait notification process performed as desired. The wait notification process provides various techniques for waiting a pre-determined period of time and determining whether or not the input had an opportunity to reach the target element. The process ends at end point 286.
Turning now to
The interface 330 has an INPUT_TYPE enumeration 332, which has various input device enumeration members, such as KEY_UP, KEY_DOWN, and so on. Interface 330 also has an interface called INotifyInputReceipt 336 that specifies methods for starting and stopping the listening for notifications. More specifically, the interface includes a StartListening method 338 and a StopListening method 340. The INotifyInputReceipt interface 336 can be implemented by a user interface framework. In one implementation, a target element is bound to the interface instance instead of being specified as a parameter. The StartListening method 338, when called, checks further input of the specified type, and when matching input is found, checks if the target element matches this element. If they do match, then the InputReceived event 342 is fired, and if they do not match, then the InputDiscarded event 344 is fired. The StopListening method 340, when called, reverts the framework back to normal operation if the framework was currently listening for input.
Turning now to
The implementations described here are technology agnostic, in that they should be able to be built into the underlying applications at a low-enough level that the implementation is invisible to users of the automatic testing programs; objects are selected without any awareness of the underlying synchronization.
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. All equivalents, changes, and modifications that come within the spirit of the implementations as described herein and/or by the following claims are desired to be protected.
For example, a person of ordinary skill in the computer software art will recognize that the examples discussed herein could be organized differently on one or more computers to include fewer or additional options or features than as portrayed in the examples.