Sorting check in Selenium

Has anyone checked sorting with Selenium? I would like to make sure table sorting works differently (az, za, state, date, etc.). Any help would be much appreciated.

/ Goran

+3
source share
5 answers

Before you test it with selenium , you need to do a small thing. Save the table values ​​(which appear after sorting) to stringor array.

Now sort using selenium and write the new list as

string new_list= selenium.gettable("xpath");

Now compare both values ​​and see if they are the same or not.

+2
source

blog. , , . , , . .

+1

:

 //div[@id='sortResult']/div[1]/div  (this'd be row 1 of the search result)
 //div[@id='sortResult']/div[2]/div   ( row 2)

( HTML , ...)

, xpath ( , "" ).

. , .

xpath. ;)

0

, , , , , , , .

, . ( .)

0

API WebDriver Selenium 2.0 ( ), findElements . , , .

0

Source: https://habr.com/ru/post/1698916/


All Articles