'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?



Solution 1:[1]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Alex Kamaev