Data table field value failing

Question ID: 105383
0
0

I’m trying to use my data table to pass data in my script and then use that data to pick a value from a list that drops down.

The value looks good and I see it’s in the list, but when I run the test it just sits there and doesn’t select the value I’m wanting.

I checked the spelling and it looks okay.

Anything else to check?

Marked as spam
Posted by (Questions: 188, Answers: 22)
Asked on April 29, 2014 4:56 pm
7 views
Answers (1)
2
Private answer

Check you value of the cell in the data table you are trying to work with. More than likely you have a preceding space or possibly space after the value in the field. These spaces have been known to cause QTP not to be able to find the value in a drop-down list. You can delete them manually in the cell or you could look at trying a trim function for the data, such as:

myListVal=Trim (DataTable(''CellValue'',dtGlobalSheet))
Window(''Whatever'').WinList(''Whatever2'').Select myListVal

or

myListVal=DataTable(''CellValue'',dtGlobalSheet)
Window(''Whatever'').WinList(''Whatever2'').Select Trim(myListVal)

and so on...

Marked as spam
Posted by (Questions: 2, Answers: 438)
Answered on April 29, 2014 4:57 pm