List of usage examples for org.openqa.selenium.support.ui ExpectedConditions visibilityOf
public static ExpectedCondition<WebElement> visibilityOf(final WebElement element)
From source file:loteriaNacional.RobotLoteria.java
public void comprobar(int numero, float dinero) { // Introducimos el nmero y la cantidad de dinero en sus respectivos campos WebElement n = driver.findElement(By.id("numero")); n.sendKeys(numero + ""); WebElement e = driver.findElement(By.id("cantidad")); // Borramos el contenido por defecto de la cantidad e.clear();//from w ww . j a v a 2s . c om e.sendKeys(dinero + ""); // Nos posicionamos, para que todo funcione correcto // Si lo quito --> falla driver.findElement(By.className("cuerpoRegion")); // Como no tenemos ninguna forma de identificar al botn vamos a hacerlo con el cssSelector a mano: // etiqueta con value = 'nombre' // La siguiente forma sera usando xpath --> no me ha funcionado // driver.findElement(By.xpath("//input[contains(text(), 'COMPROBAR')]")).click(); driver.findElement(By.cssSelector("input[value='COMPROBAR']")).click(); // nos aseguraremos de que esta accesible el mensaje de salida WebDriverWait wait = new WebDriverWait(driver, 10); wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.className("alerta")))); System.out.println(driver.findElement(By.className("alerta")).findElement(By.tagName("p")).getText()); }
From source file:main.java.qa.android.util.WaitTool.java
License:Open Source License
public static WebElement waitForElementDriverWebElementSecond(WebDriver driver, WebElement wElement, int timeOutInSeconds) { WebElement element;/*from w ww . j a v a 2s . c om*/ try { //To use WebDriverWait(), we would have to nullify implicitlyWait(). //Because implicitlyWait time also set "driver.findElement()" wait time. //info from: https://groups.google.com/forum/?fromgroups=#!topic/selenium-users/6VO_7IXylgY driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS); //nullify implicitlyWait() WebDriverWait wait = new WebDriverWait(driver, timeOutInSeconds); element = wait.until(ExpectedConditions.visibilityOf(wElement)); driver.manage().timeouts().implicitlyWait(DEFAULT_WAIT_4_PAGE, TimeUnit.SECONDS); //reset implicitlyWait return element; //return the element } catch (Exception e) { Log.info(e.getMessage()); e.printStackTrace(); } return null; }
From source file:modules.sd_uat.pages.CommonPage.java
public void clickOnSubmitButton() { new WebDriverWait(driver, 10).until(ExpectedConditions.visibilityOf(submitButton)); ReportingTools.highlightElement(submitButton); ReportingTools.takeScreenshot("Before clicking on submit button"); submitButton.click();//w w w . j a v a 2 s . c o m }
From source file:modules.sd_uat.pages.CommonPage.java
protected void clickRefreshLink() { new WebDriverWait(driver, 30).until(ExpectedConditions.visibilityOf(refreshLink)).click(); }
From source file:modules.sd_uat.pages.CommonPage.java
public void clickOnAcceptButton() { new WebDriverWait(driver, 10).until(ExpectedConditions.visibilityOf(acceptButton)); ReportingTools.highlightElement(acceptButton); ReportingTools.takeScreenshot("Before clicking on accept button"); acceptButton.click();//from w w w.jav a 2 s . c o m }
From source file:modules.sd_uat.pages.CommonPage.java
public void clickOnCreditProfile() { new WebDriverWait(driver, 10).until(ExpectedConditions.visibilityOf(acceptButton)); ReportingTools.highlightElement(creditProfileLink); ReportingTools.takeScreenshot("Before clicking on credit profile link"); creditProfileLink.click();/* w w w . jav a 2 s. co m*/ }
From source file:modules.sd_uat.pages.CommonPage.java
public void enterComments(String comment) { new WebDriverWait(driver, 10).until(ExpectedConditions.visibilityOf(commentField)); commentField.clear();/*from w w w . jav a 2 s . c om*/ commentField.sendKeys(comment); ReportingTools.takeScreenshot("Entered the comments"); }
From source file:modules.sd_uat.pages.CommonPage.java
public void enterComment(String comment) { new WebDriverWait(driver, 10).until(ExpectedConditions.visibilityOf(smartNoteCommentField)); smartNoteCommentField.clear();//from w w w. j a v a 2 s . c om smartNoteCommentField.sendKeys(comment); ReportingTools.takeScreenshot("Entered the comments"); }
From source file:modules.sd_uat.pages.CommonPage.java
protected void waitForPageToLoad() { new WebDriverWait(driver, 60).until(ExpectedConditions.visibilityOf(searchTab)); }
From source file:modules.sd_uat.pages.CommonPage.java
public void clickOnSearchButton() { new WebDriverWait(driver, 10).until(ExpectedConditions.visibilityOf(searchButton)); ReportingTools.takeScreenshot("Before clicking on search button"); searchButton.click();/*from w w w. jav a 2 s . c o m*/ }