How to handle child window in a test with no attributes

Viewed 21

In my below test when I click on a button cypress opens the window in a different tab making my test blind and it fails. I want the child window to open in the same tab.

it('login into User', () => {
      cy.visit("https://url")
      cy.get('navigate to the page 1 from main page').click()
      cy.get('button on page 2 ').click()
      //after the above command cypress opens a new tab
     });
});

Snapshot of the Dom.

enter image description here

0 Answers
Related