Pass variables from python file to robot structure variables

I assign variables in the frame of the robot as

*** Variables ***
${TestNAME}                       test

But can I pass the value of a variable from a python file?

#test.py
var = 'test'

Can I assign varto ${TESTNAME}?

+4
source share
1 answer

If you have a file called "test.py" that has the variables defined in it, you can import the variables using the variable file feature.

Here's an example using a pipe split format for clarity:

*** Settings ***
| Variables | test.py

*** Variables ***
| ${myTestName} | ${var}

, Variables. python (: python variable var ${var})

, , ${Testname} , . , , , ${myTestName}.

+7

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


All Articles