hello i am testing a cancellations module which means i have to cancel a event before it happens in realtime (i know its a pain)
i have tried using excels now() formula which when imported in ranorex does not show as time format but as text like 04567289.
is there a simple way I can insert the time of insert say 1000 plus 15 minutes say 10:15
thanks in advance, please not i am not a coder.....
once again thanks in advance
James Murrell
Insert time +15 minutes
Re: Insert time +15 minutes
Hi,
Could you please specify where exactly you want to insert the time? Ideally, please post a Ranorex snapshot (NOT screenshot) of the input element.
Generally speaking, you can use DateTime and Now to add minutes to the actual time. You can use code lie this to get the actual time + 15m...
To set the time to element of your choice, you can use either KeySequence or SetValue action.
Could you please specify where exactly you want to insert the time? Ideally, please post a Ranorex snapshot (NOT screenshot) of the input element.
Generally speaking, you can use DateTime and Now to add minutes to the actual time. You can use code lie this to get the actual time + 15m...
Code: Select all
System.DateTime startDate = System.DateTime.Now;
string curTimePlusMins = startDate.AddMinutes(15).ToShortTimeString();
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Insert time +15 minutes
thanks here is snapshot
the format must be 00:00 hh:mm
the format must be 00:00 hh:mm
- Attachments
-
- time insert.rxsnp
- (66.49 KiB) Downloaded 9 times
Re: Insert time +15 minutes
Hi,
Basically, must create a repo element with xpath like this:Hope this helps?
Basically, must create a repo element with xpath like this:
Then you must assign repo element as argument of method like this:/dom[@domain='test.mywebroster.com']/?/?/form[@name='frmEditRequirement']//input[@name='txtTimeFrom']
Code: Select all
public static void SetTimePlusMinutes(RepoItemInfo repoElement)
{
System.DateTime startDate = System.DateTime.Now;
string curTimePlusMins = startDate.AddMinutes(15).ToString("HH:mm");;
repoElement.CreateAdapter<Ranorex.Unknown>(false).PressKeys(curTimePlusMins);
}
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Insert time +15 minutes
thanks for this:
silly question from me:
how do you assign repo element as argument of method
i only ever have used front end of Ranorex, nothing with actual code
silly question from me:
how do you assign repo element as argument of method
i only ever have used front end of Ranorex, nothing with actual code
Re: Insert time +15 minutes
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Insert time +15 minutes
Thanks for this i will see if i can get working: and i will let you know the outcome
Thanks
Thanks
Re: Insert time +15 minutes
WOW: got it working:
Thanks for the code and the link which helped me learn.....
seriously you have saved me a major headache: and helped us provide better software
Thanks for the code and the link which helped me learn.....
seriously you have saved me a major headache: and helped us provide better software
Re: Insert time +15 minutes
Hi,
Nice to hear you got it working. I'm glad I could help
Nice to hear you got it working. I'm glad I could help

Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration