Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 823 by [email protected]: List variable inaccessible
http://code.google.com/p/robotframework/issues/detail?id=823
I am unable to access a list variable right after creating it. I have
documented different errors I get when used in different ways.
----------------------------------------
Case 1: My testcase is like this.
@{MO} Create List
: FOR ${i} IN RANGE 0
... ${range}
${MOname} Generate Random String 8
Append To List @{MO} ${MOname}
Log List @{MO}
But log says "Keyword 'Collections.Log List' expected 1 to 2 arguments, got
0."
----------------------------------
Case 2:
@{MO} Create List
: FOR ${i} IN RANGE 0
... ${range}
${MOname} Generate Random String 8
Append To List @{MO} ${MOname}
: FOR ${i} IN RANGE 0
... ${range}
Log @{MO}[${i}]
Log says
Non-existing variable '@{MO}[${i}]'
------------------------
case 3:
@{MO} Create List
: FOR ${i} IN RANGE 0
... ${range}
${MOname} Generate Random String 8
Append To List @{MO} ${MOname}
: FOR ${i} IN RANGE 0
... ${range}
Log @{MO}[i]
But log says
Non-existing variable '@{MO}[i]'
Note: This is extremely confusing because the user guide clearly says that
the way to access a list variable is like this.
"It is also possible to access a certain value from the list variable with
the syntax @{NAME}[i], where i is the index of the selected value. Indexes
start from zero, and trying to access a value with too large an index
causes an error. List items accessed in this manner can be used similarly
as scalar variables:"
Source:
http://robotframework.googlecode.com/svn/tags/robotframework-2.5.6/doc/userguide/RobotFrameworkUserGuide.html#list-variables
-------------------------------------------
My environment:
Windows XP SP2
D:\VerSuites\VS317modified\webservice>python --version
Python 2.7.1
D:\VerSuites\VS317modified\webservice>jybot --version
Robot Framework 2.5.6 (Jython 2.5.2rc3 on java1.6.0_13)
-----------------------------------------------------
I am an NSN employee and welcome you to contact me on my NSN ID- P, Vineesh
(NSN - IN/Bangalore) or on my email [email protected]
Attachments:
case1.html 77.0 KB
case2.html 77.4 KB
case3.html 77.4 KB
FT_NE3S_FM_002.html 5.7 KB