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

  • 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

         

         

  • can you elaborate further on what you mean by "sorting function"

    provide some screenshots and whatnot please 

    • sudam_SL's avatar
      sudam_SL
      Contributor

      Thanks for response Justing. actually what i'm expecting is validate the sort order of attached screenshot.

      • Marsha_R's avatar
        Marsha_R
        Moderator

        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