Skip to content
This repository has been archived by the owner on Dec 26, 2019. It is now read-only.

Find elements calls and getPageSource() take too long, does not return elements on pages with many UI elements #1131

Open
joshua-strickland opened this issue Jul 23, 2019 · 2 comments

Comments

@joshua-strickland
Copy link

joshua-strickland commented Jul 23, 2019

Overview

I am running into issues using findElements() calls and getPageSource() using appium on pages with many UI elements. Pages with few UI elements do not present any problems. Unfortunately not being able to use findElements() prevents automation on these pages so this is a large problem.

I believe these issues are both related to WDA not being able to search through the element tree efficiently enough. I've noticed that the phone becomes unresponsive for at least few seconds while these calls are occurring. The phone also becomes incredibly hot. This leads me to believe it is possible that there is a performance problem behind the scenes causing these calls to take too long or just outright fail.

I am using exclusively accessibility ids, so selection strategy should not be a culprit.

I'm using an iOS 12.1 iPhone 7.
Appium version: 1.12.1
xcode version 10.2

The app is cross platform (built with xamarin). I do not experience any issues on the android side, which leads me to suspect appium itself is working fine.

GetPageSource issues

appium server logs
Here are the appium server logs after a failed getPageSource() call.

It's worth mentioning I am using the getJSONSource capability to try and get this to succeed.

