question of ranorex code
-
- Posts: 23
- Joined: Tue Feb 13, 2018 2:33 pm
question of ranorex code
how can I make ranorex by code take me the current date and time
Re: question of ranorex code
Hi,
Current date could by obtained with this code:
Current date could by obtained with this code:
Code: Select all
string dateFormat = "dd/MM/yyyy";
//get actual date
System.DateTime curDate = System.DateTime.Today;
//convert date to string
string curDateStr= curDate.ToString(dateFormat);
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
-
- Posts: 23
- Joined: Tue Feb 13, 2018 2:33 pm
Re: question of ranorex code
odklizec wrote:Hi,
Current date could by obtained with this code:Code: Select all
string dateFormat = "dd/MM/yyyy"; //get actual date System.DateTime curDate = System.DateTime.Today; //convert date to string string curDateStr= curDate.ToString(dateFormat);
but if I say I want to insert the value of the actual date I can do it in a text field?
for example in keepass I must write password "rx"; just so that "rx" does not appear if not the current date as I can do?
Re: question of ranorex code
Hi,
I'm afraid, I don't quite understand what's your goal? To pass the current date to an element, you can either do this from code or from recording, using Set Value or Key sequence action.
Set Value is not ideal (and may actually fail) for web-based apps, where some inputs are using "on-mouse" and "on-key" events, which are not triggered by Set Value action. Hence it's better to use Key Sequence instead.
Please provide a small sample project/test suite (based of the keypass or any other publicly available app/web page), in which you show us your intention.
I'm afraid, I don't quite understand what's your goal? To pass the current date to an element, you can either do this from code or from recording, using Set Value or Key sequence action.
Set Value is not ideal (and may actually fail) for web-based apps, where some inputs are using "on-mouse" and "on-key" events, which are not triggered by Set Value action. Hence it's better to use Key Sequence instead.
Please provide a small sample project/test suite (based of the keypass or any other publicly available app/web page), in which you show us your intention.
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