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

SwfWindow("Finish Line Timing System").SwfWindow("Meetings (Editing)").SwfCalendar("dtpMeetingEndDate").SetDate "11-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"

'SwfWindow("Finish Line Timing System").SwfWindow("Meetings").SwfCalendar("dtpMeetingEndDate").SetDate "20-May-2009"
***************************************************

Any suggestions please


Attached Files Image(s)
               
Reply
#2
Solved: 10 Years, 8 Months, 3 Weeks ago
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"
try the above code
Reply
#3
Solved: 10 Years, 8 Months, 3 Weeks ago
Selectdate is not working with Run error as SwfCalendar does not support that method.
Reply
#4
Solved: 10 Years, 8 Months, 3 Weeks ago
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"
Reply
#5
Solved: 10 Years, 8 Months, 3 Weeks ago
I had tried Type also, but it doesn't work as the application do not allow to type in date field.
Reply
#6
Solved: 10 Years, 8 Months, 3 Weeks ago
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
Reply
#7
Solved: 10 Years, 8 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


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,936 04-23-2018, 07:24 PM
Last Post: soujanya
  Date function mahbub798 1 2,101 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,538 03-23-2014, 05:28 AM
Last Post: mahbub798
  Does QTP/UFT support "Microsoft.Windows.Control" (one type of wpf control)? abhishikth12221 2 3,723 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,079 10-14-2010, 01:06 PM
Last Post: shirish.ganjewar

Forum Jump:


Users browsing this thread: 1 Guest(s)