MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / scroll_to_element

Function scroll_to_element

seleniumbase/fixtures/js_utils.py:1287–1296  ·  view source on GitHub ↗
(driver, element)

Source from the content-addressed store, hash-verified

1285
1286
1287def scroll_to_element(driver, element):
1288 if driver.capabilities["browserName"].lower() == "firefox":
1289 return __old_scroll_to_element(driver, element)
1290 try:
1291 driver.execute_script(
1292 "arguments[0].scrollIntoViewIfNeeded(true);", element
1293 )
1294 return True
1295 except Exception:
1296 return __old_scroll_to_element(driver, element)
1297
1298
1299def __old_scroll_to_element(driver, element):

Callers 1

slow_scroll_to_elementFunction · 0.85

Calls 2

__old_scroll_to_elementFunction · 0.85
execute_scriptMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…