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.

Not able to get the text from my app webpage

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

I am using SAHI OS on my windows 7 laptop with the IE 8 and Firefox browser.
I want to get the session ID that has been created for my application login, which is unique and dynamic.
I tried to identify the label for my session ID but SAHI dint identified anything for that label, so i manually added the label name in to the script. but i am getting error with the _getCellText API.

_click(_link("View User Audit Message"));
_getCellText(_div("SessionID"));

I can see below error;
The parameter passed to _getText was not found on the browser.

Please help.

Comments

  • ashokashok Members
    Hi Swaroop,

    Please refer tweaking Sahi APIs.

    http://sahi.co.in/w/tweaking-sahi-apis
  • swaroopswaroop Members
    Hi Ashok,

    I tried tweaking sahi also but it did not worked out. I have tried many API's to get the text from the page but every time i am ending up with some error.

    1.function session()
    {
    var $sessionnumb;
    _set($sessionnumb, _getText(_span(0,_near(_label("sessionID")))));
    _debug($sessionnumb);
    }
    _writeCSVFile($sessionnumb, "<C:\Users\swaroopa.gangadharap\sahi\userdata\scripts\SessioID.csv>");


    2. _set($text,_getValue(_byID("SessionID")));
    var $text = _getValue(_span(0,_near(_label("SessionID"))));
    _log($text);

    3. function getsessionid ($data)
    {
    $data= _getText(_span("sessionID"));
    }
    _writeCSVFile($data, "<C:\Users\swaroopa.gangadharap\sahi\userdata\scripts\SessioID.csv>");

    with all these try also i am not able to get the text from the page. and for your info the web page is pure .jsp page not having any flex or flash content.

    I am getting error like
    sahi.setServervar('___lastvalue__1343218155633',_getvalue(_sapn(0,_near(_label("sessioID")))));
    TypeError: 'parent node is null or not an object
    No trace available

    Please help,
Sign In or Register to comment.