| 6757 | self.__extra_actions.append(action) |
| 6758 | |
| 6759 | def highlight_elements( |
| 6760 | self, |
| 6761 | selector, |
| 6762 | by="css selector", |
| 6763 | loops=None, |
| 6764 | scroll=True, |
| 6765 | limit=0, |
| 6766 | ): |
| 6767 | if not limit: |
| 6768 | limit = 0 # 0 means no limit |
| 6769 | limit = int(limit) |
| 6770 | count = 0 |
| 6771 | elements = self.find_elements(selector, by=by) |
| 6772 | for element in elements: |
| 6773 | with suppress(Exception): |
| 6774 | if element.is_displayed(): |
| 6775 | self.__highlight_element( |
| 6776 | element, loops=loops, scroll=scroll |
| 6777 | ) |
| 6778 | count += 1 |
| 6779 | if limit > 0 and count >= limit: |
| 6780 | break |
| 6781 | |
| 6782 | def press_up_arrow(self, selector="body", times=1, by="css selector"): |
| 6783 | """Simulates pressing the UP Arrow on the keyboard. |