Last active
July 2, 2017 00:12
-
-
Save michelpf/a044653ee60b4a6ed777256d15a006dc to your computer and use it in GitHub Desktop.
Exemplo Básico do Selenium em Java
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
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