'How to get dynamic URL from ChildWindow using cypress

I will click on button , it will then popup child window having dynamic URL each time. Now i need to grab the dynamic URL and place it in cy.visit() and automate the things in child window

I tried in many ways, but couldn't solve the issue



Solution 1:[1]

These resources are great, gleb blog filip blog.

With no DOM details shown, you may be able to remove a target attr from the anchor and then click() to visit the link.

cy.get('a')
  .invoke('removeAttr', 'target')
  .click()

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 jjhelguero