Production-provenSystem & HIL Testing

Robot Framework HIL Harness for CAN Devices

Drive a CAN-connected controller from Robot Framework keywords on a bench rig.

Owner: Tomás DelgadoTest EngineeringContact ownerAdded 30 Jun 2026Updated 12 Sep 2026
  • Runs out of the box: no
  • Tests: yes
  • CI: yes
  • Docs: yes
  • Used in production: yes

Purpose#

A keyword library and bench layout for testing a CAN-connected controller. Test authors write plain keywords such as "Power Cycle Unit" and "Expect Frame Within"; the library translates them into power-supply commands and CAN reads, and attaches the raw bus log to every test result.

The rig description, wiring notes and a calibration checklist live next to the code so a second bench can be reproduced from the repository.

What you will learn#

  1. Structure keyword libraries and resource files per bench instrument
  2. Assert on CAN frame timing with explicit windows rather than sleeps
  3. Attach raw bus logs to test results automatically
  4. Tag tests so smoke runs and nightly runs share one suite

Media#

Technologies & features#

Technologies
PythonRobot FrameworkCAN bus
Features
Hardware-in-the-Loop TestingKeyword-Driven Testing
Topics
System & HIL TestingprimaryHardware Integration

Lessons learned#

  • Worked

    A virtual bench variable file let authors develop tests at their desks and only use the physical rig for final runs.

  • Didn’t work

    Fixed sleeps between power-up and the first frame made the suite flaky on a slow unit. Waiting for the first heartbeat frame removed the flakiness.

  • Decision

    Bench addresses and channel numbers live in variable files, never in suites, so the same tests run on every bench.

Try it#

Shell
git clone https://git.example.internal/test-engineering/hil-can-harness.git
cd hil-can-harness
python -m venv .venv && . .venv/bin/activate
pip install -r requirements.txt
robot --variablefile config/virtual_bench.py tests/smoke

The virtual_bench.py variable file uses a simulated CAN interface, so the smoke suite runs without hardware.

Commands come from the owner’s README. Credentials are never stored here.

Resources#

Contributes to

StatusProduction-proven
OwnerTomás Delgado
TeamTest Engineering
Last commit10 Sep 2026
Slugrobot-hil-can-harness
Report a problem to the owner