I'm currently utilizing the selenium webdriver to automate a specific webpage. However, I am encountering an issue where my selenium code is unable to identify a certain link, resulting in the following error message.
Exception in thread "main" org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/font/font/b/a[2]"} (Session info: chrome=44.0.2403.89)
This is the excerpt of code that I have been working with:
public static void main(String[] args)
{
System.setProperty("webdriver.chrome.driver","C:\\Program Files (x86)\\Google\\Chrome\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("url");
driver.findElement(By.xpath("/html/body/font/font/b/a[2]")).click();
}
Any help or insights on resolving this issue would be greatly appreciated. Thank you.