![]() |
Qucs-S S-parameter Viewer & RF Synthesis Tools
|


Public Member Functions | |
| "FrameLocator" | first (self) |
| "FrameLocator" | last (self) |
| "Locator" | owner (self) |
| "Locator" | locator (self, typing.Union["Locator", str] selector_or_locator, *typing.Optional[typing.Union[typing.Pattern[str], str]] has_text=None, typing.Optional[typing.Union[typing.Pattern[str], str]] has_not_text=None, typing.Optional["Locator"] has=None, typing.Optional["Locator"] has_not=None) |
| "Locator" | get_by_alt_text (self, typing.Union[str, typing.Pattern[str]] text, *typing.Optional[bool] exact=None) |
| "Locator" | get_by_label (self, typing.Union[str, typing.Pattern[str]] text, *typing.Optional[bool] exact=None) |
| "Locator" | get_by_placeholder (self, typing.Union[str, typing.Pattern[str]] text, *typing.Optional[bool] exact=None) |
| "Locator" | get_by_role (self, Literal["alert", "alertdialog", "application", "article", "banner", "blockquote", "button", "caption", "cell", "checkbox", "code", "columnheader", "combobox", "complementary", "contentinfo", "definition", "deletion", "dialog", "directory", "document", "emphasis", "feed", "figure", "form", "generic", "grid", "gridcell", "group", "heading", "img", "insertion", "link", "list", "listbox", "listitem", "log", "main", "marquee", "math", "menu", "menubar", "menuitem", "menuitemcheckbox", "menuitemradio", "meter", "navigation", "none", "note", "option", "paragraph", "presentation", "progressbar", "radio", "radiogroup", "region", "row", "rowgroup", "rowheader", "scrollbar", "search", "searchbox", "separator", "slider", "spinbutton", "status", "strong", "subscript", "superscript", "switch", "tab", "table", "tablist", "tabpanel", "term", "textbox", "time", "timer", "toolbar", "tooltip", "tree", "treegrid", "treeitem",] role, *typing.Optional[bool] checked=None, typing.Optional[bool] disabled=None, typing.Optional[bool] expanded=None, typing.Optional[bool] include_hidden=None, typing.Optional[int] level=None, typing.Optional[typing.Union[typing.Pattern[str], str]] name=None, typing.Optional[bool] pressed=None, typing.Optional[bool] selected=None, typing.Optional[bool] exact=None) |
| "Locator" | get_by_test_id (self, typing.Union[str, typing.Pattern[str]] test_id) |
| "Locator" | get_by_text (self, typing.Union[str, typing.Pattern[str]] text, *typing.Optional[bool] exact=None) |
| "Locator" | get_by_title (self, typing.Union[str, typing.Pattern[str]] text, *typing.Optional[bool] exact=None) |
| "FrameLocator" | frame_locator (self, str selector) |
| "FrameLocator" | nth (self, int index) |
Public Member Functions inherited from playwright._impl._async_base.AsyncBase | |
| None | __init__ (self, Any impl_obj) |
| str | __str__ (self) |
| None | on (self, Any event, Any f) |
| None | once (self, Any event, Any f) |
| None | remove_listener (self, Any event, Any f) |
Public Member Functions inherited from playwright._impl._impl_to_api_mapping.ImplWrapper | |
| str | __repr__ (self) |
Additional Inherited Members | |
Protected Member Functions inherited from playwright._impl._async_base.AsyncBase | |
| Callable[..., None] | _wrap_handler (self, Union[Callable[..., Any], Any] handler) |
Protected Attributes inherited from playwright._impl._async_base.AsyncBase | |
| _loop | |
Protected Attributes inherited from playwright._impl._impl_to_api_mapping.ImplWrapper | |
| _impl_obj | |
| "FrameLocator" playwright.async_api._generated.FrameLocator.first | ( | self | ) |
FrameLocator.first Returns locator to the first matching frame. Returns ------- FrameLocator
| "FrameLocator" playwright.async_api._generated.FrameLocator.frame_locator | ( | self, | |
| str | selector | ||
| ) |
FrameLocator.frame_locator
When working with iframes, you can create a frame locator that will enter the iframe and allow selecting elements
in that iframe.
Parameters
----------
selector : str
A selector to use when resolving DOM element.
Returns
-------
FrameLocator
| "Locator" playwright.async_api._generated.FrameLocator.get_by_alt_text | ( | self, | |
| typing.Union[str, typing.Pattern[str]] | text, | ||
| *typing.Optional[bool] | exact = None |
||
| ) |
FrameLocator.get_by_alt_text
Allows locating elements by their alt text.
**Usage**
For example, this method will find the image by alt text \"Playwright logo\":
```html
<img alt='Playwright logo'>
```
```py
await page.get_by_alt_text(\"Playwright logo\").click()
```
Parameters
----------
text : Union[Pattern[str], str]
Text to locate the element for.
exact : Union[bool, None]
Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a
regular expression. Note that exact match still trims whitespace.
Returns
-------
Locator
| "Locator" playwright.async_api._generated.FrameLocator.get_by_label | ( | self, | |
| typing.Union[str, typing.Pattern[str]] | text, | ||
| *typing.Optional[bool] | exact = None |
||
| ) |
FrameLocator.get_by_label
Allows locating input elements by the text of the associated `<label>` or `aria-labelledby` element, or by the
`aria-label` attribute.
**Usage**
For example, this method will find inputs by label \"Username\" and \"Password\" in the following DOM:
```html
<input aria-label=\"Username\">
<label for=\"password-input\">Password:</label>
<input id=\"password-input\">
```
```py
await page.get_by_label(\"Username\").fill(\"john\")
await page.get_by_label(\"Password\").fill(\"secret\")
```
Parameters
----------
text : Union[Pattern[str], str]
Text to locate the element for.
exact : Union[bool, None]
Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a
regular expression. Note that exact match still trims whitespace.
Returns
-------
Locator
| "Locator" playwright.async_api._generated.FrameLocator.get_by_placeholder | ( | self, | |
| typing.Union[str, typing.Pattern[str]] | text, | ||
| *typing.Optional[bool] | exact = None |
||
| ) |
FrameLocator.get_by_placeholder
Allows locating input elements by the placeholder text.
**Usage**
For example, consider the following DOM structure.
```html
<input type=\"email\" placeholder=\"name@example.com\" />
```
You can fill the input after locating it by the placeholder text:
```py
await page.get_by_placeholder(\"name@example.com\").fill(\"playwright@microsoft.com\")
```
Parameters
----------
text : Union[Pattern[str], str]
Text to locate the element for.
exact : Union[bool, None]
Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a
regular expression. Note that exact match still trims whitespace.
Returns
-------
Locator
| "Locator" playwright.async_api._generated.FrameLocator.get_by_role | ( | self, | |
| Literal[ "alert", "alertdialog", "application", "article", "banner", "blockquote", "button", "caption", "cell", "checkbox", "code", "columnheader", "combobox", "complementary", "contentinfo", "definition", "deletion", "dialog", "directory", "document", "emphasis", "feed", "figure", "form", "generic", "grid", "gridcell", "group", "heading", "img", "insertion", "link", "list", "listbox", "listitem", "log", "main", "marquee", "math", "menu", "menubar", "menuitem", "menuitemcheckbox", "menuitemradio", "meter", "navigation", "none", "note", "option", "paragraph", "presentation", "progressbar", "radio", "radiogroup", "region", "row", "rowgroup", "rowheader", "scrollbar", "search", "searchbox", "separator", "slider", "spinbutton", "status", "strong", "subscript", "superscript", "switch", "tab", "table", "tablist", "tabpanel", "term", "textbox", "time", "timer", "toolbar", "tooltip", "tree", "treegrid", "treeitem", ] | role, | ||
| *typing.Optional[bool] | checked = None, |
||
| typing.Optional[bool] | disabled = None, |
||
| typing.Optional[bool] | expanded = None, |
||
| typing.Optional[bool] | include_hidden = None, |
||
| typing.Optional[int] | level = None, |
||
| typing.Optional[typing.Union[typing.Pattern[str], str]] | name = None, |
||
| typing.Optional[bool] | pressed = None, |
||
| typing.Optional[bool] | selected = None, |
||
| typing.Optional[bool] | exact = None |
||
| ) |
FrameLocator.get_by_role
Allows locating elements by their [ARIA role](https://www.w3.org/TR/wai-aria-1.2/#roles),
[ARIA attributes](https://www.w3.org/TR/wai-aria-1.2/#aria-attributes) and
[accessible name](https://w3c.github.io/accname/#dfn-accessible-name).
**Usage**
Consider the following DOM structure.
```html
<h3>Sign up</h3>
<label>
<input type=\"checkbox\" /> Subscribe
</label>
<br/>
<button>Submit</button>
```
You can locate each element by it's implicit role:
```py
await expect(page.get_by_role(\"heading\", name=\"Sign up\")).to_be_visible()
await page.get_by_role(\"checkbox\", name=\"Subscribe\").check()
await page.get_by_role(\"button\", name=re.compile(\"submit\", re.IGNORECASE)).click()
```
**Details**
Role selector **does not replace** accessibility audits and conformance tests, but rather gives early feedback
about the ARIA guidelines.
Many html elements have an implicitly [defined role](https://w3c.github.io/html-aam/#html-element-role-mappings)
that is recognized by the role selector. You can find all the
[supported roles here](https://www.w3.org/TR/wai-aria-1.2/#role_definitions). ARIA guidelines **do not recommend**
duplicating implicit roles and attributes by setting `role` and/or `aria-*` attributes to default values.
Parameters
----------
role : Union["alert", "alertdialog", "application", "article", "banner", "blockquote", "button", "caption", "cell", "checkbox", "code", "columnheader", "combobox", "complementary", "contentinfo", "definition", "deletion", "dialog", "directory", "document", "emphasis", "feed", "figure", "form", "generic", "grid", "gridcell", "group", "heading", "img", "insertion", "link", "list", "listbox", "listitem", "log", "main", "marquee", "math", "menu", "menubar", "menuitem", "menuitemcheckbox", "menuitemradio", "meter", "navigation", "none", "note", "option", "paragraph", "presentation", "progressbar", "radio", "radiogroup", "region", "row", "rowgroup", "rowheader", "scrollbar", "search", "searchbox", "separator", "slider", "spinbutton", "status", "strong", "subscript", "superscript", "switch", "tab", "table", "tablist", "tabpanel", "term", "textbox", "time", "timer", "toolbar", "tooltip", "tree", "treegrid", "treeitem"]
Required aria role.
checked : Union[bool, None]
An attribute that is usually set by `aria-checked` or native `<input type=checkbox>` controls.
Learn more about [`aria-checked`](https://www.w3.org/TR/wai-aria-1.2/#aria-checked).
disabled : Union[bool, None]
An attribute that is usually set by `aria-disabled` or `disabled`.
**NOTE** Unlike most other attributes, `disabled` is inherited through the DOM hierarchy. Learn more about
[`aria-disabled`](https://www.w3.org/TR/wai-aria-1.2/#aria-disabled).
expanded : Union[bool, None]
An attribute that is usually set by `aria-expanded`.
Learn more about [`aria-expanded`](https://www.w3.org/TR/wai-aria-1.2/#aria-expanded).
include_hidden : Union[bool, None]
Option that controls whether hidden elements are matched. By default, only non-hidden elements, as
[defined by ARIA](https://www.w3.org/TR/wai-aria-1.2/#tree_exclusion), are matched by role selector.
Learn more about [`aria-hidden`](https://www.w3.org/TR/wai-aria-1.2/#aria-hidden).
level : Union[int, None]
A number attribute that is usually present for roles `heading`, `listitem`, `row`, `treeitem`, with default values
for `<h1>-<h6>` elements.
Learn more about [`aria-level`](https://www.w3.org/TR/wai-aria-1.2/#aria-level).
name : Union[Pattern[str], str, None]
Option to match the [accessible name](https://w3c.github.io/accname/#dfn-accessible-name). By default, matching is
case-insensitive and searches for a substring, use `exact` to control this behavior.
Learn more about [accessible name](https://w3c.github.io/accname/#dfn-accessible-name).
pressed : Union[bool, None]
An attribute that is usually set by `aria-pressed`.
Learn more about [`aria-pressed`](https://www.w3.org/TR/wai-aria-1.2/#aria-pressed).
selected : Union[bool, None]
An attribute that is usually set by `aria-selected`.
Learn more about [`aria-selected`](https://www.w3.org/TR/wai-aria-1.2/#aria-selected).
exact : Union[bool, None]
Whether `name` is matched exactly: case-sensitive and whole-string. Defaults to false. Ignored when `name` is a
regular expression. Note that exact match still trims whitespace.
Returns
-------
Locator
| "Locator" playwright.async_api._generated.FrameLocator.get_by_test_id | ( | self, | |
| typing.Union[str, typing.Pattern[str]] | test_id | ||
| ) |
FrameLocator.get_by_test_id
Locate element by the test id.
**Usage**
Consider the following DOM structure.
```html
<button data-testid=\"directions\">Itinéraire</button>
```
You can locate the element by it's test id:
```py
await page.get_by_test_id(\"directions\").click()
```
**Details**
By default, the `data-testid` attribute is used as a test id. Use `selectors.set_test_id_attribute()` to
configure a different test id attribute if necessary.
Parameters
----------
test_id : Union[Pattern[str], str]
Id to locate the element by.
Returns
-------
Locator
| "Locator" playwright.async_api._generated.FrameLocator.get_by_text | ( | self, | |
| typing.Union[str, typing.Pattern[str]] | text, | ||
| *typing.Optional[bool] | exact = None |
||
| ) |
FrameLocator.get_by_text
Allows locating elements that contain given text.
See also `locator.filter()` that allows to match by another criteria, like an accessible role, and then
filter by the text content.
**Usage**
Consider the following DOM structure:
```html
<div>Hello <span>world</span></div>
<div>Hello</div>
```
You can locate by text substring, exact string, or a regular expression:
```py
# Matches <span>
page.get_by_text(\"world\")
# Matches first <div>
page.get_by_text(\"Hello world\")
# Matches second <div>
page.get_by_text(\"Hello\", exact=True)
# Matches both <div>s
page.get_by_text(re.compile(\"Hello\"))
# Matches second <div>
page.get_by_text(re.compile(\"^hello$\", re.IGNORECASE))
```
**Details**
Matching by text always normalizes whitespace, even with exact match. For example, it turns multiple spaces into
one, turns line breaks into spaces and ignores leading and trailing whitespace.
Input elements of the type `button` and `submit` are matched by their `value` instead of the text content. For
example, locating by text `\"Log in\"` matches `<input type=button value=\"Log in\">`.
Parameters
----------
text : Union[Pattern[str], str]
Text to locate the element for.
exact : Union[bool, None]
Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a
regular expression. Note that exact match still trims whitespace.
Returns
-------
Locator
| "Locator" playwright.async_api._generated.FrameLocator.get_by_title | ( | self, | |
| typing.Union[str, typing.Pattern[str]] | text, | ||
| *typing.Optional[bool] | exact = None |
||
| ) |
FrameLocator.get_by_title
Allows locating elements by their title attribute.
**Usage**
Consider the following DOM structure.
```html
<span title='Issues count'>25 issues</span>
```
You can check the issues count after locating it by the title text:
```py
await expect(page.get_by_title(\"Issues count\")).to_have_text(\"25 issues\")
```
Parameters
----------
text : Union[Pattern[str], str]
Text to locate the element for.
exact : Union[bool, None]
Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a
regular expression. Note that exact match still trims whitespace.
Returns
-------
Locator
| "FrameLocator" playwright.async_api._generated.FrameLocator.last | ( | self | ) |
FrameLocator.last Returns locator to the last matching frame. Returns ------- FrameLocator
| "Locator" playwright.async_api._generated.FrameLocator.locator | ( | self, | |
| typing.Union["Locator", str] | selector_or_locator, | ||
| *typing.Optional[typing.Union[typing.Pattern[str], str]] | has_text = None, |
||
| typing.Optional[typing.Union[typing.Pattern[str], str]] | has_not_text = None, |
||
| typing.Optional["Locator"] | has = None, |
||
| typing.Optional["Locator"] | has_not = None |
||
| ) |
FrameLocator.locator
The method finds an element matching the specified selector in the locator's subtree. It also accepts filter
options, similar to `locator.filter()` method.
[Learn more about locators](https://playwright.dev/python/docs/locators).
Parameters
----------
selector_or_locator : Union[Locator, str]
A selector or locator to use when resolving DOM element.
has_text : Union[Pattern[str], str, None]
Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When
passed a [string], matching is case-insensitive and searches for a substring. For example, `"Playwright"` matches
`<article><div>Playwright</div></article>`.
has_not_text : Union[Pattern[str], str, None]
Matches elements that do not contain specified text somewhere inside, possibly in a child or a descendant element.
When passed a [string], matching is case-insensitive and searches for a substring.
has : Union[Locator, None]
Narrows down the results of the method to those which contain elements matching this relative locator. For example,
`article` that has `text=Playwright` matches `<article><div>Playwright</div></article>`.
Inner locator **must be relative** to the outer locator and is queried starting with the outer locator match, not
the document root. For example, you can find `content` that has `div` in
`<article><content><div>Playwright</div></content></article>`. However, looking for `content` that has `article
div` will fail, because the inner locator must be relative and should not use any elements outside the `content`.
Note that outer and inner locators must belong to the same frame. Inner locator must not contain `FrameLocator`s.
has_not : Union[Locator, None]
Matches elements that do not contain an element that matches an inner locator. Inner locator is queried against the
outer one. For example, `article` that does not have `div` matches `<article><span>Playwright</span></article>`.
Note that outer and inner locators must belong to the same frame. Inner locator must not contain `FrameLocator`s.
Returns
-------
Locator
| "FrameLocator" playwright.async_api._generated.FrameLocator.nth | ( | self, | |
| int | index | ||
| ) |
FrameLocator.nth Returns locator to the n-th matching frame. It's zero based, `nth(0)` selects the first frame. Parameters ---------- index : int Returns ------- FrameLocator
| "Locator" playwright.async_api._generated.FrameLocator.owner | ( | self | ) |
FrameLocator.owner Returns a `Locator` object pointing to the same `iframe` as this frame locator. Useful when you have a `FrameLocator` object obtained somewhere, and later on would like to interact with the `iframe` element. For a reverse operation, use `locator.content_frame()`. **Usage** ```py frame_locator = page.locator(\"iframe[name=\\\"embedded\\\"]\").content_frame # ... locator = frame_locator.owner await expect(locator).to_be_visible() ``` Returns ------- Locator