Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

Java connector methods

The Java connector exposes methods at the connector, screen, and element levels. While all types of elements have common methods, they also have different methods.

Connector level methods

Start

Starts the Java application from its location and brings it to focus.

Note: You must execute this method first.

To provide inputs to the parameters, see Configure port properties.

ParameterDescriptionData port typeData typeDefault valueMandatory?
PathPath to the Java application in the local drive.Data inStringNoneYes
ArgsArguments for the path.Data inStringNoneNo

GetMainWindowHandle

Returns the window handle of the Java application launched by the Start method.

ParameterDescriptionData port typeData typeDefault valueMandatory?
ReturnReturns the Window handle of the application.Data outIntegerNoneNot applicable

GetMainWindowTitle

Returns the title of the Java application window.

ParameterDescriptionData port typeData typeDefault valueMandatory?
ReturnReturns the title of the window of the application.Data outStringNoneNot applicable

CloseMainWindow

Closes the main Java application window.

Terminate

Terminates the main Java application window.

Screen level methods

Close

Closes the active Java application window.

Focus

If the Java application window is minimized or running in the background, the method restores the focus.

GetFields

Gets the data from the text fields in a Java application. You must first configure the text fields. To configure, do the following steps.

  1. Configure the Java connector and capture one or more text fields.
  2. Expose the screen level methods. See Use connector method.
  3. From the Object Explorer pane, drag the GetFields method to the Design surface.
  4. Click the method settings icon (
Image omitted: component-settings-icon.png
Method settings icon.\).
  1. Select one or more text fields.
  2. Update the data type of the text field.
  3. To close the CHOOSE FORM ELEMENTS window, click OK.

    A Data Out port is created for each text field you select.

The GetFields method can now return the data contained in the text fields.

GetInstanceCount

Returns the total number of instances of the Java application open.

ParameterDescriptionData port typeData typeDefault valueMandatory?
ReturnReturns the total number of instances of the Java application open.Data outIntegerNoneNot applicable

GetScreenShot

Captures and returns the screenshot of the Java application screen.

ParameterDescriptionData port typeData typeDefault valueMandatory?
ReturnReturns the screenshot of the Java application screen.Data outBitmapNoneNot applicable

GetWindowHandle

Returns the Windows handle number of the Java application screen window.

ParameterDescriptionData port typeData typeDefault valueMandatory?
ReturnReturns the Windows handle number of the Java application screen window.Data outIntegerNoneNot applicable

IsCreated

Returns the Boolean response based on whether the rules for a configured window match. When you configure a Java application screen, the MATCH RULES section of the Java connector window shows certain rules that match the screen configured. The method matches the same rules.

To provide inputs to the parameters, see Configure port properties.

ParameterDescriptionData port typeData typeDefault valueMandatory?Notes
MatchAllChildrenReturns the Boolean response after matching the rules of the elements of the screen.Data inBooleanNoneNoThis parameter is relevant if you capture one or more elements.
ReturnReturns the Boolean response to whether the rules of the Java application screen you configured matched.Data outBooleanNullNot applicable 

Maximize

Maximizes the Java application window.

Minimize

Minimizes the Java application window.

MouseAction

Performs different mouse device actions on the Java application such as left-click, right-click, and middle-click.

To provide inputs to the parameters, see Configure port properties.

ParameterDescriptionData port typeData typeDefault valueMandatory?
ActionSpecifies the mouse device action.Data inMouse device inputNoneYes
ClickMiddleWhether a middle-click will be performed.Data inBooleanNoneNo

Resize

Changes the width, height, and the position of the Java application window along the X and Y axis.

To provide inputs to the parameters, see Configure port properties.

ParameterDescriptionData port typeData typeDefault valueMandatory?
xPosPosition of the window on the screen along the X-axis.Data inIntegerNoneNo
yPosPosition of the window on the screen along the Y-axis.Data inIntegerNoneNo
WidthWidth of the window.Data inIntegerNoneNo
HeightHeight of the window.Data inIntegerNoneNo

Restore

