Troubleshooting Page Loading or Rendering Problems

symptom
  • AJAX pages do not render correctly when navigating through Sahi
  • You get Javascript errors only when going through Sahi
cause 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.
resolution
  1. Just before loading the page through Sahi, click on "Enable Traffic Logs" link on the Dashboard.
  2. Then navigate to your page that causes the error. Once the page/error shows up, click on "Disable Traffic Logs" on the Dashboard.
  3. Click on the arrow near the "Enable Traffic Logs" and it should open up explorer at sahi/usedata/logs (If it does not open just go to that directory)
  4. Go to traffic folder
  5. You will see timestamped folders. Open the latest one, and look inside for various folders which represent individual URL calls made by Sahi. Inside those folders, you will see response.body_modified_xxx and response.body_unmodified_xxx. Open the modified one in a text editor and check if there is Sahi injected content in a non-html file.
  6. If there is, open the corresponding request.header_unmodified.txt file and get the full URL from the first line. It would look something like:
    GET http://sahi.co.in/demo/clickCombo.htm HTTP/1.1
    Add the URL or a pattern of it in exclude_inject.txt file.

    You can do this
    1. by directly editing sahi/userdata/config/exclude_inject.txt
    or
    1. Click on 'Configure' link on Dashboard
    2. open 'exclude_inject.txt'
    3. add the full URL or URL pattern
    4. click Save
  7. Restart Sahi, clear browser cache, and check.