Verify List Items

485 views
Skip to first unread message

Jagdish pyati

unread,
Oct 1, 2010, 2:16:09 AM10/1/10
to robotframe...@googlegroups.com
Hi,
I had another problem, I have a list with multiple items, there are no functions to verify the values in the list.Do you know of any method to do it.
 
regards
Jagdish

Pekka Klärck

unread,
Oct 1, 2010, 5:30:58 PM10/1/10
to Jagdish pyati, robotframework-users
[Resending to robotframework-users.]

2010/10/1 Jagdish pyati <jagdi...@gmail.com>:
> Hi,
> This is a Listbox in the application and I wanted to verify the items that
> are displayed in that listbox. Right now I am just using a for loop and
> selecting each item using "Select From List" function to indirectly verify
> the items present in the list box. Is there a direct function to use to
> verify this. Iam using pybot.

You still didn't tell is this a Swing, Windows, or web GUI, or
something else. There are separate libraries for all these GUIs so
when you say `list` it's impossible to know what you mean.

Based on your other question regarding HTML tables, I assume you are
still in web world an use SeleniumLibrary. Apparently it doesn't have
`List Should Have Items` keyword nor related `List Should (Not) Have
Item` keywords. I think adding them would make sense and that should
also be relatively easy. Please submit an enhancement request about
this to SeleniumLibrary's issue tracker.

Finally, using for loop like you've done sounds like a good workaround
for this limitation. If you wrap that loop into a user keyword with a
good name, there's practically no difference compared to having `List
Should Have Items` keyword in the library.

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

Jagdish pyati

unread,
Oct 4, 2010, 2:58:17 AM10/4/10
to Pekka Klärck, robotframework-users
Hi,
Its a web UI and I am using Selenium Library. I will try to log an enhancement issue for this and I am using this functionality as a keyoword with the for loop.
 
The code for the same is as follows:
${Element} is just a variable
@{AttrCondList} is a list of values of items in the list which you need to create and define.
you can add this as a keyword and use it generically.
 
: FOR ${Element} IN @{AttrCondList}
 Select From List <list object locator> ${Element}

Regards
Jagdish
Reply all
Reply to author
Forward
0 new messages