When I click "link" by attribute

This step definition is used as a command to click a link, ensuring correct navigation to the expected page.

When (I|we)* click "([^"]*)?" by( its)*( "([^"]*)?")* (attribute|attr)

Define the step for clicking the link by its id|class|name|title or any attribute.

 

Example by direct calling of ID, class:

When I click "#aboutUsid" by attr
When I click ".aboutUsCss" by attribute

 

Or match any of the field attributes:

When I click "aboutUs" by its "id" attribute
When we click "contactUs" by its "class" attr
When we click "contactUs" by attr