title: PageSource() gets different code than appium inspector code
body: <p>I am having a really hard time understanding the following problem, i have an app, i use appium inspector to see the elements, but when i use the elements, i get that the element is not found, therefore i printed the code using the driver.getPageSource() method, and i realized that the xml code that is created while running the app, is actually different to what appium inspector sees, what is the problem and how can it be solved? i could ask to the developers to fix it once i know the root cause, thanks in advance.</p>
  
  <p>This is an example of a difference </p>
  
  <p>Under <code>&lt; XCUIElementTypeOther name = Picture, Left Rear Corner&gt;</code> there are 4 more elements 2 StaticText, 2 Buttons (appium inspector) and on the the same element but in the java console, there are only 2  tags, so i do not see the 2 static text and the 2 buttons (which is what i want to click)</p>
  
  <p><a href="https://i.stack.imgur.com/ABZ26.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ABZ26.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/TpXDh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TpXDh.png" alt="enter image description here"></a></p>
  
  <p>As you can see the code in the console is different to what i see in appium iinspector. this is for IOS app.</p>
  
  <pre><code> while (driver.findElementsById("Additional Videos").size() == 0) {
              swipeScreenDown();
          }
          driver.getPageSource();
          WebElement additionalVideos = driver.findElementByXPath("//XCUIElementTypeOther[@name=\"Picture, Left Front Corner\"]");
          driver.getPageSource();
        List&lt;WebElement&gt; idf = additionalVideos.findElements(By.className("XCUIElementTypeButton"));
          driver.getPageSource();
          System.out.println(idf.size());
          driver.getPageSource();
          idf.get(0).click();
          driver.getPageSource();
  </code></pre>
  
  <p>Error got:</p>
  
  <pre><code>java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
  </code></pre>