Modify options for recording on Java tables

This task describes how to modify some recording options for recording on Java table, as well as identify the toolkit class for an editor for use with the table_external_editors_list

Modify default JTable recording of SetCellData methods

If the default recording behavior for JTables does not provide the desired value for the SetCellData statement of a particular editor, set that editor to be recorded, like a custom cell editor, in terms of the operation performed on the object inside the cell.

Do one of the following:

  • In the Advanced Java Options Dialog Box, select Table cell controls > Controls to identify as separate test objects, and then specify specific cell editor types that should always be treated as separate objects, and not as part of a JavaTable object.

  • Create a Setting.Java ("table_internal_editors_list") statement.

Back to top

Modify table cell control options

You can specify a list of table cell controls that you want UFT to identify as separate test object, or for which you want UFT to record and run JavaTable operations.

  1. In the Advanced Java Options Dialog Box, click the relevant option once to highlight it.

  2. Click the option again or press F2 to open an edit box in which you can add or modify a list of controls.

  3. Change the value as necessary.

    Note: Specify editor class names separated by a space, tab, newline, or return character. Values are case sensitive.

  4. When you finish editing the value, click another location in the dialog box to set the value.

  5. To apply your changes to the currently open test or business component, close the document and then reopen it.

Back to top

Find the toolkit class of a JTable cell editor

If you do not know the value of the toolkit class for an editor for use with the table_external_editors_list variable, you can find it by doing one of the following:

  • Use the Object Spy to retrieve the value.

  • Run a short test in UFT to retrieve the value. You may want to do this when working with a cell that does not stay activated for long enough to capture the cell with the Object Spy. For example, a cell that is no longer active after a check box is selected or cleared.

  • Create a user-defined function and insert it as a step in your test. You may want to do this when working with business components.

    You can insert steps similar to the following example:

    ' Sample test to retrieve the toolkit class of a table cell editor
    ' that cannot be made continuously active 
    Set table = JavaWindow("TableDemo").JavaTable("Left table").Object
    Set JTableCS = table.mic_get_supp_class()
    Set comp = JTableCS.getComponentAt(table, 0, 6) ‘row 0, col 6
    MsgBox comp.getClass().getName()
    ' Set the value of TABLE_EXTERNAL_EDITORS_LIST
    Setting.Java("TABLE_EXTERNAL_EDITORS_LIST") = comp.getClass().getName()

    Back to top

Find the toolkit class of a JTable cell editor

  1. Open the table and activate a cell in the cell editor column. For example, make sure the cursor is blinking inside an edit field or display the drop-down list of a combo box.

  2. With the appropriate cell activated, use the Object Spy to point to the active cell.

  3. Make sure the Properties tab of the Object Spy is displayed and select the Identification radio button.

  4. In the Properties column, scroll to toolkit class.

  5. In the Values column, select the value of the toolkit class. The value is displayed in the box below the Properties tab.

  6. Copy and paste the value from the Object Spy to the Table cell controls > Controls to identify as separate test objects option or your Setting.Java ("table_internal_editors_list") statement.

Back to top