Is it possible to create a new variable in a set / test setup - Robot Framework?

Is it possible to initialize a variable in a set or test setup based on the return value of a keyword? I tried this syntax and it did not work:

*** Settings ***
| Suite Setup | ${A variable}= | Set Variable | A String

I know that I can name keywords like "Set Suite Variable", but they do not allow me to set a variable to the result of another keyword. In this example, I used "Set Variable", but I want to be able to call any keyword here.

+4
source share
2 answers

, , . , .

, , . :

*** Settings ***
| Suite Setup | Custom suite setup

*** Keywords ***
| Custom suite setup
| | ${A Variable}= | Set Variable | A String
| | Set suite variable | ${A Variable}

, . , , , Set Variable.

+12

Bryan , , , "" Robot Framework.

- Variables.

*** Variables ***
${this_string}  This String
${that_int}     5

- .txt Resource. *** Settings ***, . , VarList.txt, :

*** Settings ***
Resource    VarList.txt

, .

, . Set Suite Variable Set Global Variable , Bryan. Set Suite Variable , Set Global Variable . -Suite script , Set Suite Variable, , , , Suite script .

0

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


All Articles