I have an iOS app that has a lot of input fields on a single page. I want to automate those inputs and i know how to scroll to those elements and everything, but I have a problem with partially displayed elements.
There are two cases in which partially displayed elements cause a problem:
The first case is caused when another element is overlapping with the element in the background. If I click on the element in the background, than Appium clicks on the overlapping element. This causes the wrong interaction and therefor the test crashes. The function isDisplayed() is not usable as the result is true for partially displayed elements, even if just one or two lines of pixels are visible.
The second case is happening when I type something into an element with sendKeys(). This opens the keyboard on iOS and when I want to click on the next element, it is possible that the keyboard is exactly over the element, except for some space that is still visible from the element, so that isDisplayed() returns true for the element. I know there is the option of hideKeyboard(), but this isn't always possible, as the keyboard displayed must have the hide key as a key visible.
One solution for me is that I don't click on the next element, but on the one below it, but this is ugly as hell, and there should be a nicer solution.
I already tried to calculate the height of the element, but in iOS this is impossible, as all elements, even if not on the screen, are still find-able in Appium and have always the height of the element.
So my question is how do I check if an element is fully visible with something more reliable than isDisplayed()? I would prefer a solution for Java, but I can manage other languages as well.