java - How to click a href link using Selenium -
i have html href
link
<a href="/docs/configuration">app configuration</a>
using selenium need click link. currently, using below code -
driver.findelement(by.xpath("//a[text()='app configuration']")).click();
but it's not redirecting page. tried below code -
driver.findelement(by.xpath(//a[@href ='/docs/configuration']")).click();
but throwing below exception -
org.openqa.selenium.elementnotvisibleexception: element not visible , may not interacted command duration or timeout: 13 milliseconds
the link visible , page loaded. don't know what's wrong code.
webdriver.findelement(by.xpath("//a[@href='/docs/configuration']")).click();
the above line works fine. please remove space after href.
is element visible in page, if element not visible please scroll down page perform click action.
Comments
Post a Comment