Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, windows and java based applications. Get your 30 day free trial.

Discuss your Sahi Pro usage patterns, best practices, problems and solutions. Help others solve their problems and seek help from the community when needed. If you need specific support on your application, please email support @ sahipro.com

Sahi doesn't work with Safari 5.0.1 on MacOSX

chrisyeemchrisyeem Members
edited January 2013 in Sahi - Open Source
I installed Sahi Open Source on Mac OS X v10.6.4 and it installed correctly and the dashboard loads properly. However, Sahi doesn't work with the Safari 5.0.1 that is installed on the machine. When I click on Safari in the list of browsers, it attempts to load http://sahi.example.com/_s_/dyn/Driver_initialized

In the Terminal Window I see the following string of text
open -n -a Safari.app http://sahi.example.com/_s_/dyn/Driver_initialized

However in the Safari window that loads, I see the following string of text

Safari can’t find the server.
Safari can’t open the page “http://sahi.example.com/_s_/dyn/Driver_initialized” because Safari can’t find the server “sahi.example.com”.

This Mac that I'm using is a loaner, however I checked and I don't see any proxies enabled in the System Preferences. I am also running Sahi on Safari for Windows and it works fine there. On the same MacOSX machine Sahi also loads correctly in the browser for Firefox and Chrome.

I also tried the instructions located in this forum thread
http://sahi.co.in/forums/discussion/2339/memory-leak-with-safari/p1
which said
'''
In userdata.properties I set up:
ext.http.proxy.host=localhost
ext.http.proxy.port=9999
'''

and that did not seem to work either.

Any assistance would be appreciated.

Best Answer

Answers

  • chrisyeemchrisyeem Members
    edited January 2013
    The only time it worked is when I added the 127.0.0.1:9999 proxy to the system settings. Then it worked as far as reaching the page http://sahi.example.com/_s_/dyn/Driver_initialized. When I tried to actually use Sahi in that situation, it doesn't access any other pages. I should say I am using Mink from a separate machine to interface with Sahi. This environment works with the other browsers running on this Mac.
  • Below is the terminal output that is displayed when I try to use Sahi to perform operations (without the system-wide proxy settings enabled). Everything before the exception takes place at the time that I try to use it. Everything from the exception to the end takes place when I see it's not working and I close Sahi Dashboard

    Jan 9, 2013 11:47:48 AM net.sf.sahi.test.ProcessHelper execute
    INFO: open -n -a Safari.app http://sahi.example.com/_s_/dyn/Driver_start?sahisid=50eda4d8b07c5__SahiAmpersandSahi__startUrl=http://sahi.example.com/_s_/dyn/Driver_initialized?startUrl=
    Socket closed
    Jan 9, 2013 11:48:00 AM net.sf.sahi.util.ProxySwitcher execCommand
    SEVERE: null
    java.io.IOException: Cannot run program "/sahi/tools/proxy_config.exe": error=13, Permission denied
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
    at java.lang.Runtime.exec(Runtime.java:593)
    at java.lang.Runtime.exec(Runtime.java:466)
    at net.sf.sahi.util.Utils.executeCommand(Utils.java:528)
    at net.sf.sahi.util.ProxySwitcher.execCommand(ProxySwitcher.java:40)
    at net.sf.sahi.util.ProxySwitcher.revertSystemProxy(ProxySwitcher.java:24)
    at net.sf.sahi.ui.Dashboard$3.windowClosing(Dashboard.java:240)
    at java.awt.AWTEventMulticaster.windowClosing(AWTEventMulticaster.java:332)
    at java.awt.Window.processWindowEvent(Window.java:1862)
    at javax.swing.JFrame.processWindowEvent(JFrame.java:274)
    at java.awt.Window.processEvent(Window.java:1820)
    at java.awt.Component.dispatchEventImpl(Component.java:4714)
    at java.awt.Container.dispatchEventImpl(Container.java:2143)
    at java.awt.Window.dispatchEventImpl(Window.java:2475)
    at java.awt.Component.dispatchEvent(Component.java:4544)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:635)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Caused by: java.io.IOException: error=13, Permission denied
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:53)
    at java.lang.ProcessImpl.start(ProcessImpl.java:91)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
    ... 21 more
    logout

    [Process completed]

  • chrisyeemchrisyeem Members
    edited January 2013
    Here is a link to a screenshot of the issue: http://imgur.com/E5GJv

    I'm at the point where I've updated Safari and the behavior is still the same. So my environment is Safari 6.0.2 with MacOSX 10.7.5 with Sahi v3.5 2011-07-19

    And here is the contents of my browser configuration file located at /Applications/sahi/userdata/config/browser_types.xml . I presume that it's the default of the mac version of the browser config file :
    <browserTypes>
    <browserType>
    <name>firefox</name>
    <displayName>Firefox</displayName>
    <icon>firefox.png</icon>
    <path>open -n -a Firefox.app</path>
    <options>--args -profile "$userDir/browser/ff/profiles/sahi$threadNo" -no-remote</options>
    <processName>Firefox</processName>
    <capacity>5</capacity>
    <force>true</force>
    </browserType>

    <browserType>
    <name>safari</name>
    <displayName>Safari</displayName>
    <icon>safari.png</icon>
    <path>open -n -a Safari.app</path>
    <options> </options>
    <processName>Safari</processName>
    <capacity>5</capacity>
    <force>true</force>
    </browserType>

    <browserType>
    <name>chrome</name>
    <displayName>Chrome</displayName>
    <icon>chrome.png</icon>
    <path>open -n -a "Google Chrome.app"</path>
    <options>--args --user-data-dir=$userDir/browser/chrome/profiles/sahi$threadNo --proxy-server=localhost:9999 --disable-popup-blocking</options>
    <processName>"Google Chrome"</processName>
    <capacity>5</capacity>
    <force>true</force>
    </browserType>
    </browserTypes>
  • Many thanks to Chris for the detail here! Essentially, I am running into the same issue installing the most recent version of Sahi OS (via install_sahi_v43_20130206.jar).

    Mac OS: 10.8.2
    Java Version: 1.6.0_37 (Java SE Runtime)

    The install went OK, Sahi starts OK (albeit I need to open terminal and explicitly run start_dashboard.sh from the command line). The controller window opens OK. However, Safari opens with the same message as described by Chris.

    (When opening Firefox or Chrome, I am seeing a permission denied error in the Sahi runtime logs -- and those browsers do not load. I am making that a separate post. I don't know if the two issues are related.)

    I am shamelessly adding this comment because I am a Sahi OS/Sahi Forum newbie and want to make sure I don't lose track of this discussion thread :)
  • Has there been any update on this? I was able to fix Chrome and FF but not Safari. Is this the right place to contact customer support?
  • chrisyeemchrisyeem Members
    edited April 2013
    That is the solution. Basically you have to manually set the proxy to localhost:9999 in the system settings. So make a new location in the system preferences and in that location, change the network preferences to have the proxy.
  • NaomiC/chrisyeem,

    thanks for your responses! i really appreciate the info.

    cheers
Sign In or Register to comment.