Micro Focus QTP (UFT) Forums
How to parameterize / do Desc. Programm on Calender 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: How to parameterize / do Desc. Programm on Calender control (/Thread-How-to-parameterize-do-Desc-Programm-on-Calender-control)



How to parameterize / do Desc. Programm on Calender control - nistalaramesh - 12-26-2010

Hi All,
In my Dot net web application i have so many calender controls (RAD Ajax control).
I want to pass Date value through DataTable. Please help me on this.
I am getting this type of code on recording while selecting date in Calender control.

Selecting Today's Date i am getting below code:
Code:
Browser("Browser").Page("Page").Image("Click here to select date").Click
Browser("Browser").Window("Calendar -- Webpage Dialog").Page("Calendar").Link("26").Click


Selecting Date ==> 17/09/2007, I am getting this type of code

Code:
Browser("Browser").Page("Page").Image("Click here to select date").Click
Browser("Browser").Window("Calendar -- Webpage Dialog").Page("Calendar").WebElement("<<").FireEvent "oncontextmenu"
Browser("Browser").Window("Calendar -- Webpage Dialog").Page("Calendar").WebElement("Today").Click
Browser("Browser").Window("Calendar -- Webpage Dialog").Page("Calendar").WebElement("Today_2").Click
Browser("Browser").Window("Calendar -- Webpage Dialog").Page("Calendar").WebButton("OK").Click
Browser("Browser").Window("Calendar -- Webpage Dialog").Page("Calendar").Link("17").Click


I am attaching the Calender control & it's Object spy here.

Please Help me.


RE: How to parameterize / do Desc. Programm on Calender control - manishbhalshankar - 12-27-2010

Hi Ramesh,

Add 3 columns in datatable for year, month and date. Now in the object repository, for each of these 3 objects, change the innertext properties value to be taken from datatable(Parameterize radio button) and select the appropriate column.


RE: How to parameterize / do Desc. Programm on Calender control - nistalaramesh - 12-28-2010

Hi Manish,
I am confused. Can you please update me with some sample code / Settings?
I am also attaching the Object Repository screen shot.


RE: How to parameterize / do Desc. Programm on Calender control - nistalaramesh - 01-30-2011

Hi Ankur,
Can you help on this problem?


RE: How to parameterize / do Desc. Programm on Calender control - Ankur - 01-31-2011

While working manually, are you able to directly input date in the date field? If yes, check how the date field is identified, you may do the Set operation directly without opening the calendar.

Otherwise you would need to parametrize the individual web elements properties as Manish suggested above.


RE: How to parameterize / do Desc. Programm on Calender control - anandanlk - 02-03-2011

I could see an edit box just before the calender button
Add that edit box to object repository
Set the value of the edit box using DOM object
for ex:
Code:
Browser("").Page("").SwfEdit(""").object.value="17/09/2007"



RE: How to parameterize / do Desc. Programm on Calender control - nistalaramesh - 02-19-2011

Hi Ankur,
In this Date field we can't type text. It is read only field. Attaching screen shot. Only we have to use calender control.
Set method is not working. But if you can give example how to use other method then i can proceed further.

Please Help me.


RE: How to parameterize / do Desc. Programm on Calender control - nistalaramesh - 05-10-2011

Any help is appreciated