I want to know what wrong with my code, because when I try to test my code, I didn´t get anything.
public class SeleniumTest {
private WebDriver driver;
private String nome;
private String idade;
@FindBy(id = "j_idt5:nome")
private WebElement inputNome;
@FindBy(id = "j_idt5:idade")
private WebElement inputIdade;
@BeforeClass
public void criarDriver() throws InterruptedException {
driver = new FirefoxDriver();
driver.get("http://localhost:8080/SeleniumWeb/index.xhtml");
PageFactory.initElements(driver, this);
}
@Test(priority = 0)
public void digitarTexto() {
inputNome.sendKeys("Diego");
inputIdade.sendKeys("29");
}
@Test(priority = 1)
public void verificaPreenchimento() {
nome = inputNome.getAttribute("value");
assertTrue(nome.length() > 0);
idade = inputIdade.getAttribute("value");
assertTrue(idade.length() > 0);
}
@AfterClass
public void fecharDriver() {
driver.close();
}
}
I´m using Selenium WebDriver
and TestNG
, and I tried to test some entries in JSF
page.