Skip to content

Commit 0eacf7d

Browse files
committed
Added more detail to Avoid Sharing State Documentation (#1948)[deploy 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
1 parent 417940d commit 0eacf7d

File tree

31 files changed

+143
-85
lines changed

31 files changed

+143
-85
lines changed

documentation/_print/index.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11480,7 +11480,10 @@
1148011480
for valid orders before picking one to perform an action on. Should two tests
1148111481
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
1148211482
test e.g. invalid order records.</p></li><li><p>Create a new WebDriver instance per test. This helps ensure test isolation
11483-
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
11483+
and makes parallelization simpler.</p><ul><li>If you choose <a href=https://pytest.org/>pytest</a> as your test runner, this can be
11484+
easily done by yielding your driver in a global fixture. This way each test gets its own
11485+
driver instance, and you can ensure that drivers always quit after a test is finished
11486+
(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
1148411487
predictable, they are the preferred method for locating an element on
1148511488
a page. They tend to work very quickly, and forego much processing
1148611489
that comes with complicated DOM traversals.</p><p>If unique IDs are unavailable, a well-written CSS selector is the
@@ -14503,7 +14506,7 @@
1450314506
<label><a href=https://github.com/titusfortner>@titusfortner</a></label>
1450414507
<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>
1450514508
<label><a href=https://github.com/apps/renovate>@renovate[bot]</a></label>
14506-
<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>
14509+
<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>
1450714510
<label><a href=https://github.com/alaahong>@alaahong</a></label>
1450814511
<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>
1450914512
<label><a href=https://github.com/pujagani>@pujagani</a></label>
@@ -14523,12 +14526,12 @@
1452314526
<label><a href=https://github.com/aguspe>@aguspe</a></label>
1452414527
<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>
1452514528
<label><a href=https://github.com/AlexAndradeNet>@AlexAndradeNet</a></label>
14526-
<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>
14529+
<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>
14530+
<label><a href=https://github.com/shbenzer>@shbenzer</a></label>
14531+
<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>
1452714532
<label><a href=https://github.com/apps/dependabot>@dependabot[bot]</a></label>
1452814533
<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>
1452914534
<label><a href=https://github.com/manoj9788>@manoj9788</a></label>
14530-
<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>
14531-
<label><a href=https://github.com/shbenzer>@shbenzer</a></label>
1453214535
<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>
1453314536
<label><a href=https://github.com/jmartinezpoq>@jmartinezpoq</a></label>
1453414537
<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>

documentation/about/_print/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@
537537
<label><a href=https://github.com/titusfortner>@titusfortner</a></label>
538538
<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>
539539
<label><a href=https://github.com/apps/renovate>@renovate[bot]</a></label>
540-
<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>
540+
<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>
541541
<label><a href=https://github.com/alaahong>@alaahong</a></label>
542542
<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>
543543
<label><a href=https://github.com/pujagani>@pujagani</a></label>
@@ -557,12 +557,12 @@
557557
<label><a href=https://github.com/aguspe>@aguspe</a></label>
558558
<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>
559559
<label><a href=https://github.com/AlexAndradeNet>@AlexAndradeNet</a></label>
560-
<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>
560+
<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>
561+
<label><a href=https://github.com/shbenzer>@shbenzer</a></label>
562+
<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>
561563
<label><a href=https://github.com/apps/dependabot>@dependabot[bot]</a></label>
562564
<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>
563565
<label><a href=https://github.com/manoj9788>@manoj9788</a></label>
564-
<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>
565-
<label><a href=https://github.com/shbenzer>@shbenzer</a></label>
566566
<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>
567567
<label><a href=https://github.com/jmartinezpoq>@jmartinezpoq</a></label>
568568
<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>

documentation/about/copyright/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@
523523
<label><a href=https://github.com/titusfortner>@titusfortner</a></label>
524524
<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>
525525
<label><a href=https://github.com/apps/renovate>@renovate[bot]</a></label>
526-
<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>
526+
<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>
527527
<label><a href=https://github.com/alaahong>@alaahong</a></label>
528528
<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>
529529
<label><a href=https://github.com/pujagani>@pujagani</a></label>
@@ -543,12 +543,12 @@
543543
<label><a href=https://github.com/aguspe>@aguspe</a></label>
544544
<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>
545545
<label><a href=https://github.com/AlexAndradeNet>@AlexAndradeNet</a></label>
546-
<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>
546+
<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>
547+
<label><a href=https://github.com/shbenzer>@shbenzer</a></label>
548+
<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>
547549
<label><a href=https://github.com/apps/dependabot>@dependabot[bot]</a></label>
548550
<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>
549551
<label><a href=https://github.com/manoj9788>@manoj9788</a></label>
550-
<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>
551-
<label><a href=https://github.com/shbenzer>@shbenzer</a></label>
552552
<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>
553553
<label><a href=https://github.com/jmartinezpoq>@jmartinezpoq</a></label>
554554
<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>

documentation/test_practices/_print/index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,10 @@
11251125
for valid orders before picking one to perform an action on. Should two tests
11261126
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
11271127
test e.g. invalid order records.</p></li><li><p>Create a new WebDriver instance per test. This helps ensure test isolation
1128-
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
1128+
and makes parallelization simpler.</p><ul><li>If you choose <a href=https://pytest.org/>pytest</a> as your test runner, this can be
1129+
easily done by yielding your driver in a global fixture. This way each test gets its own
1130+
driver instance, and you can ensure that drivers always quit after a test is finished
1131+
(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
11291132
predictable, they are the preferred method for locating an element on
11301133
a page. They tend to work very quickly, and forego much processing
11311134
that comes with complicated DOM traversals.</p><p>If unique IDs are unavailable, a well-written CSS selector is the

documentation/test_practices/encouraged/_print/index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,10 @@
468468
for valid orders before picking one to perform an action on. Should two tests
469469
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
470470
test e.g. invalid order records.</p></li><li><p>Create a new WebDriver instance per test. This helps ensure test isolation
471-
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
471+
and makes parallelization simpler.</p><ul><li>If you choose <a href=https://pytest.org/>pytest</a> as your test runner, this can be
472+
easily done by yielding your driver in a global fixture. This way each test gets its own
473+
driver instance, and you can ensure that drivers always quit after a test is finished
474+
(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
472475
predictable, they are the preferred method for locating an element on
473476
a page. They tend to work very quickly, and forego much processing
474477
that comes with complicated DOM traversals.</p><p>If unique IDs are unavailable, a well-written CSS selector is the

0 commit comments

Comments
 (0)