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.

How to get get an element/cell from a table without an ID?

swastikaswastika Members
edited November -1 in Sahi - Open Source
Can anyone please tell me how can i get an element/Cell from a table which does not have an ID?
The table that im working with generates a different dynamic ID every time i press control and check its attributes in the sahi controller.
i want find AVAILABE in the table cell and click the corresponding checkbox next to it!

Please help me out!

Comments

  • narayannarayan Administrators
    Hi Swastika,

    Are you able to get the cell with "AVAILABLE" in it, using the Controller?

    Mostly it would be _cell("AVAILABLE")

    Highlight it from the Controller and see if it is the one you want.

    Then if the checkbox is inside that cell, use
    _checkbox(0, _in(_cell("AVAILABLE")))

    If the checkbox is near that cell, use
    _checkbox(0, _near(_cell("AVAILABLE")))


    If _cell("AVAILABLE") does not work because the cell has more text in it,
    you may use _cell(/AVAILABLE/) instead.

    If you still have to get the table, you can use _parentTable(_cell(/AVAILABLE/))

    Hope that helps.

    Regards,
    Narayan
  • Is there any way to get the dynamically changing table id in order to find the cell?
  • narayannarayan Administrators
    Are you unable to get the cell by the proposed way? Is it necessary that you have to use the table to get to the cell?

    You could also check for the alternatives for that table from the Controller.
  • _check box(0, _near(_cell("AVAILABLE"))) i am using this to make checkbox tick. check box lies in different cell corresponding to available in the same table. Thus page i am automating contain large amount of data and lots of check boxes,some are enable some are disable.this code is not working for me.
    Please help out.
  • narayannarayan Administrators
    Hi Swastika,

    Could you post the html of the section with these checkboxes? We should be able to help you out. If you cannot post it here, please email it to support@sahi.co.in from your official email id.

    Regards,
    Narayan
  • Hi Narayan, am also facing the same issue. Did any solution for the same issue come?
  • narayannarayan Administrators
    Hi Vineet,

    Please create a new post with your exact requirements. It is easier to answer a new post than look at older history and figure out what is happening. And as specified in the post, PLEASE post a HTML snippet so that we can give you a specific answer.

    Regards,
    Narayan
Sign In or Register to comment.