Skip to main content
2 of 4
fixed HTML format and typos, added OP's xpath from comments

Not able to click on menu using selenium webdriver java

I am not able click on the specific element, which is in the image format. I have tried using available locators i.e id and image using xpath and remaining locators are same for all remaining menus. Please help me guys. Below is the HTML code. In the below code class locator is same for all other menus. How to automate this type of scenario?

<a href="#" class="nav-link nav-toggle" onclick="OnReportImageClick()">
   <img src="/Images/reports.png">
   <span class="title">Reports</span>
</a>

The xPath I have tried is //*[@id="ReportsView"].