Using mydate in a dropdown list
Iâm trying to automate using Mercury QTP. I have a web page that has two dropdowns.
The first dropdown has only one value (ie, ABC 08/30/2006) where the Date changes everyday. Iâm confused as to how to code this. If I code it with todays date, the code produced is such:
Browser("XXXX").Page("XXXX").Frame("mainFrame_8"). WebList("event_id").Select "Campus Interview 08/23/2006"
However when I run the automated script tomorrow, it will fail because the date is incorrect. How do I code so that the date changes daily?
---------------------------------------------------------------------
Also, I have a second dropdown on this same page, which populates only with todays (current) date: (ie, 08/30/2006)
The code I use for it is such, and works fine.
Dim MyDate
MyDate = Right("0" & Month(Date), 2) & "/" & Right("0" & Day(Date), 2) & "/" & Year(Date)
Browser("XXXX").Page("XXXX").Frame("mainFrame_8"). WebEdit("appraisal_date").Set (MyDate)
Can someone possibly assist me? It would be greatly appreciated!
Thanks!
|