Robot Framework Evaluation

Overview

Assessment of Robot Framework as a potential replacement for Gherkin in the organization’s pseudocode initiative. Robot Framework is an open-source, Python-based automation framework using keyword-driven, tabular, human-readable syntax.

Architecture

File Structure (.robot)

Four main sections identified by *** Headers ***:

SectionPurpose
*** Settings ***Import libraries, resources, metadata
*** Variables ***Define reusable data (${SCALAR}, @{LIST}, &{DICT})
*** Test Cases ***Define test scenarios
*** Keywords ***Define custom reusable keywords

Key Syntax Rules

  • Whitespace-sensitive — At least two spaces separate keywords from arguments
  • Keyword-driven — Tests composed of plain-text keywords (e.g., Open Browser, Click Element)
  • BDD-compatible — Supports Given/When/Then prefixes (ignored during execution if keyword matches)
  • Flow control — IF, ELSE, FOR, WHILE loops
  • Line continuation — ... symbol for multi-argument keywords

Comparison: Gherkin vs. Robot Framework

FeatureGherkinRobot Framework
SyntaxStrict Given/When/ThenFlexible keywords (BDD optional)
Data drivingExamples tablesTest Templates / Data files
ExtensibilityGlue code (Java/C#/JS)Python (very low boilerplate)
ReportingRequires plugins (Allure/Extent)Built-in (Logs, Reports, XML)

Deployment Best Practices

Three-Tier Structure (Critical)

The biggest risk is losing the business-readable layer when migrating from Gherkin:

  1. Workflow Layer (Test Cases) — High-level, readable keywords. No technical details.
  2. Business Keyword Layer (Resources) — Logical actions (e.g., Log In To Application)
  3. Library/Technical Layer — Actual Selenium or API calls

The “Two-Space Trap”

The #1 syntax error source for teams migrating. Mitigation: mandate Robot Framework Language Server extension (by Robocorp) in VS Code with “Format on Save.”

Strategic Implementation

PhaseAction
Phase 1: Python BridgeWrite complex logic as Python libraries, not 50-line Robot Keywords
Phase 2: Tagging Strategycritical, jira:PROJ-123, no-ci — standardize early
Phase 3: CI IntegrationParse output.xml in CI/CD for trend graphs over time

Verdict

Robot Framework is the strongest alternative to Gherkin for the pseudocode initiative:

  • Maintains readability without Gherkin’s verbosity
  • Tabular format handles complex data combinations better than Scenario Outlines
  • Python extensibility is low-friction
  • Built-in reporting eliminates plugin dependency