top of page
Search

Selenium sendKeys() does not send all characters

Writer's picture: Tuyen NguyenTuyen Nguyen

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.

2,123 views0 comments

Recent Posts

See All

Comments


Join my mailing list

Thanks for submitting!

© 2019 by Tuyen Nguyen

© 2019 by Tuyen Nguyen

  • White LinkedIn Icon
  • lm29-5xjdbzxe9s94-mn8yw
  • White Instagram Icon
bottom of page