Restores the original dimensions of the Java application window. You can use the method after you have executed methods like Maximize and Minimize.

SendKeys

Send any data or keyboard input to the active field on the Java application. For example, you can send a string data "RPA" or a keyboard input [Space] to clear a check box.

To provide inputs to the parameters, see Configure port properties.

ParameterDescriptionData port typeData typeDefault valueMandatory?
KeysSends the data or keyboard input to the active field.Data inStringNoneYes
ClearExistingValueBefore sending any data or keyboard input, clears any existing value in the active field.Data inBooleanNoneNo
TypeDelaySets a delay before sending any data or keyboard input to the active field.Data inIntegerNoneNo

SetFields

Set custom text in the text field elements captured from the Java application screen.

To use the method, do the following steps.

  1. From the Object Explorer, drag the SetFields method to the Design surface.
  2. Click the method settings icon (
Image omitted: component-settings-icon.png
Method settings icon.\).
  1. Select one or more text fields.
  2. Update the data type of the text field.
  3. Click OK.

    A Data In port is created for each text field you select. You can pass the string to set in the fields of the Java application.

    To provide inputs to the parameters, see Configure port properties.

WaitForCreate

Each screen you configure in the Java connector is identified by some rules, displayed under the MATCH RULES section of the Java Connector window. The method returns a Boolean response based on whether the rules of the screen you had configured matches.

To provide inputs to the parameters, see Configure port properties.

ParameterDescriptionData port typeData typeDefault valueMandatory?
timeoutinSecondsTime after which the operation of the method times out.Data inIntegerNoneNo
MatchAllChildrenReturns the Boolean response after matching the rules of the elements of the screen.Data inBooleanNoneNo
ReturnReturns the Boolean response to whether the rules of the Java application screen you configured matched.Data outBooleanNoneNo

Element level methods

GetAccessibleActions

Returns the list of actions that you can perform on an element. For example, for a button, it returns Click.

ParameterDescriptionData port typeData typeDefault valueMandatory?
ReturnReturns the list of actions that you can perform on an element.Data outListNoneNot applicable

GetInstanceCount

Returns the total count of an element type in the Java application. For example, if there are three text boxes in an application, the instance count is 3.

ParameterDescriptionData port typeData typeDefault valueMandatory?
ReturnReturns the instance count of an element type in the application.Data outIntegerNoneNot applicable

GetText

Returns the text from the captured text box element in the Java application. To capture multiple texts from multiple text boxes, you must configure multiple text box elements.

ParameterDescriptionData port typeData typeDefault valueMandatory?
TextReturns the text contained in the text box of the Java application.Data outStringNoneNot applicable

IsCreated

Returns the Boolean response depending on whether the rules of the element you had configured match.

ParameterDescriptionData port typeData typeDefault valueMandatory?
ReturnReturns the Boolean response depending on whether the rules of the element you had configured match.Data outBooleannullNot applicable

MouseClick

Performs a left mouse-click on the captured element.

PerformAction

Performs the specified action on an element. For example, click on a button. Each element allows a set of actions that you can get by executing the GetAccessibleActions method.

To provide inputs to the parameters, see Configure port properties.

ParameterDescriptionData port typeData typeDefault valueMandatory?Notes
ActionAccepts the action to be performed on the element.Data inStringNoneYesYou must specify the action exactly in the format as given by the GetAccessibleActions method.
ReturnReturns True if the action was performed, else, False.Data outBooleanNoneNot applicable 

SetPassword

Automate entering password securely in the password field of a Java application.

To provide inputs to the fields see Configure port properties.

ParameterDescriptionData Port typeData typeDefault valueMandatory?Notes
PasswordAccepts the password as a secured string.Data InSecured stringNoneYesSince it accepts the password as a secured string, it only shows the length of the string when you right-click on the parameter and then click Preview Data.
UseSendKeysSendKeys is a method used to send keyboard inputs such as characters, numbers, and symbols to text boxes inside an application.Data InBooleanFalseYesTip: If the SetPassword method fails to input the password in the password field, set the value to True and execute the method again.

Parent Topic:Java