Safari driver error .. Am i am missing something ????

893 views
Skip to first unread message

Mani

unread,
May 2, 2012, 3:12:00 PM5/2/12
to webd...@googlegroups.com

I tried to install safari extension and driver as referred at http://code.google.com/p/selenium/wiki/SafariDriver

But when i am trying to run it its showing me this error  and its opening a blank safari page with

SafariDriver requesting connection at ws://localhost:35454/wd

org.openqa.selenium.remote.
UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '2.2.1', revision: '16551', time: '2012-04-11 21:42:35'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.7.3', java.version: '1.6.0_31'
Driver info: driver.version: SafariDriver
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:435)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:139)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:94)
    at org.openqa.selenium.safari.SafariDriver.<init>(SafariDriver.java:33)
    at com.proferi.uitests.Safaritest.createDriver(Safaritest.java:30)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.IllegalStateException: Executor has not been started yet
    at com.google.common.base.Preconditions.checkState(Preconditions.java:145)
    at org.openqa.selenium.safari.SafariDriverCommandExecutor.execute(SafariDriverCommandExecutor.java:123)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:415)
    ... 28 more


Please help .
Thanks

David

unread,
May 6, 2012, 3:01:42 AM5/6/12
to webdriver
Most likely the install didn't work correctly. Try again.

If it did work, you'd see something like this in the logs (I see them
in standard output while testing with Beanshell for Java):

May 5, 2012 11:19:08 PM org.openqa.selenium.safari.SafariDriverServer
start
INFO: Server started at http://hostname:47427/
May 5, 2012 11:19:11 PM
org.openqa.selenium.safari.SafariDriverWebSocketHandler
onOpen
INFO: Connection opened
May 5, 2012 11:19:12 PM
org.openqa.selenium.safari.SafariDriverWebSocketHandler
onMessage
INFO: Received message: {"status":0,"value":
{"browserName":"safari","version":"5
.
1","platform":"WINDOWS","javascriptEnabled":true,"takesScreenshot":true,"cssSel
ectorsEnabled":true},"id":"d7903b74-aa4a-4285-9d2b-f419a1322108"}
May 5, 2012 11:19:12 PM
org.openqa.selenium.safari.SafariDriverConnection onMess
age
INFO: Processing message: {"status":0,"value":
{"browserName":"safari","version":
"5.1","platform":"WINDOWS","javascriptEnabled":true,"takesScreenshot":true,"cssS
electorsEnabled":true},"id":"d7903b74-aa4a-4285-9d2b-f419a1322108"}

On May 2, 12:12 pm, Mani <webuser...@gmail.com> wrote:
> I tried to install safari extension and driver as referred athttp://code.google.com/p/selenium/wiki/SafariDriver
>
> But when i am trying to run it its showing me this error  and its opening a
> blank safari page with
>
> SafariDriver requesting connection at ws://localhost:35454/wd
>
> org.openqa.selenium.remote.
> UnreachableBrowserException: Could not start a new session. Possible causes
> are invalid address of the remote server or browser start-up failure.
> Bu*ild info: version: '2.2.1', revision: '16551', time: '2012-04-11
> 21:42:35'*
> System info: os.name: '*Mac OS X'*, os.ar*ch: 'x86_64', os.version:
> '10.7.3', java.version: '1.6.0_31'*
> Driver info: driver.version: SafariDriver
>     at
> org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:435 )
>     at
> org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.jav a:139)
>     at
> org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:94)
>     at org.openqa.selenium.safari.SafariDriver.<init>(SafariDriver.java:33)
>     at com.proferi.uitests.Safaritest.createDriver(Safaritest.java:30)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3 9)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp l.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:597)
>     at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod .java:44)
>     at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable. java:15)
>     at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.j ava:41)
>     at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:2 7)
>     at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
>     at
> org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunn er.java:79)
>     at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.ja va:71)
>     at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.ja va:49)
>     at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>     at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>     at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>     at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>     at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>     at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestRe ference.java:50)
>     at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java: 38)
>     at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestR unner.java:467)
>     at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestR unner.java:683)
>     at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner .java:390)
>     at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunne r.java:197)

Payal Gupta

unread,
May 14, 2012, 8:09:54 AM5/14/12
to webd...@googlegroups.com
Hi David,

I am getting the same error as mentioned here..
I have followed the same steps mentioned in wiki for the installation.
I am using selenium-2.21 jars for the execution.

Please help if you have any idea on the same..
Thanks!!!

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To post to this group, send email to webd...@googlegroups.com.
To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.


Krishnan Mahadevan

unread,
May 15, 2012, 6:52:11 AM5/15/12
to webd...@googlegroups.com
I personally saw "UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure." come up when the extension was not properly installed on Safari browser.

I started off by downloading the "deprecated" extension from here : http://code.google.com/p/selenium/downloads/detail?name=SafariDriver.safariextension-2.21.0.zip


Tried installing the extension a couple of times and kept hitting errors. In the end I had to add up my cert and then tried doing it again and this time the extension was installed without much of a problem.

After that I was able to run UI tests on "http" pages using RemoteWebDriver against the Safari browser but with "https" URLs which had cert issues (internal sites) I kept hitting a prompt by Safari asking me if it wanted me to proceed or not 


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

Payal Gupta

unread,
May 16, 2012, 4:00:36 AM5/16/12
to webd...@googlegroups.com
Hi Krishnan,

I have downloaded this decrepated extension in safari.
But I am not sure what wrong I am doing.It is invoking IE driver instead of safari.

Reply all
Reply to author
Forward
Message has been deleted
0 new messages