New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sendKeys() only passes partial value #2019
Comments
Can you tell us your browser version, version of webdriver, and OS? |
Sure, I'm using:
|
@kleinerroemer are you using a non-English keyboard or remote display or any other configuration that might confuse the keyboard mappings? Chromedriver has had some problem configurations where it drops characters out of sendKeys. See #698 and http://stackoverflow.com/questions/18483419/selenium-sendkeys-drops-character-with-chrome-driver and https://code.google.com/p/chromedriver/issues/detail?id=1037 (the non-English keyboard bugs seem to be fixed recently, though.) Alternatively, the bug might be in the code after your |
my keyboard layout is set to german but switching to english layout didn't change anything. sendKeys always skips the keys at a different point. I don't use remote display. I doubt that the bug is in my method, since it worked just fine before upgrading. My current workaround looks like this:
|
It looks like we have a similar issue here. On the install of a colleague (windows 7, protractor 1.5, chrome 42.0.2311.90) everything is fine. From what we could observe, the problem does not seems to happen on a windows machine (there's always a first time) but on ubuntu, whatever the version is, it happens all the time. |
I am still getting this problem, particularly in chrome. It seems totally random - sometimes it works and sometimes it doesn't. eg:
will not output the current timestamp, but something like |
I experience this is well. In my case, the tested application is based on Angular 2 and it happens only with the export function sendKeys(element:protractor.ElementFinder, string:string):void {
"use strict";
for (let i:number = 0; i < string.length; i++) {
element.sendKeys(string.charAt(i));
}
} but it significantly slows down the tests. |
I'm also experiencing this issue now. Upgrading tests from 1.8.0 to 2.5.1. I have some tests randomly failing now that used to work. These are on a page where browser.ignoreSynchronization = true; I will do something like: input1.sendkeys('abc'); I will either see this: Input1: 'ab' or Input1: 'abcdef' Using Chrome: Version 46.0.2490.86 m |
@brocsk @radek-holy are either of you able to create a reproducible case we can test against using http://www.protractortest.org/testapp/? |
No, sorry, I am not able to reproduce it against the Testapp. Here is the simplest reproducer I am able to come up with: http://plnkr.co/edit/f0LQ0zLvtr8HEodySl35 . For some reason, it's necessary to call |
I've encountered a similar issue with I'm running my tests so far on non-angular pages with I'm currently working on reproducing the problem on the testapp. Update - I didn't manage to reproduce it with the testapp. And I actually have maybe a different issue because for me the first part is missing and the last characters show up. Always after few reloads of the browser. However this problem persists even when I ensure that the element is being displayed:
and when I add a My current workaround is now:
This sets the correct value eventually. |
👍 Thank you for the workaround @pgrm! This problem was hitting me probably about 8 times out of 10 on the first test in my suite. FWIW, my platform below.
|
I'm experiencing the same issue as @radek-holy described on Angular 2 with input fields. |
I spent a whole day trying to figure out why my tests were suddenly failing. This workaround fixed all my troubles. Thank you ! |
I am not using Angular 2. I have protractor 3.0.0. My input fields on login screen no more work! SendKeys() don't seem to work at all. even clear() does not work on the inputs. I get an error invalid element state: element must be user-editable in order to clear it. I actually click() the input before trying to clear it. |
Hi, Try with below example, inputUsername.sendKeys(protractor.Key.chord(protractor.Key.CONTROL, "a")); Here instead of clear(), we can use "inputUsername.sendKeys(protractor.Key.chord(protractor.Key.CONTROL, "x"));" |
@juliemr Here is the environment I used: |
Splitting up the string seems to fix the issue for me, for example:
|
Two years later and @sdsanders' hotfix is still the way to go |
2.5 years and we are still waiting.... it is f$%#! not usable like this. |
Just implemented @sdsanders hotfix on an Angular Material form. It seems to be the only stable solution. |
Just in case anybody it's still facing this problem. |
@aterrong could you elaborate on your solution? Where are you getting getClock? |
Drop IE11 testing for now because I cannot get SendKeys to work consistently. Every now and then, some random keys within a string will not be sent. Some workarounds that could work: - https://stackoverflow.com/a/43616117/489916 - angular/protractor#2019 (comment)
Drop IE11 testing for now because I cannot get SendKeys to work consistently. Every now and then, some random keys within a string will not be sent. Some workarounds that could work: - https://stackoverflow.com/a/43616117/489916 - angular/protractor#2019 (comment)
Drop IE11 testing for now because I cannot get SendKeys to work consistently. Every now and then, some random keys within a string will not be sent. Some workarounds that could work: - https://stackoverflow.com/a/43616117/489916 - angular/protractor#2019 (comment)
Animations seem to be a problem. Since I want to have animations I ended up with a fix where I assert that the dialog is ready for input by testing for the visibility of the modal without the ng-animating class on it (Xpath: //mat-dialog-container[not(contains(@Class, 'ng-animating'))]). |
After upgrading to protractor 2.0 my login tests started failing.
In my PO I use the following function to handle input values:
I found out that sendKeys only passes the first part of the value (always with a different length, sometimes one character sometimes n-1). Even if I make a conditional wait for the input to contain the whole value, the condition never gets fullfilled. It seems like sendKeys randomly stops sending keys from the value.
The text was updated successfully, but these errors were encountered: