Forum Discussion

sudam_SL's avatar
sudam_SL
Contributor
4 years ago
Solved

Any Possibility to validae the sorting function (sorting with date)

I'm new to test complete tool and there are couple of test that required to validate the sorting order. any possible way to validate it? Note: i'm proceeding with the Keyword Testing
  • Marsha_R's avatar
    Marsha_R
    4 years ago

    for a descending sort it would be something like this

     

    sorted = true
    
    x = first date
    
    y = second date
    
    while (y is not empty) and (sorted is true)
    
         if x > y then
    
             log.message sort is good
    
             if y = lastdateinlist then
    
                 set y = empty
    
             else 
    
                 set x = y
    
                 set y = nextdate
    
         else 
    
              log.message sort is bad
    
              set sorted = false