Forum Discussion

sudam_SL's avatar
sudam_SL
Contributor
5 years ago

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
    5 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