When I press "button" by attribute

Press a button by its attribute (id, class, name, placeholder, data-*).

Step pattern

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

Examples

Example #1
When I press "btn-pressid" by attr
Example #2
When I press "btn-pressid" by attribute
Example #3
And I press "Your full name" by "placeholder" attribute
Example #4
And I press "Your full name" by its "placeholder" attribute
Example #5
And I press "save-name" by "data-selector" attr