Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Month name select from WebList Box
#1
Hi,

I am new to QTP. I have small doubt, how to select the month name, automatically using for loop.

Ex:
Code:
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("toMonth").Select "January" Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("toMonth").Select "February" Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("toMonth").Select "March" Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("toMonth").Select "April" Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("toMonth").Select "May"

the above example, user manually selecting the month name. inserted of using for loop, it's select all month name in one line

Ex:
Code:
For nRow = 1 To 12 Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("toMonth").Select "January" nRow = nRow + 1 Next

when loop is running, it's should select month name from WebList box "January", "February", "March", "May",....

I don't know how to write a script for this condition, Please help me to solve this problem.

Thanks & Regards,
Kamalakannan Anandan


Hi,

Code:
For nFromMonth = 0 To 11 Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("fromMonth").ExtendSelect(nFromMonth) Wait 1 'Delay Time Next


Thanks & Regards,
Kamalakannan Anandan
Reply
#2
Hi,
There is a function - MonthName which returns name of the month.
MonthName(6) returns June.
Reply
#3
@ kamalakannan_anandan
that ExtendSelect will select all months one by one and i don't think anyone would be liking to seltct all months at a time

so just use "select"

Code:
For i= 0 To 11 Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("toMonth").Select i Wait 1 'Delay Time Next
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  WEBLIST shayk1985 3 6,429 05-17-2018, 11:49 AM
Last Post: Ankur
  Weblist selection diya 11 23,166 06-16-2015, 08:27 PM
Last Post: rajpradeep32
  Comparing webtable data with weblist and webelements in other webpage arnav 1 6,361 04-18-2014, 10:01 PM
Last Post: Parke
  Unable to select value on weblist ShekharUlli 3 6,336 09-26-2013, 08:58 AM
Last Post: basanth27
  Not able to select weblist value automation2012 2 4,042 09-20-2013, 07:19 AM
Last Post: basanth27

Forum Jump:


Users browsing this thread: 1 Guest(s)