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
tried solution are :
Hi,
I am using appium to automate the testing of our iOs app. Tests are written in Java.
I am trying to check if an element is present. If yes, I want to click it, if not proceed with the rest of the test without failing my tests.
For example, when I am trying to launch the map, the first time I access the map feature, i get a pop-up if I want to let my app use Location services. This does not come up every time, but only the first time I try to use maps.
So if there is this pop-up, I want t…
I am facing one issue that appium is not running program or not by passing element when element not present/not found.
My Scenario :
I am doing automation for one android app. In that I am working for profile picture. Now I have 2 options to get profile picture :
1 - Take picture from gallery
2 - Take profile using camera
So I am trying like :
1 - Get profile picture from gallery and do submit.
2 - Then I have put condition that if it do not get picture from gallery then take via CAMERA.
…
Someone help me out from this problem.
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
}
Ok and what we can do with popups which are asking to permission(e.g. bluetooth, Location, camera).
i used this code for android automation but it is not working
if(driver.findElement(By.xpath("//*[@text ,‘You buy’]")).isDisplayed()){
//
}