There are two options:
1) Use extended variable syntax [1] in an user keyword, like this:
***Keywords***
Uppercase [Arguments] ${string}
[Return] ${string.upper()}
2) Create your own library keyword [2]
def upper_case(string):
return string.upper()
[1]
http://robotframework.googlecode.com/hg/doc/userguide/RobotFrameworkUserGuide.html?r=2.7#extended-variable-syntax
[2]
http://robotframework.googlecode.com/hg/doc/userguide/RobotFrameworkUserGuide.html?r=2.7#creating-test-libraries
hope this helps,
--J
--
Janne H�rk�nen <|> Software Craftsman @ http://reaktor.fi
http://twitter.com/#!/janneharkonen
Hello M�rio,
On 04/04/2012 12:53 PM, M�rio Godinho wrote:
> I need to convert a string into uppercase.
> How can I do that with robot?
> I searched in some robot libraries but none has a keyword for that...There are two options:
1) Use extended variable syntax [1] in an user keyword, like this:
***Keywords***
Uppercase [Arguments] ${string}
[Return] ${string.upper()}2) Create your own library keyword [2]
def upper_case(string):
return string.upper()[1]
http://robotframework.googlecode.com/hg/doc/userguide/RobotFrameworkUserGuide.html?r=2.7#extended-variable-syntax
[2]
http://robotframework.googlecode.com/hg/doc/userguide/RobotFrameworkUserGuide.html?r=2.7#creating-test-librarieshope this helps,
--J
--
Janne H�rk�nen <|> Software Craftsman @ http://reaktor.fi
http://twitter.com/#!/janneharkonen
This does work but using `MY_VAR = my_small_var.upper()` is more
common way to do it.
I actually thought String library would have keywords for
upper/lower/title casing strings. They surely could be added. Anyone
interested to implement them? At least an enhancement request could be
submitted to the tracker.
Cheers,
.peke
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org