Evaluate в Robot Framework

Содержание
Введение
Остаток от деления
Похожие статьи

Введение

Evaluate позволяет выполнять Python код в Robot Framework

Остаток от деления

Воспользуемся Evaluate чтобы вывести на экран числа, делящиеся без остатка на 3.

В файле print_multiple_of_3.robot содержится код, который выводит все числа, кратные трём в интервале от 1 до 20.

*** Settings *** *** Test Cases *** Mod X ${x}= Set Variable ${0} FOR ${x} IN RANGE 1 20 ${x}= Evaluate ${x} + 1 ${mod_x}= Evaluate ${x}%3 Run Keyword If ${mod_x}==0 Log To Console ${x} END

robot print_multiple_of_3.robot

============================================================================== Print Multiple Of 3 ============================================================================== Mod X .3 6 9 12 15 18 Mod X | PASS | ------------------------------------------------------------------------------ Print Multiple Of 3 | PASS | 1 test, 1 passed, 0 failed ============================================================================== Output: /opt/robot/src/tests/output.xml Log: /opt/robot/src/tests/log.html Report: /opt/robot/src/tests/report.html

Article author: Andrei Olegovich

Похожие статьи
Evaluate
Robot Framework
Основы
Объявить переменную
if else: Условные операторы
Циклы
Изменить значение переменной

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: