BotSharp/src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver/PlaywrightWebDriver.EvaluateScript.cs

12 lines
314 B
C#
Raw Normal View History

namespace BotSharp.Plugin.WebDriver.Drivers.PlaywrightDriver;
public partial class PlaywrightWebDriver
{
2024-04-09 03:38:56 +00:00
public async Task<T> EvaluateScript<T>(string contextId, string script)
{
2024-04-09 03:38:56 +00:00
await _instance.Wait(contextId);
2024-04-09 03:38:56 +00:00
return await _instance.GetPage(contextId).EvaluateAsync<T>(script);
}
}