MCPcopy Create free account
hub / github.com/microsoft/playwright-python / get_by_role

Method get_by_role

playwright/_impl/_locator.py:271–299  ·  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

269 return self.locator(get_by_placeholder_selector(text, exact=exact))
270
271 def get_by_role(
272 self,
273 role: AriaRole,
274 checked: bool = None,
275 disabled: bool = None,
276 expanded: bool = None,
277 includeHidden: bool = None,
278 level: int = None,
279 name: Union[str, Pattern[str]] = None,
280 pressed: bool = None,
281 selected: bool = None,
282 exact: bool = None,
283 description: Union[str, Pattern[str]] = None,
284 ) -> "Locator":
285 return self.locator(
286 get_by_role_selector(
287 role,
288 checked=checked,
289 disabled=disabled,
290 expanded=expanded,
291 includeHidden=includeHidden,
292 level=level,
293 name=name,
294 pressed=pressed,
295 selected=selected,
296 exact=exact,
297 description=description,
298 )
299 )
300
301 def get_by_test_id(self, testId: Union[str, Pattern[str]]) -> "Locator":
302 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