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.

Recording doesnt work on pages added in exclude_inject.txt

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

On some pages I get javascript error. On these pages the recording and playback works fine, but the page doesnt function as expected.

Based on a previous post regarding exclude_inject.txt, i included the URL of this error pages in exclude_inject.txt file. But now, recording on these pages doesnt work.

On observation, the Sahi Inject code is not found on these not working pages but is present on other pages.

Please advice.

Comments

  • Hi,

    I found the problem ---

    In Exclude_inject.txt file, I was including the base URL along with the individual jsp files. On account of which the base web page wasn’t working.

    Error:
    http://ipadd:port/ra/logout.do
    http://ipadd:port/ra/scripts/login.js.jsp

    Correct:
    http://ipadd:port/ra/scripts/login.js.jsp
  • Hi Shirley,

    Yes, you are correct.

    Here is how Sahi works:

    Sahi controls the browser by injecting javascript into web pages. However there are various requests like XMLHttpRequests, javascript, css, etc. where Sahi should not inject its code. While this is correctly detected and handled in most cases, there are instances where one may need to explicitly ask Sahi not to inject code. In such instances, regular expression patterns can be added to exclude_inject.txt. When a URL matches this pattern, Sahi will NOT inject its code.

    For example while using ExtJS, Add
    .*callback=.*
    at the end of sahi/userdata/config/exclude_inject.txt,
    restart Sahi, clear browser cache, and it should fix problems with AJAX and extjs.

    For more Details:

    http://sahi.co.in/w/trouble-shooting-sahi

    Regards
    Sumitra
Sign In or Register to comment.