Sivateja rd
Sivateja rd

Reputation: 1

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

Upvotes: 0

Views: 513

Answers (1)

jjhelguero
jjhelguero

Reputation: 2565

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()

Upvotes: 0

Related Questions