Welcome, Guest. Please login or register.
Login with username, password and session length

 
Advanced search

16586 Posts in 4345 Topics- by 28323 Members - Latest Member: pallavi13
 

Pages: [1]   Go Down
Print
0 Members and 1 Guest are viewing this topic.
Author Topic: How to grab sort order property from a java table    (Read 729 times)
Donna Scharkss
User
*
Offline Offline

Posts: 10


« on: August 03, 2009, 03:27:58 PM »

Was wondering if someone has figured this out already.

In our automation tests, I'm trying to grab certain properties from the AUT to determine if they developed it according to our specs.  I've been reading the Java Docs to see if there's a method I can use to tell me if the jtable columns can be sorted and if so, is the sort ascending/descending.  Maybe it can only be both, not one or the other, not sure, but would like to grab that info.

Unfortunately, I can't seem to find a way to do that.

Would appreciate any thoughts you'd have on this.
Thank you in advance.
Logged
Meir Bar-Tal
Administrator
Advanced User
*****
Offline Offline

Posts: 1270



WWW
« Reply #1 on: August 09, 2009, 09:17:08 PM »

Hi Donna,

First, it is a common practice to have the sorting be implemented by clicking on the column header(e.g., using the SelectColumnHeader method).
Second, the best way to do it is, in my view, to independently validate the sorting order based on the specs. This means, to get the data from the table and check whether it is sorted or not by comparing the actual column data with the expected data. An easy way to accomplish this is by using the .Net ArrayList object (CreateObject("System.Collections.ArrayList")) which offers built-in Sort and Reverse methods with which you can produce the expected result based on the gathered data during RT.

I hope this is useful.

Cheers Smiley
Meir
Logged

Best Regards,

Meir Bar-Tal
AdvancedQTP Chief Editor & Forums Administrator
Donna Scharkss
User
*
Offline Offline

Posts: 10


« Reply #2 on: August 10, 2009, 05:56:46 AM »

Meir, thanks so much.  I'll look that up and try it out.  You're the best.
Logged
Pages: [1]   Go Up
Print
Jump to: