I want to click on anchor tag whose class id is clsArrowClick and the same id is on another anchor tag.
<td class="text-center" style="width: 25% !important;">
<td class="arrow" data-toggle="tooltip" data-container="body" title=""
style="width: 25% !important; text-align:center" data-original-
title="Select/Show Data">
**<a id="clsArrowClick" class="clsarrowClick" href="#"
onclick="javascript:OpenAddNewWellPopup(this);">
<i class="fa fa-arrow-right"/>
</a>**
<input id="hdnIsSaved0" class="hdnIsArrowSaved" value="0" type="hidden"/>
</td>
</tr>
<tr id="2">
<td style="width:50%; class=" '="" data-container="body" data-
toggle="tooltip" title="" data-original-title="abcd">abcd</td>
<td class="text-center" style="width: 25% !important;">
<td class="arrow" data-toggle="tooltip" data-container="body" title=""
style="width: 25% !important; text-align:center" data-original-
title="Select/Show Data">
**<a id="clsArrowClick" class="clsarrowClick" href="#"
onclick="javascript:OpenAddNewPopup(this);">
<i class="fa fa-arrow-right"/>
</a>**
<input id="hdnIsSaved1" class="hdnIsArrowSaved" value="0" type="hidden"/>
</td>
I tried list, wait method and simple way everything, but my program throws an error Exception in thread "main" org.openqa.selenium.ElementNotVisibleException
Like
//WebDriverWait wait = new WebDriverWait(driver,30); //wait.until(ExpectedConditions.presenceOfElementLocated(By.className("clsArrowClick"))); //driver.findElement(By.className("clsarrowClick")); driver.findElement(By.xpath("(.//*[@id='clsArrowClick'])[1]")).click();
id
s should be unique. – Alessandro Da Rugna