Micro Focus QTP (UFT) Forums
Not able to select weblist value - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Not able to select weblist value (/Thread-Not-able-to-select-weblist-value)



Not able to select weblist value - automation2012 - 09-19-2013

Weblist has items - 1,2,3,4,5,6,7,8,9,10,11,12

current value set to 9

i want to select 8

belw code is not helping me to solve my issue -

Code:
sTimeVal = "9"
sTimeVal = (sTimeVal) - "1"
PRINT sTimeVal

Browser("CVS pharmacy").Page("CVS pharmacy - SelectLocation").WebList("PickupHours").Select sTimeVal

Please suggest me the possible solution

Got the solution..after using Cstr its working


RE: Not able to select weblist value - supputuri - 09-19-2013

Code:
sTimeVal = 9
sTimeVal = (sTimeVal) - 1
PRINT sTimeVal

Browser("CVS pharmacy").Page("CVS pharmacy - SelectLocation").WebList("PickupHours").Select sTimeVal



RE: Not able to select weblist value - basanth27 - 09-20-2013

You may want to know the difference notation of Integer vs String.
Why are you doing this if you want to select only 8?
Code:
sTimeVal = (sTimeVal) - 1
This should just work fine?
Code:
sTimeVal=8
Browser("CVS pharmacy").Page("CVS pharmacy - SelectLocation").WebList("PickupHours").Select sTimeVal