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
DateTimePicker
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: DateTimePicker
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
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
Re: DateTimePicker
Thanks, saved my day!
Here is my code, maybe someone will find it useful
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());
Re: DateTimePicker
I need some tutorial on this line please
var control = new Ranorex.Control(dateTimePicker);
var control = new Ranorex.Control(dateTimePicker);
Tipu
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: DateTimePicker
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
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