Not able to click out side of the drop-down – selenium angular

Issue

Angular 11.0.2 web application

To check if validation message is displayed or not when value is not selected from the drop-down, I am clicking outside of the drop-down, but getting ElementNotInteractableException

Also In the inspector window, I am not able to inspect any of the elements when the drop-down is visible.
Getting div.cdk-overlay-backdrop cdk-overlay-transparent-backdrop cdk-overlay-backdrop-showing when trying to inspect.

Please find the below screenshot for same.

enter image description here

Solution

There are two ways of handling it, either you can click outside of the drop down using a different elements tag name
or use seleniums mouse click action using co-ordinates (Ex: 0,0) whivh is outside of the drop down.

  1. driver.findElement(By.tagName("body")).click();

  2. Actions action = new Actions(driver); action.moveByOffset(0, 0).click().build().perform();

Answered By – Aruna

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published