This is a migrated thread and some comments may be shown as answers.

Questions regarding sort order verification within a table

1 Answer 95 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Houston
Top achievements
Rank 1
Houston asked on 05 Feb 2014, 04:55 PM
Hi, I've been working with the Verify Sort Order in an HTML Table C# example posted at http://docs.telerik.com/teststudio/user-guide/code-samples/html/verify-sort-order.aspx and have seen some strange behavior that I'm interested in learning more about, it's probably something I'm not doing correctly. Using the example at the posted link, I inserted a step to sort the results by Order ID descending which should fail the test when the sort order check is performed, since it's written to check for Order ID ascending. However, the test is still successful even though the browser window shows the list sorted by Order ID descending (11077, 11076, 10075, etc). A check of the results log shows that the verification step is checking against the original ascending sort order (10248, 10249, 10250, etc) which seems incorrect to me, the string list is built after the sort is applied to the table so the descending Order ID should dictate the Order IDs that populate the string list?

I'm also wondering how someone would apply a sort order check to the date column - would it be a simple matter of changing the column that you're building the string list from (in the case of the example, changing HtmlTableCell cell = row.Cells[0]; to HtmlTableCell cell = row.Cells[3]; and replacing the string comparison code with a date compare?

1 Answer, 1 is accepted

Sort by
0
Velin Koychev
Telerik team
answered on 11 Feb 2014, 09:45 AM
Hi Houston,

I was able to reproduce the issue that you are describing.  In order to resolve it, you just need to put some delay and Refresh the DOM tree, after you sort the results and before you use the code sample from this article. You can do this by inserting the following line of code:

System.Threading.Thread.Sleep(5000);
ActiveBrowser.RefreshDomTree();

If this doesn't help, please provide us with a copy of your test so we can reproduce the issue on our end and give you a solution.

...how someone would apply a sort order check to the date column...

Yes, the solution should be very similar to the one that your are describing. Please let me know if you are experiencing any issues with this test scenario and I will try to help you resolve it. 

Regards,
Velin Koychev
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Houston
Top achievements
Rank 1
Answers by
Velin Koychev
Telerik team
Share this question
or