Sahi doesn't work with Safari 5 on Mac with the error: Safari can’t open the page “http://sahi.example.com/_s_/dyn/Driver_initialized”

373 views
Skip to first unread message

Christopher Yee Mon

unread,
Jan 9, 2013, 4:09:36 PM1/9/13
to sa...@googlegroups.com
I installed Sahi Open Source on Mac OS X v10.7.4 and it installed correctly and the dashboard loads properly. However, Sahi doesn't work with the Safari 5.1.7 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”.

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.

The only time it seemed to come close to working was 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.

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]

Any assistance would be appreciated.

Christopher Yee Mon

unread,
Jan 16, 2013, 10:19:08 AM1/16/13
to sa...@googlegroups.com
I have since updated the Safari on the system from Safari 5.1.7 to Safari 6.0.2 and I am still getting the same behaviour with the exact same message in Safari when I try to launch it through the dashboard. Attached is a screenshot
Screen Shot 2013-01-16 at 10.13.44 AM.png

Christopher Yee Mon

unread,
Jan 16, 2013, 10:36:07 AM1/16/13
to sa...@googlegroups.com
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>

Sriram Narayanan

unread,
Jan 16, 2013, 11:41:31 AM1/16/13
to sa...@googlegroups.com

Going by your first email, sahi is trying to set proxy configuration but is trying to use a Windows application on osx. This is a bug.

Please set the system proxy, and then browse to the URL using safari. You should also test once with Firefox just to reassure yourself that you've set the system proxy configuration correctly.

Ram

--
You received this message because you are subscribed to the Google Groups "sahi" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sahi/-/u1KvbLSvT88J.
To post to this group, send email to sa...@googlegroups.com.
To unsubscribe from this group, send email to sahi+uns...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sahi?hl=en.

Christopher Yee Mon

unread,
Jan 17, 2013, 2:17:13 PM1/17/13
to sa...@googlegroups.com
I changed the system proxy to localhost:9999 and it worked. It loaded http://sahi.example.com/_s_/dyn/Driver_initialized from the Dashboard and also responded to scripts written in PHP using Mink to access the Sahi webdriver. This is both with the scripts being run remotely and locally. Firefox and Chrome also worked with the proxy turned on. They also worked with the proxy turned off though.

When I tried it earlier with Safari 5.0.2 with the proxy, it got me as far as http://sahi.example.com/_s_/dyn/Driver_initialized , but then it was non-responsive when I wrote php scripts using the Mink (http://mink.behat.org) library that were being executed remotely against the Sahi web driver being run on this Mac. When those scripts tried to open a page, the page would start to load but never get there. I'm not sure if it was just being slow at that time, or if it was the Safari version, or what, but the Mink scripts worked this time. weird.

Thanks
Christopher

Sriram Narayanan

unread,
Jan 17, 2013, 8:41:03 PM1/17/13
to sa...@googlegroups.com

Thanks for the explanation, Christopher. I myself use windows and Solaris, ask I'll have to try this out once on Osx.

I'll file a bug and push a fix this weekend for being able to set the proxy automatically on Osx.

Sriram

To view this discussion on the web visit https://groups.google.com/d/msg/sahi/-/7ZMkaPLxkI4J.
Reply all
Reply to author
Forward
0 new messages