List of usage examples for org.openqa.selenium.support.ui ExpectedConditions visibilityOfElementLocated
public static ExpectedCondition<WebElement> visibilityOfElementLocated(final By locator)
From source file:applango.common.services.Applango.genericApplangoWebsiteActions.java
private static void waitForGraphRollUp(WebDriverWait wait1) throws IOException { logger.info("Wait until graphRolledUp appear"); wait1.until(ExpectedConditions .visibilityOfElementLocated((By.id(applangoObject.PEOPLEPAGE_GRAPHROLLUP.getValue())))); }
From source file:applicationdriverlayer.pageobjects.squash.booking.CourtCancellationPage.java
License:Apache License
@Override protected void waitForLoadToComplete() { new WebDriverWait(driver, explicitWaitTimeoutSeconds) .until(ExpectedConditions.visibilityOfElementLocated(By.className("cancellation-form"))); new WebDriverWait(driver, explicitWaitTimeoutSeconds) .until(ExpectedConditions.visibilityOf(submitCancellationButton)); }
From source file:applicationdriverlayer.pageobjects.squash.booking.CourtReservationPage.java
License:Apache License
@Override protected void waitForLoadToComplete() { new WebDriverWait(driver, explicitWaitTimeoutSeconds) .until(ExpectedConditions.visibilityOfElementLocated(By.className("reservation-form"))); new WebDriverWait(driver, explicitWaitTimeoutSeconds) .until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("input[name = 'name']"))); }
From source file:automated_tests.InitialPopups.java
@Test(priority = 1) public void rejectConsentToUse() { driver.findElement(By.id("btnDoNotConsent")).click(); //TODO: Look into $.tablesorter is undefined Javascript error wait.until(ExpectedConditions.visibilityOfElementLocated(By.className("no_html5"))); try {// w w w . j a va 2 s .c o m assertEquals("This application can only be used after accepting the Terms of Use and Privacy Policy", driver.findElement(By.cssSelector("span")).getText()); System.out.println("Rejected terms of use warning text correct"); } catch (Error e) { verificationErrors.append(e.toString()); } }
From source file:automated_tests.InitialPopups.java
@Test(priority = 3) public void rejectTermsOfUse() { driver.findElement(By.id("btnRejectTerms")).click(); wait.until(ExpectedConditions.visibilityOfElementLocated(By.className("no_html5"))); try {//from w ww . j av a 2 s .co m assertEquals("This application can only be used after accepting the Terms of Use and Privacy Policy", driver.findElement(By.cssSelector("span")).getText()); System.out.println("Rejected terms of use warning text correct"); } catch (Error e) { verificationErrors.append(e.toString()); } }
From source file:automated_tests.InitialPopups.java
@Test(priority = 5) public static void clickInstructionsOverlay() { //Wait until the instructions overlay to show up before clicking it wait.until(ExpectedConditions.visibilityOfElementLocated(By.className("instructionsOverlayHeader"))); driver.findElement(By.className("instructionsOverlayHeader")).click(); //Wait until the instructions overlay disappears before continuing wait.until(ExpectedConditions.invisibilityOfElementLocated(By.className("instructionsOverlayHeader"))); System.out.println("Closed instructions overlay"); }
From source file:automated_tests.InitialPopups.java
@Test(priority = 6) public void quiz() { //Click Patient History form driver.findElement(By.xpath(".//*[@id='btn_PH']/div/a")).click(); //Wait until the Patient History form appears wait.until(ExpectedConditions.visibilityOfElementLocated( By.xpath("//*[@id='patient_feedback']/div[1]/div[1]/div[2]/div[2]/div[1]/div[2]/label/span"))); System.out.println("opened Patient History"); try {//from w w w. j a v a 2 s . c om assertEquals("Female", driver.findElement( By.xpath("//form[@id='patient_feedback']/div/div/div[2]/div[2]/div/div[2]/label")) .getText()); } catch (Error e) { verificationErrors.append(e.toString()); System.out.println("Verification Errors:" + verificationErrors.toString()); } //Click Female button driver.findElement(By.xpath("//form[@id='patient_feedback']/div/div/div[2]/div[2]/div/div[2]/label")) .click(); }
From source file:backend.MakeUserTest.java
@Test(description = "open user panel", priority = 1) public void openUserPage() { driver.findElement(By.partialLinkText("Admin")).click(); driver.findElement(By.partialLinkText("Users")).click(); WebDriverWait wait = new WebDriverWait(driver, 10); WebElement elementButton = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath( "//span[@onclick=\"dialog.formDialog(null,'person', { refresh : 'detailTable_person'}, {})\"]"))); }
From source file:backend.MakeUserTest.java
@Test(description = "create user", priority = 2, dependsOnMethods = { "openUserPage" }) public void makeUser() { WebDriverWait wait = new WebDriverWait(driver, 10); driver.findElement(By.xpath(/* ww w. j a v a 2 s . c o m*/ "//span[@onclick=\"dialog.formDialog(null,'person', { refresh : 'detailTable_person'}, {})\"]")) .click(); WebElement elementUsername = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("username"))); textInput("username", "testUser123"); textInput("userRealName", "test user"); textInput("givenName", "test"); textInput("familyName", "user"); textInput("email", "testuser@gmail.com"); driver.findElement(By.partialLinkText("Password")).click(); WebElement elementPassword = wait .until(ExpectedConditions.visibilityOfElementLocated(By.id("newPassword"))); textInput("newPassword", "test123"); textInput("newPassword2", "test123"); driver.findElement(By.xpath("//span[text()='OK']")).click(); WebElement elementButton = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath( "//span[@onclick=\"dialog.formDialog(null,'person', { refresh : 'detailTable_person'}, {})\"]"))); }
From source file:backend.MakeUserTest.java
@Test(description = "check if new user was succesfully added", priority = 3, dependsOnMethods = { "makeUser" }) public void validateNewUser() throws InterruptedException { WebDriverWait wait = new WebDriverWait(driver, 10); //sort descending(newest on top) WebElement table = driver.findElement(By.id("detailTable_person")); WebElement idCell = table.findElement(By.xpath("//th[text()='Id']")); idCell.click();/* w w w . j av a 2s .c om*/ Thread.sleep(500); //select first table entry List<WebElement> tableRows = table.findElements(By.tagName("tr")); String userId = tableRows.get(2).findElement(By.xpath("//td[1]")).getText(); String nameCell = tableRows.get(2).findElement(By.xpath("//td[2]")).getText(); //validate if first entry is the new user. delete user if true, fails test if false if (nameCell.equals("testUser123")) { WebElement delete = table.findElement(By.xpath("//span[@onclick=\"dialog.deleteDialog('" + userId + "','person',{ refresh : 'null'}, null)\"]")); delete.click(); WebElement elementConfirm = wait .until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//span[text()='Delete']"))); WebElement confirm = table.findElement(By.xpath("//span[text()='Delete']")); confirm.click(); WebElement elementButton = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath( "//span[@onclick=\"dialog.formDialog(null,'person', { refresh : 'detailTable_person'}, {})\"]"))); } else { org.testng.Assert.fail("Test user was not succesfully created."); } }