Can any one explain how to select desired dates (Date picker control) using qtp/uft for a web application www.makemytrip.com

1,239 views
Skip to first unread message

msanjee...@gmail.com

unread,
May 19, 2015, 12:31:59 PM5/19/15
to mercu...@googlegroups.com
Hi Group,

Can anyone explain step by step procedure how to select dynamically a desired date from a Date Picker of Makemytrip.com or expedia applicaton

explain the code..It can help me a lot and others also.





.


amit rathi

unread,
May 20, 2015, 2:52:07 AM5/20/15
to mercu...@googlegroups.com
What problem are you facing exactly?

--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to Mercu...@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

---
You received this message because you are subscribed to the Google Groups "QTP - HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mercuryqtp+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Meghraj Singh

unread,
May 28, 2015, 9:17:28 AM5/28/15
to mercu...@googlegroups.com
First you need to get the objects in the repository and those particular dates are actually links which you can better see after adding to repository.

You can use the switch case to determine which particular date to set,
Below is some lines from my code

Select Case today_date
    Case "1" Browser("DateTime Picker").Page("DateTime Picker_2").Link("1").Click
    Case "2" Browser("DateTime Picker").Page("DateTime Picker_2").Link("2").Click
    Case "3" Browser("DateTime Picker").Page("DateTime Picker_2").Link("3").Click
    Case "4" Browser("DateTime Picker").Page("DateTime Picker_2").Link("4").Click
    Case "5" Browser("DateTime Picker").Page("DateTime Picker_2").Link("5").Click
    Case "6" Browser("DateTime Picker").Page("DateTime Picker_2").Link("6").Click

Venkat Reddy Bandaru

unread,
May 28, 2015, 10:17:45 AM5/28/15
to mercu...@googlegroups.com
Hi,
Please check the below code and let me know if it is not working

''CLicking on Date Webelement
Browser("name:=MakeMyTrip.*").Page("title:=MakeMyTrip.*").WebElement("outertext:=Select Date","index:=0").Click

''Getting a today date
idate=date()
idatevalue=Split(idate,"/")
idateval=Trim(idatevalue(1))

''Getting the today date row n the From Webtable
row=Browser("name:=MakeMyTrip.*").Page("title:=MakeMyTrip.*").WebTable("column names:=Mon;Tue;Wed;Thu;Fri;Sat;Sun","index:=0").GetRowWithCellText(idateval)
''Getting the column count  for the todays date row
ccount=Browser("name:=MakeMyTrip.*").Page("title:=MakeMyTrip.*").WebTable("column names:=Mon;Tue;Wed;Thu;Fri;Sat;Sun","index:=0").ColumnCount(row)
For i=1 to ccount
CellData=Browser("name:=MakeMyTrip.*").Page("title:=MakeMyTrip.*").WebTable("column names:=Mon;Tue;Wed;Thu;Fri;Sat;Sun","index:=0").GetCellData(row,i)
If  CellData=idateval Then
Set iObj=Browser("name:=MakeMyTrip.*").Page("title:=MakeMyTrip.*").WebTable("column names:=Mon;Tue;Wed;Thu;Fri;Sat;Sun","index:=0").ChildItem(row,i,"Link",0)
iObj.Click
Exit For
End If
Next''CLicking on Date Webelement
Browser("name:=MakeMyTrip.*").Page("title:=MakeMyTrip.*").WebElement("outertext:=Select Date","index:=0").Click

''Getting a today date
idate=date()
idatevalue=Split(idate,"/")
idateval=Trim(idatevalue(1))

''Getting the today date row n the From Webtable
row=Browser("name:=MakeMyTrip.*").Page("title:=MakeMyTrip.*").WebTable("column names:=Mon;Tue;Wed;Thu;Fri;Sat;Sun","index:=0").GetRowWithCellText(idateval)
''Getting the column count  for the todays date row
ccount=Browser("name:=MakeMyTrip.*").Page("title:=MakeMyTrip.*").WebTable("column names:=Mon;Tue;Wed;Thu;Fri;Sat;Sun","index:=0").ColumnCount(row)
For i=1 to ccount
CellData=Browser("name:=MakeMyTrip.*").Page("title:=MakeMyTrip.*").WebTable("column names:=Mon;Tue;Wed;Thu;Fri;Sat;Sun","index:=0").GetCellData(row,i)
If  CellData=idateval Then
Set iObj=Browser("name:=MakeMyTrip.*").Page("title:=MakeMyTrip.*").WebTable("column names:=Mon;Tue;Wed;Thu;Fri;Sat;Sun","index:=0").ChildItem(row,i,"Link",0)
iObj.Click
Exit For
End If
Next

 
Thanks & Regards,
Venkat Reddy Bandaru


On Tue, May 19, 2015 at 9:49 PM, <msanjee...@gmail.com> wrote:

Satish Kadali

unread,
May 28, 2015, 10:17:45 AM5/28/15
to mercu...@googlegroups.com
you can try something like...

Browser("title:=,*).Page("title:=.*).webelement("name:=Date").Type("whateverdateformat")



With Regards ,
Satish Kadali,
9550393539

*Note: Please excuse any typos

Subrata Saha

unread,
May 28, 2015, 1:17:00 PM5/28/15
to mercu...@googlegroups.com
Amit Rathi ... R u from Pune?

Prudhvi

unread,
Dec 21, 2019, 4:50:42 AM12/21/19
to QTP - HP Quick Test Professional - Automated Software Testing
Reply all
Reply to author
Forward
0 new messages