Robot Framework is an open-source test automation framework that is simple to use with minimal programming. In this blog, we give step-by-step instructions on how we installed the robot framework on windows.
Robot Framework is an open-source test automation framework that is simple to use with minimal programming. It is supported by the Robot framework foundation and works on all types of operating systems. The robot framework comes with a simple tabular format i.e. RIDE editor, where the test cases are written using the keyword format. Writing test cases using keywords is easier by adding/installing external libraries.
Here, we installed the robot framework on windows by using the following steps:
- Install below commands so we can use the selenium and Excel/CSV keywords in the coding.
- How to use different libraries (like “selenium”) with Robot
First step
Second step
Third step
- I am sharing a few important events which are commonly used from Selenium library
# find proper locator of calendar to open it
#..locator can be xpath/cssSelector/id
#...
Click Element Locator
# find locator of input text and enter data in it, please make sure you're
# following required format. In my case format was dd/mm/yyyy.
Input Text Locator Input required date
# intialise list first
@{random_row_list} Create List
# ...
# ...
Append To List ${random_row_list} ${values}
# initialise file
Create File tempfilename.csv
# ...
# if you've headers in a list, convert them to string
${header_string} Convert List To Comma Seperated String ${header}
# ...
# append this string to initialised file like given command below
Append To File tempfilename.csv ${header_string}
# assuming you've string and you want to split it on space
${array_result}= Split String ${some_random_string} ${SPACE}
# Please note "This is my function name" is actually referred as function name
# ...
# business logic before executing the function
${returned_data} This is my function name ${first_parameter}
# ...
# ...
# write your business logic once you get data from function
This is my function name
[Arguments] ${first_argument}
[Documentation] This is function documentation
# ...
# specify what you want to do with the function
# specify return_value, if required
[Return] ${return_value}
Note: What’s the necessity or importance of indentations in the Robot framework?
In python, indentation refers to spaces that are used at the beginning of a statement. It is used in the loop and conditional statements. Its main use is to indicate a block of code. When you want to indent code then you have to add 4 white spaces or click on the tab button.