Not Getting Dynamic URL of a Popup opening in a new tab in Testcafe

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?

Upvotes: 0

Views: 307

Answers (1)

Alex Kamaev
Alex Kamaev

Reputation: 6318

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.

Upvotes: 1

Related Questions