Visible attribute is false in appium inspector even-though UI elements are displayed..!


#1

In iOS app even-though UI elements are displayed (could see manually) ,value of visible attribute in Appium inspector is false. why so and also please suggest how to check whether elements are visible or not.

I am trying to find the element by using explicitly wait- expected condition as visibility of the element located .but it returns false!!


#2

It’s up to the DEV who did the app why he put the attribute on false even the element is there.

/*
* Use this method to check if an element is not present. If the element is
* present in the page source, test will fail, if element is not present, test
* will continue. Try to modify the implementation per your need
*/

public void validateElementIsNotPresent(MobileElement element1) {
	WebDriverWait wait = new WebDriverWait(driver, 1, 100);
	try {
		if (wait.until(ExpectedConditions.visibilityOf(element1)) != null) {
			Assert.assertFalse(element1.isDisplayed());
		}
	} catch (Exception e) {
		log.info("Element not present, we are good here!");
		log.debug(e);
	}
}

#3

wait.until(ExpectedConditions.visibilityOf(element1) returns false as same as the value for the visible attribute is false in Appium inspector.

we will check with development team but still how to handle the situation if expected condition return false.

Thanks for replying


#4

What if you use TestNG assertion: Assert.assertTrue(element.isDisplayed());
It will return true if the element is visible… False if not.
But what locator do you use for your element?


#5

Locator is xpath but still facing that problem