Smoeey
Smoeey

Reputation: 127

Launch Safari on Mac node from Windows PC with Selenium RemoteWebDriver and Grid

I'm trying to fire off a test to my iMac from my Windows PC.

I have downloaded and installed the webdriver addon for Safari and I have established a connection to my Windows based Selenium Grid hub.

When I try to run my test I receive an error for an OperaDriver:

org.openqa.selenium.WebDriverException: The best matching driver provider org.openqa.selenium.opera.OperaDriver can't create a new driver instance for Capabilities [{browserName=safari, safari.options={port=0, cleanSession=true}, version=9, platform=MAC}]

Current Setup:

Windows PC:

java -jar selenium-server-standalone-2.53.0.jar -role hub -port 4445

Mac:

java -jar selenium-server-standalone-2.53.0.jar -role node -nodeConfig node1Config.json

node1Config:

{
"capabilities": [
    {
        "browserName": "safari",
        "acceptSslCerts": true,
        "javascriptEnabled": true,
        "takeScreenshot": false,
        "browser-version": "9",
        "platform": "MAC",
        "maxInstances": 5,
        "cleanSession": true
    }
],
"configuration": {
    "_comment": "Configuration for Node",
    "cleanUpCycle": 2000,
    "timeout": 30000,
    "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
    "port": 5568,
    "hubHost": "MyNetworkIpWasHere",
    "register": true,
    "hubPort": 4445,
    "maxSessions": 5
    }   
}

Java to launch test:

DesiredCapabilities capabilities = DesiredCapabilities.safari();
capabilities.setPlatform(Platform.MAC);
capabilities.setBrowserName("safari");
capabilities.setVersion("9");

webDriver = new RemoteWebDriver(new URL("http://myipwashere:4445/wd/hub"), capabilities);

Edit: There are 5 safari nodes available on my grid, none are being used.

I must be overlooking something, any help would be greatly appreciated!

Thanks in advance.

Upvotes: 1

Views: 3154

Answers (1)

Smoeey
Smoeey

Reputation: 127

After much trial and error, the URL being passed to the remotewebdriver was incorrect only for Safari. Hopefully this will help someone that has a similar problem in the future.

Thanks RemcoW for all of your help.

Upvotes: 1

Related Questions