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
)
| 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.""" |