未获取在 Testcafe 的新选项卡中打开的弹出窗口的动态 URL

发布于 2025-01-14 04:06:28 字数 99 浏览 4 评论 0原文

单击按钮时,会打开一个新选项卡,其中包含动态 URL,我们需要在验证后关闭该选项卡并返回主选项卡。 是否可以导航到 Testcafe 中具有动态 URL 的新选项卡?如果是的话怎么办?

When a button is clicked, a new tab opens which has a dynamic URL, we need to close that tab after a verification and get back to the main tab.
Is it possible to navigate to a new tab having a dynamic URL in Testcafe? If yes then how?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夜司空 2025-01-21 04:06:28

您可以使用 getCurrentWindow 方法获取当前窗口。这意味着您可以在初始窗口和新窗口中调用此方法。
拥有所有窗口描述符后,您可以使用 switchToWindow 方法。

如果这些方法不适合您,请分享您的示例以详细演示该问题。

You can use the getCurrentWindow method to get the descriptor of the current window. This means that you can call this method in the initial and the new window.
After you have all windows descriptors you can switch between windows using the switchToWindow method.

If these methods do not suit you, please share your example to demonstrate the issue in detail.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文