Unable to set the Start date for SwfCalendar control - 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 Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others) +--- Thread: Unable to set the Start date for SwfCalendar control (/Thread-Unable-to-set-the-Start-date-for-SwfCalendar-control) |
Unable to set the Start date for SwfCalendar control - Shivakumarg - 06-17-2009 Hi I am trying to set the Start Date in my application (.net thick client) but the script ends up setting the end date. Please see the attachment1. Qtp detects both the StartDate and End Date as separate object on adding it to object repository. view attachment2. View the script below ************************************** Original Script Code: SwfWindow("Finish Line Timing System").SwfWindow("Meetings (Editing)").SwfCalendar("dtpMeetingStartDate").SetDate "2-Apr-2009" ********************************************************* I even tried renaming the object in the object repository. view attachment3 and 4 Every time the script for startdate is populating the end date calendar control (not as expected should populate start date) and again the script for end date is also rewriting the End date (as expected) I also tried commenting the End Date script and even removing the EndDate object from the object repository but still the script populates teh end date. *************************************************** MOdified Script Code: SwfWindow("Finish Line Timing System").SwfWindow("Meetings").SwfCalendar("cldStartDate").SetDate "20-May-2009" Any suggestions please RE: Unable to set the Start date for SwfCalendar control - ursvinod - 06-18-2009 I think you should be using selectdate instead of setdate method Code: SwfWindow("Finish Line Timing System").SwfWindow("Meetings (Editing)").SwfCalendar("dtpMeetingStartDate").SelectDate "5/20/2009" RE: Unable to set the Start date for SwfCalendar control - Shivakumarg - 06-18-2009 Selectdate is not working with Run error as SwfCalendar does not support that method. RE: Unable to set the Start date for SwfCalendar control - ursvinod - 06-18-2009 How about type .. does it your? Code: SwfWindow("Finish Line Timing System").SwfWindow("Meetings (Editing)").SwfCalendar("dtpMeetingStartDate").Type "5/20/2009" How about type .. does it work? Code: SwfWindow("Finish Line Timing System").SwfWindow("Meetings (Editing)").SwfCalendar("dtpMeetingStartDate").Type "5/20/2009" RE: Unable to set the Start date for SwfCalendar control - Shivakumarg - 06-19-2009 I had tried Type also, but it doesn't work as the application do not allow to type in date field. RE: Unable to set the Start date for SwfCalendar control - ursvinod - 06-19-2009 Even I am working on .NET application. SetDate and selectDate methods are working for me.. i associated wpf and .net addin's Startdate and Enddate in your application looks like combobox than swfcalender. I will let you know if i get some solution for your issue. Thanks Vinod RE: Unable to set the Start date for SwfCalendar control - Shivakumarg - 06-23-2009 I foubd out a way to resolve this. Actually even though the SetDate method was selecting the specified date in the SwfCalendar control it was not displaying it. When the user clicked on the control it displayed the date which was set and again on pressing escape it displayed the date. My application has F4 as the function key when the focus is on the SwfCalendar control. Not sure if it is a standard one. So there are two solution if somebody encounters such problem. Solution 1: After the SetDate method use Type for the shortcut key (F4) in my case and then use Type for Esc key to close the calendar as below Code: SwfWindow("Window1").SwfWindow("Window2").SwfCalendar("dtpMeetingStartDate").SetDate "21-May-2009" Get the Height and width of the SwfCalendar control using the GetRoProperty method and then click on the control twice to open and display the date. But this may need some trial an error to find the x, y coordinates to be clicked height= Code: SwfWindow("Window1").SwfWindow("Window2").SwfCalendar("dtpMeetingStartDate").GetROProperty "Height" height=height/2 width= Code: SwfWindow("Window1").SwfWindow("Window2").SwfCalendar("dtpMeetingStartDate").GetROProperty "Width" width = width -10 Code: SwfWindow("Window1").SwfWindow("Window2").SwfCalendar("dtpMeetingStartDate").Click (width, height) Regards Shiva |