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());
}
User contributions licensed under CC BY-SA 3.0