Skip to content

Commit 6a675dc

Browse files
committed
Add more time for jQuery to load from CDN links as needed
1 parent 41b344a commit 6a675dc

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

seleniumbase/fixtures/js_utils.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,8 @@ def raise_unable_to_load_jquery_exception(driver):
157157

158158

159159
def activate_jquery(driver):
160-
"""
161-
If "jQuery is not defined" on a website, use this method to activate it.
162-
This method is needed because jQuery is not always defined on web sites.
163-
"""
160+
"""If "jQuery is not defined" on a website, use this method to activate it.
161+
This method is needed because jQuery is not always defined on web sites."""
164162
try:
165163
# Let's first find out if jQuery is already defined.
166164
driver.execute_script("jQuery('html');")
@@ -171,13 +169,13 @@ def activate_jquery(driver):
171169
pass
172170
jquery_js = constants.JQuery.MIN_JS
173171
add_js_link(driver, jquery_js)
174-
for x in range(32):
172+
for x in range(36):
175173
# jQuery needs a small amount of time to activate.
176174
try:
177175
driver.execute_script("jQuery('html');")
178176
return
179177
except Exception:
180-
if x == 16:
178+
if x == 18:
181179
add_js_link(driver, jquery_js)
182180
time.sleep(0.1)
183181
# Since jQuery still isn't activating, give up and raise an exception

0 commit comments

Comments
 (0)