Steer JavaFX Controls

JavaFX Modules are created by using Tosca XScan.

Right-click on a Module folder or use the dynamic menu Modules in Tosca Commander and select Scan -> Application. For further details on how to proceed, see also chapter "Scan Modules".The following standard controls are steered as described in chapter "Steering Controls".

This chapter contains a detailed description of JavaFX specific controls.

Controls that are located beyond the visible area of your test application can be scanned and steered, provided that they are positioned within scroll bars (ScollPanes). The system focuses automatically the area which holds the respective control.

Accordion

Accordion controls are steered in multiline view as described in chapter "TabControl".

In the example below, the tab Node 2 is clicked in the accordion ctrl_accordion. The second TestStep verifies whether the tab Node 2 is expanded.

Accordion: clicking on tabs and verifying the status

Editable ComboBox

Editable ComboBoxes are ComboBoxes that allow any number of entries to be added.

If you want to steer editable ComboBoxes with Tosca, ensure that the BusinessType of the control is defined as EditableComboBox.

In the example below, the value Testvalue is written to an editable ComboBox.

Test application - Editable ComboBox

ComboEditBox - Inputting Testvalue

Hyperlink

Hyperlinks are steered as described in chapter "Link".

Use the property Visited to verify whether a hyperlink has already been opened.

This example verifies whether a hyperlink has not yet been clicked in the test application: Visited = False

Verifying the Visited state of a hyperlink

ListView

ListView controls are steered as described in chapter "Listbox". Whenever ListView entries that are located outside the visible area are either scanned or steered, the system automatically scrolls to the required cell.

In the example below, the system selects the entry Julia from the ListView IvTestListView:

Selecting a ListView entry

In the following example, the system verifies whether the entry Matthew exists in the ListView IvTestListView:

Selecting a ListView entry

Modal and Pop-up windows

Steering modal or popup windows requires that you scan separate Modules for each window.

If modal or popup windows are opened via buttons in the test application, you have to scan a Module that steers the button, and a Module that handles the appearing modal/popup window. We recommend using the click operation {CLICK} to open modal/popup windows.

This example steers a modal window in the test application: The Dialog button is clicked, and then the Login Dialog opens.

Opening a modal window

Modal window - Login Dialog

The Login Dialog is closed with a click onto the Okay button.

Opening and closing a modal window

Progress Bar/Indicator

Progress bars or progress indicators can be scanned and steered with Tosca XScan. Use the property Indeterminate to verify, whether a progress bar or progress indicator has no value (=True).

The following ActionModes can be used:

ActionMode

Value (example)

Description

Verify

50

This verifies the status of the progress.

WaitOn

100

The system waits until a specific value has been reached.

This example verifies whether the status of the progress bar shows 10:

Verifying the progress status

In the example below, the engine waits until the value of the ProgressBar shows 100 before it continues with the test execution:

Engine waits until the progress bar shows 100%

TabControl

TabControls can be scanned with Tosca XScan. They are steered as described in chapter "Listbox".

Use TabItems to select individual tabs of a TabControl. To create a TabItem, right-click on a TabControl and choose Create Generic TabItem (see chapter "Generic list items").

In this example, the engine selects the Tables tab from the TabControl TabPane1:

TabControl: selecting a tab

In the example below, the engine verifies whether the Labels tab is visible (Visible = True) in the test application:

TabControl: verifying a tab

Toggle Button

Toggle buttons are steered as described in chapter "Button".

Use the property Selected to verify the status of a ToggleButton.

In this example, the engine verifies whether the ToggleButton SingleToggleButton is selected in the test application:

Verifying the Selected status of a ToggleButton

ToolBar

Controls that are located in a toolbar can be scanned and steered in Tosca.

For further information on how to steer various control types, see also chapter "Control types".

Tri-state CheckBox

Tri-state checkboxes can have the status True and False, but also the Indeterminate status.

ActionMode

Value

Description

Input

True, False, Indeterminate

Selecting or deselecting a checkbox, or defining the indeterminate status.

Verify

True, False, Indeterminate

<property>

Verifying a value or a property

Buffer

<buffer name>

The value True, False or Indeterminate is buffered, depending on whether the checkbox is selected, deselected, or if its status is indeterminate.

In this example the system verifies whether the status of the Tri-state CheckBox called CheckBox is set to Indeterminate.

Tri-state Checkbox - Status Indeterminate

Verifying the Tri-state CheckBox

Closing the Java security message

Upon starting a Java application, Java Runtime Environment can open a security message depending on your security settings. You can close this message in Tosca as described in chapter "Close the Java security message".