Created
April 28, 2015 17:35
-
-
Save ptcmariano/fe3d6c32e978b7eff4e8 to your computer and use it in GitHub Desktop.
desafio selenium
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.org.qalab; | |
import org.junit.Test; | |
import org.openqa.selenium.By; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.WebElement; | |
import org.openqa.selenium.firefox.FirefoxDriver; | |
import org.openqa.selenium.support.ui.ExpectedConditions; | |
import org.openqa.selenium.support.ui.WebDriverWait; | |
public class DesafioWaitTest { | |
@Test | |
public void testWait(){ | |
WebDriver webDriver = new FirefoxDriver(); | |
webDriver.navigate().to("http://the-internet.herokuapp.com/dynamic_loading/1"); | |
webDriver.findElement(By.xpath("//div[@id='start']/button")).click(); | |
WebDriverWait wait = new WebDriverWait(webDriver, 10); | |
WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//div[@id=\"finish\"]/h4"))); | |
String out = "waited: " + element.getText(); | |
System.out.println(out); | |
webDriver.close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment