Java UI

Java UI node is used to automate Java applications.

  1. Pre-condition:
  2. Before designing a task, it is necessary to familiarize the Java application using UI Learn. Click here for more information.

    1.1 Defining Java Configuration:

    Note: When the user saves a new App in UI learn, then a configuration is created automatically in Jiffy. The newly created configuration is of the format Appname_Java. If the application name is already existing, then it will be of the format Appname_1_Java.

    The user can view the configuration created for the application in the Task Design: Configurations -> Java Application Execution Configuration section as shown below.

    If the task is for a different release or using/re-using the controls, then the user must create new configuration or can use existing configuration by following the below steps:
    1. Login to Jiffy.
    2. Navigate to Task Design -> Configurations -> Java Application Execution Configuration.
    3. Click on the Add button to define the configuration.
      The following drop-down is displayed with two options:

      • Create New: Use this option to create a new Java configuration.
        Do the following to add new configuration:
        • Click on the Create New button to display the display the Add JavaUI Configuration window.

          Specify the details for the following fields:
          • Configuration Name: Name to be provided for the configuration and the specified name is used in the Properties section of the node.
          • Clusters: Select the required cluster from this drop-down.
          • App: Select the JavaUI related application from this drop-down. The JavaUI:1 application can be used as a default application.
          • Java Path: Path of the application that launches the required Java application.
          • Application Path: Path where the Java application exists.
          • Click on the Save button.
        • Copy Existing: Use this option to copy from the existing configurations that are defined earlier.
          • Click on the Copy Existing button to display the Copy Configuration window.

          • Type the details of the required configuration in the above Search fields.
          • Select the required configuration from the filtered list.
          • Click on the Copy button.
    Note: All the defined Java Application Execution configurations are available in the Java Configuration drop-down in the Properties tab of the Task Design screen.

  3. Designing a Task Using an Java Node:
  4. Note: Make sure that the JAVA HOME(java path up to bin folder) environmental variables is added to the machine before designing a task consisting Java node. Do the following to use an Java UI node in a task:
    1. Use an existing task or create a new task based on the requirement.
      Note: Refer Create A Task for more details on how to create a task and how to open an existing task.
    2. Drag and drop the Java UI node from the Objects -> UI section and connect the nodes.

    3. Click on the Java UI node and specify the properties:

      Add the following details:
      • Name: Name of the node. A default name is displayed in this field, which the user can edit according to the task and the intent of using the node.
      • Description: A short note on the purpose of the node.
      • Mark run Failure on Node Fail: When the Mark run Failure on Node Fail field is ON, if the node execution fails then the complete task execution is marked as fail.
      • Run with User Config?: This functionality is now currently deprecated.
      • Continue on Failure: When the Continue on Failure field is ON, even if the node fails, the execution will continue to the next node. When the Continue on Failure field is OFF, if the node fails, the execution will not continue to the next node.
      • Java App Configuration: Select the required configuration from the Java App configuration drop-down. For more details click here.
      • Run Mode: The user can select any one of the following options from the Run Mode drop-down:
        • Run if locked: The task runs even if the machine is locked.
        • Unlock and run: Unlocks the machine and runs the task.
      • Lock After Run: Locks the machine after the node execution.
      • Variables: Click on the Variables button to select the input variables and to create an output variable to assign the output of the UI event values.
        • To create an output variable, go to Output Variables tab.

        • Type the required name of the output variable in the first text box and then select the type of the output variable from the drop-down. The output variable type can be either List or Table.
          Note:If the Table option is selected, define the table structure by clicking on the Table Def button on the right-hand side of the screen. For more details, click here.
          To get the table data and store it in a Variable, the user must create a variable as Table with multiple column options (As of now in the task that is provided as an example, there is only one column, so select the SingleColTable).

        • Click on the Save button.
      • Take Screen Shots: The user can select either Always or On Error option.
        If the user selects Always, then the user can see the screenshot of every UI event step output in the form of images (Java application) after a run.
        If the user selects On Error, the user can see the screenshot of the step which is failed. In case of any popup messages or any crash on the application, the user can identify it from the screenshot. These images can be passed to next node for further process, for example, to send an email by attaching the screenshot of failure.
      • Close Application: After completion of JavaUI run, then it will close the Java application that is launched during the execution of the task when the Close Application toggle button is in ON position. When the user wants to retain a Java application to perform actions on it, then select the Close Application toggle button must be in OFF position.
      • Close Application On Error: If it is ON, then the application or Javasite which is launched during execution will close in case of any error in the flow of execution.
    4. Double click on the Java UI node to display the Edit UI dialogue box.
    5. The Edit UI dialogue is now displayed with default UI Event option in the first drop-down. This drop-down allows the user to select any of the following options:
      • Set Screen: Select the required module from this drop-down. All the controls of a Javapage are grouped together as a module during familiarization, for example, all the login Java page controls are grouped in login module.
      • UI Event: All the familiarized UI controls are displayed in this drop-down.
      • UI Component: Click here for details on UI components.
      • Set Variable: There is an option to set a variable inside the UI node. The value to be set can either be a new variable or an existing variable (output variable created in the Properties tab).
      • Custom Expression: Jiffy provides a feature to allow users to create custom Python expressions and use them in the UI nodes steps. The Custom Expressions need to be uploaded to Jiffy Repository (Repository -> Custom Expressions). Once it is uploaded, it is available in the drop down of Custom Expressions option.
        Note: The expressions must be written in IronPython script.
      • Default Expression: These are Jiffy provided python expressions for the commonly used functions. For example: Concat, Capitalize, Add days etc. Click here, for information on Java UI related expressions.
    6. Select the Set Screen option in the Edit UI window.
    7. Based on the configuration selected in the Properties of Java UI node, all the modules that are familiarized under that application type (application is added while configuration is defined) appears in the drop-down. For more details on the Java UI controls and familiarization, click here.
    8. Select the required module.
      Note: The user must create the steps according to the manual flow of work so that the automation will run as expected.

    9. Select the UI Event option and then select the required UI control for the specific module. The drop-down corresponding to UI control contains the following options:
      • Click: When the required UI action to be performed is a “click on the UI control” then select this option.
      • Enabled: Used to check whether the UI event is enabled or not.
      • Exists: Used to check whether the UI event exists or not.
      • GetText: Used to get the text value of any UI event.
      • Keyboard: Use this option when any key has to be pressed from the keyboard, for example: Enter key.
    10. Click on the Save button in the Edit UI dialog after designing all the steps.
    11. Click on the Trail Run icon.
    12. Select the Java UI node and click on the Book icon to view the Result of execution screen.

Did you find what you were looking for?

Automation Analytics and AI in a box

Contact Us

HfS Hot Vendor

Option3's Automation capabilities featured in HfS Research's Hot Vendors List for Q3, 2018

Access your copy here