Coder Social home page Coder Social logo

robot-framework-guide's Introduction

Robot Framework User Guide

A Robot framework guide for newbies. This guide purpose is for lazy programmers who don't want to read boring robot documentation or anything about robot. This guide is simple and easy to understand.

Requirements

  • Python 2.7
  • Robot framework
  • Selenium2Library

Installation

Create a virtualenv with python2

$ mkvirtualenv --python=$(which python2) [your-virtual-env-name]

Clone the repository

$ git clone [email protected]:kaaanshady/robot-framework-guide.git

Change directory and set virtualenv to your folder

$ cd ../robot-framework-guide-master
$ setvirtualenvproject

Install Requirements

$ pip install -r requirements.txt

Running Tests

Running tests

$ robot TEST-CASE-NAME.robot

Guide 101

The thing is on robot framework :

  • Making testing much simpler and easy.
  • Robot framework has cool test reports.
  • When you run tests , robot creates reports.

How can I use and run robot and tests

  • Create a file.robot , you should use .robot extension

  • Write your test cases on that file

  • and run with

      $ robot file-name.robot
    

Concepts of Robot Framework

  • Settings
  • Variables
  • Test cases
  • Keywords

*** Settings ***

Where you can import libraries like Selenium2Library

Example :

  *** Settings ***
  Library       Selenium2Library

Notice that between 'Library' and 'Selenium2Library'
have 4 spaces.

*** Variables ***

Where you can , define variables for Test Cases and Keywords
You can define variables like ...
Example :

  *** Variables ***
  ${BROWSER}       Firefox
  ${SITEURL}       http://www.google.com

*** Test Cases ***

This section for writing test cases

Example :

    *** Test Cases ***

    FindShapeOfYou  
            Open Browser  
            Search For Ed  
            Click For Shape Of You  
            sleep       ${DELAY}  
            Close Browser

Note :

In that test case , FindShapeOfYou is TEST-CASE-NAME
and the below , instructions(keywords) of what to do with that test case.

*** Keywords ***

I think most important section is keywords.
You can define keywords and that keywords can do anything you want.
You can give their parameter some arguments and use them.

Example :

    *** Keywords ***

    Open Browser  
            Open Browser   ${SITEURL}    ${BROWSER}  

    Search For Ed  
            Input Text    [id-or-some-locator-of-element]   ed sheeran  

    Click For Shape Of You  
            Click Link     Ed Sheeran - Shape of You [Official Video]  

Notice that , you shouldn't forget using 4 spaces when defining anything
and when you want to give arguments to parameters of Keywords
you should give 2 spaces.

robot-framework-guide's People

Contributors

kaansan avatar

Stargazers

 avatar

Watchers

 avatar  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.