Giter Site home page Giter Site logo

rehael / robot-framework-example Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 513 KB

Robot Framework Example Test Suite for Web App testing with Selenium

License: The Unlicense

RobotFramework 0.83% Python 0.04% HTML 99.13%
robot-framework test-automation selenium-webdriver

robot-framework-example's Introduction

Robot Framework Example

This repository provides an example of Robot Framework (RF) test suite for Web Application testing using Selenium Library for RF.

As example web application under test the Conversion Calculator is used.

For running the test suite you will need:

  • Python 3.6 – install with pip (will provide pip3 binary)

  • Chrome Driver – place chromedriver.exe in the same folder as calculator.robot file

  • Chrome, Chromium or other Chrome–compliant browser – I used Iron Portable (direct link), you will also need to provide the correct path to the executable in the config.py file

  • and several additional packages for Python, listed in requirements.txt — install required packages with:

    pip3 install -r requirements.txt
    

Files

Short description of files and folders found here:

  • README.md – this document you are reading right now
  • requirements.txt – PIP packages list for ease of installation
  • calculator.robot – the test suite in ROBOT format
  • config.py – path to chrome.exe for ChromeDriver and browser specification
  • output - folder with screenshots created by test suite run, report and log from the run

What kind of RF and Selenium features are used?

  • Suite Setup/Teardown
  • Variables from external file
  • User Keywords
  • Using Selenium keywords
  • Using Text, CSS, XPath and DOM locators
  • JavaScript invocation
  • Simple step–by–step tests
  • Data–driven testing using data table and test template
  • Tags

How to run this thing?

If everything is installed correctly, running the following from cmd.exe console should do the magic:

robot -d output calculator.robot

Which sould give the following output:

> robot calculator.robot
==============================================================================
Calculator :: Simple Test Suite for Conversion Calculator
==============================================================================
Check if conversion type switch works                                 | PASS |
------------------------------------------------------------------------------
Convert temperature from Celsius to Kelvin                            | PASS |
------------------------------------------------------------------------------
Check error on minus                                                  | PASS |
------------------------------------------------------------------------------
Check conversion change                                               | PASS |
------------------------------------------------------------------------------
Check all conversion types                                            | PASS |
------------------------------------------------------------------------------
Calculator :: Simple Test Suite for Conversion Calculator             | PASS |
5 critical tests, 5 passed, 0 failed
5 tests total, 5 passed, 0 failed
==============================================================================
Output:  d:\tmp\20170922-RobotTest\RobotFrameworkSolution\output\output.xml
Log:     d:\tmp\20170922-RobotTest\RobotFrameworkSolution\output\log.html
Report:  d:\tmp\20170922-RobotTest\RobotFrameworkSolution\output\report.html

You can then review what exactly happened by looking into the log file.

Troubleshooting

  • if you see RuntimeWarning about robot.run, don't worry, it's a known issue

  • if you see ChromeDriver whining that cannot find Chrome binary, double– and even triple–check the path in config.py file

robot-framework-example's People

Contributors

rehael avatar

Watchers

 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.