Appium inspector says an iOS element is visible whereas it is not on my screen (xcuitest) #7679

Open
jeangb opened this Issue Jan 11, 2017 · 7 comments

Projects

None yet

5 participants

@jeangb
jeangb commented Jan 11, 2017 edited

The problem

Hello,
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 ?

Environment

  • Appium version (or git revision) that exhibits the issue: 1.6.3
  • Automation framework used: Xcuitest
  • Desktop OS/version used to run Appium: Mac OS 10.11.6
  • Node.js version (unless using Appium.app|exe): v7.2.1
  • Mobile platform/version under test: iOS 9.3.5
  • Real device or emulator/simulator: real
  • Appium CLI or Appium.app|exe: CLI
@triager triager added the NeedsTriage label Jan 11, 2017
@slipy12
slipy12 commented Jan 11, 2017

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)

@jeangb
jeangb commented Jan 11, 2017

@slipy12 Yes I use xcuitest, I forgot to mention that (I'm going to edit my issue).
Oh it seems problematic...

@jeangb jeangb changed the title from Appium inspector says an iOS element is visible whereas it is not on my screen to Appium inspector says an iOS element is visible whereas it is not on my screen (xcuitest) Jan 11, 2017
@mykola-mokhnach
Collaborator

This may depend on the actual application code, since it has full control over accessibility and can also change visibility attribute.

@jeangb
jeangb commented Jan 11, 2017

You mention accessibility element, is it related with the accessibility from accessibility id and accessibility label ?

@kcinman11358

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));
wait.Until(ExpectedConditions.ElementIsVisible(By.Name("OK")));
var i = _driver.FindElements(By.Name("OK")).Count;
_driver.FindElements(By.Name("OK")).ElementAt(i-1).Click();

@jeangb
jeangb commented Jan 13, 2017

Hi @kcinman11358 your solution is interesting but only in a case where these multiple buttons have the same accessibilityId/xpath. Thank you anyway !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment