Skip to content

Commit

Permalink
use press_sequentially to replace fill (#349)
Browse files Browse the repository at this point in the history
  • Loading branch information
ykeremy authored May 21, 2024
1 parent d8175ba commit 0719396
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion skyvern/webeye/actions/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
from skyvern.webeye.scraper.scraper import ScrapedPage

LOG = structlog.get_logger()
TEXT_INPUT_DELAY = 10 # 10ms between each character input


class ActionHandler:
Expand Down Expand Up @@ -209,7 +210,9 @@ async def handle_input_text_action(

await locator.clear()
text = get_actual_value_of_parameter_if_secret(task, action.text)
await locator.fill(text, timeout=SettingsManager.get_settings().BROWSER_ACTION_TIMEOUT_MS)
# 1.5 times the time it takes to type the text so it has time to finish typing
total_timeout = max(len(text) * TEXT_INPUT_DELAY * 1.5, SettingsManager.get_settings().BROWSER_ACTION_TIMEOUT_MS)
await locator.press_sequentially(text, delay=TEXT_INPUT_DELAY, timeout=total_timeout)
return [ActionSuccess()]


Expand Down

0 comments on commit 0719396

Please sign in to comment.