From 5e88d64a115d08136c1bb64765e01dc683df70c5 Mon Sep 17 00:00:00 2001 From: Shuchang Zheng Date: Sun, 26 May 2024 12:15:13 -0700 Subject: [PATCH] input data instantly for press_sequentially when there's too much characters (#367) --- skyvern/webeye/actions/handler.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/skyvern/webeye/actions/handler.py b/skyvern/webeye/actions/handler.py index 81eb6b70..1c4fdf4b 100644 --- a/skyvern/webeye/actions/handler.py +++ b/skyvern/webeye/actions/handler.py @@ -210,9 +210,12 @@ async def handle_input_text_action( await locator.clear() text = get_actual_value_of_parameter_if_secret(task, action.text) - # 1.5 times the time it takes to type the text so it has time to finish typing + # 3 times the time it takes to type the text so it has time to finish typing total_timeout = max(len(text) * TEXT_INPUT_DELAY * 3, SettingsManager.get_settings().BROWSER_ACTION_TIMEOUT_MS) - await locator.press_sequentially(text, delay=TEXT_INPUT_DELAY, timeout=total_timeout) + delay = TEXT_INPUT_DELAY + if total_timeout > 15000: + delay = 0 + await locator.press_sequentially(text, delay=delay, timeout=total_timeout) return [ActionSuccess()]