Skip to content

Commit

Permalink
[Java] Move code sample to github [deploy site] fb0774d
Browse files Browse the repository at this point in the history
  • Loading branch information
selenium-ci committed Apr 10, 2024
1 parent 5d5d85d commit 93d07a4
Show file tree
Hide file tree
Showing 29 changed files with 97 additions and 65 deletions.
10 changes: 6 additions & 4 deletions documentation/_print/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions documentation/about/_print/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@
<label><a href=https://github.com/diemol>@diemol</a></label>
<span class=contributions>719 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/12621691?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
<label><a href=https://github.com/harsha509>@harsha509</a></label>
<span class=contributions>680 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/3331063?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
<span class=contributions>681 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/3331063?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
<label><a href=https://github.com/selenium-ci>@selenium-ci</a></label>
<span class=contributions>323 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/777185?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
<label><a href=https://github.com/titusfortner>@titusfortner</a></label>
Expand All @@ -537,7 +537,7 @@
<label><a href=https://github.com/kzhirata>@kzhirata</a></label>
<span class=contributions>47 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/in/2740?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
<label><a href=https://github.com/apps/renovate>@renovate[bot]</a></label>
<span class=contributions>38 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/5413013?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
<span class=contributions>39 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/5413013?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
<label><a href=https://github.com/bonigarcia>@bonigarcia</a></label>
<span class=contributions>35 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/10259016?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
<label><a href=https://github.com/boris779>@boris779</a></label>
Expand Down
4 changes: 2 additions & 2 deletions documentation/about/copyright/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@
<label><a href=https://github.com/diemol>@diemol</a></label>
<span class=contributions>719 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/12621691?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
<label><a href=https://github.com/harsha509>@harsha509</a></label>
<span class=contributions>680 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/3331063?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
<span class=contributions>681 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/3331063?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
<label><a href=https://github.com/selenium-ci>@selenium-ci</a></label>
<span class=contributions>323 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/777185?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
<label><a href=https://github.com/titusfortner>@titusfortner</a></label>
Expand All @@ -526,7 +526,7 @@
<label><a href=https://github.com/kzhirata>@kzhirata</a></label>
<span class=contributions>47 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/in/2740?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
<label><a href=https://github.com/apps/renovate>@renovate[bot]</a></label>
<span class=contributions>38 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/5413013?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
<span class=contributions>39 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/5413013?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
<label><a href=https://github.com/bonigarcia>@bonigarcia</a></label>
<span class=contributions>35 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/10259016?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
<label><a href=https://github.com/boris779>@boris779</a></label>
Expand Down
6 changes: 4 additions & 2 deletions documentation/webdriver/_print/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3366,15 +3366,17 @@
CSharp</button></li><li class=nav-item><button class=nav-link id=tabs-00-04-tab data-bs-toggle=tab data-bs-target=#tabs-00-04 role=tab data-td-tp-persist=ruby aria-controls=tabs-00-04 aria-selected=false>
Ruby</button></li><li class=nav-item><button class=nav-link id=tabs-00-05-tab data-bs-toggle=tab data-bs-target=#tabs-00-05 role=tab data-td-tp-persist=javascript aria-controls=tabs-00-05 aria-selected=false>
JavaScript</button></li><li class=nav-item><button class=nav-link id=tabs-00-06-tab data-bs-toggle=tab data-bs-target=#tabs-00-06 role=tab data-td-tp-persist=kotlin aria-controls=tabs-00-06 aria-selected=false>
Kotlin</button></li></ul><div class=tab-content id=tabs-0-content><div class="tab-pane fade show active" id=tabs-00-01 role=tabpanel aria-labelled-by=tabs-00-01-tab tabindex=0><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-Java data-lang=Java><span style=display:flex><span><span style=color:#000>driver</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#c4a000>getTitle</span><span style=color:#ce5c00;font-weight:700>();</span></span></span></code></pre></div></div><div class="tab-body tab-pane fade" id=tabs-00-02 role=tabpanel aria-labelled-by=tabs-00-02-tab tabindex=0><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:#000>title</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>title</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_interactions.py#L7 target=_blank><i class="fas fa-external-link-alt pl-2"></i>
Kotlin</button></li></ul><div class=tab-content id=tabs-0-content><div class="tab-body tab-pane fade show active" id=tabs-00-01 role=tabpanel aria-labelled-by=tabs-00-01-tab tabindex=0><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-java data-lang=java><span style=display:flex><span> <span style=color:#000>String</span> <span style=color:#000>title</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:#c4a000>getTitle</span><span style=color:#ce5c00;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/java/src/test/java/dev/selenium/interactions/InteractionsTest.java#L15 target=_blank><i class="fas fa-external-link-alt pl-2"></i>
<strong>View full example on GitHub</strong></a></div></div><div class="tab-body tab-pane fade" id=tabs-00-02 role=tabpanel aria-labelled-by=tabs-00-02-tab tabindex=0><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:#000>title</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>title</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_interactions.py#L7 target=_blank><i class="fas fa-external-link-alt pl-2"></i>
<strong>View full example on GitHub</strong></a></div></div><div class="tab-pane fade" id=tabs-00-03 role=tabpanel aria-labelled-by=tabs-00-03-tab tabindex=0><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-CSharp data-lang=CSharp><span style=display:flex><span><span style=color:#000>driver</span><span style=color:#000;font-weight:700>.</span><span style=color:#000>Title</span><span style=color:#000;font-weight:700>;</span></span></span></code></pre></div></div><div class="tab-pane fade" id=tabs-00-04 role=tabpanel aria-labelled-by=tabs-00-04-tab tabindex=0><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-Ruby data-lang=Ruby><span style=display:flex><span><span style=color:#000>driver</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>title</span></span></span></code></pre></div></div><div class="tab-body tab-pane fade" id=tabs-00-05 role=tabpanel aria-labelled-by=tabs-00-05-tab tabindex=0><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-js data-lang=js><span style=display:flex><span> <span style=color:#204a87;font-weight:700>let</span> <span style=color:#000>title</span> <span style=color:#ce5c00;font-weight:700>=</span> <span style=color:#204a87;font-weight:700>await</span> <span style=color:#000>driver</span><span style=color:#000;font-weight:700>.</span><span style=color:#000>getTitle</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/javascript/test/interactions/interactionsIndex.spec.js#L20 target=_blank><i class="fas fa-external-link-alt pl-2"></i>
<strong>View full example on GitHub</strong></a></div></div><div class="tab-pane fade" id=tabs-00-06 role=tabpanel aria-labelled-by=tabs-00-06-tab tabindex=0><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-Kotlin data-lang=Kotlin><span style=display:flex><span><span style=color:#000>driver</span><span style=color:#000;font-weight:700>.</span><span style=color:#000>title</span></span></span></code></pre></div></div></div><h3 id=get-current-url>Get current URL</h3><p>You can read the current URL from the browser&rsquo;s address bar using:</p><p><a href=/documentation/about/contributing/#moving-examples><span class=selenium-badge-code data-bs-toggle=tooltip data-bs-placement=right title="One or more of these examples need to be implemented in the examples directory; click for details in the contribution guide">Move Code</span></a></p><ul class="nav nav-tabs" id=tabs-1 role=tablist><li class=nav-item><button class="nav-link active" id=tabs-01-01-tab data-bs-toggle=tab data-bs-target=#tabs-01-01 role=tab data-td-tp-persist=java aria-controls=tabs-01-01 aria-selected=true>
Java</button></li><li class=nav-item><button class=nav-link id=tabs-01-02-tab data-bs-toggle=tab data-bs-target=#tabs-01-02 role=tab data-td-tp-persist=python aria-controls=tabs-01-02 aria-selected=false>
Python</button></li><li class=nav-item><button class=nav-link id=tabs-01-03-tab data-bs-toggle=tab data-bs-target=#tabs-01-03 role=tab data-td-tp-persist=csharp aria-controls=tabs-01-03 aria-selected=false>
CSharp</button></li><li class=nav-item><button class=nav-link id=tabs-01-04-tab data-bs-toggle=tab data-bs-target=#tabs-01-04 role=tab data-td-tp-persist=ruby aria-controls=tabs-01-04 aria-selected=false>
Ruby</button></li><li class=nav-item><button class=nav-link id=tabs-01-05-tab data-bs-toggle=tab data-bs-target=#tabs-01-05 role=tab data-td-tp-persist=javascript aria-controls=tabs-01-05 aria-selected=false>
JavaScript</button></li><li class=nav-item><button class=nav-link id=tabs-01-06-tab data-bs-toggle=tab data-bs-target=#tabs-01-06 role=tab data-td-tp-persist=kotlin aria-controls=tabs-01-06 aria-selected=false>
Kotlin</button></li></ul><div class=tab-content id=tabs-1-content><div class="tab-pane fade show active" id=tabs-01-01 role=tabpanel aria-labelled-by=tabs-01-01-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-Java data-lang=Java><span style=display:flex><span><span style=color:#000>driver</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#c4a000>getCurrentUrl</span><span style=color:#ce5c00;font-weight:700>();</span></span></span></code></pre></div></div><div class="tab-body tab-pane fade" id=tabs-01-02 role=tabpanel aria-labelled-by=tabs-01-02-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-py data-lang=py><span style=display:flex><span><span style=color:#000>title</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>current_url</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_interactions.py#L10 target=_blank><i class="fas fa-external-link-alt pl-2"></i>
Kotlin</button></li></ul><div class=tab-content id=tabs-1-content><div class="tab-body tab-pane fade show active" id=tabs-01-01 role=tabpanel aria-labelled-by=tabs-01-01-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-java data-lang=java><span style=display:flex><span> <span style=color:#000>String</span> <span style=color:#000>url</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:#c4a000>getCurrentUrl</span><span style=color:#ce5c00;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/java/src/test/java/dev/selenium/interactions/InteractionsTest.java#L26 target=_blank><i class="fas fa-external-link-alt pl-2"></i>
<strong>View full example on GitHub</strong></a></div></div><div class="tab-body tab-pane fade" id=tabs-01-02 role=tabpanel aria-labelled-by=tabs-01-02-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-py data-lang=py><span style=display:flex><span><span style=color:#000>url</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>current_url</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_interactions.py#L10 target=_blank><i class="fas fa-external-link-alt pl-2"></i>
<strong>View full example on GitHub</strong></a></div></div><div class="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-CSharp data-lang=CSharp><span style=display:flex><span><span style=color:#000>driver</span><span style=color:#000;font-weight:700>.</span><span style=color:#000>Url</span><span style=color:#000;font-weight:700>;</span></span></span></code></pre></div></div><div class="tab-pane fade" id=tabs-01-04 role=tabpanel aria-labelled-by=tabs-01-04-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-Ruby data-lang=Ruby><span style=display:flex><span><span style=color:#000>driver</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>current_url</span></span></span></code></pre></div></div><div class="tab-body tab-pane fade" id=tabs-01-05 role=tabpanel aria-labelled-by=tabs-01-05-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-js data-lang=js><span style=display:flex><span> <span style=color:#204a87;font-weight:700>let</span> <span style=color:#000>currentUrl</span> <span style=color:#ce5c00;font-weight:700>=</span> <span style=color:#204a87;font-weight:700>await</span> <span style=color:#000>driver</span><span style=color:#000;font-weight:700>.</span><span style=color:#000>getCurrentUrl</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/javascript/test/interactions/interactionsIndex.spec.js#L24 target=_blank><i class="fas fa-external-link-alt pl-2"></i>
<strong>View full example on GitHub</strong></a></div></div><div class="tab-pane fade" id=tabs-01-06 role=tabpanel aria-labelled-by=tabs-01-06-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-Kotlin data-lang=Kotlin><span style=display:flex><span><span style=color:#000>driver</span><span style=color:#000;font-weight:700>.</span><span style=color:#000>currentUrl</span></span></span></code></pre></div></div></div></div><div class=td-content style=page-break-before:always><h1 id=pg-fedcd598f2ffbe9c0326ecee13ad71a0>6.1 - Browser navigation</h1><h2 id=navigate-to>Navigate to</h2><p>The first thing you will want to do after launching a browser is to
open your website. This can be achieved in a single line:</p><ul class="nav nav-tabs" id=tabs-0 role=tablist><li class=nav-item><button class="nav-link active" id=tabs-00-00-tab data-bs-toggle=tab data-bs-target=#tabs-00-00 role=tab data-td-tp-persist=java aria-controls=tabs-00-00 aria-selected=true>
Expand Down
Loading

0 comments on commit 93d07a4

Please sign in to comment.