2

I've faced a problem using Selenium and chromedriver. When using sendKeys() method with capitals, letters are rearranged. For example, I use:

element.sendKeys("ABCD")`

but in runtime it sends "CDAB" string.

As far I played with this method, it happens only with CAPITALS.

Does anyone know the reason why?

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352

1 Answers1

2

The text based HTML of the element would have been helpful to debug the issue in a better way.

However, it is always recommened that to send a character sequence to any <input> field you need to induce WebDriverWait to elementToBeClickable() for the element to render completely and you can use the following solution:

new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.cssSelector("element_cssSelector"))).sendKeys("ABCD");
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352