Search:     Advanced search

Select Statement Does Not Work As Expected When Retrieving Numeric Values from Local Datasheets

Article ID: 810  |  Last updated: 29 Dec, 2014


When the Select statement is used to retrieve numeric values from a local datasheet, one of the following issues occurs:

  • An incorrect value is returned from the datasheet.
  • Playback fails and the following error is returned: 'The item cannot be found'.


The Select statement treats a numeric input value as the index for the item to select in the control.

If the numeric value from the datasheet can be used as an index for the item in the control, the value of the item that corresponds to the index is returned. For example, you want to enter a month from a datasheet in a combo box that uses month values such as 01, 02, and 03. During playback, the Select statement selects the second item in the list for the 02 value, which may be the incorrect value depending on the items in the combo box.

If the numeric value from the datasheet is not a valid index, playback fails because QA Wizard Pro cannot locate the item. For example, you want to enter a year from a datasheet in a combo box that uses 2000 through 2010 as year values. During playback, the Select statement attempts to select the 2000th item in the combo box for the 2000 value. Because there are only 11 items in the combo box, playback fails and returns an error because the item cannot be located.


Use the String function to convert the numeric value returned from the local datasheet to a string.


Note: You may need to further modify a script if the converted string value does not match an item value in the control, such as when converting values that start with 0 to a string. For example, 01 converts to 1 as a string.  Use the Select...Case statement or Length function to reformat string values.

Article ID: 810  |   Last updated: 29 Dec, 2014
playback datasheet numeric values Select incorrect value item cannot be found

Prev   Next
Modifying Web Scripts to Run Against a Different Web Server     Unable to Recommend Repository Changes