Skip to content

Commit

Permalink
Xpath note rearrangement (#1884)[deploy site]
Browse files Browse the repository at this point in the history
* added quitting examples for all lanaguges/translations

* fixed xpath child note being in wrong place of code example

* Update _index.en.md w/ csharp example

* Update _index.ja.md w/ csharp example

* Update _index.pt-br.md w/ csharp example

* Update _index.zh-cn.md w/ csharp example 0fde8cc
  • Loading branch information
selenium-ci committed Aug 22, 2024
1 parent 9ab1066 commit b35f714
Show file tree
Hide file tree
Showing 39 changed files with 117 additions and 141 deletions.
12 changes: 6 additions & 6 deletions documentation/_print/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -704,9 +704,9 @@
CSharp</button></li><li class=nav-item><button class=nav-link id=tabs-06-03-tab data-bs-toggle=tab data-bs-target=#tabs-06-03 role=tab data-td-tp-persist=ruby aria-controls=tabs-06-03 aria-selected=false>
Ruby</button></li><li class=nav-item><button class=nav-link id=tabs-06-04-tab data-bs-toggle=tab data-bs-target=#tabs-06-04 role=tab data-td-tp-persist=javascript aria-controls=tabs-06-04 aria-selected=false>
JavaScript</button></li><li class=nav-item><button class=nav-link id=tabs-06-05-tab data-bs-toggle=tab data-bs-target=#tabs-06-05 role=tab data-td-tp-persist=kotlin aria-controls=tabs-06-05 aria-selected=false>
Kotlin</button></li></ul><div class=tab-content id=tabs-6-content><div class="tab-body tab-pane fade show active" id=tabs-06-00 role=tabpanel aria-labelled-by=tabs-06-00-tab tabindex=6><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-06-01 role=tabpanel aria-labelled-by=tabs-06-01-tab tabindex=6><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>driver</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>quit</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/drivers/test_options.py#L13 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-06-02 role=tabpanel aria-labelled-by=tabs-06-02-tab tabindex=6><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-06-03 role=tabpanel aria-labelled-by=tabs-06-03-tab tabindex=6><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-rb data-lang=rb><span style=display:flex><span> <span style=color:#000>driver</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>quit</span></span></span></code></pre></div><div class="text-end pb-2"><a href=https://github.com/SeleniumHQ/seleniumhq.github.io/blob/trunk/examples/ruby/spec/drivers/options_spec.rb#L16 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-06-04 role=tabpanel aria-labelled-by=tabs-06-04-tab tabindex=6><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-06-05 role=tabpanel aria-labelled-by=tabs-06-05-tab tabindex=6><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></div><div class=td-content style=page-break-before:always><h1 id=pg-839805e2dec21aeac2a04c521100ccd7>2.2.1 - Browser Options</h1><div class=lead>These capabilities are shared by all browsers.</div><p>In Selenium 3, capabilities were defined in a session by using Desired Capabilities classes.
Kotlin</button></li></ul><div class=tab-content id=tabs-6-content><div class="tab-body tab-pane fade show active" id=tabs-06-00 role=tabpanel aria-labelled-by=tabs-06-00-tab tabindex=6>{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScript.java#L29" >}<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-06-01 role=tabpanel aria-labelled-by=tabs-06-01-tab tabindex=6><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>driver</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>quit</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/drivers/test_options.py#L13 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-06-02 role=tabpanel aria-labelled-by=tabs-06-02-tab tabindex=6>{< gh-codeblock path="examples/dotnet/HelloSelenium.cs#L13" >}<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-06-03 role=tabpanel aria-labelled-by=tabs-06-03-tab tabindex=6><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-rb data-lang=rb><span style=display:flex><span> <span style=color:#000>driver</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>quit</span></span></span></code></pre></div><div class="text-end pb-2"><a href=https://github.com/SeleniumHQ/seleniumhq.github.io/blob/trunk/examples/ruby/spec/drivers/options_spec.rb#L16 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-06-04 role=tabpanel aria-labelled-by=tabs-06-04-tab tabindex=6>{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L28" >}<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-06-05 role=tabpanel aria-labelled-by=tabs-06-05-tab tabindex=6>{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L35" >}<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></div><div class=td-content style=page-break-before:always><h1 id=pg-839805e2dec21aeac2a04c521100ccd7>2.2.1 - Browser Options</h1><div class=lead>These capabilities are shared by all browsers.</div><p>In Selenium 3, capabilities were defined in a session by using Desired Capabilities classes.
As of Selenium 4, you must use the browser options classes.
For remote driver sessions, a browser options instance is required as it determines which browser will be used.</p><p>These options are described in the w3c specification for <a href=https://w3c.github.io/webdriver/#capabilities>Capabilities</a>.</p><p>Each browser has <a href=https://www.selenium.dev/documentation/webdriver/browsers/>custom options</a> that may be defined in addition to the ones defined in the specification.</p><h2 id=browsername>browserName</h2><p>Browser name is set by default when using an Options class instance.</p><ul class="nav nav-tabs" id=tabs-1 role=tablist><li class=nav-item><button class="nav-link active" id=tabs-01-00-tab data-bs-toggle=tab data-bs-target=#tabs-01-00 role=tab data-td-tp-persist=java aria-controls=tabs-01-00 aria-selected=true>
Java</button></li><li class=nav-item><button class=nav-link id=tabs-01-01-tab data-bs-toggle=tab data-bs-target=#tabs-01-01 role=tab data-td-tp-persist=python aria-controls=tabs-01-01 aria-selected=false>
Expand Down Expand Up @@ -3003,12 +3003,12 @@
</span></span><span style=display:flex><span><span style=color:#000>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>TAG_NAME</span><span style=color:#000;font-weight:700>,</span> <span style=color:#4e9a06>&#39;div&#39;</span><span style=color:#000;font-weight:700>)</span>
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span> <span style=color:#8f5902;font-style:italic># Get all the elements available with tag name &#39;p&#39;</span>
</span></span><span style=display:flex><span> <span style=color:#8f5902;font-style:italic># NOTE: in order to utilize XPATH from current element, you must add &#34;.&#34; to beginning of path</span>
</span></span><span style=display:flex><span><span style=color:#000>elements</span> <span style=color:#ce5c00;font-weight:700>=</span> <span style=color:#000>element</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>find_elements</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>TAG_NAME</span><span style=color:#000;font-weight:700>,</span> <span style=color:#4e9a06>&#39;p&#39;</span><span style=color:#000;font-weight:700>)</span>
</span></span><span style=display:flex><span><span style=color:#204a87;font-weight:700>for</span> <span style=color:#000>e</span> <span style=color:#204a87;font-weight:700>in</span> <span style=color:#000>elements</span><span style=color:#000;font-weight:700>:</span>
</span></span><span style=display:flex><span> <span style=color:#204a87>print</span><span style=color:#000;font-weight:700>(</span><span style=color:#000>e</span><span style=color:#ce5c00;font-weight:700>.</span><span style=color:#000>text</span><span style=color:#000;font-weight:700>)</span>
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span><span style=color:#8f5902;font-style:italic>##get elements from parent element using XPATH</span>
</span></span><span style=display:flex><span><span style=color:#8f5902;font-style:italic>##NOTE: in order to utilize XPATH from current element, you must add &#34;.&#34; to beginning of path</span>
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span> <span style=color:#8f5902;font-style:italic># Get first element of tag &#39;ul&#39;</span>
</span></span><span style=display:flex><span><span style=color:#000>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>XPATH</span><span style=color:#000;font-weight:700>,</span> <span style=color:#4e9a06>&#39;//ul&#39;</span><span style=color:#000;font-weight:700>)</span>
Expand Down Expand Up @@ -14481,14 +14481,14 @@
<label><a href=https://github.com/hiroksarker>@hiroksarker</a></label>
<span class=contributions>10 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/50069278?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/nwintop>@nwintop</a></label>
<span class=contributions>8 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/69980130?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/shbenzer>@shbenzer</a></label>
<span class=contributions>8 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/25596787?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/testbot206>@testbot206</a></label>
<span class=contributions>7 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/909773?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/krmahadevan>@krmahadevan</a></label>
<span class=contributions>7 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/2152854?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/tetration>@tetration</a></label>
<span class=contributions>7 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/69980130?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/shbenzer>@shbenzer</a></label>
<span class=contributions>7 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/117716?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/connerT>@connerT</a></label>
<span class=contributions>6 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/35181101?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
Expand Down
4 changes: 2 additions & 2 deletions documentation/about/_print/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -578,14 +578,14 @@
<label><a href=https://github.com/hiroksarker>@hiroksarker</a></label>
<span class=contributions>10 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/50069278?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/nwintop>@nwintop</a></label>
<span class=contributions>8 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/69980130?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/shbenzer>@shbenzer</a></label>
<span class=contributions>8 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/25596787?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/testbot206>@testbot206</a></label>
<span class=contributions>7 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/909773?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/krmahadevan>@krmahadevan</a></label>
<span class=contributions>7 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/2152854?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/tetration>@tetration</a></label>
<span class=contributions>7 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/69980130?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/shbenzer>@shbenzer</a></label>
<span class=contributions>7 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/117716?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/connerT>@connerT</a></label>
<span class=contributions>6 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/35181101?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
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 @@ -564,14 +564,14 @@
<label><a href=https://github.com/hiroksarker>@hiroksarker</a></label>
<span class=contributions>10 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/50069278?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/nwintop>@nwintop</a></label>
<span class=contributions>8 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/69980130?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/shbenzer>@shbenzer</a></label>
<span class=contributions>8 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/25596787?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/testbot206>@testbot206</a></label>
<span class=contributions>7 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/909773?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/krmahadevan>@krmahadevan</a></label>
<span class=contributions>7 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/2152854?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/tetration>@tetration</a></label>
<span class=contributions>7 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/69980130?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/shbenzer>@shbenzer</a></label>
<span class=contributions>7 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/117716?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/connerT>@connerT</a></label>
<span class=contributions>6 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/35181101?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
Expand Down
Loading

0 comments on commit b35f714

Please sign in to comment.