Current date, how to put it into manual mode. Is it possible?

Is it possible to change in the manual mode the date?
It needs to be every time the current date.

It has 3 different inputs / steps

  1. Day
  2. Month
  3. Year
    When you record it the item is Set Text.

Is it possible to change the input on a way that it will always take the current one?
The person that is using it doesn’t know how to change things in the script mode so when it is possible in manual mode it is great.

Hi @suzanne.vandeneinden,

As far as i know you need to write a code/keyword to get the current date and call the keyword in script.
Not sure if this can be achieved in manual mode though.
Lets hope others can help you regarding this.


1 Like

I work in Script mode, however, when I move to Manual mode, it looks like below:

Note that the method I used makes the dayPart, monthPart and yearPart as ints. In other words, as a number. To use them in a setText, you will have to add “toString()” to them:
WebUI.setText(findTestObject('TO'), dayPart.toString())

Here is what it looks like in Script mode:

Date todaysDate = new Date();

def dayPart = todaysDate[Calendar.DAY_OF_MONTH];
def monthPart = todaysDate[Calendar.MONTH] + 1;
def yearPart = todaysDate[Calendar.YEAR];

Also, adding the one to month is necessary.

1 Like

Thank you. Going to give the solution to them and hope this will help them.