I have this issue with selenium; I cannot find i textinput : it always raises this exeception:
Element is not currently interactable and may not be manipulated
in this line:
Driver.FindElement(By.Id("ctl00")).Clear();
I try to put waiting like this:
Waiting.Until(driver =>(By.Id("ctl00")));
and
Waiting.Until(ExpectedConditions.ElementExists(By.Id("ctl00")));
but no luck.
Solution for InvalidElementStateException in Selenium Webdriver. Always try to perform the required operation based on element state. If it is clickable element then perform click and if it supports type event then perform sendkeys. If the element is disabled then enable it first and then perform operations.
A stale element reference exception is thrown in one of two cases, the first being more common than the second: The element has been deleted entirely. The element is no longer attached to the DOM.
If the exception gets thrown on Clear()
,
the element is most likely present on the page and the input in a readonly
state.
Try to validate XPath first as might be that targeting more than one element. Due to this, element not currently interactable and may not be manipulated.
I faced same issue and found solution with above as my XPath was locating multiple element which exists on DOM but not page.
Correct the element XPath, error will resolve automatically with adding webdriver wait.
I hit the same error, was also a bit confused, but resolved it using the below wait condition. The elementToBeClickable
condition checks that the element is both visible and enabled. Perhaps visibility is enough, but Selenium throws an explicit ElementNotVisibleException
, so I'm not sure why I wouldn't get that...
Anyways, I opted to use a more robust wait condition, and it has worked well for me.
wait.until(ExpectedConditions.elementToBeClickable(By.id("myElementId"))).clear();
This happens sometimes when element is not visible. It would happen even when element is visible also. Try using with different tags like xpath or etc.
You can check the element status using below script
driver.findElement(By.className("")).isEnabled()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With