{"action":"created","issue":{"url":"https://api.github.com/repos/appium/appium/issues/8958","repository_url":"https://api.github.com/repos/appium/appium","labels_url":"https://api.github.com/repos/appium/appium/issues/8958/labels{/name}","comments_url":"https://api.github.com/repos/appium/appium/issues/8958/comments","events_url":"https://api.github.com/repos/appium/appium/issues/8958/events","html_url":"https://github.com/appium/appium/issues/8958","id":247168243,"number":8958,"title":"Unable to switch to WebView context on Android O","user":{"login":"jbruckne","id":5460326,"avatar_url":"https://avatars3.githubusercontent.com/u/5460326?v=4","gravatar_id":"","url":"https://api.github.com/users/jbruckne","html_url":"https://github.com/jbruckne","followers_url":"https://api.github.com/users/jbruckne/followers","following_url":"https://api.github.com/users/jbruckne/following{/other_user}","gists_url":"https://api.github.com/users/jbruckne/gists{/gist_id}","starred_url":"https://api.github.com/users/jbruckne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbruckne/subscriptions","organizations_url":"https://api.github.com/users/jbruckne/orgs","repos_url":"https://api.github.com/users/jbruckne/repos","events_url":"https://api.github.com/users/jbruckne/events{/privacy}","received_events_url":"https://api.github.com/users/jbruckne/received_events","type":"User","site_admin":false},"labels":[{"id":34328464,"url":"https://api.github.com/repos/appium/appium/labels/Android","name":"Android","color":"ADFF2F","default":false},{"id":24368806,"url":"https://api.github.com/repos/appium/appium/labels/Bug","name":"Bug","color":"fc2929","default":false},{"id":647299772,"url":"https://api.github.com/repos/appium/appium/labels/P0","name":"P0","color":"b60205","default":false}],"state":"open","locked":false,"assignee":{"login":"imurchie","id":2614354,"avatar_url":"https://avatars2.githubusercontent.com/u/2614354?v=4","gravatar_id":"","url":"https://api.github.com/users/imurchie","html_url":"https://github.com/imurchie","followers_url":"https://api.github.com/users/imurchie/followers","following_url":"https://api.github.com/users/imurchie/following{/other_user}","gists_url":"https://api.github.com/users/imurchie/gists{/gist_id}","starred_url":"https://api.github.com/users/imurchie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imurchie/subscriptions","organizations_url":"https://api.github.com/users/imurchie/orgs","repos_url":"https://api.github.com/users/imurchie/repos","events_url":"https://api.github.com/users/imurchie/events{/privacy}","received_events_url":"https://api.github.com/users/imurchie/received_events","type":"User","site_admin":false},"assignees":[{"login":"imurchie","id":2614354,"avatar_url":"https://avatars2.githubusercontent.com/u/2614354?v=4","gravatar_id":"","url":"https://api.github.com/users/imurchie","html_url":"https://github.com/imurchie","followers_url":"https://api.github.com/users/imurchie/followers","following_url":"https://api.github.com/users/imurchie/following{/other_user}","gists_url":"https://api.github.com/users/imurchie/gists{/gist_id}","starred_url":"https://api.github.com/users/imurchie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imurchie/subscriptions","organizations_url":"https://api.github.com/users/imurchie/orgs","repos_url":"https://api.github.com/users/imurchie/repos","events_url":"https://api.github.com/users/imurchie/events{/privacy}","received_events_url":"https://api.github.com/users/imurchie/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/appium/appium/milestones/42","html_url":"https://github.com/appium/appium/milestone/42","labels_url":"https://api.github.com/repos/appium/appium/milestones/42/labels","id":2758070,"number":42,"title":"Chibii Robot 16 [Sprint 16]","description":"","creator":{"login":"jlipps","id":605053,"avatar_url":"https://avatars3.githubusercontent.com/u/605053?v=4","gravatar_id":"","url":"https://api.github.com/users/jlipps","html_url":"https://github.com/jlipps","followers_url":"https://api.github.com/users/jlipps/followers","following_url":"https://api.github.com/users/jlipps/following{/other_user}","gists_url":"https://api.github.com/users/jlipps/gists{/gist_id}","starred_url":"https://api.github.com/users/jlipps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlipps/subscriptions","organizations_url":"https://api.github.com/users/jlipps/orgs","repos_url":"https://api.github.com/users/jlipps/repos","events_url":"https://api.github.com/users/jlipps/events{/privacy}","received_events_url":"https://api.github.com/users/jlipps/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":1,"state":"open","created_at":"2017-09-11T17:42:44Z","updated_at":"2017-09-13T15:32:32Z","due_on":"2017-09-22T07:00:00Z","closed_at":null},"comments":24,"created_at":"2017-08-01T18:59:00Z","updated_at":"2017-09-13T16:58:06Z","closed_at":null,"author_association":"NONE","body":"## The problem\r\n\r\nI have created a brand new empty android project and only added a WebView loading Amazon.com. All the test does is switch to the WebView context. This test works fine on Android 7.0 but hangs on Android O with the error message \"chrome not reachable\".\r\n\r\n## Environment\r\n\r\n* Appium version (or git revision) that exhibits the issue:\r\n1.6.5\r\n* Desktop OS/version used to run Appium: \r\nMacOS Sierra\r\n* Mobile platform/version under test: \r\nAndroid O beta 4\r\n* Real device or emulator/simulator: \r\nPixel XL\r\n* Appium CLI or Appium.app|exe: \r\nappium -a 127.0.0.1 -p 4723 --session-override --default-capabilities '{\"app\":\"/Users/jbruckn/AndroidStudioProjects/SimpleWebview/app/build/outputs/apk/app-debug.apk\",\"clearSystemFiles\":\"true\"}' --log-timestamp\r\n\r\n## Details\r\n\r\nThe android app is a brand new android project with this onCreate method in the MainActivity:\r\n```\r\n    @Override\r\n    protected void onCreate(Bundle savedInstanceState) {\r\n        super.onCreate(savedInstanceState);\r\n        WebView webview = new WebView(this);\r\n        setContentView(webview);\r\n\r\n        WebView.setWebContentsDebuggingEnabled(true);\r\n        webview.setWebViewClient(new WebViewClient());\r\n        webview.setEnabled(true);\r\n        webview.loadUrl(\"http://www.amazon.com\");\r\n    }\r\n```\r\n\r\nThe test to switch to webview context:\r\n```\r\n\r\npublic class SimpleTest {\r\n\r\n    protected AndroidDriver driver;\r\n\r\n    protected void prepareAndroidForAppium() throws MalformedURLException {\r\n        DesiredCapabilities capabilities = new DesiredCapabilities();\r\n        capabilities.setCapability(\"device\", \"Android\");\r\n        capabilities.setCapability(\"deviceName\", \"HT7150200171\");\r\n        //capabilities.setCapability(\"deviceName\", \"00eb9785375094e6\");\r\n        capabilities.setCapability(\"platformName\", \"Android\");\r\n        capabilities.setCapability(\"appPackage\", \"com.example.jbruckn.simplewebview\");\r\n        capabilities.setCapability(\"appActivity\", \"com.example.jbruckn.simplewebview.MainActivity\");\r\n        capabilities.setCapability(\"autoWebview\", \"true\");\r\n        driver = new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\r\n    }\r\n\r\n    @Test\r\n    public void test() throws MalformedURLException, InterruptedException {\r\n        prepareAndroidForAppium();\r\n\r\n        driver.context(driver.getContextHandles().toArray()[1].toString());\r\n    }\r\n\r\n}\r\n```\r\n\r\n## Link to Appium logs\r\n\r\nhttps://gist.github.com/jbruckne/3087a38fbb9a1e95c54ace809222c0a0\r\n\r\nEach time the following request is made for the context switch, it hangs for about half a minute.\r\n```\r\n[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {\"desiredCapabilities\":{\"chromeOptions\":{\"androidPackage\":\"com.example.jbruckn.simplewebview\",\"androidUseRunningApp\":true,\"androidDeviceSerial\":\"HT7150200171\"}}}\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/appium/appium/issues/comments/329231318","html_url":"https://github.com/appium/appium/issues/8958#issuecomment-329231318","issue_url":"https://api.github.com/repos/appium/appium/issues/8958","id":329231318,"user":{"login":"imurchie","id":2614354,"avatar_url":"https://avatars2.githubusercontent.com/u/2614354?v=4","gravatar_id":"","url":"https://api.github.com/users/imurchie","html_url":"https://github.com/imurchie","followers_url":"https://api.github.com/users/imurchie/followers","following_url":"https://api.github.com/users/imurchie/following{/other_user}","gists_url":"https://api.github.com/users/imurchie/gists{/gist_id}","starred_url":"https://api.github.com/users/imurchie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imurchie/subscriptions","organizations_url":"https://api.github.com/users/imurchie/orgs","repos_url":"https://api.github.com/users/imurchie/repos","events_url":"https://api.github.com/users/imurchie/events{/privacy}","received_events_url":"https://api.github.com/users/imurchie/received_events","type":"User","site_admin":false},"created_at":"2017-09-13T16:58:06Z","updated_at":"2017-09-13T16:58:06Z","author_association":"OWNER","body":"@yongchristophertang Please create a new issue with the full description including the _full_ logs. This issue is specifically about Android O."}}
{"actor":{"display_login":"imurchie"}}