Passing variable arguments to user keyword

2,138 views
Skip to first unread message

Gaurav Arora

unread,
Feb 14, 2012, 6:35:34 AM2/14/12
to robotframework-users
Hi,

I'm trying to write a test case where I pass a variable number of arguments to a user defined keyword. These arguments are received in the user keyword as a list. The problem is that when I pass these arguments further to a java test library which accepts all var-args then the argument is received as a list instead of an array. This confuses java and causes errors. Is there anyway I can convert this list into an array?

Thanks,
Gaurav

Pekka Klärck

unread,
Feb 15, 2012, 5:01:12 PM2/15/12
to g.a...@iontrading.com, robotframework-users
2012/2/14 Gaurav Arora <g.a...@iontrading.com>:

Since you can use list variables as scalars, this should work fine:

User Keyword
[Arguments] @{varargs}
Java Keyword ${varargs}

Cheers,
.peke
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org

Reply all
Reply to author
Forward
0 new messages