views:

1560

answers:

2

I wondered if anyone had successfully managed, or knew how to automate the Safari web browser on the Windows platform.

Ideally I would like to automate Safari in a similar way to using mshtml for Internet Explorer. Failing that a way to inject JavaScript into the running process would also be fine. I've used the JavaScript injection method to automate Firefox via the jssh plug-in.

I'm looking to automate the browser using .Net to enhance an existing automation framework WatiN

Edit: Whilst I think selenium might be a great choice for automating Safari in certain scenarios, I would like to use a solution that does not require installing software on the server i.e. Selenium Core or an intermediate proxy server in the case of Selenium Remote Control.

Update: 23-03-2009: Whilst I've not yet found a way to automate Safari, I have found a way to automate Webkit inside of Chrome. If you run Chrome using the --remote-shell-port=9999 command line switches (ref: http://www.ericdlarson.com/misc/chrome_command_line_flags.html) you can send javascript to the browser.

Once connected to the remote debug seesion

  • Send debug() to attach to the current tab
  • Send any javascript command using print, i.e. print document.window.location.href

We've used this method to add Chrome support to WatiN

+1  A: 

Selenium has been very useful for me for compatibility testing.

Nick Stinemates
+2  A: 

I'm not sure if this helps, but the guys at ArtOfTest have added Safari support to their .Net based automation framework WebAii. Maybe you could figure out what they are doing.

Randall Sutton
I asked them and got automated reply that I will get an answer in 24 hours, but a few day later still nothing.
Željko Filipin