[python] How to write multiple conditions of if-statement in Robot Framework

I have trouble writing if conditions in Robot Framework.

I want to execute

Run Keyword If '${color}' == 'Red' OR '${color}' == 'Blue'  OR '${color}' == 'Pink'    Check the quantity

I can use this "Run keyword If" keyword with one condition, but for more than one conditions, I got this error:

FAIL: Keyword name cannot be empty.

And also I would like to use these keywords:

Run Keyword If '${color} == 'Blue' AND '${Size} == 'Small' AND '${Design}' != '${Simple}'      Check the quantity

And

Run Keyword Unless '${color}' == 'Black' OR '${Size}' == 'Small' OR '${Design}' == 'Simple'

But I just end up getting errors.

This question is related to python python-2.7 selenium robotframework

The answer is


Just make sure put single space before and after "and" Keyword..


The below code worked fine:

Run Keyword if    '${value1}' \ \ == \ \ '${cost1}' \ and \ \ '${value2}' \ \ == \ \ 'cost2'    LOG    HELLO

Examples related to python

programming a servo thru a barometer Is there a way to view two blocks of code from the same file simultaneously in Sublime Text? python variable NameError Why my regexp for hyphenated words doesn't work? Comparing a variable with a string python not working when redirecting from bash script is it possible to add colors to python output? Get Public URL for File - Google Cloud Storage - App Engine (Python) Real time face detection OpenCV, Python xlrd.biffh.XLRDError: Excel xlsx file; not supported Could not load dynamic library 'cudart64_101.dll' on tensorflow CPU-only installation

Examples related to python-2.7

Numpy, multiply array with scalar Not able to install Python packages [SSL: TLSV1_ALERT_PROTOCOL_VERSION] How to create a new text file using Python Could not find a version that satisfies the requirement tensorflow Python: Pandas pd.read_excel giving ImportError: Install xlrd >= 0.9.0 for Excel support Display/Print one column from a DataFrame of Series in Pandas How to calculate 1st and 3rd quartiles? How can I read pdf in python? How to completely uninstall python 2.7.13 on Ubuntu 16.04 Check key exist in python dict

Examples related to selenium

SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 81 session not created: This version of ChromeDriver only supports Chrome version 74 error with ChromeDriver Chrome using Selenium Selenium: WebDriverException:Chrome failed to start: crashed as google-chrome is no longer running so ChromeDriver is assuming that Chrome has crashed WebDriverException: unknown error: DevToolsActivePort file doesn't exist while trying to initiate Chrome Browser Class has been compiled by a more recent version of the Java Environment How to configure ChromeDriver to initiate Chrome browser in Headless mode through Selenium? How to make Firefox headless programmatically in Selenium with Python? element not interactable exception in selenium web automation Selenium Web Driver & Java. Element is not clickable at point (x, y). Other element would receive the click How do you fix the "element not interactable" exception?

Examples related to robotframework

SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 81 How to write multiple conditions of if-statement in Robot Framework