Skip to content

Commit 1b95ae5

Browse files
committed
Add "fill(selector, text)" method
1 parent 2a9bf1c commit 1b95ae5

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

help_docs/method_summary.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ self.click_chain(selectors_list, by=By.CSS_SELECTOR, timeout=None, spacing=0)
2929
self.type(selector, text, by=By.CSS_SELECTOR, timeout=None)
3030
# Duplicates: self.update_text(selector, text, by=By.CSS_SELECTOR, timeout=None)
3131
# self.input(selector, text, by=By.CSS_SELECTOR, timeout=None)
32+
# self.fill(selector, text, by=By.CSS_SELECTOR, timeout=None)
3233
# self.write(selector, text, by=By.CSS_SELECTOR, timeout=None)
3334

3435
self.add_text(selector, text, by=By.CSS_SELECTOR, timeout=None)

seleniumbase/fixtures/base_case.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4097,6 +4097,17 @@ def input(self, selector, text, by=By.CSS_SELECTOR,
40974097
selector, by = self.__recalculate_selector(selector, by)
40984098
self.update_text(selector, text, by=by, timeout=timeout, retry=retry)
40994099

4100+
def fill(self, selector, text, by=By.CSS_SELECTOR,
4101+
timeout=None, retry=False):
4102+
""" Same as self.update_text() """
4103+
self.__check_scope()
4104+
if not timeout:
4105+
timeout = settings.LARGE_TIMEOUT
4106+
if self.timeout_multiplier and timeout == settings.LARGE_TIMEOUT:
4107+
timeout = self.__get_new_timeout(timeout)
4108+
selector, by = self.__recalculate_selector(selector, by)
4109+
self.update_text(selector, text, by=by, timeout=timeout, retry=retry)
4110+
41004111
def write(self, selector, text, by=By.CSS_SELECTOR,
41014112
timeout=None, retry=False):
41024113
""" Same as self.update_text() """

0 commit comments

Comments
 (0)