Здравствуйте, уважаемые форумчане!!! Буквально пару недель изучаю Selenium Java и пришло время написать первые тесты. Суть теста заключается в том, чтобы отправить электронное письмо через mail.ru. Полностью рабочий тест. Но я решил пойти дальше и попробовать отправить письмо без текста, а только с известным адресом получателя и темой. Собственно вот здесь я и не могу подтверить всплывающее окно, которое появляется после нажатия на кнопку "Отправить". Буду рад за помощь
package selenium; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.support.ui.Select; public class LinkText { public static void main(String[] args) throws InterruptedException { WebDriver driver = new FirefoxDriver (); driver.manage().window().maximize(); driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); driver.get("https://mail.ru/?from=logout"); driver.findElement(By.id("mailbox__login")).sendKeys("login"); Thread.sleep(4000); Select dropDown = new Select(driver.findElement(By.id("mailbox__login__domain"))); dropDown.selectByIndex(4); driver.findElement(By.id("mailbox__password")).sendKeys("password"); driver.findElement(By.id("mailbox__auth__button")).click(); driver.findElement(By.className("b-toolbar__item")).click(); WebElement comy = driver.findElement(By.cssSelector("textarea[class*='js-input compose__labels__input']")); comy.sendKeys("mail"); Thread.sleep(5000); WebElement meta = driver.findElement(By.cssSelector("input[id*='compose_419_ab_compose_subj']")); meta.sendKeys("Test"); Thread.sleep(5000); WebElement frame = driver.findElement(By.cssSelector("iframe[id*='compose_419_composeEditor_ifr']")); driver.switchTo().frame(frame); WebElement type = driver.switchTo().activeElement(); type.sendKeys("Отправлено с помощью Selenium"); driver.switchTo().defaultContent(); Thread.sleep(5000); WebElement element = driver.findElement(By.xpath("//div[@id='b-toolbar__right']/div[3]/div/div[2]/div/div/span")); ((JavascriptExecutor)driver).executeScript("arguments[0].click();", element); driver.findElement(By.id("PH_logoutLink")).click(); driver.quit(); } }