4

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

4
  • If you get automated Safari on Windows working, I would be very interested in that. Commented Oct 14, 2008 at 15:01
  • Did you have any luck with this? Commented Oct 9, 2009 at 21:40
  • Only via Chrome and webkit, as mentioned above. However it's pretty early on in development. Take a look at the latest WatiN sources for an idea. Commented Oct 10, 2009 at 11:33
  • I am thinking about adding support for Safari on Windows for Watir. We already have Chrome support, so that is not so interesting to me. Commented Oct 12, 2009 at 8:06

4 Answers 4

2

you might check my post here where I am using the method described above to automate Chrome in C#

http://markcz.wordpress.com/2012/02/18/automating-chrome-browser-from-csharp/

Martin

Sign up to request clarification or add additional context in comments.

Comments

2

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.

1 Comment

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

Selenium has been very useful for me for compatibility testing.

Comments

1

WatiN here http://watinandmore.blogspot.com/2010/01/browserattachto-and-iattachto.html lets you automate IE and FF. It is open source, so you can have a look on how they do it.

Maybe you can adapt it to your needs?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.