I am using the Get Current Date keyword to return the date in the format year-month-day. I use this particular information to make sure that an account's created timestamp is correct in automated tests.
The issue is that the keyword is not recognised, my code should be correct (it should work and it should produce the date in the format I wish.
*** Keywords ***
Initialize Test Data
${DATE}= Get Current Date result_format=timestamp
${MYNUM}= faker.Random Int
Set Suite Variable ${MYNUM}
Set Suite Variable ${DATE}
Why do I get the error No keyword with name 'Get Current Date' found.
?
Thanks in advance.
Does a keyword Get Current Date exist in standard RF lib? There is a builtin keyword called Get Time instead. Documentation explains how to format output. To use Get Current Date you need to import DateTime library first.
Update: RF script sample which works for me:
*** Settings ***
Library DateTime
*** Test Cases ***
datatimetest
${d}= get time
log {d}
${d}= Get Current Date result_format=%Y-%m-%d
log {d}
${d} = Add Time To Date 2014-05-28 12:05:03.111 7 days
log {d}
Please remember that DateTime is a new library so in case you have old version of Robot Framework, you need to either install library or upgrade RF.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With