[W3C (0856a383)] Calling AppiumDriver.getPageSource() with args: ["0856a383-6d22-4b82-a0c3-29cd01774fdd"]
[XCUITest] Executing command 'getPageSource'
[WD Proxy] Matched '/source?format=json' to command name 'getPageSource'
[WD Proxy] Proxying [GET /source?format=json] to [GET http://localhost:8100/session/D71102A1-7A10-48C4-91D8-A26FCE6B46CF/source?format=json] with no body
[Xcode] t = 3960.46s Find the Application 'com.foresee.ForeSeeCx'
[Xcode]
[Xcode] t = 3960.47s Snapshot accessibility hierarchy for app with pid 488
[Xcode]
[Xcode] t = 3976.49s Find the Application 'com.foresee.ForeSeeCx' (retry 1)
[Xcode] t = 3976.49s Snapshot accessibility hierarchy for app with pid 488
[Xcode]
[Xcode] t = 3992.51s Find the Application 'com.foresee.ForeSeeCx' (retry 2)
[Xcode] t = 3992.51s Snapshot accessibility hierarchy for app with pid 488
[Xcode]
[Xcode] 2019-07-23 16:43:00.901449+0100 WebDriverAgentRunner-Runner[413:48093] Enqueue Failure: Error kAXErrorIPCTimeout getting snapshot for element {pid=488} {uid=[ID:1 hash:0x0]} /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgentRunner/UITestingUITests.m 37 1
[Xcode]
[Xcode] 2019-07-23 16:43:08.977816+0100 WebDriverAgentRunner-Runner[413:48093] Getting the snapshot timed out after 15 seconds
[Xcode] 2019-07-23 16:43:08.977944+0100 WebDriverAgentRunner-Runner[413:48093] Internal error: Error Domain=com.apple.dt.xctest.automation-support.error Code=8 "Error getting main window kAXErrorCannotComplete" UserInfo={NSLocalizedDescription=Error getting main window kAXErrorCannotComplete}
[Xcode]
[Xcode] t = 4015.61s Snapshot accessibility hierarchy for app with pid 488
[Xcode]
[WD Proxy] Got response with status 200: "{\n "value" : {\n "rawIdentifier" : null,\n "isVisible" : "0",\n "frame" : "{{0, 0}, {0, 0}}",\n "value" : null,\n "label" : null,\n "type" : "Any",\n "name" : null,\n "isEnabled" : "0"\n },\n "sessionId" : "D71102A1-7A10-48C4-91D8-A26FCE6B46CF",\n "status" : 0\n}"
[XCUITest] Connection to WDA timed out
[iProxy] recv failed: Operation not permitted
[W3C (0856a383)] Responding to client with driver.getPageSource() result: "\n\n \n \n"
[HTTP] <-- GET /wd/hub/session/0856a383-6d22-4b82-a0c3-29cd01774fdd/source 200 55274 ms - 231
[HTTP]
[HTTP] --> DELETE /wd/hub/session/0856a383-6d22-4b82-a0c3-29cd01774fdd
[HTTP] {}
[W3C (0856a383)] Calling AppiumDriver.deleteSession() with args: ["0856a383-6d22-4b82-a0c3-29cd01774fdd"]
[BaseDriver] Event 'quitSessionRequested' logged at 1563896589502 (11:43:09 GMT-0400 (EDT))
[Appium] Removing session 0856a383-6d22-4b82-a0c3-29cd01774fdd from our master session list
[WD Proxy] Matched '/session/0856a383-6d22-4b82-a0c3-29cd01774fdd' to command name 'deleteSession'
[WD Proxy] Proxying [DELETE /session/0856a383-6d22-4b82-a0c3-29cd01774fdd] to [DELETE http://localhost:8100/session/D71102A1-7A10-48C4-91D8-A26FCE6B46CF] with no body
[Xcode] t = 4016.11s Terminate com.foresee.ForeSeeCx:488
[Xcode]
[WD Proxy] Got response with status 200: "{\n "value" : {\n\n },\n "sessionId" : "D5163A79-9DD1-473A-AC78-56EB81D9B44F",\n "status" : 0\n}"
[XCUITest] Not clearing log files. Use clearSystemFiles capability to turn on.
[iOSLog] Stopping iOS log capture
[XCUITest] Connection to WDA timed out
[iProxy] recv failed: Operation not permitted
[BaseDriver] Event 'quitSessionFinished' logged at 1563896590543 (11:43:10 GMT-0400 (EDT))
[W3C (0856a383)] Received response: null
[W3C (0856a383)] But deleting session, so not returning
[W3C (0856a383)] Responding to client with driver.deleteSession() result: null
[HTTP] <-- DELETE /wd/hub/session/0856a383-6d22-4b82-a0c3-29cd01774fdd 200 1042 ms - 14
[HTTP]

Which seems to be throwing some WDA errors.

appium client logs
And here are the appium client logs for the same failed getPageSource() call.

FINE: Executing: getPageSource [0856a383-6d22-4b82-a0c3-29cd01774fdd, getPageSource {}] Jul 23, 2019 11:43:09 AM org.openqa.selenium.remote.http.W3CHttpResponseCodec decode

`

FINE: Decoding response. Response code was: 200 and content: {"value":"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<AppiumAUT>\n <XCUIElementTypeAny type=\"XCUIElementTypeAny\" enabled=\"false\" visible=\"false\" x=\"\" y=\"\" width=\"\" height=\"\">\n \n"}

Jul 23, 2019 11:43:09 AM org.openqa.selenium.remote.RemoteWebDriver log
FINE: Executed: [0856a383-6d22-4b82-a0c3-29cd01774fdd, getPageSource {}]


`

It seems that the call is returned but with an inaccurate page source XML tree. As you can see, the tree reported by appium is too small, and barely contains anything.

Find Elements issues

find elements calls also appear to be timing out.

Appium server logs
[XCUITest] Executing command 'findElements'
[BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id
[BaseDriver] Waiting up to 15000 ms for condition
[WD Proxy] Matched '/elements' to command name 'findElements'
[WD Proxy] Proxying [POST /elements] to [POST http://localhost:8100/session/8BE7E006-AB8E-46E2-8E2F-D7E2F7DB4DD5/elements] with body: {"using":"accessibility id","value":"vocFeed-Respondent-Cell"}
[Xcode] t = 4784.72s Find the Application 'com.foresee.ForeSeeCx'
[Xcode] t = 4784.72s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4784.83s Get all elements bound by accessibility element for: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 4784.83s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4784.88s Find: Descendants matching type Any
[Xcode] t = 4784.88s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[XCUITest] Connection to WDA timed out
[iProxy] recv failed: Operation not permitted
[WD Proxy] Got response with status 200: {"value":[],"sessionId":"8BE7E006-AB8E-46E2-8E2F-D7E2F7DB4DD5","status":0}
[BaseDriver] Waited for 239 ms so far
[WD Proxy] Matched '/elements' to command name 'findElements'
[WD Proxy] Proxying [POST /elements] to [POST http://localhost:8100/session/8BE7E006-AB8E-46E2-8E2F-D7E2F7DB4DD5/elements] with body: {"using":"accessibility id","value":"vocFeed-Respondent-Cell"}
[Xcode] t = 4785.57s Find the Application 'com.foresee.ForeSeeCx'
[Xcode]
[Xcode] t = 4785.57s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4786.16s Get all elements bound by accessibility element for: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode] t = 4786.16s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4787.40s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 4787.41s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 4787.43s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode]
[Xcode] t = 4787.43s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4788.54s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 4788.55s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 4788.55s Find: Identity Binding
[Xcode]
[Xcode] t = 4788.56s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode]
[Xcode] t = 4788.56s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4791.01s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 4791.01s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 4791.03s Find: Identity Binding
[Xcode]
[Xcode] t = 4791.04s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode]
[Xcode] t = 4791.04s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4792.76s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 4792.76s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 4792.77s Find: Identity Binding
[Xcode]
[Xcode] t = 4792.78s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode]
[Xcode] t = 4792.78s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4796.25s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 4796.25s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 4796.28s Find: Identity Binding
[Xcode]
[Xcode] t = 4796.29s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode]
[Xcode] t = 4796.29s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4798.89s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 4798.90s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 4798.91s Find: Identity Binding
[Xcode]
[Xcode] t = 4798.92s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode]
[Xcode] t = 4798.92s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4803.55s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 4803.57s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 4803.60s Find: Identity Binding
[Xcode]
[Xcode] t = 4803.61s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode]
[Xcode] t = 4803.61s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4806.83s Find: Descendants matching type Any
[Xcode] t = 4806.84s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode] t = 4806.85s Find: Identity Binding
[Xcode] t = 4806.87s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode] t = 4806.87s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4810.48s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 4810.49s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 4810.51s Find: Identity Binding
[Xcode]
[Xcode] t = 4810.52s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode]
[Xcode] t = 4810.52s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4814.62s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 4814.63s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 4814.64s Find: Identity Binding
[Xcode]
[Xcode] t = 4814.66s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode]
[Xcode] t = 4814.66s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4819.37s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 4819.38s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 4819.40s Find: Identity Binding
[Xcode]
[Xcode] t = 4819.41s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode]
[Xcode] t = 4819.42s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4824.83s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 4824.85s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 4824.87s Find: Identity Binding
[Xcode]
[Xcode] t = 4824.89s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode]
[Xcode] t = 4824.89s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4830.87s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 4830.89s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 4830.91s Find: Identity Binding
[Xcode]
[Xcode] t = 4830.93s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode]
[Xcode] t = 4830.93s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4837.46s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 4837.48s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 4837.50s Find: Identity Binding
[Xcode]
[Xcode] t = 4837.53s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode]
[Xcode] t = 4837.53s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4844.62s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 4844.64s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 4844.66s Find: Identity Binding
[Xcode]
[Xcode] t = 4844.68s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode]
[Xcode] t = 4844.69s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4852.61s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 4852.64s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 4852.66s Find: Identity Binding
[Xcode]
[Xcode] t = 4852.69s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode]
[Xcode] t = 4852.69s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4860.92s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 4860.95s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 4860.97s Find: Identity Binding
[Xcode]
[Xcode] t = 4861.00s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode]
[Xcode] t = 4861.01s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4869.92s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 4869.95s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 4869.97s Find: Identity Binding
[Xcode]
[Xcode] t = 4870.01s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode]
[Xcode] t = 4870.01s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4879.91s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 4879.93s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 4879.96s Find: Identity Binding
[Xcode]
[Xcode] t = 4879.99s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode]
[Xcode] t = 4879.99s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4890.55s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 4890.58s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 4890.61s Find: Identity Binding
[Xcode]
[Xcode] t = 4890.65s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode] t = 4890.65s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4902.01s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 4902.05s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 4902.08s Find: Identity Binding
[Xcode]
[Xcode] t = 4902.13s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode]
[Xcode] t = 4902.13s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[HTTP] <-- POST /wd/hub/session/0991aeec-f7c8-43cf-93a5-6b6f2db220af/elements - - ms - -
[HTTP]
[HTTP] --> POST /wd/hub/session/0991aeec-f7c8-43cf-93a5-6b6f2db220af/elements
[HTTP] {"using":"accessibility id","value":"vocFeed-Respondent-Cell"}
[W3C (0991aeec)] Calling AppiumDriver.findElements() with args: ["accessibility id","vocFeed-Respondent-Cell","0991aeec-f7c8-43cf-93a5-6b6f2db220af"]
[XCUITest] Executing command 'findElements'
[Xcode] t = 4914.00s Find: Descendants matching type Any
[Xcode] t = 4914.04s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode] t = 4914.07s Find: Identity Binding
[Xcode] t = 4914.11s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode] t = 4914.12s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4926.51s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 4926.55s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 4926.58s Find: Identity Binding
[Xcode]
[Xcode] t = 4926.63s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode]
[Xcode] t = 4926.63s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4939.76s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 4939.80s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 4939.84s Find: Identity Binding
[Xcode]
[Xcode] t = 4939.89s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode]
[Xcode] t = 4939.89s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4953.58s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 4953.63s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 4953.66s Find: Identity Binding
[Xcode]
[Xcode] t = 4953.71s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode]
[Xcode] t = 4953.72s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4968.05s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 4968.10s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 4968.14s Find: Identity Binding
[Xcode]
[Xcode] t = 4968.19s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode]
[Xcode] t = 4968.19s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4983.01s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 4983.06s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 4983.10s Find: Identity Binding
[Xcode]
[Xcode] t = 4983.16s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode]
[Xcode] t = 4983.16s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 4998.77s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 4998.82s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 4998.86s Find: Identity Binding
[Xcode]
[Xcode] t = 4998.92s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode]
[Xcode] t = 4998.92s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 5015.05s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 5015.10s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 5015.14s Find: Identity Binding
[Xcode]
[Xcode] t = 5015.20s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode]
[Xcode] t = 5015.20s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 5031.98s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 5032.04s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 5032.08s Find: Identity Binding
[Xcode]
[Xcode] t = 5032.15s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode] t = 5032.15s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[Xcode] t = 5049.42s Find: Descendants matching type Any
[Xcode]
[Xcode] t = 5049.47s Find: Elements matching predicate '"vocFeed-Respondent-Cell" IN identifiers'
[Xcode]
[Xcode] t = 5049.52s Find: Identity Binding
[Xcode]
[Xcode] t = 5049.58s Checking existence of "vocFeed-Respondent-Cell" Cell
[Xcode]
[Xcode] t = 5049.58s Snapshot accessibility hierarchy for app with pid 507
[Xcode]
[BaseDriver] Shutting down because we waited 300 seconds for a command
[XCUITest] Not clearing log files. Use clearSystemFiles capability to turn on.
[Appium] Closing session, cause was 'New Command Timeout of 300 seconds expired. Try customizing the timeout using the 'newCommandTimeout' desired capability'
[Appium] Removing session 894f67fd-1772-4e84-bb03-6cbc520b2b67 from our master session list

