{"action":"created","issue":{"url":"https://api.github.com/repos/appium/appium/issues/7205","repository_url":"https://api.github.com/repos/appium/appium","labels_url":"https://api.github.com/repos/appium/appium/issues/7205/labels{/name}","comments_url":"https://api.github.com/repos/appium/appium/issues/7205/comments","events_url":"https://api.github.com/repos/appium/appium/issues/7205/events","html_url":"https://github.com/appium/appium/issues/7205","id":188272606,"number":7205,"title":"Appium 1.4.16 (Windows) + android emulator : unable to find elements","user":{"login":"Harmo80","id":4331345,"avatar_url":"https://avatars.githubusercontent.com/u/4331345?v=3","gravatar_id":"","url":"https://api.github.com/users/Harmo80","html_url":"https://github.com/Harmo80","followers_url":"https://api.github.com/users/Harmo80/followers","following_url":"https://api.github.com/users/Harmo80/following{/other_user}","gists_url":"https://api.github.com/users/Harmo80/gists{/gist_id}","starred_url":"https://api.github.com/users/Harmo80/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Harmo80/subscriptions","organizations_url":"https://api.github.com/users/Harmo80/orgs","repos_url":"https://api.github.com/users/Harmo80/repos","events_url":"https://api.github.com/users/Harmo80/events{/privacy}","received_events_url":"https://api.github.com/users/Harmo80/received_events","type":"User","site_admin":false},"labels":[{"id":143265062,"url":"https://api.github.com/repos/appium/appium/labels/NeedsTriage","name":"NeedsTriage","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-09T15:19:14Z","updated_at":"2016-11-09T15:44:25Z","closed_at":null,"body":"## The problem\r\n\r\nI tried to findElement on a android hybrid application (ionic), but it doesn't work. I want to launch an android app and doing action with Appium. The app start very well, but I'm unable to find any element. \r\nI tried some elements, like : \r\n\r\n```\r\nWebElement elem = driver.findElement(By.xpath(\"//android.view.View/android.view.View/android.widget.CheckBox[1]\")); \r\nWebElement elem = driver.findElement(By.xpath(\"//android.view.View[0]\"));\r\nWebElement elem = driver.findElement(By.xpath(\"//android.view.View/*[@resource-id='usernameId']\"));\r\nor\r\nWebElement elem = driver.findElement(By.xpath(\"//*[@resource-id='usernameId']\"));\r\n```\r\n\r\nNothing works. :( \r\nI think my xpath is correct... \r\nHere's a screenshot of one of the element i wanna to find : (usernameId) \r\nhttps://i.gyazo.com/ca3508201eed91fbb83f57871af0134c.png\r\nAs you see, the element's resource-id is \"usernameId\" without package. \r\n\r\n## Environment\r\n\r\n* Appium version (or git revision) that exhibits the issue: 1.4.16 but same with 1.6 on Ubuntu. \r\n* Desktop OS/version used to run Appium: Windows / Linux\r\n* Real device or emulator/simulator: Emulator / AVD\r\n* Appium CLI or Appium.app|exe: exe in windows, CLI on Ubuntu. \r\n\r\n## Details\r\n\r\nJava Error : \r\n```\r\nException in thread \"main\" org.openqa.selenium.NoSuchElementException: An element could not be located on the page using the given search parameters. (WARNING: The server did not provide any stacktrace information)\r\nCommand duration or timeout: 21.97 seconds\r\nFor documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html\r\nBuild info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'\r\nSystem info: host: 'Maxime-PC', ip: '192.168.10.72', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_25'\r\nDriver info: io.appium.java_client.android.AndroidDriver\r\nCapabilities [{app=C:\\weaselselenium\\app.apk, appPackage=com.ionicframework.feessolutions151197, networkConnectionEnabled=true, recreateChromeDriverSessions=true, warnings={}, databaseEnabled=false, deviceName=emulator-5554, version=4.1.2, platform=ANDROID, appActivity=com.ionicframework.feessolutions151197.MainActivity, desired={app=C:\\weaselselenium\\app.apk, appPackage=com.ionicframework.feessolutions151197, appActivity=com.ionicframework.feessolutions151197.MainActivity, recreateChromeDriverSessions=true, browserName=Android, takesScreenshot=true, platformName=Android, deviceName=DeviceTest, version=4.1.2, platform=ANDROID}, platformVersion=5.0.1, webStorageEnabled=false, locationContextEnabled=false, browserName=Android, takesScreenshot=true, javascriptEnabled=true, platformName=Android}]\r\nSession ID: 252f7e0a-4d1f-4dc1-a13e-96a1c3c0d2cc\r\n*** Element info: {Using=xpath, value=//android.view.View[0]}\r\n```\r\n\r\n## Appium logs\r\n\r\n```\r\n> info: --> POST /wd/hub/session/252f7e0a-4d1f-4dc1-a13e-96a1c3c0d2cc/element {\"using\":\"xpath\",\"value\":\"//android.view.View[0]\"}\r\n> info: [debug] Waiting up to 0ms for condition\r\n> info: [debug] Pushing command to appium work queue: [\"find\",{\"strategy\":\"xpath\",\"selector\":\"//android.view.View[0]\",\"context\":\"\",\"multiple\":false}]\r\n> info: [debug] [BOOTSTRAP] [debug] Got data from client: {\"cmd\":\"action\",\"action\":\"find\",\"params\":{\"strategy\":\"xpath\",\"selector\":\"//android.view.View[0]\",\"context\":\"\",\"multiple\":false}}\r\n> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION\r\n> info: [debug] [BOOTSTRAP] [debug] Got command action: find\r\n> info: [debug] [BOOTSTRAP] [debug] Finding //android.view.View[0] using XPATH with the contextId:  multiple: false\r\n> info: [debug] [BOOTSTRAP] [debug] Returning result: {\"status\":7,\"value\":\"Could not find an element using supplied strategy. \"}\r\n> info: [debug] Condition unmet after 21957ms. Timing out.\r\n> info: [debug] Responding to client with error: {\"status\":7,\"value\":{\"message\":\"An element could not be located on the page using the given search parameters.\",\"origValue\":\"Could not find an element using supplied strategy. \"},\"sessionId\":\"252f7e0a-4d1f-4dc1-a13e-96a1c3c0d2cc\"}\r\n```\r\n\r\nAny ideas ? "},"comment":{"url":"https://api.github.com/repos/appium/appium/issues/comments/259445803","html_url":"https://github.com/appium/appium/issues/7205#issuecomment-259445803","issue_url":"https://api.github.com/repos/appium/appium/issues/7205","id":259445803,"user":{"login":"mykola-mokhnach","id":7767781,"avatar_url":"https://avatars.githubusercontent.com/u/7767781?v=3","gravatar_id":"","url":"https://api.github.com/users/mykola-mokhnach","html_url":"https://github.com/mykola-mokhnach","followers_url":"https://api.github.com/users/mykola-mokhnach/followers","following_url":"https://api.github.com/users/mykola-mokhnach/following{/other_user}","gists_url":"https://api.github.com/users/mykola-mokhnach/gists{/gist_id}","starred_url":"https://api.github.com/users/mykola-mokhnach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mykola-mokhnach/subscriptions","organizations_url":"https://api.github.com/users/mykola-mokhnach/orgs","repos_url":"https://api.github.com/users/mykola-mokhnach/repos","events_url":"https://api.github.com/users/mykola-mokhnach/events{/privacy}","received_events_url":"https://api.github.com/users/mykola-mokhnach/received_events","type":"User","site_admin":false},"created_at":"2016-11-09T15:44:25Z","updated_at":"2016-11-09T15:44:25Z","body":"Elements indexing in XPath queries starts from 1.\r\nUse _getPageSource()_ call to see the actual xml tree visible to Appium and get attribute names there."}}
{"actor":{"display_login":"mykola-mokhnach"}}