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

Method highlight_elements

seleniumbase/fixtures/base_case.py:6759–6780  ·  view source on GitHub ↗
(
        self,
        selector,
        by="css selector",
        loops=None,
        scroll=True,
        limit=0,
    )

Source from the content-addressed store, hash-verified

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.

Callers 1

test_highlight_inputsMethod · 0.80

Calls 2

find_elementsMethod · 0.95
__highlight_elementMethod · 0.95

Tested by 1

test_highlight_inputsMethod · 0.64