未获取在 Testcafe 的新选项卡中打开的弹出窗口的动态 URL
单击按钮时,会打开一个新选项卡,其中包含动态 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 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.