I have this piece of code
<a href="/iot/apply/device.do" id="subMenu1" class="fortification55"
onclick="$('#deviceinfo').hide()">Apply</a>
I am trying to link by href using
getDriver().findElement(By.name("subMenu1")).click();
But i got this error
org.openqa.selenium.NoSuchElementException: Unable to find element with name == subMenu1 (WARNING: The server did not provide any stacktrace information)