Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to set the Start date for SwfCalendar control
#7
Solved: 10 Years, 9 Months, 3 Weeks ago
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"

SwfWindow("Window1").SwfWindow("Window2").SwfCalendar("dtpMeetingStartDate").Type micF4

SwfWindow("Window1").SwfWindow("Window2").SwfCalendar("dtpMeetingStartDate").Type micEsc
Solution2:

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)


SwfWindow("Window1").SwfWindow("Window2").SwfCalendar("dtpMeetingStartDate").Click (width, height)

Regards
Shiva
Reply


Messages In This Thread
RE: Unable to set the Start date for SwfCalendar control - by Shivakumarg - 06-23-2009, 10:57 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Using UFT 14.0 on Win 10, unable to find 'Register New Browser Control' utility soujanya 2 2,960 04-23-2018, 07:24 PM
Last Post: soujanya
  Date function mahbub798 1 2,117 03-27-2014, 07:27 PM
Last Post: Ankur
  Unable to set the Start date for SwfCalendar control-using SetDate or Type method mahbub798 0 2,561 03-23-2014, 05:28 AM
Last Post: mahbub798
  Does QTP/UFT support "Microsoft.Windows.Control" (one type of wpf control)? abhishikth12221 2 3,747 01-22-2014, 06:24 PM
Last Post: abhishikth12221
  wants to Automate Mainframe app, but at start QTP throws "HLLAPI.dll not found". shirish.ganjewar 0 5,092 10-14-2010, 01:06 PM
Last Post: shirish.ganjewar

Forum Jump:


Users browsing this thread: 1 Guest(s)