Index: ssts-selenium-test/src/test/java/test_4_1/Assemble.java =================================================================== diff -u -r17680 -r17683 --- ssts-selenium-test/src/test/java/test_4_1/Assemble.java (.../Assemble.java) (revision 17680) +++ ssts-selenium-test/src/test/java/test_4_1/Assemble.java (.../Assemble.java) (revision 17683) @@ -1,23 +1,17 @@ package test_4_1; -import java.util.NoSuchElementException; -import java.util.concurrent.TimeUnit; -import java.util.function.Function; - -import org.testng.annotations.AfterMethod; -import org.testng.annotations.Test; -import org.testng.annotations.BeforeMethod; -import org.testng.AssertJUnit; import org.openqa.selenium.Alert; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.Keys; -import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.Actions; import org.openqa.selenium.support.ui.ExpectedConditions; -import org.openqa.selenium.support.ui.FluentWait; -import org.openqa.selenium.support.ui.Wait; +import org.openqa.selenium.support.ui.WebDriverWait; +import org.testng.AssertJUnit; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; import test_4_1.tools.Utils; @@ -117,7 +111,11 @@ Utils.retryingFind(By .xpath("//div/ul/li[contains(text(), '" + name + "')]"))).perform(); - Thread.sleep(1000); + + //Thread.sleep(1000); + + WebDriverWait wait = new WebDriverWait(Utils.driver, 10); + wait.until(ExpectedConditions.alertIsPresent()); Alert alertBox = Utils.driver.switchTo().alert(); alertBox.accept();