cancel
Showing results for 
Search instead for 
Did you mean: 

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

SOLVED
Occasional Contributor

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

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

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

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

     

     

View solution in original post

6 REPLIES 6
Staff

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

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

provide some screenshots and whatnot please 

Best,
Justin Kim
Occasional Contributor

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

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

Community Hero

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

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

     

     

View solution in original post

Occasional Contributor

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

Thanks for the reply, badly i'm using keyword test. any possibility to resolve this with keyword test?

Community Hero

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

Yes, you have all those constructs in Keyword Tests

 

Marsha_R_0-1605312741998.png

 

Community Hero

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

Hi,

 

Run Script Routine operation (https://support.smartbear.com/testcomplete/docs/keyword-testing/reference/test-actions/run-script-ro...) should help.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors