diff --git a/splinter/driver/webdriver/__init__.py b/splinter/driver/webdriver/__init__.py index 62b12a3d5..b36dc2c37 100644 --- a/splinter/driver/webdriver/__init__.py +++ b/splinter/driver/webdriver/__init__.py @@ -808,7 +808,7 @@ def press(self, key: str, delay: int = 0) -> None: if key_value: chain = chain.key_down(key_value, self._element) else: - chain = chain.send_keys(key, self._element) + chain = chain.send_keys_to_element(key, self._element) if delay: chain = chain.pause(delay) diff --git a/tests/element.py b/tests/element.py index ea45a9c53..977328ee4 100644 --- a/tests/element.py +++ b/tests/element.py @@ -38,11 +38,11 @@ def test_element_press_tab(self): elem = self.browser.find_by_css("[name='q']") next_elem = self.browser.find_by_css("[name='input1']").first - assert not next_elem.is_selected() + assert not next_elem == self.browser.driver.switch_to.active_element elem.press("TAB") - assert next_elem.is_selected() + assert next_elem == self.browser.driver.switch_to.active_element @skip_if_zope @skip_if_django