3

I'm new & started working on selenium from last month. I was successfully running script on FF & chrome. but when I started to run same script on Win safari It gives browser initilization error.
what should I do for launching SafariDriver on Windows?

  • Whay is the error message you're getting? – dzieciou May 7 '16 at 11:46
  • Question yourself if you want to support the Windows version of Safari, it has been discontinued since 2013. Better use a Mac version or on something like saucelabs or testingbot cloud services. saucelabs.com – Niels van Reijmersdal May 7 '16 at 12:24
  • Yes, but I have to work with windows Safari. I have a client which has given win-safari support. – Sophia May 7 '16 at 12:27
  • 1
    I think you should advice them to reconsider that for two reasons. One you will run into issues with testing, because it is unsupported. Second using Win-Safari version is very insecure, no sane IT department should support it. There is not a significant group of actual users for Win-Safari. So I see no reason to waste time on it, but if you must goodluck :) Also testing Safari on Windows is not a replacement for testing it on a Mac, because it is so old it does not compare at all. Keep this things in mind. – Niels van Reijmersdal May 7 '16 at 12:43
4

Launching Safari browser is very easy, just you have to add safariDriver jar in your Windows Safari browser. Check after installation whether this icon is displayed or not?

enter image description here

If Yes then it will work.
Steps-
Requirements: Safari Browser installed Selenium WebDriver
Now we have to install SafariDriver extension with below steps.
Manually install the latest Safari extension:

Download Safari Driver jar from here.
Rename the file to a .zip file instead of a .jar file – Unzip it (just double click on it to do so).
In Folder, go to ../selenium-safari-driver-2.43.1/org/openqa/selenium/safari.
Double click “SafariDriver.safariextz” or simple drag this file in browser.

WebDriver driver = new SafariDriver();
driver.get("Url");

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.