Wilson Mar bio photo

Wilson Mar

Hello. Hire me!

Email me Calendar Skype call 310 320-7878

LinkedIn Twitter Gitter Google+ Youtube

Github Stackoverflow Pinterest

A robot python mimics what human users do to entertain real developers

Gitter

Overview

Developers and testers of UIs can be more efficient if they use a robot script that flawlessly repeats a sequence of keystrokes and mouse clicks.

There are many products and frameworks which do that. Selenium works on web browsers. FitNesse, Cucumber, HP QTP (‘Unified Functional Testing’ or ‘UFT’).

The Robot Framework (RF)’s components are typical of most other test automation frameworks:

Robot Framework high-level design

Robot Framework high-level design

Green signifies framework components whereas grey refers to components or artefacts, such as test code and product code, that are to be created by the development organization. The numbers indicate the order in which a typical test execution run would flow. Obviously, this schema is a simplification of a real-life set-up, which would result in a more complex infrastructural model so as to account for topics such as:</p>

The Robot Framework (RF) is written in Python language. So it can be used on any OS that runs the Python interpreter: Windows, OS X, Linux. Through a Remote Library Interface, RF can run (but slower) on IronPython or Jython when automating on a Java application or implementing a custom RF test library in Java.

Consequently, RF can be used with non-Python libraries such as the Java JDBC Database Library by running RF on Jython. The Jython interpreter not only compiles the RF Python code into Java bytecode for execution within a JVM, but also allows for the importing of Java classes (such as those of the Database Library) as (if they were) Python modules. See http://blog.xebia.com/the-robot-framework-remote-library-interface-using-the-remote-database-library-to-connect-to-ibm-db2/

The Robot Framework (RF) is open sourced at ???

Introductions

generic, keyword- and data-driven test automation framework for acceptance test driven development (ATDD).

  • http://blog.xebia.com/robot-framework-the-unsung-hero-of-test-automation/
  • http://blog.xebia.com/robot-framework-and-the-keyword-driven-approach-to-test-automation-part-1-of-3/
  • http://blog.xebia.com/robot-framework-and-the-keyword-driven-approach-to-test-automation-part-2-of-3/
  • http://blog.xebia.com/tag/robot-framework/ by Michael Hallik

Social

@robotframework

It’s maintained by contractor Pekka Klärck @pekkaklarck, http://eliga.fi/)

See Pekka on Joe’s video using this slidedeck. Note it’s copyrighted by Nokia Networks (Finland).

https://blog.codecentric.de/en/2016/12/robot-framework-tutorial-2016-working-with-collections/

https://medium.com/@varjoinen/robot-framework-101-fb12d1d6954c#.jejc3hrwl

Robot Framework Install

Instead of coding programming code, it’s faster to write keyword-driven syntax driven by text data files. That’s provided by the Robot Framework, open-sourced on GitHub.

The core framework is operating system and application independent because it’s implemented using Python for running on Jython (JVM) and IronPython (.NET).

See https://github.com/robotframework/QuickStartGuide/blob/master/QuickStart.rst

  1. Install the Robot Framework core:

    pip install robotframework
    

    The response:

    Collecting robotframework
      Downloading robotframework-3.0.tar.gz (430kB)
     100% |████████████████████████████████| 440kB 399kB/s 
    Building wheels for collected packages: robotframework
      Running setup.py bdist_wheel for robotframework ... done
      Stored in directory: /Users/mac/Library/Caches/pip/wheels/9e/61/ee/b4bb4b9b7824594cc785a577975bec2fce9c54b09bbf39eb3f
    Successfully built robotframework
    Installing collected packages: robotframework
    Successfully installed robotframework-3.0
    
  2. To test databases and for example REST APIs, also install:

    pip install robotframework-databaselibrary
    pip install requests
    pip install botframework-requests
    
  3. PROTIP: I don’t recommend installing docutils because you can look it up online.

  4. To install the demo Robot login script, create a folder to hold the demo repo:

    cd ~/gits/wilsonmar/pattern-recognition
    git clone https://github.com/robotframework/QuickStartGuide.git --depth=1
    cd QuickStartGuide
    
  5. Position your present working directory to thePROTIP: I don’t recommend installing docutils because you can look it up online.

  6. Run the demo:

    robot QuickStart.rst
    

    NOTE: The file name extension (ending) .rst is also used by Ansible scripts.

    You will see this if the .rst file is not in the present folder:

    [ ERROR ] Parsing 'QuickStart.rst' failed: Data source does not exist.
    

    The expected response is:

    ==============================================================================
    QuickStart                                                                    
    ==============================================================================
    User can create an account and log in                                 | PASS |
    ------------------------------------------------------------------------------
    User cannot log in with bad password                                  | PASS |
    ------------------------------------------------------------------------------
    User can change password                                              | PASS |
    ------------------------------------------------------------------------------
    Invalid password                                                      | PASS |
    ------------------------------------------------------------------------------
    User status is stored in database                                     | PASS |
    ------------------------------------------------------------------------------
    QuickStart                                                            | PASS |
    5 critical tests, 5 passed, 0 failed
    5 tests total, 5 passed, 0 failed
    ==============================================================================
    Output:  /Users/mac/gits/wilsonmar/pattern-recognition/QuickStartGuide/output.xml
    Log:     /Users/mac/gits/wilsonmar/pattern-recognition/QuickStartGuide/log.html
    Report:  /Users/mac/gits/wilsonmar/pattern-recognition/QuickStartGuide/report.html
    

Scripting

Robot QuickStart Login Demo script

Many of the functions are common to other similar programs, such as Selenium, HP QTP, etc.

RIDE = Robot IDE.

But there are plugins for IntelliJ/PyCharm & Eclipse, Atom, Sublime, TextMate, Vim, etc.

See http://sikulix-2014.readthedocs.io/en/latest/scenarios.html#using-robotframework

http://www.slideshare.net/pekkaklarck/robot-framework-introduction

Run scripts

http://sikulix-2014.readthedocs.io/en/latest/faq/010-command-line.html#how-to-run-sikulix-from-command-line

robot some_tests.robot OR robot test_cases/


More on IoT

This is one of a series on IoT:

  1. IoT Acronymns and Abbreviations

  2. IoT Apprentice school curriculum
  3. IoT use cases
  4. IoT reminders prevent dead mobile battery
  5. IoT ceiling dumper

  6. IoT text to speech synthesis
  7. IoT AWS button
  8. Intel IoT
  9. IoT Raspberry hardware
  10. IoT Raspberry installation

  11. IoT Clouds
  12. Samsung IoT Cloud

  13. Predix basics
  14. Predix installation
  15. Predix services
  16. Predix programming