-1

Tried executing the code but getting:

ElementNotInteractableException: element not interactable 

for the below sendKeys statement. What could be the solution??

WebElement ss = driver.findElement(By.cssSelector("div[class='select__single-value css-1uccc91-singleValue']"));
ss.click();
ss.sendKeys("abc");
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Ziniyaa
  • 1
  • 3

2 Answers2

0

Generally <div> tags are not interactable unless [contenteditable="true"] (How to modify the innerHTML of a contenteditable element) is attribute is explicitly set.


Solution

If your usecase is to invoke click() / sendKeys() generally you have to invoke on <input> elements but not on <div>. Try to identify the element using the inspector opening the and identify the desired <input> element.


References

You can find a couple of relevant detailed discussion on ElementNotInteractableException in:

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

Please make sure you are using the correct path as div tags are usually not interactable.

By.cssSelector("div[class='select__single-value css-1uccc91-singleValue']");

Here, you are using the compound class which is no longer allowed in selenium. So, try using:

By.cssSelector("div[class='.select__single-value.css-1uccc91-singleValue']");
Apps Maven
  • 1,314
  • 1
  • 4
  • 17