Skip to content

Instantly share code, notes, and snippets.

@cnparmar
Created February 25, 2020 07:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cnparmar/49d5318fdd489ef8f0f82331e8eb4a7b to your computer and use it in GitHub Desktop.
Save cnparmar/49d5318fdd489ef8f0f82331e8eb4a7b to your computer and use it in GitHub Desktop.
Unable to click on element using selenium normal click.
Hi,
I am using Selenium 4 alpha to run my tests and facing an issue. The issue is like at quite a few places normal selenium click (i.e. driver.findElement("").click()) doesn't work.
If I use, javascriptExecute interface and try to click on it using executeScript(), then it works fine.
Element Locator -
<a href="{someURL}">Test Central</a>
Selenium Code -
WebDriver driver = new SafariDriver();
driver.findElement(By.linkText("Test Central")).click();
Any particular reason why this is happening? Currently I am seeing this behavior in Chrome and Safari but I suspect it will be same in other browsers as well.
Chandresh Parmar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment