You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Copy file name to clipboardExpand all lines: documentation/_print/index.html
+8-5Lines changed: 8 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -11480,7 +11480,10 @@
11480
11480
for valid orders before picking one to perform an action on. Should two tests
11481
11481
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
11482
11482
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
11484
11487
predictable, they are the preferred method for locating an element on
11485
11488
a page. They tend to work very quickly, and forego much processing
11486
11489
that comes with complicated DOM traversals.</p><p>If unique IDs are unavailable, a well-written CSS selector is the
Copy file name to clipboardExpand all lines: documentation/test_practices/_print/index.html
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1125,7 +1125,10 @@
1125
1125
for valid orders before picking one to perform an action on. Should two tests
1126
1126
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
1127
1127
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><divclass=td-contentstyle=page-break-before:always><h1id=pg-84640ae953713c14fe36c508f185cc39>4.7 - Tips on working with locators</h1><divclass=lead>When to use which locators and how best to manage them in your code.</div><p>Take a look at examples of the <ahref=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 <ahref=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><divclass=td-contentstyle=page-break-before:always><h1id=pg-84640ae953713c14fe36c508f185cc39>4.7 - Tips on working with locators</h1><divclass=lead>When to use which locators and how best to manage them in your code.</div><p>Take a look at examples of the <ahref=https://www.selenium.dev/documentation/webdriver/elements/locators/>supported locator strategies</a>.</p><p>In general, if HTML IDs are available, unique, and consistently
1129
1132
predictable, they are the preferred method for locating an element on
1130
1133
a page. They tend to work very quickly, and forego much processing
1131
1134
that comes with complicated DOM traversals.</p><p>If unique IDs are unavailable, a well-written CSS selector is the
Copy file name to clipboardExpand all lines: documentation/test_practices/encouraged/_print/index.html
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -468,7 +468,10 @@
468
468
for valid orders before picking one to perform an action on. Should two tests
469
469
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
470
470
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><divclass=td-contentstyle=page-break-before:always><h1id=pg-84640ae953713c14fe36c508f185cc39>7 - Tips on working with locators</h1><divclass=lead>When to use which locators and how best to manage them in your code.</div><p>Take a look at examples of the <ahref=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 <ahref=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><divclass=td-contentstyle=page-break-before:always><h1id=pg-84640ae953713c14fe36c508f185cc39>7 - Tips on working with locators</h1><divclass=lead>When to use which locators and how best to manage them in your code.</div><p>Take a look at examples of the <ahref=https://www.selenium.dev/documentation/webdriver/elements/locators/>supported locator strategies</a>.</p><p>In general, if HTML IDs are available, unique, and consistently
472
475
predictable, they are the preferred method for locating an element on
473
476
a page. They tend to work very quickly, and forego much processing
474
477
that comes with complicated DOM traversals.</p><p>If unique IDs are unavailable, a well-written CSS selector is the
0 commit comments