From 1c8b00eda593d9afb4137136cd0e75ab1af9b818 Mon Sep 17 00:00:00 2001 From: Vinayak Kolagi Date: Mon, 2 Mar 2020 21:11:22 +0530 Subject: [PATCH] Move click to action chain Move the click to action chain instead of clicking it via regular element click. This keeps the actions atomic and also handles weird bug where the focus from text box jumps in legacy/older for various rendering reasons. --- basepage/base_page.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/basepage/base_page.py b/basepage/base_page.py index 1723d31..1bd9a78 100644 --- a/basepage/base_page.py +++ b/basepage/base_page.py @@ -250,13 +250,12 @@ def enter_text(self, locator, text, with_click=True, with_clear=False, with_ente if not isinstance(element, WebElement): element = self.get_visible_element(locator, params) - if with_click: - self.click(element) - actions = ActionChains(self.driver) if 'explorer' in self.driver.name and "@" in str(text): actions = BasePage.handle_at_sign_for_ie(text, actions) else: + if with_click: + actions.click(element) actions.send_keys_to_element(element, text) if with_clear: