diff --git a/tir/technologies/core/base.py b/tir/technologies/core/base.py index cc676916..1fa43cd9 100644 --- a/tir/technologies/core/base.py +++ b/tir/technologies/core/base.py @@ -888,7 +888,7 @@ def return_selected_combo_value(self, element): else: return '' - def send_keys(self, element, arg): + def send_keys(self, element, arg, send_type=1): """ [Internal] @@ -898,7 +898,8 @@ def send_keys(self, element, arg): :type element: Selenium object :param arg: Text or Keys to be sent to the element :type arg: str or selenium.webdriver.common.keys - + :param send_type: Send Keys type can be do it Selenium or ActionChains + :type send_type: Int Usage: >>> #Defining the element: @@ -909,10 +910,21 @@ def send_keys(self, element, arg): >>> self.send_keys(element(), Keys.ENTER) """ try: - if arg.isprintable(): - element.clear() - element.send_keys(Keys.CONTROL, 'a') - element.send_keys(arg) + if send_type == 1: + if arg.isprintable(): + element.clear() + element.send_keys(Keys.CONTROL, 'a') + element.send_keys(arg) + elif send_type == 2: + actions = ActionChains(self.driver) + actions.move_to_element(element) + actions.click() + if arg.isprintable(): + actions.key_down(Keys.CONTROL).send_keys('a').key_up(Keys.CONTROL).send_keys(Keys.DELETE) + actions.send_keys(Keys.HOME) + actions.send_keys(arg) + actions.perform() + except Exception: actions = ActionChains(self.driver) actions.move_to_element(element) diff --git a/tir/technologies/webapp_internal.py b/tir/technologies/webapp_internal.py index 407abb83..3219de9d 100644 --- a/tir/technologies/webapp_internal.py +++ b/tir/technologies/webapp_internal.py @@ -863,7 +863,12 @@ def filling_date(self, shadow_root=None, container=None): ActionChains(self.driver).key_down(Keys.CONTROL).send_keys(Keys.HOME).key_up(Keys.CONTROL).perform() ActionChains(self.driver).key_down(Keys.CONTROL).key_down(Keys.SHIFT).send_keys( Keys.END).key_up(Keys.CONTROL).key_up(Keys.SHIFT).perform() - self.send_keys(date(), self.config.date) + + if self.config.browser.lower() == "chrome": + self.send_keys(date(), self.config.date, send_type=2) + else: + self.send_keys(date(), self.config.date) + base_date_value = self.merge_date_mask(self.config.date, self.get_web_value(date())) if self.config.poui_login: ActionChains(self.driver).send_keys(Keys.TAB * 2).perform()