18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

Sorting problems

SamsirsameerSamsirsameer Members
edited November -1 in Sahi - Open Source
Hi,

Can any1 provide me code for the following requirement.

I have a table and some columns. I need to click on each column header and verify that whether it is sorted or not.
When click the column header for the first time, it should be sorted in ascending order, if we click again it should be sorted in descending order.

Please also provide me the code to verify that if clicked for the first time and if column is sorted in ascending order, log success message, else log failure message

Same code when we click for the second time.

Thanks,
SamsirSameer

Comments

  • Hi,



    When I done assert on the table , the following code is returned

    _assertExists(_cell(_table(4), 4, 0));


    _assertExists(_cell(_table(4), 4, 0));
    _assertEqual("Name", _getText(_cell(_table(4), 4, 0)));
    _assertContainsText("Name", _cell(_table(4), 4, 0));

    Please reply....

    Thanks,
    Sameer
  • Hi,

    _assertExists() will check if the web element is present in your page or not.
    Please elaborate what you would further need to understand.

    Regards,
    Pankaj
Sign In or Register to comment.