You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dotnet/versioned_docs/version-stable/api/class-browser.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ In case this browser is connected to, clears all created contexts belonging to t
52
52
53
53
:::note
54
54
55
-
This is similar to forcequitting the browser. Therefore, you should call [BrowserContext.CloseAsync()](/api/class-browsercontext.mdx#browser-context-close) on any [BrowserContext]'s you explicitly created earlier with[Browser.NewContextAsync()](/api/class-browser.mdx#browser-new-context)**before** calling [Browser.CloseAsync()](/api/class-browser.mdx#browser-close).
55
+
This is similar to force-quitting the browser. To close pages gracefully and ensure you receive page close events, call [BrowserContext.CloseAsync()](/api/class-browsercontext.mdx#browser-context-close) on any [BrowserContext] instances you explicitly created earlier using[Browser.NewContextAsync()](/api/class-browser.mdx#browser-new-context)**before** calling [Browser.CloseAsync()](/api/class-browser.mdx#browser-close).
56
56
:::
57
57
58
58
The [Browser] object itself is considered to be disposed and cannot be used anymore.
A permission or an array of permissions to grant. Permissions can be one of the following values:
416
+
A list of permissions to grant.
417
+
418
+
:::danger
419
+
420
+
Supported permissions differ between browsers, and even between different versions of the same browser. Any permission may stop working after an update.
421
+
:::
422
+
423
+
Here are some permissions that may be supported by some browsers:
Copy file name to clipboardExpand all lines: dotnet/versioned_docs/version-stable/api/class-browsertype.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -172,7 +172,7 @@ var browser = await playwright.Chromium.LaunchAsync(new() {
172
172
173
173
Browser distribution channel.
174
174
175
-
Use "chromium" to [opt in to new headless mode](../browsers.mdx#opt-in-to-new-headless-mode).
175
+
Use "chromium" to [opt in to new headless mode](../browsers.mdx#chromium-new-headless-mode).
176
176
177
177
Use "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", "msedge-beta", "msedge-dev", or "msedge-canary" to use branded [Google Chrome and Microsoft Edge](../browsers.mdx#google-chrome--microsoft-edge).
Use "chromium" to [opt in to new headless mode](../browsers.mdx#opt-in-to-new-headless-mode).
292
+
Use "chromium" to [opt in to new headless mode](../browsers.mdx#chromium-new-headless-mode).
293
293
294
294
Use "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", "msedge-beta", "msedge-dev", or "msedge-canary" to use branded [Google Chrome and Microsoft Edge](../browsers.mdx#google-chrome--microsoft-edge).
For best results, install the clock before navigating the page and set it to a time slightly before the intended test time. This ensures that all timers run normally during page loading, preventing the page from getting stuck. Once the page has fully loaded, you can safely use [Clock.PauseAtAsync()](/api/class-clock.mdx#clock-pause-at) to pause the clock.
Captures the aria snapshot of the given element. Read more about [aria snapshots](../aria-snapshots.mdx) and [Expect(Locator).ToMatchAriaSnapshotAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot) for the corresponding assertion.
118
+
Captures the aria snapshot of the given element. Read more about [aria snapshots](../aria-snapshots.mdx) and [Expect(Locator).ToMatchAriaSnapshotAsync()](/api/class-locatorassertions.mdx#locator-assertions-to-match-aria-snapshot-1) for the corresponding assertion.
Returns whether the element is [editable](../actionability.mdx#editable).
1495
+
Returns whether the element is [editable](../actionability.mdx#editable). If the target element is not an `<input>`, `<textarea>`, `<select>`, `[contenteditable]` and does not have a role allowing `[aria-readonly]`, this method throws an error.
1496
1496
1497
1497
:::warning[Asserting editable state]
1498
1498
@@ -1692,16 +1692,21 @@ var banana = await page.GetByRole(AriaRole.Listitem).Nth(2);
1692
1692
1693
1693
Creates a locator matching all elements that match one or both of the two locators.
1694
1694
1695
-
Note that when both locators match something, the resulting locator will have multiple matches and violate [locator strictness](../locators.mdx#strictness)guidelines.
1695
+
Note that when both locators match something, the resulting locator will have multiple matches, potentially causing a [locator strictness](../locators.mdx#strictness)violation.
1696
1696
1697
1697
**Usage**
1698
1698
1699
1699
Consider a scenario where you'd like to click on a "New email" button, but sometimes a security settings dialog shows up instead. In this case, you can wait for either a "New email" button, or a dialog and act accordingly.
1700
1700
1701
+
:::note
1702
+
1703
+
If both "New email" button and security dialog appear on screen, the "or" locator will match both of them, possibly throwing the ["strict mode violation" error](../locators.mdx#strictness). In this case, you can use [Locator.First](/api/class-locator.mdx#locator-first) to only match one of them.
Provides state to assert for. Asserts for input to be checked by default. This option can't be used when [Indeterminate](/api/class-locatorassertions.mdx#locator-assertions-to-be-checked-option-indeterminate) is set to true.
Asserts that the element is in the indeterminate (mixed) state. Only supported for checkboxes and radio buttons. This option can't be true when [Checked](/api/class-locatorassertions.mdx#locator-assertions-to-be-checked-option-checked) is provided.
Whether to perform case-insensitive match. [IgnoreCase](/api/class-locatorassertions.mdx#locator-assertions-to-have-accessible-error-message-option-ignore-case) option takes precedence over the corresponding regular expression flag if specified.
Ensures the [Locator] points to an element with given CSS classes. This needs to be a full match or using a relaxed regular expression.
502
+
Ensures the [Locator] points to an element with given CSS classes. When a string is provided, it must fully match the element's `class` attribute. To match individual classes or perform partial matches, use a regular expression:
Note that if array is passed as an expected value, entire lists of elements can be asserted:
516
+
When an array is passed, the method asserts that the list of elements located matches the corresponding list of expected class values. Each element's class attribute is matched against the corresponding string or regular expression in the array:
482
517
483
518
```csharp
484
519
varlocator=Page.Locator("list > .component");
@@ -776,7 +811,7 @@ await Expect(locator).ToHaveValuesAsync(new Regex[] { new Regex("R"), new Regex(
Copy file name to clipboardExpand all lines: dotnet/versioned_docs/version-stable/api/class-page.mdx
+1-6Lines changed: 1 addition & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1339,11 +1339,6 @@ await Page.PauseAsync();
1339
1339
1340
1340
Returns the PDF buffer.
1341
1341
1342
-
:::note
1343
-
1344
-
Generating a pdf is currently only supported in Chromium headless.
1345
-
:::
1346
-
1347
1342
`page.pdf()` generates a pdf of the page with `print` css media. To generate a pdf with `screen` media, call [Page.EmulateMediaAsync()](/api/class-page.mdx#page-emulate-media) before calling `page.pdf()`:
0 commit comments