Hi, at this moment i need to ask if it is possible to select or set a value on a dataTimePicker from a string using code, when i click to open i have a Form you can see on the attach picture.
string one = 02/12/2008.This time i can't search for the value to match, i have to set the value of the control...How can i do that?
public static void UserCodeMethod1()
{
string startDate = "01/02/2008";
Ranorex.Form rtcForm = ("/form[@controlname='RTCMain']");
Ranorex.DateTime DataTime = rtcForm.FindSingle("/form[@controlname='RTCMain']/container[@controlname='myTimeSel']/container/tabpagelist/tabpage[@controlname='tabTimeframe']/container/datetime[@controlname='dateTimePickerFrom']");
DataTime.Value.....
Thank you
Select item on dataTimePickerFrom
Select item on dataTimePickerFrom
You do not have the required permissions to view the files attached to this post.
Last edited by rj-nora on Tue Jun 08, 2010 10:51 am, edited 1 time in total.
Re: Select item on dataTimePickerFrom
I don't think there is a way to select dates from the calendar element directly without using imaging.
Reading this post http://www.ranorex.com/forum/post4063.h ... time#p4063 discusses setting the value of the dateTime instance.
What I do in my testing is to get the RXPath to the text box that lives under the dateEdit element and enter the date text there. This way I can enter any date information I want into the AUT without having to go directly through the calendar element.
Reading this post http://www.ranorex.com/forum/post4063.h ... time#p4063 discusses setting the value of the dateTime instance.
What I do in my testing is to get the RXPath to the text box that lives under the dateEdit element and enter the date text there. This way I can enter any date information I want into the AUT without having to go directly through the calendar element.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!
Ciege...
Ciege...
Re: Select item on dataTimePickerFrom
Hi Ciege thanks for your help, my problem is different as you can see on the snapshot i attach on this post, i don't have a text box while exploring the control with Ranorex Spy i only catch the DateTimePicker and inside a List...but when i open the button appears the Calendar Form..Neither I can search for the date on the ListItems because i need to open the list, but the open button brings the Calendar Form...
However manually i can set the value of the control like you can see on the other attach, first the year, then the month and then the day, however i can't change the "/" only the date...
How can i solve this?
Regards
However manually i can set the value of the control like you can see on the other attach, first the year, then the month and then the day, however i can't change the "/" only the date...
How can i solve this?
Regards
You do not have the required permissions to view the files attached to this post.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Select item on dataTimePickerFrom
Hi,
Peter
Ranorex Support Team
On that way you should be able to set the value of a "dateTimePicker"rj-nora wrote:How can i solve this?
Ranorex.DateTime dateTimeDateTimePicker = "pathToDateTimePicker"; dateTimeDateTimePicker.Value = System.DateTime.Parse("16/12/2010"));Regards,
Peter
Ranorex Support Team
Re: Select item on dataTimePickerFrom
Hello , thank you very much! one more problem solved 

Re: Select item on dataTimePickerFrom
This hasn't been useful to me, Value property has no setter.
I had to resort to the method here http://www.ranorex.com/forum/datetimepicker-t1141.html
I had to resort to the method here http://www.ranorex.com/forum/datetimepicker-t1141.html