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 do you handle dynamic objects

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

How can we handle dynamic objects in sahi.
for eg: we need to verify user name with logged in user.. username should match with logged in user.
how do you we validate this scenario.

Please reply...

Regards
Raja

Comments

  • Hi Raja,

    Have a look at _dataDrive() API.

    For more details: http://sahi.co.in/w/data-driven-testing

    If you are telling that there are different username's then you can get the user name and assert on it.

    For Eg:

    var $name= _getText(_textbox("user"));
    _alert($name);
    _assertEqual($name, "test");

    Regards
    Sumitra
  • Hi Sumitra,

    Thanks for your reply, i have used below code in my script.
    var $text=_getText(_span("id"));
    _alert($text);

    i am getting the error like "Error: The parameter passed to _getText was not found on the browser ".

    Please reply...

    Regards
    Raja
  • Sumitra waiting for your reply...
  • Hi Raja,

    Could you please explain me what exactly you want to do as your usage is wrong.

    Have a look at _getText() API in http://sahi.co.in/w/all-apis

    Are you trying to use many username's from a file and trying to use it in a script?

    Kindly be more specific about what exactly you want to do?

    Regards
    Sumitra
Sign In or Register to comment.