Interacting with a Java Applet Window

Applies To: AutoMate 6, AutoMate 5
Published: 6/22/06 , modified June 22, 2006

How AutoMate finds and dissects windows
AutoMate's Window Dissection Technology allows the specification of a window based on title as well as objects, controls, and/or text within window. This technology is implemented in all of AutoMate's window-related actions and many of the interactivity actions such as the 'Press,' 'Select,' and 'Get Text' actions.

How AutoMate views a Java Applet Window
AutoMate uses Windows API (Application Program Interface) calls to find and dissect an object, control or text inside a window. If the objects inside a window are not Standard Windows Controls, the Windows API will not be able to find the objects and, consequently, AutoMate will not be able to interact with them. Unfortunately, Java Applets do not use Standard Windows Controls.

AutoMate is able to find the Java Applet window but recognizes nothing inside it. The Java controls are basically "invisible" to AutoMate. From Windows' point of view the Java Applet looks like a window containing one large bitmap. Because of this, most of AutoMate's interactivity actions (i.e. 'Move Mouse to Object,' 'Press,' or 'Set Text' actions) will not work within a Java Applet Window.

The only possibility for AutoMate to interact with controls within a Java Applet Window is to set the focus to the Java Window and use the 'Send Keystrokes' action to tab through the fields to set and get data or press buttons.

To set data you can simply use the 'Send Keystrokes' action to tab to the correct field and enter text. To get data (for example, text within an editbox control) you will need to use 'Send Keystrokes' to highlight and copy it. Achieving this will require you to send tabs and arrows to navigate to what you need to copy.

If everything you need to copy is already highlighted when your cursor focus reaches the text (the default behavior for most text boxes) you can simply use the 'Copy' action from the Clipboard folder. However, if it isn't highlighted, you will need to use the 'Hold Down Key' action to hold down the Shift key together with the 'Send Keystrokes' action to send arrow keys to highlight the text.

To press a button you will need to tab to the correct button and send a {Spacebar} or {Enter} key to the control using 'Send Keystrokes.'