More about links
The click_link command works in three different modes. First it will check if there is a textlink with the defined text. For example you have:
<a href="#">My Link</a>
then you can use:
click_link | My Link
In case you are using an image then you do not have a text. Therefore if the there is no link with the given text the command will look for a link with an id. For example:
<a href="#"><img src="/images/my.jpg" alt="My Image"/></a>
then you can click the link by doing:
click_link | My Image
Sometimes you might have a number of links with the same image. Therefore you can use the id for the link. For example:
<a href="#" id="1"><img src="/images/myimage.jpg"/></a>
<a href="#" id="2"><img src="/images/myimage.jpg"/></a>
<a href="#" id="3"><img src="/images/myimage.jpg"/></a>
In order to click the second link you can do:
click_link | 2
The click command will first of all check if there is a textlink with the given text. If not found it will check if there is a link with an image and the image has an
alt tag with the given text. If still not found it will check if there is a link with an
id with the given text.