{"action":"created","issue":{"url":"https://api.github.com/repos/ios-driver/ios-driver/issues/369","labels_url":"https://api.github.com/repos/ios-driver/ios-driver/issues/369/labels{/name}","comments_url":"https://api.github.com/repos/ios-driver/ios-driver/issues/369/comments","events_url":"https://api.github.com/repos/ios-driver/ios-driver/issues/369/events","html_url":"https://github.com/ios-driver/ios-driver/issues/369","id":68553574,"number":369,"title":"WebDriverException: is Safari started and with the focus ?","user":{"login":"pgmreddy","id":8236389,"avatar_url":"https://avatars.githubusercontent.com/u/8236389?v=3","gravatar_id":"","url":"https://api.github.com/users/pgmreddy","html_url":"https://github.com/pgmreddy","followers_url":"https://api.github.com/users/pgmreddy/followers","following_url":"https://api.github.com/users/pgmreddy/following{/other_user}","gists_url":"https://api.github.com/users/pgmreddy/gists{/gist_id}","starred_url":"https://api.github.com/users/pgmreddy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgmreddy/subscriptions","organizations_url":"https://api.github.com/users/pgmreddy/orgs","repos_url":"https://api.github.com/users/pgmreddy/repos","events_url":"https://api.github.com/users/pgmreddy/events{/privacy}","received_events_url":"https://api.github.com/users/pgmreddy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-04-15T02:29:34Z","updated_at":"2015-07-08T07:30:11Z","closed_at":null,"body":"Hi all,\r\n\r\n1. I have built the ios-server jar from default DEV branch source code\r\nTrying to run test on safari on Real device with below source code given on website:\r\n\r\n2. Code is from website:\r\npublic static void main(String[] args) throws Exception {\r\n    DesiredCapabilities safari = IOSCapabilities.iphone(\"Safari\");\r\n    RemoteWebDriver driver = new RemoteWebDriver(new URL(\"http://localhost:5555/wd/hub\"), safari);\r\n    driver.get(\"http://www.ebay.co.uk/\");\r\n    System.out.println(driver.getTitle());\r\n    driver.quit();\r\n}\r\n\r\n3.\r\nMy Config:\r\nMacOSX 10.10.3 (14D131)\r\nJava: 1.8\r\niPhone 5s (real device) - iOS Version 8.2(12D508)\r\nXcode versions 6.1, 6.2 & 6.3\r\n\r\n4.\r\nI am getting below error:\r\n       WebDriverException: is Safari started and with the focus ?\r\n\r\nActually\r\nthe Safari opens\r\nand then closes\r\nafter few seconds\r\njust when this exception occurs\r\n\r\nDetailed error is below\r\nCan anyone help? Or, let me know how I can contribute to solve this bug.\r\n\r\nWhen i searched its coming from showWarning() function of RemoteIOSWebDriver.java file\r\ncan be seen at below link\r\nhttps://github.com/ios-driver/ios-driver/search?utf8=%E2%9C%93&q=is+Safari+started+and+with+the+focus\r\n\r\nThank you\r\n\r\n\r\n-------------------------------------------------------------------------------------------------------------------------\r\nXCode6.1\r\n\r\nException in thread \"main\" org.openqa.selenium.WebDriverException: is Safari started and with the focus ? \r\nCommand duration or timeout: 17.34 seconds\r\nBuild info: version: '2.45.0', revision: '32a636c', time: '2015-03-05 22:01:35'\r\nSystem info: host: 'mayank-iMac.local', ip: '192.168.116.99', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.3', java.version: '1.8.0_40'\r\nDriver info: org.uiautomation.ios.client.uiamodels.impl.RemoteIOSDriver\r\n    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\r\n    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)\r\n    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\r\n    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)\r\n    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)\r\n    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)\r\n    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)\r\n    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)\r\n    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:126)\r\n    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:153)\r\n    at org.uiautomation.ios.client.uiamodels.impl.RemoteIOSDriver.<init>(RemoteIOSDriver.java:94)\r\n    at com.innopark.pkg1.Cls1.device(Cls1.java:49)\r\n    at com.innopark.pkg1.Cls1.main(Cls1.java:35)\r\nCaused by: org.openqa.selenium.WebDriverException: is Safari started and with the focus ? \r\nBuild info: version: '2.45.0', revision: '32a636c', time: '2015-03-05 22:01:35'\r\nSystem info: host: 'mayank-iMac.local', ip: '192.168.116.99', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.3', java.version: '1.8.0_40'\r\nDriver info: driver.version: IOSDualDriver\r\n    at org.uiautomation.ios.drivers.RemoteIOSWebDriver.showWarning(RemoteIOSWebDriver.java:122)\r\n    at org.uiautomation.ios.drivers.RemoteIOSWebDriver.start(RemoteIOSWebDriver.java:113)\r\n    at org.uiautomation.ios.drivers.IOSDualDriver.getRemoteWebDriver(IOSDualDriver.java:198)\r\n    at org.uiautomation.ios.drivers.IOSDualDriver.start(IOSDualDriver.java:130)\r\n    at org.uiautomation.ios.ServerSideSession.start(ServerSideSession.java:306)\r\n    at org.uiautomation.ios.command.uiautomation.NewSessionNHandler.safeStart(NewSessionNHandler.java:98)\r\n    at org.uiautomation.ios.command.uiautomation.NewSessionNHandler.handle(NewSessionNHandler.java:56)\r\n    at org.uiautomation.ios.command.BaseCommandHandler.handleAndRunDecorators(BaseCommandHandler.java:110)\r\n    at org.uiautomation.ios.servlet.IOSServlet.getResponse(IOSServlet.java:158)\r\n    at org.uiautomation.ios.servlet.IOSServlet.process(IOSServlet.java:85)\r\n    at org.uiautomation.ios.servlet.IOSServlet.doPost(IOSServlet.java:60)\r\n    at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)\r\n    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)\r\n    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)\r\n    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)\r\n    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)\r\n    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)\r\n    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)\r\n    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)\r\n    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)\r\n    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)\r\n    at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)\r\n    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)\r\n    at org.eclipse.jetty.server.Server.handle(Server.java:370)\r\n    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)\r\n    at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982)\r\n    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043)\r\n    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)\r\n    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)\r\n    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)\r\n    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)\r\n    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)\r\n    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)\r\n    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)\r\n    at java.lang.Thread.run(Thread.java:745)\r\n\r\n----------------------------------------------------------------------------------------------------------------------------------------\r\n\r\nXCode6.2\r\n\r\nException in thread \"main\" org.openqa.selenium.WebDriverException: is Safari started and with the focus ? \r\nCommand duration or timeout: 21.74 seconds\r\nBuild info: version: '2.45.0', revision: '32a636c', time: '2015-03-05 22:01:35'\r\nSystem info: host: 'mayank-iMac.local', ip: '192.168.116.99', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.3', java.version: '1.8.0_40'\r\nDriver info: org.uiautomation.ios.client.uiamodels.impl.RemoteIOSDriver\r\n    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\r\n    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)\r\n    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\r\n    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)\r\n    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)\r\n    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)\r\n    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)\r\n    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)\r\n    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:126)\r\n    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:153)\r\n    at org.uiautomation.ios.client.uiamodels.impl.RemoteIOSDriver.<init>(RemoteIOSDriver.java:94)\r\n    at com.innopark.pkg1.Cls1.device(Cls1.java:49)\r\n    at com.innopark.pkg1.Cls1.main(Cls1.java:35)\r\nCaused by: org.openqa.selenium.WebDriverException: is Safari started and with the focus ? \r\nBuild info: version: '2.45.0', revision: '32a636c', time: '2015-03-05 22:01:35'\r\nSystem info: host: 'mayank-iMac.local', ip: '192.168.116.99', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.3', java.version: '1.8.0_40'\r\nDriver info: driver.version: IOSDualDriver\r\n    at org.uiautomation.ios.drivers.RemoteIOSWebDriver.showWarning(RemoteIOSWebDriver.java:122)\r\n    at org.uiautomation.ios.drivers.RemoteIOSWebDriver.start(RemoteIOSWebDriver.java:113)\r\n    at org.uiautomation.ios.drivers.IOSDualDriver.getRemoteWebDriver(IOSDualDriver.java:198)\r\n    at org.uiautomation.ios.drivers.IOSDualDriver.start(IOSDualDriver.java:130)\r\n    at org.uiautomation.ios.ServerSideSession.start(ServerSideSession.java:306)\r\n    at org.uiautomation.ios.command.uiautomation.NewSessionNHandler.safeStart(NewSessionNHandler.java:98)\r\n    at org.uiautomation.ios.command.uiautomation.NewSessionNHandler.handle(NewSessionNHandler.java:56)\r\n    at org.uiautomation.ios.command.BaseCommandHandler.handleAndRunDecorators(BaseCommandHandler.java:110)\r\n    at org.uiautomation.ios.servlet.IOSServlet.getResponse(IOSServlet.java:158)\r\n    at org.uiautomation.ios.servlet.IOSServlet.process(IOSServlet.java:85)\r\n    at org.uiautomation.ios.servlet.IOSServlet.doPost(IOSServlet.java:60)\r\n    at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)\r\n    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)\r\n    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)\r\n    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)\r\n    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)\r\n    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)\r\n    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)\r\n    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)\r\n    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)\r\n    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)\r\n    at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)\r\n    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)\r\n    at org.eclipse.jetty.server.Server.handle(Server.java:370)\r\n    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)\r\n    at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982)\r\n    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043)\r\n    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)\r\n    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)\r\n    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)\r\n    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)\r\n    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)\r\n    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)\r\n    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)\r\n    at java.lang.Thread.run(Thread.java:745)\r\n\r\n----------------------------------------------------------------------------------------------------------------------------------------\r\n\r\nXCode6.3\r\n\r\nException in thread \"main\" org.openqa.selenium.WebDriverException: is Safari started and with the focus ? \r\nCommand duration or timeout: 27.19 seconds\r\nBuild info: version: '2.45.0', revision: '32a636c', time: '2015-03-05 22:01:35'\r\nSystem info: host: 'mayank-iMac.local', ip: '192.168.116.99', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.3', java.version: '1.8.0_40'\r\nDriver info: org.uiautomation.ios.client.uiamodels.impl.RemoteIOSDriver\r\n    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\r\n    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)\r\n    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\r\n    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)\r\n    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)\r\n    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)\r\n    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)\r\n    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)\r\n    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:126)\r\n    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:153)\r\n    at org.uiautomation.ios.client.uiamodels.impl.RemoteIOSDriver.<init>(RemoteIOSDriver.java:94)\r\n    at com.innopark.pkg1.Cls1.device(Cls1.java:49)\r\n    at com.innopark.pkg1.Cls1.main(Cls1.java:35)\r\nCaused by: org.openqa.selenium.WebDriverException: is Safari started and with the focus ? \r\nBuild info: version: '2.45.0', revision: '32a636c', time: '2015-03-05 22:01:35'\r\nSystem info: host: 'mayank-iMac.local', ip: '192.168.116.99', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.3', java.version: '1.8.0_40'\r\nDriver info: driver.version: IOSDualDriver\r\n    at org.uiautomation.ios.drivers.RemoteIOSWebDriver.showWarning(RemoteIOSWebDriver.java:122)\r\n    at org.uiautomation.ios.drivers.RemoteIOSWebDriver.start(RemoteIOSWebDriver.java:113)\r\n    at org.uiautomation.ios.drivers.IOSDualDriver.getRemoteWebDriver(IOSDualDriver.java:198)\r\n    at org.uiautomation.ios.drivers.IOSDualDriver.start(IOSDualDriver.java:130)\r\n    at org.uiautomation.ios.ServerSideSession.start(ServerSideSession.java:306)\r\n    at org.uiautomation.ios.command.uiautomation.NewSessionNHandler.safeStart(NewSessionNHandler.java:98)\r\n    at org.uiautomation.ios.command.uiautomation.NewSessionNHandler.handle(NewSessionNHandler.java:56)\r\n    at org.uiautomation.ios.command.BaseCommandHandler.handleAndRunDecorators(BaseCommandHandler.java:110)\r\n    at org.uiautomation.ios.servlet.IOSServlet.getResponse(IOSServlet.java:158)\r\n    at org.uiautomation.ios.servlet.IOSServlet.process(IOSServlet.java:85)\r\n    at org.uiautomation.ios.servlet.IOSServlet.doPost(IOSServlet.java:60)\r\n    at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)\r\n    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)\r\n    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)\r\n    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)\r\n    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)\r\n    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)\r\n    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)\r\n    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)\r\n    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)\r\n    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)\r\n    at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)\r\n    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)\r\n    at org.eclipse.jetty.server.Server.handle(Server.java:370)\r\n    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)\r\n    at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982)\r\n    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043)\r\n    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)\r\n    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)\r\n    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)\r\n    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)\r\n    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)\r\n    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)\r\n    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)\r\n    at java.lang.Thread.run(Thread.java:745)\r\n"},"comment":{"url":"https://api.github.com/repos/ios-driver/ios-driver/issues/comments/119468568","html_url":"https://github.com/ios-driver/ios-driver/issues/369#issuecomment-119468568","issue_url":"https://api.github.com/repos/ios-driver/ios-driver/issues/369","id":119468568,"user":{"login":"pgmreddy","id":8236389,"avatar_url":"https://avatars.githubusercontent.com/u/8236389?v=3","gravatar_id":"","url":"https://api.github.com/users/pgmreddy","html_url":"https://github.com/pgmreddy","followers_url":"https://api.github.com/users/pgmreddy/followers","following_url":"https://api.github.com/users/pgmreddy/following{/other_user}","gists_url":"https://api.github.com/users/pgmreddy/gists{/gist_id}","starred_url":"https://api.github.com/users/pgmreddy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgmreddy/subscriptions","organizations_url":"https://api.github.com/users/pgmreddy/orgs","repos_url":"https://api.github.com/users/pgmreddy/repos","events_url":"https://api.github.com/users/pgmreddy/events{/privacy}","received_events_url":"https://api.github.com/users/pgmreddy/received_events","type":"User","site_admin":false},"created_at":"2015-07-08T07:30:11Z","updated_at":"2015-07-08T07:30:11Z","body":"Sure, I will.Because I need extract sleeps in my old code & find them on ios-driver too, I will revert in 2 days, right now a bit busy writing casino game server. Thanks for your patience.\nDate: Mon, 6 Jul 2015 22:02:06 -0700\nFrom: notifications@github.com\nTo: ios-driver@noreply.github.com\nCC: pgmreddy@outlook.com\nSubject: Re: [ios-driver] WebDriverException: is Safari started and with the focus ? (#369)\n\n@pgmreddy Thanks for your reply. I've already tried to explore that fix on that link you are talking about but couldn't find any. And without any knowledge of iOS-driver putting sleeps randomly in the code doesn't make any sense, So it will be great if you can point the exact place where that sleep thing works. Thanks again.\n\n\n—\nReply to this email directly or view it on GitHub.\n\n  \n    \n    \n  \n  \n \t\t \t   \t\t  "}}