I have a use case for which I have to automate the following steps:
- Create an empty list
- Push data into the empty list
- Keep/save the original order in a variable
- Sort the original order
- Save the sorted list
Reverse the sorted list and return value
*** Settings *** Library SeleniumLibrary Library Collections *** Keywords *** Sort order verification @{username_list}= Create List //creates an empty list @{get_name}= Get WebElements css=#userTable > tbody > tr> td:nth-child(1) :FOR ${each} IN @{get_name} \ ${get_username}= Get Text ${each} \ Append To List ${username_list} ${get_username} //pushes data into list in iteration ${original_order}= Copy list ${username_list} //returns original order ${sorted_list}= Sort List ${original_order} //sorts the list but returns none(nothing is saved in the variable ${reverse_sorted_list}= Reverse List ${sorted_list} //returns AttributeError: 'NoneType' object has no attribute 'reverse'