We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9cfccca commit f2b33bcCopy full SHA for f2b33bc
src/SeleniumLibrary/keywords/element.py
@@ -240,10 +240,10 @@ def element_should_be_focused(self, locator):
240
New in SeleniumLibrary 3.0.
241
"""
242
element = self.find_element(locator)
243
- if self.driver.capabilities['browserName'] != "firefox":
244
- focused = self.driver.switch_to.active_element
245
- else:
246
- focused = self.driver.execute_script('return document.activeElement;')
+ focused = self.driver.switch_to.active_element
+ # Selenium 3.6.0 with Firefox return dict wich contains the selenium WebElement
+ if isinstance(focused, dict):
+ focused = focused['value']
247
if element != focused:
248
raise AssertionError("Element '%s' does not have focus." % locator)
249
0 commit comments