Export to GitHub

robotframework - issue #1611

Variable assignment should not be considered part of a keyword when removing keywords by name


Posted on Dec 16, 2013 by Happy Wombat

Given this line in a test, ${foo}= Create Variable bar In order to remove the keyword using an exact match, the assignment portion is considered part of the keyword name, so something like this must be used: --removekeywords ${foo}=BuiltIn.CreateVariable Where one would expect this to work: --removekeywords BuiltIn.CreateVariable but it does not match. I cannot think of a realistic use case where the assignment portion should be considered part of the keyword for --removekeywords.

Also since the matching is against the full keyword names, this example is misleading: pybot --removekeywords name:HugeKeyword --removekeywords name:resource.* tests.txt

It should have a library name like this: pybot --removekeywords name:MyLibrary.HugeKeyword --removekeywords name:resource.* tests.txt

Comment #1

Posted on Dec 16, 2013 by Happy Rhino

1) I agree fully that assignment should not be part of the keyword name. Unfortunately fixing this likely to be backwards-incompatible with some tools. Hope we nevertheless get it done in 2.9.

2) Luckily using something like '--removekeywords name:*BuiltIn.CreateVariable' ought to work.

3) In the '--removekeywords name:HugeKeyword' example the idea was that this 'HugeKeyword' is created in the same file as the test case itself. In that case it gets no additional prefix. Please submit a separate issue if you think documentation related to this should be enhanced.

Comment #2

Posted on Dec 17, 2013 by Happy Wombat

Thanks for the feedback. I had not thought of removing a keyword that belongs to a test suite so the example is correct, it is just not the most common usage. There is no hurry on this. I was just trying to help someone in the user group and stumbled upon unexpected behavior and wanted to report it.

Comment #3

Posted on Jun 30, 2014 by Happy Rhino

Robot Framework is being migrated to GitHub and issues have already been moved to https://github.com/robotframework/robotframework/issues/. Old IDs are preserved so you can find this particular issue using URL like:

https://github.com/robotframework/robotframework/issues/<id>

Status: Moved

Labels:
Type-Defect Priority-Medium Target-2.9 bwic