Merge pull request #297 from hchen2020/master
wait LoadState.NetworkIdle after button clicked.
This commit is contained in:
commit
1b559f75be
|
|
@ -8,7 +8,6 @@ public partial class PlaywrightWebDriver
|
|||
{
|
||||
await _instance.Page.WaitForLoadStateAsync(LoadState.DOMContentLoaded);
|
||||
await _instance.Page.WaitForLoadStateAsync(LoadState.NetworkIdle);
|
||||
|
||||
await Task.Delay(100);
|
||||
|
||||
// Find by text exactly match
|
||||
|
|
@ -52,10 +51,11 @@ public partial class PlaywrightWebDriver
|
|||
|
||||
try
|
||||
{
|
||||
await elements.HoverAsync();
|
||||
await elements.ClickAsync();
|
||||
|
||||
await Task.Delay(300);
|
||||
await _instance.Page.WaitForLoadStateAsync(LoadState.NetworkIdle);
|
||||
await Task.Delay(100);
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ public partial class PlaywrightWebDriver
|
|||
{
|
||||
await _instance.Page.WaitForLoadStateAsync(LoadState.DOMContentLoaded);
|
||||
await _instance.Page.WaitForLoadStateAsync(LoadState.NetworkIdle);
|
||||
await Task.Delay(100);
|
||||
|
||||
// Retrieve the page raw html and infer the element path
|
||||
var regexExpression = actionParams.Context.MatchRule.ToLower() switch
|
||||
|
|
@ -37,11 +38,11 @@ public partial class PlaywrightWebDriver
|
|||
{
|
||||
// var tagName = await elements.EvaluateAsync<string>("el => el.tagName");
|
||||
|
||||
await elements.HoverAsync();
|
||||
await elements.ClickAsync();
|
||||
|
||||
// Triggered ajax
|
||||
await _instance.Page.WaitForLoadStateAsync(LoadState.NetworkIdle);
|
||||
await Task.Delay(100);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue