Is there any robot framework keyword to sort a list number

327 views
Skip to first unread message

Aphirak Phothisa

unread,
Feb 19, 2020, 5:13:59 AM2/19/20
to robotframework-users
Hi,

Is there any robot framework keyword to sort a list number 


@{property_value} = [ 2 | 13 | 12 ] to @{property_value} = [ 13 | 12 | 2 ] and i will get value by first index in list

Hélio Guilherme

unread,
Feb 19, 2020, 6:18:10 AM2/19/20
to robotframework-users
From the Collections library you have Sort List

Name:
Sort List
Source:
Collections <test library>
Arguments:
[ list_ ]
Sorts the given list in place.
Sorting fails if items in the list are not comparable with each others. On Python 2 most objects are comparable, but on Python 3 comparing, for example, strings with numbers is not possible.
Note that the given list is changed and nothing is returned. Use `Copy List` first, if you need to keep also the original order.


--
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 view this discussion on the web visit https://groups.google.com/d/msgid/robotframework-users/CA%2Bqya7RtF0-xYAbZfFCeeSJdY%3D-8b85%3DqjjijUKbtgxnbDHQ4w%40mail.gmail.com.

Md Mubeen Khan

unread,
Feb 19, 2020, 7:59:14 AM2/19/20
to maico...@gmail.com, robotframework-users
Please check Sort List keyword in Collections library.

Thanks,
Md Mubeen Khan

--
Reply all
Reply to author
Forward
0 new messages