How to source file in bash using Robot platform?

Does anyone know how to create a file using a Robot framework?

I am trying to use "Run" or "Run the process" to start the source, but it looks like the environment variables set in the source file are not saved.

eg.

${out} | Run Process | source | set_config.sh | shell=True
${out} | Run Process | check_env_vars.pl

Check_env_vars.pl returns an error message in which the charters of the environment have not yet been established, although they were set on the previous line. Any suggestion on how to do this?

Thanks in advance!

+4
source share
1 answer

, " " , , .

*** Settings ***
Library  Process
Library  OperatingSystem

*** Test Cases ***
sample
    Set Environment Variable  VAR  2
    Run Process   sh  Sample2.sh

Sample.sh :

echo $VAR > console.txt

env, robotframework, Sample2.sh. , "check_env_vars.pl", .

, !

+3

Source: https://habr.com/ru/post/1673562/


All Articles