Skip to content

Errors with command line options should always prevent execution #5481

@HoangViet144

Description

@HoangViet144

my variable.py is:

def get_variables():
    print(">>> get_variables() called <<<")
    raise RuntimeError("Fatal: Could not load config")

my handler.robot is:

*** Settings ***
Library             RPA.Browser.Playwright
Library             OperatingSystem
Library             DateTime
Library             RPA.Cloud.Google

Test Setup          New Browser    browser=Firefox
Test Teardown       Close Browser

*** Test Cases ***
Dummy
    Log    hello

My command is: robot --variablefile variable.py handler.robot.
Expected:

  • robot command will stop because variable.py throws an exception

Actual:

  • it only logs the exception error and continue execute the robot file
>>> get_variables() called <<<
[ ERROR ] Processing variable file '.../variable.py' failed: Fatal: Could not load config
2025-08-09 15:47:19,216 - RPA.core.certificates - INFO - Truststore not in use, HTTPS traffic validated against `certifi` package. (requires Python 3.10.12 and 'pip' 23.2.1 at minimum)
==============================================================================
Handler                                                                       
==============================================================================
Dummy                                                                 | PASS |
------------------------------------------------------------------------------
Handler                                                               | PASS |
1 test, 1 passed, 0 failed
==============================================================================

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions