RPA - Desktop - UI Locator - Conditional Statements

Hi all,
I am new to robot framework, and I am interested to learn how to use it for automated testing on desktop applications. I want to take a screenshot when a particular UI locator image for a warning appears inside a simulator running in Windows.

How would you use the Wait for element and alias for a UI image in a conditional statement? Thanks!

*** Settings ***
Documentation Automate testing
Library RPA.Desktop

*** Keywords ***
Warning test
@{elements} Wait for element ${1:locator} timeout=5

IF Wait for element ${1:locator} == True
Take Screenshot
ELSE
Click ${1:locator}
END

My conda.yaml :
python=3.7.5

pip=20.1

rpaframework==11.6.3 # Release notes — RPA Framework documentation
rpaframework-recognition==0.7.2

There are keywords what you can use for conditional execution. Some options.

1 Like