Reputation: 1
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
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