title: Access a new window - cypress.io
body: <p>The question is as simple as that. In Cypress, how can I access a new window that opens up when running the test.</p>
  
  <p>Steps to recreate :</p>
  
  <blockquote>
    <ol>
    <li>Run the test. After some action, new window pops up (the url is dynamic in nature).</li>
    <li>Fill in the fields in the new window, and click a few buttons.</li>
    <li>After required actions are completed in the new Window, close the new window and move back to the main window.</li>
    <li>Continue execution with the main window.</li>
    </ol>
  </blockquote>
  
  <p>Point of interest: the focus should be</p>
  
  <pre><code>main window -&gt; new window -&gt; main window
  </code></pre>
  
  <p>I have read few things that relate to use of <code>iframe</code> and <code>confirmation box</code>, but here its none of those. Relates to accessing a whole new window. Something like <a href="http://toolsqa.com/selenium-webdriver/switch-commands/" rel="noreferrer"><code>Window Handlers</code></a> in Selenium. Unfortunately could not find anything related to it.</p>