Selenium click link-How to click a href link using Selenium
I have an html href link
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 the page is completely loaded. Can anyone help with this?
webDriver.findElement(By.xpath("//a[@href='/docs/configuration']")).click();
The above line works fine. Please remove the space after href.
If the element is not visible please scroll down the page then perform click the action
Or
selenium click link-How to click a href link using Selenium
App Configuration
Driver.findElement(By.xpath("//a[text()='App Configuration']")).click();
Driver.findElement(By.xpath(//a[@href ='/docs/configuration']")).click();