selenium: Cannot run browser with WebDriver 3.0.0, Safari 10 and ElCaptain 10.11.6

OS:

Mac OS El Captain 10.11.6

Selenium Version:

3.0.0,

Driver:

SafariDriver 2.48

Browser:

Safari 10

Browser Version:

11602.1.50.0.10

Expected Behavior -

When starting driver, browser is starting and performing commands

Actual Behavior -

Browser is starting, but nothing happens or browser is not starting at all - depending on previous commands: if process listed by this command (launchctl list | grep webdriverd) is running, browser is not starting at all. If I kill the process, browser is starting, but nothing happens

Steps to reproduce -

Write a test working with Se3.0.0 and Chrome or Se2.53.1 and any browser, change settings and try to run in on Safari using Se3.0.0.

Capabilities:

    SafariOptions safariOpts = new SafariOptions();
    DesiredCapabilities cap = DesiredCapabilities.safari();

    safariOpts.setUseCleanSession(true);
    cap.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
    cap.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, "dismiss");
    cap.setCapability(SafariOptions.CAPABILITY, safariOpts);
    cap.setBrowserName("safari");
    cap.setPlatform(Platform.MAC);

AND - I guess - the most helpful information here - whole setup and tests are working with previous version of webdriver (2.53.1) and SafariDriver 2.48

Stacktrace

    Unable to start the server: another safaridriver is already running (@ localhost:28142).
    paź 19, 2016 5:06:53 PM org.openqa.selenium.remote.ProtocolHandshake createSession
    INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end
    Unable to start the server: another safaridriver is already running (@ localhost:28142).
    paź 19, 2016 5:07:15 PM org.openqa.selenium.remote.ProtocolHandshake createSession
    INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end

    org.openqa.selenium.WebDriverException: The driver server has unexpectedly died!
    Build info: version: '3.0.0', revision: '350cf60', time: '2016-10-13 10:48:57 -0700'
    System info: host: 'krk-mptye', ip: '***.***.***.***', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.8.0_92'
    Driver info: driver.version: SafariDriver

at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:88)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:241)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:128)
at org.openqa.selenium.safari.SafariDriver.<init>(SafariDriver.java:62)
at org.openqa.selenium.safari.SafariDriver.<init>(SafariDriver.java:53)
at core.engineui.WebDriverAdapter.getDriver(WebDriverAdapter.java:55)
at core.engineui.webdriver.SnapshotProvider.takeAScreenshot(SnapshotProvider.java:45)
at core.engineui.webdriver.SnapshotProvider.takeSnapshots(SnapshotProvider.java:36)
at core.listeners.UiTestSubListener.takeASnapshot(UiTestSubListener.java:51)
at core.listeners.UiTestSubListener.takeASnapshot(UiTestSubListener.java:55)
at core.listeners.UiTestSubListener.additionalTearDown(UiTestSubListener.java:40)
at core.listeners.TestRunListener.afterInvocation(TestRunListener.java:50)
at org.testng.internal.invokers.InvokedMethodListenerInvoker$InvokeAfterInvocationWithoutContextStrategy.callMethod(InvokedMethodListenerInvoker.java:100)
at org.testng.internal.invokers.InvokedMethodListenerInvoker.invokeListener(InvokedMethodListenerInvoker.java:62)
at org.testng.internal.Invoker.runInvokedMethodListeners(Invoker.java:556)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:699)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:820)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1128)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
at org.testng.TestRunner.privateRun(TestRunner.java:782)
at org.testng.TestRunner.run(TestRunner.java:632)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
at org.testng.SuiteRunner.run(SuiteRunner.java:268)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1244)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1169)
at org.testng.TestNG.run(TestNG.java:1064)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:74)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:124)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
    Caused by: org.apache.http.conn.HttpHostConnectException: Connect to localhost:5252 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:158)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
at org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute(ApacheHttpClient.java:142)
at org.openqa.selenium.remote.internal.ApacheHttpClient.execute(ApacheHttpClient.java:88)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:108)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:64)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
... 38 more
    Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:74)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:141)
... 53 more

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 19 (6 by maintainers)

Most upvoted comments

@lukeis http://alunthomasevans.blogspot.com/2007/10/old-microsoft-joke.html

@aolkuski, try: > launchctl list | grep webdriverd > sudo kill xxxx where xxxx is the process id of the webdriverd process. Which it looks like you may already have tried (now that I re-read your original post)…

You might also try enabling the ‘Allow Remote Automation’ option from the Develop menu in Safari if it isn’t already checked.

Hi,

I am facing the same issue.

The behavior is: “Browser is starting, but nothing happens or browser is not starting at all - depending on previous commands: if process listed by this command (launchctl list | grep webdriverd) is running, browser is not starting at all. If I kill the process, browser is starting, but nothing happens”

Is there a fix for this issue? As I see the issue has been closed.

Selenium 3.x uses Apple’s safaridriver, not the old safaridriver extension. Apple’s safaridriver comes with Safari 10, so you have to have Safari 10 to test Safari in Selenium 3.x. If you want to use the latest safaridriver you can use the safaridriver that comes with Safari Technology Preview, but that only works on Sierra, not El Capitan. Finally, the safaridriver that is included in the latest Safari Technology Preview (Release 22) is not working, so you’ll need to wait for the next release in order to use it.