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.

Objects not identifying while recording

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

Intially i was facing problem for opening some pages of my application through Sahi
My application contains several java applets and javascripts.

After including these pages in exclude injection list I could open these pages successfully.

However while recording objects from these pages/ applets /popups are not getting identified or getting recorded. Even I tried by pressing ctrl and taking mouseover, but nothing happens.

My application page contains following pages which I have added in exclude_injection list
.*pagenameFS.jsp.*
.*pagename.jsp.*
.*pagenameAppletFS.jsp.*
.*pagenameApplet.jsp.*

I have also set the external proxy as false in userdata.properties.

Can anyone please guide where I am going wrong? I am just stuck due to this object identification issue.

Comments

  • Hi bodhep,

    Could you please let me know if the record and playback is working fine for other sites.

    Regards
    Sumitra
  • bodhepbodhep Members
    Hi Sumitra,

    I tried on google with some search criteria and opening the links from those pages and it's working.

    Also tried playback of Demo scripts(after starting web.bat) but it's not running.

    My application contains javapplets/scripts , sample code as follows
    _setValue(_textbox("username"), "xxxx");
    _setValue(_password("password"), "xxxx");
    _click(_submit(" Login "));
    _mouseOver(_link("Modify/Delete"));
    _click(_link("Modify/Delete"));
    _click(_radio("SearchCriteria_RADIO[1]"));
    _click(_radio("SearchCriteria_RADIO[1]"));
    _click(_radio("SearchCriteria_RADIO[1]"));
    _click(_radio("SearchCriteria_RADIO[1]"));
    _setValue(_radio("SearchCriteria_RADIO[1]"), "true");
    _setValue(_textbox("Name_SELECT"), "Block");
    _click(_button(" Search "));
    _click(_heading3("SEARCH RESULTS"));
    _setSelected(_select("xxxx_SELECT"), "Block ^5542 0999 1 -");
    _click(_button("Modify "));
    _select("MODIFY");

    After this step it opens popup window for modification of values.
    Earlier this page/window was not displaying correctly due to sahi injected code.

    I have identified such related pages and added them into exclude_injection_txt as follows
    .*modify.jsp.*
    .*modifyFS.jsp.*
    SearchFS.jsp
    add.jsp
    addFS.jsp

    Now page/window are displaying correctly but contents are not getting recorded.

    Please help
  • narayannarayan Administrators
    Hi,

    If you add a page to exclude_inject.txt, Sahi will not inject code into it. Since there is no injected code, Sahi cannot record and play back either on that page. One should not exclude top level pages. Only ajax, js, css requests should be excluded.

    Use firebug or some such tool to see which specific urls and url patterns you need to exclude.

    If you are unable to do that, I would suggest you to do the following:

    1) Revert back the settings in exclude_inject.txt to what it was originally (remove your entries)
    2) Modify sahi/userdata/config/userdata.properties and add
    debug.traffic.log.unmodified=true
    debug.traffic.log.modified=true
    
    at the end
    3) Save, restart Sahi and navigate up to the point just before bringing up the popup window.
    4) Delete all files in sahi/userdata/logs/traffic/
    5) Open your popup window. (to the place where the page is rendered incorrectly)
    6) Stop Sahi
    7) Zip the files in traffic folder and email us at support@sahi.co.in
    8) Modify sahi/userdata/config/userdata.properties and REMOVE
    debug.traffic.log.unmodified=true
    debug.traffic.log.modified=true

    Once you send us the zip, we will have a look at the logs and tell you what pattern to use in exclude inject.

    Regards,
    Narayan
  • bodhepbodhep Members
    Thanks Narayan.

    I have reverted the setting of exclude_injection.txt
    Taken traffic logs only for screens which failed to open correctly and sent to above mentioned ID.

    Kindly check and revert which patterns I should mention in exclude_injection.txt for those screeens

    Thanks

    Regards
    Prashant
Sign In or Register to comment.