Hi, I need to hide some data (string) from GIT and trying this:(get from web)
-
mylib.py (from dotenv import load_dotenv
load_dotenv()) -
created .env file (and added the data there)
dbhost=“1.1.1.1”
dbuser=“fulan”
dbpass=“sudxnilfxlminzselfinsldnd==”
dbport=“3307”
dbname=“master”
Now when I try to access the data:
*** Settings ***
Library mylib.py
*** Variables ***
${dbhost} %{dbhost}
*** Test Cases ***
Case 1 get value from env
${dbhost}= Get Variable Value ${dbhost}
log to console dbhost: ${dbhost}
log to console dbuser: %{dbuser}
log to console dbpass: %{dbpass}
log to console dbport: %{dbport}
log to console dbname: %{dbname}
That one does not work.
Undefined environment variable: dbhost
Undefined environment variable: dbuser robotframework
What am I missing? Is the location of .env file important?
Should I see the values with:
Get Environment Variables