MCPcopy Index your code
hub / github.com/microsoft/playwright-python / get_by_role

Method get_by_role

playwright/_impl/_locator.py:835–863  ·  view source on GitHub ↗
(
        self,
        role: AriaRole,
        checked: bool = None,
        disabled: bool = None,
        expanded: bool = None,
        includeHidden: bool = None,
        level: int = None,
        name: Union[str, Pattern[str]] = None,
        pressed: bool = None,
        selected: bool = None,
        exact: bool = None,
        description: Union[str, Pattern[str]] = None,
    )

Source from the content-addressed store, hash-verified

833 return self.locator(get_by_placeholder_selector(text, exact=exact))
834
835 def get_by_role(
836 self,
837 role: AriaRole,
838 checked: bool = None,
839 disabled: bool = None,
840 expanded: bool = None,
841 includeHidden: bool = None,
842 level: int = None,
843 name: Union[str, Pattern[str]] = None,
844 pressed: bool = None,
845 selected: bool = None,
846 exact: bool = None,
847 description: Union[str, Pattern[str]] = None,
848 ) -> "Locator":
849 return self.locator(
850 get_by_role_selector(
851 role,
852 checked=checked,
853 disabled=disabled,
854 expanded=expanded,
855 includeHidden=includeHidden,
856 level=level,
857 name=name,
858 pressed=pressed,
859 selected=selected,
860 exact=exact,
861 description=description,
862 )
863 )
864
865 def get_by_test_id(self, testId: Union[str, Pattern[str]]) -> "Locator":
866 return self.locator(get_by_test_id_selector(test_id_attribute_name(), testId))

Callers

nothing calls this directly

Calls 2

locatorMethod · 0.95
get_by_role_selectorFunction · 0.85

Tested by

no test coverage detected