{"action":"created","issue":{"url":"https://api.github.com/repos/appium/appium/issues/6440","repository_url":"https://api.github.com/repos/appium/appium","labels_url":"https://api.github.com/repos/appium/appium/issues/6440/labels{/name}","comments_url":"https://api.github.com/repos/appium/appium/issues/6440/comments","events_url":"https://api.github.com/repos/appium/appium/issues/6440/events","html_url":"https://github.com/appium/appium/issues/6440","id":151492169,"number":6440,"title":"Safari mobile browser not loading default page  / initialURL correctly","user":{"login":"amaricleroberts","id":6227424,"avatar_url":"https://avatars.githubusercontent.com/u/6227424?v=3","gravatar_id":"","url":"https://api.github.com/users/amaricleroberts","html_url":"https://github.com/amaricleroberts","followers_url":"https://api.github.com/users/amaricleroberts/followers","following_url":"https://api.github.com/users/amaricleroberts/following{/other_user}","gists_url":"https://api.github.com/users/amaricleroberts/gists{/gist_id}","starred_url":"https://api.github.com/users/amaricleroberts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amaricleroberts/subscriptions","organizations_url":"https://api.github.com/users/amaricleroberts/orgs","repos_url":"https://api.github.com/users/amaricleroberts/repos","events_url":"https://api.github.com/users/amaricleroberts/events{/privacy}","received_events_url":"https://api.github.com/users/amaricleroberts/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/appium/appium/labels/iOS","name":"iOS","color":"444444"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-04-27T21:11:10Z","updated_at":"2016-10-05T11:27:39Z","closed_at":"2016-04-29T02:55:07Z","body":"## The problem\r\nI am trying to simulate deep linking in an Appium app.  To do this, I first open up an iOSDriver that navigates to the desired URL.  Then I quit this AppiumDriver without closing the simulator, and open another iOSDriver with the app.  \r\n\r\nHowever, the Driver won't load because the initial welcome URL doesn't apply.  The simulator opens up Safari and puts the welcome text into the search bar, but it doesn't apply it / hit Enter.  The simulator just spins and the Driver can't be created unless I manually hit Enter. \r\n\r\nSee below.\r\n<img width=\"371\" alt=\"screen shot 2016-04-27 at 3 59 18 pm\" src=\"https://cloud.githubusercontent.com/assets/6227424/14868039/1edb3e06-0c91-11e6-87d4-338c65bfef5a.png\">\r\n\r\n\r\n## Environment\r\n\r\n* Appium 1.4.16\r\n* MacBook Pro, running Yosemite 10.10.5\r\n* Node v1.5.0\r\n* iOS app being tested\r\n* iPhone 6, OS 9.2 simulator\r\n\r\n\r\n## Link to Appium logs\r\n\r\nAppium log once it eventually times out:\r\nhttps://gist.github.com/amaricleroberts/3cf32c46d727d0f4dda2692150eefe53\r\n\r\nI think the important bit is this, where it appears to try to hit 'Go' in Safari but can't.\r\n```\r\ninfo: [debug] Pushing command to appium work queue: \"au.getElementByName('Go')\"\r\ninfo: [debug] Sending command to instruments: au.getElementByName('Go')\r\ninfo: [debug] [INST] 2016-04-27 21:04:28 +0000 Debug: Got new command 7 from instruments: au.getElementByName('Go')\r\ninfo: [debug] [INST] 2016-04-27 21:04:28 +0000 Debug: evaluating au.getElementByName('Go')\r\ninfo: [debug] [INST] 2016-04-27 21:04:28 +0000 Debug: evaluation finished\r\ninfo: [debug] [INST] 2016-04-27 21:04:28 +0000 Debug: Lookup returned [object UIAButton] with the name \"Go\" (id: 2).\r\ninfo: [debug] [INST] 2016-04-27 21:04:28 +0000 Debug: responding with:\r\ninfo: [debug] [INST] 2016-04-27 21:04:28 +0000 Debug: Running system command #8: /usr/local/Cellar/node/5.1.0/bin/node /usr/local/lib/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{\"status\":0,\"value\":{\"ELEMENT\":\"2\"}}...\r\ninfo: [debug] Socket data received (38 bytes)\r\ninfo: [debug] Socket data being routed.\r\ninfo: [debug] Got result from instruments: {\"status\":0,\"value\":{\"ELEMENT\":\"2\"}}\r\ninfo: [debug] Pushing command to appium work queue: \"au.tapById('2')\"\r\ninfo: [debug] Sending command to instruments: au.tapById('2')\r\ninfo: [debug] [INST] 2016-04-27 21:04:29 +0000 Debug: Got new command 8 from instruments: au.tapById('2')\r\ninfo: [debug] [INST] 2016-04-27 21:04:29 +0000 Debug: evaluating au.tapById('2')\r\ninfo: [debug] [INST] 2016-04-27 21:04:29 +0000 Debug: UIAButton.tap()\r\ninfo: [debug] [INST] 2016-04-27 21:04:29 +0000 Debug: UIAButton.scrollToVisible()\r\ninfo: [debug] [INST] 2016-04-27 21:04:29 +0000 Debug: UIAButton - scrollToVisible cannot be used because this element has no scrollable ancestor.\r\ninfo: [debug] [INST] 2016-04-27 21:04:29 +0000 Debug: UIAButton - scrollToVisible cannot be used because this element has no scrollable ancestor.\r\ninfo: [debug] [INST] 2016-04-27 21:04:29 +0000 Debug: UIAButton could not be tapped because the element is not visible\r\ninfo: [debug] Socket data received (57 bytes)\r\ninfo: [debug] Socket data being routed.\r\ninfo: [debug] Got result from instruments: {\"status\":13,\"value\":\"elementId 2 could not be tapped\"}\r\ninfo: [debug] Navigating to most recently opened webview\r\n```\r\n\r\n\r\n## Code\r\n```\r\nDesiredCapabilities desCap = new DesiredCapabilities();\r\n\r\n        final URL connectionUrl;\r\n        try {\r\n            connectionUrl = new URL(connectionUrlString);\r\n        } catch (MalformedURLException MUE) {\r\n            throw new RuntimeException(\"COULD NOT PARSE APPIUM CONNECTION URL\");\r\n        }\r\n\r\n        desCap.setCapability(\"platform\", platform);\r\n        desCap.setCapability(\"deviceName\", deviceName);\r\n        desCap.setCapability(\"platformVersion\", platformVersion);\r\n        desCap.setCapability(\"noReset\", true);\r\n\r\n        switch (platform) {\r\n            case PLATFORM_ANDROID:\r\n                desCap.setCapability(\"avd\", System.getProperty(\"avd\", deviceName));\r\n                desCap.setCapability(\"androidDeviceReadyTimeout\", 180);\r\n\r\n                appiumDriver = new AndroidDriver(connectionUrl, desCap);\r\n\r\n                break;\r\n            case PLATFORM_IOS:\r\n                desCap.setCapability(\"autoAcceptAlerts\", true);\r\n                desCap.setCapability(\"sendKeyStrategy\", \"setValue\");\r\n\r\n                desCap.setBrowserName(\"Safari\");\r\n                desCap.setCapability(\"safariInitialUrl\", initialUrl);\r\n\r\n                int tries = 3;\r\n\r\n                while (tries > 0) {\r\n                    try {\r\n                        appiumDriver = new IOSDriver(connectionUrl, desCap);\r\n                        \r\n                        tries = 0;\r\n                    } catch (SessionNotCreatedException e) {\r\n                        System.out.println(\"Problem encountered while trying to launch appium driver, trying again in 5 seconds...\");\r\n                        try {\r\n                            Thread.sleep(5000L);\r\n                            System.out.println(\"Done sleeping\");\r\n                        } catch (InterruptedException ex) {\r\n                           System.out.println(ex);\r\n                        }\r\n                    }\r\n\r\n                    tries--;\r\n                }\r\n\r\n                break;\r\n            default:\r\n                throw new RuntimeException(\"UNKNOWN PLATFORM\");\r\n        }\r\n\r\nappiumDriver.manage().timeouts().implicitlyWait(TIMEOUT_SECONDS, TimeUnit.SECONDS);\r\n\r\nappiumDriver.get(initialUrl);\r\n```"},"comment":{"url":"https://api.github.com/repos/appium/appium/issues/comments/251649061","html_url":"https://github.com/appium/appium/issues/6440#issuecomment-251649061","issue_url":"https://api.github.com/repos/appium/appium/issues/6440","id":251649061,"user":{"login":"qual","id":20475680,"avatar_url":"https://avatars.githubusercontent.com/u/20475680?v=3","gravatar_id":"","url":"https://api.github.com/users/qual","html_url":"https://github.com/qual","followers_url":"https://api.github.com/users/qual/followers","following_url":"https://api.github.com/users/qual/following{/other_user}","gists_url":"https://api.github.com/users/qual/gists{/gist_id}","starred_url":"https://api.github.com/users/qual/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qual/subscriptions","organizations_url":"https://api.github.com/users/qual/orgs","repos_url":"https://api.github.com/users/qual/repos","events_url":"https://api.github.com/users/qual/events{/privacy}","received_events_url":"https://api.github.com/users/qual/received_events","type":"User","site_admin":false},"created_at":"2016-10-05T11:27:39Z","updated_at":"2016-10-05T11:27:39Z","body":"I just struggled with this issue for 2 days until I ended up on this page. When I toggle the software keyword, everything worked well.\r\n\r\nI am using Appium 1.5.3 on Mac OS X EL Capitan. So it seems that issue exists in Appium 1.5.3 as well. \r\nPlease check if the issue is fixed and provide update. If not fixed, please add it in list of known issues."}}
{"actor":{"display_login":"qual"}}