top of page
Search

Selenium sendKeys() does not send all characters

Updated: Dec 27, 2022

Problems:


Have you ever met the issues of inputting a text which was not filled in completely by the automation driver? The selenium is not sending the complete string to the field?

Example:

  • your code: txtFirstName.sendKeys("My password")

  • actual result: the text box only filled with "My passw" (fewer characters than the demand)

Root causes:


This issue of this sendKeys() is supposed to come from the issue of Angular. Angular (version < 2.0) can't process input events when they arrive too fast.


Solutions:


Try each solution and find the best approach for yourself:

  1. Update your SUT to a new version of Angular (should be > 2.0).

  2. Click on the field, clear the text and try to send keys again.

  3. Send every single character with a small delay between each.

  4. Add a thread sleep for a specified amount of time (~200 millisecs or more) due to the bug, and then try to send keys again.

1,908 views0 comments

Comments

Couldn’t Load Comments
It looks like there was a technical problem. Try reconnecting or refreshing the page.
bottom of page