Insert system date to Text field

Ranorex Spy, Recorder, and Studio.
nnorbi
Posts: 5
Joined: Tue Dec 18, 2018 1:43 pm

Insert system date to Text field

Post by nnorbi » Tue Dec 18, 2018 1:54 pm

Hello There!

I have a problem. I'm never use Ranorex before.

In my recording, there is a Key sequence where in the sequence field = Teszt (Text type)

Image

In the desktop software:

Image

I need to insert the current system date to the Text field.

How to do that?

Many thanks

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 4151
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Insert system date to Text field

Post by odklizec » Fri Dec 21, 2018 10:35 am

Hi,

I'm afraid, there are missing screenshots in your post.

As for your problem, you must create a user code, in which you get the actual date (in format you need), fill the recording variable of your choice and simply use that variable in KeySequence action.

To obtain the system date/time, use this code:
timestamp = System.DateTime.Now.ToString("yy.MMM.dd_HHmmss");
Pavel Kudrys
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