@@ -507,18 +507,26 @@ def get_vertical_position(self, locator):
507507 return self .find_element (locator ).location ['y' ]
508508
509509 @keyword
510- def click_button (self , locator ):
510+ def click_button (self , locator , modifier = False ):
511511 """Clicks button identified by ``locator``.
512512
513513 See the `Locating elements` section for details about the locator
514514 syntax. When using the default locator strategy, buttons are
515515 searched using ``id``, ``name`` and ``value``.
516+
517+ See the `Click Element` keyword for details about the
518+ ``modifier`` argument.
519+
520+ The ``modifier`` argument is new in SeleniumLibrary 3.3
516521 """
517- self .info ("Clicking button '%s'." % locator )
518- element = self .find_element (locator , tag = 'input' , required = False )
519- if not element :
520- element = self .find_element (locator , tag = 'button' )
521- element .click ()
522+ if is_falsy (modifier ):
523+ self .info ("Clicking button '%s'." % locator )
524+ element = self .find_element (locator , tag = 'input' , required = False )
525+ if not element :
526+ element = self .find_element (locator , tag = 'button' )
527+ element .click ()
528+ else :
529+ self ._click_with_modifier (locator , 'button' , modifier )
522530
523531 @keyword
524532 def click_image (self , locator ):
@@ -584,7 +592,7 @@ def click_element(self, locator, modifier=False):
584592 self ._click_with_modifier (locator , None , modifier )
585593
586594 def _click_with_modifier (self , locator , tag , modifier ):
587- self .info ("Clicking element '%s' with %s." % (locator , modifier ))
595+ self .info ("Clicking %s '%s' with %s." % (tag if tag else 'element' , locator , modifier ))
588596 modifier = self .parse_modifier (modifier )
589597 action = ActionChains (self .driver )
590598 for item in modifier :
0 commit comments