Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98817

Login gmail open message check for sucess or fail in message

$
0
0

Java Selenium program Login to Gmail account in search box check for text this is working fine. How to check if the message is a success or fail If I write a separate class im getting session ID null exception.

// SAP to Magento stock sync

    WebElement searchbox = driver.findElement(By.xpath("//input[@placeholder='Search mail']"));
    Thread.sleep(100);
    searchbox.click();
    searchbox.sendKeys("SAP to Magento stock sync");
    Thread.sleep(100);
    searchbox.sendKeys(Keys.ENTER);
    Thread.sleep(1000); 
    new WebDriverWait(driver, 30).until(ExpectedConditions
        .visibilityOfElementLocated(By.className("xY a4W")));
WebElement NumberofRecord = driver.findElement(By.className("xY a4W"));
System.out.println(NumberofRecord.getText());

error:

TimeoutException: Expected condition failed: waiting for visibility of element located by By.className: xY a4W (tried for 30 second(s) with 500 milliseconds interval)
    at org.openqa.selenium.support.ui.WebDriverWait.timeoutException(WebDriverWait.java:81)


Viewing all articles
Browse latest Browse all 98817

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>