How can I write a keyword for my test case with Selenium2Library to click on a button with no element id?
Below is the html code. I am new to selenium!
<a href="redirect.cfm?app=profile">
<div id="profile" class="icon">
<img style="display:block; margin:0 auto;" src="assets/images/profile.png">
<h3>Profile</h3>
</div>
</a>
I've tried
driver.findElement(By.Xpath("//img[@src='assets/images/profile.png']")).click();
But got the error:
LoginTest
| FAIL | ValueError: Element locator with prefix 'driver.findElement(By.Xpath("//img[@ src' is not supported