Skip to content

Instantly share code, notes, and snippets.

@michelpf
Last active July 2, 2017 00:12
Show Gist options
  • Save michelpf/a044653ee60b4a6ed777256d15a006dc to your computer and use it in GitHub Desktop.
Save michelpf/a044653ee60b4a6ed777256d15a006dc to your computer and use it in GitHub Desktop.
Exemplo Básico do Selenium em Java
public class Main {
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://www.terra.com.br");
boolean i = driver.getPageSource().contains("Lula");
System.out.println("Lula no Terra? "+(i?"Sim":"Não"));
driver.get("http://www.uol.com.br");
i = driver.getPageSource().contains("Lula");
System.out.println("Lula no Uol? "+(i?"Sim":"Não"));
driver.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment