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.

accessing elements using _in

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

Trying to access elements structured like

Folder1 ---subFolder1---filename1
---filename1

Folder2 ---subFolder2

_assertExists(_span("filename1"),_in(_cell(subFolder1))); shows true
_assertExists(_span("filename1"),_in(_cell("subFolder2"))); also shows true

confused why the second script shows true.

How can I get the attributes (eg: title) of these elements?

Thanks

Comments

  • narayannarayan Administrators
    Hi dk,

    The brackets in your script are incorrect.

    _assertExists(_span("filename1"),_in(_cell("subFolder1")));

    should be

    _assertExists(_span("filename1",_in(_cell(subFolder1))));


    To get the title, just use _span("filename1",_in(_cell(subFolder1))).title

    In cases like these, copy the accessor to "Evaluate Expression" box, modify it and click "Highlight" to see if it is pointing to the correct element.

    Regards,
    Narayan
  • dkdk Members
    Thanks Narayan
    Now it works.
This discussion has been closed.