RIDE icon indicating copy to clipboard operation
RIDE copied to clipboard

Create new keyword and default arguments

Open robotframework-ride opened this issue 10 years ago • 6 comments

Originally submitted to Google Code by GodTdd on 26 Sep 2011

When I want to implement new keyword, that has arguments as a input, currently ride will set the arguments in the following way: *** Keywords *** to do stuff ${foo} ${bar}

to do stuff [Arguments] ${arg1} ${arg2}

Now, it would be really handy if the arguments given to the new keyword could be directly used as default arguments in the new key word. Example like this: *** Keywords *** to do stuff ${foo} ${bar}

to do stuff [Arguments] ${foo} ${bar}

Most of the cases, at least me, I am changing the new keyword default arguments to the same as was an input. I agree that in some cases this is not valid but at least they are mode better than the current ${arg1}, ${arg2} and so on

robotframework-ride avatar Jun 02 '15 12:06 robotframework-ride

Originally submitted to Google Code by @mkorpela on 19 Dec 2011

This is a good idea. Have to think how to do this in the most user friendly way (what to do when there is something else than a variable).

robotframework-ride avatar Jun 02 '15 12:06 robotframework-ride

Originally submitted to Google Code by GodTdd on 19 Dec 2011

If the argument is not a variable, perhaps then it could be ${arg1} and so on. Or perhaps then it could be the argument itself, example:

*** Keywords *** to do stuff foo bar

to do stuff [Arguments] ${foo} ${bar}

Or could this lead a problem when some special characters are used as an argument, example http://mydomain.com#foo ? But do not know implementation that well, would it lead to problems.

One thing pops in my mind, if my keyword is defined like this: *** Keywords *** to do stuff ${FOO} ${BAR}

Would it be better, that the new keyword arguments are defined in lower case. to do stuff [Arguments] ${foo} ${bar}

Just that one do not have to manually convert them to lower case, if (read when) some small manual editing is required to the arguments.

robotframework-ride avatar Jun 02 '15 12:06 robotframework-ride

Originally submitted to Google Code by @jussimalinen on 14 Aug 2012

we should first do issue 580 and then think about how to populate the names in keyword creation.

robotframework-ride avatar Jun 02 '15 12:06 robotframework-ride

Note: The old issue 580 was resolved a few years ago.

edbrannin avatar Jun 06 '15 20:06 edbrannin

I've not been following the project at the time, but it seems to that 580 was resolved only partially. The problem with having to separate user keyword arguments with | remains. (And in general, settings that accept arbitrary number of values are handled inconsistently, with tags having completely different handling that the others.

yanne avatar Jun 07 '15 07:06 yanne