You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<strong>View full example on GitHub</strong></a></div></div><div class="tab-body tab-pane fade" id=tabs-08-01 role=tabpanel aria-labelled-by=tabs-08-01-tab tabindex=8><p><a href=/documentation/about/contributing/#creating-examples><span class=selenium-badge-code data-bs-toggle=tooltip data-bs-placement=right title="This code example is missing. Examples are added to the examples directory; click for details in the contribution guide">Add Example</span></a></p></div><div class="tab-body tab-pane fade" id=tabs-08-02 role=tabpanel aria-labelled-by=tabs-08-02-tab tabindex=8><p><a href=https://github.com/SeleniumHQ/selenium><span class=selenium-badge-implementation data-bs-toggle=tooltip data-bs-placement=right title="This functionality is not available for this language">Implementation Missing</span></a></p></div><div class="tab-body tab-pane fade" id=tabs-08-03 role=tabpanel aria-labelled-by=tabs-08-03-tab tabindex=8><p><a href=/documentation/about/contributing/#creating-examples><span class=selenium-badge-code data-bs-toggle=tooltip data-bs-placement=right title="This code example is missing. Examples are added to the examples directory; click for details in the contribution guide">Add Example</span></a></p></div><div class="tab-body tab-pane fade" id=tabs-08-04 role=tabpanel aria-labelled-by=tabs-08-04-tab tabindex=8><p><a href=https://github.com/SeleniumHQ/selenium><span class=selenium-badge-implementation data-bs-toggle=tooltip data-bs-placement=right title="This functionality is not available for this language">Implementation Missing</span></a></p></div><div class="tab-body tab-pane fade" id=tabs-08-05 role=tabpanel aria-labelled-by=tabs-08-05-tab tabindex=8><p><a href=https://github.com/SeleniumHQ/selenium><span class=selenium-badge-implementation data-bs-toggle=tooltip data-bs-placement=right title="This functionality is not available for this language">Implementation Missing</span></a></p></div></div></div><div class=td-content style=page-break-before:always><h1 id=pg-0173104e5a75fd17aec00cf87e6f26d4>2.6.6 - Working with windows and tabs</h1><h2 id=windows-and-tabs>Windows and tabs</h2><h3 id=get-window-handle>Get window handle</h3><p>WebDriver does not make the distinction between windows and tabs. If
5226
+
<strong>View full example on GitHub</strong></a></div></div><div class="tab-body tab-pane fade" id=tabs-08-01 role=tabpanel aria-labelled-by=tabs-08-01-tab tabindex=8><p><a href=/documentation/about/contributing/#creating-examples><span class=selenium-badge-code data-bs-toggle=tooltip data-bs-placement=right title="This code example is missing. Examples are added to the examples directory; click for details in the contribution guide">Add Example</span></a></p></div><div class="tab-body tab-pane fade" id=tabs-08-02 role=tabpanel aria-labelled-by=tabs-08-02-tab tabindex=8><p><a href=https://github.com/SeleniumHQ/selenium><span class=selenium-badge-implementation data-bs-toggle=tooltip data-bs-placement=right title="This functionality is not available for this language">Implementation Missing</span></a></p></div><div class="tab-body tab-pane fade" id=tabs-08-03 role=tabpanel aria-labelled-by=tabs-08-03-tab tabindex=8><p><strong>print_page()</strong></p><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-py data-lang=py><span style=display:flex><span><span style=color:#204a87;font-weight:700>def</span> <span style=color:#000>test_prints_page</span><span style=color:#000;font-weight:700>(</span><span style=color:#000>driver</span><span style=color:#000;font-weight:700>):</span>
<strong>View full example on GitHub</strong></a></div></div><div class="tab-body tab-pane fade" id=tabs-08-04 role=tabpanel aria-labelled-by=tabs-08-04-tab tabindex=8><p><a href=https://github.com/SeleniumHQ/selenium><span class=selenium-badge-implementation data-bs-toggle=tooltip data-bs-placement=right title="This functionality is not available for this language">Implementation Missing</span></a></p></div><div class="tab-body tab-pane fade" id=tabs-08-05 role=tabpanel aria-labelled-by=tabs-08-05-tab tabindex=8><p><a href=https://github.com/SeleniumHQ/selenium><span class=selenium-badge-implementation data-bs-toggle=tooltip data-bs-placement=right title="This functionality is not available for this language">Implementation Missing</span></a></p></div></div></div><div class=td-content style=page-break-before:always><h1 id=pg-0173104e5a75fd17aec00cf87e6f26d4>2.6.6 - Working with windows and tabs</h1><h2 id=windows-and-tabs>Windows and tabs</h2><h3 id=get-window-handle>Get window handle</h3><p>WebDriver does not make the distinction between windows and tabs. If
5227
5232
your site opens a new tab or window, Selenium will let you work with it
5228
5233
using a window handle. Each window has a unique identifier which remains
5229
5234
persistent in a single session. You can get the window handle of the
<strong>View full example on GitHub</strong></a></div></div><div class="tab-body tab-pane fade" id=tabs-08-01 role=tabpanel aria-labelled-by=tabs-08-01-tab tabindex=8><p><a href=/documentation/about/contributing/#creating-examples><span class=selenium-badge-code data-bs-toggle=tooltip data-bs-placement=right title="This code example is missing. Examples are added to the examples directory; click for details in the contribution guide">Add Example</span></a></p></div><div class="tab-body tab-pane fade" id=tabs-08-02 role=tabpanel aria-labelled-by=tabs-08-02-tab tabindex=8><p><a href=https://github.com/SeleniumHQ/selenium><span class=selenium-badge-implementation data-bs-toggle=tooltip data-bs-placement=right title="This functionality is not available for this language">Implementation Missing</span></a></p></div><div class="tab-body tab-pane fade" id=tabs-08-03 role=tabpanel aria-labelled-by=tabs-08-03-tab tabindex=8><p><a href=/documentation/about/contributing/#creating-examples><span class=selenium-badge-code data-bs-toggle=tooltip data-bs-placement=right title="This code example is missing. Examples are added to the examples directory; click for details in the contribution guide">Add Example</span></a></p></div><div class="tab-body tab-pane fade" id=tabs-08-04 role=tabpanel aria-labelled-by=tabs-08-04-tab tabindex=8><p><a href=https://github.com/SeleniumHQ/selenium><span class=selenium-badge-implementation data-bs-toggle=tooltip data-bs-placement=right title="This functionality is not available for this language">Implementation Missing</span></a></p></div><div class="tab-body tab-pane fade" id=tabs-08-05 role=tabpanel aria-labelled-by=tabs-08-05-tab tabindex=8><p><a href=https://github.com/SeleniumHQ/selenium><span class=selenium-badge-implementation data-bs-toggle=tooltip data-bs-placement=right title="This functionality is not available for this language">Implementation Missing</span></a></p></div></div></div><div class=td-content style=page-break-before:always><h1 id=pg-0173104e5a75fd17aec00cf87e6f26d4>6.6 - Working with windows and tabs</h1><h2 id=windows-and-tabs>Windows and tabs</h2><h3 id=get-window-handle>Get window handle</h3><p>WebDriver does not make the distinction between windows and tabs. If
5027
+
<strong>View full example on GitHub</strong></a></div></div><div class="tab-body tab-pane fade" id=tabs-08-01 role=tabpanel aria-labelled-by=tabs-08-01-tab tabindex=8><p><a href=/documentation/about/contributing/#creating-examples><span class=selenium-badge-code data-bs-toggle=tooltip data-bs-placement=right title="This code example is missing. Examples are added to the examples directory; click for details in the contribution guide">Add Example</span></a></p></div><div class="tab-body tab-pane fade" id=tabs-08-02 role=tabpanel aria-labelled-by=tabs-08-02-tab tabindex=8><p><a href=https://github.com/SeleniumHQ/selenium><span class=selenium-badge-implementation data-bs-toggle=tooltip data-bs-placement=right title="This functionality is not available for this language">Implementation Missing</span></a></p></div><div class="tab-body tab-pane fade" id=tabs-08-03 role=tabpanel aria-labelled-by=tabs-08-03-tab tabindex=8><p><strong>print_page()</strong></p><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-py data-lang=py><span style=display:flex><span><span style=color:#204a87;font-weight:700>def</span> <span style=color:#000>test_prints_page</span><span style=color:#000;font-weight:700>(</span><span style=color:#000>driver</span><span style=color:#000;font-weight:700>):</span>
<strong>View full example on GitHub</strong></a></div></div><div class="tab-body tab-pane fade" id=tabs-08-04 role=tabpanel aria-labelled-by=tabs-08-04-tab tabindex=8><p><a href=https://github.com/SeleniumHQ/selenium><span class=selenium-badge-implementation data-bs-toggle=tooltip data-bs-placement=right title="This functionality is not available for this language">Implementation Missing</span></a></p></div><div class="tab-body tab-pane fade" id=tabs-08-05 role=tabpanel aria-labelled-by=tabs-08-05-tab tabindex=8><p><a href=https://github.com/SeleniumHQ/selenium><span class=selenium-badge-implementation data-bs-toggle=tooltip data-bs-placement=right title="This functionality is not available for this language">Implementation Missing</span></a></p></div></div></div><div class=td-content style=page-break-before:always><h1 id=pg-0173104e5a75fd17aec00cf87e6f26d4>6.6 - Working with windows and tabs</h1><h2 id=windows-and-tabs>Windows and tabs</h2><h3 id=get-window-handle>Get window handle</h3><p>WebDriver does not make the distinction between windows and tabs. If
5028
5033
your site opens a new tab or window, Selenium will let you work with it
5029
5034
using a window handle. Each window has a unique identifier which remains
5030
5035
persistent in a single session. You can get the window handle of the
0 commit comments