Path - 1 :
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(3));
wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("div.alert-danger p")));
List<String> alertTextList = driver.findElements(By.cssSelector("div.alert-danger p"))
.stream()
.map(WebElement::getText)
.toList();
System.out.println("Application Status :" + alertTextList);
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(3));
wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("div.alert-danger p")));
List<String> alertTextList = driver.findElements(By.cssSelector("div.alert-danger p"))
.stream()
.map(WebElement::getText)
.toList();
System.out.println("Application Status :" + alertTextList);
Path - 2 :
WebElement actmessage = new WebDriverWait(driver, 15)
.until(ExpectedConditions.elementToBeClickable(By.className("Toastify")));
String act = actmessage.getText();
System.out.println("Application Status :" + act);
Path - 3 :
WebElement display = driver.findElement(By.className("alert-content"));
String act = display.getText();
//To print the value
System.out.println("Element displayed is :" + act);
No comments:
Post a Comment