tr1via
tr1via

Reputation: 57

How to set an environment variable in Robot Framework

Trying to set an env var using robot script

${res}=  Set Environment Variable  ABCDE  12345

But when I check the env vars from my shell, I am not able to find it!

grep-ing the env var key in shell

Robot Logs:

Robot logs

Upvotes: 1

Views: 3820

Answers (1)

Adrian W
Adrian W

Reputation: 5036

Environment variables are local to the process in which they are created. They are inherited to child processes, but not to parents. That's why you can't see them in the calling process. *ix shells have a special export command to export environment variables, but there is no export feature in Robot Framework. So, AFAIK this is not possible.

Upvotes: 3

Related Questions