Объявить переменную в Robot Framework

Содержание
Введение
В блоке *** Variables ***
Внутри тест кейса
& Словарь
Похожие статьи

Введение

Первый способ - создать глобальные переменные в начале .robot файла

Второй - воспользоваться Set Variable

В блоке *** Variables ***

Не забывайте, что между знаком = и присваиваемым значением должно быть больше чем один пробел.

*** Settings *** # make at least two spaces beetween Documentation Simple example using SeleniumLibrary. Library SeleniumLibrary *** Variables *** ${WEBSITE_URL} = www.aredel.com *** Test Cases *** Test case number one [documentation] Web url test [tags] web Log To Console ${WEBSITE_URL}

Внутри тест кейса

*** Settings *** # make at least two spaces beetween Documentation Simple example using SeleniumLibrary. Library SeleniumLibrary *** Variables *** *** Test Cases *** Test case number one [documentation] Web url test [tags] web ${WEBSITE_URL} = Set Variable www.heihei.ru Log To Console ${WEBSITE_URL}

& Словарь

Если в переменную нужно сохранить словарь использовать нужно &

*** Settings *** # make at least two spaces beetween Documentation Simple example using SeleniumLibrary. Library SeleniumLibrary *** Variables *** *** Test Cases *** Test case number one [documentation] Web url test [tags] web &{VARIABLE} = Some Keyword Log To Console ${VARIABLE}

Article author: Andrei Olegovich

Похожие статьи
Robot Framework
Basics
RFBrowser
Set Variable
if else: conditionals
in: check if smth belongs to list
Loops
Change Variable Value
New Line
[Tags]
Collections: lists, dicts
JSON
Pass Argument to a Keyword
Evaluate
Robot in PyCharm
PyCharm
Banner image

Search this site

Subscribe to Telegram channel @aofeed to follow new articles and updates to old ones

Go to channel

@aofeed

Ask a question in the Telegram group

@aofeedchat

Contacts and cooperation:
I recommend our hosting beget.ru
Write to info@urn.su, info@aredel.com if you:
1. Want to write an article for our site or translate an article into your native language.
2. Want to place thematically relevant ads on the site.
3. Ads on my site pass maximum censorship. If you see an ad block unsuitable for school-age children, shocking or misleading - please contact us by e-mail
4. Found a mistake, inaccuracy, bug, etc. on the site. ... .......
5. Articles can be shared on social media by clicking a network icon: