I'm trying to get the current date and time in Selenium IDE (latest version 3.7.4) in a format like this 2019-05-21 12:35:23 that is YYYY-MM-DD hh:mm:ss
I'm new to javascript and what I found so far is that in Javascript the current date is obtained from system using new Date();
So I've set the following commands in Selenium IDE
1)
Command: execute script
Target: new Date();
Value: currentdate
2)
Command: echo
Target: $(currentdate)
Value:
But it seems Date(); is not working and is not stored in variable currentdate. This is the output
executeScript on new Date(); with value currentdate OK
echo: undefined
'Untitled' completed successfully
What I'm doing wrong? Thanks for help in advance.