Skip to content

Instantly share code, notes, and snippets.

@ptcmariano
Created April 28, 2015 17:35
Show Gist options
  • Save ptcmariano/fe3d6c32e978b7eff4e8 to your computer and use it in GitHub Desktop.
Save ptcmariano/fe3d6c32e978b7eff4e8 to your computer and use it in GitHub Desktop.
desafio selenium
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