Sorting of Date Column in Ascending/Descending order in Data tables

495 views
Skip to first unread message

Pankaj Tiwari

unread,
Feb 26, 2017, 12:48:51 AM2/26/17
to seleniu...@googlegroups.com
Hello Guys,

I want to verify the Sorting of Date column in Ascending and Descending order in below screenshot. 

Here are the steps :
1. User clicks on "Start Date"  column- It will sort the dates in Ascending order
2. User again clicks on "Start Date"- This time it will sort the dates in Descending order

I have observed that date is in 5th td of each tr but i am unable to build the logic. How to solve.

This is the name of website https://datatables.net/.

Kindly check and send me the code if anyone have for same kind of scenario.

Thanks in Advance


-Pankaj


Oscar Rieken

unread,
Feb 26, 2017, 12:54:08 AM2/26/17
to seleniu...@googlegroups.com
I would probably go to the page collect all of the items shown => original items
click sort by whatever then collect the items again => sorted items
then sort original items by whatever
then compare my sorted original items with the sorted items collection 


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAJCh4pRbquyfxZC7zBg5L_Wsd79h3XH4kWS_XaO7_B5w5Vp3Tg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Pankaj Tiwari

unread,
Feb 26, 2017, 1:06:49 AM2/26/17
to seleniu...@googlegroups.com
Hi Oscar,

You wanna say that i will use findelements method and save all the items in a List ?

-Pankaj

On Sun, Feb 26, 2017 at 11:23 AM, Oscar Rieken <bis...@gmail.com> wrote:
I would probably go to the page collect all of the items shown => original items
click sort by whatever then collect the items again => sorted items
then sort original items by whatever
then compare my sorted original items with the sorted items collection 

On Sun, Feb 26, 2017 at 12:48 AM, Pankaj Tiwari <pankaj.t...@gmail.com> wrote:
Hello Guys,

I want to verify the Sorting of Date column in Ascending and Descending order in below screenshot. 

Here are the steps :
1. User clicks on "Start Date"  column- It will sort the dates in Ascending order
2. User again clicks on "Start Date"- This time it will sort the dates in Descending order

I have observed that date is in 5th td of each tr but i am unable to build the logic. How to solve.

This is the name of website https://datatables.net/.

Kindly check and send me the code if anyone have for same kind of scenario.

Thanks in Advance


-Pankaj


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

Pankaj Tiwari

unread,
Feb 26, 2017, 1:07:38 AM2/26/17
to seleniu...@googlegroups.com
FYI..
Sorry forget to attach screenshot.

Inline image 1

Pankaj Tiwari

unread,
Feb 26, 2017, 6:33:08 AM2/26/17
to seleniu...@googlegroups.com

Guys,
Please check below screenshot and let me know how to sort the Dates column in ascending and descending order.

Thanks
Pankak

Reply all
Reply to author
Forward
0 new messages