Popup
Sat May 27 2023 07:16:28 GMT+0000 (Coordinated Universal Time)
Saved by
@mehran
driver.findElement(By.id("ir.mci.ecareapp:id/roaming_status_switch_roaming_activity")).click();
String test1=driver.findElement(By.id("ir.mci.ecareapp:id/snackbar_text")).getText();
LOGGER.info("نتیجه رومینگ");
LOGGER.info(test1);
if (test1.equals("عملیات موفقیت آمیز")) {
LOGGER.info("PASS");
}else{
LOGGER.error("Test failed ");
Assert.fail("Test failed ");
}
/////////
اگر پاپاپ را دید چه کند
By snackbarTextLocator = By.id("ir.mci.ecareapp:id/snackbar_text");
boolean isElementPresent = driver.findElements(snackbarTextLocator).size() > 0;
if (isElementPresent) {
// If the element is present, take the desired action
// Take a screenshot or perform any other operation
// ...
} else {
// If the element is not present, take a different action
// Continue with the rest of the testing or perform any other operation
// ...
}
content_copyCOPY
Comments