a 标签点击超时 TimeoutException 异常处理,异常如下:
System.TimeoutException
HResult=0x80131505
Message=Timeout 30000ms exceeded.
Call log:
- attempting click action
2 × waiting for element to be visible, enabled and stable
- element is visible, enabled and stable
- scrolling into view if needed
- done scrolling
- <div tabindex="-1" role="dialog" aria-modal="true" class="modal fade show" id="staticBackdropLive" data-bs-keyboard="false" data-bs-backdrop="static" aria-labelledby="staticBackdropLiveLabel">…</div> from <main class="bd-main order-1">…</main> subtree intercepts pointer events
- retrying click action
- waiting 20ms
2 × waiting for element to be visible, enabled and stable
- element is visible, enabled and stable
- scrolling into view if needed
- done scrolling
- <div tabindex="-1" role="dialog" aria-modal="true" class="modal fade show" id="staticBackdropLive" data-bs-keyboard="false" data-bs-backdrop="static" aria-labelledby="staticBackdropLiveLabel">…</div> from <main class="bd-main order-1">…</main> subtree intercepts pointer events
- retrying click action
- waiting 100ms
57 × waiting for element to be visible, enabled and stable
- element is visible, enabled and stable
- scrolling into view if needed
- done scrolling
- <div tabindex="-1" role="dialog" aria-modal="true" class="modal fade show" id="staticBackdropLive" data-bs-keyboard="false" data-bs-backdrop="static" aria-labelledby="staticBackdropLiveLabel">…</div> from <main class="bd-main order-1">…</main> subtree intercepts pointer events
- retrying click action
- waiting 500ms
Source=Microsoft.Playwright
StackTrace:
在 Microsoft.Playwright.Transport.Connection.<InnerSendMessageToServerAsync>d__40`1.MoveNext() 在 /_/src/Playwright/Transport/Connection.cs 中: 第 228 行
在 Microsoft.Playwright.Transport.Connection.<WrapApiCallAsync>d__52`1.MoveNext() 在 /_/src/Playwright/Transport/Connection.cs 中: 第 541 行
在 ConsoleApp4.PlaywrightDemo.<Main>d__0.MoveNext() 在 D:\Project\ConsoleApp1\ConsoleApp4\PlaywrightDemo.cs 中: 第 71 行
在 ConsoleApp4.PlaywrightDemo.<Main>d__0.MoveNext() 在 D:\Project\ConsoleApp1\ConsoleApp4\PlaywrightDemo.cs 中: 第 83 行
在 ConsoleApp4.PlaywrightDemo.<Main>(String[] args)
代码:
解决方案一:
解决方案二(推荐):
|