Debugging “Element is not clickable at point” error

后端 未结 30 2118
余生分开走
余生分开走 2020-11-21 23:55

I see this only in Chrome.

The full error message reads:

\"org.openqa.selenium.WebDriverException: Element is not clickable at point (411, 675

30条回答
  •  一生所求
    2020-11-22 00:28

    It's funny, all the time I spent looking at the various responses, no one had tried the obvious, which of course, I hadn't either. If your page has the same id used multiple times, as mine did, ("newButton",) and the one you want is not the first one found, then you will in all likelihood get this error. The easiest thing to do (C#):

    var testIt = driver.FindElements(By.Id("newButton"));
    

    Note it's FindElements, not FindElement.

    And then test to see how many results came back from the retrieval. If it's the second one, you can then use:

    testit[1].Click();
    

    Or get whomever reused ids to fix them.

提交回复
热议问题