RobotJ ComboBoxFunctions

Last Updated:

Actions for working with ComboBox objects


[How To Read This Reference]
CaptureItemsToFile
RJ
Capture Items To a File specified (if not abs, then to test dir)
HideList
RJ
Hide the combo box list (equivalent to an ESC or two ESCs).
Select
RJ
Select an item by its text value from a combobox.
SelectIndex
RJ
Select an item by its index from a combobox.
SelectPartialMatch
RJ
Select an item via a partial text match in a combobox.
SelectUnverified
RJ
Select an item by its text value from a combobox without verifying the selection.
SetTextValue
RJ
Set the text of the combobox
SetUnverifiedTextValue
RJ
Set the text of the combobox without verification
ShowList
RJ
Show the combo box list (expose it).
VerifySelected
RJ
Verify Selected item is equal to specified parameter

RobotJ ComboBoxFunctions::CaptureItemsToFile
RJ

Capture Items To a File specified (if not abs, then to test dir)

Capture Items To a File specified (if not abs, then to test dir)

Fields: [ ]=Optional with Default Value
  1. FileName
    File name (if not absolute, then to test dir)

    File name (if not absolute, then to test dir)

  2. [ FileEncoding = ]
    Specify a character encoding to be used when saving data to a file. If it is not specified, the system default file encoding will be used. The encoding should be a valid string supported by Java; if it is not valid, the system default file encoding will be used instead.


Examples:
  • T, WINDOW, ComboBox, CaptureItemsToFile , afile.txt
    Captures all the items in the combo to ...\datapool\test\afile.txt

    Captures all the items in the combo to ...\datapool\test\afile.txt

  • T, WINDOW, ComboBox, CaptureItemsToFile , afile.txt, "UTF-8"
    Captures all the items in the combo to ...\datapool\test\afile.txt

    Captures all the items in the combo to ...\datapool\test\afile.txt
    Write the file with encoding "UTF-8".


[How To Read This Reference]

RobotJ ComboBoxFunctions::HideList
RJ

Hide the combo box list (equivalent to an ESC or two ESCs).

hide the list. This would only be necessary in cases where the state of the combo box is not known ahead of time.



