I am trying to click on a hyperlink without a link text.
I have:
<a id="fontColor" href="f?p=420181023:1:12264109389989:1416222:NO::P1_SEMCODE:20190">
<strong>Check</strong>
</a>
I've tried:
driver.findElement(By.xpath("//a[@href='f?p=420181023:1:12264109389989:1416222:NO::P1_SEMCODE:20190']")).click();
Causes No.SuchElementException
driver.findElement(By.id("fontColor")).click();
Does nothing
I have read different materials from different websites but it seems none mention hyperlinks without link text. Is there a alternative to
By.xpath()
By.id()
By.linkText()
Sources: