I have a situation where I am finding an element (the second element with the content-desc="example"
) and am using the following UiSelector to call findElement()
: UiSelector().descriptionContains("example").instance(1)
. Later, I set the orientation to Landscape and attempt to find the same element. For some reason I am no longer able to find that element on the second try even though I was able to on the first attempt in portrait mode.
I am able to see that the webElement is fully in view at the time findElement is called and even have ensured that I can locate the same element programmatically by automating down button presses until the item is focused and verifying the attribute is as expected. There is no issue when I try this order of operations for instance(0)
.
Is there any reason the findElement experience would differ between portrait and landscape like this or any reason I would only have this issue when using instance > 0
?