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

sendKeys() with input type number doesn't register a value with Firefox 31 #7809

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

Comments

@lukeis
Copy link
Member

lukeis commented Mar 4, 2016

Originally reported on Google Code with ID 7809

What steps will reproduce the problem?
1. Using Protractor with Selenium testing Firefox 31 with Sauce Labs configured for
Linux, use code like the following in a test of an input element with type "number":

element(by.id('id_count')).sendKeys('100');
expect(element(by.id('id_count')).getAttribute('value')).toBe('100');

What is the expected output? What do you see instead?

The expected behavior is for a value of '100' to be retrieved.  Instead, the retrieved
value is the empty string.

Selenium version: 2.42.1
OS: Linux
Browser: Firefox
Browser version: 31


Please provide any additional information below. A sample reduced test
case, or a public URL that demonstrates the problem will intrigue our merry
band of Open Source developers far more than nothing at all: they'll be far
more likely to look at your problem if you make it easy for them!

Things work as expected with Firefox 28.  See also this Stackoverflow post which contains
more info and a simpler way to reproduce the issue:

http://stackoverflow.com/questions/23412912/selenium-send-keys-doesnt-work-if-input-type-number


Reported by chris.jerdonek on 2014-08-30 18:00:42

@lukeis lukeis self-assigned this Mar 4, 2016
@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Please provide a proof of the issue. I can't reproduce it.

Here is the sample code:

DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setVersion("31");
capabilities.setPlatform(Platform.LINUX);
capabilities.setCapability("selenium-version", "2.42.1");
// Create the connection to Sauce Labs to run the tests
WebDriver driver = new RemoteWebDriver(
    new URL("http://xxx:xxx@ondemand.saucelabs.com:80/wd/hub"),
    capabilities);

driver.get("http://fiddle.jshell.net/barancev/4xmnde8s/show/light/");
WebElement num = driver.findElement(By.id("num"));
num.sendKeys("100");
System.out.println(num.getAttribute("value"));
driver.quit();

And the result is: https://saucelabs.com/tests/3d3174055f734a70811f9791230bd987

Reported by barancev on 2014-08-30 19:42:19

  • Status changed: NeedsClarification
  • Labels added: Browser-Firefox

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Thanks for looking into this.  Hmm, here is an example of one of my Travis failures:

https://travis-ci.org/cjerdonek/quick-sampler/builds/33986945

And here is the line of test code:

https://github.com/cjerdonek/quick-sampler/blob/1ce18051180b0b2515bd891e3eac11fbd00a62a8/test/e2e/test.js#L47

This simple assertion passed on Sauce Labs with Chrome and IE 10, but never with Firefox
31.  It started passing only when I switched to Firefox 28 and kept everything else
the same.

How is your test different from what is described in the Stackoverflow post?  My experience
matches what was described there.  Do you have a suggestion for what else I should
try?  If I can only reproduce the issue using Protractor, should I file a Protractor
issue?

Reported by chris.jerdonek on 2014-08-30 22:04:51

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

@barancev, could you try running your test against the following URL with input element
id "id_total_count"?

http://cjerdonek.github.io/quick-sampler/#/


Reported by chris.jerdonek on 2014-08-30 22:14:38

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Okay, you can close this.

I figured out what was wrong.  I wasn't telling Sauce Labs what Selenium version to
use, and Sauce Labs defaults to an old version.  Manually specifying the latest version
gets things working.  Thanks.

Reported by chris.jerdonek on 2014-08-31 01:35:19

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by barancev on 2014-08-31 09:43:02

  • Status changed: Invalid
  • Labels removed: Status-Untriaged

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

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

  • 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