Java Developer Tools

Embedded Swing Components

The WindowTester Pro runtime supports testing RCP/SWT applications with embedded Swing components.

  1. Embedded Swing Components
    1. SwingWidgetLocator
    2. Examples
      1. Clicking widgets and entering text
      2. Double-clicking widgets
      3. Tabbing into widgets and entering text
      4. Sample RCP application with embedded Swing components
    3. Recording interactions with Embedded Swing components


SwingWidgetLocator

WindowTester Pro provides a SwingWidgetLocator to identify embedded Swing widgets.

Examples

Clicking widgets and entering text

ui.click(new SwingWidgetLocator(JTextField.class, 5));
ui.enterText("11001");

Double-clicking widgets

ui.click(2, new XYLocator(new SwingWidgetLocator(JTextField.class, 2), 20, 10));

Tabbing into widgets and entering text

The recorder generates code if you use the Tab key to navigate through the Swing widgets.

ui.enterText("Jon");
ui.keyClick(WT.TAB);
ui.enterText("Doe");
ui.keyClick(WT.TAB);
ui.enterText("somewhere");

  
  

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.