Skip to content

Instantly share code, notes, and snippets.

@apallier
Created February 8, 2023 21:31
Show Gist options
  • Save apallier/d67f9068cd7f51ce329eeaf33c78b510 to your computer and use it in GitHub Desktop.
Save apallier/d67f9068cd7f51ce329eeaf33c78b510 to your computer and use it in GitHub Desktop.
Robot Framework: inject variables/presets methods

Method 1

robot --variable VARIABLE:value

Method 2

*** Settings ***
Resource    variables.robot

Method 3

robot --variablefile python_variables.py;yaml_variables.yaml

Method 4

*** Variables ***
VARIABLE    %{ENV_VARIABLE}

Method 5

*** Keywords ***
My Keyword
    ${GLOBAL_VARIABLE}=    Generate Random String    length=4    chars=[NUMBERS]
    Set Global Variable    ${GLOBAL_VARIABLE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment