From d2ba1a3dc0f23b467e4a4e5d2b6ca2a5634a66a5 Mon Sep 17 00:00:00 2001 From: Visagan Guruparan <103048@smsassist.com> Date: Wed, 12 Mar 2025 21:35:30 -0500 Subject: [PATCH] Update default wait time for web driver --- .../Browsing/Settings/WebBrowsingSettings.cs | 2 ++ .../UtilFunctions/UtilWebGoToPageFn.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Infrastructure/BotSharp.Abstraction/Browsing/Settings/WebBrowsingSettings.cs b/src/Infrastructure/BotSharp.Abstraction/Browsing/Settings/WebBrowsingSettings.cs index 7521a3e4..f876c449 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Browsing/Settings/WebBrowsingSettings.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Browsing/Settings/WebBrowsingSettings.cs @@ -7,4 +7,6 @@ public class WebBrowsingSettings // Default timeout in milliseconds public float DefaultTimeout { get; set; } = 30000; public bool IsEnableScreenshot { get; set; } + // Default wait time in seconds after page is opened + public int DefaultWaitTime { get; set; } = 5; } diff --git a/src/Plugins/BotSharp.Plugin.WebDriver/UtilFunctions/UtilWebGoToPageFn.cs b/src/Plugins/BotSharp.Plugin.WebDriver/UtilFunctions/UtilWebGoToPageFn.cs index a29af212..0c5507bf 100644 --- a/src/Plugins/BotSharp.Plugin.WebDriver/UtilFunctions/UtilWebGoToPageFn.cs +++ b/src/Plugins/BotSharp.Plugin.WebDriver/UtilFunctions/UtilWebGoToPageFn.cs @@ -26,7 +26,7 @@ public class UtilWebGoToPageFn : IFunctionCallback var _webDriver = _services.GetRequiredService(); args.Timeout = _webDriver.DefaultTimeout; args.WaitForNetworkIdle = false; - args.WaitTime = 5; + args.WaitTime = _webDriver.DefaultWaitTime; args.OpenNewTab = true; var conv = _services.GetRequiredService();