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

Method flash

seleniumbase/core/sb_cdp.py:1019–1034  ·  view source on GitHub ↗

Paint a quickly-vanishing dot over an element.

(
        self,
        selector,  # The CSS Selector to flash
        duration=1,  # (seconds) flash duration
        color="44CC88",  # RGB hex flash color
        pause=0,  # (seconds) If 0, the next action starts during flash
    )

Source from the content-addressed store, hash-verified

1017 )
1018
1019 def flash(
1020 self,
1021 selector, # The CSS Selector to flash
1022 duration=1, # (seconds) flash duration
1023 color="44CC88", # RGB hex flash color
1024 pause=0, # (seconds) If 0, the next action starts during flash
1025 ):
1026 """Paint a quickly-vanishing dot over an element."""
1027 selector = self.__convert_to_css_if_xpath(selector)
1028 element = self.find_element(selector)
1029 element.scroll_into_view()
1030 x_offset = self.__get_x_scroll_offset()
1031 y_offset = self.__get_y_scroll_offset()
1032 element.flash(duration, color, x_offset, y_offset)
1033 if pause and isinstance(pause, (int, float)):
1034 time.sleep(pause)
1035
1036 def highlight(self, selector):
1037 """Highlight an element with multi-colors."""

Callers 15

highlightMethod · 0.45
test_presentation_4Method · 0.45
raw_browserscan.pyFile · 0.45
raw_fingerprint.pyFile · 0.45
raw_pokemon.pyFile · 0.45
raw_idealista.pyFile · 0.45
raw_albertsons.pyFile · 0.45
raw_patent.pyFile · 0.45
raw_theaters.pyFile · 0.45

Calls 6

find_elementMethod · 0.95
__get_x_scroll_offsetMethod · 0.95
__get_y_scroll_offsetMethod · 0.95
scroll_into_viewMethod · 0.45
sleepMethod · 0.45

Tested by 1

test_presentation_4Method · 0.36