WebDriver PressKey
This commit is contained in:
parent
040bd7e406
commit
d28aeaed79
|
|
@ -12,6 +12,7 @@ public interface IWebBrowser
|
|||
Task<BrowserActionResult> ActionOnElement(MessageInfo message, ElementLocatingArgs location, ElementActionArgs action);
|
||||
Task<BrowserActionResult> LocateElement(MessageInfo message, ElementLocatingArgs location);
|
||||
Task DoAction(MessageInfo message, ElementActionArgs action, BrowserActionResult result);
|
||||
Task PressKey(MessageInfo message, string key);
|
||||
|
||||
Task<BrowserActionResult> InputUserText(BrowserActionParams actionParams);
|
||||
Task<BrowserActionResult> InputUserPassword(BrowserActionParams actionParams);
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ public static class BotSharpOpenApiExtensions
|
|||
|
||||
app.UseSwagger();
|
||||
|
||||
if (env.IsDevelopment())
|
||||
// if (env.IsDevelopment())
|
||||
{
|
||||
IdentityModelEventSource.ShowPII = true;
|
||||
app.UseSwaggerUI();
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
namespace BotSharp.Plugin.WebDriver.Drivers.PlaywrightDriver;
|
||||
|
||||
public partial class PlaywrightWebDriver : IWebBrowser
|
||||
|
|
@ -68,4 +69,13 @@ public partial class PlaywrightWebDriver : IWebBrowser
|
|||
{
|
||||
_instance.SetServiceProvider(_services);
|
||||
}
|
||||
|
||||
public async Task PressKey(MessageInfo message, string key)
|
||||
{
|
||||
var page = _instance.GetPage(message.ContextId);
|
||||
if (page != null)
|
||||
{
|
||||
await page.Keyboard.PressAsync(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue