Getting Started with Robot Framework

Aug 2, 2024

Selenium with Python using Robot Framework - Introduction

Presented by: Pawan


Overview

  • Introduction of a new series on Selenium with Python using Robot Framework.
  • Topics covered:
    • What is Robot Framework?
    • Differences from other frameworks.
    • How to set up Robot Framework.
    • Prerequisites for setup.

What is Robot Framework?

  • Definition:
    • A generic test automation framework for acceptance testing.
  • Purpose:
    • Designed for users (customers) without programming backgrounds to automate test cases easily.
  • Types of Testing Supported:
    • Focuses on Acceptance Test Driven Development (ATDD).
    • Supports Test Driven Development (TDD) and Behavior Driven Development (BDD).

Key Features of Robot Framework

  • Keyword Driven Testing:
    • Uses predefined keywords for operations (e.g., `open browser` to launch a URL).
  • Libraries:
    • Provides numerous libraries built with Python and Java.
    • Users can create new keywords using existing ones.
  • Ease of Use:
    • Non-technical users can understand and write test cases easily using keywords.

Robot Framework vs. Traditional Selenium Scripts

  • Traditional Selenium:
    • Requires knowledge of Python scripting and Selenium methods.
  • Robot Framework:
    • Simplifies the process using keywords; code is easier to read and understand.
    • Example operations:
      • Traditional:
        • driver.get(url)
        • find_element_by_name().send_keys()
      • Robot Framework:
        • Open Browser
        • Input Text
        • Click Element

How Robot Framework Works

  • Contains multiple built-in libraries (e.g., Selenium library, DB library) implemented in Python/Java.
  • Installation Process:
    • Requires installing Robot Framework and additional libraries (like Selenium).

Setup Process

Prerequisites

  1. Python Installation:
    • Download from python.org.
    • Ensure to configure the path for the script folder.
  2. Install PyCharm IDE:
    • Download from JetBrains.
    • Choose the Community edition for free use.
  3. Install Necessary Packages:
    • Using pip in command prompt:
      • pip install selenium
      • pip install robotframework
      • pip install robotframework-seleniumlibrary

Adding Packages in PyCharm

  1. Open PyCharm and select your project.
  2. Go to File > Settings > Project Interpreter.
  3. Use the + button to add required libraries:
    • selenium
    • robotframework
    • robotframework-seleniumlibrary
  4. Install Plugins:
    • Install IntelliBot Plugin to enable auto-completion for Robot Framework files.

Conclusion

  • The setup for Robot Framework with Selenium is complete.
  • Next video will cover writing basic test cases using Robot Framework.

Thanks for Watching!