diff --git a/src/Plugins/BotSharp.Plugin.WebDriver/BotSharp.Plugin.WebDriver.csproj b/src/Plugins/BotSharp.Plugin.WebDriver/BotSharp.Plugin.WebDriver.csproj index ace808b0..572b2917 100644 --- a/src/Plugins/BotSharp.Plugin.WebDriver/BotSharp.Plugin.WebDriver.csproj +++ b/src/Plugins/BotSharp.Plugin.WebDriver/BotSharp.Plugin.WebDriver.csproj @@ -9,10 +9,16 @@ $(GenerateDocumentationFile) $(SolutionDir)packages + + + + + + - - + + diff --git a/src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver/PlaywrightWebDriver.GoToPage.cs b/src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver/PlaywrightWebDriver.GoToPage.cs index 371a8c06..7327bb40 100644 --- a/src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver/PlaywrightWebDriver.GoToPage.cs +++ b/src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver/PlaywrightWebDriver.GoToPage.cs @@ -15,9 +15,12 @@ public partial class PlaywrightWebDriver if (page != null) { - await page.EvaluateAsync(@"() => { - window.open('', '_blank'); - }"); + if (page.Url != "about:blank") + { + await page.EvaluateAsync(@"() => { + window.open('', '_blank'); + }"); + } if (args.EnableResponseCallback) { @@ -36,13 +39,6 @@ public partial class PlaywrightWebDriver else { page = await _instance.NewPage(message, args); - - Serilog.Log.Information($"goto page: {args.Url}"); - - if (args.OpenNewTab && page != null && page.Url == "about:blank") - { - page = await _instance.NewPage(message, args); - } } if (page == null) @@ -95,6 +91,7 @@ public partial class PlaywrightWebDriver } result.ResponseStatusCode = response.Status; + result.UrlAfterAction = page.Url; if (response.Status == 200) { result.IsSuccess = true;