1. Collections can be used in selenium in different scenarios,
i’m just trying to mention which i have experienced.
1. When there is a dropdown and you know there should won’t be any
duplicate elements, then Set is the best one to use because it doesn’t allow
duplicates.
2. When the front end is developed using AngluarJS then the Select option
doesn’t work perfectly. In such scenarios you can use either List or Set based
on either duplicates are allowed or not.
3. If there is a table and when you want to check if a column is getting sorted
or not when clicked on a sort option (arrows) which is provided there, then
you can use Set. Tree set is basically sorted in ascending order.
4. Hashmap can be used when there are two drop downs and the values in
both of them are interrelated like if you select one option in the first
dropdown then in the second only specific values are to be displayed