How to driven safari10 with selenium3.0 in a remote environment?

77 views Asked by At

I have a selenium grid environment, i already start chrome in windows7, i want start up safari, how to config safari? Here is my code:

        DesiredCapabilities desiredCapabilities = DesiredCapabilities.safari();
        WebDriver driver = new RemoteWebDriver(new URL("http://hub ip"), desiredCapabilities);
        driver.get("www.google.com");
1

There are 1 answers

0
Karidrgn On

If your safari 10 is on El Capitan or greater you need to add the following capability: capability.setCapability(SafariOptions.CAPABILITY, new SafariOptions());

Safari 10 now comes with it's own driver built in and you no longer need to include the extension. However, I'm having trouble getting it to work on a Yosemite machine and have posted my one question there.