Keywords in test case files with dots in name do not have precedence over imported keywords
See original GitHub issueI created resource res.robot
like below:
*** Keywords ***
ok
Log This is external res.ok
res.keyword
Log This is external res.res.keyword
Then I created test suite Test.robot
, which inside has keywords res.res.keyword
and res.ok
like below:
*** Settings ***
Resource res.robot
*** Test Cases ***
Test Check
res.ok
res.res.keyword
*** Keywords ***
res.ok
Log This is internal res.ok
res.res.keyword
Log This is internall res.res.keyword
According to documentation http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#handling-keywords-with-same-names 1. Created as a user keyword in the same file where it is used. These keywords have the highest priority and they are always used, even if there are other keywords with the same name elsewhere.
What I see in the output is that RF call resource file keywords instead of corresponding internal, so I got message from res.robot
file:
20161118 09:32:03.353 : INFO : This is external res.ok
20161118 09:32:03.355 : INFO : This is external res.res.keyword
Is it expected behaviour or a new issue?
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Robot Framework User Guide
Creating test cases from available keywords. Tasks, Creating tasks using available keywords. Single file can only contain either tests or tasks. Keywords ......
Read more >RobotFrameworkAdvancedGuide < EMI < TWiki
Keywords can be imported from test libraries or resource files, or created in the keyword table of the test case file itself. The...
Read more >BuiltIn - Keyword Documentation - Robot Framework Hub
If a library is imported with a custom name, the name used to get the instance must be that name and not the...
Read more >Robot Framework Tutorial #11 - Move User Defined Keywords ...
Get all my courses for USD 5.99/Month - https://bit.ly/all-courses-subscription❖ FREE Training's at https://training.rcvacademy.com ❖ In ...
Read more >Operators and Identifiers in Power Apps - Microsoft Learn
Some of these operators are dependent on the language of the author. ... Identifier, 'Account Name', Identifiers that contain special ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Scrap that! We can fix the original problem by always first looking does the test case file have the specified keyword. This can be done regardless does the keyword name have dot or not. If the test case file doesn’t have such keyword, we can then first look from resources/libraries if the keyword has a dot. This implementation ought to cause no backwards compatibility problems and ought to also be in sync with the documentation.
After implementing the change, our own tests showed that it can break tests using embedded arguments. For example, if we have keyword like
${embedded} args
in a resource file and use it likeresource.Embedded args
, variable${embedded}
nowadays gets valueEmbedded
but after the change it would getresource.Embedded
. This would be too big change in a minor version, and I’m not sure would that really make sense even in a major version. I guess the current implementation is actually the best one. We just need to document it better.