Accessing Image Links
Image links are the links in web pages represented by an image which when clicked navigates to a different window or page.
Since they are images, we cannot use the By.linkText() and By.partialLinkText() methods because image links basically have no link texts at all.
In this case, we should resort to using either By.cssSelector or By.xpath. The first method is more preferred because of its simplicity.
In the example below, we will access the "Facebook" logo on the upper left portion of Facebook's Password Recovery page.
We will use By.cssSelector and the element's "title" attribute to access the image link. And then we will verify if we are taken to Facebook's homepage.
This is all to clicking images. Accessing image link is done using By.cssSelector()