0

In dropdown list is element "Set time" but this element is not currently visible. enter image description here

I was trying set driver.Manage().Window.Maximize(); and also window size to 1920, 1080.

Assert.IsTrue(driver.FindElement(By.LinkText("Set time")).Displayed);
driver.FindElement(By.LinkText("Set time")).Click();
Thread.Sleep(2000);
driver.FindElement(By.Id("retM")).Clear();
driver.FindElement(By.Id("retM")).SendKeys("1");
driver.FindElement(By.Id("btnOK_CD")).Click();

I'm unable to click on element by:

driver.FindElement(By.LinkText("Set time")).Click();

and in the next step of code:

driver.FindElement(By.Id("retM")).Clear();

I got exception Element is not currently interactable and may not be manipulated.

I was trying to select element by XPath, by CSS, by Id...with same result.

Please, can you help me how to click on not currently visible element in dropdown menu ?

2 Answers 2

1

You cannot.

That the whole point of Selenium. If user cannot do it (like when element is hidden), Selenium (by design) does not allow to do that.

0

After opening the drop down menu, try to scroll down till the link you want to click is visible and then click it.

Try to scroll with something like,

var element = driver.FindElement(By.id("element-id"));
Actions actions = new Actions(driver);
actions.MoveToElement(element);
actions.Perform();

OR

driver.FindElementByClassName("body").SendKeys(Keys.PageDown); 

followed by your code to click on the link.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.