Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

1 like 0 dislike
251 views
by The go-to Tester (324 points)

Is there a way to click hidden LINK in web driver?

explain with code

1 Answer

1 like 0 dislike
by The go-to Tester (181 points)

You can try clicking on the link using custom JavaScript.

 

WebElement element = driver.findElement(By.id("Your id here"));
JavascriptExecutor js = (JavascriptExecutor)driver;
js.executeScript("arguments[0].click();", element);

Hope that helps!


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

...