Hello,
I have a scenario where I would like to force Appium to refresh the page source or DOM structure on an adhoc basis on iOS. To give a brief overview of the issue, we are trying to find elements on a desired page. The page/screen gets loaded as a result of a button click. The screen is basically a tabbed view controller, which loads the data for the selected tab. The problem is as soon as we try to click on a new tab, appium/page source still refers to old tab's data. We have tried adding refresh method's at the application code level (like recalculating the accessibility indexes after a view appears), but it did not help to a great extent.
The workaround we found was, by launching the Appium's inspector, manually navigating to a new tab, and once the new tab's data is loaded, performing a "Refresh" (Clicking on the refresh button), gives the correct results. However, through automation, after every click action, Appium itself invokes the getPageSource() method, as a result of the action. Now, after we click on a new tab, Appium invokes the getPageSource() method again, however, this time the old tab's data page source only shows up (It does not show the new tab's data, this is not the case manually, as we are doing the refresh on an adhoc basis).We are trying to see if we can control this by calling the getPageSource() method only when needed for this particular screen. Would it be possible to do a dynamic refresh? Thanks in advance.