SQABasic "ComboBoxFunctions" Script

 MODULE DESCRIPTION:

      Routines and utilities to work on SQA Type=COMBOBOX objects in
      Data-Driven Automation.

Action Commands Global Variables Routine Details

User Dependencies:

(stuff the developer's library/script $INCLUDES at compile time.)
(Note: The order of items may matter and may be different for your code.)

Internal Dependencies:

(stuff this library needs at compile time.)

DDE Action Commands

 SUPPORTED ACTION COMMANDS:

      Select                  'Select a text item in the drop down list
      SelectUnverified        'Select a text item in the drop down list without verifying the selection.
      SelectPartialMatch      'Select a text item in the drop down list based on a partial match.
      SelectIndex             'Select an item in the drop down list by index
      SetTextValue            'Assign a value to the Combo List Box
      SetUnverifiedTextValue  'Assign a value to the Combo List Box but do not verify return


Globals

    (none)

Routine Details



   Sub ComboBoxSelect ()


 DESCRIPTION:

      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.

      The routine expects that the given object already has Context or Focus.
      It also expects that Global StepDriverTestInfo contains all the information
      it needs to perform its function.

 DATA TABLE PARAMETERS:

      5   Field 5 should contain the case-sensitive text item to select.
          You can enclose this text in double-quotes to ensure proper retrieval.

 ERRORS:

      none

 Orig Author: Carl Nagle
 Orig   Date: MAR 27, 2000
 History:

      MAR 27, 2000    Original Release
      APR 26, 2000    (CANAGL) Enabled Quoted Text
      FEB 23, 2001    (CANAGL) More work for HTMLComboboxes.
      FEB 27, 2001    (CANAGL) More work for HTMLComboboxes.
      MAY 06, 2002    (CANAGL) Added optional partial matches.
      JUN 04, 2002    (CANAGL) Fixed certain partial text match problems.
      JUN 05, 2002    (BWEBER) Added support for Java Combos.
      JAN 23, 2003    (YWANG)  Changed to click on the drop-down button.




   Sub ComboBoxSelectUnverified ()


 DESCRIPTION:

      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 attemp the selection.
      it will not verify the existence of the item before the attemp, nor
      will it verify the item is actually selected after the attemp.

The routine expects that the given object already has Context or Focus. It also expects that Global StepDriverTestInfo contains all the information it needs to perform its function. DATA TABLE PARAMETERS: 5 Field 5 should contain the case-sensitive text item to select. You can enclose this text in double-quotes to ensure proper retrieval. ERRORS: none Orig Author: Yuesong Wang Orig Date: JAN 03, 2003 History: JAN 03, 2003 Original Release JAN 23, 2003 (YWANG) Changed to click on the drop-down button.



   Sub ComboBoxSelectIndex ()


 DESCRIPTION:

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

      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.

      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.

      The routine expects that the given object already has Context or Focus.
      It also expects that Global StepDriverTestInfo contains all the information
      it needs to perform its function.

 DATA TABLE PARAMETERS:

      5   Field 5 should contain the item index to select.
          You can enclose this index text in double-quotes to ensure proper retrieval.

 ERRORS:

      none

 Orig Author: Dawn Coen, Cyborg Systems
 Orig   Date: OCT 27, 2001
 History:

      OCT 27, 2001    Original Release
      JUN 05, 2002    (BWEBER) Added support for Java Combos.
      JAN 23, 2003    (YWANG)  Changed to click on the drop-down button.
      JAN 25, 2003    (CANAGL) Fix indexing problem with HTML Combos.



   Sub ComboSetTextValue ()


 DESCRIPTION:

      Routine to set 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.

      The routine expects that the given object already has Context or Focus.
      It also expects that Global StepDriverTestInfo contains all the information
      it needs to perform its function.

 DATA TABLE PARAMETERS:

      FLD     CONTENT
      ---     ------------------------------
       5      Text to send to 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.

 ERRORS:

      none

 Orig Author: John Crunk
 Orig   Date: Jan 15, 2002
 History:

      Jan 15, 2002    Original Release
      DEC 29, 2004    (RLD)   Added SetUnverifiedTextValue capability to the function
      Jun 10, 2005    (RJL)   Removed duplicate call to GetCurrentComboBoxText(); this
                              will eliminate extra WARNING messages in Log (bolawl)




   Sub ComboBoxSelectPartialMatch ()


 DESCRIPTION:

      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 first item containing a match of the provided substring is selected.

      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.

      The routine expects that the given object already has Context or Focus.
      It also expects that Global StepDriverTestInfo contains all the information
      it needs to perform its function.

 DATA TABLE PARAMETERS:

      5   Field 5 should contain the case-sensitive substring to select.
          You can enclose this text in double-quotes to ensure proper retrieval.

 ERRORS:

      none


 Orig Author: Carl Nagle
 Orig   Date: MAY 06, 2002
 History:

      MAY 06, 2002    Original Release
      JAN 23, 2003    (YWANG)  Changed to click on the drop-down button.




   Sub Main ()

 DESCRIPTION:

      Entry point to process StepDriver ACTION COMMANDS for this object.
      The routine merely reads the Global StepDriverTestInfo.testcommand and
      calls the appropriate subroutine to process it.

      If the testcommand is unrecognized it will be processed by the
      GenericMasterFunctions.GenericUnimplementedCommand routine.

 DATA TABLE PARAMETERS:

      none    -   the called subroutine has the requirements

 ERRORS:

      none

 Orig Author: Carl Nagle
 Orig   Date: MAR 27, 2000
 History:

      MAR 27, 2000    Original Release
      OCT 27, 2001    Added ComboBoxSelectIndex command (DCOEN)
      Jan 15, 2002    (JCrunk) Added SetTextValue command.
      MAY 06, 2002    (CANAGL) Added optional partial matches on Select.
      OCT 17, 2002    (CANAGL) Reroute fallback to GenericObjectFunctions.
      OCT 22, 2002    (CANAGL) Warn of unimplemented TF and TW record types.
      DEC 12, 2002    (CANAGL) Added support for XSLComponentActions.MAP
      JAN 03, 2003    (YWANG)  Added SelectUnverified command.
      JAN 23, 2003    (YWANG)  Changed Select... commands to click the drop-down button.
      DEC 29, 2004    (RLD)    Added SetUnverifiedTextValue command.
      OCT 19, 2005    (CANAGL) Removed Click command


Copyright (C) SAS Institute
GNU General Public License: http://www.opensource.org/licenses/gpl-license.php 
==============================================================================