Windows Connector methods

  • Release version: Xanadu
  • Updated August 1, 2024
  • 2 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of Windows Connector methods

    The Windows Connector methods in RPA Desktop Design Studio enable interaction with Windows applications to perform automated tasks. These methods operate at three levels: connector, window, and element, providing granular control over application windows and UI elements.

    Show full answer Show less

    Connector level methods

    Connector level methods manage the overall application, including starting and terminating it, setting its working directory, and retrieving information about the active window:

    • CloseMainWindow: Closes the active application window.
    • GetMainWindowHandle: Retrieves the handle ID of the active window.
    • GetMainWindowTitle: Retrieves the title of the active window.
    • SetWorkingDirectory: Defines the directory for all file operations within the application.
    • Start: Launches the application.
    • Terminate: Closes the application.

    Window level methods

    These methods interact with specific application windows to manipulate focus, capture data, and control window state:

    • Focus: Activates a window that is inactive, minimized, or in the background.
    • GetFields: Retrieves data from form fields on the screen. Configuration involves selecting form elements and updating their data types.
    • GetScreenShot: Captures and returns a bitmap screenshot of the window.
    • IsCreated: Returns a Boolean indicating if a window matches defined criteria.
    • Maximize: Maximizes the window.
    • Minimize: Minimizes the window.
    • SendKeys: Simulates keystrokes on windows or web pages; allows configuring keys, delay, and whether to clear existing values.
    • SetFields: Sets data in form fields after configuring the form elements and their data types.
    • WaitForCreate: Sets a delay for window or page load, returning a Boolean indicating success.

    Element level methods

    Exposed when interacting with specific UI elements, these methods enable element-specific actions and validations:

    • Click: Performs a click operation on the element.
    • IsCreated: Checks if the element matches specified criteria, returning a Boolean.
    • SendKeys: Sends keystrokes to the element with options for clearing existing text and setting typing delay.
    • SetPassword: Securely inputs passwords into password fields using a secured string. It accepts the password securely and offers a fallback to using SendKeys if direct input fails.

    Practical application for ServiceNow customers

    These methods empower you to automate interactions with Windows applications in your RPA workflows, enabling tasks such as data entry, window management, and secure password handling. Proper configuration of form elements is essential for accurate data retrieval and input. Using the SetPassword method with secured strings enhances security when automating credential inputs. The ability to simulate keystrokes and control window focus and state ensures robust automation even in complex UI scenarios.

    The Windows methods in RPA Desktop Design Studio interact with the Windows applications to perform various tasks. The connector provides methods at different levels of the Windows applications.

    Windows connector method levels

    Connector level methods

    Window level methods

    Element level methods

    Connector level methods

    CloseMainWindow

    Closes the active window of the application.

    GetMainWindowHandle

    Retrieves the handle ID of the active window of the application.

    GetMainWindowTitle

    Retrieves the title of the active window of the application.

    SetWorkingDirectory

    Sets the working directory of the application for all file operations through the application to be performed in the specified directory.

    Input
    Path

    Start

    Starts the application.

    Input
    Path Args

    Terminate

    Terminates the application.

    Window level methods

    Focus

    Sets the focus on a window that is inactive, minimized, or in the background.

    GetFields

    Returns the data in the form fields of the screen. You must configure the method before using.

    To configure, do the following steps.
    1. Click the method settings icon (Method settings icon.).
    2. Select the form elements.
    3. Update the form element data type.
    4. Click OK.
    Output
    Form element data

    GetScreenShot

    Captures the screenshot of the screen.
    Output
    Return (Bitmap)

    IsCreated

    Returns the Boolean response depending on whether a specific window matches the rules set in the MATCH CHILDREN section of the configuration window.
    Inputs
    MatchAllChildren
    Outputs
    Return (Boolean)

    Maximize

    Maximizes the window.

    Minimize

    Minimizes the window.

    SendKeys

    Simulates keystrokes on web pages and windows.
    Inputs
    Keys
    ClearExistingValue (Boolean)
    TypeDelay

    SetFields

    Sets data in form field types. To set the form fields, you must first configure the method. To configure, do the following steps.
    1. Click the method settings icon (Method settings icon.).
    2. Select the form elements.
    3. Update the form element data type.
    4. Click OK.
    Input
    Form data field

    WaitForCreate

    Sets delay before a web page or a window loads.
    Inputs
    timeoutInSeconds
    MatchAllChildren
    Outputs
    Return (Boolean)

    Element level methods

    These methods are exposed when you double-click an application element under the Global Objects in the Project Explorer.

    Click

    Performs a click operation.

    IsCreated

    Checks whether an element matches the rules set in the MATCH CHILDREN window.
    Outputs
    Return (Boolean)

    SendKeys

    Simulates keystrokes on web pages and windows.
    Inputs
    Keys (String)
    ClearExistingValue
    TypeDelay (Double)

    SetPassword

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

    To provide inputs to the fields see Configure port properties.
    Table 1. SetPassword method parameters
    Parameter Description Data Port type Data type Default value Mandatory? Notes
    Password Accepts the password as a secured string. Data In Secured string None Yes Since 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.
    UseSendKeys SendKeys is a method used to send keyboard inputs such as characters, numbers, and symbols to text boxes inside an application. Data In Boolean False Yes
    Tip:
    If the SetPassword method fails to input the password in the password field, set the value to True and execute the method again.