Skip to content

Commit b0585dc

Browse files
committed
upgraded headers to reflect error messages (#1963)[deploy site]
Co-authored-by: Sri Harsha <12621691+harsha509@users.noreply.github.com> 744290a
1 parent e545373 commit b0585dc

File tree

25 files changed

+55
-55
lines changed

25 files changed

+55
-55
lines changed

documentation/_print/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8816,7 +8816,7 @@
88168816
out a driver problem by executing the command in multiple <a href=https://www.selenium.dev/documentation/webdriver/browsers/>browsers</a>.</p></li><li><p>If you have questions about how to do things, check out the <a href=/support/>Support options</a>
88178817
for ways get assistance.</p></li><li><p>If you think you&rsquo;ve found a problem with Selenium code, go ahead and file a
88188818
<a href="https://github.com/SeleniumHQ/selenium/issues/new?assignees=&labels=I-defect%2Cneeds-triaging&template=bug-report.yml&title=%5B%F0%9F%90%9B+Bug%5D%3A+">Bug Report</a>
8819-
on GitHub.</p></li></ol></div><div class=td-content style=page-break-before:always><h1 id=pg-9106a7ac709cadefdb6e4b92e9e3ceaf>2.10.1 - Understanding Common Errors</h1><div class=lead>How to get deal with various problems in your Selenium code.</div><h2 id=invalid-selector-exception>Invalid Selector Exception</h2><p>CSS and XPath Selectors are sometimes difficult to get correct.</p><h3 id=likely-cause>Likely Cause</h3><p>The CSS or XPath selector you are trying to use has invalid characters or an invalid query.</p><h3 id=possible-solutions>Possible Solutions</h3><p>Run your selector through a validator service:</p><ul><li><a href=http://csslint.net/>CSS Validator</a></li><li><a href=http://www.freeformatter.com/xpath-tester.html>xPath Validator</a></li></ul><p>Or use a browser extension to get a known good value:</p><ul><li><a href=https://selectorshub.com/selectorshub/>SelectorsHub</a></li></ul><h2 id=no-such-element-exception>No Such Element Exception</h2><p>The element can not be found at the exact moment you attempted to locate it.</p><h3 id=likely-cause-1>Likely Cause</h3><ul><li>You are looking for the element in the wrong place (perhaps a previous action was unsuccessful).</li><li>You are looking for the element at the wrong time (the element has not shown up in the DOM, yet)</li><li>The locator has changed since you wrote the code</li></ul><h3 id=possible-solutions-1>Possible Solutions</h3><ul><li>Make sure you are on the page you expect to be on, and that previous actions in your code completed correctly</li><li>Make sure you are using a proper <a href=https://www.selenium.dev/documentation/webdriver/waits/>Waiting Strategy</a></li><li>Update the locator with the browser&rsquo;s devtools console or use a browser extension like:<ul><li><a href=https://selectorshub.com/selectorshub/>SelectorsHub</a></li></ul></li></ul><h2 id=stale-element-reference-exception>Stale Element Reference Exception</h2><p>An element goes stale when it was previously located, but can not be currently accessed.
8819+
on GitHub.</p></li></ol></div><div class=td-content style=page-break-before:always><h1 id=pg-9106a7ac709cadefdb6e4b92e9e3ceaf>2.10.1 - Understanding Common Errors</h1><div class=lead>How to get deal with various problems in your Selenium code.</div><h2 id=invalidselectorexception>InvalidSelectorException</h2><p>CSS and XPath Selectors are sometimes difficult to get correct.</p><h3 id=likely-cause>Likely Cause</h3><p>The CSS or XPath selector you are trying to use has invalid characters or an invalid query.</p><h3 id=possible-solutions>Possible Solutions</h3><p>Run your selector through a validator service:</p><ul><li><a href=http://csslint.net/>CSS Validator</a></li><li><a href=http://www.freeformatter.com/xpath-tester.html>xPath Validator</a></li></ul><p>Or use a browser extension to get a known good value:</p><ul><li><a href=https://selectorshub.com/selectorshub/>SelectorsHub</a></li></ul><h2 id=nosuchelementexception>NoSuchElementException</h2><p>The element can not be found at the exact moment you attempted to locate it.</p><h3 id=likely-cause-1>Likely Cause</h3><ul><li>You are looking for the element in the wrong place (perhaps a previous action was unsuccessful).</li><li>You are looking for the element at the wrong time (the element has not shown up in the DOM, yet)</li><li>The locator has changed since you wrote the code</li></ul><h3 id=possible-solutions-1>Possible Solutions</h3><ul><li>Make sure you are on the page you expect to be on, and that previous actions in your code completed correctly</li><li>Make sure you are using a proper <a href=https://www.selenium.dev/documentation/webdriver/waits/>Waiting Strategy</a></li><li>Update the locator with the browser&rsquo;s devtools console or use a browser extension like:<ul><li><a href=https://selectorshub.com/selectorshub/>SelectorsHub</a></li></ul></li></ul><h2 id=staleelementreferenceexception>StaleElementReferenceException</h2><p>An element goes stale when it was previously located, but can not be currently accessed.
88208820
Elements do not get relocated automatically; the driver creates a reference ID for the element and
88218821
has a particular place it expects to find it in the DOM. If it can not find the element
88228822
in the current DOM, any action using that element will result in this exception.</p><h3 id=likely-cause-2>Likely Cause</h3><p>This can happen when:</p><ul><li>You have refreshed the page, or the DOM of the page has dynamically changed.</li><li>You have navigated to a different page.</li><li>You have switched to another window or into or out of a frame or iframe.</li></ul><h3 id=possible-solutions-2>Possible Solutions</h3><p><strong>The DOM has changed</strong></p><p>When the page is refreshed or items on the page have moved around, there is still
@@ -8848,7 +8848,7 @@
88488848
A great way is to use <code>ExpectedCondition.ToBeClickable()</code> with <code>WebDriverWait</code> to wait until the right moment.</p><p><strong>Scroll the Element into View</strong></p><p>In instances where the element is out of view, but Selenium still registers the element as visible
88498849
(e.g. navbars overlapping a section at the top of your screen), you can use the <code>WebDriver.executeScript()</code>
88508850
method to execute a javascript function to scroll (e.g. <code>WebDriver.executeScript('window.scrollBy(0,-250)')</code>)
8851-
or you can utilize the Actions class with <code>Actions.moveToElement(element)</code>.</p><h2 id=invalid-sessionid-exception>Invalid SessionId Exception</h2><p>Sometimes the session you&rsquo;re trying to access is different than what&rsquo;s currently available</p><h3 id=likely-cause-4>Likely Cause</h3><p>This usually occurs when the session has been deleted (e.g. <code>driver.quit()</code>) or if the session has changed,
8851+
or you can utilize the Actions class with <code>Actions.moveToElement(element)</code>.</p><h2 id=invalidsessionidexception>InvalidSessionIdException</h2><p>Sometimes the session you&rsquo;re trying to access is different than what&rsquo;s currently available</p><h3 id=likely-cause-4>Likely Cause</h3><p>This usually occurs when the session has been deleted (e.g. <code>driver.quit()</code>) or if the session has changed,
88528852
like when the last tab/browser has closed (e.g. <code>driver.close()</code>)</p><h3 id=possible-solutions-4>Possible Solutions</h3><p>Check your script for instances of <code>driver.close()</code> and <code>driver.quit()</code>, and any other possible causes
88538853
of closed tabs/browsers. It could be that you are locating an element before you should/can.</p></div><div class=td-content style=page-break-before:always><h1 id=pg-5a7d28a8d143d2eaa2a6727d561e2164>2.10.1.1 - Unable to Locate Driver Error</h1><div class=lead>Troubleshooting missing path to driver executable.</div><p>Historically, this is the most common error beginning Selenium users get
88548854
when trying to run code for the first time:</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>

documentation/webdriver/_print/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8617,7 +8617,7 @@
86178617
out a driver problem by executing the command in multiple <a href=https://www.selenium.dev/documentation/webdriver/browsers/>browsers</a>.</p></li><li><p>If you have questions about how to do things, check out the <a href=/support/>Support options</a>
86188618
for ways get assistance.</p></li><li><p>If you think you&rsquo;ve found a problem with Selenium code, go ahead and file a
86198619
<a href="https://github.com/SeleniumHQ/selenium/issues/new?assignees=&labels=I-defect%2Cneeds-triaging&template=bug-report.yml&title=%5B%F0%9F%90%9B+Bug%5D%3A+">Bug Report</a>
8620-
on GitHub.</p></li></ol></div><div class=td-content style=page-break-before:always><h1 id=pg-9106a7ac709cadefdb6e4b92e9e3ceaf>10.1 - Understanding Common Errors</h1><div class=lead>How to get deal with various problems in your Selenium code.</div><h2 id=invalid-selector-exception>Invalid Selector Exception</h2><p>CSS and XPath Selectors are sometimes difficult to get correct.</p><h3 id=likely-cause>Likely Cause</h3><p>The CSS or XPath selector you are trying to use has invalid characters or an invalid query.</p><h3 id=possible-solutions>Possible Solutions</h3><p>Run your selector through a validator service:</p><ul><li><a href=http://csslint.net/>CSS Validator</a></li><li><a href=http://www.freeformatter.com/xpath-tester.html>xPath Validator</a></li></ul><p>Or use a browser extension to get a known good value:</p><ul><li><a href=https://selectorshub.com/selectorshub/>SelectorsHub</a></li></ul><h2 id=no-such-element-exception>No Such Element Exception</h2><p>The element can not be found at the exact moment you attempted to locate it.</p><h3 id=likely-cause-1>Likely Cause</h3><ul><li>You are looking for the element in the wrong place (perhaps a previous action was unsuccessful).</li><li>You are looking for the element at the wrong time (the element has not shown up in the DOM, yet)</li><li>The locator has changed since you wrote the code</li></ul><h3 id=possible-solutions-1>Possible Solutions</h3><ul><li>Make sure you are on the page you expect to be on, and that previous actions in your code completed correctly</li><li>Make sure you are using a proper <a href=https://www.selenium.dev/documentation/webdriver/waits/>Waiting Strategy</a></li><li>Update the locator with the browser&rsquo;s devtools console or use a browser extension like:<ul><li><a href=https://selectorshub.com/selectorshub/>SelectorsHub</a></li></ul></li></ul><h2 id=stale-element-reference-exception>Stale Element Reference Exception</h2><p>An element goes stale when it was previously located, but can not be currently accessed.
8620+
on GitHub.</p></li></ol></div><div class=td-content style=page-break-before:always><h1 id=pg-9106a7ac709cadefdb6e4b92e9e3ceaf>10.1 - Understanding Common Errors</h1><div class=lead>How to get deal with various problems in your Selenium code.</div><h2 id=invalidselectorexception>InvalidSelectorException</h2><p>CSS and XPath Selectors are sometimes difficult to get correct.</p><h3 id=likely-cause>Likely Cause</h3><p>The CSS or XPath selector you are trying to use has invalid characters or an invalid query.</p><h3 id=possible-solutions>Possible Solutions</h3><p>Run your selector through a validator service:</p><ul><li><a href=http://csslint.net/>CSS Validator</a></li><li><a href=http://www.freeformatter.com/xpath-tester.html>xPath Validator</a></li></ul><p>Or use a browser extension to get a known good value:</p><ul><li><a href=https://selectorshub.com/selectorshub/>SelectorsHub</a></li></ul><h2 id=nosuchelementexception>NoSuchElementException</h2><p>The element can not be found at the exact moment you attempted to locate it.</p><h3 id=likely-cause-1>Likely Cause</h3><ul><li>You are looking for the element in the wrong place (perhaps a previous action was unsuccessful).</li><li>You are looking for the element at the wrong time (the element has not shown up in the DOM, yet)</li><li>The locator has changed since you wrote the code</li></ul><h3 id=possible-solutions-1>Possible Solutions</h3><ul><li>Make sure you are on the page you expect to be on, and that previous actions in your code completed correctly</li><li>Make sure you are using a proper <a href=https://www.selenium.dev/documentation/webdriver/waits/>Waiting Strategy</a></li><li>Update the locator with the browser&rsquo;s devtools console or use a browser extension like:<ul><li><a href=https://selectorshub.com/selectorshub/>SelectorsHub</a></li></ul></li></ul><h2 id=staleelementreferenceexception>StaleElementReferenceException</h2><p>An element goes stale when it was previously located, but can not be currently accessed.
86218621
Elements do not get relocated automatically; the driver creates a reference ID for the element and
86228622
has a particular place it expects to find it in the DOM. If it can not find the element
86238623
in the current DOM, any action using that element will result in this exception.</p><h3 id=likely-cause-2>Likely Cause</h3><p>This can happen when:</p><ul><li>You have refreshed the page, or the DOM of the page has dynamically changed.</li><li>You have navigated to a different page.</li><li>You have switched to another window or into or out of a frame or iframe.</li></ul><h3 id=possible-solutions-2>Possible Solutions</h3><p><strong>The DOM has changed</strong></p><p>When the page is refreshed or items on the page have moved around, there is still
@@ -8649,7 +8649,7 @@
86498649
A great way is to use <code>ExpectedCondition.ToBeClickable()</code> with <code>WebDriverWait</code> to wait until the right moment.</p><p><strong>Scroll the Element into View</strong></p><p>In instances where the element is out of view, but Selenium still registers the element as visible
86508650
(e.g. navbars overlapping a section at the top of your screen), you can use the <code>WebDriver.executeScript()</code>
86518651
method to execute a javascript function to scroll (e.g. <code>WebDriver.executeScript('window.scrollBy(0,-250)')</code>)
8652-
or you can utilize the Actions class with <code>Actions.moveToElement(element)</code>.</p><h2 id=invalid-sessionid-exception>Invalid SessionId Exception</h2><p>Sometimes the session you&rsquo;re trying to access is different than what&rsquo;s currently available</p><h3 id=likely-cause-4>Likely Cause</h3><p>This usually occurs when the session has been deleted (e.g. <code>driver.quit()</code>) or if the session has changed,
8652+
or you can utilize the Actions class with <code>Actions.moveToElement(element)</code>.</p><h2 id=invalidsessionidexception>InvalidSessionIdException</h2><p>Sometimes the session you&rsquo;re trying to access is different than what&rsquo;s currently available</p><h3 id=likely-cause-4>Likely Cause</h3><p>This usually occurs when the session has been deleted (e.g. <code>driver.quit()</code>) or if the session has changed,
86538653
like when the last tab/browser has closed (e.g. <code>driver.close()</code>)</p><h3 id=possible-solutions-4>Possible Solutions</h3><p>Check your script for instances of <code>driver.close()</code> and <code>driver.quit()</code>, and any other possible causes
86548654
of closed tabs/browsers. It could be that you are locating an element before you should/can.</p></div><div class=td-content style=page-break-before:always><h1 id=pg-5a7d28a8d143d2eaa2a6727d561e2164>10.1.1 - Unable to Locate Driver Error</h1><div class=lead>Troubleshooting missing path to driver executable.</div><p>Historically, this is the most common error beginning Selenium users get
86558655
when trying to run code for the first time:</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>

0 commit comments

Comments
 (0)