DateTimePicker : General Questions

DateTimePicker

Ask general questions here.

DateTimePicker

Postby makodela » Wed Dec 16, 2009 12:58 am

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
makodela
 
Posts: 1
Joined: Wed Dec 16, 2009 12:54 am

Re: DateTimePicker

Postby Support Team » Wed Dec 16, 2009 12:47 pm

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
User avatar
Support Team
Site Admin
 
Posts: 4840
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: DateTimePicker

Postby jtruppia » Wed Nov 02, 2011 9: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());
jtruppia
 
Posts: 11
Joined: Sat Oct 22, 2011 1:35 am

Re: DateTimePicker

Postby omayer » Mon Mar 26, 2012 5:42 pm

I need some tutorial on this line please

var control = new Ranorex.Control(dateTimePicker);
Tipu
omayer
 
Posts: 239
Joined: Thu Oct 28, 2010 7:14 pm

Re: DateTimePicker

Postby Support Team » Tue Mar 27, 2012 1: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
User avatar
Support Team
Site Admin
 
Posts: 4840
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to General Questions

Who is online

Users browsing this forum: No registered users and 0 guests