Skip to content

Commit

Permalink
Added more detail to Avoid Sharing State Documentation (#1948)[deploy…
Browse files Browse the repository at this point in the history
… site]

* added more detail to Avoid

* put back in English - to be tagged for translation

* put back in English - to be tagged for translation

* put back in English - to be tagged for translation e1fa2da
  • Loading branch information
selenium-ci committed Sep 23, 2024
1 parent 417940d commit 0eacf7d
Show file tree
Hide file tree
Showing 31 changed files with 143 additions and 85 deletions.
13 changes: 8 additions & 5 deletions documentation/_print/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11480,7 +11480,10 @@
for valid orders before picking one to perform an action on. Should two tests
pick up the same order you are likely to get unexpected behavior.</p></li><li><p>Clean up stale data in the application that might be picked up by another
test e.g. invalid order records.</p></li><li><p>Create a new WebDriver instance per test. This helps ensure test isolation
and makes parallelization simpler.</p></li></ul></div><div class=td-content style=page-break-before:always><h1 id=pg-84640ae953713c14fe36c508f185cc39>7.4.7 - Tips on working with locators</h1><div class=lead>When to use which locators and how best to manage them in your code.</div><p>Take a look at examples of the <a href=https://www.selenium.dev/documentation/webdriver/elements/locators/>supported locator strategies</a>.</p><p>In general, if HTML IDs are available, unique, and consistently
and makes parallelization simpler.</p><ul><li>If you choose <a href=https://pytest.org/>pytest</a> as your test runner, this can be
easily done by yielding your driver in a global fixture. This way each test gets its own
driver instance, and you can ensure that drivers always quit after a test is finished
(pass or fail).</li></ul></li></ul></div><div class=td-content style=page-break-before:always><h1 id=pg-84640ae953713c14fe36c508f185cc39>7.4.7 - Tips on working with locators</h1><div class=lead>When to use which locators and how best to manage them in your code.</div><p>Take a look at examples of the <a href=https://www.selenium.dev/documentation/webdriver/elements/locators/>supported locator strategies</a>.</p><p>In general, if HTML IDs are available, unique, and consistently
predictable, they are the preferred method for locating an element on
a page. They tend to work very quickly, and forego much processing
that comes with complicated DOM traversals.</p><p>If unique IDs are unavailable, a well-written CSS selector is the
Expand Down Expand Up @@ -14503,7 +14506,7 @@
<label><a href=https://github.com/titusfortner>@titusfortner</a></label>
<span class=contributions>232 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>140 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/3264250?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
<span class=contributions>141 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/3264250?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/alaahong>@alaahong</a></label>
<span class=contributions>115 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/10705590?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/pujagani>@pujagani</a></label>
Expand All @@ -14523,12 +14526,12 @@
<label><a href=https://github.com/aguspe>@aguspe</a></label>
<span class=contributions>26 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/6996743?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/AlexAndradeNet>@AlexAndradeNet</a></label>
<span class=contributions>25 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/in/29110?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
<span class=contributions>25 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>22 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/in/29110?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/dependabot>@dependabot[bot]</a></label>
<span class=contributions>22 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/1823178?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/manoj9788>@manoj9788</a></label>
<span class=contributions>21 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>21 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/47970682?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/jmartinezpoq>@jmartinezpoq</a></label>
<span class=contributions>18 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/22507394?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
Expand Down
8 changes: 4 additions & 4 deletions documentation/about/_print/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@
<label><a href=https://github.com/titusfortner>@titusfortner</a></label>
<span class=contributions>232 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>140 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/3264250?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
<span class=contributions>141 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/3264250?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/alaahong>@alaahong</a></label>
<span class=contributions>115 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/10705590?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/pujagani>@pujagani</a></label>
Expand All @@ -557,12 +557,12 @@
<label><a href=https://github.com/aguspe>@aguspe</a></label>
<span class=contributions>26 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/6996743?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/AlexAndradeNet>@AlexAndradeNet</a></label>
<span class=contributions>25 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/in/29110?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
<span class=contributions>25 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>22 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/in/29110?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/dependabot>@dependabot[bot]</a></label>
<span class=contributions>22 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/1823178?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/manoj9788>@manoj9788</a></label>
<span class=contributions>21 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>21 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/47970682?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/jmartinezpoq>@jmartinezpoq</a></label>
<span class=contributions>18 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/22507394?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
Expand Down
8 changes: 4 additions & 4 deletions documentation/about/copyright/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@
<label><a href=https://github.com/titusfortner>@titusfortner</a></label>
<span class=contributions>232 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>140 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/3264250?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
<span class=contributions>141 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/3264250?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/alaahong>@alaahong</a></label>
<span class=contributions>115 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/10705590?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/pujagani>@pujagani</a></label>
Expand All @@ -543,12 +543,12 @@
<label><a href=https://github.com/aguspe>@aguspe</a></label>
<span class=contributions>26 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/6996743?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/AlexAndradeNet>@AlexAndradeNet</a></label>
<span class=contributions>25 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/in/29110?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
<span class=contributions>25 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>22 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/in/29110?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/dependabot>@dependabot[bot]</a></label>
<span class=contributions>22 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/1823178?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/manoj9788>@manoj9788</a></label>
<span class=contributions>21 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>21 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/47970682?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/jmartinezpoq>@jmartinezpoq</a></label>
<span class=contributions>18 commits</span></div><div style=padding:10px><img src="https://avatars.githubusercontent.com/u/22507394?v=4" class=inline width=100 height=100 style=height:100px;height:100px;margin-bottom:.25em;vertical-align:middle>
Expand Down
5 changes: 4 additions & 1 deletion documentation/test_practices/_print/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,10 @@
for valid orders before picking one to perform an action on. Should two tests
pick up the same order you are likely to get unexpected behavior.</p></li><li><p>Clean up stale data in the application that might be picked up by another
test e.g. invalid order records.</p></li><li><p>Create a new WebDriver instance per test. This helps ensure test isolation
and makes parallelization simpler.</p></li></ul></div><div class=td-content style=page-break-before:always><h1 id=pg-84640ae953713c14fe36c508f185cc39>4.7 - Tips on working with locators</h1><div class=lead>When to use which locators and how best to manage them in your code.</div><p>Take a look at examples of the <a href=https://www.selenium.dev/documentation/webdriver/elements/locators/>supported locator strategies</a>.</p><p>In general, if HTML IDs are available, unique, and consistently
and makes parallelization simpler.</p><ul><li>If you choose <a href=https://pytest.org/>pytest</a> as your test runner, this can be
easily done by yielding your driver in a global fixture. This way each test gets its own
driver instance, and you can ensure that drivers always quit after a test is finished
(pass or fail).</li></ul></li></ul></div><div class=td-content style=page-break-before:always><h1 id=pg-84640ae953713c14fe36c508f185cc39>4.7 - Tips on working with locators</h1><div class=lead>When to use which locators and how best to manage them in your code.</div><p>Take a look at examples of the <a href=https://www.selenium.dev/documentation/webdriver/elements/locators/>supported locator strategies</a>.</p><p>In general, if HTML IDs are available, unique, and consistently
predictable, they are the preferred method for locating an element on
a page. They tend to work very quickly, and forego much processing
that comes with complicated DOM traversals.</p><p>If unique IDs are unavailable, a well-written CSS selector is the
Expand Down
5 changes: 4 additions & 1 deletion documentation/test_practices/encouraged/_print/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,10 @@
for valid orders before picking one to perform an action on. Should two tests
pick up the same order you are likely to get unexpected behavior.</p></li><li><p>Clean up stale data in the application that might be picked up by another
test e.g. invalid order records.</p></li><li><p>Create a new WebDriver instance per test. This helps ensure test isolation
and makes parallelization simpler.</p></li></ul></div><div class=td-content style=page-break-before:always><h1 id=pg-84640ae953713c14fe36c508f185cc39>7 - Tips on working with locators</h1><div class=lead>When to use which locators and how best to manage them in your code.</div><p>Take a look at examples of the <a href=https://www.selenium.dev/documentation/webdriver/elements/locators/>supported locator strategies</a>.</p><p>In general, if HTML IDs are available, unique, and consistently
and makes parallelization simpler.</p><ul><li>If you choose <a href=https://pytest.org/>pytest</a> as your test runner, this can be
easily done by yielding your driver in a global fixture. This way each test gets its own
driver instance, and you can ensure that drivers always quit after a test is finished
(pass or fail).</li></ul></li></ul></div><div class=td-content style=page-break-before:always><h1 id=pg-84640ae953713c14fe36c508f185cc39>7 - Tips on working with locators</h1><div class=lead>When to use which locators and how best to manage them in your code.</div><p>Take a look at examples of the <a href=https://www.selenium.dev/documentation/webdriver/elements/locators/>supported locator strategies</a>.</p><p>In general, if HTML IDs are available, unique, and consistently
predictable, they are the preferred method for locating an element on
a page. They tend to work very quickly, and forego much processing
that comes with complicated DOM traversals.</p><p>If unique IDs are unavailable, a well-written CSS selector is the
Expand Down
Loading

0 comments on commit 0eacf7d

Please sign in to comment.