Selenium Getting an error message when I try to click elements on the page

0

When I arrive on a page that has multiple clicks of radio buttons, and buttons, etc I often get the error message below. It seems to be random on which element this error is thrown on:

Error message:

System.InvalidOperationException HResult=0x80131509 Message=unknown error: Element ... is not clickable at point (1221, 755). Other element would receive the click: ... (Session info: chrome=63.0.3239.84) (Driver info: chromedriver=2.34.522940 (1a76f96f66e3ca7b8e57d503b4dd3bccfba87af1),platform=Windows NT 10.0.15063 x86_64) Source=WebDriver StackTrace: at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) at OpenQA.Selenium.Remote.RemoteWebElement.Click() at TestAutomationFrameworkPOMS.ComponentHelper.ButtonHelper.ClickButton(By locator) in C:\Users\User\Desktop\TestAutomationFrameworkPOMS v0 2\TestAutomationFrameworkPOMS\ComponentHelper\ButtonHelper.cs:line 14 at TestAutomationFrameworkPOMS.StepDefinition.ContactCentre.BasePageStepDefinition.ClickNavigationButton(String buttonText) in C:\Users\User\Desktop\TestAutomationFrameworkPOMS v0 2\TestAutomationFrameworkPOMS\StepDefinition\ContactCentre\BasePageStepDefinition.cs:line 21

ButtonHelper:

public static void ClickButton(By locator)
{
    element = GenericHelper.GetElement(locator);
    element.Click();
}

GenericHelper:

public static bool IsElementPresent(By locator)
{
    try
    {
        return ObjectRepository.Driver.FindElements(locator).Count == 1;
    }
    catch (Exception)
    {
        return false;
    }
}

public static IWebElement GetElement(By locator)
{
    if (IsElementPresent(locator))
        return ObjectRepository.Driver.FindElement(locator);
    else
        throw new NoSuchElementException("Element Not Found : " + locator.ToString());
}
c#
selenium
selenium-webdriver
selenium-chromedriver
asked on Stack Overflow Dec 21, 2017 by Ross

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0