Setting Up Python 3 with Robot Framework for Test Automation

Python Installation

Donwload and install Python from the official website: https://www.python.org/. During installation, ensure you check the option to add Python to the system PATH. After installation, verify the installation by opening a command prompt and typing 'python'. If the Python version is displayed, the installation was successful.

WxPython Installation

Install WxPython using pip with the following command:

pip install wxPython

RIDE Installation

Install Robot Framework IDE (RIDE) using pip:

pip install robotframework-ride

Selenium2Library Installation

Install Selenium2Library for web browser automation:

pip install robotframework-selenium2library

AutoItLibrary Installation

  1. Download AutoIt v3 from https://www.autoitscript.com/site/autoit/downloads
  2. Extract the downloaded package and run the installer. For 64-bit systems, ensure you select the 64-bit option during installation to avoid errors later.
  3. Install the Robot Framework AutoItLibrary:
pip install robotframework-autoitlibrary

Browser Driver Setup

Download the appropriate browser driver from:

Before downloading, check your browser version and select the matching driver version. After downloading, place the driver executable (e.g., chromedriver.exe) in your Python installation directory (e.g., C:\Program Files\Python311).

Creating pybot.bat

Create a new file named pybot.txt and add the following content:

@Echo off
python -m robot.run %*

Save the file and change its extension to .bat. Copy this file to your Python Scripts directory (e.g., C:\Program Files\Python311\Scripts). This will prevent "no pybot" errors when running test cases.

Starting Robot Framework RIDE

Navigate to your Python Scripts directory (e.g., C:\Users\ivan\AppData\Roaming\Python\Python311\Scripts) and find ride.py. Open a command prompt in this directory and execute:

python ride.py

Once RIDE is running, you can create a desktop shortcut via the Tools menu for easier access.

Test Example

The following test case demonstrates opening a browser, navigating to a website, and performing login actions:

*** Settings ***
Library           Selenium2Library
Library           AutoItLibrary

*** Test Cases ***
Login Test
    Log    Starting automation test
    Open Browser    https://www.example.com    Chrome
    Maximize Browser Window
    Wait Until Element Is Visible    id=login-button
    Click Element    id=login-button
    Sleep    2
    Wait Until Element Is Visible    id=login-form
    Sleep    2
    Input Text    name=username    testuser
    Sleep    2
    Press Keys    name=password    mypassword
    Sleep    2
    Click Button    id=submit-login
    Sleep    2
    Close Browser

Tags: robot-framework python-automation test-automation Selenium autoit

Posted on Sun, 24 May 2026 20:02:13 +0000 by truCido