I am trying to find an element is not visible in the UI by using Appium and Java.
Element:-
<android.widget.RelativeLayout index="0" text="" resource-id="com.test:id/test" class="android.widget.RelativeLayout" package="com.test" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,75][1080,1920]" instance="0">
p, li { white-space: pre-wrap; }
But In the pagesource, I see “com.test:id/test” enabled as true.
Method 1:-
driver.findElements(By.id(com.test:id/test)).size() > 0
Result:- Return 1
Method 2:-
public WebElement test() {
WebDriverWait wait = new WebDriverWait(driver, 10);
wait.until(ExpectedConditions.presenceOfElementLocated(By.id(com.test:id/test)));
}
test.isDisplayed();
Result:- Return true
It seems to be test is still visible in the pagesoure but not in the UI
How can i test it ?