def press_tab(self):
"""Simulates the user pressing the tab key on element that is currently focussed.
.. versionchanged: 4.0
Changed to operate on the currently focussed element.
"""
el = self.web_driver.switch_to.active_element
el.send_keys(Keys.TAB)
# To ensure the element gets blur event which for some reason does not always happen when pressing TAB:
self.web_driver.execute_script('if ( "undefined" !== typeof jQuery) {jQuery(arguments[0]).blur();};', el)
评论列表
文章目录