The workaround I use : webElement.sendKeys(Keys.ENTER); (or SPACE with
chekboxes).
I still want to know why .click() is not working on these cases :))
Le vendredi 6 janvier 2012 23:31:25 UTC+1, Chris Rudram a écrit :
I have, as part of my code the following :
// Use the driver to get the Login
def loginPage = server + "activity-management-ui/login/auth"
driver.get(loginPage)
driver.findElement(By.id("username"))
assert driver.getTitle() == "Login"
// Assert succeeds, confirmed I have the correct page
// Enter User name and password and click log in
driver.findElement(By.id("username")).sendKeys(username)
driver.findElement(By.id("password")).sendKeys(password)
driver.findElement(By.id("sign-in")).click()
The click does not seem to click the button at all. I have
implemented the WebDriverEventListener class to log the before and
after click actions, and can check that the element is found, and is
of the correct type. The click however doesn't submit the log in page
and log into the application. The HTML looks like :
<form class="test" action="/activity-management-ui/
j_spring_security_check" method="post">
<div class="clearfix">
<div class="clearfix">
<label for="password">Password</label>
<div class="input">
<input id="password" type="password" name="j_password">
<input id="sign-in" class="btn blue" type="submit" value="Sign In">
</div>
</div>
The before and after click show I am on the element I expect (the
submit), but the driver appears to go nowhere. This is not the only
page I am having trouble with the click() function not triggering the
web page to do something. Other pages also show the click() -
sometimes- not working. I spect some time checking that I have the
correct element, and that the element is active and available, but
still the click() does not always trigger a new page to open as
expected.
The system under test is a javascript based set of web pages using
ExtJS as the framework.
--// Use the driver to get the Login
def loginPage = server + "activity-management-ui/login/auth"
driver.get(loginPage)
driver.findElement(By.id("username"))
assert driver.getTitle() == "Login"
// Assert succeeds, confirmed I have the correct page
// Enter User name and password and click log in
driver.findElement(By.id("username")).sendKeys(username)
driver.findElement(By.id("password")).sendKeys(password)
driver.findElement(By.id("sign-in")).click()
The click does not seem to click the button at all. I have
implemented the WebDriverEventListener class to log the before and
after click actions, and can check that the element is found, and is
of the correct type. The click however doesn't submit the log in page
and log into the application. The HTML looks like :
<form class="test" action="/activity-management-ui/
j_spring_security_check" method="post">
<div class="clearfix">
<div class="clearfix">
<label for="password">Password</label>
<div class="input">
<input id="password" type="password" name="j_password">
<input id="sign-in" class="btn blue" type="submit" value="Sign In">
</div>
</div>
The before and after click show I am on the element I expect (the
submit), but the driver appears to go nowhere. This is not the only
page I am having trouble with the click() function not triggering the
web page to do something. Other pages also show the click() -
sometimes- not working. I spect some time checking that I have the
correct element, and that the element is active and available, but
still the click() does not always trigger a new page to open as
expected.
The system under test is a javascript based set of web pages using
ExtJS as the framework.
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/5oALyT05vnQJ.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en-US.