How to compare the two lists

2,959 views
Skip to first unread message

Ramana Ranga

unread,
Nov 27, 2014, 12:27:56 PM11/27/14
to robotframe...@googlegroups.com
H All

I have a scenario :

1) I have a list variable which is predefined in my keywords  @L1=['one','two','xyz','abc','qqq','rrr','kkk']
2) From my test case i will get another list as $L2=['qqq','rrr','kkk','one','two','xyz']

I need to compare The L2 list count and contents should match the L1 list...

Can any one give some suggestion how to approach this logic?

Thanks Ramana



Tatu Aalto

unread,
Nov 27, 2014, 4:17:15 PM11/27/14
to rama...@gmail.com, robotframe...@googlegroups.com
Ugh

Collections library has nice keywords for you, example List Should Be Equal [1].

-Tatu
[1] http://robotframework.org/robotframework/latest/libraries/Collections.html#Lists%20Should%20Be%20Equal
--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at http://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

mrunal bodhe

unread,
Nov 26, 2019, 4:28:10 PM11/26/19
to robotframework-users
Hi Ramana,

Try this keyword -

list should contain sub list  ${l1}     ${l2} From Collections



On Thursday, November 27, 2014 at 9:27:56 AM UTC-8, Ramana Ranga wrote:
H All

I have a scenario :

1) I have a list variable which is predefined in my keywords  @L1=['one','two','xyz','abc','qqq','rrr','kkk']
2) From my test case i will get another list as $L2=['qqq','rrr','kkk','one','two','xyz']
Ω
Reply all
Reply to author
Forward
0 new messages