{"action":"created","issue":{"url":"https://api.github.com/repos/appium/appium/issues/10703","repository_url":"https://api.github.com/repos/appium/appium","labels_url":"https://api.github.com/repos/appium/appium/issues/10703/labels{/name}","comments_url":"https://api.github.com/repos/appium/appium/issues/10703/comments","events_url":"https://api.github.com/repos/appium/appium/issues/10703/events","html_url":"https://github.com/appium/appium/issues/10703","id":324052573,"number":10703,"title":"Element getText hanging on Android regularly with Appium 1.8 (and Grid)","user":{"login":"bennid","id":502340,"avatar_url":"https://avatars1.githubusercontent.com/u/502340?v=4","gravatar_id":"","url":"https://api.github.com/users/bennid","html_url":"https://github.com/bennid","followers_url":"https://api.github.com/users/bennid/followers","following_url":"https://api.github.com/users/bennid/following{/other_user}","gists_url":"https://api.github.com/users/bennid/gists{/gist_id}","starred_url":"https://api.github.com/users/bennid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bennid/subscriptions","organizations_url":"https://api.github.com/users/bennid/orgs","repos_url":"https://api.github.com/users/bennid/repos","events_url":"https://api.github.com/users/bennid/events{/privacy}","received_events_url":"https://api.github.com/users/bennid/received_events","type":"User","site_admin":false},"labels":[{"id":24368806,"url":"https://api.github.com/repos/appium/appium/labels/Bug","name":"Bug","color":"fc2929","default":false},{"id":467930958,"url":"https://api.github.com/repos/appium/appium/labels/UIAutomator2","name":"UIAutomator2","color":"1d76db","default":false}],"state":"open","locked":false,"assignee":{"login":"dpgraham","id":852574,"avatar_url":"https://avatars2.githubusercontent.com/u/852574?v=4","gravatar_id":"","url":"https://api.github.com/users/dpgraham","html_url":"https://github.com/dpgraham","followers_url":"https://api.github.com/users/dpgraham/followers","following_url":"https://api.github.com/users/dpgraham/following{/other_user}","gists_url":"https://api.github.com/users/dpgraham/gists{/gist_id}","starred_url":"https://api.github.com/users/dpgraham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpgraham/subscriptions","organizations_url":"https://api.github.com/users/dpgraham/orgs","repos_url":"https://api.github.com/users/dpgraham/repos","events_url":"https://api.github.com/users/dpgraham/events{/privacy}","received_events_url":"https://api.github.com/users/dpgraham/received_events","type":"User","site_admin":false},"assignees":[{"login":"dpgraham","id":852574,"avatar_url":"https://avatars2.githubusercontent.com/u/852574?v=4","gravatar_id":"","url":"https://api.github.com/users/dpgraham","html_url":"https://github.com/dpgraham","followers_url":"https://api.github.com/users/dpgraham/followers","following_url":"https://api.github.com/users/dpgraham/following{/other_user}","gists_url":"https://api.github.com/users/dpgraham/gists{/gist_id}","starred_url":"https://api.github.com/users/dpgraham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpgraham/subscriptions","organizations_url":"https://api.github.com/users/dpgraham/orgs","repos_url":"https://api.github.com/users/dpgraham/repos","events_url":"https://api.github.com/users/dpgraham/events{/privacy}","received_events_url":"https://api.github.com/users/dpgraham/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/appium/appium/milestones/53","html_url":"https://github.com/appium/appium/milestone/53","labels_url":"https://api.github.com/repos/appium/appium/milestones/53/labels","id":3345240,"number":53,"title":"Robot 27","description":"","creator":{"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},"open_issues":8,"closed_issues":4,"state":"open","created_at":"2018-05-14T16:01:26Z","updated_at":"2018-05-25T15:12:45Z","due_on":"2018-06-01T07:00:00Z","closed_at":null},"comments":24,"created_at":"2018-05-17T14:38:05Z","updated_at":"2018-05-29T06:13:47Z","closed_at":null,"author_association":"NONE","body":"## The problem\r\n\r\nGetting a list of text elements, then looping through and getting the text for each regularly hangs (sometimes on the first, sometimes on the fifth, sometimes further down.  At initial looks at the logs, it appears to happen when a hub \"getStatus()\" is called in the middle of getText() call.  I'm going to try this without the phone/emulator being in the grid as well\r\n\r\n## Environment\r\n\r\n* Appium version (or git revision) that exhibits the issue:  1.8\r\n* Last Appium version that did not exhibit the issue (if applicable): 1.7.2\r\n* Desktop OS/version used to run Appium: OSX 10.13.4\r\n* Node.js version (unless using Appium.app|exe): 8.11.1\r\n* Mobile platform/version under test: Android 5.1 and Android 6.0\r\n* Real device or emulator/simulator: Emulator @ 5.1, Nexus 5X @ 6.0\r\n* Appium CLI or Appium.app|exe: appium cli\r\n* Appium Client: Java Client 6.0.0-BETA5\r\n\r\n## Details\r\n\r\nI have a wrapper around all appium calls to make sure the calls don't hang, which is why the GET request hangs up at the end, without it appium wasn't even honoring the 45 second newCommandTimeout I set.  The ...SNIP... section is just Selenium Grid keepalives.\r\n\r\n```\r\n2018-05-17 13:45:49:928 - [debug] [JSONWP Proxy] Proxying [POST /elements] to [POST http://localhost:7773/wd/hub/session/8b1c4b67-e811-4d30-8d74-e68319d265c2/elements] with body: {\"strategy\":\"id\",\"selector\":\"my.app.package:id/use_id\",\"context\":\"\",\"multiple\":true}\r\n2018-05-17 13:45:49:970 - [debug] [JSONWP Proxy] Got response with status 200: {\"sessionId\":\"8b1c4b67-e811-4d30-8d74-e68319d265c2\",\"status\":0,\"value\":[{\"ELEMENT\":\"c338518f-adb9-406d-990d-36b20cfb4380\"},{\"ELEMENT\":\"b0cf120c-294a-4635-b424-f7e04814cb54\"},{\"ELE\r\nMENT\":\"d5925d31-0408-4ed6-8cd7-34187bfdc7a0\"},{\"ELEMENT\":\"4fd3fd7c-c865-4d8c-8fbd-c32b20579090\"},{\"ELEMENT\":\"8a2e1729-4396-4f3c-a542-666979ef535c\"},{\"ELEMENT\":\"89c02a25-a188-4723-b966-55b64e3a6876\"},{\"ELEMENT\":\"ffa29001-62b4-49df-bd0c-a800bc354061\"}]}\r\n2018-05-17 13:45:49:971 - [debug] [W3C] Responding to client with driver.findElements() result: [{\"ELEMENT\":\"c338518f-adb9-406d-990d-36b20cfb4380\"},{\"ELEMENT\":\"b0cf120c-294a-4635-b424-f7e04814cb54\"},{\"ELEMENT\":\"d5925d31-0408-4ed6-8cd7-34187bfdc7a0\"},{\"ELEMEN\r\nT\":\"4fd3fd7c-c865-4d8c-8fbd-c32b20579090\"},{\"ELEMENT\":\"8a2e1729-4396-4f3c-a542-666979ef535c\"},{\"ELEMENT\":\"89c02a25-a188-4723-b966-55b64e3a6876\"},{\"ELEMENT\":\"ffa29001-62b4-49df-bd0c-a800bc354061\"}]\r\n2018-05-17 13:45:49:972 - [HTTP] <-- POST /wd/hub/session/d451b3cf-4048-4e70-9ef7-21a66b20b559/elements 200 47 ms - 430\r\n2018-05-17 13:45:49:972 - [HTTP] \r\n2018-05-17 13:45:49:978 - [HTTP] --> GET /wd/hub/session/d451b3cf-4048-4e70-9ef7-21a66b20b559/element/c338518f-adb9-406d-990d-36b20cfb4380/text\r\n2018-05-17 13:45:49:978 - [HTTP] {}\r\n2018-05-17 13:45:49:979 - [W3C] Driver proxy active, passing request on via HTTP proxy\r\n2018-05-17 13:45:49:979 - [debug] [JSONWP Proxy] Proxying [GET /wd/hub/session/d451b3cf-4048-4e70-9ef7-21a66b20b559/element/c338518f-adb9-406d-990d-36b20cfb4380/text] to [GET http://localhost:7773/wd/hub/session/8b1c4b67-e811-4d30-8d74-e68319d265c2/element/c\r\n338518f-adb9-406d-990d-36b20cfb4380/text] with body: {}\r\n2018-05-17 13:45:50:020 - [debug] [JSONWP Proxy] Got response with status 200: \"{\\\"sessionId\\\":\\\"8b1c4b67-e811-4d30-8d74-e68319d265c2\\\",\\\"status\\\":0,\\\"value\\\":\\\"15 mins ago\\\"}\"\r\n2018-05-17 13:45:50:021 - [JSONWP Proxy] Replacing sessionId 8b1c4b67-e811-4d30-8d74-e68319d265c2 with d451b3cf-4048-4e70-9ef7-21a66b20b559\r\n2018-05-17 13:45:50:021 - [HTTP] <-- GET /wd/hub/session/d451b3cf-4048-4e70-9ef7-21a66b20b559/element/c338518f-adb9-406d-990d-36b20cfb4380/text 200 42 ms - 85\r\n2018-05-17 13:45:50:022 - [HTTP] \r\n2018-05-17 13:45:50:027 - [HTTP] --> GET /wd/hub/session/d451b3cf-4048-4e70-9ef7-21a66b20b559/element/b0cf120c-294a-4635-b424-f7e04814cb54/text\r\n2018-05-17 13:45:50:027 - [HTTP] {}\r\n2018-05-17 13:45:50:027 - [W3C] Driver proxy active, passing request on via HTTP proxy\r\n2018-05-17 13:45:50:028 - [debug] [JSONWP Proxy] Proxying [GET /wd/hub/session/d451b3cf-4048-4e70-9ef7-21a66b20b559/element/b0cf120c-294a-4635-b424-f7e04814cb54/text] to [GET http://localhost:7773/wd/hub/session/8b1c4b67-e811-4d30-8d74-e68319d265c2/element/b\r\n0cf120c-294a-4635-b424-f7e04814cb54/text] with body: {}\r\n2018-05-17 13:45:53:251 - [HTTP] --> GET /wd/hub/status\r\n2018-05-17 13:45:53:251 - [HTTP] {}\r\n2018-05-17 13:45:53:252 - [debug] [W3C] Calling AppiumDriver.getStatus() with args: []\r\n2018-05-17 13:45:53:262 - [debug] [W3C] Responding to client with driver.getStatus() result: {\"build\":{\"version\":\"1.8.0\",\"revision\":null}}\r\n2018-05-17 13:45:53:264 - [HTTP] <-- GET /wd/hub/status 200 11 ms - 55\r\n2018-05-17 13:45:53:264 - [HTTP] \r\n2018-05-17 13:45:58:271 - [HTTP] --> GET /wd/hub/status\r\n2018-05-17 13:45:58:273 - [HTTP] {}\r\n2018-05-17 13:45:58:273 - [debug] [W3C] Calling AppiumDriver.getStatus() with args: []\r\n2018-05-17 13:45:58:285 - [debug] [W3C] Responding to client with driver.getStatus() result: {\"build\":{\"version\":\"1.8.0\",\"revision\":null}}\r\n2018-05-17 13:45:58:286 - [HTTP] <-- GET /wd/hub/status 200 15 ms - 55\r\n2018-05-17 13:45:58:286 - [HTTP] \r\n2018-05-17 13:46:03:292 - [HTTP] --> GET /wd/hub/status\r\n2018-05-17 13:46:03:292 - [HTTP] {}\r\n2018-05-17 13:46:03:292 - [debug] [W3C] Calling AppiumDriver.getStatus() with args: []\r\n2018-05-17 13:46:03:301 - [debug] [W3C] Responding to client with driver.getStatus() result: {\"build\":{\"version\":\"1.8.0\",\"revision\":null}}\r\n2018-05-17 13:46:03:302 - [HTTP] <-- GET /wd/hub/status 200 9 ms - 55\r\n2018-05-17 13:46:03:302 - [HTTP] \r\n... SNIP ...\r\n2018-05-17 13:47:48:694 - [HTTP] --> GET /wd/hub/status\r\n2018-05-17 13:47:48:694 - [HTTP] {}\r\n2018-05-17 13:47:48:694 - [debug] [W3C] Calling AppiumDriver.getStatus() with args: []\r\n2018-05-17 13:47:48:704 - [debug] [W3C] Responding to client with driver.getStatus() result: {\"build\":{\"version\":\"1.8.0\",\"revision\":null}}\r\n2018-05-17 13:47:48:705 - [HTTP] <-- GET /wd/hub/status 200 11 ms - 55\r\n2018-05-17 13:47:48:705 - [HTTP] \r\n2018-05-17 13:47:50:025 - [HTTP] <-- GET /wd/hub/session/d451b3cf-4048-4e70-9ef7-21a66b20b559/element/b0cf120c-294a-4635-b424-f7e04814cb54/text - - ms - -\r\n```\r\n\r\n## Link to Appium logs\r\n\r\nhttps://gist.github.com/bennid/0b5d9fbd6040ec486a6446e7a7c0d9fa\r\n\r\n## Code To Reproduce Issue [ Good To Have ]\r\n\r\n```\r\n        Dimension screenSize = appiumDriver.manage().window().getSize();\r\n        int useX = screenSize.width / 2;\r\n        int startY = screenSize.height / 3;\r\n        int endY = screenSize.height * 2 / 3;\r\n        Duration duration = Duration.ofMillis(500);\r\n\r\n        for (int i = 0; i < 10; i++) {\r\n            List<MobileElement> elements = appiumDriver.findElements(By.id(\"my.company.android.my.app.debug:id:id/inbox_message_timestamp\"));\r\n            List<String> texts = elements.stream().map(MobileElement::getText).collect(Collectors.toList());\r\n            System.out.println(\"Text values: \" + StringUtils.join(texts, \",\"));\r\n            new TouchAction(appiumDriver)\r\n                            .press(PointOption.point(useX, startY))\r\n                            .waitAction(WaitOptions.waitOptions(duration))\r\n                            .moveTo(PointOption.point(useX, endY))\r\n                            .release()\r\n                            .perform();\r\n        }\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/appium/appium/issues/comments/392663618","html_url":"https://github.com/appium/appium/issues/10703#issuecomment-392663618","issue_url":"https://api.github.com/repos/appium/appium/issues/10703","id":392663618,"user":{"login":"mykola-mokhnach","id":7767781,"avatar_url":"https://avatars1.githubusercontent.com/u/7767781?v=4","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":"2018-05-29T06:13:47Z","updated_at":"2018-05-29T06:13:47Z","author_association":"COLLABORATOR","body":"@bennid Are you sure that both Selenium API and Java client are up to date?"}}
{"actor":{"display_login":"mykola-mokhnach"}}