|
50 | 50 | </span></span><span style=display:flex><span> <span style=color:#204a87;font-weight:700><artifactId></span>selenium-java<span style=color:#204a87;font-weight:700></artifactId></span>
|
51 | 51 | </span></span><span style=display:flex><span> <span style=color:#204a87;font-weight:700><version></span>${selenium.version}<span style=color:#204a87;font-weight:700></version></span>
|
52 | 52 | </span></span><span style=display:flex><span> <span style=color:#204a87;font-weight:700></dependency></span></span></span></code></pre></div><div class="text-end pb-2"><a href=https://github.com/SeleniumHQ/seleniumhq.github.io/blob/trunk/examples/java/pom.xml#L30-L34 target=_blank><i class="fas fa-external-link-alt pl-2"></i>
|
53 |
| -<strong>View full example on GitHub</strong></a></div><h3 id=gradle>Gradle</h3><p>Specify the dependency in the project <code>build.gradle</code> file as <code>testImplementation</code>:</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-gradle data-lang=gradle><span style=display:flex><span> <span style=color:#000>testImplementation</span> <span style=color:#4e9a06>'org.seleniumhq.selenium:selenium-java:4.29.0'</span> |
| 53 | +<strong>View full example on GitHub</strong></a></div><h3 id=gradle>Gradle</h3><p>Specify the dependency in the project <code>build.gradle</code> file as <code>testImplementation</code>:</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-gradle data-lang=gradle><span style=display:flex><span> <span style=color:#000>testImplementation</span> <span style=color:#4e9a06>'org.seleniumhq.selenium:selenium-java:4.30.0'</span> |
54 | 54 | </span></span><span style=display:flex><span> <span style=color:#000>testImplementation</span> <span style=color:#4e9a06>'org.junit.jupiter:junit-jupiter-engine:5.12.0'</span></span></span></code></pre></div><div class="text-end pb-2"><a href=https://github.com/SeleniumHQ/seleniumhq.github.io/blob/trunk/examples/java/build.gradle#L13-L14 target=_blank><i class="fas fa-external-link-alt pl-2"></i>
|
55 | 55 | <strong>View full example on GitHub</strong></a></div></div><div class="tab-body tab-pane fade" id=tabs-00-01 role=tabpanel aria-labelled-by=tabs-00-01-tab tabindex=0><p>The minimum supported Python version for each Selenium version can be found
|
56 | 56 | in “Supported Python Versions” on <a href=https://pypi.org/project/selenium/>PyPi</a>.</p><p>There are a couple different ways to install Selenium.</p><h3 id=pip>Pip</h3><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell><span style=display:flex><span>pip install selenium
|
|
4326 | 4326 | </span></span><span style=display:flex><span><span style=color:#000>email_element</span> <span style=color:#ce5c00;font-weight:700>=</span> <span style=color:#000>driver</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>find_element</span><span style=color:#000;font-weight:700>(</span><span style=color:#000>By</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>ID</span><span style=color:#000;font-weight:700>,</span> <span style=color:#4e9a06>"email"</span><span style=color:#000;font-weight:700>)</span>
|
4327 | 4327 | </span></span><span style=display:flex><span><span style=color:#000>email_element</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>send_keys</span><span style=color:#000;font-weight:700>(</span><span style=color:#4e9a06>"admin@selenium.dev"</span><span style=color:#000;font-weight:700>)</span>
|
4328 | 4328 | </span></span><span style=display:flex><span><span style=color:#000>email_element</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>clear</span><span style=color:#000;font-weight:700>()</span>
|
4329 |
| -</span></span><span style=display:flex><span><span style=color:#000>driver</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>switch_to</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>default_content</span><span style=color:#000;font-weight:700>()</span> |
4330 |
| -</span></span><span style=display:flex><span> |
4331 |
| -</span></span><span style=display:flex><span><span style=color:#8f5902;font-style:italic># --- Switch to iframe using name or ID ---</span> |
4332 |
| -</span></span><span style=display:flex><span><span style=color:#000>iframe1</span><span style=color:#ce5c00;font-weight:700>=</span><span style=color:#000>driver</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>find_element</span><span style=color:#000;font-weight:700>(</span><span style=color:#000>By</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>NAME</span><span style=color:#000;font-weight:700>,</span> <span style=color:#4e9a06>"iframe1-name"</span><span style=color:#000;font-weight:700>)</span> <span style=color:#8f5902;font-style:italic># (This line doesn't switch, just locates)</span> |
4333 |
| -</span></span><span style=display:flex><span><span style=color:#000>driver</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>switch_to</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>frame</span><span style=color:#000;font-weight:700>(</span><span style=color:#000>iframe</span><span style=color:#000;font-weight:700>)</span> |
4334 |
| -</span></span><span style=display:flex><span><span style=color:#204a87;font-weight:700>assert</span> <span style=color:#4e9a06>"We Leave From Here"</span> <span style=color:#204a87;font-weight:700>in</span> <span style=color:#000>driver</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>page_source</span></span></span></code></pre></div><div class="text-end pb-2"><a href=https://github.com/SeleniumHQ/seleniumhq.github.io/blob/trunk/examples/python/tests/interactions/test_frames.py#L24-L37 target=_blank><i class="fas fa-external-link-alt pl-2"></i> |
| 4329 | +</span></span><span style=display:flex><span><span style=color:#000>driver</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>switch_to</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>default_content</span><span style=color:#000;font-weight:700>()</span></span></span></code></pre></div><div class="text-end pb-2"><a href=https://github.com/SeleniumHQ/seleniumhq.github.io/blob/trunk/examples/python/tests/interactions/test_frames.py#L24-L32 target=_blank><i class="fas fa-external-link-alt pl-2"></i> |
4335 | 4330 | <strong>View full example on GitHub</strong></a></div></div><div class="tab-body tab-pane fade" id=tabs-01-03 role=tabpanel aria-labelled-by=tabs-01-03-tab tabindex=1><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cs data-lang=cs><span style=display:flex><span> <span style=color:#8f5902;font-style:italic>//switch To IFrame using Web Element</span>
|
4336 | 4331 | </span></span><span style=display:flex><span> <span style=color:#000>IWebElement</span> <span style=color:#000>iframe</span> <span style=color:#000;font-weight:700>=</span> <span style=color:#000>driver</span><span style=color:#000;font-weight:700>.</span><span style=color:#000>FindElement</span><span style=color:#000;font-weight:700>(</span><span style=color:#000>By</span><span style=color:#000;font-weight:700>.</span><span style=color:#000>Id</span><span style=color:#000;font-weight:700>(</span><span style=color:#4e9a06>"iframe1"</span><span style=color:#000;font-weight:700>));</span>
|
4337 | 4332 | </span></span><span style=display:flex><span> <span style=color:#8f5902;font-style:italic>//Switch to the frame</span>
|
|
0 commit comments