Thank you so much for your reply.
I tried with the mobile Element option however, it it still giving me an exception after running it.
I’d be really grateful if you could help me correct my code.
Here is my code:
public static MobileElement mobileElement;
public static boolean waitForPresence(AndroidDriver driver, int timeLimitInSeconds, String targetResourceId){
try{
mobileElement = (MobileElement) driver.findElementByAndroidUIAutomator("UiSelector().resourceId(\""+targetResourceId+"\")");
WebDriverWait wait = new WebDriverWait(driver, timeLimitInSeconds);
wait.until(ExpectedConditions.visibilityOf(mobileElement));
isElementPresent = mobileElement.isDisplayed();
return isElementPresent;
}catch(Exception e){
isElementPresent = false;
System.out.println(e.getMessage());
return isElementPresent;
}
}
Thank you in advance for your time!
Best regards,
Rohit