Forum Discussion

googleid_116641's avatar
googleid_116641
Occasional Contributor
14 years ago

Sort in Alphabetical Order

Hi All



As i am a newbie in TestComplete , got stuck in the middle of somewhere while writing test for a web based application



Please refer to the attached screenshots



The problem is



In screenshot -1 , the object which i highlighted , its inner text property returns all of its internal text present [like spender, document name , document number etc]



In screenshot - 2 , the object for document name , which i higlighted, through its inner text property i can fetch all of its text present in it,



what i want to check , is , how do i verify that the document name should be in sorted alphabetical manner





Please help regarding the same



Thanks in advance
  • Hi Prashant:



      1. As you can get all inner text then assign them into an Array

      2. Develop you own sorting algorithm to sort this Array

      3. Compare all text between Array and inner text based on row number and element in Array.



    Good luck,



    Allan
  • Hi,


    If you can access an individual column, you can access an individual cell in this column. So, you can get inner text for each cell in your table.



    The only thing you need to do is to create a function that will sort the rows in the table based on inner text of elements in the Document Name column.