On the login page of my application, there is a button "cancel" which is only displayed after user submitted the login form.
The problem is appium inspector see it all the time, even when not displayed, and his attributes visible, enabled are always true.
So during my test, if I want to check that this kind of element isn't displayed I can't because this one is never saw as not displayed.
I tried many ways, such as ExpectedConditions.elementToBeClickable.
Is there a way to detect if this element is really hidden ?
Is it possible that you are using xcuitest driver? I think it shows everything loaded in the phone's memory :( (not sure if it's that, but seems the behaviour in my same situation)
@slipy12 Yes I use xcuitest, I forgot to mention that (I'm going to edit my issue).
Oh it seems problematic...
This may depend on the actual application code, since it has full control over accessibility and can also change visibility attribute.
Check this for example http://stackoverflow.com/questions/25259822/showing-hiding-accessibility-elements-in-an-overflow-menu-when-opening-a-custo
You mention accessibility element, is it related with the accessibility from accessibility id and accessibility label ?
I had something similar, where multiple pop ups with "OK" button were being found, but they were in the background. Here's my solution:
WebDriverWait wait = new WebDriverWait(_driver, new TimeSpan(0, 0, 20));
var i = _driver.FindElements(By.Name("OK")).Count;
Hi @kcinman11358 your solution is interesting but only in a case where these multiple buttons have the same accessibilityId/xpath. Thank you anyway !