I have a html href
link
<a href="/docs/configuration">App Configuration</a>
using Selenium I need to click the link. Currently, I am using below code -
Driver.findElement(By.xpath("//a[text()='App Configuration']")).click();
But it's not redirecting to the page. I also tried below code -
Driver.findElement(By.xpath(//a[@href ='/docs/configuration']")).click();
But this is throwing below exception -
org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with
Command duration or timeout: 13 milliseconds
The link is visible and page is completely loaded. I don't know what's wrong with my code.
webDriver.findElement(By.xpath("//a[@href='/docs/configuration']")).click();
The above line works fine. Please remove the space after href.
Is that element is visible in the page, if the element is not visible please scroll down the page then perform click action.