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

Method scroll_up

seleniumbase/fixtures/base_case.py:7006–7012  ·  view source on GitHub ↗

Scrolls up as a percentage of the page.

(self, amount=25)

Source from the content-addressed store, hash-verified

7004 time.sleep(0.012)
7005
7006 def scroll_up(self, amount=25):
7007 """Scrolls up as a percentage of the page."""
7008 if self.__is_cdp_swap_needed():
7009 self.cdp.scroll_up(amount)
7010 return
7011 amount = self.get_window_size()["height"] * amount / 100
7012 self.execute_script("window.scrollBy(0, -%s);" % amount)
7013
7014 def scroll_down(self, amount=25):
7015 """Scrolls down as a percentage of the page."""

Callers

nothing calls this directly

Calls 3

__is_cdp_swap_neededMethod · 0.95
get_window_sizeMethod · 0.95
execute_scriptMethod · 0.95

Tested by

no test coverage detected