OS:
macOS Sierra
Selenium Version:
3.0.1
Browser:
Safari
Problem:
Unable to start Safari, getting error saying 'unable to start the server: another safaridriver is already running'
Code Used:
SafariOptions options = new SafariOptions();
options.setUseCleanSession(true);
WebDriver driver = new SafariDriver(options);
driver.get("http://www.google.com");
Error logs:
Unable to start the server: another safaridriver is already running (@ localhost:22411).
Exception in thread "main" org.openqa.selenium.WebDriverException: The driver server has unexpectedly died!
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:49:13 -0700'
System info: host: 'sanojs-Mac-mini.local', ip: '172.16.0.171', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12', java.version: '1.8.0_102'
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.
at org.openqa.selenium.safari.SafariDriver.
at com.test.TEsting.main(TEsting.java:13)
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to localhost:39201 [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)
... 5 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)
... 20 more
I am also facing the similar kind of issue , When try to launch the safari browser , It throws an error as org.openqa.selenium.WebDriverException: The driver server has unexpectedly died!
I have installed the extension correctly . Its a straight forward scenario .
On Sierra, Selenium 3 defaults to using Apple's new safaridriver, which is already included on your system. You don't need to install an extension. Expect the options to be different and the functionality to be different as the driver is still in active development.
@sanojqa - have you verified that there is not already a safaridriver process on your computer?
Hi all, I'm facing the same issue, same OS and console output
@titusfortner, I've checked - no additional process
ps aux | grep sel
im 3556 0.0 1.0 8250552 167748 s000 S+ Thu02PM 0:11.02 /usr/bin/java -jar selenium-server-standalone-3.0.1.jar -role hub
im 4017 0.0 0.0 2434840 776 s005 S+ 6:44PM 0:00.00 grep sel
I am also getting the same issue, while running a simple script in safari/Mac.
another safari already running.
Please do let me know if anyone has any clue?
killing existing webdriver process doesn't help (like in issue 411)
(no additional processes)
Could we at least expect sel3.x safari extension - that will alleviate the issue of parallel run on multiple sessions for the same macOs user?
@vicnbt
the process name is safaridriver... it's not a selenium or webdriver.
@cgoldberg, thanks I'll try it out
I am also having the same issue....
usr/bin/safaridriver?Reg point 1 above - one needs to supply port where the safaridriver should listen to for session-establishment say
/usr/bin/safaridriver -p 0
...And mostly user running this command should be the administrator on the Mac Sierra machine.
Note: Pt2 above You can still use Safari 2.48.x web-driver extension with selenium 2.x such as with sel v2.53 to drive Safari 10.0.1 automation (I ve tried it myself & it works). However having the web-driver extension enabled in Safari should ideally not impact sel3 from connecting to apple safari driver ,since sel3 uses a direct websocket to connect.
@praveen-cimplicity even if i run the /usr/bin/safaridriver -p 0 in terminal i am getting the same issue.
Unable to start the server: another safaridriver is already running (@ localhost:12616)
What should we do? i am trying to run selenium from eclipse using java. is there any driver like chrome/geckodriver for safari separately after the release of Selenium 3.1.0??
Hi,
Kill the process associated with mentioned port no. in error as a
workaround.
Thanks,
Ravi Kukreja
On 23-Feb-2017 11:08 AM, "williamvr74738" notifications@github.com wrote:
@praveen-cimplicity https://github.com/praveen-cimplicity even if i run
the /usr/bin/safaridriver -p 0 in terminal i am getting the same issue.
Unable to start the server: another safaridriver is already running (@
localhost:12616)What should we do? i am trying to run selenium from eclipse using java. is
there any driver like chrome/geckodriver for safari separately after the
release of Selenium 3.1.0??—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/SeleniumHQ/selenium/issues/3260#issuecomment-281899924,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AYwNJOfLxF08MH6RqUAJqk5eWxLPKC_7ks5rfRtWgaJpZM4LPBr_
.
Multiple safaridriver instances are allowed as of Safari 10.1 or later, however, only one Safari.app can be automated at a time. Please verify that this behaves as advertised on that version or later.
I'm closing issue as this is a limitation of SafariDriver - only 1 instance can be run at a time. There is nothing we can do about it so please raise this to Apple bug tracker.
Most helpful comment
I am also getting the same issue, while running a simple script in safari/Mac.
another safari already running.
Please do let me know if anyone has any clue?