01-30-2009, 05:57 PM
Code:
'systemutil.Run "http://newtours.demoaut.com/"
datee=browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebElement("Jan 30, 2009").GetROProperty("innertext")
print datee
mon=split(datee," ")
Exp_mont=trim(mon(0))
print "month is :"&Exp_mont
Exp_day=trim(left(mon(1),2))
print "Date is :"&Exp_day
Exp_yr=trim(mon(2))
print "Year is :"&Exp_yr
browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName").Set "tutorial"
pwd=crypt.Encrypt("tutorial")
browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("password").SetSecure pwd
browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").Image("Sign-In").Click
fromday=browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("fromDay").GetROProperty("value")
print "Actual Date is :"&fromday
frommonth=browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WebList("fromMonth").GetROProperty("value")
print "Actual Month is :"&frommonth
print "Date of 2nd page is :"&fromday
print "Month of left 3 char's"&left(frommonth,3)
If (left(frommonth,3)=Exp_mont) Then
reporter.ReportEvent micPass,"Month validation","Month is validated"
else
reporter.ReportEvent micFail,"Month validation","Month is mismatched"
End If
If (fromday=Exp_day) Then
reporter.ReportEvent micPass,"Date Validation","Day is validated"
else
reporter.ReportEvent micFail,"Date Validation","Day is mismatched"
End If
'If browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WinButton("View Calendar").WaitProperty("enabled","True",40000) then
browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").WinButton("View Calendar").Click
'Window("Select Departure Date").Activate
yr=window("Select Departure Date").WinObject("January 2009").GetROProperty("text")
act_yr=trim(right(act_yr,4))
If (act_yr=Exp_yr) Then
reporter.ReportEvent micPass,"Year Validation","Year is Validated"
else
reporter.ReportEvent micFail,"Year Validation","Year is mismatched"
End If
window("Select Departure Date").Close