Miscellaneous Issues

Content blocked from being loaded

symptom Sahi proxy seems to block content from being loaded
cause The blocked content is probably of content type application/octet-stream. This content type is part of download_contenttypes.txt which causes the content to get downloaded instead of being displayed on the page.
resolution
  1. Take a backup of userdata\config\download_contenttypes.txt.
  2. Edit download_contenttypes.txt. Remove the following line
    application/octet-stream
  3. Save download_contenttypes.txt. Restart Sahi server and clear browser cache, and try your application again.

Element's class identified incorrectly

symptom Sahi seems to identify an element by an incorrect class name. This causes the script to fail. On doing an Inspect element, we can see that the class is different.
cause Sometimes when you do mouse over an element, its class will change. Since elements are identified by doing a Ctrl + Mouse Over, the class will be wrongly identified.
resolution In such cases, you may need to do a View Source or Inspect Element to find out the original class and use that to identify the element.

Controller does not open in Linux

symptom Clicking Alt + DoubleClick does not bring up the controller on Linux. I have tried this on Firefox and Chrome.

This does not work on Ubuntu 12.04 as well as on CentOS.
resolution Please try the following steps
  1. Check that the Popup blocker has not been turned ON by some update. If it has been, turn it OFF.
  2. If it still doesn't work, please try accessing the controller by Ctrl + Alt + Double Click. Usually, we do it by Alt + Double Click. Try pressing the Ctrl key as well.

Multiple Chrome instances

symptom Whenever Chrome browser is launched from the Dashboard, multiple instances of the Chrome browser are opened.
resolution Install Sahi to a folder that does NOT contain spaces.

OR

Do the following.
  1. In browser_types.xml, search for chrome and replace [code --user-data-dir=$userDir\browser\chrome\profiles\sahi$threadNo --proxy-server=localhost:9999 --disable-popup-blocking --always-authorize-plugins [/code] with
    <options>--user-data-dir=c:\ChromeProfiles\browser\chrome\profiles\sahi$threadNo --proxy-server=localhost:9999 --disable-popup-blocking --always-authorize-plugins</options>
  2. Create c:\ChromeProfiles.
  3. Restart Sahi server and clear browser cache.

    Now launching Chrome browser will launch only one instance.

Elements not getting identified on Safari browser

For identifying elements on the Safari browser, Sahi needs the browser window to be in focus while hovering over the element to be identified. Suggested way of doing this would be my minimizing the browser window and placing the window and the controller side by side as shown below. Now click on the browser window, before trying to identify an element.

Firefox Redirect Loop