Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I have tested a scenario where I have to enter user credentials and click on login button using Selenium2 (version selenium2.19-standalone.jar)

driver.findElement(By.id("emailIdLogin")).sendKeys("test123@gmail.com");
driver.findElement(By.id("passwordLogin")).sendKeys("test1234");
driver.findElement(By.id("submitLogin")).click

On click is performed on submit button but page is not loaded to new page. Whereas when I use driver.findElement(By.id("submitLogin")).sendKeys(Keys.ENTER) page is loaded to the next page. Please explain why click command is not loading the new page.

I am using Firefox 8.

share|improve this question
1  
Which Browser? If IE it could be because the physical mouse pointer is over the browser when the test is running (There are issues with IE picking up the physical mouse pointer location and using that instead of the pointer location set by selenium). Is it really a clickable button? Can you show us some HTML, that would help diagnose the issue. Are you expecting a JavaScript event to be fired on click? Possible the event isn't firing when a click occurs. Basically we need more info. –  Ardesco Feb 22 '12 at 11:08
    
There are unfortunately LOTS of reasons a click can fail to work. IE is particularly problematic in that respect. Let us know which browser and we can help... –  Stephen Gross Feb 22 '12 at 19:28
    
The choice of bindings that you use also seems to make a difference. I have seen this same problem with the Java bindings, but the Click() method in the C# works fine. –  Sam Warwick Feb 22 '12 at 22:26
add comment

1 Answer 1

Not sure if it was a paste error but your last line should be:

driver.findElement(By.id("submitLogin")).click();
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.