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
Copy file name to clipboardExpand all lines: website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.pt-br.md
+19-5Lines changed: 19 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -94,27 +94,41 @@ for your error, you must both navigate back to the correct location and relocate
94
94
95
95
## ElementClickInterceptedException
96
96
97
-
This exception occurs when Selenium tries to click an element, but the click would instead be received by a different element. Before Selenium will click an element, it checks if the element is visible, unobscured by any other elements, and enabled - if the element is obscured, it will raise this exception.
97
+
This exception occurs when Selenium tries to click an element, but the click would instead
98
+
be received by a different element. Before Selenium will click an element, it checks if the
99
+
element is visible, unobscured by any other elements, and enabled - if the element is obscured,
100
+
it will raise this exception.
98
101
99
102
### Likely Cause
100
103
101
104
**UI Elements Overlapping**
102
105
103
-
Elements on the UI are typically placed next to each other, but occasionally elements may overlap. For example, a navbar always staying at the top of your window as you scroll a page. If that navbar happens to be covering an element we are trying to click, Selenium might believe it to be visible and enabled, but when you try to click it will throw this exception. Pop-ups and Modals are also common offenders here.
106
+
Elements on the UI are typically placed next to each other, but occasionally elements may overlap.
107
+
For example, a navbar always staying at the top of your window as you scroll a page. If that navbar
108
+
happens to be covering an element we are trying to click, Selenium might believe it to be visible
109
+
and enabled, but when you try to click it will throw this exception. Pop-ups and Modals are also
110
+
common offenders here.
104
111
105
112
**Animations**
106
113
107
-
Elements with animations have the potential to cause this exception as well - it is recommended to wait for animations to cease before attempting to click an element.
114
+
Elements with animations have the potential to cause this exception as well - it is recommended
115
+
to wait for animations to cease before attempting to click an element.
108
116
109
117
### Possible Solutions
110
118
111
119
**Use Explicit Waits**
112
120
113
-
Explicit waits will likely be your best friend in these instances. A great way is to use `ExpectedCondition.ToBeClickable()` with `WebDriverWait` to wait until the right moment.
121
+
[Explicit Waits]({{< ref "/documentation/webdriver/waits" >}}) will likely be your best friend in these instances.
122
+
A great way is to use `ExpectedCondition.ToBeClickable()` with `WebDriverWait`
123
+
to wait until the right moment.
114
124
115
125
**Scroll the Element into View**
116
126
117
-
In instances where the element is out of view, but Selenium still registers the element as visible (e.g. navbars overlapping a section at the top of your screen), you can use the `WebDriver.executeScript()` method to execute a javascript function to scroll (e.g. `WebDriver.executeScript('window.scrollBy(0,-250)')`) or you can utilize the Actions class with `Actions.moveToElement(element)`.
127
+
In instances where the element is out of view, but Selenium still registers the element as visible
128
+
(e.g. navbars overlapping a section at the top of your screen), you can use the
129
+
`WebDriver.executeScript()` method to execute a javascript function to scroll
130
+
(e.g. `WebDriver.executeScript('window.scrollBy(0,-250)')`) or you can utilize the Actions
0 commit comments