package Caelum;
import static org.junit.Assert.assertTrue;
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;
public class UsuariosSystemTest {
@Test
public void deveAdicionarUmUsuario{
System.setProperty("webdriver.gecko.driver","c:\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get("http://localhost:8080/usuarios/new");
WebElement nome = driver.findElement(By.name("usuario.nome"));
WebElement email = driver.findElement(By.name("usuario.email"));
nome.sendKeys("Jackson Praia Brandão");
email.sendKeys("jacksonbrandaobr@gmail.com");
WebElement botaoSalvar = driver.findElement(By.id("btnSalvar"));
botaoSalvar.click();
// garantir que Ronaldo foi adicionado!
boolean achouNome = driver.getPageSource().contains("Jackson Praia Brandão");
boolean achouEmail = driver.getPageSource().contains("jacksonbrandaobr@gmail.com");
assertTrue(achouNome);
assertTrue(achouEmail);
driver.close();
}
}
----------MENSAGEM DE ERRO --------------
Information:java: Errors occurred while compiling module 'Selenium_Guru99'
Information:javac 1.8.0_144 was used to compile java sources
Information:13/11/2017 14:01 - Compilation completed with 1 error and 0 warnings in 569ms
C:\Users\jackson.brandao\IdeaProjects\Selenium_Guru99\src\Caelum\UsuariosSystemTest.java
Error:(13, 39) java: '(' expected