Click on Java Object

Click on an object in the currently active Java application. This enables you to imitate a mouse-click on a specific component in the Java application.

Support and Prerequisites: See Java Automation Commands Support and Prerequisites

The advanced command "Click on Java Object" isn't supported in Java 1.2.

Workaround: 

  1. Use the "Get Java Location" command to get the location coordinates.
  2. Add the "Click mouse" command and insert the coordinates in it.

 

  1. Select the Java object you want to click.

    After selecting the object, the following buttons become available (when relevant):

    • Click an object

    • Expand selection

    • Narrow selection

    • Highlight selected object

    • Use right click for selection

    • Tree view

      Highlighting items with blue while hovering them is set to be off by default. To change that, change the key value <add key="FeatureFlag_JavaHighlight" value="false" /> to "true" in the appsettings.config file of the Studio.
  2. Enter the name of the variable into which you want to save the result.

  3. Select the Java search method by platform (Default, Awt, Swing, or JavaFx).

  4. Select the Java click option (Default, Native, or FlaUI)- enabling capturing elements using right-click.

  5. Instruct the wizard how to handle any errors encountered. Read more about Error Handling.

On Java 1.6, the this command might cause an issue and show a message of user interruption. As a workaround, use the Get Mouse Position + Mouse Click commands OR add the command Set user Interrupt at the beginning of the step and set it as Ignore user interrupt.