appium client logs
The last thing I see is

Jul 23, 2019 11:55:58 AM org.openqa.selenium.remote.RemoteWebDriver log FINE: Executing: findElements [0991aeec-f7c8-43cf-93a5-6b6f2db220af, findElements {using=accessibility id, value=vocFeed-Respondent-Cell}]

And that lasts for about 10 minutes. I've noticed sometimes it will finish, but not report any found elements. Othertimes it will just gve up with:

WARNING: WebDriverException thrown by findElements(By.AccessibilityId: vocFeed-Respondent-Cell) org.openqa.selenium.WebDriverException: java.io.IOException: unexpected end of stream on Connection{127.0.0.1:5012, proxy=DIRECT hostAddress=/127.0.0.1:5012 cipherSuite=none protocol=http/1.1}

Please let me know if there is any additional information I can provide. I'm at a loss as how to work around this.

Possibly related issues

#1022
#1067

@willisfeng
Copy link

I have the same problem

@kartikjain12
Copy link

kartikjain12 commented Jul 30, 2019

Also have same Problem or similar.
I get the following error intermittently :

[XCUITest] Connection to WDA timed out
[iProxy] recv failed: Operation not permitted

I am running the following code to scroll on the ios device

    public static IOSElement FindAndScrollToElement(IOSDriver<IOSElement> remoteDriver, string id)
        {
            var height = remoteDriver.Manage().Window.Size.Height;
            var theElmentInQuestion = remoteDriver.FindElementByName(id);
            var locationy = theElmentInQuestion.Location.Y;
            while (locationy > height || locationy < 0)
            {
                var distance = ((double)(Math.Abs(locationy))) / height;
                if (distance < 0.2)
                {
                    distance = 0.2;
                }
                if (locationy > height)
                {
                    var scrollObject = new Dictionary<String, String>();
                    scrollObject.Add("direction", "down");
                    scrollObject.Add("distance", $"{distance}");
                    remoteDriver.ExecuteScript("mobile: scroll", scrollObject);
                }
                else
                {
                    var scrollObject = new Dictionary<String, String>();
                    scrollObject.Add("direction", "up");
                    scrollObject.Add("distance", $"{distance}");
                    remoteDriver.ExecuteScript("mobile: scroll", scrollObject);
                }
                locationy = theElmentInQuestion.Location.Y;
            }
            return remoteDriver.FindElementByAccessibilityId(id);
        }

Sometimes test pass, sometimes they fails
I think it happens on
var height = remoteDriver.Manage().Window.Size.Height;
the most

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants