Skip to content

Commit

Permalink
added empty input value functionality in fill_grid method
Browse files Browse the repository at this point in the history
  • Loading branch information
renanllisboa committed Dec 15, 2023
1 parent e8fe8e0 commit e8832b1
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions tir/technologies/webapp_internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -5967,7 +5967,7 @@ def fill_grid(self, field, x3_dictionaries, initial_layer, duplicate_fields=[]):
field_to_valtype = {}
field_to_len = {}

current_value = ""
current_value = None
column_name = ""
rows = ""
headers = ""
Expand Down Expand Up @@ -6006,13 +6006,17 @@ def fill_grid(self, field, x3_dictionaries, initial_layer, duplicate_fields=[]):
try:
endtime = time.time() + self.config.time_out + 300
while (current_value != field_one and time.time() < endtime):
current_value = re.sub('[\,\.]', '', self.remove_mask(current_value).strip())
field_one = re.sub('[\,\.]', '', self.remove_mask(field_one).strip())
if current_value.isnumeric() and field_one.isnumeric():
if float(current_value) == float(field_one):

if field_one != "":
current_value = ""
current_value = re.sub('[\,\.]', '', self.remove_mask(current_value).strip())
field_one = re.sub('[\,\.]', '', self.remove_mask(field_one).strip())
if current_value.isnumeric() and field_one.isnumeric():
if float(current_value) == float(field_one):
break
if field[8] and current_value.lower() == field_one.lower():
break
if field[8] and current_value.lower() == field_one.lower():
break

endtime_row = time.time() + self.config.time_out
while (time.time() < endtime_row and grid_reload):
logger().debug('Grid loading...')
Expand Down Expand Up @@ -6235,7 +6239,12 @@ def fill_grid(self, field, x3_dictionaries, initial_layer, duplicate_fields=[]):
self.wait_until_to(expected_condition="element_to_be_clickable", element=bsoup_element,
locator=By.XPATH, timeout=True)
logger().debug(f"Sending keys: {user_value}")
self.try_send_keys(selenium_input, user_value, try_counter)
if user_value == "":
ActionChains(self.driver).move_to_element(
selenium_input()).send_keys_to_element(selenium_input(), " ").perform()
else:
self.try_send_keys(selenium_input, user_value, try_counter)

self.wait_blocker()
if self.grid_memo_field:
self.SetButton('Ok')
Expand Down

0 comments on commit e8832b1

Please sign in to comment.