Hi All,
Has anyone been able to achieve the execution on Safari browser using webdrivers. Please share your views on the same. I have referred to wiki page available for safari extension setup. http://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/remote/DesiredCapabilities.html With below mentioned Maven dependency, I am able to use DesiredCapabilities.safari(). <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-server</artifactId> <version>2.21.0</version> </dependency> But I am getting following error : C:\Automation-jar>java -jar selenium-server-standalone-2.21.0.jar May 14, 2012 3:51:01 PM org.openqa.grid.selenium.GridLauncher main INFO: Launching a standalone server 15:51:05.288 INFO - Java: Sun Microsystems Inc. 20.6-b01 15:51:05.296 INFO - OS: Windows 7 6.1 x86 15:51:05.318 INFO - v2.21.0, with Core v2.21.0. Built from revision 16552 15:51:05.498 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub 15:51:05.503 INFO - Version Jetty/5.1.x 15:51:05.531 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver] 15:51:05.539 INFO - Started HttpContext[/selenium-server,/selenium-server] 15:51:05.546 INFO - Started HttpContext[/,/] 15:51:05.587 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@1d8957f 15:51:05.594 INFO - Started HttpContext[/wd,/wd] 15:51:05.609 INFO - Started SocketListener on 0.0.0.0:4444 15:51:05.613 INFO - Started org.openqa.jetty.jetty.Server@d1e604 15:51:30.359 INFO - Executing: [new session: {platform=ANY, browserName=safari, version=5}] at URL: /session) 15:51:30.541 INFO - Server started at http://DDC2-D-9M8C6BS:19283/ 15:52:15.732 WARN - Exception thrown java.util.concurrent.ExecutionException: org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new s ession. Possible causes are invalid address of the remote server or browser start-up failure. Build info: version: '2.21.0', revision: '16552', time: '2012-04-11 19:08:38' System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_31' Driver info: driver.version: SafariDriver at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source) at java.util.concurrent.FutureTask.get(Unknown Source) at org.openqa.selenium.remote.server.DefaultSession.execute(DefaultSession.java:158) at org.openqa.selenium.remote.server.DefaultSession.<init>(DefaultSession.java:112) at org.openqa.selenium.remote.server.DefaultSession.createSession(DefaultSession.java:89) at org.openqa.selenium.remote.server.DefaultDriverSessions.newSession(DefaultDriverSessions.java:92) at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:62) at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:202) at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:597) at org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:548) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet.java:520) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.openqa.jetty.jetty.servlet.ServletHolder.handle(ServletHolder.java:428) at org.openqa.jetty.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:677) at org.openqa.jetty.jetty.servlet.ServletHandler.handle(ServletHandler.java:568) at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1530) at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1482) at org.openqa.jetty.http.HttpServer.service(HttpServer.java:909) at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820) at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986) at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837) at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243) at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:357) at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:534) Caused by: org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are in valid address of the remote server or browser start-up failure. Build info: version: '2.21.0', revision: '16552', time: '2012-04-11 19:08:38' System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_31' Driver info: driver.version: SafariDriver at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:454) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:140) at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:95) at org.openqa.selenium.safari.SafariDriver.<init>(SafariDriver.java:33) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) |
I think that Web Driver does not support safari at all. I think that for safari you have to use Selenium RC
|
Administrator
|
With 2.21 selenium jar, we can now use DesiredCapabilites.safari() just like for Firefox/IE. We have to use Safari 5 and above versions.
I have referred to the same wiki page : https://code.google.com/p/selenium/wiki/SafariDriver for the installation of certificate and safari extensions. |
Free forum by Nabble | Edit this page |