Skip to content

Commit b01041f

Browse files
navin772harsha509
andauthored
[py]: set consistent polling across java and python for WebDriverWait methods (#14626)
Co-authored-by: Sri Harsha <[email protected]>
1 parent 68f82b3 commit b01041f

File tree

1 file changed

+2
-2
lines changed
  • py/selenium/webdriver/support

1 file changed

+2
-2
lines changed

py/selenium/webdriver/support/wait.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ def until(self, method: Callable[[D], Union[Literal[False], T]], message: str =
9999
except self._ignored_exceptions as exc:
100100
screen = getattr(exc, "screen", None)
101101
stacktrace = getattr(exc, "stacktrace", None)
102-
time.sleep(self._poll)
103102
if time.monotonic() > end_time:
104103
break
104+
time.sleep(self._poll)
105105
raise TimeoutException(message, screen, stacktrace)
106106

107107
def until_not(self, method: Callable[[D], T], message: str = "") -> Union[T, Literal[True]]:
@@ -122,7 +122,7 @@ def until_not(self, method: Callable[[D], T], message: str = "") -> Union[T, Lit
122122
return value
123123
except self._ignored_exceptions:
124124
return True
125-
time.sleep(self._poll)
126125
if time.monotonic() > end_time:
127126
break
127+
time.sleep(self._poll)
128128
raise TimeoutException(message)

0 commit comments

Comments
 (0)