Code Monkey home page Code Monkey logo

rbf-demo's Introduction

Robot Framework Demo

Prerequisites

  1. Python.

  2. Check Python installation

    python -V

  3. Install pip.

    pip -V

  4. Install Robot Framework.

    pip install robotframework

  5. Install Selenium Library.

    pip install robotframework-seleniumlibrary

  6. Download and install VSCode VSCode.

  7. Install Robot Framework Language Server by Robocort extension from VSCode's Marketplace

  8. Install Browser Drivers

    pip install webdrivermanager

Example

Test cases for a sample web site Demoblaze.

This project is developed to demontrate Web UI automation using Robot Framework and Selenium Library.

Here, there are 3 variables ${SMALL_RETRY_SCALE}, ${MEDIUM_RETRY_SCALE} and ${LARGE_RETRY_SCALE} for retrying the keywords when they are failing. Each variable has assigned with the number of retries. Automation engineers are advised to use ${SMALL_RETRY_SCALE} as the default number of retries for the keywords. If there are big delays in some scenarios, you can use other variables ${MEDIUM_RETRY_SCALE} and ${LARGE_RETRY_SCALE}. You can find the examples for this in object-repository/page-objects directory.

Test cases are in test-cases directory and cover login functionality.

File organization

|- rbf-demo/                                                      // Home folder for robot selenium UI automation project
  |- configs/ApplicationVariables.robot                           // Application common variables file
  |- configs/BrowserDetails.robot                                 // Test execution browser configurations
  |- configs/EnvDetails.robot                                     // Test execution environment configurations
  |- configs/SeleniumConfigs.robot                                // Selenium configurations
  |- object-repository/locators/*.robot                           // UI locators of the application
  |- object-repository/page-objects/CommonPo.robot                // Common keywords for the application
  |- object-repository/page-objects/*.robot                       // Page object keywords of the application
  |- test-cases/..../*.robot                                      // Test cases of the application
|- results                                                        // Test results will be saving here
|- .gitignore                                                     // Excluded the unnecessary files in the repo
|- README.md                                                      // This file

Usage

Starting from Robot Framework 3.0, tests are executed from the command line using the robot script or by executing the robot module directly like python -m robot or jython -m robot.

The basic usage is giving a path to a test (or task) file or directory as an argument with possible command line options before the path

Run All Test Cases

python -m robot -v ENV:SIT -d results test-cases/

Run Test Cases tagged Smoke Test

python -m robot -v ENV:SIT -i Smoke -d results test-cases/LoginTest.robot

Run Test Cases tagged Regression Test

python -m robot -v ENV:SIT -i Regression -d results test-cases/LoginTest.robot

"-v" refers to the variables. To replace a declared value within the code, you can specify a variable name and value.

"-i" refers to the tags. To run only a selected group of tests, you may specify a tag name.

"-d" refers to the test results. The location to save the test results can be specified here.

Additionally there is rebot tool for combining results and otherwise post-processing outputs

rebot --name Example output1.xml output2.xml

Run robot --help and rebot --help for more information about the command line usage. For a complete reference manual see Robot Framework User Guide.

rbf-demo's People

Contributors

tatyana-avanade avatar

Watchers

QA Automation Demo Projects avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.