DateTimePicker

Ask general questions here.
makodela
Posts: 1
Joined: Tue Dec 15, 2009 11:54 pm

DateTimePicker

Post by makodela » Tue Dec 15, 2009 11:58 pm

Hi
i have DateTimePicker control in my application
i need to automate the click and selecting date
i have used the option to set the value but i need to see the flow of click and selecting the date ....
how can i do it as click action is not recognized as button click as in other dropdowns
with spy i am seeing very few properties
any helpis appreciated

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: DateTimePicker

Post by Support Team » Wed Dec 16, 2009 11:47 am

If I understand you right you have already noticed that the drop down button is not recognized as a separate button and when you use the spy to track the datetimepicker it selects the list.

The list is a child of the Datetime as you’ll see in the spy. The element you what is the Datetime and not the list. If you are using a repository you can just drag it from spy into the Repository. You will need to convert the Ranorex.Datetime instance to a Ranorex.Control and call the SetPropertyValue Method. The property name that you want to set is ‘Value’.
Here are some links that should help.

http://www.ranorex.com/support/user-gui ... apter.html (the section on Multiple Adapters for one GUI element)

http://www.ranorex.com/Documentation/Ranorex-2.0/
http://www.ranorex.com/Documentation/Ra ... yValue.htm


if you really need to perform the clicks then you will need to use the imaging capabilities of the recorder. You can find a Screencast at this link that shows how to use imaging capabilities http://www.ranorex.com/support/screencasts.html.

I also recommend that you watch the ones on the RanorexPath as well.

Regards,
Ron
Support Team

jtruppia
Posts: 11
Joined: Sat Oct 22, 2011 12:35 am

Re: DateTimePicker

Post by jtruppia » Wed Nov 02, 2011 8:00 pm

Thanks, saved my day!

Here is my code, maybe someone will find it useful

Code: Select all

 Ranorex.DateTime dateTimePicker = ranorexRepo.DateChooser.DateTimePicker;
 var control = new Ranorex.Control(dateTimePicker);
 control.SetPropertyValue("Value",System.DateTime.Parse(time).ToShortTimeString());

omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Re: DateTimePicker

Post by omayer » Mon Mar 26, 2012 4:42 pm

I need some tutorial on this line please

var control = new Ranorex.Control(dateTimePicker);
Tipu

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: DateTimePicker

Post by Support Team » Tue Mar 27, 2012 12:54 pm

Hi,

as described in following chapter of our user guide, this line of code converts the DateTime adapter into a Control adapter:
Ranorex UI Adapter

The Control adapter (which is available for .NET WinForms applications) allows to access more properties than the DateTime adapter.

Regards,
Tobias
Ranorex Support Team