Giter Site home page Giter Site logo

robotframework's Introduction

Robot Framework is released under the Apache License 2.0. Development of Robot Framework is sponsored by the Robot Framework Foundation. The basis for Robot Framework is Pekka Klärck’s Master’s thesis for Helsinki University of Technology in 2006.

If you live in Finland, this tool is especially useful as many finnish companies use it.

Keywords

  • Keywords are like functions that you execute to accomplish various tests.

  • Keywords can be reused and composed, which means that you create keywords by calling other keywords

    Library keywords

  • Library keywords are the lowest level building blocks of creating user keywords and using them in test cases.

  • Libraries are normally imported in the Settings section but can also be imported in the Test Cases section using the Import Library keyword from the BuiltIn Library

Defining variables

  • Variables, as keywords, are case-insensitive, and spaces and underscores are ignored.
  • Recommendation is to use CAPITAL letters with global variables like ${PATH} and small letters with local variables like ${name}.
  • Variable names have type identifiers and variable names between the mandatory curly braces like ${VAR}.
  • Robot Framework has scalars ${SCALAR}, lists @{LIST} and dictionaries &{DICT}. Environment variables are used as strings with %{ENV_VAR}.

Web testing with Robot Framework and SeleniumLibrary

  1. Install Python: Download Python

  2. On Windows, navigate to cmd and type:

    # To verify that Python is installed
    python --version
    
    # To install Robot Framework
    pip install robotframework
    
    # To verify that Robot Framework is installed
    robot --version
    
    # To install the Selenium library
    pip install robotframework-selenium2library
    
    # To check the library list
    pip list
    
  3. Download Web Testing Demo the repository from GitHub . As a result you’ll get directory WebDemo-master and demoapp , docs and login_tests subdirectories:

    web_Demo

  4. Requirements for this demo are having Python, Pip, Robot Framework and SeleniumLibrary installed. This demo includes requirements.txt -file so we just need to give command:

     pip install -r requirements.txt
    
  5. install browser and operating system specific browser drivers for all those browsers you want to use in tests: pip install seleniumbase

  6. Next we start the demo application with command:

    Manually testing

      python demoapp/server.py
    

Extensions

Open browserand navigate to http://localhost:7272 .

The demo application is a very simple login page. With user name demo and password mode you get into a welcome page and otherwise you end up on an error page.

Now try to login to manually test, end the server by pressing ctrl-c.

Extensions

Automated test using robot

  • so let’s start it again.
  • Locate demoapp/server.py from your file manager and Run it with python
  • next run automated tests with cmd:
     robot login_tests
    

Extensions

Result of the Test

Report.html

Extensions

log.html

Extensions

robotframework's People

Contributors

mays-m 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.