@@ -536,15 +536,23 @@ def click_image(self, locator):
536536 element .click ()
537537
538538 @keyword
539- def click_link (self , locator ):
539+ def click_link (self , locator , modifier = False ):
540540 """Clicks a link identified by ``locator``.
541541
542542 See the `Locating elements` section for details about the locator
543543 syntax. When using the default locator strategy, links are searched
544544 using ``id``, ``name``, ``href`` and the link text.
545+
546+ See the `Click Element` keyword for details about the
547+ ``modifier`` argument.
548+
549+ The ``modifier`` argument is new in SeleniumLibrary 3.3
545550 """
546- self .info ("Clicking link '%s'." % locator )
547- self .find_element (locator , tag = 'link' ).click ()
551+ if is_falsy (modifier ):
552+ self .info ("Clicking link '%s'." % locator )
553+ self .find_element (locator , tag = 'link' ).click ()
554+ else :
555+ self ._click_with_modifier (locator , 'link' , modifier )
548556
549557 @keyword
550558 def click_element (self , locator , modifier = False ):
@@ -573,14 +581,15 @@ def click_element(self, locator, modifier=False):
573581 self .info ("Clicking element '%s'." % locator )
574582 self .find_element (locator ).click ()
575583 else :
576- self ._click_with_modifier (locator , modifier )
584+ self ._click_with_modifier (locator , None , modifier )
577585
578- def _click_with_modifier (self , locator , modifier ):
586+ def _click_with_modifier (self , locator , tag , modifier ):
587+ self .info ("Clicking element '%s' with %s." % (locator , modifier ))
579588 modifier = self .parse_modifier (modifier )
580589 action = ActionChains (self .driver )
581590 for item in modifier :
582591 action .key_down (item )
583- action .click (self .find_element (locator ))
592+ action .click (self .find_element (locator , tag = tag ))
584593 for item in modifier :
585594 action .key_up (item )
586595 action .perform ()
0 commit comments