node for rootElement not found

Symptom

shirates.core.exception.TestDriverException: node for rootElement not found.(mode=ios, source=<?xml version="1.0" encoding="UTF-8"?>

Platform

iOS

Cause

Appium driver failed to capture elements and returns invalid element type XCUIElementTypeAny.

Solution

Restart iOS device or simulator.

Exception example

shirates.core.exception.TestDriverException: node for rootElement not found.(mode=ios, source=<?xml version="1.0" encoding="UTF-8"?>
<AppiumAUT>
  <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
    <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
      <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
          <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
            <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
              <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                </XCUIElementTypeAny>
              </XCUIElementTypeAny>
              <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                  <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                    <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                      <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                      </XCUIElementTypeAny>
                      <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                      </XCUIElementTypeAny>
                      <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                      </XCUIElementTypeAny>
                      <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                      </XCUIElementTypeAny>
                      <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                      </XCUIElementTypeAny>
                      <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                      </XCUIElementTypeAny>
                      <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                      </XCUIElementTypeAny>
                      <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                      </XCUIElementTypeAny>
                      <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                      </XCUIElementTypeAny>
                      <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                      </XCUIElementTypeAny>
                      <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                      </XCUIElementTypeAny>
                      <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                      </XCUIElementTypeAny>
                      <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                      </XCUIElementTypeAny>
                      <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                      </XCUIElementTypeAny>
                      <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                      </XCUIElementTypeAny>
                      <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
                        </XCUIElementTypeAny>
                      </XCUIElementTypeAny>
                    </XCUIElementTypeAny>
                  </XCUIElementTypeAny>
                </XCUIElementTypeAny>
              </XCUIElementTypeAny>
            </XCUIElementTypeAny>
          </XCUIElementTypeAny>
        </XCUIElementTypeAny>
      </XCUIElementTypeAny>
    </XCUIElementTypeAny>
    <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
      <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
        <XCUIElementTypeAny type="XCUIElementTypeAny" enabled="true" visible="false" x="-1" y="-1" width="0" height="0">
        </XCUIElementTypeAny>
      </XCUIElementTypeAny>
    </XCUIElementTypeAny>
  </XCUIElementTypeAny>
</AppiumAUT>)

Link