I want to check element existence on screen


#1

I want to check any element with XPath.
I am implement my test application in JAVA, for iOS application testing.

I go through with several other post to on the same and tried but could not make worked for me :frowning:
tried solution are :


Someone help me out from this problem.


#2

for i OS better use native predicate instead of XPATH:

List<IOSElement> elementList = driver.findElements(MobileBy.
                iOSNsPredicateString("type == 'XCUIElementTypeStaticText' AND name == '" + name + "' AND visible == 1"));
        if (!elementList.isEmpty()) {
             // element found on screen
        }

#3

Ok and what we can do with popups which are asking to permission(e.g. bluetooth, Location, camera).