1

I am trying to find the element Data Access.

The HTML code behind this is:

<ul class="tabs left">
<li id="tabPersonalInformation" class="current first">
<li id="tabSystemAccess">
<li id="tabDataAccess">
<a href="#dataAccess">Data Access</a>
</li>

The C# code that I am using is:

Thread.Sleep(1000);
var wait = new WebDriverWait(Driver.Instance, TimeSpan.FromSeconds(20));
var DataAccess = wait.Until(ExpectedConditions.ElementIsVisible(By.LinkText("Data Access")));
DataAccess.Click();

It is unable to find the field DataAccess. The exception that I am getting is:

An exception of type 'System.InvalidOperationException' occurred in WebDriver.dll but was not handled in user code Additional information: unknown error: Element is not >clickable at point (543, 15). Other element would >receive the click: ...

Can someone please help?

1 Answer 1

1

This is mostly occurred in the chrome browser due to target element overlay with other element. Selenium always perform click on the center of the element so due to overlay of other element it could not be click, In this case you should try to click using IJavaScriptExecutor as below :-

var wait = new WebDriverWait(Driver.Instance, TimeSpan.FromSeconds(20));
var DataAccess =    wait.Until(ExpectedConditions.ElementIsVisible(By.LinkText("Data Access")));

IJavaScriptExecutor js = Driver.Instance as IJavaScriptExecutor;
js.ExecuteScript("arguments[0].click()", DataAccess);

Hope it helps...:)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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