Forum Discussion

CamDang's avatar
New Contributor
12 months ago

Export a list test cases to an Excel file sorted by 'Name' as displayed on the GUI?

Hi, How can I export a list test cases to an Excel file sorted by 'Name' as displayed on the GUI? Please help me with this.  
  • MisterB's avatar
    12 months ago

    Apologies I missed out that step thinking a Sort in Excel would be the way to go, but I can see that has its own challenges.  I can't see a way to specify the sort order of an export, and the command being sent to the exporter doesn't seem to contain any logic that you could control.  I think we're stuck with the way the data is presented, but you could try SmartBear for a definitive answer: SmartBear Support


    Alternatively you can workaround the issue in Excel.  Here's one way of achieving that:

    Column A = Manually fill the original sort order of rows from 1 to n.  This will be used to keep related rows together

    Column B = Add this formula to each row to get the relevant Name value:  =IF(ISBLANK(E2),INDEX(E:E,MAX(INDEX((E$1:E1<>"")*(ROW(E$1:E1)),,))),E2)

    Column C = Copy & Paste Special Values the Name from column B

    Then use Custom Sort by Column C, then A, to sort all data in test case order


      A B C D E
    1 OrigOrder fxGetName NewOrder Key Name
    2 1 Test B Test B TEST-T1165 Test B
    3 2 Test A Test A TEST-T1167 Test A
    4 3 Test A Test A    
    5 4 Test A Test A    
    6 5 Test A Test A    
    7 6 Test A Test A    
    8 7 Test E Test E TEST-T1168 Test E
    9 8 Test F Test F TEST-T1390 Test F
    10 9 Test F Test F    
    11 10 Test F Test F    
    12 11 Test F Test F    
    13 12 Test F Test F    
    14 13 Test D Test D TEST-T1166 Test D
    15 14 Test D Test D