User Tools

Site Tools


doc:testing_robotframework

Automated Testing with Robotframework

Quick Start

Robotframework, shorted RF, allows by its extentability to combine its automated test flow with self written interfaces. By that we can “connect” RF either to OOBD (to the webUI websocket) or to a serial line where a dongle is connected to to run automated tests.

In OOBD, this tests simulates user menu selections, while for the dongle data is send to the dongle.

In both cases the feedback is compared with the expected answer, where a match defines if the test is passed or failed.

Environment Simulation

The test envirement is build as follow: RF is talking either to OOBD or the dongle. OOBD expects for itself that a dongle is connected, and in both cases there must be “something” behind the dongle which generates ansers to the dongle requests.

The test cases also evaluate also some error conditions coming from wrong or missing answers, so there must be “something” which can support not only normal answers, but also reproducable errors. This “something” is called the carSim.

The carSim is realized as a python program, which reads predefined answers out of a config file, sorted by DID numbers, so for each DID you can define, which answer shall be given. These answers can be defined byte by byte and also the time gaps between the frames - so each DID stands for a correct or incorrect answer, depending on its configuration.

System requirements

The system requirement is mainly driven by the fact, that the carSim is made for the canSocket device, a device driver for the CAN bus for Linux OS. That means that at last for the CAN message data source a Linux device is needed. But as also the testing does also contain bug fixing, the majority of the OOBD tail chain is useful to have, so it's strongly recommended to set up the whole test and debugging environment on a Linux machine. That then also supports the use of the firmware simulator, which gives more predicable results and avoids the need of real physical hardware.

A good practice is to have also terminator installed ( a multiframe terminal program) which allows to have all the different tools running in seperate frames of the same window and to not go mad in between 10 seperate terminal windows.

Installation

You'll need

  • python >= 3.3
  • Robotframework
  • mono
  • java 1.8
  • make
  • Lua (5.1!)
  • OOBDesk with webUI (from Google Drive)
  • python module yaml

Setup

  1. Clone the OOBD repository
  2. make sure your lua make process is working
  3. run make in \oobd\interface\Designs\POSIX\GCC\D3\app to compile the firmware simulator
  4. start OOBDesk once to have a preference file in ~/.config/java/sonstwo. In there, edit the “UIHandler” to “ws”
  5. start OOBDesk again.
    1. Go into the settings and change the script path to where your to be tested scripts are
    2. - set the port to “/tmp/DXM”

Run the tests

  1. goto oobd/testing/carCAN_Simulator/ and run startSimCAN.sh. Follow the instructions to start:
    1. socat
    2. canSimCAN.py
  2. goto \oobd\interface\Designs\POSIX\GCC\D3\app and start the OOBDSim
  3. goto oobd/testing/robotframework/. run pybot core.rst to start the test
  4. extend core.rst and carsimCAN.yaml with the test cases and test data you need
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
doc/testing_robotframework.txt · Last modified: 2015/09/21 18:04 by admin