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.
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)