title: Cypress how to handle new tab without "target" and "href" attribute?
body: <p><strong>Note:</strong>
  Cypress is a great tool for automating. I am new in Cypress world. I really like the way how we can take actions and make assertions on the same line of code.
  However, I met a hard problem, that I am not able to process. I am sure that this is handled in some way, but after 2 days of researching (about 6 hours), I'm running out of energy.</p>
  <p><strong>Description:</strong>
  I am trying (learning to use Cypress) to automate <a href="https://demoqa.com/browser-windows" rel="nofollow noreferrer">this</a> example. I am not able to automate (button) &quot;New Tab&quot; functionality. I don't want to think about how can I solve this 'quest' and how can I automate the other two (buttons) &quot;New WIndow&quot; and &quot;New WIndow Message&quot; functionalities. Here is a screenshot of the HTML document:
  <a href="https://i.stack.imgur.com/D4ea7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/D4ea7.png" alt="Screenshot of the HTML" /></a></p>
  <p><strong>My code:</strong>
  I try to solve this by using the first answer from <a href="https://stackoverflow.com/questions/47749956/access-a-new-window-cypress-io">this</a> topic.</p>
  <pre><code>/// &lt;reference types=&quot;cypress&quot; /&gt;
  describe('Example shows how to work with browser windows.', () =&gt; {
      it('Example shows how to work witn button that opens new tab without &quot;target: _blank&quot; and &quot;href&quot; attributes.', () =&gt; {
          cy.visit('https://demoqa.com/browser-windows')
          cy.window().then(win =&gt; {
              cy.stub(win, 'open').as('open')
            })
  
            cy.xpath('//*[@id=&quot;tabButton&quot;]').click()
            cy.get('@open').should('have.been.calledOnceWithExactly', '/sample')
      })
  })
  </code></pre>
  <p>I am not sure what I miss.</p>