Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

SendKeys does not work in Firefox #8180

Closed
lukeis opened this issue Mar 4, 2016 · 5 comments
Closed

SendKeys does not work in Firefox #8180

lukeis opened this issue Mar 4, 2016 · 5 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 4, 2016

Originally reported on Google Code with ID 8180

In firefox, if the app is not in focus, sendKeys will focus the text field, but does
not actually send the key. 
Here is a short webdriver test to reproduce the issue. 

Related: https://github.com/angular/protractor/issues/1511#issuecomment-63573621

var webdriver = require('selenium-webdriver');
var driver = new webdriver.Builder().
usingServer('http://localhost:4444/wd/hub').
withCapabilities(webdriver.Capabilities.firefox()).
build();

driver.get('https://staging.eversnapapp.com/view');
driver.findElement(webdriver.By.css('.navbar #sign-up-navbar > #navbar-registration-button')).click();
driver.wait(function() {
return driver.findElement(webdriver.By.css('#registrationModalView.modal')).isDisplayed();
});

driver.findElement(webdriver.By.css('#registrationModalView.modal form[name="regForm"]

input_last_name')).sendKeys('A user');

driver.findElement(webdriver.By.css('#registrationModalView.modal form[name="regForm"]

input_email')).sendKeys('auser@test.com');

driver.findElement(webdriver.By.css('#registrationModalView.modal form[name="regForm"]

input_password')).sendKeys('123456');

driver.findElement(webdriver.By.css('#registrationModalView.modal form[name="regForm"]

input_confirm_password')).sendKeys('123456');

driver.wait(function() {
return driver.findElement(webdriver.By.css('#registrationModalView.modal #registrationModal
form[name="regForm"] .modal-footer > #modal-register-button')).isEnabled();
});

driver.quit();


Here all it's doing is clicking on the register button so a form appears. At this point
we enter strings into all 4 fields and wait for the register button to become enabled
(which is enabled only when everything is filled out). During the test you will notice
that text is not entered into the first field, but is in the remaining 3. The reason
is that the focus is on firefox's url field until the first send key, but nothing is
entered; after that, since the focus is on the app now, additional send keys will start
working. 

Additionally, in support of the focus theory. Doing a clear before sendKeys will work,
and doing a click() before sendkeys will work. In addition, if you manually click on
the webpage the moment the browser comes up before any test is ran (to take the focus
away from the url bar) the test also passes.

OS: OSX 10.9.5
Browser: Firefox
Browser version: 33.0
selenium-server-standalone-2.44.0.jar

Reported by hankduan@google.com on 2014-11-19 01:00:51

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by barancev on 2014-12-01 21:06:10

  • Labels added: Browser-Firefox, OpSys-OSX

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

The target page is not accessible. Please create a reproduction scenario against a page
that is available in public.

Reported by barancev on 2015-03-22 22:16:03

  • Status changed: NeedsClarification

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

I cannot bring the target page back up anymore because the person who reported the issue
originally (and provided the target page) is no longer with the project.

Unless any of the watchers of this issue can produce a reproducible case, I'm okay
if you just close this. Thanks!

Reported by duan.hank on 2015-03-23 19:15:38

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by barancev on 2015-03-29 22:30:00

  • Status changed: Invalid

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by luke.semerau on 2015-09-17 18:24:50

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 4, 2016
@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant