DEV Community

Manoranjan
Manoranjan

Posted on

How to execute your first .robot file.

Robot Framework is a generic open source automation framework. It can be used for test automation and robotic process automation (RPA). It can be integrated with virtually any other tool to create powerful and flexible automation solutions.

Robot Framework has an easy syntax, utilizing human-readable keywords. Its capabilities can be extended by libraries implemented with Python, Java or many other programming languages.

pre-requisites - you need to have python installed.

step-1: install robotframework

pip install robotframework

after executing this command verify the robotframework installation

robot --version
or 
pip list 

Enter fullscreen mode Exit fullscreen mode

step-2 : install SeleniumLibrary

pip install robotframework-seleniumlibrary
Enter fullscreen mode Exit fullscreen mode

Step-3 : you still need to install browser drivers separately.

Goto the following link  
https://www.selenium.dev/selenium/docs/api/py/index.html#drivers
and download necessary drivers unzip and place it PATH,
or you can place inside python folder
Ex: C:\Program Files\Python-38\Scripts
Enter fullscreen mode Exit fullscreen mode

Step-4: Open your favorite IDE or simply nodepad & copy the below code & save as tc1.robot

*** Settings ***
Library           SeleniumLibrary

*** Test Cases ***
My first robot file 
    Log To Console     Hello Robot World..!
    Open Browser https://www.google.co.in/ chrome
Enter fullscreen mode Exit fullscreen mode

Step-5: Open the terminal & execute the file 🚀

python -m robot tc1.robot
Enter fullscreen mode Exit fullscreen mode

congratulation..!! you have executed your first robot file 🙌

Top comments (0)