简体   繁体   中英

Fetching data from a table alphabetically using webdriver

Is there a way to fetch data from a table alphabetically using webdriver.

for example:

a table contains "sno, language, text, link"

I would like to know is there away to fetch data alphabetically using language as the column. Lets say the languages are not alphabetically ordered... Russian, Spanish, English, Chinese... ETC

Yes you need a DataStructure to store the WebElements which are getting listed while finding elements of table.

For Java you can use a DataStructure like HashMap where you can save the link texts as the Key later you can use Collection.sort to sort this DataStructure with the attribute/ column you want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM