Appium IOS time out finding the element when API call return large number of data set

I am getting following error in Appium Server log

[Xcode] 2017-04-26 17:18:21.811 XCTRunner[2724:2785096] Enqueue Failure: UI Testing Failure - Failure getting snapshot Error Domain=XCTestManagerErrorDomain Code=9 “Error -25204 getting snapshot for element <AXUIElement 0x7ff57ad03da0> {pid=2730}” UserInfo={NSLocalizedDescription=Error -25204 getting snapshot for element <AXUIElement 0x7ff57ad03da0> {pid=2730}} 0 1

[Xcode] 2017-04-26 17:18:21.929 XCTRunner[2724:2772514] Enqueue Failure: UI Testing Failure - (null) /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgentRunner/UITestingUITests.m 35 1
[Xcode] 2017-04-26 17:18:21.932 XCTRunner[2724:2772514] Failed to invoke libxml2>xmlTextWriterStartElement. Error code: -1
[Xcode] 2017-04-26 17:18:21.932 XCTRunner[2724:2772514] Failed to generate XML presentation of a screen element

And i realize that when API call return the less number of data set its pretty quick to get the element.
Any Suggestion / idea to solve this issue

Please help me to solve this problem

I did a quick google search on this error and the only thing I could find that might be useful is this:

https://forums.developer.apple.com/thread/49936

Could your screen be in transition? You may need an explicit or implicit wait so that the transition is done before attempting a screenshot.

Thank you Wreed.

i am guessing this issue is because the API return large data set and appium ios driver is taking long time to parse and get the desired element from the DOM.

Interesting observation. You may need to increase the timeout so that this operation completes. Of course a wait will probably help.

well thats work , its way long time like 4-5 minutes which is not desirable i guess :slight_smile

Android works fine because appium android only know what is present in the current screen regardless what api returns