For instance, what is the best practice for assigning a global variable for today’s date that can then be used in every keyword.
The *** Variables *** section seems to only allow strings.
The code for this variable is:
${current_date}= Get Current Date local
I understand that Set Global Variable is an available task, but where should this be placed in the task file as a best practice (if it should be placed in the task file at all)?
Good option is to place it in the Suite Setup that is automatically executed before any task. It seems that we don’t have any good example about this in docs site, but here is an example:
*** Settings ***
Library DateTime
Suite Setup Set Global Variables
*** Tasks ***
Minimal task
Log ${current_date}
*** Keywords ***
Set Global Variables
${current_date}= Get Current Date local
Set Global Variable ${current_date}