diff --git a/src/Infrastructure/BotSharp.Abstraction/Browsing/Models/BrowserActionResult.cs b/src/Infrastructure/BotSharp.Abstraction/Browsing/Models/BrowserActionResult.cs index 63c592b7..b3576b90 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Browsing/Models/BrowserActionResult.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Browsing/Models/BrowserActionResult.cs @@ -8,7 +8,6 @@ public class BrowserActionResult public string Selector { get; set; } public string Body { get; set; } public bool IsHighlighted { get; set; } - public DateTime? ExecutedAt { get; set; } = DateTime.UtcNow; public override string ToString() { diff --git a/src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver/PlaywrightWebDriver.LocateElement.cs b/src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver/PlaywrightWebDriver.LocateElement.cs index 4bbd84ac..f62c230a 100644 --- a/src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver/PlaywrightWebDriver.LocateElement.cs +++ b/src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver/PlaywrightWebDriver.LocateElement.cs @@ -40,12 +40,13 @@ public partial class PlaywrightWebDriver // Retrieve the page raw html and infer the element path if (!string.IsNullOrEmpty(location.Text)) { + var text = location.Text.Replace("(", "\\(").Replace(")", "\\)"); var regexExpression = location.MatchRule.ToLower() switch { - "startwith" => $"^{location.Text}", - "endwith" => $"{location.Text}$", - "contains" => $"{location.Text}", - _ => $"^{location.Text}$" + "startwith" => $"^{text}", + "endwith" => $"{text}$", + "contains" => $"{text}", + _ => $"^{text}$" }; var regex = new Regex(regexExpression, RegexOptions.IgnoreCase); locator = locator.GetByText(regex);