Skip to content

Add support for prefixing suite keywords with suite name#5584

Open
sylvesterboris wants to merge 1 commit intorobotframework:masterfrom
sylvesterboris:add-suite-keyword-prefix-support
Open

Add support for prefixing suite keywords with suite name#5584
sylvesterboris wants to merge 1 commit intorobotframework:masterfrom
sylvesterboris:add-suite-keyword-prefix-support

Conversation

@sylvesterboris
Copy link

@sylvesterboris sylvesterboris commented Dec 21, 2025

Solution

Modified the _get_explicit_runner() method in src/robot/running/namespace.py to also check the suite file's keywords when a prefix is used.

Key changes:

  • Check suite_file.owner.name before searching libraries/resources
  • Added proper None checks for robustness
  • Suite keywords checked first, maintaining consistency with unprefixed resolution

Testing

Verified with test case:

*** Test Cases ***
Simple test
    Some keyword    123    
    MySuite.Some keyword    123    

*** Keywords ***
Some keyword
    [Arguments]        ${alpha}
    Log    ${alpha}    

- Allow calling suite keywords with suite name prefix (e.g., MySuite.Some keyword)
- Modified _get_explicit_runner() to check suite_file.owner.name
- Maintains full backward compatibility with existing unprefixed calls
- Fixes robotframework#5582
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant