Hi,
does anyone sucessfully use Selenium for UI-tests of a Vaadin application?
I am currently trying to implement a simple JUnit test, that puts username and password into two input fields and clicks a button to submit the form and do the login.
My test looks like this:
[code]
@Test
public void testSeleniumJava() throws Exception {
driver.get(baseUrl + “/app/”);
driver.findElement(By.id("gwt-uid-5")).sendKeys("user");
driver.findElement(By.id("gwt-uid-7")).sendKeys("pass");
driver.findElement(By.cssSelector("div.v-button.v-widget")).click();
assertTrue(isElementPresent(By.cssSelector("div.v-slot.v-align-center > img.v-image.v-widget")));
}
[/code]If i run this test, everythings starts up fine (so Selenium is basically working). In the started Firefox, i can see, that both input fields are getting filled with the text and also the button gets clicked. But for some reason the login always fails, because no data (no username and no password) gets send to the server for login.
If I remove the “click” from the JUnit test and manually click, it does not work, too.
But: It works, if I manually click the two input fields, after the text was inserted by the JUnit test. So it seems, that the Vaadin application does not recognize “sendKeys” as real user interaction.