-1

I used DebanjanB's answer, but it didn't solve the error:

Element is not clickable at point (860.5999755859375,36.69999694824219) because another element obscures it.

IWebDriver MyDriver = new FirefoxDriver();
IWebElement Element1 = MyDriver.FindElement((By.XPath("//a[@class='pagination-button pagination-button--next']")));
//IWebElement Element1 = MyDriver.FindElement((By.XPath("//html/body/main/div/div/div[3]/section[2]/header/div[1]/ul/li/a[@class='pagination-button pagination-button--next']")));
Element1.Click();

I get the error once in about ten times.

JeffC
  • 22,180
  • 5
  • 32
  • 55
cyrus2500
  • 428
  • 4
  • 15
  • 1
    What is obscuring the element? You need to deal with that... there's no one size fits all for that. Approach it like a user would... what would a user do to fix the situation? Is it a dialog? Close it. Is it a Loading... screen? Wait for it to appear and then disappear... the list goes on. Update your question with more info and the relevant HTML. – JeffC Nov 06 '18 at 14:28

1 Answers1

3

The solution you tried to use was Java. You've posted this under C#. If the element is obscured and doesn't go away (the overlapping element) e.g. a loading screen use javascript to delete it from the dom then click.

This should work. please replace my button with your identifier

WebDriverWait wait = new WebDriverWait(Driver, TimeSpan.FromSeconds(15));
IWebElement element = wait.Until(ExpectedConditions.ElementToBeClickable(myButton));

Edit:

Don't forget to actually click the element.

element.click();
RumbleJungle
  • 100
  • 6