ComboBoxFunctions

Last Updated:

Actions for working with ComboBox objects


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

ComboBoxFunctions::CaptureItemsToFile
RJ DRD TC SE2

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]

ComboBoxFunctions::Click (deprecated for: Generic CLICK)
WR TC

Attempts to perform a standard Click on the ComboBox

Attempts to perform a standard Click on the ComboBox. If the combobox list is not exposed then this will expose the list of items. If the list is already exposed, then this will close the list.

It must be noted that when you expose the list in a ComboBox, it is no longer a ComboBox. It typically converts to a ComboListBox. This may not be an issue on controls that Robot can recognize with a NAME=method.

However, if the control is recognized by ObjectIndex or some other means then the original ComboBox may no longer be found on the screen. With this scenario, you need to reference the ComboBox and the ComboListBox in the application map (and associated data files) as two separate items.

To avoid these potential problems, use the COMBOBOX 'SELECT' command to actually open the list and select the item all with a single command.



Fields: [ ]=Optional with Default Value
    Examples:
    • T, WINDOW, ComboBox, CLICK
      Used to show or hide the drop down list from the ComboBox object.

      Used to show or hide the drop down list from the ComboBox object. Use the Select command INSTEAD of Click if you actually want to Select an item in the list.

    [How To Read This Reference]

    ComboBoxFunctions::HideList
    RJ SE2

    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]

      ComboBoxFunctions::Select
      RC RJ WR SE TC DRD SE2

      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]

      ComboBoxFunctions::SelectIndex
      RC RJ WR SE TC DRD SE2

      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]

      ComboBoxFunctions::SelectPartialMatch
      RC RJ WR SE TC DRD SE2

      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]

      ComboBoxFunctions::SelectUnverified
      RC RJ WR SE TC DRD SE2

      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]

      ComboBoxFunctions::SelectUnverifiedPartialMatch
      SE2

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

      Select an item via a partial text match in a combobox without verification. 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.

      The routine will not verify the selected-item matches the parameter partial-text.



      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, SelectUnverifiedPartialMatch, "ATextSubstring"
        This action attempts to Click AND Select the first item containing the substring provided.


      • T, WINDOW, ComboBox, SelectUnverifiedPartialMatch, "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]

      ComboBoxFunctions::SetTextValue
      RC RJ WR TC SE2

      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]

      ComboBoxFunctions::SetUnverifiedTextValue
      RC RJ TC

      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]

      ComboBoxFunctions::ShowList
      RJ SE2

      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]

        ComboBoxFunctions::VerifySelected
        RJ TC DRD SE2

        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]