Click on the body to give focus to the page
This commit is contained in:
parent
f3b395ce01
commit
ebd2688564
|
|
@ -20,8 +20,8 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Playwright" Version="1.45.1" />
|
||||
<PackageReference Include="HtmlAgilityPack" Version="1.11.62" />
|
||||
<PackageReference Include="Microsoft.Playwright" Version="1.48.0" />
|
||||
<PackageReference Include="HtmlAgilityPack" Version="1.11.71" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -36,6 +36,9 @@ public partial class PlaywrightWebDriver
|
|||
includeResponseUrls: args.IncludeResponseUrls);
|
||||
}
|
||||
|
||||
// Active current tab
|
||||
await page.BringToFrontAsync();
|
||||
|
||||
var response = await page.GotoAsync(args.Url, new PageGotoOptions
|
||||
{
|
||||
Timeout = args.Timeout > 0 ? args.Timeout : 30000
|
||||
|
|
|
|||
|
|
@ -75,6 +75,9 @@ public partial class PlaywrightWebDriver : IWebBrowser
|
|||
var page = _instance.GetPage(message.ContextId);
|
||||
if (page != null)
|
||||
{
|
||||
// Click on the body to give focus to the page
|
||||
await page.FocusAsync("input");
|
||||
|
||||
await page.Keyboard.PressAsync(key);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue