ericmckean / chromedriver

Automatically exported from code.google.com/p/chromedriver
0 stars 0 forks source link

SendKeys sometimes fails to put all text in a textbox #986

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Version:
WebDriver.ChromeDriver.win32 version 2.12.0.0

Issue Description:
SendKeys sometimes only puts the beginning of a string in the textbox. The 
behavior seems to get worse if the browser/computer goes slow. Thread.Sleep 
after SendKeys seems to have little effect.

Steps to reproduce:
Random behavior

Regardless of how slow the browser/computer is, this call should succeed.

I also want to know if there is a known version where the defect was introduced.

Original issue reported on code.google.com by purgina...@gmail.com on 3 Dec 2014 at 7:35

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

do you have any small test program that will address this issue.
I am working on the fix of SendKeys in the driver.
with your test program,  I hope the fix will also include your issue.

Original comment by andrewch...@chromium.org on 4 Dec 2014 at 12:39

GoogleCodeExporter commented 9 years ago
I am seeing this too except that the driver always fails to enter all text in 
my case. The test calls sendKeys("Hello World!") but the driver enters only 
"Hello" into the textfield. Sleeping / waiting doesn't help.

Chrome 36.0.1985.125 on Linux (on SauceLabs)
Selenium: 2.44.0

The test:
https://github.com/fscheffer/arras/blob/master/arras-components-demo/src/test/ja
va/com/github/fscheffer/arras/demo/RemoteSubmitIT.java

excerpt from the selenium log:

[104.956][INFO]: Done waiting for pending navigations
[104.956][INFO]: RESPONSE FindElement {
 "ELEMENT": "0.8765186725649983-2"
}
[105.048][INFO]: COMMAND ClearElement {
 "id": "0.8765186725649983-2"
}
[105.048][INFO]: Waiting for pending navigations...
[105.048][INFO]: Done waiting for pending navigations
[105.067][INFO]: Waiting for pending navigations...
[105.067][INFO]: Done waiting for pending navigations
[105.067][INFO]: RESPONSE ClearElement
[105.282][INFO]: COMMAND TypeElement {
 "id": "0.8765186725649983-2",
 "value": [ "Hello World!" ]
}
[105.283][INFO]: Waiting for pending navigations...
[105.283][INFO]: Done waiting for pending navigations
[105.434][INFO]: Waiting for pending navigations...
[105.884][INFO]: Done waiting for pending navigations
[105.884][INFO]: RESPONSE TypeElement
[106.141][INFO]: COMMAND FindElement {
 "using": "css selector",
 "value": "#visibleExample input[type=text]"
}
[106.143][INFO]: Waiting for pending navigations...
[106.144][INFO]: Done waiting for pending navigations
[106.155][INFO]: Waiting for pending navigations...
[106.155][INFO]: Done waiting for pending navigations
[106.155][INFO]: RESPONSE FindElement {
 "ELEMENT": "0.6754643849562854-1"
}
[106.244][INFO]: COMMAND GetElementAttribute {
 "id": "0.6754643849562854-1",
 "name": "value"
}
[106.244][INFO]: Waiting for pending navigations...
[106.244][INFO]: Done waiting for pending navigations
[106.254][INFO]: Waiting for pending navigations...
[106.254][INFO]: Done waiting for pending navigations
[106.254][INFO]: RESPONSE GetElementAttribute "Hello"

Original comment by fschef...@felix-scheffer.de on 4 Dec 2014 at 4:03

GoogleCodeExporter commented 9 years ago
ok,  let me look into it.

Original comment by andrewch...@chromium.org on 4 Dec 2014 at 6:31

GoogleCodeExporter commented 9 years ago
How often is "sometimes" - ratio?
can you use current stable version?  - Chrome 39 
let me  know how it goes?

Original comment by andrewch...@chromium.org on 5 Dec 2014 at 8:50

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I tried Chrome 35 and 39 with the same result. I also tried replacing spaces by 
KEYS.SPACE without any noticeable effect.

Original comment by fschef...@felix-scheffer.de on 6 Dec 2014 at 1:16

GoogleCodeExporter commented 9 years ago
don't know how to run your test case.
My little  test program - a simple Java program
driver.findElement(By.name("MemberInformation.FirstName")).sendKeys("Hello 
World!");
the results are  always good, and it never failed. 
your case may involve other scenario - css selector 
can you provide me normal Java test program so that I can run in my set up?

Original comment by andrewch...@chromium.org on 6 Dec 2014 at 1:39

GoogleCodeExporter commented 9 years ago
Hi,

I created a simple maven project:
https://github.com/fscheffer/arras/raw/master/files/chrome-sendkeys-test.zip

While creating this test, I noticed that the text is actually present in the 
textfield for a VERY short time. Then the focus changes and the "World"-part 
disappears.

Hope that helps!
Felix

Original comment by fschef...@felix-scheffer.de on 6 Dec 2014 at 4:04

GoogleCodeExporter commented 9 years ago
Hi,

i ran both test, the original test and the simplified test, on my local 
computer using Chromium (Ubuntu 14.04) and both tests work fine!

When I run the same tests on SauceLabs (using Google Chrome), both tests 
fail... 

Original comment by fschef...@felix-scheffer.de on 6 Dec 2014 at 5:33

GoogleCodeExporter commented 9 years ago
Hi,

i tried more combinations of Chrome and OSs (on SauceLabs):

Chrome 26 on Windows: FINE
Chrome 39 on Windows: FINE

Chrome 26 on Linux (chomedriver 26.0.1383.0): FINE
Chrome 28 on Linux (chomedriver 26.0.1383.0): FINE
Chrome 29 on Linux (chomedriver 2.4.226074): FAIL
Chrome 39 on Linux (chomedriver 2.11): FAIL

Does this make any sense to you?

Original comment by fschef...@felix-scheffer.de on 7 Dec 2014 at 9:05

GoogleCodeExporter commented 9 years ago
what version of chromedriver you run on windows?
can you run most recent version chromedriver for Linux - at least 2.12?

Original comment by andrewch...@chromium.org on 8 Dec 2014 at 6:26

GoogleCodeExporter commented 9 years ago
version 2.12 is not available on SauceLabs (I created a support request to make 
it available). I am not sure about the version of the chrome driver under 
windows, I think it's 2.11, but there's nothing in the log file.

I uploaded a video of the issue...may that helps.
https://github.com/fscheffer/arras/raw/master/files/video_215139847055470fa6da8d
0717aac721.flv

Original comment by fschef...@felix-scheffer.de on 8 Dec 2014 at 8:49

GoogleCodeExporter commented 9 years ago
It is only one textbox where I have problems. It is nothing special with that 
textbox, no script is triggered because of it. It seems to be totally innocent.
I tried to put the word "test" in it by using SendKeys, but only "te" goes in.
If I try to call SendText once per letter, it seems to work. I can then read 
the word "test" in it.

Original comment by purgina...@gmail.com on 17 Dec 2014 at 1:57

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
my test  results (with different length of words)
Chrome 39 on Linux (chomedriver 2.9): FINE
Chrome 39 on Linux (chomedriver 2.12): FINE

Original comment by andrewch...@chromium.org on 17 Dec 2014 at 11:03

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
By sending letter by letter, it seemed like the was entered correctly into the 
textbox, but now, "test" became "est" for me.

Original comment by purgina...@gmail.com on 18 Dec 2014 at 10:44

GoogleCodeExporter commented 9 years ago
sendKeys("Hello World!")  should work.  can you create many textboxs, and use 
sendKeys.

Original comment by andrewch...@chromium.org on 18 Dec 2014 at 6:22

GoogleCodeExporter commented 9 years ago
Every form I have consists of many textboxes, I must have misunderstood you.

Original comment by purgina...@gmail.com on 18 Dec 2014 at 8:57

GoogleCodeExporter commented 9 years ago
For  #14
you have one textbox has problem. can you find a way to trouble-shoot that?
create another one etc...

Original comment by andrewch...@chromium.org on 18 Dec 2014 at 9:14

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Creating another one is not an error narrowing down procedure I know anything 
about. I can try to create a minimal error reproduction, but I am afraid I will 
not always get an error.

Original comment by purgina...@gmail.com on 18 Dec 2014 at 9:22

GoogleCodeExporter commented 9 years ago
I am experiencing a similar issue where spaces are being interpreted as new 
lines e.g. If send "Test User" to a First name field, only the first word is 
entered into that field. the last word goes into the next field.
Im using Saucelabs to run my tests

Original comment by denisha....@takealot.com on 22 Jan 2015 at 9:18

GoogleCodeExporter commented 9 years ago
#24 try you best to have a test case. otherwise,  very difficult for us to 
trouble shoot.

#25  spaces  is used all the time. can you run the same program without 
Saucelabs 

Original comment by andrewch...@chromium.org on 22 Jan 2015 at 6:29

GoogleCodeExporter commented 9 years ago
With the version ChromeDriver.win32.2.13.0.0 it seems like my problematic test 
runs without problems.

Original comment by purgina...@gmail.com on 6 Feb 2015 at 12:51

GoogleCodeExporter commented 9 years ago
Good to hear that

Original comment by andrewch...@chromium.org on 6 Feb 2015 at 6:18

GoogleCodeExporter commented 9 years ago

Original comment by samu...@chromium.org on 21 Feb 2015 at 12:26