I am a beginner with selenium and I have encountered a problem while trying to click on a specific element using the following locators. Unfortunately, none of them seem to work as expected and my scripts just skip over that particular line without any errors being shown.
Here is the HTML snippet:
<a class="board-icons" href="/htw/qmsHtwDoc/newRegQueries">
<i class="fa fa-file-text-o"></i>
</a>
driver.findElement(By.cssSelector("i.fa.fa-file-text-o")).click();
(or)
driver.findElement(By.xpath("//div[3]/div/div/div/a/i")).click();
(or)
driver.findElement(By.xpath("//div[@id='sub-container']/div/div/div/a/i")).click();
I also tried using the Actions class, but it did not help in resolving the issue.
Actions actions = new Actions(driver);
WebElement ele = driver.findElement(By.xpath("//div[@id='sub-container']/div/div/div/a/i"));
actions.moveToElement(ele).build().perform();
ele.click();
If anyone has suggestions or can provide assistance with this issue, it would be greatly appreciated.