{"action":"created","issue":{"url":"https://api.github.com/repos/appium/java-client/issues/188","labels_url":"https://api.github.com/repos/appium/java-client/issues/188/labels{/name}","comments_url":"https://api.github.com/repos/appium/java-client/issues/188/comments","events_url":"https://api.github.com/repos/appium/java-client/issues/188/events","html_url":"https://github.com/appium/java-client/issues/188","id":70235188,"number":188,"title":"getContextHandles method is not working with javaclient 2.2 with AndroidDriver class","user":{"login":"amitjaincoer191","id":7996111,"avatar_url":"https://avatars.githubusercontent.com/u/7996111?v=3","gravatar_id":"","url":"https://api.github.com/users/amitjaincoer191","html_url":"https://github.com/amitjaincoer191","followers_url":"https://api.github.com/users/amitjaincoer191/followers","following_url":"https://api.github.com/users/amitjaincoer191/following{/other_user}","gists_url":"https://api.github.com/users/amitjaincoer191/gists{/gist_id}","starred_url":"https://api.github.com/users/amitjaincoer191/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amitjaincoer191/subscriptions","organizations_url":"https://api.github.com/users/amitjaincoer191/orgs","repos_url":"https://api.github.com/users/amitjaincoer191/repos","events_url":"https://api.github.com/users/amitjaincoer191/events{/privacy}","received_events_url":"https://api.github.com/users/amitjaincoer191/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/appium/java-client/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-04-22T21:08:02Z","updated_at":"2015-06-04T06:28:44Z","closed_at":"2015-06-04T06:28:44Z","body":"Relation between classes are as follows \r\njava.lang.Object > org.openqa.selenium.remote.RemoteWebDriver > io.appium.java_client.AppiumDriver > io.appium.java_client.android.AndroidDriver\r\n\r\n\t\tDesiredCapabilities capabilities = new DesiredCapabilities();   \t\t\t\t \r\n\t\tcapabilities.setCapability(MobileCapabilityType.LAUNCH_TIMEOUT,\"300000\"); \r\n\t\tcapabilities.setCapability(CapabilityType.BROWSER_NAME,\"\");\r\n\t\tcapabilities.setCapability(\"deviceName\",\"ZX1B32HNBD\");\r\n\t\tcapabilities.setCapability(\"deviceName\",\"0a3f3878\");\r\n\t\t//capabilities.setCapability(\"platformVersion\",\"5.0.2\");\r\n\t\tcapabilities.setCapability(\"platformVersion\",\"4.4.4\");\r\n\t\tcapabilities.setCapability(\"platformName\",\"Android\");\r\n\t\tcapabilities.setCapability(\"appPackage\",\"air.com.wiziq.ipadvc\");\r\n\t\tcapabilities.setCapability(\"appActivity\",\".AppEntry\");\r\n\t\tdriver = new AndroidDriver(new URL(\"http://127.0.0.1:4725/wd/hub\"), capabilities);\r\n                driver.getContextHandles(); // no method in AndroidDriver class\r\n                \r\n                AppiumDriver appiumdriver = (AppiumDriver) driver;\r\n\t\tSet<String> availableContexts = appiumdriver.getContextHandles();\r\n\t\tfor(String context : availableContexts) {\r\n\t\t\tSystem.out.println(\"context : \" + appiumdriver.context(context) );\r\n\t\t}\r\n\r\nI am not able to get available contexts for my hybrid app, if I try to typecast driver handle to AppiumDriver from AndroidDriver, it provides incorrect results like as shown below\r\n\r\ncontext : AndroidDriver:  on LINUX (71cf1d2c-8683-4e0b-b081-21de94605cde)\r\n\r\nalthough app has webview context with class android.webkit.WebView where i need to enter login and password\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/appium/java-client/issues/comments/108749013","html_url":"https://github.com/appium/java-client/issues/188#issuecomment-108749013","issue_url":"https://api.github.com/repos/appium/java-client/issues/188","id":108749013,"user":{"login":"amitjaincoer191","id":7996111,"avatar_url":"https://avatars.githubusercontent.com/u/7996111?v=3","gravatar_id":"","url":"https://api.github.com/users/amitjaincoer191","html_url":"https://github.com/amitjaincoer191","followers_url":"https://api.github.com/users/amitjaincoer191/followers","following_url":"https://api.github.com/users/amitjaincoer191/following{/other_user}","gists_url":"https://api.github.com/users/amitjaincoer191/gists{/gist_id}","starred_url":"https://api.github.com/users/amitjaincoer191/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amitjaincoer191/subscriptions","organizations_url":"https://api.github.com/users/amitjaincoer191/orgs","repos_url":"https://api.github.com/users/amitjaincoer191/repos","events_url":"https://api.github.com/users/amitjaincoer191/events{/privacy}","received_events_url":"https://api.github.com/users/amitjaincoer191/received_events","type":"User","site_admin":false},"created_at":"2015-06-04T06:28:44Z","updated_at":"2015-06-04T06:28:44Z","body":"I would like to close this issue as I am able to find contexts\r\n\r\nIssue was with chromedriver to be updated in appium folder\r\n\r\nI would like to thank all for your kind support and bearing with this bug"}}