Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions dotnet/versioned_docs/version-stable/actionability.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "Auto-waiting"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';

## Introduction

Expand Down
1 change: 1 addition & 0 deletions dotnet/versioned_docs/version-stable/api-testing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "API testing"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';

## Introduction

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "Accessibility"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


:::warning[Deprecated]
Expand Down
3 changes: 3 additions & 0 deletions dotnet/versioned_docs/version-stable/api/class-apirequest.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "APIRequest"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


Exposes API that can be used for the Web API testing. This class is used for creating [APIRequestContext] instance which in turn can be used for sending web requests. An instance of this class can be obtained via [Playwright.APIRequest](/api/class-playwright.mdx#playwright-request). For more information see [APIRequestContext].
Expand Down Expand Up @@ -66,6 +67,8 @@ await ApiRequest.NewContextAsync(options);

An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for.

Client certificate authentication is only active when at least one client certificate is provided. If you want to reject all client certificates sent by the server, you need to provide a client certificate with an `origin` that does not match any of the domains you plan to visit.

:::note

When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "APIRequestContext"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


This API is used for the Web API testing. You can use it to trigger API endpoints, configure micro-services, prepare environment or the service to your e2e test.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "APIResponse"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


[APIResponse] class represents responses returned by [ApiRequestContext.GetAsync()](/api/class-apirequestcontext.mdx#api-request-context-get) and similar methods.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "APIResponseAssertions"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


The [APIResponseAssertions] class provides assertion methods that can be used to make assertions about the [APIResponse] in the tests.
Expand Down
5 changes: 5 additions & 0 deletions dotnet/versioned_docs/version-stable/api/class-browser.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "Browser"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


A Browser is created via [BrowserType.LaunchAsync()](/api/class-browsertype.mdx#browser-type-launch). An example of using a [Browser] to create a [Page]:
Expand Down Expand Up @@ -207,6 +208,8 @@ await browser.CloseAsync();

An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for.

Client certificate authentication is only active when at least one client certificate is provided. If you want to reject all client certificates sent by the server, you need to provide a client certificate with an `origin` that does not match any of the domains you plan to visit.

:::note

When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`.
Expand Down Expand Up @@ -425,6 +428,8 @@ await Browser.NewPageAsync(options);

An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for.

Client certificate authentication is only active when at least one client certificate is provided. If you want to reject all client certificates sent by the server, you need to provide a client certificate with an `origin` that does not match any of the domains you plan to visit.

:::note

When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "BrowserContext"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


BrowserContexts provide a way to operate multiple independent browser sessions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "BrowserType"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


BrowserType provides methods to launch a specific browser instance or connect to an existing one. The following is a typical example of using Playwright to drive automation:
Expand Down Expand Up @@ -279,6 +280,12 @@ await BrowserType.LaunchPersistentContextAsync(userDataDir, options);
More details for [Chromium](https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md#introduction) and [Firefox](https://wiki.mozilla.org/Firefox/CommandLineOptions#User_profile). Chromium's user data directory is the **parent** directory of the "Profile Path" seen at `chrome://version`.

Note that browsers do not allow launching multiple instances with the same User Data Directory.

:::warning

Chromium/Chrome: Due to recent Chrome policy changes, automating the default Chrome user profile is not supported. Pointing `userDataDir` to Chrome's main "User Data" directory (the profile used for your regular browsing) may result in pages not loading or the browser exiting. Create and use a separate directory (for example, an empty folder) as your automation profile instead. See https://developer.chrome.com/blog/remote-debugging-port for details.
:::

- `options` `BrowserTypeLaunchPersistentContextOptions?` *(optional)*
- `AcceptDownloads` [bool]? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-type-launch-persistent-context-option-accept-downloads"/><a href="#browser-type-launch-persistent-context-option-accept-downloads" class="list-anchor">#</a>

Expand Down Expand Up @@ -342,6 +349,8 @@ await BrowserType.LaunchPersistentContextAsync(userDataDir, options);

An array of client certificates to be used. Each certificate object must have either both `certPath` and `keyPath`, a single `pfxPath`, or their corresponding direct value equivalents (`cert` and `key`, or `pfx`). Optionally, `passphrase` property should be provided if the certificate is encrypted. The `origin` property should be provided with an exact match to the request origin that the certificate is valid for.

Client certificate authentication is only active when at least one client certificate is provided. If you want to reject all client certificates sent by the server, you need to provide a client certificate with an `origin` that does not match any of the domains you plan to visit.

:::note

When using WebKit on macOS, accessing `localhost` will not pick up client certificates. You can make it work by replacing `localhost` with `local.playwright`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "CDPSession"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


The `CDPSession` instances are used to talk raw Chrome Devtools Protocol:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "CDPSessionEvent"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


[CDPSessionEvent] objects are returned by page via the [CdpSession.Event()](/api/class-cdpsession.mdx#cdp-session-event) method.
Expand Down
1 change: 1 addition & 0 deletions dotnet/versioned_docs/version-stable/api/class-clock.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "Clock"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


Accurately simulating time-dependent behavior is essential for verifying the correctness of applications. Learn more about [clock emulation](../clock.mdx).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "ConsoleMessage"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


[ConsoleMessage] objects are dispatched by page via the [Page.Console](/api/class-page.mdx#page-event-console) event. For each console message logged in the page there will be corresponding event in the Playwright context.
Expand Down
1 change: 1 addition & 0 deletions dotnet/versioned_docs/version-stable/api/class-dialog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "Dialog"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


[Dialog] objects are dispatched by page via the [Page.Dialog](/api/class-page.mdx#page-event-dialog) event.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "Download"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


[Download] objects are dispatched by page via the [Page.Download](/api/class-page.mdx#page-event-download) event.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "ElementHandle"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';

* extends: [JSHandle]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "FileChooser"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


[FileChooser] objects are dispatched by the page in the [Page.FileChooser](/api/class-page.mdx#page-event-file-chooser) event.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "FormData"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


The [FormData] is used create form data that is sent via [APIRequestContext].
Expand Down
1 change: 1 addition & 0 deletions dotnet/versioned_docs/version-stable/api/class-frame.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "Frame"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


At every point of time, page exposes its current frame tree via the [Page.MainFrame](/api/class-page.mdx#page-main-frame) and [Frame.ChildFrames](/api/class-frame.mdx#frame-child-frames) methods.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "FrameLocator"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


FrameLocator represents a view to the `iframe` on the page. It captures the logic sufficient to retrieve the `iframe` and locate elements in that iframe. FrameLocator can be created with either [Locator.ContentFrame](/api/class-locator.mdx#locator-content-frame), [Page.FrameLocator()](/api/class-page.mdx#page-frame-locator) or [Locator.FrameLocator()](/api/class-locator.mdx#locator-frame-locator) method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "JSHandle"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


JSHandle represents an in-page JavaScript object. JSHandles can be created with the [Page.EvaluateHandleAsync()](/api/class-page.mdx#page-evaluate-handle) method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "Keyboard"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


Keyboard provides an api for managing a virtual keyboard. The high level api is [Keyboard.TypeAsync()](/api/class-keyboard.mdx#keyboard-type), which takes raw characters and generates proper `keydown`, `keypress`/`input`, and `keyup` events on your page.
Expand Down
1 change: 1 addition & 0 deletions dotnet/versioned_docs/version-stable/api/class-locator.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "Locator"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


Locators are the central piece of Playwright's auto-waiting and retry-ability. In a nutshell, locators represent a way to find element(s) on the page at any moment. A locator can be created with the [Page.Locator()](/api/class-page.mdx#page-locator) method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "LocatorAssertions"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


The [LocatorAssertions] class provides assertion methods that can be used to make assertions about the [Locator] state in the tests.
Expand Down
1 change: 1 addition & 0 deletions dotnet/versioned_docs/version-stable/api/class-mouse.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "Mouse"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport.
Expand Down
3 changes: 2 additions & 1 deletion dotnet/versioned_docs/version-stable/api/class-page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "Page"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


Page provides methods to interact with a single tab in a [Browser], or an [extension background page](https://developer.chrome.com/extensions/background_pages) in Chromium. One [Browser] instance might have multiple [Page] instances.
Expand Down Expand Up @@ -1314,7 +1315,7 @@ await Page.OpenerAsync();

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.9</font><x-search>page.PauseAsync</x-search>

Pauses script execution. Playwright will stop executing the script and wait for the user to either press 'Resume' button in the page overlay or to call `playwright.resume()` in the DevTools console.
Pauses script execution. Playwright will stop executing the script and wait for the user to either press the 'Resume' button in the page overlay or to call `playwright.resume()` in the DevTools console.

User can inspect selectors or perform manual steps while paused. Resume will continue running the original script from the place it was paused.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "PageAssertions"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


The [PageAssertions] class provides assertion methods that can be used to make assertions about the [Page] state in the tests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "Playwright"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


Playwright module provides a method to launch a browser instance. The following is a typical example of using Playwright to drive automation:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "PlaywrightAssertions"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


Playwright gives you Web-First Assertions with convenience methods for creating assertions that will wait and retry until the expected condition is met.
Expand Down
1 change: 1 addition & 0 deletions dotnet/versioned_docs/version-stable/api/class-request.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "Request"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


Whenever the page sends a request for a network resource the following sequence of events are emitted by [Page]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "Response"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


[Response] class represents responses which are received by page.
Expand Down
1 change: 1 addition & 0 deletions dotnet/versioned_docs/version-stable/api/class-route.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "Route"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


Whenever a network route is set up with [Page.RouteAsync()](/api/class-page.mdx#page-route) or [BrowserContext.RouteAsync()](/api/class-browsercontext.mdx#browser-context-route), the `Route` object allows to handle the route.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "Selectors"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


Selectors can be used to install custom selector engines. See [extensibility](../extensibility.mdx) for more information.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "TimeoutError"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';

* extends: [Error]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "Touchscreen"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


The Touchscreen class operates in main-frame CSS pixels relative to the top-left corner of the viewport. Methods on the touchscreen can only be used in browser contexts that have been initialized with `hasTouch` set to true.
Expand Down
1 change: 1 addition & 0 deletions dotnet/versioned_docs/version-stable/api/class-tracing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "Tracing"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


API for collecting and saving Playwright traces. Playwright traces can be opened in [Trace Viewer](../trace-viewer.mdx) after Playwright script runs.
Expand Down
1 change: 1 addition & 0 deletions dotnet/versioned_docs/version-stable/api/class-video.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "Video"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


When browser context is created with the `recordVideo` option, each page has a video object associated with it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: "WebError"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import HTMLCard from '@site/src/components/HTMLCard';
import ProgressiveImage from '@theme/ProgressiveImage';


[WebError] class represents an unhandled exception thrown in the page. It is dispatched via the [BrowserContext.WebError](/api/class-browsercontext.mdx#browser-context-event-web-error) event.
Expand Down
Loading
Loading