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 take value from _div("elementname")

LynLyn Members
edited November -1 in Sahi - Open Source
I need a value from an element _div("elementname") and check if that value exists in the given page.

Comments

  • if(_condition(_div("elementname") != undefined)){
    _debug(_div("elementname").innerText);
    }
  • narayannarayan Administrators
    Hi Lyn,

    Use
    var $myValue;
    _set($myValue, _getText(_div("elementname")));
    // Use $myValue where ever you want.
    

    Beesman,

    Use _getText instead of innerText because _getText will normalize text to work across browsers.

    Regards,
    Narayan
  • it's works beesman

    Thanks
Sign In or Register to comment.