Fields: [ ]=Optional with Default Value
    Examples:
    • T, WINDOW, ComboBox, HideList
      Hide the combo box list


    [How To Read This Reference]

    RobotJ ComboBoxFunctions::Select
    RJ

    Select an item by its text value from a combobox.

    Select an item by its text value from a combobox. This method combines the initial Click required to expose the list of items and then the subsequent selection of a text item from the list.

    The routine will first attempt to see if the item exists in the list and should provide a warning if it cannot find the item or cannot read the list of items. The routine will then attempt the selection.

    After the selection is attempted, the routine tries to verify that the list has the specified item as the selected item. A warning will be issued if the routine cannot read the list. A failure will be issued if the routine CAN read the list and determines that the specified item is NOT the currently selected item.

    Note: RobotJ also uses identical keyword SelectTextItem



    Fields: [ ]=Optional with Default Value
    1. TextValue
      The case-sensitive item in the drop down list to select.


    2. [ ForceRefresh = ]
      Force refreshing to update stale element after selection.

      NOTE:
      SE2 : First implemented in March 2016 for Selenium2.0 and might not be supported in all engines yet.

    Examples:
    • T, WINDOW, ComboBox, SELECT, "MySelection"
      This action attempts to Click AND Select "MySelection" (case-sensitive) from the ComboBox.


    • T, WINDOW, ComboBox, SELECT, "MySelection", "true"
      This action attempts to Click AND Select "MySelection" (case-sensitive) from the ComboBox, and force refreshing after selection.


    [How To Read This Reference]

    RobotJ ComboBoxFunctions::SelectIndex
    RJ

    Select an item by its index from a combobox.

    Select an item by its index from a combobox. This method combines the initial Click required to expose the list of items and then the subsequent selection of the item from the list.
    The routine will first attempt to see if the index exists in the list and should provide a warning if it cannot find the item or cannot read the list of items. The routine will then attempt the selection.


    Fields: [ ]=Optional with Default Value
    1. IndexValue
      The item index in the drop down list to select.

      Some combo lists are 0-based (start with 0). Some are 1-based (start with 1). The user will have to determine the index base for their particular combo list.
      It would appear that HTML Combo lists are 1-based.


    2. [ ForceRefresh = ]
      Force refreshing to update stale element after selection.

      NOTE:
      SE2 : First implemented in March 2016 for Selenium2.0 and might not be supported in all engines yet.

    Examples:
    • T, WINDOW, ComboBox, SELECTINDEX, "1"
      This action attempts to Click AND Select item #1 from the ComboBox list.


    • T, WINDOW, ComboBox, SELECTINDEX, "1", "true"
      This action attempts to Click AND Select item #1 from the ComboBox list, and force refreshing after selection.


    [How To Read This Reference]

    RobotJ ComboBoxFunctions::SelectPartialMatch
    RJ

    Select an item via a partial text match in a combobox.

    Select an item via a partial text match in a combobox. This method combines the initial Click required to expose the list of items and then the subsequent selection of a text item from the list.

    The routine will first attempt to see if the item exists in the list and should provide a warning if it cannot find the item or cannot read the list of items. The routine will then attempt the selection.

    After the selection is attempted, the routine tries to verify that the list has the specified item as the selected item. A warning will be issued if the routine cannot read the list. A failure will be issued if the routine CAN read the list and determines that the specified item is NOT the currently selected item.



    Fields: [ ]=Optional with Default Value
    1. TextValue
      The case-sensitive substring of an item in the drop down list to select.


    2. [ ForceRefresh = ]
      Force refreshing to update stale element after selection.

      NOTE:
      SE2 : First implemented in March 2016 for Selenium2.0 and might not be supported in all engines yet.

    Examples:
    • T, WINDOW, ComboBox, SelectPartialMatch, "ATextSubstring"
      This action attempts to Click AND Select the first item containing the substring provided.


    • T, WINDOW, ComboBox, SelectPartialMatch, "ATextSubstring", "true"
      This action attempts to Click AND Select the first item containing the substring provided, and force refreshing after selection.


    [How To Read This Reference]

    RobotJ ComboBoxFunctions::SelectUnverified
    RJ

    Select an item by its text value from a combobox without verifying the selection.

    Select an item by its text value from a combobox without verifying the selection. This method combines the initial Click required to expose the list of items and then the subsequent selection of a text item from the list.

    The routine will simply take the specified text and attempt the selection. it will not verify the existence of the item before the attempt, nor will it verify the item is actually selected after the attempt.

    Note: RobotJ also uses identical keyword SelectUnverifiedTextItem



    Fields: [ ]=Optional with Default Value
    1. TextValue
      The case-sensitive item in the drop down list to select.


    2. [ ForceRefresh = ]
      Force refreshing to update stale element after selection.

      NOTE:
      SE2 : First implemented in March 2016 for Selenium2.0 and might not be supported in all engines yet.

    Examples:
    • T, WINDOW, ComboBox, SELECTUNVERIFIED, "MySelection"
      This action attempts to Click AND Select "MySelection" (case-sensitive) from the ComboBox.


    • T, WINDOW, ComboBox, SELECTUNVERIFIED, "MySelection", "true"
      This action attempts to Click AND Select "MySelection" (case-sensitive) from the ComboBox, and force refreshing after selection.


    [How To Read This Reference]

    RobotJ ComboBoxFunctions::SetTextValue
    RJ

    Set the text of the combobox

    This action sets the text of the combobox. This version allows the use of special character combinations and substrings to identify specific keyboard keys. These are the same special characters and interpretation used for Robot's InputKeys command and the Windows Scripting Host.

    ~^+%{( are primarily the characters that induce special processing.

    The routine verifies we can read the text property, sets the text value and will verify that the property has been set to that value *IF* none of the special characters exist in the provided text value. If those special characters exist, then no post-set verification will occur.



    Fields: [ ]=Optional with Default Value
    1. [ TextValue = ]
      The text that will be typed into the ComboBox.

      TextValue will be the text that will be typed into the Combobox. Quoted text may be used to ensure proper expected value retrieval. There is also no check for a missing field because that would be the same as specifying no text ("")--which is valid.

    Examples:
    • T, WINDOW, ComboBox, SETTEXTVALUE, "MyPassword"
      "MyPassword" is typed into the Combobox


    [How To Read This Reference]

    RobotJ ComboBoxFunctions::SetUnverifiedTextValue
    RJ

    Set the text of the combobox without verification

    This action sets the text of the combobox. This version allows the use of special character combinations and substrings to identify specific keyboard keys. These are the same special characters and interpretation used for Robot's InputKeys command and the Windows Scripting Host.

    ~^+%{( are primarily the characters that induce special processing.

    The routine verifies we can read the text property, sets the text value but does not verify that the property has been set to that value whether or not any of the special characters exist in the provided text value.



    Fields: [ ]=Optional with Default Value
    1. [ TextValue = ]
      The text that will be typed into the ComboBox.

      TextValue will be the text that will be typed into the Combobox. Quoted text may be used to ensure proper expected value retrieval. There is also no check for a missing field because that would be the same as specifying no text ("")--which is valid.

    Examples:
    • T, WINDOW, ComboBox, SETUNVERIFIEDTEXTVALUE, "MyPassword"
      "MyPassword" is typed into the Combobox


    [How To Read This Reference]

    RobotJ ComboBoxFunctions::ShowList
    RJ

    Show the combo box list (expose it).

    show the list so that the next step can be a click on an item. This would only be necessary in cases where the state of the combo box is not known ahead of time.



    Fields: [ ]=Optional with Default Value
      Examples:
      • T, WINDOW, ComboBox, ShowList
        Show the combo box list


      [How To Read This Reference]

      RobotJ ComboBoxFunctions::VerifySelected
      RJ

      Verify Selected item is equal to specified parameter

      Verify Selected item is equal to specified parameter

      Fields: [ ]=Optional with Default Value
      1. TextValue
        The case-sensitive substring to compare.


      Examples:
      • T, WINDOW, ComboBox, VerifySelected, "ATextSubstring"
        This action verifies that the selected item is ATextSubstring.


      [How To Read This Reference]