Skip to content

Commit 0505937

Browse files
committed
Better exception-handling with element.clear() in update_text()
1 parent f91ac18 commit 0505937

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,10 @@ def update_text(self, selector, new_value, by=By.CSS_SELECTOR,
279279
time.sleep(0.06)
280280
element = self.wait_for_element_visible(
281281
selector, by=by, timeout=timeout)
282-
element.clear()
282+
try:
283+
element.clear()
284+
except Exception:
285+
pass # Clearing the text field first isn't critical
283286
except Exception:
284287
pass # Clearing the text field first isn't critical
285288
self.__demo_mode_pause_if_active(tiny=True)

0 commit comments

Comments
 (0)