SendKeys method not working with Selenium 2.42.0 in Firefox
Hi there,
we have an issue with Selenium upgrade.
Currently, UI tests for our ASP.NET MVC Web application run on Selenium 2.38.0 and Firefox version 31.0.
Our goal is to update both Selenium and Firefox to the latest versions which are: Selenium 2.46.0 and Firefox 38.0.
There seems to be an issue with IWebElement.SendKeys method in Selenium 2.42.0 because from that version on, our tests fail because values are not set on drop-down lists and text-fields.
This is a code snippet of how we use SendKeys method:
IWebElement dropDown = webElement.FindElement(By.XPath(".//span[contains(@class, 'k-select')]")); dropDown.SendKeys(Keys.ArrowDown);
Since this same piece of code have been working properly with previous versions of Selenium, can you please help us with figuring out if something has changed in the way of how this method is used?
Notes:
- We use this to interact with Kendo UI controls so you can test by running scripts on any of their live demos.
- We also downgraded/upgraded Firefox to many other versions (from 29.0 to the latest one) but the issue still exists.
- What might be interesting is that we also tested it with Selenium IDE 2.9.0 (and the latest Firefox version). Our test case included selection of value in a drop-down list but even if we were able to set it while recording, during reproduction the test failed exactly in a place where it should have selected that value.
Cheers, Aleksandra
For issues please provide a concise reproducible test case and describe what results you are seeing and what results you expect.
See CONTRIBUTING.md
Steps to reproduce with the Selenium IDE 2.9.0 and Firefox:
- Start recording with Selenium IDE 2.9.0
- Open: http://demos.telerik.com/aspnet-mvc/dropdownlist/index
- Select label "Orange" in a drop-down list "Cap Color" (by using arrow keys on a keyboard or any other way)
- Stop recording.
- Play the test.
Expected behavior: the value "Orange" is selected. Observed behavior: drop-down list remains opened with value unchanged.
Can you add the diagnostic information in a git hub gist and post the link here?
On 16 Jun 2015, at 09:25, dzudaleks [email protected] wrote:
Steps to reproduce with the Selenium IDE 2.9.0 and Firefox:
Start recording with Selenium IDE 2.9.0 Open: http://demos.telerik.com/aspnet-mvc/dropdownlist/index Select label "Orange" in a drop-down list "Cap Color" (by using arrow keys on a keyboard or any other way) Stop recording. Play the test. Expected behavior: the value "Orange" is selected. Observed behavior: drop-down list remains opened with value unchanged.
— Reply to this email directly or view it on GitHub.
Here is diagnostic information: https://gist.github.com/dzudaleks/3ca79fbb80403c1a2f79
Don't be confused with Firefox version 31.0, we also tried it with the latest one and result is the same.
For issues please provide a concise reproducible test case, not a narrative description of how to create a reproducible test case.
This is xml version of a Test Case recorded with Selenium IDE. https://gist.github.com/dzudaleks/18c57a307fe70dbe94d7
Please notice that during recording, we changed the value of CapColor dropdown list from "Black" to "Orange" but if you reproduce it, it will just open the dropdown list, without value selected.
It seems like enter keypress performed on this dropdown list was never recorded.
There is also a problem with SendKeys in chrome version 43, the SendKeys function often does not send all the keys. So if you want to send "Hello World" sometimes it will send "He", sometimes it will send "Hello" and sometimes it will send "Hello World"
Are you are reporting that sendKeys command is not working when using the .Net bindings?
As for Selenium IDE notes, recording does not yet support sendKeys, so you will have to manually add the sendKeys command in.
Cheers, Samit
On 15 Jul 2015, at 18:17, mkrouwer [email protected] wrote:
There is also a problem with SendKeys in chrome version 43, the SendKeys function often does not send all the keys. So if you want to send "Hello World" sometimes it will send "He", sometimes it will send "Hello" and sometimes it will send "Hello World"
— Reply to this email directly or view it on GitHub.
I am not using the .net bindings, just straight selenium.
I'm not sure where the disconnect is, but this issue has failed to provide a way for anyone else to reproduce any potential issue.
If one can provide a script to run (since this issue is related to WebDriver + sendKeys, there should be nothing mentioned about Selenium IDE... if there is an issue with IDE, log a separate bug). The script should hit an external url or the html with javascript/css should be provided.
On the only sample page provided, I was able to successfully change the Cap color by doing the following (using Firefox in python, cause I prefer it, but .NET would be similar):
driver.get("http://demos.telerik.com/aspnet-mvc/dropdownlist/index") element = driver.find_element_by_css_selector("span[aria-owns='color_listbox']") element.send_keys(Keys.DOWN)