I am not able to use suite variables across multiple test files

71 Views Asked by At

I am initializing a suit variable in the initial suit setup by simply using,

Set Suite Variable    ${sample}    abc

in the init.robot. But the variable is not accessible in the next test file which is 01__test.robot.

Log To Console    ${sample} 

The error says: Variable '${sample}' not found.

How to use suite variables in such a way that they are accessible within the whole test suite?

I tried different methods like using the variable section etc. It simply does not work.

1

There are 1 best solutions below

0
JSFernando On

I have come across a simple solution for the above issue. We can simply set the suite variable in the initialization suite as below.

Set Suite Variable    ${sample}    abc     children=${True} 

We can ser childern=${True} which allows us to use this variable across all the test files in the current suite.