.playwright/package/api.json

[{"name":"Accessibility","spec":[{"type":"text","text":"The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is used by↵assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or↵[switches](https://en.wikipedia.org/wiki/Switch_access)."},{"type":"text","text":"Accessibility is a very platform-specific thing. On different platforms, there are different screen readers that might↵have wildly different output."},{"type":"text","text":"Rendering engines of Chromium, Firefox and WebKit have a concept of \"accessibility tree\", which is then translated into different↵platform-specific APIs. Accessibility namespace gives access to this Accessibility Tree."},{"type":"text","text":"Most of the accessibility tree gets filtered out when converting from internal browser AX Tree to Platform-specific AX-Tree or by↵assistive technologies themselves. By default, Playwright tries to approximate this filtering, exposing only the↵\"interesting\" nodes of the tree."}],"langs":{"only":["csharp","js","python"],"aliases":{},"types":{},"overrides":{}},"comment":"The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is\nused by assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or\n[switches](https://en.wikipedia.org/wiki/Switch_access).\n\nAccessibility is a very platform-specific thing. On different platforms, there are different screen readers that\nmight have wildly different output.\n\nRendering engines of Chromium, Firefox and WebKit have a concept of \"accessibility tree\", which is then translated\ninto different platform-specific APIs. Accessibility namespace gives access to this Accessibility Tree.\n\nMost of the accessibility tree gets filtered out when converting from internal browser AX Tree to Platform-specific\nAX-Tree or by assistive technologies themselves. By default, Playwright tries to approximate this filtering,\nexposing only the \"interesting\" nodes of the tree.","since":"v1.8","members":[{"kind":"method","langs":{"types":{"java":{"name":"","union":[{"name":"null"},{"name":"string"}],"expression":"[null]|[string]"},"csharp":{"name":"","union":[{"name":"null"},{"name":"JsonElement"}],"expression":"[null]|[JsonElement]"}}},"since":"v1.8","deprecated":"This method is deprecated. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for integration with Axe.","name":"snapshot","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"role","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"The [role](https://www.w3.org/TR/wai-aria/#usage_intro)."}],"required":true,"comment":"The [role](https://www.w3.org/TR/wai-aria/#usage_intro).","async":false,"alias":"role","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A human readable name for the node."}],"required":true,"comment":"A human readable name for the node.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"value","type":{"name":"","union":[{"name":"string"},{"name":"float"}],"expression":"[string]|[float]"},"spec":[{"type":"text","text":"The current value of the node, if applicable."}],"required":true,"comment":"The current value of the node, if applicable.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"description","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"An additional human readable description of the node, if applicable."}],"required":true,"comment":"An additional human readable description of the node, if applicable.","async":false,"alias":"description","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"keyshortcuts","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Keyboard shortcuts associated with this node, if applicable."}],"required":true,"comment":"Keyboard shortcuts associated with this node, if applicable.","async":false,"alias":"keyshortcuts","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"roledescription","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A human readable alternative to the role, if applicable."}],"required":true,"comment":"A human readable alternative to the role, if applicable.","async":false,"alias":"roledescription","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"valuetext","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A description of the current value, if applicable."}],"required":true,"comment":"A description of the current value, if applicable.","async":false,"alias":"valuetext","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"disabled","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether the node is disabled, if applicable."}],"required":true,"comment":"Whether the node is disabled, if applicable.","async":false,"alias":"disabled","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"expanded","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether the node is expanded or collapsed, if applicable."}],"required":true,"comment":"Whether the node is expanded or collapsed, if applicable.","async":false,"alias":"expanded","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"focused","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether the node is focused, if applicable."}],"required":true,"comment":"Whether the node is focused, if applicable.","async":false,"alias":"focused","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"modal","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether the node is [modal](https://en.wikipedia.org/wiki/Modal_window), if applicable."}],"required":true,"comment":"Whether the node is [modal](https://en.wikipedia.org/wiki/Modal_window), if applicable.","async":false,"alias":"modal","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"multiline","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether the node text input supports multiline, if applicable."}],"required":true,"comment":"Whether the node text input supports multiline, if applicable.","async":false,"alias":"multiline","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"multiselectable","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether more than one child can be selected, if applicable."}],"required":true,"comment":"Whether more than one child can be selected, if applicable.","async":false,"alias":"multiselectable","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"readonly","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether the node is read only, if applicable."}],"required":true,"comment":"Whether the node is read only, if applicable.","async":false,"alias":"readonly","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"required","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether the node is required, if applicable."}],"required":true,"comment":"Whether the node is required, if applicable.","async":false,"alias":"required","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"selected","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether the node is selected in its parent node, if applicable."}],"required":true,"comment":"Whether the node is selected in its parent node, if applicable.","async":false,"alias":"selected","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"checked","type":{"name":"","union":[{"name":"boolean"},{"name":"\"mixed\""}],"expression":"[boolean]|\"mixed\""},"spec":[{"type":"text","text":"Whether the checkbox is checked, or \"mixed\", if applicable."}],"required":true,"comment":"Whether the checkbox is checked, or \"mixed\", if applicable.","async":false,"alias":"checked","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"pressed","type":{"name":"","union":[{"name":"boolean"},{"name":"\"mixed\""}],"expression":"[boolean]|\"mixed\""},"spec":[{"type":"text","text":"Whether the toggle button is checked, or \"mixed\", if applicable."}],"required":true,"comment":"Whether the toggle button is checked, or \"mixed\", if applicable.","async":false,"alias":"pressed","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"level","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"The level of a heading, if applicable."}],"required":true,"comment":"The level of a heading, if applicable.","async":false,"alias":"level","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"valuemin","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"The minimum value in a node, if applicable."}],"required":true,"comment":"The minimum value in a node, if applicable.","async":false,"alias":"valuemin","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"valuemax","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"The maximum value in a node, if applicable."}],"required":true,"comment":"The maximum value in a node, if applicable.","async":false,"alias":"valuemax","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"autocomplete","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"What kind of autocomplete is supported by a control, if applicable."}],"required":true,"comment":"What kind of autocomplete is supported by a control, if applicable.","async":false,"alias":"autocomplete","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"haspopup","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"What kind of popup is currently being shown for a node, if applicable."}],"required":true,"comment":"What kind of popup is currently being shown for a node, if applicable.","async":false,"alias":"haspopup","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"invalid","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Whether and in what way this node's value is invalid, if applicable."}],"required":true,"comment":"Whether and in what way this node's value is invalid, if applicable.","async":false,"alias":"invalid","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"orientation","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Whether the node is oriented horizontally or vertically, if applicable."}],"required":true,"comment":"Whether the node is oriented horizontally or vertically, if applicable.","async":false,"alias":"orientation","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"children","type":{"name":"Array","templates":[{"name":"Object"}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":"Child nodes, if any, if applicable."}],"required":true,"comment":"Child nodes, if any, if applicable.","async":false,"alias":"children","overloadIndex":0,"paramOrOption":null}]}],"expression":"[null]|[Object]"},"spec":[{"type":"text","text":"Captures the current state of the accessibility tree. The returned object represents the root accessible node of the↵page."},{"type":"note","noteType":"note","text":"The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen readers. Playwright↵will discard them as well for an easier to process tree, unless `interestingOnly` is set to `false`."},{"type":"text","text":"**Usage**"},{"type":"text","text":"An example of dumping the entire accessibility tree:"},{"type":"code","lines":["const snapshot = await page.accessibility.snapshot();","console.log(snapshot);"],"codeLang":"js"},{"type":"code","lines":["String snapshot = page.accessibility().snapshot();","System.out.println(snapshot);"],"codeLang":"java"},{"type":"code","lines":["snapshot = await page.accessibility.snapshot()","print(snapshot)"],"codeLang":"python async"},{"type":"code","lines":["snapshot = page.accessibility.snapshot()","print(snapshot)"],"codeLang":"python sync"},{"type":"code","lines":["var accessibilitySnapshot = await page.Accessibility.SnapshotAsync();","Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(accessibilitySnapshot));"],"codeLang":"csharp"},{"type":"text","text":"An example of logging the focused node's name:"},{"type":"code","lines":["const snapshot = await page.accessibility.snapshot();","const node = findFocusedNode(snapshot);","console.log(node && node.name);","","function findFocusedNode(node) {"," if (node.focused)"," return node;"," for (const child of node.children || []) {"," const foundNode = findFocusedNode(child);"," if (foundNode)"," return foundNode;"," }"," return null;","}"],"codeLang":"js"},{"type":"code","lines":["var accessibilitySnapshot = await page.Accessibility.SnapshotAsync();","Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(accessibilitySnapshot));"],"codeLang":"csharp"},{"type":"code","lines":["// FIXME","String snapshot = page.accessibility().snapshot();"],"codeLang":"java"},{"type":"code","lines":["def find_focused_node(node):"," if node.get(\"focused\"):"," return node"," for child in (node.get(\"children\") or []):"," found_node = find_focused_node(child)"," if found_node:"," return found_node"," return None","","snapshot = await page.accessibility.snapshot()","node = find_focused_node(snapshot)","if node:"," print(node[\"name\"])"],"codeLang":"python async"},{"type":"code","lines":["def find_focused_node(node):"," if node.get(\"focused\"):"," return node"," for child in (node.get(\"children\") or []):"," found_node = find_focused_node(child)"," if found_node:"," return found_node"," return None","","snapshot = page.accessibility.snapshot()","node = find_focused_node(snapshot)","if node:"," print(node[\"name\"])"],"codeLang":"python sync"}],"required":true,"comment":"Captures the current state of the accessibility tree. The returned object represents the root accessible node of\nthe page.\n\n**NOTE** The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen\nreaders. Playwright will discard them as well for an easier to process tree, unless `interestingOnly` is set to\n`false`.\n\n**Usage**\n\nAn example of dumping the entire accessibility tree:\n\n```js\nconst snapshot = await page.accessibility.snapshot();\nconsole.log(snapshot);\n```\n\n```java\nString snapshot = page.accessibility().snapshot();\nSystem.out.println(snapshot);\n```\n\n```py\nsnapshot = await page.accessibility.snapshot()\nprint(snapshot)\n```\n\n```py\nsnapshot = page.accessibility.snapshot()\nprint(snapshot)\n```\n\n```csharp\nvar accessibilitySnapshot = await page.Accessibility.SnapshotAsync();\nConsole.WriteLine(System.Text.Json.JsonSerializer.Serialize(accessibilitySnapshot));\n```\n\nAn example of logging the focused node's name:\n\n```js\nconst snapshot = await page.accessibility.snapshot();\nconst node = findFocusedNode(snapshot);\nconsole.log(node && node.name);\n\nfunction findFocusedNode(node) {\n if (node.focused)\n return node;\n for (const child of node.children || []) {\n const foundNode = findFocusedNode(child);\n if (foundNode)\n return foundNode;\n }\n return null;\n}\n```\n\n```csharp\nvar accessibilitySnapshot = await page.Accessibility.SnapshotAsync();\nConsole.WriteLine(System.Text.Json.JsonSerializer.Serialize(accessibilitySnapshot));\n```\n\n```java\n// FIXME\nString snapshot = page.accessibility().snapshot();\n```\n\n```py\ndef find_focused_node(node):\n if node.get(\"focused\"):\n return node\n for child in (node.get(\"children\") or []):\n found_node = find_focused_node(child)\n if found_node:\n return found_node\n return None\n\nsnapshot = await page.accessibility.snapshot()\nnode = find_focused_node(snapshot)\nif node:\n print(node[\"name\"])\n```\n\n```py\ndef find_focused_node(node):\n if node.get(\"focused\"):\n return node\n for child in (node.get(\"children\") or []):\n found_node = find_focused_node(child)\n if found_node:\n return found_node\n return None\n\nsnapshot = page.accessibility.snapshot()\nnode = find_focused_node(snapshot)\nif node:\n print(node[\"name\"])\n```\n","async":true,"alias":"snapshot","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"interestingOnly","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Prune uninteresting nodes from the tree. Defaults to `true`."}],"required":false,"comment":"Prune uninteresting nodes from the tree. Defaults to `true`.","async":false,"alias":"interestingOnly","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"root","type":{"name":"ElementHandle","expression":"[ElementHandle]"},"spec":[{"type":"text","text":"The root DOM element for the snapshot. Defaults to the whole page."}],"required":false,"comment":"The root DOM element for the snapshot. Defaults to the whole page.","async":false,"alias":"root","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]}]},{"name":"Android","spec":[{"type":"text","text":"Playwright has **experimental** support for Android automation. This includes Chrome for Android and Android WebView."},{"type":"text","text":"*Requirements*"},{"type":"li","text":"Android device or AVD Emulator.","liType":"bullet"},{"type":"li","text":"[ADB daemon](https://developer.android.com/studio/command-line/adb) running and authenticated with your device. Typically running `adb devices` is all you need to do.","liType":"bullet"},{"type":"li","text":"[`Chrome 87`](https://play.google.com/store/apps/details?id=com.android.chrome) or newer installed on the device","liType":"bullet"},{"type":"li","text":"\"Enable command line on non-rooted devices\" enabled in `chrome://flags`.","liType":"bullet"},{"type":"text","text":"*Known limitations*"},{"type":"li","text":"Raw USB operation is not yet supported, so you need ADB.","liType":"bullet"},{"type":"li","text":"Device needs to be awake to produce screenshots. Enabling \"Stay awake\" developer mode will help.","liType":"bullet"},{"type":"li","text":"We didn't run all the tests against the device, so not everything works.","liType":"bullet"},{"type":"text","text":"*How to run*"},{"type":"text","text":"An example of the Android automation script would be:"},{"type":"code","lines":["const { _android: android } = require('playwright');","","(async () => {"," // Connect to the device."," const [device] = await android.devices();"," console.log(`Model: ${device.model()}`);"," console.log(`Serial: ${device.serial()}`);"," // Take screenshot of the whole device."," await device.screenshot({ path: 'device.png' });",""," {"," // --------------------- WebView -----------------------",""," // Launch an application with WebView."," await device.shell('am force-stop org.chromium.webview_shell');"," await device.shell('am start org.chromium.webview_shell/.WebViewBrowserActivity');"," // Get the WebView."," const webview = await device.webView({ pkg: 'org.chromium.webview_shell' });",""," // Fill the input box."," await device.fill({"," res: 'org.chromium.webview_shell:id/url_field',"," }, 'github.com/microsoft/playwright');"," await device.press({"," res: 'org.chromium.webview_shell:id/url_field',"," }, 'Enter');",""," // Work with WebView's page as usual."," const page = await webview.page();"," await page.waitForNavigation({ url: /.*microsoft\\/playwright.*/ });"," console.log(await page.title());"," }",""," {"," // --------------------- Browser -----------------------",""," // Launch Chrome browser."," await device.shell('am force-stop com.android.chrome');"," const context = await device.launchBrowser();",""," // Use BrowserContext as usual."," const page = await context.newPage();"," await page.goto('https://webkit.org/');"," console.log(await page.evaluate(() => window.location.href));"," await page.screenshot({ path: 'page.png' });",""," await context.close();"," }",""," // Close the device."," await device.close();","})();"],"codeLang":"js"}],"langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"comment":"Playwright has **experimental** support for Android automation. This includes Chrome for Android and Android\nWebView.\n\n*Requirements*\n- Android device or AVD Emulator.\n- [ADB daemon](https://developer.android.com/studio/command-line/adb) running and authenticated with your device.\n Typically running `adb devices` is all you need to do.\n- [`Chrome 87`](https://play.google.com/store/apps/details?id=com.android.chrome) or newer installed on the\n device\n- \"Enable command line on non-rooted devices\" enabled in `chrome://flags`.\n\n*Known limitations*\n- Raw USB operation is not yet supported, so you need ADB.\n- Device needs to be awake to produce screenshots. Enabling \"Stay awake\" developer mode will help.\n- We didn't run all the tests against the device, so not everything works.\n\n*How to run*\n\nAn example of the Android automation script would be:\n\n```js\nconst { _android: android } = require('playwright');\n\n(async () => {\n // Connect to the device.\n const [device] = await android.devices();\n console.log(`Model: ${device.model()}`);\n console.log(`Serial: ${device.serial()}`);\n // Take screenshot of the whole device.\n await device.screenshot({ path: 'device.png' });\n\n {\n // --------------------- WebView -----------------------\n\n // Launch an application with WebView.\n await device.shell('am force-stop org.chromium.webview_shell');\n await device.shell('am start org.chromium.webview_shell/.WebViewBrowserActivity');\n // Get the WebView.\n const webview = await device.webView({ pkg: 'org.chromium.webview_shell' });\n\n // Fill the input box.\n await device.fill({\n res: 'org.chromium.webview_shell:id/url_field',\n }, 'github.com/microsoft/playwright');\n await device.press({\n res: 'org.chromium.webview_shell:id/url_field',\n }, 'Enter');\n\n // Work with WebView's page as usual.\n const page = await webview.page();\n await page.waitForNavigation({ url: /.*microsoft\\/playwright.*/ });\n console.log(await page.title());\n }\n\n {\n // --------------------- Browser -----------------------\n\n // Launch Chrome browser.\n await device.shell('am force-stop com.android.chrome');\n const context = await device.launchBrowser();\n\n // Use BrowserContext as usual.\n const page = await context.newPage();\n await page.goto('https://webkit.org/');\n console.log(await page.evaluate(() => window.location.href));\n await page.screenshot({ path: 'page.png' });\n\n await context.close();\n }\n\n // Close the device.\n await device.close();\n})();\n```\n","since":"v1.9","members":[{"kind":"method","langs":{},"since":"v1.28","name":"connect","type":{"name":"AndroidDevice","expression":"[AndroidDevice]"},"spec":[{"type":"text","text":"This methods attaches Playwright to an existing Android device.↵Use [`method: Android.launchServer`] to launch a new Android server instance."}],"required":true,"comment":"This methods attaches Playwright to an existing Android device. Use [`method: Android.launchServer`] to launch a\nnew Android server instance.","async":true,"alias":"connect","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.28","name":"wsEndpoint","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A browser websocket endpoint to connect to."}],"required":true,"comment":"A browser websocket endpoint to connect to.","async":false,"alias":"wsEndpoint","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.28","name":"headers","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"Additional HTTP headers to be sent with web socket connect request. Optional."}],"required":false,"comment":"Additional HTTP headers to be sent with web socket connect request. Optional.","async":false,"alias":"headers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.28","name":"slowMo","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Slows down Playwright operations by the specified amount of milliseconds. Useful so that you↵can see what is going on. Defaults to `0`."}],"required":false,"comment":"Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going\non. Defaults to `0`.","async":false,"alias":"slowMo","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.28","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds to wait for the connection to be established. Defaults to↵`30000` (30 seconds). Pass `0` to disable timeout."}],"required":false,"comment":"Maximum time in milliseconds to wait for the connection to be established. Defaults to `30000` (30 seconds). Pass\n`0` to disable timeout.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"devices","type":{"name":"Array","templates":[{"name":"AndroidDevice"}],"expression":"[Array]<[AndroidDevice]>"},"spec":[{"type":"text","text":"Returns the list of detected Android devices."}],"required":true,"comment":"Returns the list of detected Android devices.","async":true,"alias":"devices","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.22","name":"host","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional host to establish ADB server connection. Default to `127.0.0.1`."}],"required":false,"comment":"Optional host to establish ADB server connection. Default to `127.0.0.1`.","async":false,"alias":"host","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.21","name":"omitDriverInstall","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Prevents automatic playwright driver installation on attach. Assumes that the drivers have been installed already."}],"required":false,"comment":"Prevents automatic playwright driver installation on attach. Assumes that the drivers have been installed already.","async":false,"alias":"omitDriverInstall","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.20","name":"port","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Optional port to establish ADB server connection. Default to `5037`."}],"required":false,"comment":"Optional port to establish ADB server connection. Default to `5037`.","async":false,"alias":"port","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.28","name":"launchServer","type":{"name":"BrowserServer","expression":"[BrowserServer]"},"spec":[{"type":"text","text":"Launches Playwright Android server that clients can connect to. See the following example:"},{"type":"text","text":"**Usage**"},{"type":"text","text":"Server Side:"},{"type":"code","lines":["const { _android } = require('playwright');","","(async () => {"," const browserServer = await _android.launchServer({"," // If you have multiple devices connected and want to use a specific one."," // deviceSerialNumber: '<deviceSerialNumber>',"," });"," const wsEndpoint = browserServer.wsEndpoint();"," console.log(wsEndpoint);","})();"],"codeLang":"js"},{"type":"text","text":"Client Side:"},{"type":"code","lines":["const { _android } = require('playwright');","","(async () => {"," const device = await _android.connect('<wsEndpoint>');",""," console.log(device.model());"," console.log(device.serial());"," await device.shell('am force-stop com.android.chrome');"," const context = await device.launchBrowser();",""," const page = await context.newPage();"," await page.goto('https://webkit.org/');"," console.log(await page.evaluate(() => window.location.href));"," await page.screenshot({ path: 'page-chrome-1.png' });",""," await context.close();","})();"],"codeLang":"js"}],"required":true,"comment":"Launches Playwright Android server that clients can connect to. See the following example:\n\n**Usage**\n\nServer Side:\n\n```js\nconst { _android } = require('playwright');\n\n(async () => {\n const browserServer = await _android.launchServer({\n // If you have multiple devices connected and want to use a specific one.\n // deviceSerialNumber: '<deviceSerialNumber>',\n });\n const wsEndpoint = browserServer.wsEndpoint();\n console.log(wsEndpoint);\n})();\n```\n\nClient Side:\n\n```js\nconst { _android } = require('playwright');\n\n(async () => {\n const device = await _android.connect('<wsEndpoint>');\n\n console.log(device.model());\n console.log(device.serial());\n await device.shell('am force-stop com.android.chrome');\n const context = await device.launchBrowser();\n\n const page = await context.newPage();\n await page.goto('https://webkit.org/');\n console.log(await page.evaluate(() => window.location.href));\n await page.screenshot({ path: 'page-chrome-1.png' });\n\n await context.close();\n})();\n```\n","async":true,"alias":"launchServer","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.28","name":"adbHost","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional host to establish ADB server connection. Default to `127.0.0.1`."}],"required":false,"comment":"Optional host to establish ADB server connection. Default to `127.0.0.1`.","async":false,"alias":"adbHost","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.28","name":"adbPort","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Optional port to establish ADB server connection. Default to `5037`."}],"required":false,"comment":"Optional port to establish ADB server connection. Default to `5037`.","async":false,"alias":"adbPort","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.28","name":"deviceSerialNumber","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional device serial number to launch the browser on. If not specified, it will↵throw if multiple devices are connected."}],"required":false,"comment":"Optional device serial number to launch the browser on. If not specified, it will throw if multiple devices are\nconnected.","async":false,"alias":"deviceSerialNumber","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.45","name":"host","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Host to use for the web socket. It is optional and if it is omitted, the server will accept connections on the unspecified IPv6 address (::) when IPv6 is available, or the unspecified IPv4 address (0.0.0.0) otherwise. Consider hardening it with picking a specific interface."}],"required":false,"comment":"Host to use for the web socket. It is optional and if it is omitted, the server will accept connections on the\nunspecified IPv6 address (::) when IPv6 is available, or the unspecified IPv4 address (0.0.0.0) otherwise. Consider\nhardening it with picking a specific interface.","async":false,"alias":"host","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.28","name":"omitDriverInstall","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Prevents automatic playwright driver installation on attach. Assumes that the drivers have been installed already."}],"required":false,"comment":"Prevents automatic playwright driver installation on attach. Assumes that the drivers have been installed already.","async":false,"alias":"omitDriverInstall","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.28","name":"port","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Port to use for the web socket. Defaults to 0 that picks any available port."}],"required":false,"comment":"Port to use for the web socket. Defaults to 0 that picks any available port.","async":false,"alias":"port","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.28","name":"wsPath","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Path at which to serve the Android Server. For security, this defaults to an↵unguessable string."},{"type":"note","noteType":"warning","text":"Any process or web page (including those running in Playwright) with knowledge↵of the `wsPath` can take control of the OS user. For this reason, you should↵use an unguessable token when using this option."}],"required":false,"comment":"Path at which to serve the Android Server. For security, this defaults to an unguessable string.\n\n**NOTE** Any process or web page (including those running in Playwright) with knowledge of the `wsPath` can take\ncontrol of the OS user. For this reason, you should use an unguessable token when using this option.","async":false,"alias":"wsPath","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"setDefaultTimeout","type":{"name":"void"},"spec":[{"type":"text","text":"This setting will change the default maximum time for all the methods accepting `timeout` option."}],"required":true,"comment":"This setting will change the default maximum time for all the methods accepting `timeout` option.","async":false,"alias":"setDefaultTimeout","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds"}],"required":true,"comment":"Maximum time in milliseconds","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]}]},{"name":"AndroidDevice","spec":[{"type":"text","text":"`AndroidDevice` represents a connected device, either real hardware or emulated. Devices can be obtained using [`method: Android.devices`]."}],"langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"comment":"`AndroidDevice` represents a connected device, either real hardware or emulated. Devices can be obtained using\n[`method: Android.devices`].","since":"v1.9","members":[{"kind":"event","langs":{},"since":"v1.28","name":"close","type":{"name":"AndroidDevice","expression":"[AndroidDevice]"},"spec":[{"type":"text","text":"Emitted when the device connection gets closed."}],"required":true,"comment":"Emitted when the device connection gets closed.","async":false,"alias":"close","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.9","name":"webView","type":{"name":"AndroidWebView","expression":"[AndroidWebView]"},"spec":[{"type":"text","text":"Emitted when a new WebView instance is detected."}],"required":true,"comment":"Emitted when a new WebView instance is detected.","async":false,"alias":"webView","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.9","name":"close","type":{"name":"void"},"spec":[{"type":"text","text":"Disconnects from the device."}],"required":true,"comment":"Disconnects from the device.","async":true,"alias":"close","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.9","name":"drag","type":{"name":"void"},"spec":[{"type":"text","text":"Drags the widget defined by `selector` towards `dest` point."}],"required":true,"comment":"Drags the widget defined by `selector` towards `dest` point.","async":true,"alias":"drag","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"AndroidSelector","expression":"[AndroidSelector]"},"spec":[{"type":"text","text":"Selector to drag."}],"required":true,"comment":"Selector to drag.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"dest","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Point to drag to."}],"required":true,"comment":"Point to drag to.","async":false,"alias":"dest","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"speed","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Optional speed of the drag in pixels per second."}],"required":false,"comment":"Optional speed of the drag in pixels per second.","async":false,"alias":"speed","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by↵using the [`method: AndroidDevice.setDefaultTimeout`] method."}],"required":false,"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed\nby using the [`method: AndroidDevice.setDefaultTimeout`] method.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"fill","type":{"name":"void"},"spec":[{"type":"text","text":"Fills the specific `selector` input box with `text`."}],"required":true,"comment":"Fills the specific `selector` input box with `text`.","async":true,"alias":"fill","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"AndroidSelector","expression":"[AndroidSelector]"},"spec":[{"type":"text","text":"Selector to fill."}],"required":true,"comment":"Selector to fill.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"text","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Text to be filled in the input box."}],"required":true,"comment":"Text to be filled in the input box.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by↵using the [`method: AndroidDevice.setDefaultTimeout`] method."}],"required":false,"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed\nby using the [`method: AndroidDevice.setDefaultTimeout`] method.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"fling","type":{"name":"void"},"spec":[{"type":"text","text":"Flings the widget defined by `selector` in the specified `direction`."}],"required":true,"comment":"Flings the widget defined by `selector` in the specified `direction`.","async":true,"alias":"fling","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"AndroidSelector","expression":"[AndroidSelector]"},"spec":[{"type":"text","text":"Selector to fling."}],"required":true,"comment":"Selector to fling.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"direction","type":{"name":"AndroidFlingDirection","union":[{"name":"\"down\""},{"name":"\"up\""},{"name":"\"left\""},{"name":"\"right\""}],"expression":"[AndroidFlingDirection]<\"down\"|\"up\"|\"left\"|\"right\">"},"spec":[{"type":"text","text":"Fling direction."}],"required":true,"comment":"Fling direction.","async":false,"alias":"direction","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"speed","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Optional speed of the fling in pixels per second."}],"required":false,"comment":"Optional speed of the fling in pixels per second.","async":false,"alias":"speed","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by↵using the [`method: AndroidDevice.setDefaultTimeout`] method."}],"required":false,"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed\nby using the [`method: AndroidDevice.setDefaultTimeout`] method.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"info","type":{"name":"AndroidElementInfo","expression":"[AndroidElementInfo]"},"spec":[{"type":"text","text":"Returns information about a widget defined by `selector`."}],"required":true,"comment":"Returns information about a widget defined by `selector`.","async":true,"alias":"info","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"AndroidSelector","expression":"[AndroidSelector]"},"spec":[{"type":"text","text":"Selector to return information about."}],"required":true,"comment":"Selector to return information about.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null}]},{"kind":"property","langs":{},"since":"v1.9","name":"input","type":{"name":"AndroidInput","expression":"[AndroidInput]"},"spec":[],"required":true,"comment":"","async":false,"alias":"input","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.9","name":"installApk","type":{"name":"void"},"spec":[{"type":"text","text":"Installs an apk on the device."}],"required":true,"comment":"Installs an apk on the device.","async":true,"alias":"installApk","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"file","type":{"name":"","union":[{"name":"string"},{"name":"Buffer"}],"expression":"[string]|[Buffer]"},"spec":[{"type":"text","text":"Either a path to the apk file, or apk file content."}],"required":true,"comment":"Either a path to the apk file, or apk file content.","async":false,"alias":"file","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"args","type":{"name":"Array","templates":[{"name":"string"}],"expression":"[Array]<[string]>"},"spec":[{"type":"text","text":"Optional arguments to pass to the `shell:cmd package install` call. Defaults to `-r -t -S`."}],"required":false,"comment":"Optional arguments to pass to the `shell:cmd package install` call. Defaults to `-r -t -S`.","async":false,"alias":"args","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"launchBrowser","type":{"name":"BrowserContext","expression":"[BrowserContext]"},"spec":[{"type":"text","text":"Launches Chrome browser on the device, and returns its persistent context."}],"required":true,"comment":"Launches Chrome browser on the device, and returns its persistent context.","async":true,"alias":"launchBrowser","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"acceptDownloads","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted."}],"required":false,"comment":"Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted.","async":false,"alias":"acceptDownloads","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.29","name":"args","type":{"name":"Array","templates":[{"name":"string"}],"expression":"[Array]<[string]>"},"spec":[{"type":"note","noteType":"warning","text":"Use custom browser args at your own risk, as some of them may break Playwright functionality."},{"type":"text","text":"Additional arguments to pass to the browser instance. The list of Chromium flags can be found↵[here](https://peter.sh/experiments/chromium-command-line-switches/)."}],"required":false,"comment":"**NOTE** Use custom browser args at your own risk, as some of them may break Playwright functionality.\n\nAdditional arguments to pass to the browser instance. The list of Chromium flags can be found\n[here](https://peter.sh/experiments/chromium-command-line-switches/).","async":false,"alias":"args","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"baseURL","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"When using [`method: Page.goto`], [`method: Page.route`], [`method: Page.waitForURL`], [`method: Page.waitForRequest`], or [`method: Page.waitForResponse`] it takes the base URL in consideration by using the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL. Unset by default. Examples:"},{"type":"li","text":"baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html`","liType":"bullet"},{"type":"li","text":"baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in `http://localhost:3000/foo/bar.html`","liType":"bullet"},{"type":"li","text":"baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in `http://localhost:3000/bar.html`","liType":"bullet"}],"required":false,"comment":"When using [`method: Page.goto`], [`method: Page.route`], [`method: Page.waitForURL`],\n[`method: Page.waitForRequest`], or [`method: Page.waitForResponse`] it takes the base URL in consideration by\nusing the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the\ncorresponding URL. Unset by default. Examples:\n- baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html`\n- baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in\n `http://localhost:3000/foo/bar.html`\n- baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in\n `http://localhost:3000/bar.html`","async":false,"alias":"baseURL","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"bypassCSP","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Toggles bypassing page's Content-Security-Policy. Defaults to `false`."}],"required":false,"comment":"Toggles bypassing page's Content-Security-Policy. Defaults to `false`.","async":false,"alias":"bypassCSP","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"colorScheme","type":{"name":"","union":[{"name":"null"},{"name":"ColorScheme","union":[{"name":"\"light\""},{"name":"\"dark\""},{"name":"\"no-preference\""}]}],"expression":"null|[ColorScheme]<\"light\"|\"dark\"|\"no-preference\">"},"spec":[{"type":"text","text":"Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See↵[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'light'`."}],"required":false,"comment":"Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to\n`'light'`.","async":false,"alias":"colorScheme","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"colorScheme","type":{"name":"ColorScheme","union":[{"name":"\"light\""},{"name":"\"dark\""},{"name":"\"no-preference\""},{"name":"\"null\""}],"expression":"[ColorScheme]<\"light\"|\"dark\"|\"no-preference\"|\"null\">"},"spec":[{"type":"text","text":"Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See↵[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'light'`."}],"required":false,"comment":"Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to\n`'light'`.","async":false,"alias":"colorScheme","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"command","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional package name to launch instead of default Chrome for Android."}],"required":false,"comment":"Optional package name to launch instead of default Chrome for Android.","async":false,"alias":"command","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"deviceScaleFactor","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about [emulating devices with device scale factor](../emulation.md#devices)."}],"required":false,"comment":"Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about\n[emulating devices with device scale factor](../emulation.md#devices).","async":false,"alias":"deviceScaleFactor","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"extraHTTPHeaders","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"An object containing additional HTTP headers to be sent with every request. Defaults to none."}],"required":false,"comment":"An object containing additional HTTP headers to be sent with every request. Defaults to none.","async":false,"alias":"extraHTTPHeaders","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"forcedColors","type":{"name":"","union":[{"name":"null"},{"name":"ForcedColors","union":[{"name":"\"active\""},{"name":"\"none\""}]}],"expression":"null|[ForcedColors]<\"active\"|\"none\">"},"spec":[{"type":"text","text":"Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See [`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'none'`."}],"required":false,"comment":"Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See\n[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to\n`'none'`.","async":false,"alias":"forcedColors","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"forcedColors","type":{"name":"ForcedColors","union":[{"name":"\"active\""},{"name":"\"none\""},{"name":"\"null\""}],"expression":"[ForcedColors]<\"active\"|\"none\"|\"null\">"},"spec":[{"type":"text","text":"Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See [`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'none'`."}],"required":false,"comment":"Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See\n[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to\n`'none'`.","async":false,"alias":"forcedColors","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"geolocation","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"latitude","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Latitude between -90 and 90."}],"required":true,"comment":"Latitude between -90 and 90.","async":false,"alias":"latitude","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"longitude","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Longitude between -180 and 180."}],"required":true,"comment":"Longitude between -180 and 180.","async":false,"alias":"longitude","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"accuracy","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Non-negative accuracy value. Defaults to `0`."}],"required":false,"comment":"Non-negative accuracy value. Defaults to `0`.","async":false,"alias":"accuracy","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[],"required":false,"comment":"","async":false,"alias":"geolocation","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"hasTouch","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Specifies if viewport supports touch events. Defaults to false. Learn more about [mobile emulation](../emulation.md#devices)."}],"required":false,"comment":"Specifies if viewport supports touch events. Defaults to false. Learn more about\n[mobile emulation](../emulation.md#devices).","async":false,"alias":"hasTouch","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"httpCredentials","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"username","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"username","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"password","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"password","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"origin","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Restrain sending http credentials on specific origin (scheme://host:port)."}],"required":false,"comment":"Restrain sending http credentials on specific origin (scheme://host:port).","async":false,"alias":"origin","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"send","type":{"name":"HttpCredentialsSend","union":[{"name":"\"unauthorized\""},{"name":"\"always\""}],"expression":"[HttpCredentialsSend]<\"unauthorized\"|\"always\">"},"spec":[{"type":"text","text":"This option only applies to the requests sent from corresponding `APIRequestContext` and does not affect requests sent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with `WWW-Authenticate` header is received. Defaults to `'unauthorized'`."}],"required":false,"comment":"This option only applies to the requests sent from corresponding `APIRequestContext` and does not affect requests\nsent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with\nthe each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with\n`WWW-Authenticate` header is received. Defaults to `'unauthorized'`.","async":false,"alias":"send","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).↵If no origin is specified, the username and password are sent to any servers upon unauthorized responses."}],"required":false,"comment":"Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no\norigin is specified, the username and password are sent to any servers upon unauthorized responses.","async":false,"alias":"httpCredentials","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"ignoreHTTPSErrors","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to ignore HTTPS errors when sending network requests. Defaults to `false`."}],"required":false,"comment":"Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.","async":false,"alias":"ignoreHTTPSErrors","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"isMobile","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device, so you don't actually need to set it manually. Defaults to `false` and is not supported in Firefox. Learn more about [mobile emulation](../emulation.md#ismobile)."}],"required":false,"comment":"Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device,\nso you don't actually need to set it manually. Defaults to `false` and is not supported in Firefox. Learn more\nabout [mobile emulation](../emulation.md#ismobile).","async":false,"alias":"isMobile","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"javaScriptEnabled","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether or not to enable JavaScript in the context. Defaults to `true`. Learn more about [disabling JavaScript](../emulation.md#javascript-enabled)."}],"required":false,"comment":"Whether or not to enable JavaScript in the context. Defaults to `true`. Learn more about\n[disabling JavaScript](../emulation.md#javascript-enabled).","async":false,"alias":"javaScriptEnabled","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"locale","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language` request header value as well as number and date formatting rules. Defaults to the system default locale. Learn more about emulation in our [emulation guide](../emulation.md#locale--timezone)."}],"required":false,"comment":"Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value,\n`Accept-Language` request header value as well as number and date formatting rules. Defaults to the system default\nlocale. Learn more about emulation in our [emulation guide](../emulation.md#locale--timezone).","async":false,"alias":"locale","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"logger","type":{"name":"Logger","expression":"[Logger]"},"spec":[{"type":"text","text":"Logger sink for Playwright logging."}],"required":false,"comment":"Logger sink for Playwright logging.","async":false,"alias":"logger","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"noViewport","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Does not enforce fixed viewport, allows resizing window in the headed mode."}],"required":false,"comment":"Does not enforce fixed viewport, allows resizing window in the headed mode.","async":false,"alias":"noViewport","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"offline","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to emulate network being offline. Defaults to `false`. Learn more about [network emulation](../emulation.md#offline)."}],"required":false,"comment":"Whether to emulate network being offline. Defaults to `false`. Learn more about\n[network emulation](../emulation.md#offline).","async":false,"alias":"offline","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"permissions","type":{"name":"Array","templates":[{"name":"string"}],"expression":"[Array]<[string]>"},"spec":[{"type":"text","text":"A list of permissions to grant to all pages in this context. See↵[`method: BrowserContext.grantPermissions`] for more details. Defaults to none."}],"required":false,"comment":"A list of permissions to grant to all pages in this context. See [`method: BrowserContext.grantPermissions`] for\nmore details. Defaults to none.","async":false,"alias":"permissions","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.29","name":"proxy","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"server","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example↵`http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP↵proxy."}],"required":true,"comment":"Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or\n`socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.","async":false,"alias":"server","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"bypass","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org,↵.domain.com\"`."}],"required":false,"comment":"Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.","async":false,"alias":"bypass","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"username","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional username to use if HTTP proxy requires authentication."}],"required":false,"comment":"Optional username to use if HTTP proxy requires authentication.","async":false,"alias":"username","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"password","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional password to use if HTTP proxy requires authentication."}],"required":false,"comment":"Optional password to use if HTTP proxy requires authentication.","async":false,"alias":"password","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Network proxy settings."}],"required":false,"comment":"Network proxy settings.","async":false,"alias":"proxy","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"recordHar","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"omitContent","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Optional setting to control whether to omit request content from the HAR. Defaults to↵`false`. Deprecated, use `content` policy instead."}],"required":false,"comment":"Optional setting to control whether to omit request content from the HAR. Defaults to `false`. Deprecated, use\n`content` policy instead.","async":false,"alias":"omitContent","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"content","type":{"name":"HarContentPolicy","union":[{"name":"\"omit\""},{"name":"\"embed\""},{"name":"\"attach\""}],"expression":"[HarContentPolicy]<\"omit\"|\"embed\"|\"attach\">"},"spec":[{"type":"text","text":"Optional setting to control resource content management. If `omit` is specified, content is not persisted. If `attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is specified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output files and to `embed` for all other file extensions."}],"required":false,"comment":"Optional setting to control resource content management. If `omit` is specified, content is not persisted. If\n`attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is\nspecified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output\nfiles and to `embed` for all other file extensions.","async":false,"alias":"content","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path on the filesystem to write the HAR file to. If the file name ends with `.zip`, `content: 'attach'` is used by default."}],"required":true,"comment":"Path on the filesystem to write the HAR file to. If the file name ends with `.zip`, `content: 'attach'` is used by\ndefault.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mode","type":{"name":"HarMode","union":[{"name":"\"full\""},{"name":"\"minimal\""}],"expression":"[HarMode]<\"full\"|\"minimal\">"},"spec":[{"type":"text","text":"When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`."}],"required":false,"comment":"When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,\ncookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.","async":false,"alias":"mode","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"urlFilter","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"A glob or regex pattern to filter requests that are stored in the HAR. When a `baseURL` via the context options was provided and the passed URL is a path, it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. Defaults to none."}],"required":false,"comment":"A glob or regex pattern to filter requests that are stored in the HAR. When a `baseURL` via the context options was\nprovided and the passed URL is a path, it gets merged via the\n[`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. Defaults to none.","async":false,"alias":"urlFilter","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not↵specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be↵saved."}],"required":false,"comment":"Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file.\nIf not specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be\nsaved.","async":false,"alias":"recordHar","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_content"},"types":{},"overrides":{}},"since":"v1.9","name":"recordHarContent","type":{"name":"HarContentPolicy","union":[{"name":"\"omit\""},{"name":"\"embed\""},{"name":"\"attach\""}],"expression":"[HarContentPolicy]<\"omit\"|\"embed\"|\"attach\">"},"spec":[{"type":"text","text":"Optional setting to control resource content management. If `omit` is specified, content is not persisted. If `attach` is specified, resources are persisted as separate files and all of these files are archived along with the HAR file. Defaults to `embed`, which stores content inline the HAR file as per HAR specification."}],"required":false,"comment":"Optional setting to control resource content management. If `omit` is specified, content is not persisted. If\n`attach` is specified, resources are persisted as separate files and all of these files are archived along with the\nHAR file. Defaults to `embed`, which stores content inline the HAR file as per HAR specification.","async":false,"alias":"recordHarContent","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_mode"},"types":{},"overrides":{}},"since":"v1.9","name":"recordHarMode","type":{"name":"HarMode","union":[{"name":"\"full\""},{"name":"\"minimal\""}],"expression":"[HarMode]<\"full\"|\"minimal\">"},"spec":[{"type":"text","text":"When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`."}],"required":false,"comment":"When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,\ncookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.","async":false,"alias":"recordHarMode","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_omit_content"},"types":{},"overrides":{}},"since":"v1.9","name":"recordHarOmitContent","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Optional setting to control whether to omit request content from the HAR. Defaults to `false`."}],"required":false,"comment":"Optional setting to control whether to omit request content from the HAR. Defaults to `false`.","async":false,"alias":"recordHarOmitContent","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_path"},"types":{},"overrides":{}},"since":"v1.9","name":"recordHarPath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the↵specified HAR file on the filesystem. If not specified, the HAR is not recorded. Make sure to↵call [`method: BrowserContext.close`] for the HAR to be saved."}],"required":false,"comment":"Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file\non the filesystem. If not specified, the HAR is not recorded. Make sure to call [`method: BrowserContext.close`]\nfor the HAR to be saved.","async":false,"alias":"recordHarPath","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_url_filter"},"types":{},"overrides":{}},"since":"v1.9","name":"recordHarUrlFilter","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[],"required":false,"comment":"","async":false,"alias":"recordHarUrlFilter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"recordVideo","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"dir","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the directory to put videos into."}],"required":true,"comment":"Path to the directory to put videos into.","async":false,"alias":"dir","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"size","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame width."}],"required":true,"comment":"Video frame width.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame height."}],"required":true,"comment":"Video frame height.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport`↵scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450.↵Actual picture of each page will be scaled down if necessary to fit the specified size."}],"required":false,"comment":"Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to\nfit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of\neach page will be scaled down if necessary to fit the specified size.","async":false,"alias":"size","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make↵sure to await [`method: BrowserContext.close`] for videos to be saved."}],"required":false,"comment":"Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded.\nMake sure to await [`method: BrowserContext.close`] for videos to be saved.","async":false,"alias":"recordVideo","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_video_dir"},"types":{},"overrides":{}},"since":"v1.9","name":"recordVideoDir","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Enables video recording for all pages into the specified directory. If not specified videos are↵not recorded. Make sure to call [`method: BrowserContext.close`] for videos to be saved."}],"required":false,"comment":"Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make\nsure to call [`method: BrowserContext.close`] for videos to be saved.","async":false,"alias":"recordVideoDir","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_video_size"},"types":{},"overrides":{}},"since":"v1.9","name":"recordVideoSize","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame width."}],"required":true,"comment":"Video frame width.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame height."}],"required":true,"comment":"Video frame height.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Dimensions of the recorded videos. If not specified the size will be equal to `viewport`↵scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450.↵Actual picture of each page will be scaled down if necessary to fit the specified size."}],"required":false,"comment":"Dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into\n800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page\nwill be scaled down if necessary to fit the specified size.","async":false,"alias":"recordVideoSize","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"reducedMotion","type":{"name":"","union":[{"name":"null"},{"name":"ReducedMotion","union":[{"name":"\"reduce\""},{"name":"\"no-preference\""}]}],"expression":"null|[ReducedMotion]<\"reduce\"|\"no-preference\">"},"spec":[{"type":"text","text":"Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See [`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'no-preference'`."}],"required":false,"comment":"Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to\n`'no-preference'`.","async":false,"alias":"reducedMotion","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"reducedMotion","type":{"name":"ReducedMotion","union":[{"name":"\"reduce\""},{"name":"\"no-preference\""},{"name":"\"null\""}],"expression":"[ReducedMotion]<\"reduce\"|\"no-preference\"|\"null\">"},"spec":[{"type":"text","text":"Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See [`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'no-preference'`."}],"required":false,"comment":"Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to\n`'no-preference'`.","async":false,"alias":"reducedMotion","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"aliases":{"java":"screenSize","csharp":"screenSize"},"types":{},"overrides":{}},"since":"v1.9","name":"screen","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page width in pixels."}],"required":true,"comment":"page width in pixels.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page height in pixels."}],"required":true,"comment":"page height in pixels.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the↵`viewport` is set."}],"required":false,"comment":"Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the\n`viewport` is set.","async":false,"alias":"screen","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"serviceWorkers","type":{"name":"ServiceWorkerPolicy","union":[{"name":"\"allow\""},{"name":"\"block\""}],"expression":"[ServiceWorkerPolicy]<\"allow\"|\"block\">"},"spec":[{"type":"text","text":"Whether to allow sites to register Service workers. Defaults to `'allow'`."},{"type":"li","text":"`'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be registered.","liType":"bullet"},{"type":"li","text":"`'block'`: Playwright will block all registration of Service Workers.","liType":"bullet"}],"required":false,"comment":"Whether to allow sites to register Service workers. Defaults to `'allow'`.\n- `'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be\n registered.\n- `'block'`: Playwright will block all registration of Service Workers.","async":false,"alias":"serviceWorkers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"strictSelectors","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations↵on selectors that imply single target DOM element will throw when more than one element matches the selector.↵This option does not affect any Locator APIs (Locators are always strict). Defaults to `false`.↵See `Locator` to learn more about the strict mode."}],"required":false,"comment":"If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations on\nselectors that imply single target DOM element will throw when more than one element matches the selector. This\noption does not affect any Locator APIs (Locators are always strict). Defaults to `false`. See `Locator` to learn\nmore about the strict mode.","async":false,"alias":"strictSelectors","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"timezoneId","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Changes the timezone of the context. See [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)↵for a list of supported timezone IDs. Defaults to the system timezone."}],"required":false,"comment":"Changes the timezone of the context. See\n[ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)\nfor a list of supported timezone IDs. Defaults to the system timezone.","async":false,"alias":"timezoneId","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"userAgent","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Specific user agent to use in this context."}],"required":false,"comment":"Specific user agent to use in this context.","async":false,"alias":"userAgent","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","deprecated":"Use `recordVideo` instead.","name":"videoSize","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame width."}],"required":true,"comment":"Video frame width.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame height."}],"required":true,"comment":"Video frame height.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[],"required":false,"comment":"","async":false,"alias":"videoSize","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","deprecated":"Use `recordVideo` instead.","name":"videosPath","type":{"name":"path","expression":"[path]"},"spec":[],"required":false,"comment":"","async":false,"alias":"videosPath","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","java"],"aliases":{"java":"viewportSize"},"types":{},"overrides":{}},"since":"v1.9","name":"viewport","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page width in pixels."}],"required":true,"comment":"page width in pixels.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page height in pixels."}],"required":true,"comment":"page height in pixels.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}]}],"expression":"[null]|[Object]"},"spec":[{"type":"text","text":"Emulates consistent viewport for each page. Defaults to an 1280x720 viewport.↵Use `null` to disable the consistent viewport emulation. Learn more about [viewport emulation](../emulation#viewport)."},{"type":"note","noteType":"note","text":"The `null` value opts out from the default presets, makes viewport depend on the↵host window size defined by the operating system. It makes the execution of the↵tests non-deterministic."}],"required":false,"comment":"Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `null` to disable the consistent\nviewport emulation. Learn more about [viewport emulation](../emulation#viewport).\n\n**NOTE** The `null` value opts out from the default presets, makes viewport depend on the host window size defined\nby the operating system. It makes the execution of the tests non-deterministic.","async":false,"alias":"viewport","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{"csharp":"viewportSize"},"types":{},"overrides":{}},"since":"v1.9","name":"viewport","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page width in pixels."}],"required":true,"comment":"page width in pixels.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page height in pixels."}],"required":true,"comment":"page height in pixels.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}]}],"expression":"[null]|[Object]"},"spec":[{"type":"text","text":"Emulates consistent viewport for each page. Defaults to an 1280x720 viewport.↵Use `ViewportSize.NoViewport` to disable the consistent viewport emulation. Learn more about [viewport emulation](../emulation.md#viewport)."},{"type":"note","noteType":"note","text":"The `ViewportSize.NoViewport` value opts out from the default presets,↵makes viewport depend on the host window size defined by the operating system.↵It makes the execution of the tests non-deterministic."}],"required":false,"comment":"Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `ViewportSize.NoViewport` to\ndisable the consistent viewport emulation. Learn more about [viewport emulation](../emulation.md#viewport).\n\n**NOTE** The `ViewportSize.NoViewport` value opts out from the default presets, makes viewport depend on the host\nwindow size defined by the operating system. It makes the execution of the tests non-deterministic.","async":false,"alias":"viewport","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"viewport","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page width in pixels."}],"required":true,"comment":"page width in pixels.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page height in pixels."}],"required":true,"comment":"page height in pixels.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}]}],"expression":"[null]|[Object]"},"spec":[{"type":"text","text":"Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed viewport. Learn more about [viewport emulation](../emulation.md#viewport)."}],"required":false,"comment":"Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed\nviewport. Learn more about [viewport emulation](../emulation.md#viewport).","async":false,"alias":"viewport","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"longTap","type":{"name":"void"},"spec":[{"type":"text","text":"Performs a long tap on the widget defined by `selector`."}],"required":true,"comment":"Performs a long tap on the widget defined by `selector`.","async":true,"alias":"longTap","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"AndroidSelector","expression":"[AndroidSelector]"},"spec":[{"type":"text","text":"Selector to tap on."}],"required":true,"comment":"Selector to tap on.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by↵using the [`method: AndroidDevice.setDefaultTimeout`] method."}],"required":false,"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed\nby using the [`method: AndroidDevice.setDefaultTimeout`] method.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"model","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Device model."}],"required":true,"comment":"Device model.","async":false,"alias":"model","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.9","name":"open","type":{"name":"AndroidSocket","expression":"[AndroidSocket]"},"spec":[{"type":"text","text":"Launches a process in the shell on the device and returns a socket to communicate with the launched process."}],"required":true,"comment":"Launches a process in the shell on the device and returns a socket to communicate with the launched process.","async":true,"alias":"open","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"command","type":{"name":"string","expression":"[string]"},"spec":[],"required":true,"comment":"","async":false,"alias":"command","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"pinchClose","type":{"name":"void"},"spec":[{"type":"text","text":"Pinches the widget defined by `selector` in the closing direction."}],"required":true,"comment":"Pinches the widget defined by `selector` in the closing direction.","async":true,"alias":"pinchClose","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"AndroidSelector","expression":"[AndroidSelector]"},"spec":[{"type":"text","text":"Selector to pinch close."}],"required":true,"comment":"Selector to pinch close.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"percent","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"The size of the pinch as a percentage of the widget's size."}],"required":true,"comment":"The size of the pinch as a percentage of the widget's size.","async":false,"alias":"percent","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"speed","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Optional speed of the pinch in pixels per second."}],"required":false,"comment":"Optional speed of the pinch in pixels per second.","async":false,"alias":"speed","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by↵using the [`method: AndroidDevice.setDefaultTimeout`] method."}],"required":false,"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed\nby using the [`method: AndroidDevice.setDefaultTimeout`] method.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"pinchOpen","type":{"name":"void"},"spec":[{"type":"text","text":"Pinches the widget defined by `selector` in the open direction."}],"required":true,"comment":"Pinches the widget defined by `selector` in the open direction.","async":true,"alias":"pinchOpen","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"AndroidSelector","expression":"[AndroidSelector]"},"spec":[{"type":"text","text":"Selector to pinch open."}],"required":true,"comment":"Selector to pinch open.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"percent","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"The size of the pinch as a percentage of the widget's size."}],"required":true,"comment":"The size of the pinch as a percentage of the widget's size.","async":false,"alias":"percent","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"speed","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Optional speed of the pinch in pixels per second."}],"required":false,"comment":"Optional speed of the pinch in pixels per second.","async":false,"alias":"speed","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by↵using the [`method: AndroidDevice.setDefaultTimeout`] method."}],"required":false,"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed\nby using the [`method: AndroidDevice.setDefaultTimeout`] method.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"press","type":{"name":"void"},"spec":[{"type":"text","text":"Presses the specific `key` in the widget defined by `selector`."}],"required":true,"comment":"Presses the specific `key` in the widget defined by `selector`.","async":true,"alias":"press","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"AndroidSelector","expression":"[AndroidSelector]"},"spec":[{"type":"text","text":"Selector to press the key in."}],"required":true,"comment":"Selector to press the key in.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"key","type":{"name":"AndroidKey","expression":"[AndroidKey]"},"spec":[{"type":"text","text":"The key to press."}],"required":true,"comment":"The key to press.","async":false,"alias":"key","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by↵using the [`method: AndroidDevice.setDefaultTimeout`] method."}],"required":false,"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed\nby using the [`method: AndroidDevice.setDefaultTimeout`] method.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"push","type":{"name":"void"},"spec":[{"type":"text","text":"Copies a file to the device."}],"required":true,"comment":"Copies a file to the device.","async":true,"alias":"push","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"file","type":{"name":"","union":[{"name":"string"},{"name":"Buffer"}],"expression":"[string]|[Buffer]"},"spec":[{"type":"text","text":"Either a path to the file, or file content."}],"required":true,"comment":"Either a path to the file, or file content.","async":false,"alias":"file","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"path","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Path to the file on the device."}],"required":true,"comment":"Path to the file on the device.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"mode","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Optional file mode, defaults to `644` (`rw-r--r--`)."}],"required":false,"comment":"Optional file mode, defaults to `644` (`rw-r--r--`).","async":false,"alias":"mode","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"screenshot","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"Returns the buffer with the captured screenshot of the device."}],"required":true,"comment":"Returns the buffer with the captured screenshot of the device.","async":true,"alias":"screenshot","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"The file path to save the image to. If `path` is a↵relative path, then it is resolved relative to the current working directory. If no path is provided, the image won't be↵saved to the disk."}],"required":false,"comment":"The file path to save the image to. If `path` is a relative path, then it is resolved relative to the current\nworking directory. If no path is provided, the image won't be saved to the disk.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"scroll","type":{"name":"void"},"spec":[{"type":"text","text":"Scrolls the widget defined by `selector` in the specified `direction`."}],"required":true,"comment":"Scrolls the widget defined by `selector` in the specified `direction`.","async":true,"alias":"scroll","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"AndroidSelector","expression":"[AndroidSelector]"},"spec":[{"type":"text","text":"Selector to scroll."}],"required":true,"comment":"Selector to scroll.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"direction","type":{"name":"AndroidScrollDirection","union":[{"name":"\"down\""},{"name":"\"up\""},{"name":"\"left\""},{"name":"\"right\""}],"expression":"[AndroidScrollDirection]<\"down\"|\"up\"|\"left\"|\"right\">"},"spec":[{"type":"text","text":"Scroll direction."}],"required":true,"comment":"Scroll direction.","async":false,"alias":"direction","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"percent","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Distance to scroll as a percentage of the widget's size."}],"required":true,"comment":"Distance to scroll as a percentage of the widget's size.","async":false,"alias":"percent","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"speed","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Optional speed of the scroll in pixels per second."}],"required":false,"comment":"Optional speed of the scroll in pixels per second.","async":false,"alias":"speed","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by↵using the [`method: AndroidDevice.setDefaultTimeout`] method."}],"required":false,"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed\nby using the [`method: AndroidDevice.setDefaultTimeout`] method.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"serial","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Device serial number."}],"required":true,"comment":"Device serial number.","async":false,"alias":"serial","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.9","name":"setDefaultTimeout","type":{"name":"void"},"spec":[{"type":"text","text":"This setting will change the default maximum time for all the methods accepting `timeout` option."}],"required":true,"comment":"This setting will change the default maximum time for all the methods accepting `timeout` option.","async":false,"alias":"setDefaultTimeout","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds"}],"required":true,"comment":"Maximum time in milliseconds","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"shell","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"Executes a shell command on the device and returns its output."}],"required":true,"comment":"Executes a shell command on the device and returns its output.","async":true,"alias":"shell","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"command","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Shell command to execute."}],"required":true,"comment":"Shell command to execute.","async":false,"alias":"command","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"swipe","type":{"name":"void"},"spec":[{"type":"text","text":"Swipes the widget defined by `selector` in the specified `direction`."}],"required":true,"comment":"Swipes the widget defined by `selector` in the specified `direction`.","async":true,"alias":"swipe","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"AndroidSelector","expression":"[AndroidSelector]"},"spec":[{"type":"text","text":"Selector to swipe."}],"required":true,"comment":"Selector to swipe.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"direction","type":{"name":"AndroidSwipeDirection","union":[{"name":"\"down\""},{"name":"\"up\""},{"name":"\"left\""},{"name":"\"right\""}],"expression":"[AndroidSwipeDirection]<\"down\"|\"up\"|\"left\"|\"right\">"},"spec":[{"type":"text","text":"Swipe direction."}],"required":true,"comment":"Swipe direction.","async":false,"alias":"direction","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"percent","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Distance to swipe as a percentage of the widget's size."}],"required":true,"comment":"Distance to swipe as a percentage of the widget's size.","async":false,"alias":"percent","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"speed","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Optional speed of the swipe in pixels per second."}],"required":false,"comment":"Optional speed of the swipe in pixels per second.","async":false,"alias":"speed","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by↵using the [`method: AndroidDevice.setDefaultTimeout`] method."}],"required":false,"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed\nby using the [`method: AndroidDevice.setDefaultTimeout`] method.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"tap","type":{"name":"void"},"spec":[{"type":"text","text":"Taps on the widget defined by `selector`."}],"required":true,"comment":"Taps on the widget defined by `selector`.","async":true,"alias":"tap","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"AndroidSelector","expression":"[AndroidSelector]"},"spec":[{"type":"text","text":"Selector to tap on."}],"required":true,"comment":"Selector to tap on.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"duration","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Optional duration of the tap in milliseconds."}],"required":false,"comment":"Optional duration of the tap in milliseconds.","async":false,"alias":"duration","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by↵using the [`method: AndroidDevice.setDefaultTimeout`] method."}],"required":false,"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed\nby using the [`method: AndroidDevice.setDefaultTimeout`] method.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"wait","type":{"name":"void"},"spec":[{"type":"text","text":"Waits for the specific `selector` to either appear or disappear, depending on the `state`."}],"required":true,"comment":"Waits for the specific `selector` to either appear or disappear, depending on the `state`.","async":true,"alias":"wait","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"AndroidSelector","expression":"[AndroidSelector]"},"spec":[{"type":"text","text":"Selector to wait for."}],"required":true,"comment":"Selector to wait for.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"state","type":{"name":"AndroidDeviceState","union":[{"name":"\"gone\""}],"expression":"[AndroidDeviceState]<\"gone\">"},"spec":[{"type":"text","text":"Optional state. Can be either:"},{"type":"li","text":"default - wait for element to be present.","liType":"bullet"},{"type":"li","text":"`'gone'` - wait for element to not be present.","liType":"bullet"}],"required":false,"comment":"Optional state. Can be either:\n- default - wait for element to be present.\n- `'gone'` - wait for element to not be present.","async":false,"alias":"state","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by↵using the [`method: AndroidDevice.setDefaultTimeout`] method."}],"required":false,"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed\nby using the [`method: AndroidDevice.setDefaultTimeout`] method.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"waitForEvent","type":{"name":"any","expression":"[any]"},"spec":[{"type":"text","text":"Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy value."}],"required":true,"comment":"Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy\nvalue.","async":true,"alias":"waitForEvent","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["js","python","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"event","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Event name, same one typically passed into `*.on(event)`."}],"required":true,"comment":"Event name, same one typically passed into `*.on(event)`.","async":false,"alias":"event","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"optionsOrPredicate","type":{"name":"","union":[{"name":"function"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"predicate","type":{"name":"function","expression":"[function]"},"spec":[{"type":"text","text":"receives the event data and resolves to truthy value when the waiting should resolve."}],"required":true,"comment":"receives the event data and resolves to truthy value when the waiting should resolve.","async":false,"alias":"predicate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to↵disable timeout. The default value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`]."}],"required":false,"comment":"maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: AndroidDevice.setDefaultTimeout`].","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]}],"expression":"[function]|[Object]"},"spec":[{"type":"text","text":"Either a predicate that receives an event or an options object. Optional."}],"required":false,"comment":"Either a predicate that receives an event or an options object. Optional.","async":false,"alias":"optionsOrPredicate","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"webView","type":{"name":"AndroidWebView","expression":"[AndroidWebView]"},"spec":[{"type":"text","text":"This method waits until `AndroidWebView` matching the `selector` is opened and returns it. If there is already an open `AndroidWebView` matching the `selector`, returns immediately."}],"required":true,"comment":"This method waits until `AndroidWebView` matching the `selector` is opened and returns it. If there is already an\nopen `AndroidWebView` matching the `selector`, returns immediately.","async":true,"alias":"webView","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"pkg","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional Package identifier."}],"required":false,"comment":"Optional Package identifier.","async":false,"alias":"pkg","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"socketName","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional webview socket name."}],"required":false,"comment":"Optional webview socket name.","async":false,"alias":"socketName","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[],"required":true,"comment":"","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by↵using the [`method: AndroidDevice.setDefaultTimeout`] method."}],"required":false,"comment":"Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed\nby using the [`method: AndroidDevice.setDefaultTimeout`] method.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"webViews","type":{"name":"Array","templates":[{"name":"AndroidWebView"}],"expression":"[Array]<[AndroidWebView]>"},"spec":[{"type":"text","text":"Currently open WebViews."}],"required":true,"comment":"Currently open WebViews.","async":false,"alias":"webViews","overloadIndex":0,"paramOrOption":null,"args":[]}]},{"name":"AndroidInput","spec":[],"langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","members":[{"kind":"method","langs":{},"since":"v1.9","name":"drag","type":{"name":"void"},"spec":[{"type":"text","text":"Performs a drag between `from` and `to` points."}],"required":true,"comment":"Performs a drag between `from` and `to` points.","async":true,"alias":"drag","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"from","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"The start point of the drag."}],"required":true,"comment":"The start point of the drag.","async":false,"alias":"from","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"to","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"The end point of the drag."}],"required":true,"comment":"The end point of the drag.","async":false,"alias":"to","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"steps","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"The number of steps in the drag. Each step takes 5 milliseconds to complete."}],"required":true,"comment":"The number of steps in the drag. Each step takes 5 milliseconds to complete.","async":false,"alias":"steps","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"press","type":{"name":"void"},"spec":[{"type":"text","text":"Presses the `key`."}],"required":true,"comment":"Presses the `key`.","async":true,"alias":"press","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"key","type":{"name":"AndroidKey","expression":"[AndroidKey]"},"spec":[{"type":"text","text":"Key to press."}],"required":true,"comment":"Key to press.","async":false,"alias":"key","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"swipe","type":{"name":"void"},"spec":[{"type":"text","text":"Swipes following the path defined by `segments`."}],"required":true,"comment":"Swipes following the path defined by `segments`.","async":true,"alias":"swipe","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"from","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"The point to start swiping from."}],"required":true,"comment":"The point to start swiping from.","async":false,"alias":"from","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"segments","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":"Points following the `from` point in the swipe gesture."}],"required":true,"comment":"Points following the `from` point in the swipe gesture.","async":false,"alias":"segments","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"steps","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"The number of steps for each segment. Each step takes 5 milliseconds to complete, so 100 steps means half a second per each segment."}],"required":true,"comment":"The number of steps for each segment. Each step takes 5 milliseconds to complete, so 100 steps means half a second\nper each segment.","async":false,"alias":"steps","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"tap","type":{"name":"void"},"spec":[{"type":"text","text":"Taps at the specified `point`."}],"required":true,"comment":"Taps at the specified `point`.","async":true,"alias":"tap","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"point","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"The point to tap at."}],"required":true,"comment":"The point to tap at.","async":false,"alias":"point","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"type","type":{"name":"void"},"spec":[{"type":"text","text":"Types `text` into currently focused widget."}],"required":true,"comment":"Types `text` into currently focused widget.","async":true,"alias":"type","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"text","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Text to type."}],"required":true,"comment":"Text to type.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null}]}]},{"name":"AndroidSocket","spec":[{"type":"text","text":"`AndroidSocket` is a way to communicate with a process launched on the `AndroidDevice`. Use [`method: AndroidDevice.open`] to open a socket."}],"langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"comment":"`AndroidSocket` is a way to communicate with a process launched on the `AndroidDevice`. Use\n[`method: AndroidDevice.open`] to open a socket.","since":"v1.9","members":[{"kind":"event","langs":{},"since":"v1.9","name":"close","type":{"name":"void"},"spec":[{"type":"text","text":"Emitted when the socket is closed."}],"required":true,"comment":"Emitted when the socket is closed.","async":false,"alias":"close","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.9","name":"data","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"Emitted when data is available to read from the socket."}],"required":true,"comment":"Emitted when data is available to read from the socket.","async":false,"alias":"data","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.9","name":"close","type":{"name":"void"},"spec":[{"type":"text","text":"Closes the socket."}],"required":true,"comment":"Closes the socket.","async":true,"alias":"close","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.9","name":"write","type":{"name":"void"},"spec":[{"type":"text","text":"Writes some `data` to the socket."}],"required":true,"comment":"Writes some `data` to the socket.","async":true,"alias":"write","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"data","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"Data to write."}],"required":true,"comment":"Data to write.","async":false,"alias":"data","overloadIndex":0,"paramOrOption":null}]}]},{"name":"AndroidWebView","spec":[{"type":"text","text":"`AndroidWebView` represents a WebView open on the `AndroidDevice`. WebView is usually obtained using [`method: AndroidDevice.webView`]."}],"langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"comment":"`AndroidWebView` represents a WebView open on the `AndroidDevice`. WebView is usually obtained using\n[`method: AndroidDevice.webView`].","since":"v1.9","members":[{"kind":"event","langs":{},"since":"v1.9","name":"close","type":{"name":"void"},"spec":[{"type":"text","text":"Emitted when the WebView is closed."}],"required":true,"comment":"Emitted when the WebView is closed.","async":false,"alias":"close","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.9","name":"page","type":{"name":"Page","expression":"[Page]"},"spec":[{"type":"text","text":"Connects to the WebView and returns a regular Playwright `Page` to interact with."}],"required":true,"comment":"Connects to the WebView and returns a regular Playwright `Page` to interact with.","async":true,"alias":"page","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.9","name":"pid","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"WebView process PID."}],"required":true,"comment":"WebView process PID.","async":false,"alias":"pid","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.9","name":"pkg","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"WebView package identifier."}],"required":true,"comment":"WebView package identifier.","async":false,"alias":"pkg","overloadIndex":0,"paramOrOption":null,"args":[]}]},{"name":"APIRequest","spec":[{"type":"text","text":"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 [`property: Playwright.request`]. For more information↵see `APIRequestContext`."}],"langs":{},"comment":"Exposes API that can be used for the Web API testing. This class is used for creating `APIRequestContext` instance\nwhich in turn can be used for sending web requests. An instance of this class can be obtained via\n[`property: Playwright.request`]. For more information see `APIRequestContext`.","since":"v1.16","members":[{"kind":"method","langs":{},"since":"v1.16","name":"newContext","type":{"name":"APIRequestContext","expression":"[APIRequestContext]"},"spec":[{"type":"text","text":"Creates new instances of `APIRequestContext`."}],"required":true,"comment":"Creates new instances of `APIRequestContext`.","async":true,"alias":"newContext","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"baseURL","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Methods like [`method: APIRequestContext.get`] take the base URL into consideration by using the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL. Examples:"},{"type":"li","text":"baseURL: `http://localhost:3000` and sending request to `/bar.html` results in `http://localhost:3000/bar.html`","liType":"bullet"},{"type":"li","text":"baseURL: `http://localhost:3000/foo/` and sending request to `./bar.html` results in `http://localhost:3000/foo/bar.html`","liType":"bullet"},{"type":"li","text":"baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in `http://localhost:3000/bar.html`","liType":"bullet"}],"required":false,"comment":"Methods like [`method: APIRequestContext.get`] take the base URL into consideration by using the\n[`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL.\nExamples:\n- baseURL: `http://localhost:3000` and sending request to `/bar.html` results in `http://localhost:3000/bar.html`\n- baseURL: `http://localhost:3000/foo/` and sending request to `./bar.html` results in\n `http://localhost:3000/foo/bar.html`\n- baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in\n `http://localhost:3000/bar.html`","async":false,"alias":"baseURL","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.16","name":"extraHTTPHeaders","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"An object containing additional HTTP headers to be sent with every request. Defaults to none."}],"required":false,"comment":"An object containing additional HTTP headers to be sent with every request. Defaults to none.","async":false,"alias":"extraHTTPHeaders","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.16","name":"httpCredentials","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"username","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"username","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"password","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"password","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"origin","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Restrain sending http credentials on specific origin (scheme://host:port)."}],"required":false,"comment":"Restrain sending http credentials on specific origin (scheme://host:port).","async":false,"alias":"origin","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"send","type":{"name":"HttpCredentialsSend","union":[{"name":"\"unauthorized\""},{"name":"\"always\""}],"expression":"[HttpCredentialsSend]<\"unauthorized\"|\"always\">"},"spec":[{"type":"text","text":"This option only applies to the requests sent from corresponding `APIRequestContext` and does not affect requests sent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with `WWW-Authenticate` header is received. Defaults to `'unauthorized'`."}],"required":false,"comment":"This option only applies to the requests sent from corresponding `APIRequestContext` and does not affect requests\nsent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with\nthe each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with\n`WWW-Authenticate` header is received. Defaults to `'unauthorized'`.","async":false,"alias":"send","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).↵If no origin is specified, the username and password are sent to any servers upon unauthorized responses."}],"required":false,"comment":"Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no\norigin is specified, the username and password are sent to any servers upon unauthorized responses.","async":false,"alias":"httpCredentials","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.16","name":"ignoreHTTPSErrors","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to ignore HTTPS errors when sending network requests. Defaults to `false`."}],"required":false,"comment":"Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.","async":false,"alias":"ignoreHTTPSErrors","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.16","name":"proxy","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"server","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example↵`http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP↵proxy."}],"required":true,"comment":"Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or\n`socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.","async":false,"alias":"server","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"bypass","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org,↵.domain.com\"`."}],"required":false,"comment":"Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.","async":false,"alias":"bypass","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"username","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional username to use if HTTP proxy requires authentication."}],"required":false,"comment":"Optional username to use if HTTP proxy requires authentication.","async":false,"alias":"username","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"password","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional password to use if HTTP proxy requires authentication."}],"required":false,"comment":"Optional password to use if HTTP proxy requires authentication.","async":false,"alias":"password","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Network proxy settings."}],"required":false,"comment":"Network proxy settings.","async":false,"alias":"proxy","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"storageState","type":{"name":"","union":[{"name":"path"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"cookies","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"domain","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"domain","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"path","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"expires","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Unix time in seconds."}],"required":true,"comment":"Unix time in seconds.","async":false,"alias":"expires","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"httpOnly","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"httpOnly","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"secure","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"secure","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"sameSite","type":{"name":"SameSiteAttribute","union":[{"name":"\"Strict\""},{"name":"\"Lax\""},{"name":"\"None\""}],"expression":"[SameSiteAttribute]<\"Strict\"|\"Lax\"|\"None\">"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"sameSite","overloadIndex":0,"paramOrOption":null}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"cookies","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"origins","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"origin","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"origin","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"localStorage","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"localStorage","overloadIndex":0,"paramOrOption":null}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"origins","overloadIndex":0,"paramOrOption":null}]}],"expression":"[path]|[Object]"},"spec":[{"type":"text","text":"Populates context with given storage state. This option can be used to initialize context with logged-in information↵obtained via [`method: BrowserContext.storageState`] or [`method: APIRequestContext.storageState`]. Either a path to the↵file with saved storage, or the value returned by one of [`method: BrowserContext.storageState`] or↵[`method: APIRequestContext.storageState`] methods."}],"required":false,"comment":"Populates context with given storage state. This option can be used to initialize context with logged-in\ninformation obtained via [`method: BrowserContext.storageState`] or [`method: APIRequestContext.storageState`].\nEither a path to the file with saved storage, or the value returned by one of\n[`method: BrowserContext.storageState`] or [`method: APIRequestContext.storageState`] methods.","async":false,"alias":"storageState","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"storageState","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Populates context with given storage state. This option can be used to initialize context with logged-in information↵obtained via [`method: BrowserContext.storageState`] or [`method: APIRequestContext.storageState`]. Either a path to the↵file with saved storage, or the value returned by one of [`method: BrowserContext.storageState`] or↵[`method: APIRequestContext.storageState`] methods."}],"required":false,"comment":"Populates context with given storage state. This option can be used to initialize context with logged-in\ninformation obtained via [`method: BrowserContext.storageState`] or [`method: APIRequestContext.storageState`].\nEither a path to the file with saved storage, or the value returned by one of\n[`method: BrowserContext.storageState`] or [`method: APIRequestContext.storageState`] methods.","async":false,"alias":"storageState","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"storageStatePath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Populates context with given storage state. This option can be used to initialize context with logged-in information↵obtained via [`method: BrowserContext.storageState`]. Path to the file with saved storage state."}],"required":false,"comment":"Populates context with given storage state. This option can be used to initialize context with logged-in\ninformation obtained via [`method: BrowserContext.storageState`]. Path to the file with saved storage state.","async":false,"alias":"storageStatePath","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.16","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds to wait for the response. Defaults to↵`30000` (30 seconds). Pass `0` to disable timeout."}],"required":false,"comment":"Maximum time in milliseconds to wait for the response. Defaults to `30000` (30 seconds). Pass `0` to disable\ntimeout.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.16","name":"userAgent","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Specific user agent to use in this context."}],"required":false,"comment":"Specific user agent to use in this context.","async":false,"alias":"userAgent","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]}]},{"name":"APIRequestContext","spec":[{"type":"text","text":"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."},{"type":"text","text":"Each Playwright browser context has associated with it `APIRequestContext` instance which shares cookie storage with↵the browser context and can be accessed via [`property: BrowserContext.request`] or [`property: Page.request`].↵It is also possible to create a new APIRequestContext instance manually by calling [`method: APIRequest.newContext`]."},{"type":"text","text":"**Cookie management**"},{"type":"text","text":"`APIRequestContext` returned by [`property: BrowserContext.request`] and [`property: Page.request`] shares cookie↵storage with the corresponding `BrowserContext`. Each API request will have `Cookie` header populated with the↵values from the browser context. If the API response contains `Set-Cookie` header it will automatically update↵`BrowserContext` cookies and requests made from the page will pick them up. This means that if you log in using↵this API, your e2e test will be logged in and vice versa."},{"type":"text","text":"If you want API requests to not interfere with the browser cookies you should create a new `APIRequestContext` by↵calling [`method: APIRequest.newContext`]. Such `APIRequestContext` object will have its own isolated cookie↵storage."},{"type":"code","lines":["import os","import asyncio","from playwright.async_api import async_playwright, Playwright","","REPO = \"test-repo-1\"","USER = \"github-username\"","API_TOKEN = os.getenv(\"GITHUB_API_TOKEN\")","","async def run(playwright: Playwright):"," # This will launch a new browser, create a context and page. When making HTTP"," # requests with the internal APIRequestContext (e.g. `context.request` or `page.request`)"," # it will automatically set the cookies to the browser page and vice versa."," browser = await playwright.chromium.launch()"," context = await browser.new_context(base_url=\"https://api.github.com\")"," api_request_context = context.request"," page = await context.new_page()",""," # Alternatively you can create a APIRequestContext manually without having a browser context attached:"," # api_request_context = await playwright.request.new_context(base_url=\"https://api.github.com\")",""," # Create a repository."," response = await api_request_context.post("," \"/user/repos\","," headers={"," \"Accept\": \"application/vnd.github.v3+json\","," # Add GitHub personal access token."," \"Authorization\": f\"token {API_TOKEN}\","," },"," data={\"name\": REPO},"," )"," assert response.ok"," assert response.json()[\"name\"] == REPO",""," # Delete a repository."," response = await api_request_context.delete("," f\"/repos/{USER}/{REPO}\","," headers={"," \"Accept\": \"application/vnd.github.v3+json\","," # Add GitHub personal access token."," \"Authorization\": f\"token {API_TOKEN}\","," },"," )"," assert response.ok"," assert await response.body() == '{\"status\": \"ok\"}'","","async def main():"," async with async_playwright() as playwright:"," await run(playwright)","","asyncio.run(main())"],"codeLang":"python async"},{"type":"code","lines":["import os","from playwright.sync_api import sync_playwright","","REPO = \"test-repo-1\"","USER = \"github-username\"","API_TOKEN = os.getenv(\"GITHUB_API_TOKEN\")","","with sync_playwright() as p:"," # This will launch a new browser, create a context and page. When making HTTP"," # requests with the internal APIRequestContext (e.g. `context.request` or `page.request`)"," # it will automatically set the cookies to the browser page and vice versa."," browser = p.chromium.launch()"," context = browser.new_context(base_url=\"https://api.github.com\")"," api_request_context = context.request"," page = context.new_page()",""," # Alternatively you can create a APIRequestContext manually without having a browser context attached:"," # api_request_context = p.request.new_context(base_url=\"https://api.github.com\")","",""," # Create a repository."," response = api_request_context.post("," \"/user/repos\","," headers={"," \"Accept\": \"application/vnd.github.v3+json\","," # Add GitHub personal access token."," \"Authorization\": f\"token {API_TOKEN}\","," },"," data={\"name\": REPO},"," )"," assert response.ok"," assert response.json()[\"name\"] == REPO",""," # Delete a repository."," response = api_request_context.delete("," f\"/repos/{USER}/{REPO}\","," headers={"," \"Accept\": \"application/vnd.github.v3+json\","," # Add GitHub personal access token."," \"Authorization\": f\"token {API_TOKEN}\","," },"," )"," assert response.ok"," assert await response.body() == '{\"status\": \"ok\"}'"],"codeLang":"python sync"}],"langs":{},"comment":"This API is used for the Web API testing. You can use it to trigger API endpoints, configure micro-services,\nprepare environment or the service to your e2e test.\n\nEach Playwright browser context has associated with it `APIRequestContext` instance which shares cookie storage\nwith the browser context and can be accessed via [`property: BrowserContext.request`] or\n[`property: Page.request`]. It is also possible to create a new APIRequestContext instance manually by calling\n[`method: APIRequest.newContext`].\n\n**Cookie management**\n\n`APIRequestContext` returned by [`property: BrowserContext.request`] and [`property: Page.request`] shares cookie\nstorage with the corresponding `BrowserContext`. Each API request will have `Cookie` header populated with the\nvalues from the browser context. If the API response contains `Set-Cookie` header it will automatically update\n`BrowserContext` cookies and requests made from the page will pick them up. This means that if you log in using\nthis API, your e2e test will be logged in and vice versa.\n\nIf you want API requests to not interfere with the browser cookies you should create a new `APIRequestContext` by\ncalling [`method: APIRequest.newContext`]. Such `APIRequestContext` object will have its own isolated cookie\nstorage.\n\n```py\nimport os\nimport asyncio\nfrom playwright.async_api import async_playwright, Playwright\n\nREPO = \"test-repo-1\"\nUSER = \"github-username\"\nAPI_TOKEN = os.getenv(\"GITHUB_API_TOKEN\")\n\nasync def run(playwright: Playwright):\n # This will launch a new browser, create a context and page. When making HTTP\n # requests with the internal APIRequestContext (e.g. `context.request` or `page.request`)\n # it will automatically set the cookies to the browser page and vice versa.\n browser = await playwright.chromium.launch()\n context = await browser.new_context(base_url=\"https://api.github.com\")\n api_request_context = context.request\n page = await context.new_page()\n\n # Alternatively you can create a APIRequestContext manually without having a browser context attached:\n # api_request_context = await playwright.request.new_context(base_url=\"https://api.github.com\")\n\n # Create a repository.\n response = await api_request_context.post(\n \"/user/repos\",\n headers={\n \"Accept\": \"application/vnd.github.v3+json\",\n # Add GitHub personal access token.\n \"Authorization\": f\"token {API_TOKEN}\",\n },\n data={\"name\": REPO},\n )\n assert response.ok\n assert response.json()[\"name\"] == REPO\n\n # Delete a repository.\n response = await api_request_context.delete(\n f\"/repos/{USER}/{REPO}\",\n headers={\n \"Accept\": \"application/vnd.github.v3+json\",\n # Add GitHub personal access token.\n \"Authorization\": f\"token {API_TOKEN}\",\n },\n )\n assert response.ok\n assert await response.body() == '{\"status\": \"ok\"}'\n\nasync def main():\n async with async_playwright() as playwright:\n await run(playwright)\n\nasyncio.run(main())\n```\n\n```py\nimport os\nfrom playwright.sync_api import sync_playwright\n\nREPO = \"test-repo-1\"\nUSER = \"github-username\"\nAPI_TOKEN = os.getenv(\"GITHUB_API_TOKEN\")\n\nwith sync_playwright() as p:\n # This will launch a new browser, create a context and page. When making HTTP\n # requests with the internal APIRequestContext (e.g. `context.request` or `page.request`)\n # it will automatically set the cookies to the browser page and vice versa.\n browser = p.chromium.launch()\n context = browser.new_context(base_url=\"https://api.github.com\")\n api_request_context = context.request\n page = context.new_page()\n\n # Alternatively you can create a APIRequestContext manually without having a browser context attached:\n # api_request_context = p.request.new_context(base_url=\"https://api.github.com\")\n\n\n # Create a repository.\n response = api_request_context.post(\n \"/user/repos\",\n headers={\n \"Accept\": \"application/vnd.github.v3+json\",\n # Add GitHub personal access token.\n \"Authorization\": f\"token {API_TOKEN}\",\n },\n data={\"name\": REPO},\n )\n assert response.ok\n assert response.json()[\"name\"] == REPO\n\n # Delete a repository.\n response = api_request_context.delete(\n f\"/repos/{USER}/{REPO}\",\n headers={\n \"Accept\": \"application/vnd.github.v3+json\",\n # Add GitHub personal access token.\n \"Authorization\": f\"token {API_TOKEN}\",\n },\n )\n assert response.ok\n assert await response.body() == '{\"status\": \"ok\"}'\n```\n","since":"v1.16","members":[{"kind":"method","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"createFormData","type":{"name":"FormData","expression":"[FormData]"},"spec":[{"type":"text","text":"Creates a new `FormData` instance which is used for providing form and multipart data when making HTTP requests."}],"required":true,"comment":"Creates a new `FormData` instance which is used for providing form and multipart data when making HTTP requests.","async":false,"alias":"createFormData","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.16","name":"delete","type":{"name":"APIResponse","expression":"[APIResponse]"},"spec":[{"type":"text","text":"Sends HTTP(S) [DELETE](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/DELETE) request and returns its response.↵The method will populate request cookies from the context and update↵context cookies from the response. The method will automatically follow redirects."}],"required":true,"comment":"Sends HTTP(S) [DELETE](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/DELETE) request and returns its\nresponse. The method will populate request cookies from the context and update context cookies from the response.\nThe method will automatically follow redirects.","async":true,"alias":"delete","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.16","name":"url","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Target URL."}],"required":true,"comment":"Target URL.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"params","type":{"name":"RequestOptions","expression":"[RequestOptions]"},"spec":[{"type":"text","text":"Optional request parameters."}],"required":false,"comment":"Optional request parameters.","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.17","name":"data","type":{"name":"","union":[{"name":"string"},{"name":"Buffer"},{"name":"Serializable"}],"expression":"[string]|[Buffer]|[Serializable]"},"spec":[{"type":"text","text":"Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string↵and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will be↵set to `application/octet-stream` if not explicitly set."}],"required":false,"comment":"Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string\nand `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`\nheader will be set to `application/octet-stream` if not explicitly set.","async":false,"alias":"data","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"failOnStatusCode","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to throw on response codes other than 2xx and 3xx. By default response object is returned↵for all status codes."}],"required":false,"comment":"Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status\ncodes.","async":false,"alias":"failOnStatusCode","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.17","name":"form","type":{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}],"expression":"[Object]<[string], [string]|[float]|[boolean]>"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided."}],"required":false,"comment":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.","async":false,"alias":"form","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.17","name":"form","type":{"name":"FormData","expression":"[FormData]"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided."},{"type":"text","text":"An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]."}],"required":false,"comment":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].","async":false,"alias":"form","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"headers","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by it."}],"required":false,"comment":"Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by\nit.","async":false,"alias":"headers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"ignoreHTTPSErrors","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to ignore HTTPS errors when sending network requests. Defaults to `false`."}],"required":false,"comment":"Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.","async":false,"alias":"ignoreHTTPSErrors","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.26","name":"maxRedirects","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is exceeded.↵Defaults to `20`. Pass `0` to not follow redirects."}],"required":false,"comment":"Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is\nexceeded. Defaults to `20`. Pass `0` to not follow redirects.","async":false,"alias":"maxRedirects","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.17","name":"multipart","type":{"name":"","union":[{"name":"FormData"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]}]}]}],"expression":"[FormData]|[Object]<[string], [string]|[float]|[boolean]|[ReadStream]|[Object]>"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)↵or as file-like object containing file name, mime-type and its content."}],"required":false,"comment":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed either as\n[`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file\nname, mime-type and its content.","async":false,"alias":"multipart","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.17","name":"multipart","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]}]}],"expression":"[Object]<[string], [string]|[float]|[boolean]|[ReadStream]|[Object]>"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed as file-like object containing file name, mime-type and its content."}],"required":false,"comment":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed as file-like object containing file name, mime-type and its content.","async":false,"alias":"multipart","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.17","name":"multipart","type":{"name":"FormData","expression":"[FormData]"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed as file-like object containing file name, mime-type and its content."},{"type":"text","text":"An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]."}],"required":false,"comment":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed as file-like object containing file name, mime-type and its content.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].","async":false,"alias":"multipart","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}],"expression":"[Object]<[string], [string]|[float]|[boolean]>"},"spec":[{"type":"text","text":"Query parameters to be sent with the URL."}],"required":false,"comment":"Query parameters to be sent with the URL.","async":false,"alias":"params","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"Object","templates":[{"name":"string"},{"name":"Serializable"}],"expression":"[Object]<[string], [Serializable]>"},"spec":[{"type":"text","text":"Query parameters to be sent with the URL."}],"required":false,"comment":"Query parameters to be sent with the URL.","async":false,"alias":"params","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout."}],"required":false,"comment":"Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.16","name":"dispose","type":{"name":"void"},"spec":[{"type":"text","text":"All responses returned by [`method: APIRequestContext.get`] and similar methods are stored in the memory, so that you can later call [`method: APIResponse.body`].This method discards all its resources, calling any method on disposed `APIRequestContext` will throw an exception."}],"required":true,"comment":"All responses returned by [`method: APIRequestContext.get`] and similar methods are stored in the memory, so that\nyou can later call [`method: APIResponse.body`].This method discards all its resources, calling any method on\ndisposed `APIRequestContext` will throw an exception.","async":true,"alias":"dispose","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.45","name":"reason","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"The reason to be reported to the operations interrupted by the context disposal."}],"required":false,"comment":"The reason to be reported to the operations interrupted by the context disposal.","async":false,"alias":"reason","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.16","name":"fetch","type":{"name":"APIResponse","expression":"[APIResponse]"},"spec":[{"type":"text","text":"Sends HTTP(S) request and returns its response. The method will populate request cookies from the context and update↵context cookies from the response. The method will automatically follow redirects."},{"type":"text","text":"**Usage**"},{"type":"text","text":"JSON objects can be passed directly to the request:"},{"type":"code","lines":["await request.fetch('https://example.com/api/createBook', {"," method: 'post',"," data: {"," title: 'Book Title',"," author: 'John Doe',"," }","});"],"codeLang":"js"},{"type":"code","lines":["Map<String, Object> data = new HashMap();","data.put(\"title\", \"Book Title\");","data.put(\"body\", \"John Doe\");","request.fetch(\"https://example.com/api/createBook\", RequestOptions.create().setMethod(\"post\").setData(data));"],"codeLang":"java"},{"type":"code","lines":["data = {"," \"title\": \"Book Title\","," \"body\": \"John Doe\",","}","api_request_context.fetch(\"https://example.com/api/createBook\", method=\"post\", data=data)"],"codeLang":"python"},{"type":"code","lines":["var data = new Dictionary<string, object>() {"," { \"title\", \"Book Title\" },"," { \"body\", \"John Doe\" }","};","await Request.FetchAsync(\"https://example.com/api/createBook\", new() { Method = \"post\", DataObject = data });"],"codeLang":"csharp"},{"type":"text","text":"The common way to send file(s) in the body of a request is to upload them as form fields with `multipart/form-data` encoding. Use `FormData` to construct request body and pass it to the request as `multipart` parameter:"},{"type":"code","lines":["const form = new FormData();","form.set('name', 'John');","form.append('name', 'Doe');","// Send two file fields with the same name.","form.append('file', new File(['console.log(2024);'], 'f1.js', { type: 'text/javascript' }));","form.append('file', new File(['hello'], 'f2.txt', { type: 'text/plain' }));","await request.fetch('https://example.com/api/uploadForm', {"," multipart: form","});"],"codeLang":"js"},{"type":"code","lines":["// Pass file path to the form data constructor:","Path file = Paths.get(\"team.csv\");","APIResponse response = request.fetch(\"https://example.com/api/uploadTeamList\","," RequestOptions.create().setMethod(\"post\").setMultipart("," FormData.create().set(\"fileField\", file)));","","// Or you can pass the file content directly as FilePayload object:","FilePayload filePayload = new FilePayload(\"f.js\", \"text/javascript\","," \"console.log(2022);\".getBytes(StandardCharsets.UTF_8));","APIResponse response = request.fetch(\"https://example.com/api/uploadScript\","," RequestOptions.create().setMethod(\"post\").setMultipart("," FormData.create().set(\"fileField\", filePayload)));"],"codeLang":"java"},{"type":"code","lines":["api_request_context.fetch("," \"https://example.com/api/uploadScript\", method=\"post\","," multipart={"," \"fileField\": {"," \"name\": \"f.js\","," \"mimeType\": \"text/javascript\","," \"buffer\": b\"console.log(2022);\","," },"," })"],"codeLang":"python"},{"type":"code","lines":["var file = new FilePayload()","{"," Name = \"f.js\","," MimeType = \"text/javascript\","," Buffer = System.Text.Encoding.UTF8.GetBytes(\"console.log(2022);\")","};","var multipart = Context.APIRequest.CreateFormData();","multipart.Set(\"fileField\", file);","await Request.FetchAsync(\"https://example.com/api/uploadScript\", new() { Method = \"post\", Multipart = multipart });"],"codeLang":"csharp"}],"required":true,"comment":"Sends HTTP(S) request and returns its response. The method will populate request cookies from the context and\nupdate context cookies from the response. The method will automatically follow redirects.\n\n**Usage**\n\nJSON objects can be passed directly to the request:\n\n```js\nawait request.fetch('https://example.com/api/createBook', {\n method: 'post',\n data: {\n title: 'Book Title',\n author: 'John Doe',\n }\n});\n```\n\n```java\nMap<String, Object> data = new HashMap();\ndata.put(\"title\", \"Book Title\");\ndata.put(\"body\", \"John Doe\");\nrequest.fetch(\"https://example.com/api/createBook\", RequestOptions.create().setMethod(\"post\").setData(data));\n```\n\n```python\ndata = {\n \"title\": \"Book Title\",\n \"body\": \"John Doe\",\n}\napi_request_context.fetch(\"https://example.com/api/createBook\", method=\"post\", data=data)\n```\n\n```csharp\nvar data = new Dictionary<string, object>() {\n { \"title\", \"Book Title\" },\n { \"body\", \"John Doe\" }\n};\nawait Request.FetchAsync(\"https://example.com/api/createBook\", new() { Method = \"post\", DataObject = data });\n```\n\nThe common way to send file(s) in the body of a request is to upload them as form fields with `multipart/form-data`\nencoding. Use `FormData` to construct request body and pass it to the request as `multipart` parameter:\n\n```js\nconst form = new FormData();\nform.set('name', 'John');\nform.append('name', 'Doe');\n// Send two file fields with the same name.\nform.append('file', new File(['console.log(2024);'], 'f1.js', { type: 'text/javascript' }));\nform.append('file', new File(['hello'], 'f2.txt', { type: 'text/plain' }));\nawait request.fetch('https://example.com/api/uploadForm', {\n multipart: form\n});\n```\n\n```java\n// Pass file path to the form data constructor:\nPath file = Paths.get(\"team.csv\");\nAPIResponse response = request.fetch(\"https://example.com/api/uploadTeamList\",\n RequestOptions.create().setMethod(\"post\").setMultipart(\n FormData.create().set(\"fileField\", file)));\n\n// Or you can pass the file content directly as FilePayload object:\nFilePayload filePayload = new FilePayload(\"f.js\", \"text/javascript\",\n \"console.log(2022);\".getBytes(StandardCharsets.UTF_8));\nAPIResponse response = request.fetch(\"https://example.com/api/uploadScript\",\n RequestOptions.create().setMethod(\"post\").setMultipart(\n FormData.create().set(\"fileField\", filePayload)));\n```\n\n```python\napi_request_context.fetch(\n \"https://example.com/api/uploadScript\", method=\"post\",\n multipart={\n \"fileField\": {\n \"name\": \"f.js\",\n \"mimeType\": \"text/javascript\",\n \"buffer\": b\"console.log(2022);\",\n },\n })\n```\n\n```csharp\nvar file = new FilePayload()\n{\n Name = \"f.js\",\n MimeType = \"text/javascript\",\n Buffer = System.Text.Encoding.UTF8.GetBytes(\"console.log(2022);\")\n};\nvar multipart = Context.APIRequest.CreateFormData();\nmultipart.Set(\"fileField\", file);\nawait Request.FetchAsync(\"https://example.com/api/uploadScript\", new() { Method = \"post\", Multipart = multipart });\n```\n","async":true,"alias":"fetch","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.16","name":"urlOrRequest","type":{"name":"","union":[{"name":"string"},{"name":"Request"}],"expression":"[string]|[Request]"},"spec":[{"type":"text","text":"Target URL or Request to get all parameters from."}],"required":true,"comment":"Target URL or Request to get all parameters from.","async":false,"alias":"urlOrRequest","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"params","type":{"name":"RequestOptions","expression":"[RequestOptions]"},"spec":[{"type":"text","text":"Optional request parameters."}],"required":false,"comment":"Optional request parameters.","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"data","type":{"name":"","union":[{"name":"string"},{"name":"Buffer"},{"name":"Serializable"}],"expression":"[string]|[Buffer]|[Serializable]"},"spec":[{"type":"text","text":"Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string↵and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will be↵set to `application/octet-stream` if not explicitly set."}],"required":false,"comment":"Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string\nand `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`\nheader will be set to `application/octet-stream` if not explicitly set.","async":false,"alias":"data","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"failOnStatusCode","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to throw on response codes other than 2xx and 3xx. By default response object is returned↵for all status codes."}],"required":false,"comment":"Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status\ncodes.","async":false,"alias":"failOnStatusCode","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"form","type":{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}],"expression":"[Object]<[string], [string]|[float]|[boolean]>"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided."}],"required":false,"comment":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.","async":false,"alias":"form","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"form","type":{"name":"FormData","expression":"[FormData]"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided."},{"type":"text","text":"An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]."}],"required":false,"comment":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].","async":false,"alias":"form","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"headers","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by it."}],"required":false,"comment":"Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by\nit.","async":false,"alias":"headers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"ignoreHTTPSErrors","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to ignore HTTPS errors when sending network requests. Defaults to `false`."}],"required":false,"comment":"Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.","async":false,"alias":"ignoreHTTPSErrors","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.26","name":"maxRedirects","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is exceeded.↵Defaults to `20`. Pass `0` to not follow redirects."}],"required":false,"comment":"Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is\nexceeded. Defaults to `20`. Pass `0` to not follow redirects.","async":false,"alias":"maxRedirects","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"method","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"If set changes the fetch method (e.g. [PUT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT) or↵[POST](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST)). If not specified, GET method is used."}],"required":false,"comment":"If set changes the fetch method (e.g. [PUT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT) or\n[POST](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST)). If not specified, GET method is used.","async":false,"alias":"method","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"multipart","type":{"name":"","union":[{"name":"FormData"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]}]}]}],"expression":"[FormData]|[Object]<[string], [string]|[float]|[boolean]|[ReadStream]|[Object]>"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)↵or as file-like object containing file name, mime-type and its content."}],"required":false,"comment":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed either as\n[`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file\nname, mime-type and its content.","async":false,"alias":"multipart","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"multipart","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]}]}],"expression":"[Object]<[string], [string]|[float]|[boolean]|[ReadStream]|[Object]>"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed as file-like object containing file name, mime-type and its content."}],"required":false,"comment":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed as file-like object containing file name, mime-type and its content.","async":false,"alias":"multipart","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"multipart","type":{"name":"FormData","expression":"[FormData]"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed as file-like object containing file name, mime-type and its content."},{"type":"text","text":"An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]."}],"required":false,"comment":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed as file-like object containing file name, mime-type and its content.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].","async":false,"alias":"multipart","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}],"expression":"[Object]<[string], [string]|[float]|[boolean]>"},"spec":[{"type":"text","text":"Query parameters to be sent with the URL."}],"required":false,"comment":"Query parameters to be sent with the URL.","async":false,"alias":"params","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"Object","templates":[{"name":"string"},{"name":"Serializable"}],"expression":"[Object]<[string], [Serializable]>"},"spec":[{"type":"text","text":"Query parameters to be sent with the URL."}],"required":false,"comment":"Query parameters to be sent with the URL.","async":false,"alias":"params","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout."}],"required":false,"comment":"Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.16","name":"get","type":{"name":"APIResponse","expression":"[APIResponse]"},"spec":[{"type":"text","text":"Sends HTTP(S) [GET](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET) request and returns its response.↵The method will populate request cookies from the context and update↵context cookies from the response. The method will automatically follow redirects."},{"type":"text","text":"**Usage**"},{"type":"text","text":"Request parameters can be configured with `params` option, they will be serialized into the URL search parameters:"},{"type":"code","lines":["await request.get('https://example.com/api/getText', {"," params: {"," 'isbn': '1234',"," 'page': 23,"," }","});"],"codeLang":"js"},{"type":"code","lines":["request.get(\"https://example.com/api/getText\", RequestOptions.create()"," .setQueryParam(\"isbn\", \"1234\")"," .setQueryParam(\"page\", 23));"],"codeLang":"java"},{"type":"code","lines":["query_params = {"," \"isbn\": \"1234\","," \"page\": \"23\"","}","api_request_context.get(\"https://example.com/api/getText\", params=query_params)"],"codeLang":"python"},{"type":"code","lines":["var queryParams = new Dictionary<string, object>()","{"," { \"isbn\", \"1234\" },"," { \"page\", 23 },","};","await request.GetAsync(\"https://example.com/api/getText\", new() { Params = queryParams });"],"codeLang":"csharp"}],"required":true,"comment":"Sends HTTP(S) [GET](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET) request and returns its\nresponse. The method will populate request cookies from the context and update context cookies from the response.\nThe method will automatically follow redirects.\n\n**Usage**\n\nRequest parameters can be configured with `params` option, they will be serialized into the URL search parameters:\n\n```js\nawait request.get('https://example.com/api/getText', {\n params: {\n 'isbn': '1234',\n 'page': 23,\n }\n});\n```\n\n```java\nrequest.get(\"https://example.com/api/getText\", RequestOptions.create()\n .setQueryParam(\"isbn\", \"1234\")\n .setQueryParam(\"page\", 23));\n```\n\n```python\nquery_params = {\n \"isbn\": \"1234\",\n \"page\": \"23\"\n}\napi_request_context.get(\"https://example.com/api/getText\", params=query_params)\n```\n\n```csharp\nvar queryParams = new Dictionary<string, object>()\n{\n { \"isbn\", \"1234\" },\n { \"page\", 23 },\n};\nawait request.GetAsync(\"https://example.com/api/getText\", new() { Params = queryParams });\n```\n","async":true,"alias":"get","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.16","name":"url","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Target URL."}],"required":true,"comment":"Target URL.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"params","type":{"name":"RequestOptions","expression":"[RequestOptions]"},"spec":[{"type":"text","text":"Optional request parameters."}],"required":false,"comment":"Optional request parameters.","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.26","name":"data","type":{"name":"","union":[{"name":"string"},{"name":"Buffer"},{"name":"Serializable"}],"expression":"[string]|[Buffer]|[Serializable]"},"spec":[{"type":"text","text":"Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string↵and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will be↵set to `application/octet-stream` if not explicitly set."}],"required":false,"comment":"Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string\nand `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`\nheader will be set to `application/octet-stream` if not explicitly set.","async":false,"alias":"data","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"failOnStatusCode","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to throw on response codes other than 2xx and 3xx. By default response object is returned↵for all status codes."}],"required":false,"comment":"Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status\ncodes.","async":false,"alias":"failOnStatusCode","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.26","name":"form","type":{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}],"expression":"[Object]<[string], [string]|[float]|[boolean]>"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided."}],"required":false,"comment":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.","async":false,"alias":"form","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.26","name":"form","type":{"name":"FormData","expression":"[FormData]"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided."},{"type":"text","text":"An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]."}],"required":false,"comment":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].","async":false,"alias":"form","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"headers","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by it."}],"required":false,"comment":"Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by\nit.","async":false,"alias":"headers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"ignoreHTTPSErrors","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to ignore HTTPS errors when sending network requests. Defaults to `false`."}],"required":false,"comment":"Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.","async":false,"alias":"ignoreHTTPSErrors","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.26","name":"maxRedirects","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is exceeded.↵Defaults to `20`. Pass `0` to not follow redirects."}],"required":false,"comment":"Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is\nexceeded. Defaults to `20`. Pass `0` to not follow redirects.","async":false,"alias":"maxRedirects","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.26","name":"multipart","type":{"name":"","union":[{"name":"FormData"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]}]}]}],"expression":"[FormData]|[Object]<[string], [string]|[float]|[boolean]|[ReadStream]|[Object]>"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)↵or as file-like object containing file name, mime-type and its content."}],"required":false,"comment":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed either as\n[`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file\nname, mime-type and its content.","async":false,"alias":"multipart","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.26","name":"multipart","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]}]}],"expression":"[Object]<[string], [string]|[float]|[boolean]|[ReadStream]|[Object]>"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed as file-like object containing file name, mime-type and its content."}],"required":false,"comment":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed as file-like object containing file name, mime-type and its content.","async":false,"alias":"multipart","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.26","name":"multipart","type":{"name":"FormData","expression":"[FormData]"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed as file-like object containing file name, mime-type and its content."},{"type":"text","text":"An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]."}],"required":false,"comment":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed as file-like object containing file name, mime-type and its content.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].","async":false,"alias":"multipart","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}],"expression":"[Object]<[string], [string]|[float]|[boolean]>"},"spec":[{"type":"text","text":"Query parameters to be sent with the URL."}],"required":false,"comment":"Query parameters to be sent with the URL.","async":false,"alias":"params","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"Object","templates":[{"name":"string"},{"name":"Serializable"}],"expression":"[Object]<[string], [Serializable]>"},"spec":[{"type":"text","text":"Query parameters to be sent with the URL."}],"required":false,"comment":"Query parameters to be sent with the URL.","async":false,"alias":"params","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout."}],"required":false,"comment":"Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.16","name":"head","type":{"name":"APIResponse","expression":"[APIResponse]"},"spec":[{"type":"text","text":"Sends HTTP(S) [HEAD](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD) request and returns its response.↵The method will populate request cookies from the context and update↵context cookies from the response. The method will automatically follow redirects."}],"required":true,"comment":"Sends HTTP(S) [HEAD](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD) request and returns its\nresponse. The method will populate request cookies from the context and update context cookies from the response.\nThe method will automatically follow redirects.","async":true,"alias":"head","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.16","name":"url","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Target URL."}],"required":true,"comment":"Target URL.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"params","type":{"name":"RequestOptions","expression":"[RequestOptions]"},"spec":[{"type":"text","text":"Optional request parameters."}],"required":false,"comment":"Optional request parameters.","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.26","name":"data","type":{"name":"","union":[{"name":"string"},{"name":"Buffer"},{"name":"Serializable"}],"expression":"[string]|[Buffer]|[Serializable]"},"spec":[{"type":"text","text":"Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string↵and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will be↵set to `application/octet-stream` if not explicitly set."}],"required":false,"comment":"Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string\nand `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`\nheader will be set to `application/octet-stream` if not explicitly set.","async":false,"alias":"data","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"failOnStatusCode","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to throw on response codes other than 2xx and 3xx. By default response object is returned↵for all status codes."}],"required":false,"comment":"Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status\ncodes.","async":false,"alias":"failOnStatusCode","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.26","name":"form","type":{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}],"expression":"[Object]<[string], [string]|[float]|[boolean]>"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided."}],"required":false,"comment":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.","async":false,"alias":"form","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.26","name":"form","type":{"name":"FormData","expression":"[FormData]"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided."},{"type":"text","text":"An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]."}],"required":false,"comment":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].","async":false,"alias":"form","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"headers","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by it."}],"required":false,"comment":"Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by\nit.","async":false,"alias":"headers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"ignoreHTTPSErrors","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to ignore HTTPS errors when sending network requests. Defaults to `false`."}],"required":false,"comment":"Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.","async":false,"alias":"ignoreHTTPSErrors","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.26","name":"maxRedirects","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is exceeded.↵Defaults to `20`. Pass `0` to not follow redirects."}],"required":false,"comment":"Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is\nexceeded. Defaults to `20`. Pass `0` to not follow redirects.","async":false,"alias":"maxRedirects","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.26","name":"multipart","type":{"name":"","union":[{"name":"FormData"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]}]}]}],"expression":"[FormData]|[Object]<[string], [string]|[float]|[boolean]|[ReadStream]|[Object]>"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)↵or as file-like object containing file name, mime-type and its content."}],"required":false,"comment":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed either as\n[`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file\nname, mime-type and its content.","async":false,"alias":"multipart","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.26","name":"multipart","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]}]}],"expression":"[Object]<[string], [string]|[float]|[boolean]|[ReadStream]|[Object]>"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed as file-like object containing file name, mime-type and its content."}],"required":false,"comment":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed as file-like object containing file name, mime-type and its content.","async":false,"alias":"multipart","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.26","name":"multipart","type":{"name":"FormData","expression":"[FormData]"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed as file-like object containing file name, mime-type and its content."},{"type":"text","text":"An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]."}],"required":false,"comment":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed as file-like object containing file name, mime-type and its content.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].","async":false,"alias":"multipart","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}],"expression":"[Object]<[string], [string]|[float]|[boolean]>"},"spec":[{"type":"text","text":"Query parameters to be sent with the URL."}],"required":false,"comment":"Query parameters to be sent with the URL.","async":false,"alias":"params","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"Object","templates":[{"name":"string"},{"name":"Serializable"}],"expression":"[Object]<[string], [Serializable]>"},"spec":[{"type":"text","text":"Query parameters to be sent with the URL."}],"required":false,"comment":"Query parameters to be sent with the URL.","async":false,"alias":"params","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout."}],"required":false,"comment":"Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.16","name":"patch","type":{"name":"APIResponse","expression":"[APIResponse]"},"spec":[{"type":"text","text":"Sends HTTP(S) [PATCH](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PATCH) request and returns its response.↵The method will populate request cookies from the context and update↵context cookies from the response. The method will automatically follow redirects."}],"required":true,"comment":"Sends HTTP(S) [PATCH](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PATCH) request and returns its\nresponse. The method will populate request cookies from the context and update context cookies from the response.\nThe method will automatically follow redirects.","async":true,"alias":"patch","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.16","name":"url","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Target URL."}],"required":true,"comment":"Target URL.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"params","type":{"name":"RequestOptions","expression":"[RequestOptions]"},"spec":[{"type":"text","text":"Optional request parameters."}],"required":false,"comment":"Optional request parameters.","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"data","type":{"name":"","union":[{"name":"string"},{"name":"Buffer"},{"name":"Serializable"}],"expression":"[string]|[Buffer]|[Serializable]"},"spec":[{"type":"text","text":"Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string↵and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will be↵set to `application/octet-stream` if not explicitly set."}],"required":false,"comment":"Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string\nand `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`\nheader will be set to `application/octet-stream` if not explicitly set.","async":false,"alias":"data","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"failOnStatusCode","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to throw on response codes other than 2xx and 3xx. By default response object is returned↵for all status codes."}],"required":false,"comment":"Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status\ncodes.","async":false,"alias":"failOnStatusCode","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"form","type":{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}],"expression":"[Object]<[string], [string]|[float]|[boolean]>"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided."}],"required":false,"comment":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.","async":false,"alias":"form","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"form","type":{"name":"FormData","expression":"[FormData]"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided."},{"type":"text","text":"An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]."}],"required":false,"comment":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].","async":false,"alias":"form","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"headers","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by it."}],"required":false,"comment":"Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by\nit.","async":false,"alias":"headers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"ignoreHTTPSErrors","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to ignore HTTPS errors when sending network requests. Defaults to `false`."}],"required":false,"comment":"Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.","async":false,"alias":"ignoreHTTPSErrors","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.26","name":"maxRedirects","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is exceeded.↵Defaults to `20`. Pass `0` to not follow redirects."}],"required":false,"comment":"Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is\nexceeded. Defaults to `20`. Pass `0` to not follow redirects.","async":false,"alias":"maxRedirects","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"multipart","type":{"name":"","union":[{"name":"FormData"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]}]}]}],"expression":"[FormData]|[Object]<[string], [string]|[float]|[boolean]|[ReadStream]|[Object]>"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)↵or as file-like object containing file name, mime-type and its content."}],"required":false,"comment":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed either as\n[`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file\nname, mime-type and its content.","async":false,"alias":"multipart","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"multipart","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]}]}],"expression":"[Object]<[string], [string]|[float]|[boolean]|[ReadStream]|[Object]>"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed as file-like object containing file name, mime-type and its content."}],"required":false,"comment":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed as file-like object containing file name, mime-type and its content.","async":false,"alias":"multipart","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"multipart","type":{"name":"FormData","expression":"[FormData]"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed as file-like object containing file name, mime-type and its content."},{"type":"text","text":"An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]."}],"required":false,"comment":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed as file-like object containing file name, mime-type and its content.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].","async":false,"alias":"multipart","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}],"expression":"[Object]<[string], [string]|[float]|[boolean]>"},"spec":[{"type":"text","text":"Query parameters to be sent with the URL."}],"required":false,"comment":"Query parameters to be sent with the URL.","async":false,"alias":"params","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"Object","templates":[{"name":"string"},{"name":"Serializable"}],"expression":"[Object]<[string], [Serializable]>"},"spec":[{"type":"text","text":"Query parameters to be sent with the URL."}],"required":false,"comment":"Query parameters to be sent with the URL.","async":false,"alias":"params","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout."}],"required":false,"comment":"Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.16","name":"post","type":{"name":"APIResponse","expression":"[APIResponse]"},"spec":[{"type":"text","text":"Sends HTTP(S) [POST](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST) request and returns its response.↵The method will populate request cookies from the context and update↵context cookies from the response. The method will automatically follow redirects."},{"type":"text","text":"**Usage**"},{"type":"text","text":"JSON objects can be passed directly to the request:"},{"type":"code","lines":["await request.post('https://example.com/api/createBook', {"," data: {"," title: 'Book Title',"," author: 'John Doe',"," }","});"],"codeLang":"js"},{"type":"code","lines":["Map<String, Object> data = new HashMap();","data.put(\"title\", \"Book Title\");","data.put(\"body\", \"John Doe\");","request.post(\"https://example.com/api/createBook\", RequestOptions.create().setData(data));"],"codeLang":"java"},{"type":"code","lines":["data = {"," \"title\": \"Book Title\","," \"body\": \"John Doe\",","}","api_request_context.post(\"https://example.com/api/createBook\", data=data)"],"codeLang":"python"},{"type":"code","lines":["var data = new Dictionary<string, object>() {"," { \"firstName\", \"John\" },"," { \"lastName\", \"Doe\" }","};","await request.PostAsync(\"https://example.com/api/createBook\", new() { DataObject = data });"],"codeLang":"csharp"},{"type":"text","text":"To send form data to the server use `form` option. Its value will be encoded into the request body with `application/x-www-form-urlencoded` encoding (see below how to use `multipart/form-data` form encoding to send files):"},{"type":"code","lines":["await request.post('https://example.com/api/findBook', {"," form: {"," title: 'Book Title',"," author: 'John Doe',"," }","});"],"codeLang":"js"},{"type":"code","lines":["request.post(\"https://example.com/api/findBook\", RequestOptions.create().setForm("," FormData.create().set(\"title\", \"Book Title\").set(\"body\", \"John Doe\")","));"],"codeLang":"java"},{"type":"code","lines":["formData = {"," \"title\": \"Book Title\","," \"body\": \"John Doe\",","}","api_request_context.post(\"https://example.com/api/findBook\", form=formData)"],"codeLang":"python"},{"type":"code","lines":["var formData = Context.APIRequest.CreateFormData();","formData.Set(\"title\", \"Book Title\");","formData.Set(\"body\", \"John Doe\");","await request.PostAsync(\"https://example.com/api/findBook\", new() { Form = formData });"],"codeLang":"csharp"},{"type":"text","text":"The common way to send file(s) in the body of a request is to upload them as form fields with `multipart/form-data` encoding. Use `FormData` to construct request body and pass it to the request as `multipart` parameter:"},{"type":"code","lines":["const form = new FormData();","form.set('name', 'John');","form.append('name', 'Doe');","// Send two file fields with the same name.","form.append('file', new File(['console.log(2024);'], 'f1.js', { type: 'text/javascript' }));","form.append('file', new File(['hello'], 'f2.txt', { type: 'text/plain' }));","await request.post('https://example.com/api/uploadForm', {"," multipart: form","});"],"codeLang":"js"},{"type":"code","lines":["// Pass file path to the form data constructor:","Path file = Paths.get(\"team.csv\");","APIResponse response = request.post(\"https://example.com/api/uploadTeamList\","," RequestOptions.create().setMultipart("," FormData.create().set(\"fileField\", file)));","","// Or you can pass the file content directly as FilePayload object:","FilePayload filePayload1 = new FilePayload(\"f1.js\", \"text/javascript\","," \"console.log(2022);\".getBytes(StandardCharsets.UTF_8));","APIResponse response = request.post(\"https://example.com/api/uploadScript\","," RequestOptions.create().setMultipart("," FormData.create().set(\"fileField\", filePayload)));"],"codeLang":"java"},{"type":"code","lines":["api_request_context.post("," \"https://example.com/api/uploadScript'\","," multipart={"," \"fileField\": {"," \"name\": \"f.js\","," \"mimeType\": \"text/javascript\","," \"buffer\": b\"console.log(2022);\","," },"," })"],"codeLang":"python"},{"type":"code","lines":["var file = new FilePayload()","{"," Name = \"f.js\","," MimeType = \"text/javascript\","," Buffer = System.Text.Encoding.UTF8.GetBytes(\"console.log(2022);\")","};","var multipart = Context.APIRequest.CreateFormData();","multipart.Set(\"fileField\", file);","await request.PostAsync(\"https://example.com/api/uploadScript\", new() { Multipart = multipart });"],"codeLang":"csharp"}],"required":true,"comment":"Sends HTTP(S) [POST](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST) request and returns its\nresponse. The method will populate request cookies from the context and update context cookies from the response.\nThe method will automatically follow redirects.\n\n**Usage**\n\nJSON objects can be passed directly to the request:\n\n```js\nawait request.post('https://example.com/api/createBook', {\n data: {\n title: 'Book Title',\n author: 'John Doe',\n }\n});\n```\n\n```java\nMap<String, Object> data = new HashMap();\ndata.put(\"title\", \"Book Title\");\ndata.put(\"body\", \"John Doe\");\nrequest.post(\"https://example.com/api/createBook\", RequestOptions.create().setData(data));\n```\n\n```python\ndata = {\n \"title\": \"Book Title\",\n \"body\": \"John Doe\",\n}\napi_request_context.post(\"https://example.com/api/createBook\", data=data)\n```\n\n```csharp\nvar data = new Dictionary<string, object>() {\n { \"firstName\", \"John\" },\n { \"lastName\", \"Doe\" }\n};\nawait request.PostAsync(\"https://example.com/api/createBook\", new() { DataObject = data });\n```\n\nTo send form data to the server use `form` option. Its value will be encoded into the request body with\n`application/x-www-form-urlencoded` encoding (see below how to use `multipart/form-data` form encoding to send\nfiles):\n\n```js\nawait request.post('https://example.com/api/findBook', {\n form: {\n title: 'Book Title',\n author: 'John Doe',\n }\n});\n```\n\n```java\nrequest.post(\"https://example.com/api/findBook\", RequestOptions.create().setForm(\n FormData.create().set(\"title\", \"Book Title\").set(\"body\", \"John Doe\")\n));\n```\n\n```python\nformData = {\n \"title\": \"Book Title\",\n \"body\": \"John Doe\",\n}\napi_request_context.post(\"https://example.com/api/findBook\", form=formData)\n```\n\n```csharp\nvar formData = Context.APIRequest.CreateFormData();\nformData.Set(\"title\", \"Book Title\");\nformData.Set(\"body\", \"John Doe\");\nawait request.PostAsync(\"https://example.com/api/findBook\", new() { Form = formData });\n```\n\nThe common way to send file(s) in the body of a request is to upload them as form fields with `multipart/form-data`\nencoding. Use `FormData` to construct request body and pass it to the request as `multipart` parameter:\n\n```js\nconst form = new FormData();\nform.set('name', 'John');\nform.append('name', 'Doe');\n// Send two file fields with the same name.\nform.append('file', new File(['console.log(2024);'], 'f1.js', { type: 'text/javascript' }));\nform.append('file', new File(['hello'], 'f2.txt', { type: 'text/plain' }));\nawait request.post('https://example.com/api/uploadForm', {\n multipart: form\n});\n```\n\n```java\n// Pass file path to the form data constructor:\nPath file = Paths.get(\"team.csv\");\nAPIResponse response = request.post(\"https://example.com/api/uploadTeamList\",\n RequestOptions.create().setMultipart(\n FormData.create().set(\"fileField\", file)));\n\n// Or you can pass the file content directly as FilePayload object:\nFilePayload filePayload1 = new FilePayload(\"f1.js\", \"text/javascript\",\n \"console.log(2022);\".getBytes(StandardCharsets.UTF_8));\nAPIResponse response = request.post(\"https://example.com/api/uploadScript\",\n RequestOptions.create().setMultipart(\n FormData.create().set(\"fileField\", filePayload)));\n```\n\n```python\napi_request_context.post(\n \"https://example.com/api/uploadScript'\",\n multipart={\n \"fileField\": {\n \"name\": \"f.js\",\n \"mimeType\": \"text/javascript\",\n \"buffer\": b\"console.log(2022);\",\n },\n })\n```\n\n```csharp\nvar file = new FilePayload()\n{\n Name = \"f.js\",\n MimeType = \"text/javascript\",\n Buffer = System.Text.Encoding.UTF8.GetBytes(\"console.log(2022);\")\n};\nvar multipart = Context.APIRequest.CreateFormData();\nmultipart.Set(\"fileField\", file);\nawait request.PostAsync(\"https://example.com/api/uploadScript\", new() { Multipart = multipart });\n```\n","async":true,"alias":"post","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.16","name":"url","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Target URL."}],"required":true,"comment":"Target URL.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"params","type":{"name":"RequestOptions","expression":"[RequestOptions]"},"spec":[{"type":"text","text":"Optional request parameters."}],"required":false,"comment":"Optional request parameters.","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"data","type":{"name":"","union":[{"name":"string"},{"name":"Buffer"},{"name":"Serializable"}],"expression":"[string]|[Buffer]|[Serializable]"},"spec":[{"type":"text","text":"Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string↵and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will be↵set to `application/octet-stream` if not explicitly set."}],"required":false,"comment":"Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string\nand `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`\nheader will be set to `application/octet-stream` if not explicitly set.","async":false,"alias":"data","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"failOnStatusCode","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to throw on response codes other than 2xx and 3xx. By default response object is returned↵for all status codes."}],"required":false,"comment":"Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status\ncodes.","async":false,"alias":"failOnStatusCode","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"form","type":{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}],"expression":"[Object]<[string], [string]|[float]|[boolean]>"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided."}],"required":false,"comment":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.","async":false,"alias":"form","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"form","type":{"name":"FormData","expression":"[FormData]"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided."},{"type":"text","text":"An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]."}],"required":false,"comment":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].","async":false,"alias":"form","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"headers","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by it."}],"required":false,"comment":"Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by\nit.","async":false,"alias":"headers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"ignoreHTTPSErrors","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to ignore HTTPS errors when sending network requests. Defaults to `false`."}],"required":false,"comment":"Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.","async":false,"alias":"ignoreHTTPSErrors","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.26","name":"maxRedirects","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is exceeded.↵Defaults to `20`. Pass `0` to not follow redirects."}],"required":false,"comment":"Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is\nexceeded. Defaults to `20`. Pass `0` to not follow redirects.","async":false,"alias":"maxRedirects","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"multipart","type":{"name":"","union":[{"name":"FormData"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]}]}]}],"expression":"[FormData]|[Object]<[string], [string]|[float]|[boolean]|[ReadStream]|[Object]>"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)↵or as file-like object containing file name, mime-type and its content."}],"required":false,"comment":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed either as\n[`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file\nname, mime-type and its content.","async":false,"alias":"multipart","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"multipart","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]}]}],"expression":"[Object]<[string], [string]|[float]|[boolean]|[ReadStream]|[Object]>"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed as file-like object containing file name, mime-type and its content."}],"required":false,"comment":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed as file-like object containing file name, mime-type and its content.","async":false,"alias":"multipart","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"multipart","type":{"name":"FormData","expression":"[FormData]"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed as file-like object containing file name, mime-type and its content."},{"type":"text","text":"An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]."}],"required":false,"comment":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed as file-like object containing file name, mime-type and its content.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].","async":false,"alias":"multipart","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}],"expression":"[Object]<[string], [string]|[float]|[boolean]>"},"spec":[{"type":"text","text":"Query parameters to be sent with the URL."}],"required":false,"comment":"Query parameters to be sent with the URL.","async":false,"alias":"params","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"Object","templates":[{"name":"string"},{"name":"Serializable"}],"expression":"[Object]<[string], [Serializable]>"},"spec":[{"type":"text","text":"Query parameters to be sent with the URL."}],"required":false,"comment":"Query parameters to be sent with the URL.","async":false,"alias":"params","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout."}],"required":false,"comment":"Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.16","name":"put","type":{"name":"APIResponse","expression":"[APIResponse]"},"spec":[{"type":"text","text":"Sends HTTP(S) [PUT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT) request and returns its response.↵The method will populate request cookies from the context and update↵context cookies from the response. The method will automatically follow redirects."}],"required":true,"comment":"Sends HTTP(S) [PUT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT) request and returns its\nresponse. The method will populate request cookies from the context and update context cookies from the response.\nThe method will automatically follow redirects.","async":true,"alias":"put","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.16","name":"url","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Target URL."}],"required":true,"comment":"Target URL.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"params","type":{"name":"RequestOptions","expression":"[RequestOptions]"},"spec":[{"type":"text","text":"Optional request parameters."}],"required":false,"comment":"Optional request parameters.","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"data","type":{"name":"","union":[{"name":"string"},{"name":"Buffer"},{"name":"Serializable"}],"expression":"[string]|[Buffer]|[Serializable]"},"spec":[{"type":"text","text":"Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string↵and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will be↵set to `application/octet-stream` if not explicitly set."}],"required":false,"comment":"Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string\nand `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`\nheader will be set to `application/octet-stream` if not explicitly set.","async":false,"alias":"data","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"failOnStatusCode","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to throw on response codes other than 2xx and 3xx. By default response object is returned↵for all status codes."}],"required":false,"comment":"Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status\ncodes.","async":false,"alias":"failOnStatusCode","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"form","type":{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}],"expression":"[Object]<[string], [string]|[float]|[boolean]>"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided."}],"required":false,"comment":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.","async":false,"alias":"form","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"form","type":{"name":"FormData","expression":"[FormData]"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided."},{"type":"text","text":"An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]."}],"required":false,"comment":"Provides an object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent\nas this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].","async":false,"alias":"form","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"headers","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by it."}],"required":false,"comment":"Allows to set HTTP headers. These headers will apply to the fetched request as well as any redirects initiated by\nit.","async":false,"alias":"headers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"ignoreHTTPSErrors","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to ignore HTTPS errors when sending network requests. Defaults to `false`."}],"required":false,"comment":"Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.","async":false,"alias":"ignoreHTTPSErrors","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.26","name":"maxRedirects","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is exceeded.↵Defaults to `20`. Pass `0` to not follow redirects."}],"required":false,"comment":"Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is\nexceeded. Defaults to `20`. Pass `0` to not follow redirects.","async":false,"alias":"maxRedirects","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"multipart","type":{"name":"","union":[{"name":"FormData"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]}]}]}],"expression":"[FormData]|[Object]<[string], [string]|[float]|[boolean]|[ReadStream]|[Object]>"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed either as [`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream)↵or as file-like object containing file name, mime-type and its content."}],"required":false,"comment":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed either as\n[`fs.ReadStream`](https://nodejs.org/api/fs.html#fs_class_fs_readstream) or as file-like object containing file\nname, mime-type and its content.","async":false,"alias":"multipart","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"multipart","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}],"templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"},{"name":"ReadStream"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]}]}],"expression":"[Object]<[string], [string]|[float]|[boolean]|[ReadStream]|[Object]>"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed as file-like object containing file name, mime-type and its content."}],"required":false,"comment":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed as file-like object containing file name, mime-type and its content.","async":false,"alias":"multipart","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"multipart","type":{"name":"FormData","expression":"[FormData]"},"spec":[{"type":"text","text":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided. File values can be passed as file-like object containing file name, mime-type and its content."},{"type":"text","text":"An instance of `FormData` can be created via [`method: APIRequestContext.createFormData`]."}],"required":false,"comment":"Provides an object that will be serialized as html form using `multipart/form-data` encoding and sent as this\nrequest body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided. File values can be passed as file-like object containing file name, mime-type and its content.\n\nAn instance of `FormData` can be created via [`method: APIRequestContext.createFormData`].","async":false,"alias":"multipart","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}],"expression":"[Object]<[string], [string]|[float]|[boolean]>"},"spec":[{"type":"text","text":"Query parameters to be sent with the URL."}],"required":false,"comment":"Query parameters to be sent with the URL.","async":false,"alias":"params","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"params","type":{"name":"Object","templates":[{"name":"string"},{"name":"Serializable"}],"expression":"[Object]<[string], [Serializable]>"},"spec":[{"type":"text","text":"Query parameters to be sent with the URL."}],"required":false,"comment":"Query parameters to be sent with the URL.","async":false,"alias":"params","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout."}],"required":false,"comment":"Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"types":{"java":{"name":"string","expression":"[string]"},"csharp":{"name":"string","expression":"[string]"}}},"since":"v1.16","name":"storageState","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"cookies","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"domain","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"domain","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"path","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"expires","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Unix time in seconds."}],"required":true,"comment":"Unix time in seconds.","async":false,"alias":"expires","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"httpOnly","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"httpOnly","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"secure","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"secure","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"sameSite","type":{"name":"SameSiteAttribute","union":[{"name":"\"Strict\""},{"name":"\"Lax\""},{"name":"\"None\""}],"expression":"[SameSiteAttribute]<\"Strict\"|\"Lax\"|\"None\">"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"sameSite","overloadIndex":0,"paramOrOption":null}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"cookies","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"origins","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"origin","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"origin","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"localStorage","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"localStorage","overloadIndex":0,"paramOrOption":null}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"origins","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Returns storage state for this request context, contains current cookies and local storage snapshot if it was passed to the constructor."}],"required":true,"comment":"Returns storage state for this request context, contains current cookies and local storage snapshot if it was\npassed to the constructor.","async":true,"alias":"storageState","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"The file path to save the storage state to. If `path` is a relative path, then it is resolved relative to↵current working directory. If no path is provided, storage↵state is still returned, but won't be saved to the disk."}],"required":false,"comment":"The file path to save the storage state to. If `path` is a relative path, then it is resolved relative to current\nworking directory. If no path is provided, storage state is still returned, but won't be saved to the disk.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]}]},{"name":"APIResponse","spec":[{"type":"text","text":"`APIResponse` class represents responses returned by [`method: APIRequestContext.get`] and similar methods."},{"type":"code","lines":["import asyncio","from playwright.async_api import async_playwright, Playwright","","async def run(playwright: Playwright):"," context = await playwright.request.new_context()"," response = await context.get(\"https://example.com/user/repos\")"," assert response.ok"," assert response.status == 200"," assert response.headers[\"content-type\"] == \"application/json; charset=utf-8\""," assert response.json()[\"name\"] == \"foobar\""," assert await response.body() == '{\"status\": \"ok\"}'","","","async def main():"," async with async_playwright() as playwright:"," await run(playwright)","","asyncio.run(main())"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import sync_playwright","","with sync_playwright() as p:"," context = playwright.request.new_context()"," response = context.get(\"https://example.com/user/repos\")"," assert response.ok"," assert response.status == 200"," assert response.headers[\"content-type\"] == \"application/json; charset=utf-8\""," assert response.json()[\"name\"] == \"foobar\""," assert response.body() == '{\"status\": \"ok\"}'"],"codeLang":"python sync"}],"langs":{},"comment":"`APIResponse` class represents responses returned by [`method: APIRequestContext.get`] and similar methods.\n\n```py\nimport asyncio\nfrom playwright.async_api import async_playwright, Playwright\n\nasync def run(playwright: Playwright):\n context = await playwright.request.new_context()\n response = await context.get(\"https://example.com/user/repos\")\n assert response.ok\n assert response.status == 200\n assert response.headers[\"content-type\"] == \"application/json; charset=utf-8\"\n assert response.json()[\"name\"] == \"foobar\"\n assert await response.body() == '{\"status\": \"ok\"}'\n\n\nasync def main():\n async with async_playwright() as playwright:\n await run(playwright)\n\nasyncio.run(main())\n```\n\n```py\nfrom playwright.sync_api import sync_playwright\n\nwith sync_playwright() as p:\n context = playwright.request.new_context()\n response = context.get(\"https://example.com/user/repos\")\n assert response.ok\n assert response.status == 200\n assert response.headers[\"content-type\"] == \"application/json; charset=utf-8\"\n assert response.json()[\"name\"] == \"foobar\"\n assert response.body() == '{\"status\": \"ok\"}'\n```\n","since":"v1.16","members":[{"kind":"method","langs":{},"since":"v1.16","name":"body","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"Returns the buffer with response body."}],"required":true,"comment":"Returns the buffer with response body.","async":true,"alias":"body","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.16","name":"dispose","type":{"name":"void"},"spec":[{"type":"text","text":"Disposes the body of this response. If not called then the body will stay in memory until the context closes."}],"required":true,"comment":"Disposes the body of this response. If not called then the body will stay in memory until the context closes.","async":true,"alias":"dispose","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.16","name":"headers","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"An object with all the response HTTP headers associated with this response."}],"required":true,"comment":"An object with all the response HTTP headers associated with this response.","async":false,"alias":"headers","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.16","name":"headersArray","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Name of the header."}],"required":true,"comment":"Name of the header.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Value of the header."}],"required":true,"comment":"Value of the header.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":"An array with all the request HTTP headers associated with this response. Header names are not lower-cased.↵Headers with multiple entries, such as `Set-Cookie`, appear in the array multiple times."}],"required":true,"comment":"An array with all the request HTTP headers associated with this response. Header names are not lower-cased. Headers\nwith multiple entries, such as `Set-Cookie`, appear in the array multiple times.","async":false,"alias":"headersArray","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"json","type":{"name":"Serializable","expression":"[Serializable]"},"spec":[{"type":"text","text":"Returns the JSON representation of response body."},{"type":"text","text":"This method will throw if the response body is not parsable via `JSON.parse`."}],"required":true,"comment":"Returns the JSON representation of response body.\n\nThis method will throw if the response body is not parsable via `JSON.parse`.","async":true,"alias":"json","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"json","type":{"name":"","union":[{"name":"null"},{"name":"JsonElement"}],"expression":"[null]|[JsonElement]"},"spec":[{"type":"text","text":"Returns the JSON representation of response body."},{"type":"text","text":"This method will throw if the response body is not parsable via `JSON.parse`."}],"required":true,"comment":"Returns the JSON representation of response body.\n\nThis method will throw if the response body is not parsable via `JSON.parse`.","async":true,"alias":"json","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.16","name":"ok","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Contains a boolean stating whether the response was successful (status in the range 200-299) or not."}],"required":true,"comment":"Contains a boolean stating whether the response was successful (status in the range 200-299) or not.","async":false,"alias":"ok","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.16","name":"status","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Contains the status code of the response (e.g., 200 for a success)."}],"required":true,"comment":"Contains the status code of the response (e.g., 200 for a success).","async":false,"alias":"status","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.16","name":"statusText","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Contains the status text of the response (e.g. usually an \"OK\" for a success)."}],"required":true,"comment":"Contains the status text of the response (e.g. usually an \"OK\" for a success).","async":false,"alias":"statusText","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.16","name":"text","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Returns the text representation of response body."}],"required":true,"comment":"Returns the text representation of response body.","async":true,"alias":"text","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.16","name":"url","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Contains the URL of the response."}],"required":true,"comment":"Contains the URL of the response.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null,"args":[]}]},{"name":"APIResponseAssertions","spec":[{"type":"text","text":"The `APIResponseAssertions` class provides assertion methods that can be used to make assertions about the `APIResponse` in the tests."},{"type":"code","lines":["import { test, expect } from '@playwright/test';","","test('navigates to login', async ({ page }) => {"," // ..."," const response = await page.request.get('https://playwright.dev');"," await expect(response).toBeOK();","});"],"codeLang":"js"},{"type":"code","lines":["...","import static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;","","public class TestPage {"," ..."," @Test"," void navigatesToLoginPage() {"," ..."," APIResponse response = page.request().get('https://playwright.dev');"," assertThat(response).isOK();"," }","}"],"codeLang":"java"},{"type":"code","lines":["from playwright.async_api import Page, expect","","async def test_navigates_to_login_page(page: Page) -> None:"," # .."," response = await page.request.get('https://playwright.dev')"," await expect(response).to_be_ok()"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import Page, expect","","def test_navigates_to_login_page(page: Page) -> None:"," # .."," response = page.request.get('https://playwright.dev')"," expect(response).to_be_ok()"],"codeLang":"python sync"}],"langs":{},"comment":"The `APIResponseAssertions` class provides assertion methods that can be used to make assertions about the\n`APIResponse` in the tests.\n\n```js\nimport { test, expect } from '@playwright/test';\n\ntest('navigates to login', async ({ page }) => {\n // ...\n const response = await page.request.get('https://playwright.dev');\n await expect(response).toBeOK();\n});\n```\n\n```java\n...\nimport static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;\n\npublic class TestPage {\n ...\n @Test\n void navigatesToLoginPage() {\n ...\n APIResponse response = page.request().get('https://playwright.dev');\n assertThat(response).isOK();\n }\n}\n```\n\n```py\nfrom playwright.async_api import Page, expect\n\nasync def test_navigates_to_login_page(page: Page) -> None:\n # ..\n response = await page.request.get('https://playwright.dev')\n await expect(response).to_be_ok()\n```\n\n```py\nfrom playwright.sync_api import Page, expect\n\ndef test_navigates_to_login_page(page: Page) -> None:\n # ..\n response = page.request.get('https://playwright.dev')\n expect(response).to_be_ok()\n```\n","since":"v1.18","members":[{"kind":"property","langs":{"only":["java","js","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.20","name":"not","type":{"name":"APIResponseAssertions","expression":"[APIResponseAssertions]"},"spec":[{"type":"text","text":"Makes the assertion check for the opposite condition. For example, this code tests that the response status is not successful:"},{"type":"code","lines":["await expect(response).not.toBeOK();"],"codeLang":"js"},{"type":"code","lines":["assertThat(response).not().isOK();"],"codeLang":"java"}],"required":true,"comment":"Makes the assertion check for the opposite condition. For example, this code tests that the response status is not\nsuccessful:\n\n```js\nawait expect(response).not.toBeOK();\n```\n\n```java\nassertThat(response).not().isOK();\n```\n","async":false,"alias":"not","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.19","name":"NotToBeOK","type":{"name":"void"},"spec":[{"type":"text","text":"The opposite of [`method: APIResponseAssertions.toBeOK`]."}],"required":true,"comment":"The opposite of [`method: APIResponseAssertions.toBeOK`].","async":true,"alias":"NotToBeOK","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"aliases":{"java":"isOK"},"types":{},"overrides":{}},"since":"v1.18","name":"toBeOK","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures the response status code is within `200..299` range."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await expect(response).toBeOK();"],"codeLang":"js"},{"type":"code","lines":["assertThat(response).isOK();"],"codeLang":"java"},{"type":"code","lines":["from playwright.async_api import expect","","# ...","await expect(response).to_be_ok()"],"codeLang":"python async"},{"type":"code","lines":["import re","from playwright.sync_api import expect","","# ...","expect(response).to_be_ok()"],"codeLang":"python sync"}],"required":true,"comment":"Ensures the response status code is within `200..299` range.\n\n**Usage**\n\n```js\nawait expect(response).toBeOK();\n```\n\n```java\nassertThat(response).isOK();\n```\n\n```py\nfrom playwright.async_api import expect\n\n# ...\nawait expect(response).to_be_ok()\n```\n\n```py\nimport re\nfrom playwright.sync_api import expect\n\n# ...\nexpect(response).to_be_ok()\n```\n","async":true,"alias":"toBeOK","overloadIndex":0,"paramOrOption":null,"args":[]}]},{"name":"Browser","spec":[{"type":"li","text":"extends: [EventEmitter]","liType":"bullet"},{"type":"text","text":"A Browser is created via [`method: BrowserType.launch`]. An example of using a `Browser` to create a `Page`:"},{"type":"code","lines":["const { firefox } = require('playwright'); // Or 'chromium' or 'webkit'.","","(async () => {"," const browser = await firefox.launch();"," const page = await browser.newPage();"," await page.goto('https://example.com');"," await browser.close();","})();"],"codeLang":"js"},{"type":"code","lines":["import com.microsoft.playwright.*;","","public class Example {"," public static void main(String[] args) {"," try (Playwright playwright = Playwright.create()) {"," BrowserType firefox = playwright.firefox()"," Browser browser = firefox.launch();"," Page page = browser.newPage();"," page.navigate('https://example.com');"," browser.close();"," }"," }","}"],"codeLang":"java"},{"type":"code","lines":["import asyncio","from playwright.async_api import async_playwright, Playwright","","async def run(playwright: Playwright):"," firefox = playwright.firefox"," browser = await firefox.launch()"," page = await browser.new_page()"," await page.goto(\"https://example.com\")"," await browser.close()","","async def main():"," async with async_playwright() as playwright:"," await run(playwright)","asyncio.run(main())"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import sync_playwright, Playwright","","def run(playwright: Playwright):"," firefox = playwright.firefox"," browser = firefox.launch()"," page = browser.new_page()"," page.goto(\"https://example.com\")"," browser.close()","","with sync_playwright() as playwright:"," run(playwright)"],"codeLang":"python sync"},{"type":"code","lines":["using Microsoft.Playwright;","","using var playwright = await Playwright.CreateAsync();","var firefox = playwright.Firefox;","var browser = await firefox.LaunchAsync(new() { Headless = false });","var page = await browser.NewPageAsync();","await page.GotoAsync(\"https://www.bing.com\");","await browser.CloseAsync();"],"codeLang":"csharp"}],"extends":"EventEmitter","langs":{},"comment":"- extends: [EventEmitter]\n\nA Browser is created via [`method: BrowserType.launch`]. An example of using a `Browser` to create a `Page`:\n\n```js\nconst { firefox } = require('playwright'); // Or 'chromium' or 'webkit'.\n\n(async () => {\n const browser = await firefox.launch();\n const page = await browser.newPage();\n await page.goto('https://example.com');\n await browser.close();\n})();\n```\n\n```java\nimport com.microsoft.playwright.*;\n\npublic class Example {\n public static void main(String[] args) {\n try (Playwright playwright = Playwright.create()) {\n BrowserType firefox = playwright.firefox()\n Browser browser = firefox.launch();\n Page page = browser.newPage();\n page.navigate('https://example.com');\n browser.close();\n }\n }\n}\n```\n\n```py\nimport asyncio\nfrom playwright.async_api import async_playwright, Playwright\n\nasync def run(playwright: Playwright):\n firefox = playwright.firefox\n browser = await firefox.launch()\n page = await browser.new_page()\n await page.goto(\"https://example.com\")\n await browser.close()\n\nasync def main():\n async with async_playwright() as playwright:\n await run(playwright)\nasyncio.run(main())\n```\n\n```py\nfrom playwright.sync_api import sync_playwright, Playwright\n\ndef run(playwright: Playwright):\n firefox = playwright.firefox\n browser = firefox.launch()\n page = browser.new_page()\n page.goto(\"https://example.com\")\n browser.close()\n\nwith sync_playwright() as playwright:\n run(playwright)\n```\n\n```csharp\nusing Microsoft.Playwright;\n\nusing var playwright = await Playwright.CreateAsync();\nvar firefox = playwright.Firefox;\nvar browser = await firefox.LaunchAsync(new() { Headless = false });\nvar page = await browser.NewPageAsync();\nawait page.GotoAsync(\"https://www.bing.com\");\nawait browser.CloseAsync();\n```\n","since":"v1.8","members":[{"kind":"event","langs":{},"since":"v1.8","name":"disconnected","type":{"name":"Browser","expression":"[Browser]"},"spec":[{"type":"text","text":"Emitted when Browser gets disconnected from the browser application. This might happen because of one of the following:"},{"type":"li","text":"Browser application is closed or crashed.","liType":"bullet"},{"type":"li","text":"The [`method: Browser.close`] method was called.","liType":"bullet"}],"required":true,"comment":"Emitted when Browser gets disconnected from the browser application. This might happen because of one of the\nfollowing:\n- Browser application is closed or crashed.\n- The [`method: Browser.close`] method was called.","async":false,"alias":"disconnected","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.23","name":"browserType","type":{"name":"BrowserType","expression":"[BrowserType]"},"spec":[{"type":"text","text":"Get the browser type (chromium, firefox or webkit) that the browser belongs to."}],"required":true,"comment":"Get the browser type (chromium, firefox or webkit) that the browser belongs to.","async":false,"alias":"browserType","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"close","type":{"name":"void"},"spec":[{"type":"text","text":"In case this browser is obtained using [`method: BrowserType.launch`], closes the browser and all of its pages (if any↵were opened)."},{"type":"text","text":"In case this browser is connected to, clears all created contexts belonging to this browser and disconnects from the↵browser server."},{"type":"note","noteType":"note","text":"This is similar to force quitting the browser. Therefore, you should call [`method: BrowserContext.close`] on any `BrowserContext`'s you explicitly created earlier with [`method: Browser.newContext`] **before** calling [`method: Browser.close`]."},{"type":"text","text":"The `Browser` object itself is considered to be disposed and cannot be used anymore."}],"required":true,"comment":"In case this browser is obtained using [`method: BrowserType.launch`], closes the browser and all of its pages (if\nany were opened).\n\nIn case this browser is connected to, clears all created contexts belonging to this browser and disconnects from\nthe browser server.\n\n**NOTE** This is similar to force quitting the browser. Therefore, you should call [`method: BrowserContext.close`]\non any `BrowserContext`'s you explicitly created earlier with [`method: Browser.newContext`] **before** calling\n[`method: Browser.close`].\n\nThe `Browser` object itself is considered to be disposed and cannot be used anymore.","async":true,"alias":"close","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.40","name":"reason","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"The reason to be reported to the operations interrupted by the browser closure."}],"required":false,"comment":"The reason to be reported to the operations interrupted by the browser closure.","async":false,"alias":"reason","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"contexts","type":{"name":"Array","templates":[{"name":"BrowserContext"}],"expression":"[Array]<[BrowserContext]>"},"spec":[{"type":"text","text":"Returns an array of all open browser contexts. In a newly created browser, this will return zero browser contexts."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const browser = await pw.webkit.launch();","console.log(browser.contexts().length); // prints `0`","","const context = await browser.newContext();","console.log(browser.contexts().length); // prints `1`"],"codeLang":"js"},{"type":"code","lines":["Browser browser = pw.webkit().launch();","System.out.println(browser.contexts().size()); // prints \"0\"","BrowserContext context = browser.newContext();","System.out.println(browser.contexts().size()); // prints \"1\""],"codeLang":"java"},{"type":"code","lines":["browser = await pw.webkit.launch()","print(len(browser.contexts)) # prints `0`","context = await browser.new_context()","print(len(browser.contexts)) # prints `1`"],"codeLang":"python async"},{"type":"code","lines":["browser = pw.webkit.launch()","print(len(browser.contexts)) # prints `0`","context = browser.new_context()","print(len(browser.contexts)) # prints `1`"],"codeLang":"python sync"},{"type":"code","lines":["using var playwright = await Playwright.CreateAsync();","var browser = await playwright.Webkit.LaunchAsync();","System.Console.WriteLine(browser.Contexts.Count); // prints \"0\"","var context = await browser.NewContextAsync();","System.Console.WriteLine(browser.Contexts.Count); // prints \"1\""],"codeLang":"csharp"}],"required":true,"comment":"Returns an array of all open browser contexts. In a newly created browser, this will return zero browser contexts.\n\n**Usage**\n\n```js\nconst browser = await pw.webkit.launch();\nconsole.log(browser.contexts().length); // prints `0`\n\nconst context = await browser.newContext();\nconsole.log(browser.contexts().length); // prints `1`\n```\n\n```java\nBrowser browser = pw.webkit().launch();\nSystem.out.println(browser.contexts().size()); // prints \"0\"\nBrowserContext context = browser.newContext();\nSystem.out.println(browser.contexts().size()); // prints \"1\"\n```\n\n```py\nbrowser = await pw.webkit.launch()\nprint(len(browser.contexts)) # prints `0`\ncontext = await browser.new_context()\nprint(len(browser.contexts)) # prints `1`\n```\n\n```py\nbrowser = pw.webkit.launch()\nprint(len(browser.contexts)) # prints `0`\ncontext = browser.new_context()\nprint(len(browser.contexts)) # prints `1`\n```\n\n```csharp\nusing var playwright = await Playwright.CreateAsync();\nvar browser = await playwright.Webkit.LaunchAsync();\nSystem.Console.WriteLine(browser.Contexts.Count); // prints \"0\"\nvar context = await browser.NewContextAsync();\nSystem.Console.WriteLine(browser.Contexts.Count); // prints \"1\"\n```\n","async":false,"alias":"contexts","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"isConnected","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Indicates that the browser is connected."}],"required":true,"comment":"Indicates that the browser is connected.","async":false,"alias":"isConnected","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.11","name":"newBrowserCDPSession","type":{"name":"CDPSession","expression":"[CDPSession]"},"spec":[{"type":"note","noteType":"note","text":"CDP Sessions are only supported on Chromium-based browsers."},{"type":"text","text":"Returns the newly created browser session."}],"required":true,"comment":"**NOTE** CDP Sessions are only supported on Chromium-based browsers.\n\nReturns the newly created browser session.","async":true,"alias":"newBrowserCDPSession","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"newContext","type":{"name":"BrowserContext","expression":"[BrowserContext]"},"spec":[{"type":"text","text":"Creates a new browser context. It won't share cookies/cache with other browser contexts."},{"type":"note","noteType":"note","text":"If directly using this method to create `BrowserContext`s, it is best practice to explicitly close the returned context via [`method: BrowserContext.close`] when your code is done with the `BrowserContext`,↵and before calling [`method: Browser.close`]. This will ensure the `context` is closed gracefully and any artifacts—like HARs and videos—are fully flushed and saved."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["(async () => {"," const browser = await playwright.firefox.launch(); // Or 'chromium' or 'webkit'."," // Create a new incognito browser context."," const context = await browser.newContext();"," // Create a new page in a pristine context."," const page = await context.newPage();"," await page.goto('https://example.com');",""," // Gracefully close up everything"," await context.close();"," await browser.close();","})();"],"codeLang":"js"},{"type":"code","lines":["Browser browser = playwright.firefox().launch(); // Or 'chromium' or 'webkit'.","// Create a new incognito browser context.","BrowserContext context = browser.newContext();","// Create a new page in a pristine context.","Page page = context.newPage();","page.navigate('https://example.com');","","// Graceful close up everything","context.close();","browser.close();"],"codeLang":"java"},{"type":"code","lines":["browser = await playwright.firefox.launch() # or \"chromium\" or \"webkit\".","# create a new incognito browser context.","context = await browser.new_context()","# create a new page in a pristine context.","page = await context.new_page()","await page.goto(\"https://example.com\")","","# gracefully close up everything","await context.close()","await browser.close()"],"codeLang":"python async"},{"type":"code","lines":["browser = playwright.firefox.launch() # or \"chromium\" or \"webkit\".","# create a new incognito browser context.","context = browser.new_context()","# create a new page in a pristine context.","page = context.new_page()","page.goto(\"https://example.com\")","","# gracefully close up everything","context.close()","browser.close()"],"codeLang":"python sync"},{"type":"code","lines":["using var playwright = await Playwright.CreateAsync();","var browser = await playwright.Firefox.LaunchAsync();","// Create a new incognito browser context.","var context = await browser.NewContextAsync();","// Create a new page in a pristine context.","var page = await context.NewPageAsync(); ;","await page.GotoAsync(\"https://www.bing.com\");","","// Gracefully close up everything","await context.CloseAsync();","await browser.CloseAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Creates a new browser context. It won't share cookies/cache with other browser contexts.\n\n**NOTE** If directly using this method to create `BrowserContext`s, it is best practice to explicitly close the\nreturned context via [`method: BrowserContext.close`] when your code is done with the `BrowserContext`, and before\ncalling [`method: Browser.close`]. This will ensure the `context` is closed gracefully and any artifacts—like HARs\nand videos—are fully flushed and saved.\n\n**Usage**\n\n```js\n(async () => {\n const browser = await playwright.firefox.launch(); // Or 'chromium' or 'webkit'.\n // Create a new incognito browser context.\n const context = await browser.newContext();\n // Create a new page in a pristine context.\n const page = await context.newPage();\n await page.goto('https://example.com');\n\n // Gracefully close up everything\n await context.close();\n await browser.close();\n})();\n```\n\n```java\nBrowser browser = playwright.firefox().launch(); // Or 'chromium' or 'webkit'.\n// Create a new incognito browser context.\nBrowserContext context = browser.newContext();\n// Create a new page in a pristine context.\nPage page = context.newPage();\npage.navigate('https://example.com');\n\n// Graceful close up everything\ncontext.close();\nbrowser.close();\n```\n\n```py\nbrowser = await playwright.firefox.launch() # or \"chromium\" or \"webkit\".\n# create a new incognito browser context.\ncontext = await browser.new_context()\n# create a new page in a pristine context.\npage = await context.new_page()\nawait page.goto(\"https://example.com\")\n\n# gracefully close up everything\nawait context.close()\nawait browser.close()\n```\n\n```py\nbrowser = playwright.firefox.launch() # or \"chromium\" or \"webkit\".\n# create a new incognito browser context.\ncontext = browser.new_context()\n# create a new page in a pristine context.\npage = context.new_page()\npage.goto(\"https://example.com\")\n\n# gracefully close up everything\ncontext.close()\nbrowser.close()\n```\n\n```csharp\nusing var playwright = await Playwright.CreateAsync();\nvar browser = await playwright.Firefox.LaunchAsync();\n// Create a new incognito browser context.\nvar context = await browser.NewContextAsync();\n// Create a new page in a pristine context.\nvar page = await context.NewPageAsync(); ;\nawait page.GotoAsync(\"https://www.bing.com\");\n\n// Gracefully close up everything\nawait context.CloseAsync();\nawait browser.CloseAsync();\n```\n","async":true,"alias":"newContext","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"acceptDownloads","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted."}],"required":false,"comment":"Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted.","async":false,"alias":"acceptDownloads","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"baseURL","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"When using [`method: Page.goto`], [`method: Page.route`], [`method: Page.waitForURL`], [`method: Page.waitForRequest`], or [`method: Page.waitForResponse`] it takes the base URL in consideration by using the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL. Unset by default. Examples:"},{"type":"li","text":"baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html`","liType":"bullet"},{"type":"li","text":"baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in `http://localhost:3000/foo/bar.html`","liType":"bullet"},{"type":"li","text":"baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in `http://localhost:3000/bar.html`","liType":"bullet"}],"required":false,"comment":"When using [`method: Page.goto`], [`method: Page.route`], [`method: Page.waitForURL`],\n[`method: Page.waitForRequest`], or [`method: Page.waitForResponse`] it takes the base URL in consideration by\nusing the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the\ncorresponding URL. Unset by default. Examples:\n- baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html`\n- baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in\n `http://localhost:3000/foo/bar.html`\n- baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in\n `http://localhost:3000/bar.html`","async":false,"alias":"baseURL","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"bypassCSP","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Toggles bypassing page's Content-Security-Policy. Defaults to `false`."}],"required":false,"comment":"Toggles bypassing page's Content-Security-Policy. Defaults to `false`.","async":false,"alias":"bypassCSP","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"colorScheme","type":{"name":"","union":[{"name":"null"},{"name":"ColorScheme","union":[{"name":"\"light\""},{"name":"\"dark\""},{"name":"\"no-preference\""}]}],"expression":"null|[ColorScheme]<\"light\"|\"dark\"|\"no-preference\">"},"spec":[{"type":"text","text":"Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See↵[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'light'`."}],"required":false,"comment":"Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to\n`'light'`.","async":false,"alias":"colorScheme","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"colorScheme","type":{"name":"ColorScheme","union":[{"name":"\"light\""},{"name":"\"dark\""},{"name":"\"no-preference\""},{"name":"\"null\""}],"expression":"[ColorScheme]<\"light\"|\"dark\"|\"no-preference\"|\"null\">"},"spec":[{"type":"text","text":"Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See↵[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'light'`."}],"required":false,"comment":"Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to\n`'light'`.","async":false,"alias":"colorScheme","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"deviceScaleFactor","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about [emulating devices with device scale factor](../emulation.md#devices)."}],"required":false,"comment":"Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about\n[emulating devices with device scale factor](../emulation.md#devices).","async":false,"alias":"deviceScaleFactor","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"extraHTTPHeaders","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"An object containing additional HTTP headers to be sent with every request. Defaults to none."}],"required":false,"comment":"An object containing additional HTTP headers to be sent with every request. Defaults to none.","async":false,"alias":"extraHTTPHeaders","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"forcedColors","type":{"name":"","union":[{"name":"null"},{"name":"ForcedColors","union":[{"name":"\"active\""},{"name":"\"none\""}]}],"expression":"null|[ForcedColors]<\"active\"|\"none\">"},"spec":[{"type":"text","text":"Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See [`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'none'`."}],"required":false,"comment":"Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See\n[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to\n`'none'`.","async":false,"alias":"forcedColors","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"forcedColors","type":{"name":"ForcedColors","union":[{"name":"\"active\""},{"name":"\"none\""},{"name":"\"null\""}],"expression":"[ForcedColors]<\"active\"|\"none\"|\"null\">"},"spec":[{"type":"text","text":"Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See [`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'none'`."}],"required":false,"comment":"Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See\n[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to\n`'none'`.","async":false,"alias":"forcedColors","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"geolocation","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"latitude","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Latitude between -90 and 90."}],"required":true,"comment":"Latitude between -90 and 90.","async":false,"alias":"latitude","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"longitude","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Longitude between -180 and 180."}],"required":true,"comment":"Longitude between -180 and 180.","async":false,"alias":"longitude","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"accuracy","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Non-negative accuracy value. Defaults to `0`."}],"required":false,"comment":"Non-negative accuracy value. Defaults to `0`.","async":false,"alias":"accuracy","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[],"required":false,"comment":"","async":false,"alias":"geolocation","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"hasTouch","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Specifies if viewport supports touch events. Defaults to false. Learn more about [mobile emulation](../emulation.md#devices)."}],"required":false,"comment":"Specifies if viewport supports touch events. Defaults to false. Learn more about\n[mobile emulation](../emulation.md#devices).","async":false,"alias":"hasTouch","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"httpCredentials","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"username","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"username","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"password","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"password","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"origin","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Restrain sending http credentials on specific origin (scheme://host:port)."}],"required":false,"comment":"Restrain sending http credentials on specific origin (scheme://host:port).","async":false,"alias":"origin","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"send","type":{"name":"HttpCredentialsSend","union":[{"name":"\"unauthorized\""},{"name":"\"always\""}],"expression":"[HttpCredentialsSend]<\"unauthorized\"|\"always\">"},"spec":[{"type":"text","text":"This option only applies to the requests sent from corresponding `APIRequestContext` and does not affect requests sent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with `WWW-Authenticate` header is received. Defaults to `'unauthorized'`."}],"required":false,"comment":"This option only applies to the requests sent from corresponding `APIRequestContext` and does not affect requests\nsent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with\nthe each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with\n`WWW-Authenticate` header is received. Defaults to `'unauthorized'`.","async":false,"alias":"send","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).↵If no origin is specified, the username and password are sent to any servers upon unauthorized responses."}],"required":false,"comment":"Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no\norigin is specified, the username and password are sent to any servers upon unauthorized responses.","async":false,"alias":"httpCredentials","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"ignoreHTTPSErrors","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to ignore HTTPS errors when sending network requests. Defaults to `false`."}],"required":false,"comment":"Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.","async":false,"alias":"ignoreHTTPSErrors","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"isMobile","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device, so you don't actually need to set it manually. Defaults to `false` and is not supported in Firefox. Learn more about [mobile emulation](../emulation.md#ismobile)."}],"required":false,"comment":"Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device,\nso you don't actually need to set it manually. Defaults to `false` and is not supported in Firefox. Learn more\nabout [mobile emulation](../emulation.md#ismobile).","async":false,"alias":"isMobile","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"javaScriptEnabled","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether or not to enable JavaScript in the context. Defaults to `true`. Learn more about [disabling JavaScript](../emulation.md#javascript-enabled)."}],"required":false,"comment":"Whether or not to enable JavaScript in the context. Defaults to `true`. Learn more about\n[disabling JavaScript](../emulation.md#javascript-enabled).","async":false,"alias":"javaScriptEnabled","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"locale","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language` request header value as well as number and date formatting rules. Defaults to the system default locale. Learn more about emulation in our [emulation guide](../emulation.md#locale--timezone)."}],"required":false,"comment":"Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value,\n`Accept-Language` request header value as well as number and date formatting rules. Defaults to the system default\nlocale. Learn more about emulation in our [emulation guide](../emulation.md#locale--timezone).","async":false,"alias":"locale","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"logger","type":{"name":"Logger","expression":"[Logger]"},"spec":[{"type":"text","text":"Logger sink for Playwright logging."}],"required":false,"comment":"Logger sink for Playwright logging.","async":false,"alias":"logger","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"noViewport","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Does not enforce fixed viewport, allows resizing window in the headed mode."}],"required":false,"comment":"Does not enforce fixed viewport, allows resizing window in the headed mode.","async":false,"alias":"noViewport","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"offline","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to emulate network being offline. Defaults to `false`. Learn more about [network emulation](../emulation.md#offline)."}],"required":false,"comment":"Whether to emulate network being offline. Defaults to `false`. Learn more about\n[network emulation](../emulation.md#offline).","async":false,"alias":"offline","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"permissions","type":{"name":"Array","templates":[{"name":"string"}],"expression":"[Array]<[string]>"},"spec":[{"type":"text","text":"A list of permissions to grant to all pages in this context. See↵[`method: BrowserContext.grantPermissions`] for more details. Defaults to none."}],"required":false,"comment":"A list of permissions to grant to all pages in this context. See [`method: BrowserContext.grantPermissions`] for\nmore details. Defaults to none.","async":false,"alias":"permissions","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"proxy","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"server","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example↵`http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy."}],"required":true,"comment":"Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or\n`socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.","async":false,"alias":"server","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"bypass","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`."}],"required":false,"comment":"Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.","async":false,"alias":"bypass","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"username","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional username to use if HTTP proxy requires authentication."}],"required":false,"comment":"Optional username to use if HTTP proxy requires authentication.","async":false,"alias":"username","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"password","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional password to use if HTTP proxy requires authentication."}],"required":false,"comment":"Optional password to use if HTTP proxy requires authentication.","async":false,"alias":"password","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Network proxy settings to use with this context. Defaults to none."},{"type":"note","noteType":"note","text":"For Chromium on Windows the browser needs to be launched with the global proxy for this option to work. If all↵contexts override the proxy, global proxy will be never used and can be any string, for example↵`launch({ proxy: { server: 'http://per-context' } })`."}],"required":false,"comment":"Network proxy settings to use with this context. Defaults to none.\n\n**NOTE** For Chromium on Windows the browser needs to be launched with the global proxy for this option to work. If\nall contexts override the proxy, global proxy will be never used and can be any string, for example `launch({\nproxy: { server: 'http://per-context' } })`.","async":false,"alias":"proxy","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"recordHar","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"omitContent","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Optional setting to control whether to omit request content from the HAR. Defaults to↵`false`. Deprecated, use `content` policy instead."}],"required":false,"comment":"Optional setting to control whether to omit request content from the HAR. Defaults to `false`. Deprecated, use\n`content` policy instead.","async":false,"alias":"omitContent","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"content","type":{"name":"HarContentPolicy","union":[{"name":"\"omit\""},{"name":"\"embed\""},{"name":"\"attach\""}],"expression":"[HarContentPolicy]<\"omit\"|\"embed\"|\"attach\">"},"spec":[{"type":"text","text":"Optional setting to control resource content management. If `omit` is specified, content is not persisted. If `attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is specified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output files and to `embed` for all other file extensions."}],"required":false,"comment":"Optional setting to control resource content management. If `omit` is specified, content is not persisted. If\n`attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is\nspecified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output\nfiles and to `embed` for all other file extensions.","async":false,"alias":"content","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path on the filesystem to write the HAR file to. If the file name ends with `.zip`, `content: 'attach'` is used by default."}],"required":true,"comment":"Path on the filesystem to write the HAR file to. If the file name ends with `.zip`, `content: 'attach'` is used by\ndefault.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mode","type":{"name":"HarMode","union":[{"name":"\"full\""},{"name":"\"minimal\""}],"expression":"[HarMode]<\"full\"|\"minimal\">"},"spec":[{"type":"text","text":"When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`."}],"required":false,"comment":"When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,\ncookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.","async":false,"alias":"mode","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"urlFilter","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"A glob or regex pattern to filter requests that are stored in the HAR. When a `baseURL` via the context options was provided and the passed URL is a path, it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. Defaults to none."}],"required":false,"comment":"A glob or regex pattern to filter requests that are stored in the HAR. When a `baseURL` via the context options was\nprovided and the passed URL is a path, it gets merged via the\n[`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. Defaults to none.","async":false,"alias":"urlFilter","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not↵specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be↵saved."}],"required":false,"comment":"Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file.\nIf not specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be\nsaved.","async":false,"alias":"recordHar","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_content"},"types":{},"overrides":{}},"since":"v1.8","name":"recordHarContent","type":{"name":"HarContentPolicy","union":[{"name":"\"omit\""},{"name":"\"embed\""},{"name":"\"attach\""}],"expression":"[HarContentPolicy]<\"omit\"|\"embed\"|\"attach\">"},"spec":[{"type":"text","text":"Optional setting to control resource content management. If `omit` is specified, content is not persisted. If `attach` is specified, resources are persisted as separate files and all of these files are archived along with the HAR file. Defaults to `embed`, which stores content inline the HAR file as per HAR specification."}],"required":false,"comment":"Optional setting to control resource content management. If `omit` is specified, content is not persisted. If\n`attach` is specified, resources are persisted as separate files and all of these files are archived along with the\nHAR file. Defaults to `embed`, which stores content inline the HAR file as per HAR specification.","async":false,"alias":"recordHarContent","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_mode"},"types":{},"overrides":{}},"since":"v1.8","name":"recordHarMode","type":{"name":"HarMode","union":[{"name":"\"full\""},{"name":"\"minimal\""}],"expression":"[HarMode]<\"full\"|\"minimal\">"},"spec":[{"type":"text","text":"When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`."}],"required":false,"comment":"When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,\ncookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.","async":false,"alias":"recordHarMode","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_omit_content"},"types":{},"overrides":{}},"since":"v1.8","name":"recordHarOmitContent","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Optional setting to control whether to omit request content from the HAR. Defaults to `false`."}],"required":false,"comment":"Optional setting to control whether to omit request content from the HAR. Defaults to `false`.","async":false,"alias":"recordHarOmitContent","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_path"},"types":{},"overrides":{}},"since":"v1.8","name":"recordHarPath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the↵specified HAR file on the filesystem. If not specified, the HAR is not recorded. Make sure to↵call [`method: BrowserContext.close`] for the HAR to be saved."}],"required":false,"comment":"Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file\non the filesystem. If not specified, the HAR is not recorded. Make sure to call [`method: BrowserContext.close`]\nfor the HAR to be saved.","async":false,"alias":"recordHarPath","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_url_filter"},"types":{},"overrides":{}},"since":"v1.8","name":"recordHarUrlFilter","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[],"required":false,"comment":"","async":false,"alias":"recordHarUrlFilter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"recordVideo","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"dir","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the directory to put videos into."}],"required":true,"comment":"Path to the directory to put videos into.","async":false,"alias":"dir","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"size","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame width."}],"required":true,"comment":"Video frame width.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame height."}],"required":true,"comment":"Video frame height.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport`↵scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450.↵Actual picture of each page will be scaled down if necessary to fit the specified size."}],"required":false,"comment":"Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to\nfit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of\neach page will be scaled down if necessary to fit the specified size.","async":false,"alias":"size","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make↵sure to await [`method: BrowserContext.close`] for videos to be saved."}],"required":false,"comment":"Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded.\nMake sure to await [`method: BrowserContext.close`] for videos to be saved.","async":false,"alias":"recordVideo","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_video_dir"},"types":{},"overrides":{}},"since":"v1.8","name":"recordVideoDir","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Enables video recording for all pages into the specified directory. If not specified videos are↵not recorded. Make sure to call [`method: BrowserContext.close`] for videos to be saved."}],"required":false,"comment":"Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make\nsure to call [`method: BrowserContext.close`] for videos to be saved.","async":false,"alias":"recordVideoDir","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_video_size"},"types":{},"overrides":{}},"since":"v1.8","name":"recordVideoSize","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame width."}],"required":true,"comment":"Video frame width.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame height."}],"required":true,"comment":"Video frame height.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Dimensions of the recorded videos. If not specified the size will be equal to `viewport`↵scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450.↵Actual picture of each page will be scaled down if necessary to fit the specified size."}],"required":false,"comment":"Dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into\n800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page\nwill be scaled down if necessary to fit the specified size.","async":false,"alias":"recordVideoSize","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"reducedMotion","type":{"name":"","union":[{"name":"null"},{"name":"ReducedMotion","union":[{"name":"\"reduce\""},{"name":"\"no-preference\""}]}],"expression":"null|[ReducedMotion]<\"reduce\"|\"no-preference\">"},"spec":[{"type":"text","text":"Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See [`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'no-preference'`."}],"required":false,"comment":"Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to\n`'no-preference'`.","async":false,"alias":"reducedMotion","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"reducedMotion","type":{"name":"ReducedMotion","union":[{"name":"\"reduce\""},{"name":"\"no-preference\""},{"name":"\"null\""}],"expression":"[ReducedMotion]<\"reduce\"|\"no-preference\"|\"null\">"},"spec":[{"type":"text","text":"Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See [`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'no-preference'`."}],"required":false,"comment":"Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to\n`'no-preference'`.","async":false,"alias":"reducedMotion","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"aliases":{"java":"screenSize","csharp":"screenSize"},"types":{},"overrides":{}},"since":"v1.8","name":"screen","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page width in pixels."}],"required":true,"comment":"page width in pixels.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page height in pixels."}],"required":true,"comment":"page height in pixels.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the↵`viewport` is set."}],"required":false,"comment":"Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the\n`viewport` is set.","async":false,"alias":"screen","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"serviceWorkers","type":{"name":"ServiceWorkerPolicy","union":[{"name":"\"allow\""},{"name":"\"block\""}],"expression":"[ServiceWorkerPolicy]<\"allow\"|\"block\">"},"spec":[{"type":"text","text":"Whether to allow sites to register Service workers. Defaults to `'allow'`."},{"type":"li","text":"`'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be registered.","liType":"bullet"},{"type":"li","text":"`'block'`: Playwright will block all registration of Service Workers.","liType":"bullet"}],"required":false,"comment":"Whether to allow sites to register Service workers. Defaults to `'allow'`.\n- `'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be\n registered.\n- `'block'`: Playwright will block all registration of Service Workers.","async":false,"alias":"serviceWorkers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"storageState","type":{"name":"","union":[{"name":"path"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"cookies","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"domain","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Domain and path are required. For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: \".example.com\""}],"required":true,"comment":"Domain and path are required. For the cookie to apply to all subdomains as well, prefix domain with a dot, like\nthis: \".example.com\"","async":false,"alias":"domain","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"path","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Domain and path are required"}],"required":true,"comment":"Domain and path are required","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"expires","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Unix time in seconds."}],"required":true,"comment":"Unix time in seconds.","async":false,"alias":"expires","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"httpOnly","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"httpOnly","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"secure","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"secure","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"sameSite","type":{"name":"SameSiteAttribute","union":[{"name":"\"Strict\""},{"name":"\"Lax\""},{"name":"\"None\""}],"expression":"[SameSiteAttribute]<\"Strict\"|\"Lax\"|\"None\">"},"spec":[{"type":"text","text":"sameSite flag"}],"required":true,"comment":"sameSite flag","async":false,"alias":"sameSite","overloadIndex":0,"paramOrOption":null}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":"Cookies to set for context"}],"required":true,"comment":"Cookies to set for context","async":false,"alias":"cookies","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"origins","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"origin","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"origin","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"localStorage","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"localStorage","overloadIndex":0,"paramOrOption":null}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":"localStorage to set for context"}],"required":true,"comment":"localStorage to set for context","async":false,"alias":"origins","overloadIndex":0,"paramOrOption":null}]}],"expression":"[path]|[Object]"},"spec":[{"type":"text","text":"Learn more about [storage state and auth](../auth.md)."},{"type":"text","text":"Populates context with given storage state. This option can be used to initialize context with logged-in information obtained via [`method: BrowserContext.storageState`]."}],"required":false,"comment":"Learn more about [storage state and auth](../auth.md).\n\nPopulates context with given storage state. This option can be used to initialize context with logged-in\ninformation obtained via [`method: BrowserContext.storageState`].","async":false,"alias":"storageState","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"storageState","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Populates context with given storage state. This option can be used to initialize context with logged-in information↵obtained via [`method: BrowserContext.storageState`]."}],"required":false,"comment":"Populates context with given storage state. This option can be used to initialize context with logged-in\ninformation obtained via [`method: BrowserContext.storageState`].","async":false,"alias":"storageState","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"storageStatePath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Populates context with given storage state. This option can be used to initialize context with logged-in information↵obtained via [`method: BrowserContext.storageState`]. Path to the file with saved storage state."}],"required":false,"comment":"Populates context with given storage state. This option can be used to initialize context with logged-in\ninformation obtained via [`method: BrowserContext.storageState`]. Path to the file with saved storage state.","async":false,"alias":"storageStatePath","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"strictSelectors","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations↵on selectors that imply single target DOM element will throw when more than one element matches the selector.↵This option does not affect any Locator APIs (Locators are always strict). Defaults to `false`.↵See `Locator` to learn more about the strict mode."}],"required":false,"comment":"If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations on\nselectors that imply single target DOM element will throw when more than one element matches the selector. This\noption does not affect any Locator APIs (Locators are always strict). Defaults to `false`. See `Locator` to learn\nmore about the strict mode.","async":false,"alias":"strictSelectors","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"timezoneId","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Changes the timezone of the context. See [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)↵for a list of supported timezone IDs. Defaults to the system timezone."}],"required":false,"comment":"Changes the timezone of the context. See\n[ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)\nfor a list of supported timezone IDs. Defaults to the system timezone.","async":false,"alias":"timezoneId","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"userAgent","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Specific user agent to use in this context."}],"required":false,"comment":"Specific user agent to use in this context.","async":false,"alias":"userAgent","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","deprecated":"Use `recordVideo` instead.","name":"videoSize","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame width."}],"required":true,"comment":"Video frame width.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame height."}],"required":true,"comment":"Video frame height.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[],"required":false,"comment":"","async":false,"alias":"videoSize","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","deprecated":"Use `recordVideo` instead.","name":"videosPath","type":{"name":"path","expression":"[path]"},"spec":[],"required":false,"comment":"","async":false,"alias":"videosPath","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","java"],"aliases":{"java":"viewportSize"},"types":{},"overrides":{}},"since":"v1.8","name":"viewport","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page width in pixels."}],"required":true,"comment":"page width in pixels.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page height in pixels."}],"required":true,"comment":"page height in pixels.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}]}],"expression":"[null]|[Object]"},"spec":[{"type":"text","text":"Emulates consistent viewport for each page. Defaults to an 1280x720 viewport.↵Use `null` to disable the consistent viewport emulation. Learn more about [viewport emulation](../emulation#viewport)."},{"type":"note","noteType":"note","text":"The `null` value opts out from the default presets, makes viewport depend on the↵host window size defined by the operating system. It makes the execution of the↵tests non-deterministic."}],"required":false,"comment":"Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `null` to disable the consistent\nviewport emulation. Learn more about [viewport emulation](../emulation#viewport).\n\n**NOTE** The `null` value opts out from the default presets, makes viewport depend on the host window size defined\nby the operating system. It makes the execution of the tests non-deterministic.","async":false,"alias":"viewport","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{"csharp":"viewportSize"},"types":{},"overrides":{}},"since":"v1.8","name":"viewport","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page width in pixels."}],"required":true,"comment":"page width in pixels.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page height in pixels."}],"required":true,"comment":"page height in pixels.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}]}],"expression":"[null]|[Object]"},"spec":[{"type":"text","text":"Emulates consistent viewport for each page. Defaults to an 1280x720 viewport.↵Use `ViewportSize.NoViewport` to disable the consistent viewport emulation. Learn more about [viewport emulation](../emulation.md#viewport)."},{"type":"note","noteType":"note","text":"The `ViewportSize.NoViewport` value opts out from the default presets,↵makes viewport depend on the host window size defined by the operating system.↵It makes the execution of the tests non-deterministic."}],"required":false,"comment":"Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `ViewportSize.NoViewport` to\ndisable the consistent viewport emulation. Learn more about [viewport emulation](../emulation.md#viewport).\n\n**NOTE** The `ViewportSize.NoViewport` value opts out from the default presets, makes viewport depend on the host\nwindow size defined by the operating system. It makes the execution of the tests non-deterministic.","async":false,"alias":"viewport","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"viewport","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page width in pixels."}],"required":true,"comment":"page width in pixels.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page height in pixels."}],"required":true,"comment":"page height in pixels.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}]}],"expression":"[null]|[Object]"},"spec":[{"type":"text","text":"Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed viewport. Learn more about [viewport emulation](../emulation.md#viewport)."}],"required":false,"comment":"Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed\nviewport. Learn more about [viewport emulation](../emulation.md#viewport).","async":false,"alias":"viewport","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"newPage","type":{"name":"Page","expression":"[Page]"},"spec":[{"type":"text","text":"Creates a new page in a new browser context. Closing this page will close the context as well."},{"type":"text","text":"This is a convenience API that should only be used for the single-page scenarios and short snippets. Production code and↵testing frameworks should explicitly create [`method: Browser.newContext`] followed by the↵[`method: BrowserContext.newPage`] to control their exact life times."}],"required":true,"comment":"Creates a new page in a new browser context. Closing this page will close the context as well.\n\nThis is a convenience API that should only be used for the single-page scenarios and short snippets. Production\ncode and testing frameworks should explicitly create [`method: Browser.newContext`] followed by the\n[`method: BrowserContext.newPage`] to control their exact life times.","async":true,"alias":"newPage","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"acceptDownloads","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted."}],"required":false,"comment":"Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted.","async":false,"alias":"acceptDownloads","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"baseURL","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"When using [`method: Page.goto`], [`method: Page.route`], [`method: Page.waitForURL`], [`method: Page.waitForRequest`], or [`method: Page.waitForResponse`] it takes the base URL in consideration by using the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL. Unset by default. Examples:"},{"type":"li","text":"baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html`","liType":"bullet"},{"type":"li","text":"baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in `http://localhost:3000/foo/bar.html`","liType":"bullet"},{"type":"li","text":"baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in `http://localhost:3000/bar.html`","liType":"bullet"}],"required":false,"comment":"When using [`method: Page.goto`], [`method: Page.route`], [`method: Page.waitForURL`],\n[`method: Page.waitForRequest`], or [`method: Page.waitForResponse`] it takes the base URL in consideration by\nusing the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the\ncorresponding URL. Unset by default. Examples:\n- baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html`\n- baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in\n `http://localhost:3000/foo/bar.html`\n- baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in\n `http://localhost:3000/bar.html`","async":false,"alias":"baseURL","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"bypassCSP","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Toggles bypassing page's Content-Security-Policy. Defaults to `false`."}],"required":false,"comment":"Toggles bypassing page's Content-Security-Policy. Defaults to `false`.","async":false,"alias":"bypassCSP","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"colorScheme","type":{"name":"","union":[{"name":"null"},{"name":"ColorScheme","union":[{"name":"\"light\""},{"name":"\"dark\""},{"name":"\"no-preference\""}]}],"expression":"null|[ColorScheme]<\"light\"|\"dark\"|\"no-preference\">"},"spec":[{"type":"text","text":"Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See↵[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'light'`."}],"required":false,"comment":"Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to\n`'light'`.","async":false,"alias":"colorScheme","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"colorScheme","type":{"name":"ColorScheme","union":[{"name":"\"light\""},{"name":"\"dark\""},{"name":"\"no-preference\""},{"name":"\"null\""}],"expression":"[ColorScheme]<\"light\"|\"dark\"|\"no-preference\"|\"null\">"},"spec":[{"type":"text","text":"Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See↵[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'light'`."}],"required":false,"comment":"Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to\n`'light'`.","async":false,"alias":"colorScheme","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"deviceScaleFactor","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about [emulating devices with device scale factor](../emulation.md#devices)."}],"required":false,"comment":"Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about\n[emulating devices with device scale factor](../emulation.md#devices).","async":false,"alias":"deviceScaleFactor","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"extraHTTPHeaders","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"An object containing additional HTTP headers to be sent with every request. Defaults to none."}],"required":false,"comment":"An object containing additional HTTP headers to be sent with every request. Defaults to none.","async":false,"alias":"extraHTTPHeaders","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"forcedColors","type":{"name":"","union":[{"name":"null"},{"name":"ForcedColors","union":[{"name":"\"active\""},{"name":"\"none\""}]}],"expression":"null|[ForcedColors]<\"active\"|\"none\">"},"spec":[{"type":"text","text":"Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See [`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'none'`."}],"required":false,"comment":"Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See\n[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to\n`'none'`.","async":false,"alias":"forcedColors","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"forcedColors","type":{"name":"ForcedColors","union":[{"name":"\"active\""},{"name":"\"none\""},{"name":"\"null\""}],"expression":"[ForcedColors]<\"active\"|\"none\"|\"null\">"},"spec":[{"type":"text","text":"Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See [`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'none'`."}],"required":false,"comment":"Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See\n[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to\n`'none'`.","async":false,"alias":"forcedColors","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"geolocation","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"latitude","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Latitude between -90 and 90."}],"required":true,"comment":"Latitude between -90 and 90.","async":false,"alias":"latitude","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"longitude","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Longitude between -180 and 180."}],"required":true,"comment":"Longitude between -180 and 180.","async":false,"alias":"longitude","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"accuracy","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Non-negative accuracy value. Defaults to `0`."}],"required":false,"comment":"Non-negative accuracy value. Defaults to `0`.","async":false,"alias":"accuracy","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[],"required":false,"comment":"","async":false,"alias":"geolocation","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"hasTouch","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Specifies if viewport supports touch events. Defaults to false. Learn more about [mobile emulation](../emulation.md#devices)."}],"required":false,"comment":"Specifies if viewport supports touch events. Defaults to false. Learn more about\n[mobile emulation](../emulation.md#devices).","async":false,"alias":"hasTouch","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"httpCredentials","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"username","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"username","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"password","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"password","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"origin","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Restrain sending http credentials on specific origin (scheme://host:port)."}],"required":false,"comment":"Restrain sending http credentials on specific origin (scheme://host:port).","async":false,"alias":"origin","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"send","type":{"name":"HttpCredentialsSend","union":[{"name":"\"unauthorized\""},{"name":"\"always\""}],"expression":"[HttpCredentialsSend]<\"unauthorized\"|\"always\">"},"spec":[{"type":"text","text":"This option only applies to the requests sent from corresponding `APIRequestContext` and does not affect requests sent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with `WWW-Authenticate` header is received. Defaults to `'unauthorized'`."}],"required":false,"comment":"This option only applies to the requests sent from corresponding `APIRequestContext` and does not affect requests\nsent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with\nthe each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with\n`WWW-Authenticate` header is received. Defaults to `'unauthorized'`.","async":false,"alias":"send","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).↵If no origin is specified, the username and password are sent to any servers upon unauthorized responses."}],"required":false,"comment":"Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no\norigin is specified, the username and password are sent to any servers upon unauthorized responses.","async":false,"alias":"httpCredentials","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"ignoreHTTPSErrors","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to ignore HTTPS errors when sending network requests. Defaults to `false`."}],"required":false,"comment":"Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.","async":false,"alias":"ignoreHTTPSErrors","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"isMobile","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device, so you don't actually need to set it manually. Defaults to `false` and is not supported in Firefox. Learn more about [mobile emulation](../emulation.md#ismobile)."}],"required":false,"comment":"Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device,\nso you don't actually need to set it manually. Defaults to `false` and is not supported in Firefox. Learn more\nabout [mobile emulation](../emulation.md#ismobile).","async":false,"alias":"isMobile","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"javaScriptEnabled","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether or not to enable JavaScript in the context. Defaults to `true`. Learn more about [disabling JavaScript](../emulation.md#javascript-enabled)."}],"required":false,"comment":"Whether or not to enable JavaScript in the context. Defaults to `true`. Learn more about\n[disabling JavaScript](../emulation.md#javascript-enabled).","async":false,"alias":"javaScriptEnabled","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"locale","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language` request header value as well as number and date formatting rules. Defaults to the system default locale. Learn more about emulation in our [emulation guide](../emulation.md#locale--timezone)."}],"required":false,"comment":"Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value,\n`Accept-Language` request header value as well as number and date formatting rules. Defaults to the system default\nlocale. Learn more about emulation in our [emulation guide](../emulation.md#locale--timezone).","async":false,"alias":"locale","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"logger","type":{"name":"Logger","expression":"[Logger]"},"spec":[{"type":"text","text":"Logger sink for Playwright logging."}],"required":false,"comment":"Logger sink for Playwright logging.","async":false,"alias":"logger","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"noViewport","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Does not enforce fixed viewport, allows resizing window in the headed mode."}],"required":false,"comment":"Does not enforce fixed viewport, allows resizing window in the headed mode.","async":false,"alias":"noViewport","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"offline","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to emulate network being offline. Defaults to `false`. Learn more about [network emulation](../emulation.md#offline)."}],"required":false,"comment":"Whether to emulate network being offline. Defaults to `false`. Learn more about\n[network emulation](../emulation.md#offline).","async":false,"alias":"offline","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"permissions","type":{"name":"Array","templates":[{"name":"string"}],"expression":"[Array]<[string]>"},"spec":[{"type":"text","text":"A list of permissions to grant to all pages in this context. See↵[`method: BrowserContext.grantPermissions`] for more details. Defaults to none."}],"required":false,"comment":"A list of permissions to grant to all pages in this context. See [`method: BrowserContext.grantPermissions`] for\nmore details. Defaults to none.","async":false,"alias":"permissions","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"proxy","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"server","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example↵`http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy."}],"required":true,"comment":"Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or\n`socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.","async":false,"alias":"server","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"bypass","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`."}],"required":false,"comment":"Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.","async":false,"alias":"bypass","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"username","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional username to use if HTTP proxy requires authentication."}],"required":false,"comment":"Optional username to use if HTTP proxy requires authentication.","async":false,"alias":"username","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"password","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional password to use if HTTP proxy requires authentication."}],"required":false,"comment":"Optional password to use if HTTP proxy requires authentication.","async":false,"alias":"password","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Network proxy settings to use with this context. Defaults to none."},{"type":"note","noteType":"note","text":"For Chromium on Windows the browser needs to be launched with the global proxy for this option to work. If all↵contexts override the proxy, global proxy will be never used and can be any string, for example↵`launch({ proxy: { server: 'http://per-context' } })`."}],"required":false,"comment":"Network proxy settings to use with this context. Defaults to none.\n\n**NOTE** For Chromium on Windows the browser needs to be launched with the global proxy for this option to work. If\nall contexts override the proxy, global proxy will be never used and can be any string, for example `launch({\nproxy: { server: 'http://per-context' } })`.","async":false,"alias":"proxy","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"recordHar","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"omitContent","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Optional setting to control whether to omit request content from the HAR. Defaults to↵`false`. Deprecated, use `content` policy instead."}],"required":false,"comment":"Optional setting to control whether to omit request content from the HAR. Defaults to `false`. Deprecated, use\n`content` policy instead.","async":false,"alias":"omitContent","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"content","type":{"name":"HarContentPolicy","union":[{"name":"\"omit\""},{"name":"\"embed\""},{"name":"\"attach\""}],"expression":"[HarContentPolicy]<\"omit\"|\"embed\"|\"attach\">"},"spec":[{"type":"text","text":"Optional setting to control resource content management. If `omit` is specified, content is not persisted. If `attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is specified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output files and to `embed` for all other file extensions."}],"required":false,"comment":"Optional setting to control resource content management. If `omit` is specified, content is not persisted. If\n`attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is\nspecified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output\nfiles and to `embed` for all other file extensions.","async":false,"alias":"content","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path on the filesystem to write the HAR file to. If the file name ends with `.zip`, `content: 'attach'` is used by default."}],"required":true,"comment":"Path on the filesystem to write the HAR file to. If the file name ends with `.zip`, `content: 'attach'` is used by\ndefault.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mode","type":{"name":"HarMode","union":[{"name":"\"full\""},{"name":"\"minimal\""}],"expression":"[HarMode]<\"full\"|\"minimal\">"},"spec":[{"type":"text","text":"When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`."}],"required":false,"comment":"When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,\ncookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.","async":false,"alias":"mode","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"urlFilter","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"A glob or regex pattern to filter requests that are stored in the HAR. When a `baseURL` via the context options was provided and the passed URL is a path, it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. Defaults to none."}],"required":false,"comment":"A glob or regex pattern to filter requests that are stored in the HAR. When a `baseURL` via the context options was\nprovided and the passed URL is a path, it gets merged via the\n[`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. Defaults to none.","async":false,"alias":"urlFilter","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not↵specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be↵saved."}],"required":false,"comment":"Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file.\nIf not specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be\nsaved.","async":false,"alias":"recordHar","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_content"},"types":{},"overrides":{}},"since":"v1.8","name":"recordHarContent","type":{"name":"HarContentPolicy","union":[{"name":"\"omit\""},{"name":"\"embed\""},{"name":"\"attach\""}],"expression":"[HarContentPolicy]<\"omit\"|\"embed\"|\"attach\">"},"spec":[{"type":"text","text":"Optional setting to control resource content management. If `omit` is specified, content is not persisted. If `attach` is specified, resources are persisted as separate files and all of these files are archived along with the HAR file. Defaults to `embed`, which stores content inline the HAR file as per HAR specification."}],"required":false,"comment":"Optional setting to control resource content management. If `omit` is specified, content is not persisted. If\n`attach` is specified, resources are persisted as separate files and all of these files are archived along with the\nHAR file. Defaults to `embed`, which stores content inline the HAR file as per HAR specification.","async":false,"alias":"recordHarContent","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_mode"},"types":{},"overrides":{}},"since":"v1.8","name":"recordHarMode","type":{"name":"HarMode","union":[{"name":"\"full\""},{"name":"\"minimal\""}],"expression":"[HarMode]<\"full\"|\"minimal\">"},"spec":[{"type":"text","text":"When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`."}],"required":false,"comment":"When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,\ncookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.","async":false,"alias":"recordHarMode","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_omit_content"},"types":{},"overrides":{}},"since":"v1.8","name":"recordHarOmitContent","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Optional setting to control whether to omit request content from the HAR. Defaults to `false`."}],"required":false,"comment":"Optional setting to control whether to omit request content from the HAR. Defaults to `false`.","async":false,"alias":"recordHarOmitContent","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_path"},"types":{},"overrides":{}},"since":"v1.8","name":"recordHarPath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the↵specified HAR file on the filesystem. If not specified, the HAR is not recorded. Make sure to↵call [`method: BrowserContext.close`] for the HAR to be saved."}],"required":false,"comment":"Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file\non the filesystem. If not specified, the HAR is not recorded. Make sure to call [`method: BrowserContext.close`]\nfor the HAR to be saved.","async":false,"alias":"recordHarPath","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_url_filter"},"types":{},"overrides":{}},"since":"v1.8","name":"recordHarUrlFilter","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[],"required":false,"comment":"","async":false,"alias":"recordHarUrlFilter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"recordVideo","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"dir","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the directory to put videos into."}],"required":true,"comment":"Path to the directory to put videos into.","async":false,"alias":"dir","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"size","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame width."}],"required":true,"comment":"Video frame width.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame height."}],"required":true,"comment":"Video frame height.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport`↵scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450.↵Actual picture of each page will be scaled down if necessary to fit the specified size."}],"required":false,"comment":"Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to\nfit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of\neach page will be scaled down if necessary to fit the specified size.","async":false,"alias":"size","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make↵sure to await [`method: BrowserContext.close`] for videos to be saved."}],"required":false,"comment":"Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded.\nMake sure to await [`method: BrowserContext.close`] for videos to be saved.","async":false,"alias":"recordVideo","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_video_dir"},"types":{},"overrides":{}},"since":"v1.8","name":"recordVideoDir","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Enables video recording for all pages into the specified directory. If not specified videos are↵not recorded. Make sure to call [`method: BrowserContext.close`] for videos to be saved."}],"required":false,"comment":"Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make\nsure to call [`method: BrowserContext.close`] for videos to be saved.","async":false,"alias":"recordVideoDir","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_video_size"},"types":{},"overrides":{}},"since":"v1.8","name":"recordVideoSize","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame width."}],"required":true,"comment":"Video frame width.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame height."}],"required":true,"comment":"Video frame height.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Dimensions of the recorded videos. If not specified the size will be equal to `viewport`↵scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450.↵Actual picture of each page will be scaled down if necessary to fit the specified size."}],"required":false,"comment":"Dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into\n800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page\nwill be scaled down if necessary to fit the specified size.","async":false,"alias":"recordVideoSize","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"reducedMotion","type":{"name":"","union":[{"name":"null"},{"name":"ReducedMotion","union":[{"name":"\"reduce\""},{"name":"\"no-preference\""}]}],"expression":"null|[ReducedMotion]<\"reduce\"|\"no-preference\">"},"spec":[{"type":"text","text":"Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See [`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'no-preference'`."}],"required":false,"comment":"Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to\n`'no-preference'`.","async":false,"alias":"reducedMotion","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"reducedMotion","type":{"name":"ReducedMotion","union":[{"name":"\"reduce\""},{"name":"\"no-preference\""},{"name":"\"null\""}],"expression":"[ReducedMotion]<\"reduce\"|\"no-preference\"|\"null\">"},"spec":[{"type":"text","text":"Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See [`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'no-preference'`."}],"required":false,"comment":"Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to\n`'no-preference'`.","async":false,"alias":"reducedMotion","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"aliases":{"java":"screenSize","csharp":"screenSize"},"types":{},"overrides":{}},"since":"v1.8","name":"screen","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page width in pixels."}],"required":true,"comment":"page width in pixels.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page height in pixels."}],"required":true,"comment":"page height in pixels.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the↵`viewport` is set."}],"required":false,"comment":"Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the\n`viewport` is set.","async":false,"alias":"screen","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"serviceWorkers","type":{"name":"ServiceWorkerPolicy","union":[{"name":"\"allow\""},{"name":"\"block\""}],"expression":"[ServiceWorkerPolicy]<\"allow\"|\"block\">"},"spec":[{"type":"text","text":"Whether to allow sites to register Service workers. Defaults to `'allow'`."},{"type":"li","text":"`'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be registered.","liType":"bullet"},{"type":"li","text":"`'block'`: Playwright will block all registration of Service Workers.","liType":"bullet"}],"required":false,"comment":"Whether to allow sites to register Service workers. Defaults to `'allow'`.\n- `'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be\n registered.\n- `'block'`: Playwright will block all registration of Service Workers.","async":false,"alias":"serviceWorkers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"storageState","type":{"name":"","union":[{"name":"path"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"cookies","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"domain","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Domain and path are required. For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: \".example.com\""}],"required":true,"comment":"Domain and path are required. For the cookie to apply to all subdomains as well, prefix domain with a dot, like\nthis: \".example.com\"","async":false,"alias":"domain","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"path","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Domain and path are required"}],"required":true,"comment":"Domain and path are required","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"expires","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Unix time in seconds."}],"required":true,"comment":"Unix time in seconds.","async":false,"alias":"expires","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"httpOnly","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"httpOnly","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"secure","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"secure","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"sameSite","type":{"name":"SameSiteAttribute","union":[{"name":"\"Strict\""},{"name":"\"Lax\""},{"name":"\"None\""}],"expression":"[SameSiteAttribute]<\"Strict\"|\"Lax\"|\"None\">"},"spec":[{"type":"text","text":"sameSite flag"}],"required":true,"comment":"sameSite flag","async":false,"alias":"sameSite","overloadIndex":0,"paramOrOption":null}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":"Cookies to set for context"}],"required":true,"comment":"Cookies to set for context","async":false,"alias":"cookies","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"origins","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"origin","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"origin","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"localStorage","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"localStorage","overloadIndex":0,"paramOrOption":null}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":"localStorage to set for context"}],"required":true,"comment":"localStorage to set for context","async":false,"alias":"origins","overloadIndex":0,"paramOrOption":null}]}],"expression":"[path]|[Object]"},"spec":[{"type":"text","text":"Learn more about [storage state and auth](../auth.md)."},{"type":"text","text":"Populates context with given storage state. This option can be used to initialize context with logged-in information obtained via [`method: BrowserContext.storageState`]."}],"required":false,"comment":"Learn more about [storage state and auth](../auth.md).\n\nPopulates context with given storage state. This option can be used to initialize context with logged-in\ninformation obtained via [`method: BrowserContext.storageState`].","async":false,"alias":"storageState","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"storageState","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Populates context with given storage state. This option can be used to initialize context with logged-in information↵obtained via [`method: BrowserContext.storageState`]."}],"required":false,"comment":"Populates context with given storage state. This option can be used to initialize context with logged-in\ninformation obtained via [`method: BrowserContext.storageState`].","async":false,"alias":"storageState","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"storageStatePath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Populates context with given storage state. This option can be used to initialize context with logged-in information↵obtained via [`method: BrowserContext.storageState`]. Path to the file with saved storage state."}],"required":false,"comment":"Populates context with given storage state. This option can be used to initialize context with logged-in\ninformation obtained via [`method: BrowserContext.storageState`]. Path to the file with saved storage state.","async":false,"alias":"storageStatePath","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"strictSelectors","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations↵on selectors that imply single target DOM element will throw when more than one element matches the selector.↵This option does not affect any Locator APIs (Locators are always strict). Defaults to `false`.↵See `Locator` to learn more about the strict mode."}],"required":false,"comment":"If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations on\nselectors that imply single target DOM element will throw when more than one element matches the selector. This\noption does not affect any Locator APIs (Locators are always strict). Defaults to `false`. See `Locator` to learn\nmore about the strict mode.","async":false,"alias":"strictSelectors","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"timezoneId","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Changes the timezone of the context. See [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)↵for a list of supported timezone IDs. Defaults to the system timezone."}],"required":false,"comment":"Changes the timezone of the context. See\n[ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)\nfor a list of supported timezone IDs. Defaults to the system timezone.","async":false,"alias":"timezoneId","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"userAgent","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Specific user agent to use in this context."}],"required":false,"comment":"Specific user agent to use in this context.","async":false,"alias":"userAgent","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","deprecated":"Use `recordVideo` instead.","name":"videoSize","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame width."}],"required":true,"comment":"Video frame width.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame height."}],"required":true,"comment":"Video frame height.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[],"required":false,"comment":"","async":false,"alias":"videoSize","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","deprecated":"Use `recordVideo` instead.","name":"videosPath","type":{"name":"path","expression":"[path]"},"spec":[],"required":false,"comment":"","async":false,"alias":"videosPath","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","java"],"aliases":{"java":"viewportSize"},"types":{},"overrides":{}},"since":"v1.8","name":"viewport","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page width in pixels."}],"required":true,"comment":"page width in pixels.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page height in pixels."}],"required":true,"comment":"page height in pixels.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}]}],"expression":"[null]|[Object]"},"spec":[{"type":"text","text":"Emulates consistent viewport for each page. Defaults to an 1280x720 viewport.↵Use `null` to disable the consistent viewport emulation. Learn more about [viewport emulation](../emulation#viewport)."},{"type":"note","noteType":"note","text":"The `null` value opts out from the default presets, makes viewport depend on the↵host window size defined by the operating system. It makes the execution of the↵tests non-deterministic."}],"required":false,"comment":"Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `null` to disable the consistent\nviewport emulation. Learn more about [viewport emulation](../emulation#viewport).\n\n**NOTE** The `null` value opts out from the default presets, makes viewport depend on the host window size defined\nby the operating system. It makes the execution of the tests non-deterministic.","async":false,"alias":"viewport","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{"csharp":"viewportSize"},"types":{},"overrides":{}},"since":"v1.8","name":"viewport","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page width in pixels."}],"required":true,"comment":"page width in pixels.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page height in pixels."}],"required":true,"comment":"page height in pixels.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}]}],"expression":"[null]|[Object]"},"spec":[{"type":"text","text":"Emulates consistent viewport for each page. Defaults to an 1280x720 viewport.↵Use `ViewportSize.NoViewport` to disable the consistent viewport emulation. Learn more about [viewport emulation](../emulation.md#viewport)."},{"type":"note","noteType":"note","text":"The `ViewportSize.NoViewport` value opts out from the default presets,↵makes viewport depend on the host window size defined by the operating system.↵It makes the execution of the tests non-deterministic."}],"required":false,"comment":"Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `ViewportSize.NoViewport` to\ndisable the consistent viewport emulation. Learn more about [viewport emulation](../emulation.md#viewport).\n\n**NOTE** The `ViewportSize.NoViewport` value opts out from the default presets, makes viewport depend on the host\nwindow size defined by the operating system. It makes the execution of the tests non-deterministic.","async":false,"alias":"viewport","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"viewport","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page width in pixels."}],"required":true,"comment":"page width in pixels.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page height in pixels."}],"required":true,"comment":"page height in pixels.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}]}],"expression":"[null]|[Object]"},"spec":[{"type":"text","text":"Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed viewport. Learn more about [viewport emulation](../emulation.md#viewport)."}],"required":false,"comment":"Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed\nviewport. Learn more about [viewport emulation](../emulation.md#viewport).","async":false,"alias":"viewport","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["java","js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.11","name":"startTracing","type":{"name":"void"},"spec":[{"type":"note","noteType":"note","text":"This API controls [Chromium Tracing](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) which is a low-level chromium-specific debugging tool. API to control [Playwright Tracing](../trace-viewer) could be found [here](./class-tracing)."},{"type":"text","text":"You can use [`method: Browser.startTracing`] and [`method: Browser.stopTracing`] to create a trace file that can↵be opened in Chrome DevTools performance panel."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await browser.startTracing(page, { path: 'trace.json' });","await page.goto('https://www.google.com');","await browser.stopTracing();"],"codeLang":"js"},{"type":"code","lines":["browser.startTracing(page, new Browser.StartTracingOptions()"," .setPath(Paths.get(\"trace.json\")));","page.goto('https://www.google.com');","browser.stopTracing();"],"codeLang":"java"},{"type":"code","lines":["await browser.start_tracing(page, path=\"trace.json\")","await page.goto(\"https://www.google.com\")","await browser.stop_tracing()"],"codeLang":"python async"},{"type":"code","lines":["browser.start_tracing(page, path=\"trace.json\")","page.goto(\"https://www.google.com\")","browser.stop_tracing()"],"codeLang":"python sync"}],"required":true,"comment":"**NOTE** This API controls\n[Chromium Tracing](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) which is a low-level\nchromium-specific debugging tool. API to control [Playwright Tracing](../trace-viewer) could be found\n[here](./class-tracing).\n\nYou can use [`method: Browser.startTracing`] and [`method: Browser.stopTracing`] to create a trace file that can be\nopened in Chrome DevTools performance panel.\n\n**Usage**\n\n```js\nawait browser.startTracing(page, { path: 'trace.json' });\nawait page.goto('https://www.google.com');\nawait browser.stopTracing();\n```\n\n```java\nbrowser.startTracing(page, new Browser.StartTracingOptions()\n .setPath(Paths.get(\"trace.json\")));\npage.goto('https://www.google.com');\nbrowser.stopTracing();\n```\n\n```py\nawait browser.start_tracing(page, path=\"trace.json\")\nawait page.goto(\"https://www.google.com\")\nawait browser.stop_tracing()\n```\n\n```py\nbrowser.start_tracing(page, path=\"trace.json\")\npage.goto(\"https://www.google.com\")\nbrowser.stop_tracing()\n```\n","async":true,"alias":"startTracing","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.11","name":"page","type":{"name":"Page","expression":"[Page]"},"spec":[{"type":"text","text":"Optional, if specified, tracing includes screenshots of the given page."}],"required":false,"comment":"Optional, if specified, tracing includes screenshots of the given page.","async":false,"alias":"page","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.11","name":"categories","type":{"name":"Array","templates":[{"name":"string"}],"expression":"[Array]<[string]>"},"spec":[{"type":"text","text":"specify custom categories to use instead of default."}],"required":false,"comment":"specify custom categories to use instead of default.","async":false,"alias":"categories","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"A path to write the trace file to."}],"required":false,"comment":"A path to write the trace file to.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"screenshots","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"captures screenshots in the trace."}],"required":false,"comment":"captures screenshots in the trace.","async":false,"alias":"screenshots","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["java","js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.11","name":"stopTracing","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"note","noteType":"note","text":"This API controls [Chromium Tracing](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) which is a low-level chromium-specific debugging tool. API to control [Playwright Tracing](../trace-viewer) could be found [here](./class-tracing)."},{"type":"text","text":"Returns the buffer with trace data."}],"required":true,"comment":"**NOTE** This API controls\n[Chromium Tracing](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) which is a low-level\nchromium-specific debugging tool. API to control [Playwright Tracing](../trace-viewer) could be found\n[here](./class-tracing).\n\nReturns the buffer with trace data.","async":true,"alias":"stopTracing","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"version","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Returns the browser version."}],"required":true,"comment":"Returns the browser version.","async":false,"alias":"version","overloadIndex":0,"paramOrOption":null,"args":[]}]},{"name":"BrowserContext","spec":[{"type":"li","text":"extends: [EventEmitter]","liType":"bullet"},{"type":"text","text":"BrowserContexts provide a way to operate multiple independent browser sessions."},{"type":"text","text":"If a page opens another page, e.g. with a `window.open` call, the popup will belong to the parent page's browser↵context."},{"type":"text","text":"Playwright allows creating \"incognito\" browser contexts with [`method: Browser.newContext`] method. \"Incognito\" browser↵contexts don't write any browsing data to disk."},{"type":"code","lines":["// Create a new incognito browser context","const context = await browser.newContext();","// Create a new page inside context.","const page = await context.newPage();","await page.goto('https://example.com');","// Dispose context once it's no longer needed.","await context.close();"],"codeLang":"js"},{"type":"code","lines":["// Create a new incognito browser context","BrowserContext context = browser.newContext();","// Create a new page inside context.","Page page = context.newPage();","page.navigate(\"https://example.com\");","// Dispose context once it is no longer needed.","context.close();"],"codeLang":"java"},{"type":"code","lines":["# create a new incognito browser context","context = await browser.new_context()","# create a new page inside context.","page = await context.new_page()","await page.goto(\"https://example.com\")","# dispose context once it is no longer needed.","await context.close()"],"codeLang":"python async"},{"type":"code","lines":["# create a new incognito browser context","context = browser.new_context()","# create a new page inside context.","page = context.new_page()","page.goto(\"https://example.com\")","# dispose context once it is no longer needed.","context.close()"],"codeLang":"python sync"},{"type":"code","lines":["using var playwright = await Playwright.CreateAsync();","var browser = await playwright.Firefox.LaunchAsync(new() { Headless = false });","// Create a new incognito browser context","var context = await browser.NewContextAsync();","// Create a new page inside context.","var page = await context.NewPageAsync();","await page.GotoAsync(\"https://bing.com\");","// Dispose context once it is no longer needed.","await context.CloseAsync();"],"codeLang":"csharp"}],"extends":"EventEmitter","langs":{},"comment":"- extends: [EventEmitter]\n\nBrowserContexts provide a way to operate multiple independent browser sessions.\n\nIf a page opens another page, e.g. with a `window.open` call, the popup will belong to the parent page's browser\ncontext.\n\nPlaywright allows creating \"incognito\" browser contexts with [`method: Browser.newContext`] method. \"Incognito\"\nbrowser contexts don't write any browsing data to disk.\n\n```js\n// Create a new incognito browser context\nconst context = await browser.newContext();\n// Create a new page inside context.\nconst page = await context.newPage();\nawait page.goto('https://example.com');\n// Dispose context once it's no longer needed.\nawait context.close();\n```\n\n```java\n// Create a new incognito browser context\nBrowserContext context = browser.newContext();\n// Create a new page inside context.\nPage page = context.newPage();\npage.navigate(\"https://example.com\");\n// Dispose context once it is no longer needed.\ncontext.close();\n```\n\n```py\n# create a new incognito browser context\ncontext = await browser.new_context()\n# create a new page inside context.\npage = await context.new_page()\nawait page.goto(\"https://example.com\")\n# dispose context once it is no longer needed.\nawait context.close()\n```\n\n```py\n# create a new incognito browser context\ncontext = browser.new_context()\n# create a new page inside context.\npage = context.new_page()\npage.goto(\"https://example.com\")\n# dispose context once it is no longer needed.\ncontext.close()\n```\n\n```csharp\nusing var playwright = await Playwright.CreateAsync();\nvar browser = await playwright.Firefox.LaunchAsync(new() { Headless = false });\n// Create a new incognito browser context\nvar context = await browser.NewContextAsync();\n// Create a new page inside context.\nvar page = await context.NewPageAsync();\nawait page.GotoAsync(\"https://bing.com\");\n// Dispose context once it is no longer needed.\nawait context.CloseAsync();\n```\n","since":"v1.8","members":[{"kind":"event","langs":{},"since":"v1.11","name":"backgroundPage","type":{"name":"Page","expression":"[Page]"},"spec":[{"type":"note","noteType":"note","text":"Only works with Chromium browser's persistent context."},{"type":"text","text":"Emitted when new background page is created in the context."},{"type":"code","lines":["context.onBackgroundPage(backgroundPage -> {"," System.out.println(backgroundPage.url());","});"],"codeLang":"java"},{"type":"code","lines":["const backgroundPage = await context.waitForEvent('backgroundpage');"],"codeLang":"js"},{"type":"code","lines":["background_page = await context.wait_for_event(\"backgroundpage\")"],"codeLang":"python async"},{"type":"code","lines":["background_page = context.wait_for_event(\"backgroundpage\")"],"codeLang":"python sync"},{"type":"code","lines":["context.BackgroundPage += (_, backgroundPage) =>","{"," Console.WriteLine(backgroundPage.Url);","};",""],"codeLang":"csharp"}],"required":true,"comment":"**NOTE** Only works with Chromium browser's persistent context.\n\nEmitted when new background page is created in the context.\n\n```java\ncontext.onBackgroundPage(backgroundPage -> {\n System.out.println(backgroundPage.url());\n});\n```\n\n```js\nconst backgroundPage = await context.waitForEvent('backgroundpage');\n```\n\n```py\nbackground_page = await context.wait_for_event(\"backgroundpage\")\n```\n\n```py\nbackground_page = context.wait_for_event(\"backgroundpage\")\n```\n\n```csharp\ncontext.BackgroundPage += (_, backgroundPage) =>\n{\n Console.WriteLine(backgroundPage.Url);\n};\n\n```\n","async":false,"alias":"backgroundPage","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"property","langs":{},"since":"v1.45","name":"clock","type":{"name":"Clock","expression":"[Clock]"},"spec":[{"type":"text","text":"Playwright has ability to mock clock and passage of time."}],"required":true,"comment":"Playwright has ability to mock clock and passage of time.","async":false,"alias":"clock","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.8","name":"close","type":{"name":"BrowserContext","expression":"[BrowserContext]"},"spec":[{"type":"text","text":"Emitted when Browser context gets closed. This might happen because of one of the following:"},{"type":"li","text":"Browser context is closed.","liType":"bullet"},{"type":"li","text":"Browser application is closed or crashed.","liType":"bullet"},{"type":"li","text":"The [`method: Browser.close`] method was called.","liType":"bullet"}],"required":true,"comment":"Emitted when Browser context gets closed. This might happen because of one of the following:\n- Browser context is closed.\n- Browser application is closed or crashed.\n- The [`method: Browser.close`] method was called.","async":false,"alias":"close","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{"aliases":{"java":"consoleMessage"},"types":{},"overrides":{}},"since":"v1.34","name":"console","type":{"name":"ConsoleMessage","expression":"[ConsoleMessage]"},"spec":[{"type":"text","text":"Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`."},{"type":"text","text":"The arguments passed into `console.log` and the page are available on the `ConsoleMessage` event handler argument."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["context.on('console', async msg => {"," const values = [];"," for (const arg of msg.args())"," values.push(await arg.jsonValue());"," console.log(...values);","});","await page.evaluate(() => console.log('hello', 5, { foo: 'bar' }));"],"codeLang":"js"},{"type":"code","lines":["context.onConsoleMessage(msg -> {"," for (int i = 0; i < msg.args().size(); ++i)"," System.out.println(i + \": \" + msg.args().get(i).jsonValue());","});","page.evaluate(\"() => console.log('hello', 5, { foo: 'bar' })\");"],"codeLang":"java"},{"type":"code","lines":["async def print_args(msg):"," values = []"," for arg in msg.args:"," values.append(await arg.json_value())"," print(values)","","context.on(\"console\", print_args)","await page.evaluate(\"console.log('hello', 5, { foo: 'bar' })\")"],"codeLang":"python async"},{"type":"code","lines":["def print_args(msg):"," for arg in msg.args:"," print(arg.json_value())","","context.on(\"console\", print_args)","page.evaluate(\"console.log('hello', 5, { foo: 'bar' })\")"],"codeLang":"python sync"},{"type":"code","lines":["context.Console += async (_, msg) =>","{"," foreach (var arg in msg.Args)"," Console.WriteLine(await arg.JsonValueAsync<object>());","};","","await page.EvaluateAsync(\"console.log('hello', 5, { foo: 'bar' })\");"],"codeLang":"csharp"}],"required":true,"comment":"Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`.\n\nThe arguments passed into `console.log` and the page are available on the `ConsoleMessage` event handler argument.\n\n**Usage**\n\n```js\ncontext.on('console', async msg => {\n const values = [];\n for (const arg of msg.args())\n values.push(await arg.jsonValue());\n console.log(...values);\n});\nawait page.evaluate(() => console.log('hello', 5, { foo: 'bar' }));\n```\n\n```java\ncontext.onConsoleMessage(msg -> {\n for (int i = 0; i < msg.args().size(); ++i)\n System.out.println(i + \": \" + msg.args().get(i).jsonValue());\n});\npage.evaluate(\"() => console.log('hello', 5, { foo: 'bar' })\");\n```\n\n```py\nasync def print_args(msg):\n values = []\n for arg in msg.args:\n values.append(await arg.json_value())\n print(values)\n\ncontext.on(\"console\", print_args)\nawait page.evaluate(\"console.log('hello', 5, { foo: 'bar' })\")\n```\n\n```py\ndef print_args(msg):\n for arg in msg.args:\n print(arg.json_value())\n\ncontext.on(\"console\", print_args)\npage.evaluate(\"console.log('hello', 5, { foo: 'bar' })\")\n```\n\n```csharp\ncontext.Console += async (_, msg) =>\n{\n foreach (var arg in msg.Args)\n Console.WriteLine(await arg.JsonValueAsync<object>());\n};\n\nawait page.EvaluateAsync(\"console.log('hello', 5, { foo: 'bar' })\");\n```\n","async":false,"alias":"console","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.34","name":"dialog","type":{"name":"Dialog","expression":"[Dialog]"},"spec":[{"type":"text","text":"Emitted when a JavaScript dialog appears, such as `alert`, `prompt`, `confirm` or `beforeunload`. Listener **must** either [`method: Dialog.accept`] or [`method: Dialog.dismiss`] the dialog - otherwise the page will [freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#never_blocking) waiting for the dialog, and actions like click will never finish."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["context.on('dialog', dialog => {"," dialog.accept();","});"],"codeLang":"js"},{"type":"code","lines":["context.onDialog(dialog -> {"," dialog.accept();","});"],"codeLang":"java"},{"type":"code","lines":["context.on(\"dialog\", lambda dialog: dialog.accept())"],"codeLang":"python"},{"type":"code","lines":["Context.Dialog += async (_, dialog) =>","{"," await dialog.AcceptAsync();","};"],"codeLang":"csharp"},{"type":"note","noteType":"note","text":"When no [`event: Page.dialog`] or [`event: BrowserContext.dialog`] listeners are present, all dialogs are automatically dismissed."}],"required":true,"comment":"Emitted when a JavaScript dialog appears, such as `alert`, `prompt`, `confirm` or `beforeunload`. Listener **must**\neither [`method: Dialog.accept`] or [`method: Dialog.dismiss`] the dialog - otherwise the page will\n[freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#never_blocking) waiting for the dialog,\nand actions like click will never finish.\n\n**Usage**\n\n```js\ncontext.on('dialog', dialog => {\n dialog.accept();\n});\n```\n\n```java\ncontext.onDialog(dialog -> {\n dialog.accept();\n});\n```\n\n```python\ncontext.on(\"dialog\", lambda dialog: dialog.accept())\n```\n\n```csharp\nContext.Dialog += async (_, dialog) =>\n{\n await dialog.AcceptAsync();\n};\n```\n\n**NOTE** When no [`event: Page.dialog`] or [`event: BrowserContext.dialog`] listeners are present, all dialogs are\nautomatically dismissed.","async":false,"alias":"dialog","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.8","name":"page","type":{"name":"Page","expression":"[Page]"},"spec":[{"type":"text","text":"The event is emitted when a new Page is created in the BrowserContext. The page may still be loading. The event will↵also fire for popup pages. See also [`event: Page.popup`] to receive events about popups relevant to a specific page."},{"type":"text","text":"The earliest moment that page is available is when it has navigated to the initial url. For example, when opening a↵popup with `window.open('http://example.com')`, this event will fire when the network request to \"http://example.com\" is↵done and its response has started loading in the popup. If you would like to route/listen to this network request, use [`method: BrowserContext.route`] and [`event: BrowserContext.request`] respectively instead of similar methods on the `Page`."},{"type":"code","lines":["const newPagePromise = context.waitForEvent('page');","await page.getByText('open new page').click();","const newPage = await newPagePromise;","console.log(await newPage.evaluate('location.href'));"],"codeLang":"js"},{"type":"code","lines":["Page newPage = context.waitForPage(() -> {"," page.getByText(\"open new page\").click();","});","System.out.println(newPage.evaluate(\"location.href\"));"],"codeLang":"java"},{"type":"code","lines":["async with context.expect_page() as page_info:"," await page.get_by_text(\"open new page\").click(),","page = await page_info.value","print(await page.evaluate(\"location.href\"))"],"codeLang":"python async"},{"type":"code","lines":["with context.expect_page() as page_info:"," page.get_by_text(\"open new page\").click(),","page = page_info.value","print(page.evaluate(\"location.href\"))"],"codeLang":"python sync"},{"type":"code","lines":["var popup = await context.RunAndWaitForPageAsync(async =>","{"," await page.GetByText(\"open new page\").ClickAsync();","});","Console.WriteLine(await popup.EvaluateAsync<string>(\"location.href\"));"],"codeLang":"csharp"},{"type":"note","noteType":"note","text":"Use [`method: Page.waitForLoadState`] to wait until the page gets to a particular state (you should not need it in most↵cases)."}],"required":true,"comment":"The event is emitted when a new Page is created in the BrowserContext. The page may still be loading. The event\nwill also fire for popup pages. See also [`event: Page.popup`] to receive events about popups relevant to a\nspecific page.\n\nThe earliest moment that page is available is when it has navigated to the initial url. For example, when opening a\npopup with `window.open('http://example.com')`, this event will fire when the network request to\n\"http://example.com\" is done and its response has started loading in the popup. If you would like to route/listen\nto this network request, use [`method: BrowserContext.route`] and [`event: BrowserContext.request`] respectively\ninstead of similar methods on the `Page`.\n\n```js\nconst newPagePromise = context.waitForEvent('page');\nawait page.getByText('open new page').click();\nconst newPage = await newPagePromise;\nconsole.log(await newPage.evaluate('location.href'));\n```\n\n```java\nPage newPage = context.waitForPage(() -> {\n page.getByText(\"open new page\").click();\n});\nSystem.out.println(newPage.evaluate(\"location.href\"));\n```\n\n```py\nasync with context.expect_page() as page_info:\n await page.get_by_text(\"open new page\").click(),\npage = await page_info.value\nprint(await page.evaluate(\"location.href\"))\n```\n\n```py\nwith context.expect_page() as page_info:\n page.get_by_text(\"open new page\").click(),\npage = page_info.value\nprint(page.evaluate(\"location.href\"))\n```\n\n```csharp\nvar popup = await context.RunAndWaitForPageAsync(async =>\n{\n await page.GetByText(\"open new page\").ClickAsync();\n});\nConsole.WriteLine(await popup.EvaluateAsync<string>(\"location.href\"));\n```\n\n**NOTE** Use [`method: Page.waitForLoadState`] to wait until the page gets to a particular state (you should not\nneed it in most cases).","async":false,"alias":"page","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.38","name":"webError","type":{"name":"WebError","expression":"[WebError]"},"spec":[{"type":"text","text":"Emitted when exception is unhandled in any of the pages in this↵context. To listen for errors from a particular page, use [`event: Page.pageError`] instead."}],"required":true,"comment":"Emitted when exception is unhandled in any of the pages in this context. To listen for errors from a particular\npage, use [`event: Page.pageError`] instead.","async":false,"alias":"webError","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.12","name":"request","type":{"name":"Request","expression":"[Request]"},"spec":[{"type":"text","text":"Emitted when a request is issued from any pages created through this context.↵The [request] object is read-only. To only listen for requests from a particular↵page, use [`event: Page.request`]."},{"type":"text","text":"In order to intercept and mutate requests, see [`method: BrowserContext.route`]↵or [`method: Page.route`]."}],"required":true,"comment":"Emitted when a request is issued from any pages created through this context. The [request] object is read-only. To\nonly listen for requests from a particular page, use [`event: Page.request`].\n\nIn order to intercept and mutate requests, see [`method: BrowserContext.route`] or [`method: Page.route`].","async":false,"alias":"request","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.12","name":"requestFailed","type":{"name":"Request","expression":"[Request]"},"spec":[{"type":"text","text":"Emitted when a request fails, for example by timing out. To only listen for↵failed requests from a particular page, use [`event: Page.requestFailed`]."},{"type":"note","noteType":"note","text":"HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request will complete↵with [`event: BrowserContext.requestFinished`] event and not with [`event: BrowserContext.requestFailed`]."}],"required":true,"comment":"Emitted when a request fails, for example by timing out. To only listen for failed requests from a particular page,\nuse [`event: Page.requestFailed`].\n\n**NOTE** HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request\nwill complete with [`event: BrowserContext.requestFinished`] event and not with\n[`event: BrowserContext.requestFailed`].","async":false,"alias":"requestFailed","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.12","name":"requestFinished","type":{"name":"Request","expression":"[Request]"},"spec":[{"type":"text","text":"Emitted when a request finishes successfully after downloading the response body. For a successful response, the↵sequence of events is `request`, `response` and `requestfinished`. To listen for↵successful requests from a particular page, use [`event: Page.requestFinished`]."}],"required":true,"comment":"Emitted when a request finishes successfully after downloading the response body. For a successful response, the\nsequence of events is `request`, `response` and `requestfinished`. To listen for successful requests from a\nparticular page, use [`event: Page.requestFinished`].","async":false,"alias":"requestFinished","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.12","name":"response","type":{"name":"Response","expression":"[Response]"},"spec":[{"type":"text","text":"Emitted when [response] status and headers are received for a request. For a successful response, the sequence of events↵is `request`, `response` and `requestfinished`. To listen for response events↵from a particular page, use [`event: Page.response`]."}],"required":true,"comment":"Emitted when [response] status and headers are received for a request. For a successful response, the sequence of\nevents is `request`, `response` and `requestfinished`. To listen for response events from a particular page, use\n[`event: Page.response`].","async":false,"alias":"response","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.11","name":"serviceWorker","type":{"name":"Worker","expression":"[Worker]"},"spec":[{"type":"note","noteType":"note","text":"Service workers are only supported on Chromium-based browsers."},{"type":"text","text":"Emitted when new service worker is created in the context."}],"required":true,"comment":"**NOTE** Service workers are only supported on Chromium-based browsers.\n\nEmitted when new service worker is created in the context.","async":false,"alias":"serviceWorker","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"addCookies","type":{"name":"void"},"spec":[{"type":"text","text":"Adds cookies into this browser context. All pages within this context will have these cookies installed. Cookies can be↵obtained via [`method: BrowserContext.cookies`]."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await browserContext.addCookies([cookieObject1, cookieObject2]);"],"codeLang":"js"},{"type":"code","lines":["browserContext.addCookies(Arrays.asList(cookieObject1, cookieObject2));"],"codeLang":"java"},{"type":"code","lines":["await browser_context.add_cookies([cookie_object1, cookie_object2])"],"codeLang":"python async"},{"type":"code","lines":["browser_context.add_cookies([cookie_object1, cookie_object2])"],"codeLang":"python sync"},{"type":"code","lines":["await context.AddCookiesAsync(new[] { cookie1, cookie2 });"],"codeLang":"csharp"}],"required":true,"comment":"Adds cookies into this browser context. All pages within this context will have these cookies installed. Cookies\ncan be obtained via [`method: BrowserContext.cookies`].\n\n**Usage**\n\n```js\nawait browserContext.addCookies([cookieObject1, cookieObject2]);\n```\n\n```java\nbrowserContext.addCookies(Arrays.asList(cookieObject1, cookieObject2));\n```\n\n```py\nawait browser_context.add_cookies([cookie_object1, cookie_object2])\n```\n\n```py\nbrowser_context.add_cookies([cookie_object1, cookie_object2])\n```\n\n```csharp\nawait context.AddCookiesAsync(new[] { cookie1, cookie2 });\n```\n","async":true,"alias":"addCookies","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"cookies","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"url","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"either url or domain / path are required. Optional."}],"required":false,"comment":"either url or domain / path are required. Optional.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"domain","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"either url or domain / path are required Optional."}],"required":false,"comment":"either url or domain / path are required Optional.","async":false,"alias":"domain","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"path","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"either url or domain / path are required Optional."}],"required":false,"comment":"either url or domain / path are required Optional.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"expires","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Unix time in seconds. Optional."}],"required":false,"comment":"Unix time in seconds. Optional.","async":false,"alias":"expires","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"httpOnly","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Optional."}],"required":false,"comment":"Optional.","async":false,"alias":"httpOnly","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"secure","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Optional."}],"required":false,"comment":"Optional.","async":false,"alias":"secure","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"sameSite","type":{"name":"SameSiteAttribute","union":[{"name":"\"Strict\""},{"name":"\"Lax\""},{"name":"\"None\""}],"expression":"[SameSiteAttribute]<\"Strict\"|\"Lax\"|\"None\">"},"spec":[{"type":"text","text":"Optional."}],"required":false,"comment":"Optional.","async":false,"alias":"sameSite","overloadIndex":0,"paramOrOption":null}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":"Adds cookies to the browser context."},{"type":"text","text":"For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: \".example.com\"."}],"required":true,"comment":"Adds cookies to the browser context.\n\nFor the cookie to apply to all subdomains as well, prefix domain with a dot, like this: \".example.com\".","async":false,"alias":"cookies","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"addInitScript","type":{"name":"void"},"spec":[{"type":"text","text":"Adds a script which would be evaluated in one of the following scenarios:"},{"type":"li","text":"Whenever a page is created in the browser context or is navigated.","liType":"bullet"},{"type":"li","text":"Whenever a child frame is attached or navigated in any page in the browser context. In this case, the script is↵evaluated in the context of the newly attached frame.","liType":"bullet"},{"type":"text","text":"The script is evaluated after the document was created but before any of its scripts were run. This is useful to amend↵the JavaScript environment, e.g. to seed `Math.random`."},{"type":"text","text":"**Usage**"},{"type":"text","text":"An example of overriding `Math.random` before the page loads:"},{"type":"code","lines":["// preload.js","Math.random = () => 42;"],"codeLang":"js browser"},{"type":"code","lines":["// In your playwright script, assuming the preload.js file is in same directory.","await browserContext.addInitScript({"," path: 'preload.js'","});"],"codeLang":"js"},{"type":"code","lines":["// In your playwright script, assuming the preload.js file is in same directory.","browserContext.addInitScript(Paths.get(\"preload.js\"));"],"codeLang":"java"},{"type":"code","lines":["# in your playwright script, assuming the preload.js file is in same directory.","await browser_context.add_init_script(path=\"preload.js\")"],"codeLang":"python async"},{"type":"code","lines":["# in your playwright script, assuming the preload.js file is in same directory.","browser_context.add_init_script(path=\"preload.js\")"],"codeLang":"python sync"},{"type":"code","lines":["await Context.AddInitScriptAsync(scriptPath: \"preload.js\");"],"codeLang":"csharp"},{"type":"note","noteType":"note","text":"The order of evaluation of multiple scripts installed via [`method: BrowserContext.addInitScript`] and↵[`method: Page.addInitScript`] is not defined."}],"required":true,"comment":"Adds a script which would be evaluated in one of the following scenarios:\n- Whenever a page is created in the browser context or is navigated.\n- Whenever a child frame is attached or navigated in any page in the browser context. In this case, the script is\n evaluated in the context of the newly attached frame.\n\nThe script is evaluated after the document was created but before any of its scripts were run. This is useful to\namend the JavaScript environment, e.g. to seed `Math.random`.\n\n**Usage**\n\nAn example of overriding `Math.random` before the page loads:\n\n```js\n// preload.js\nMath.random = () => 42;\n```\n\n```js\n// In your playwright script, assuming the preload.js file is in same directory.\nawait browserContext.addInitScript({\n path: 'preload.js'\n});\n```\n\n```java\n// In your playwright script, assuming the preload.js file is in same directory.\nbrowserContext.addInitScript(Paths.get(\"preload.js\"));\n```\n\n```py\n# in your playwright script, assuming the preload.js file is in same directory.\nawait browser_context.add_init_script(path=\"preload.js\")\n```\n\n```py\n# in your playwright script, assuming the preload.js file is in same directory.\nbrowser_context.add_init_script(path=\"preload.js\")\n```\n\n```csharp\nawait Context.AddInitScriptAsync(scriptPath: \"preload.js\");\n```\n\n**NOTE** The order of evaluation of multiple scripts installed via [`method: BrowserContext.addInitScript`] and\n[`method: Page.addInitScript`] is not defined.","async":true,"alias":"addInitScript","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"script","type":{"name":"","union":[{"name":"function"},{"name":"string"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the↵current working directory. Optional."}],"required":false,"comment":"Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working\ndirectory. Optional.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"content","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Raw script content. Optional."}],"required":false,"comment":"Raw script content. Optional.","async":false,"alias":"content","overloadIndex":0,"paramOrOption":null}]}],"expression":"[function]|[string]|[Object]"},"spec":[{"type":"text","text":"Script to be evaluated in all pages in the browser context."}],"required":true,"comment":"Script to be evaluated in all pages in the browser context.","async":false,"alias":"script","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"script","type":{"name":"","union":[{"name":"string"},{"name":"path"}],"expression":"[string]|[path]"},"spec":[{"type":"text","text":"Script to be evaluated in all pages in the browser context."}],"required":true,"comment":"Script to be evaluated in all pages in the browser context.","async":false,"alias":"script","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"arg","type":{"name":"Serializable","expression":"[Serializable]"},"spec":[{"type":"text","text":"Optional argument to pass to `script` (only supported when passing a function)."}],"required":false,"comment":"Optional argument to pass to `script` (only supported when passing a function).","async":false,"alias":"arg","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working directory. Optional."}],"required":false,"comment":"Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working\ndirectory. Optional.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"script","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Script to be evaluated in all pages in the browser context. Optional."}],"required":false,"comment":"Script to be evaluated in all pages in the browser context. Optional.","async":false,"alias":"script","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.11","name":"backgroundPages","type":{"name":"Array","templates":[{"name":"Page"}],"expression":"[Array]<[Page]>"},"spec":[{"type":"note","noteType":"note","text":"Background pages are only supported on Chromium-based browsers."},{"type":"text","text":"All existing background pages in the context."}],"required":true,"comment":"**NOTE** Background pages are only supported on Chromium-based browsers.\n\nAll existing background pages in the context.","async":false,"alias":"backgroundPages","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"browser","type":{"name":"","union":[{"name":"null"},{"name":"Browser"}],"expression":"[null]|[Browser]"},"spec":[{"type":"text","text":"Returns the browser instance of the context. If it was launched as a persistent context null gets returned."}],"required":true,"comment":"Returns the browser instance of the context. If it was launched as a persistent context null gets returned.","async":false,"alias":"browser","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"clearCookies","type":{"name":"void"},"spec":[{"type":"text","text":"Removes cookies from context. Accepts optional filter."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await context.clearCookies();","await context.clearCookies({ name: 'session-id' });","await context.clearCookies({ domain: 'my-origin.com' });","await context.clearCookies({ domain: /.*my-origin\\.com/ });","await context.clearCookies({ path: '/api/v1' });","await context.clearCookies({ name: 'session-id', domain: 'my-origin.com' });"],"codeLang":"js"},{"type":"code","lines":["context.clearCookies();","context.clearCookies(new BrowserContext.ClearCookiesOptions().setName(\"session-id\"));","context.clearCookies(new BrowserContext.ClearCookiesOptions().setDomain(\"my-origin.com\"));","context.clearCookies(new BrowserContext.ClearCookiesOptions().setPath(\"/api/v1\"));","context.clearCookies(new BrowserContext.ClearCookiesOptions()"," .setName(\"session-id\")"," .setDomain(\"my-origin.com\"));"],"codeLang":"java"},{"type":"code","lines":["await context.clear_cookies()","await context.clear_cookies(name=\"session-id\")","await context.clear_cookies(domain=\"my-origin.com\")","await context.clear_cookies(path=\"/api/v1\")","await context.clear_cookies(name=\"session-id\", domain=\"my-origin.com\")"],"codeLang":"python async"},{"type":"code","lines":["context.clear_cookies()","context.clear_cookies(name=\"session-id\")","context.clear_cookies(domain=\"my-origin.com\")","context.clear_cookies(path=\"/api/v1\")","context.clear_cookies(name=\"session-id\", domain=\"my-origin.com\")"],"codeLang":"python sync"},{"type":"code","lines":["await context.ClearCookiesAsync();","await context.ClearCookiesAsync(new() { Name = \"session-id\" });","await context.ClearCookiesAsync(new() { Domain = \"my-origin.com\" });","await context.ClearCookiesAsync(new() { Path = \"/api/v1\" });","await context.ClearCookiesAsync(new() { Name = \"session-id\", Domain = \"my-origin.com\" });"],"codeLang":"csharp"}],"required":true,"comment":"Removes cookies from context. Accepts optional filter.\n\n**Usage**\n\n```js\nawait context.clearCookies();\nawait context.clearCookies({ name: 'session-id' });\nawait context.clearCookies({ domain: 'my-origin.com' });\nawait context.clearCookies({ domain: /.*my-origin\\.com/ });\nawait context.clearCookies({ path: '/api/v1' });\nawait context.clearCookies({ name: 'session-id', domain: 'my-origin.com' });\n```\n\n```java\ncontext.clearCookies();\ncontext.clearCookies(new BrowserContext.ClearCookiesOptions().setName(\"session-id\"));\ncontext.clearCookies(new BrowserContext.ClearCookiesOptions().setDomain(\"my-origin.com\"));\ncontext.clearCookies(new BrowserContext.ClearCookiesOptions().setPath(\"/api/v1\"));\ncontext.clearCookies(new BrowserContext.ClearCookiesOptions()\n .setName(\"session-id\")\n .setDomain(\"my-origin.com\"));\n```\n\n```py\nawait context.clear_cookies()\nawait context.clear_cookies(name=\"session-id\")\nawait context.clear_cookies(domain=\"my-origin.com\")\nawait context.clear_cookies(path=\"/api/v1\")\nawait context.clear_cookies(name=\"session-id\", domain=\"my-origin.com\")\n```\n\n```py\ncontext.clear_cookies()\ncontext.clear_cookies(name=\"session-id\")\ncontext.clear_cookies(domain=\"my-origin.com\")\ncontext.clear_cookies(path=\"/api/v1\")\ncontext.clear_cookies(name=\"session-id\", domain=\"my-origin.com\")\n```\n\n```csharp\nawait context.ClearCookiesAsync();\nawait context.ClearCookiesAsync(new() { Name = \"session-id\" });\nawait context.ClearCookiesAsync(new() { Domain = \"my-origin.com\" });\nawait context.ClearCookiesAsync(new() { Path = \"/api/v1\" });\nawait context.ClearCookiesAsync(new() { Name = \"session-id\", Domain = \"my-origin.com\" });\n```\n","async":true,"alias":"clearCookies","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.43","name":"domain","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Only removes cookies with the given domain."}],"required":false,"comment":"Only removes cookies with the given domain.","async":false,"alias":"domain","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.43","name":"name","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Only removes cookies with the given name."}],"required":false,"comment":"Only removes cookies with the given name.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.43","name":"path","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Only removes cookies with the given path."}],"required":false,"comment":"Only removes cookies with the given path.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"clearPermissions","type":{"name":"void"},"spec":[{"type":"text","text":"Clears all permission overrides for the browser context."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const context = await browser.newContext();","await context.grantPermissions(['clipboard-read']);","// do stuff ..","context.clearPermissions();"],"codeLang":"js"},{"type":"code","lines":["BrowserContext context = browser.newContext();","context.grantPermissions(Arrays.asList(\"clipboard-read\"));","// do stuff ..","context.clearPermissions();"],"codeLang":"java"},{"type":"code","lines":["context = await browser.new_context()","await context.grant_permissions([\"clipboard-read\"])","# do stuff ..","context.clear_permissions()"],"codeLang":"python async"},{"type":"code","lines":["context = browser.new_context()","context.grant_permissions([\"clipboard-read\"])","# do stuff ..","context.clear_permissions()"],"codeLang":"python sync"},{"type":"code","lines":["var context = await browser.NewContextAsync();","await context.GrantPermissionsAsync(new[] { \"clipboard-read\" });","// Alternatively, you can use the helper class ContextPermissions","// to specify the permissions...","// do stuff ...","await context.ClearPermissionsAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Clears all permission overrides for the browser context.\n\n**Usage**\n\n```js\nconst context = await browser.newContext();\nawait context.grantPermissions(['clipboard-read']);\n// do stuff ..\ncontext.clearPermissions();\n```\n\n```java\nBrowserContext context = browser.newContext();\ncontext.grantPermissions(Arrays.asList(\"clipboard-read\"));\n// do stuff ..\ncontext.clearPermissions();\n```\n\n```py\ncontext = await browser.new_context()\nawait context.grant_permissions([\"clipboard-read\"])\n# do stuff ..\ncontext.clear_permissions()\n```\n\n```py\ncontext = browser.new_context()\ncontext.grant_permissions([\"clipboard-read\"])\n# do stuff ..\ncontext.clear_permissions()\n```\n\n```csharp\nvar context = await browser.NewContextAsync();\nawait context.GrantPermissionsAsync(new[] { \"clipboard-read\" });\n// Alternatively, you can use the helper class ContextPermissions\n// to specify the permissions...\n// do stuff ...\nawait context.ClearPermissionsAsync();\n```\n","async":true,"alias":"clearPermissions","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"close","type":{"name":"void"},"spec":[{"type":"text","text":"Closes the browser context. All the pages that belong to the browser context will be closed."},{"type":"note","noteType":"note","text":"The default browser context cannot be closed."}],"required":true,"comment":"Closes the browser context. All the pages that belong to the browser context will be closed.\n\n**NOTE** The default browser context cannot be closed.","async":true,"alias":"close","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.40","name":"reason","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"The reason to be reported to the operations interrupted by the context closure."}],"required":false,"comment":"The reason to be reported to the operations interrupted by the context closure.","async":false,"alias":"reason","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"cookies","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"domain","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"domain","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"path","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"expires","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Unix time in seconds."}],"required":true,"comment":"Unix time in seconds.","async":false,"alias":"expires","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"httpOnly","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"httpOnly","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"secure","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"secure","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"sameSite","type":{"name":"SameSiteAttribute","union":[{"name":"\"Strict\""},{"name":"\"Lax\""},{"name":"\"None\""}],"expression":"[SameSiteAttribute]<\"Strict\"|\"Lax\"|\"None\">"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"sameSite","overloadIndex":0,"paramOrOption":null}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":"If no URLs are specified, this method returns all cookies. If URLs are specified, only cookies that affect those URLs↵are returned."}],"required":true,"comment":"If no URLs are specified, this method returns all cookies. If URLs are specified, only cookies that affect those\nURLs are returned.","async":true,"alias":"cookies","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"urls","type":{"name":"","union":[{"name":"string"},{"name":"Array","templates":[{"name":"string"}]}],"expression":"[string]|[Array]<[string]>"},"spec":[{"type":"text","text":"Optional list of URLs."}],"required":false,"comment":"Optional list of URLs.","async":false,"alias":"urls","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"exposeBinding","type":{"name":"void"},"spec":[{"type":"text","text":"The method adds a function called `name` on the `window` object of every frame in every page in the context.↵When called, the function executes `callback` and returns a [Promise] which resolves to the return value of↵`callback`. If the `callback` returns a [Promise], it will be awaited."},{"type":"text","text":"The first argument of the `callback` function contains information about the caller: `{ browserContext:↵BrowserContext, page: Page, frame: Frame }`."},{"type":"text","text":"See [`method: Page.exposeBinding`] for page-only version."},{"type":"text","text":"**Usage**"},{"type":"text","text":"An example of exposing page URL to all frames in all pages in the context:"},{"type":"code","lines":["const { webkit } = require('playwright'); // Or 'chromium' or 'firefox'.","","(async () => {"," const browser = await webkit.launch({ headless: false });"," const context = await browser.newContext();"," await context.exposeBinding('pageURL', ({ page }) => page.url());"," const page = await context.newPage();"," await page.setContent(`"," <script>"," async function onClick() {"," document.querySelector('div').textContent = await window.pageURL();"," }"," </script>"," <button onclick=\"onClick()\">Click me</button>"," <div></div>"," `);"," await page.getByRole('button').click();","})();"],"codeLang":"js"},{"type":"code","lines":["import com.microsoft.playwright.*;","","public class Example {"," public static void main(String[] args) {"," try (Playwright playwright = Playwright.create()) {"," BrowserType webkit = playwright.webkit()"," Browser browser = webkit.launch(new BrowserType.LaunchOptions().setHeadless(false));"," BrowserContext context = browser.newContext();"," context.exposeBinding(\"pageURL\", (source, args) -> source.page().url());"," Page page = context.newPage();"," page.setContent(\"<script>\\n\" +"," \" async function onClick() {\\n\" +"," \" document.querySelector('div').textContent = await window.pageURL();\\n\" +"," \" }\\n\" +"," \"</script>\\n\" +"," \"<button onclick=\\\"onClick()\\\">Click me</button>\\n\" +"," \"<div></div>\");"," page.getByRole(AriaRole.BUTTON).click();"," }"," }","}"],"codeLang":"java"},{"type":"code","lines":["import asyncio","from playwright.async_api import async_playwright, Playwright","","async def run(playwright: Playwright):"," webkit = playwright.webkit"," browser = await webkit.launch(headless=False)"," context = await browser.new_context()"," await context.expose_binding(\"pageURL\", lambda source: source[\"page\"].url)"," page = await context.new_page()"," await page.set_content(\"\"\""," <script>"," async function onClick() {"," document.querySelector('div').textContent = await window.pageURL();"," }"," </script>"," <button onclick=\"onClick()\">Click me</button>"," <div></div>"," \"\"\")"," await page.get_by_role(\"button\").click()","","async def main():"," async with async_playwright() as playwright:"," await run(playwright)","asyncio.run(main())"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import sync_playwright, Playwright","","def run(playwright: Playwright):"," webkit = playwright.webkit"," browser = webkit.launch(headless=False)"," context = browser.new_context()"," context.expose_binding(\"pageURL\", lambda source: source[\"page\"].url)"," page = context.new_page()"," page.set_content(\"\"\""," <script>"," async function onClick() {"," document.querySelector('div').textContent = await window.pageURL();"," }"," </script>"," <button onclick=\"onClick()\">Click me</button>"," <div></div>"," \"\"\")"," page.get_by_role(\"button\").click()","","with sync_playwright() as playwright:"," run(playwright)"],"codeLang":"python sync"},{"type":"code","lines":["using Microsoft.Playwright;","","using var playwright = await Playwright.CreateAsync();","var browser = await playwright.Webkit.LaunchAsync(new() { Headless = false });","var context = await browser.NewContextAsync();","","await context.ExposeBindingAsync(\"pageURL\", source => source.Page.Url);","var page = await context.NewPageAsync();","await page.SetContentAsync(\"<script>\\n\" +","\" async function onClick() {\\n\" +","\" document.querySelector('div').textContent = await window.pageURL();\\n\" +","\" }\\n\" +","\"</script>\\n\" +","\"<button onclick=\\\"onClick()\\\">Click me</button>\\n\" +","\"<div></div>\");","await page.GetByRole(AriaRole.Button).ClickAsync();"],"codeLang":"csharp"}],"required":true,"comment":"The method adds a function called `name` on the `window` object of every frame in every page in the context. When\ncalled, the function executes `callback` and returns a [Promise] which resolves to the return value of `callback`.\nIf the `callback` returns a [Promise], it will be awaited.\n\nThe first argument of the `callback` function contains information about the caller: `{ browserContext:\nBrowserContext, page: Page, frame: Frame }`.\n\nSee [`method: Page.exposeBinding`] for page-only version.\n\n**Usage**\n\nAn example of exposing page URL to all frames in all pages in the context:\n\n```js\nconst { webkit } = require('playwright'); // Or 'chromium' or 'firefox'.\n\n(async () => {\n const browser = await webkit.launch({ headless: false });\n const context = await browser.newContext();\n await context.exposeBinding('pageURL', ({ page }) => page.url());\n const page = await context.newPage();\n await page.setContent(`\n <script>\n async function onClick() {\n document.querySelector('div').textContent = await window.pageURL();\n }\n </script>\n <button onclick=\"onClick()\">Click me</button>\n <div></div>\n `);\n await page.getByRole('button').click();\n})();\n```\n\n```java\nimport com.microsoft.playwright.*;\n\npublic class Example {\n public static void main(String[] args) {\n try (Playwright playwright = Playwright.create()) {\n BrowserType webkit = playwright.webkit()\n Browser browser = webkit.launch(new BrowserType.LaunchOptions().setHeadless(false));\n BrowserContext context = browser.newContext();\n context.exposeBinding(\"pageURL\", (source, args) -> source.page().url());\n Page page = context.newPage();\n page.setContent(\"<script>\\n\" +\n \" async function onClick() {\\n\" +\n \" document.querySelector('div').textContent = await window.pageURL();\\n\" +\n \" }\\n\" +\n \"</script>\\n\" +\n \"<button onclick=\\\"onClick()\\\">Click me</button>\\n\" +\n \"<div></div>\");\n page.getByRole(AriaRole.BUTTON).click();\n }\n }\n}\n```\n\n```py\nimport asyncio\nfrom playwright.async_api import async_playwright, Playwright\n\nasync def run(playwright: Playwright):\n webkit = playwright.webkit\n browser = await webkit.launch(headless=False)\n context = await browser.new_context()\n await context.expose_binding(\"pageURL\", lambda source: source[\"page\"].url)\n page = await context.new_page()\n await page.set_content(\"\"\"\n <script>\n async function onClick() {\n document.querySelector('div').textContent = await window.pageURL();\n }\n </script>\n <button onclick=\"onClick()\">Click me</button>\n <div></div>\n \"\"\")\n await page.get_by_role(\"button\").click()\n\nasync def main():\n async with async_playwright() as playwright:\n await run(playwright)\nasyncio.run(main())\n```\n\n```py\nfrom playwright.sync_api import sync_playwright, Playwright\n\ndef run(playwright: Playwright):\n webkit = playwright.webkit\n browser = webkit.launch(headless=False)\n context = browser.new_context()\n context.expose_binding(\"pageURL\", lambda source: source[\"page\"].url)\n page = context.new_page()\n page.set_content(\"\"\"\n <script>\n async function onClick() {\n document.querySelector('div').textContent = await window.pageURL();\n }\n </script>\n <button onclick=\"onClick()\">Click me</button>\n <div></div>\n \"\"\")\n page.get_by_role(\"button\").click()\n\nwith sync_playwright() as playwright:\n run(playwright)\n```\n\n```csharp\nusing Microsoft.Playwright;\n\nusing var playwright = await Playwright.CreateAsync();\nvar browser = await playwright.Webkit.LaunchAsync(new() { Headless = false });\nvar context = await browser.NewContextAsync();\n\nawait context.ExposeBindingAsync(\"pageURL\", source => source.Page.Url);\nvar page = await context.NewPageAsync();\nawait page.SetContentAsync(\"<script>\\n\" +\n\" async function onClick() {\\n\" +\n\" document.querySelector('div').textContent = await window.pageURL();\\n\" +\n\" }\\n\" +\n\"</script>\\n\" +\n\"<button onclick=\\\"onClick()\\\">Click me</button>\\n\" +\n\"<div></div>\");\nawait page.GetByRole(AriaRole.Button).ClickAsync();\n```\n","async":true,"alias":"exposeBinding","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Name of the function on the window object."}],"required":true,"comment":"Name of the function on the window object.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"callback","type":{"name":"function","expression":"[function]"},"spec":[{"type":"text","text":"Callback function that will be called in the Playwright's context."}],"required":true,"comment":"Callback function that will be called in the Playwright's context.","async":false,"alias":"callback","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","deprecated":"This option will be removed in the future.","name":"handle","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to pass the argument as a handle, instead of passing by value. When passing a handle, only one argument is↵supported. When passing by value, multiple arguments are supported."}],"required":false,"comment":"Whether to pass the argument as a handle, instead of passing by value. When passing a handle, only one argument is\nsupported. When passing by value, multiple arguments are supported.","async":false,"alias":"handle","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"exposeFunction","type":{"name":"void"},"spec":[{"type":"text","text":"The method adds a function called `name` on the `window` object of every frame in every page in the context.↵When called, the function executes `callback` and returns a [Promise] which resolves to the return value of↵`callback`."},{"type":"text","text":"If the `callback` returns a [Promise], it will be awaited."},{"type":"text","text":"See [`method: Page.exposeFunction`] for page-only version."},{"type":"text","text":"**Usage**"},{"type":"text","text":"An example of adding a `sha256` function to all pages in the context:"},{"type":"code","lines":["const { webkit } = require('playwright'); // Or 'chromium' or 'firefox'.","const crypto = require('crypto');","","(async () => {"," const browser = await webkit.launch({ headless: false });"," const context = await browser.newContext();"," await context.exposeFunction('sha256', text =>"," crypto.createHash('sha256').update(text).digest('hex'),"," );"," const page = await context.newPage();"," await page.setContent(`"," <script>"," async function onClick() {"," document.querySelector('div').textContent = await window.sha256('PLAYWRIGHT');"," }"," </script>"," <button onclick=\"onClick()\">Click me</button>"," <div></div>"," `);"," await page.getByRole('button').click();","})();"],"codeLang":"js"},{"type":"code","lines":["import com.microsoft.playwright.*;","","import java.nio.charset.StandardCharsets;","import java.security.MessageDigest;","import java.security.NoSuchAlgorithmException;","import java.util.Base64;","","public class Example {"," public static void main(String[] args) {"," try (Playwright playwright = Playwright.create()) {"," BrowserType webkit = playwright.webkit()"," Browser browser = webkit.launch(new BrowserType.LaunchOptions().setHeadless(false));"," context.exposeFunction(\"sha256\", args -> {"," String text = (String) args[0];"," MessageDigest crypto;"," try {"," crypto = MessageDigest.getInstance(\"SHA-256\");"," } catch (NoSuchAlgorithmException e) {"," return null;"," }"," byte[] token = crypto.digest(text.getBytes(StandardCharsets.UTF_8));"," return Base64.getEncoder().encodeToString(token);"," });"," Page page = context.newPage();"," page.setContent(\"<script>\\n\" +"," \" async function onClick() {\\n\" +"," \" document.querySelector('div').textContent = await window.sha256('PLAYWRIGHT');\\n\" +"," \" }\\n\" +"," \"</script>\\n\" +"," \"<button onclick=\\\"onClick()\\\">Click me</button>\\n\" +"," \"<div></div>\\n\");"," page.getByRole(AriaRole.BUTTON).click();"," }"," }","}"],"codeLang":"java"},{"type":"code","lines":["import asyncio","import hashlib","from playwright.async_api import async_playwright, Playwright","","def sha256(text: str) -> str:"," m = hashlib.sha256()"," m.update(bytes(text, \"utf8\"))"," return m.hexdigest()","","","async def run(playwright: Playwright):"," webkit = playwright.webkit"," browser = await webkit.launch(headless=False)"," context = await browser.new_context()"," await context.expose_function(\"sha256\", sha256)"," page = await context.new_page()"," await page.set_content(\"\"\""," <script>"," async function onClick() {"," document.querySelector('div').textContent = await window.sha256('PLAYWRIGHT');"," }"," </script>"," <button onclick=\"onClick()\">Click me</button>"," <div></div>"," \"\"\")"," await page.get_by_role(\"button\").click()","","async def main():"," async with async_playwright() as playwright:"," await run(playwright)","asyncio.run(main())"],"codeLang":"python async"},{"type":"code","lines":["import hashlib","from playwright.sync_api import sync_playwright","","def sha256(text: str) -> str:"," m = hashlib.sha256()"," m.update(bytes(text, \"utf8\"))"," return m.hexdigest()","","","def run(playwright: Playwright):"," webkit = playwright.webkit"," browser = webkit.launch(headless=False)"," context = browser.new_context()"," context.expose_function(\"sha256\", sha256)"," page = context.new_page()"," page.set_content(\"\"\""," <script>"," async function onClick() {"," document.querySelector('div').textContent = await window.sha256('PLAYWRIGHT');"," }"," </script>"," <button onclick=\"onClick()\">Click me</button>"," <div></div>"," \"\"\")"," page.get_by_role(\"button\").click()","","with sync_playwright() as playwright:"," run(playwright)"],"codeLang":"python sync"},{"type":"code","lines":["using Microsoft.Playwright;","using System;","using System.Security.Cryptography;","using System.Threading.Tasks;","","class BrowserContextExamples","{"," public static async Task Main()"," {"," using var playwright = await Playwright.CreateAsync();"," var browser = await playwright.Webkit.LaunchAsync(new() { Headless = false });"," var context = await browser.NewContextAsync();",""," await context.ExposeFunctionAsync(\"sha256\", (string input) =>"," {"," return Convert.ToBase64String("," SHA256.Create().ComputeHash(System.Text.Encoding.UTF8.GetBytes(input)));"," });",""," var page = await context.NewPageAsync();"," await page.SetContentAsync(\"<script>\\n\" +"," \" async function onClick() {\\n\" +"," \" document.querySelector('div').textContent = await window.sha256('PLAYWRIGHT');\\n\" +"," \" }\\n\" +"," \"</script>\\n\" +"," \"<button onclick=\\\"onClick()\\\">Click me</button>\\n\" +"," \"<div></div>\");",""," await page.GetByRole(AriaRole.Button).ClickAsync();"," Console.WriteLine(await page.TextContentAsync(\"div\"));"," }","}"],"codeLang":"csharp"}],"required":true,"comment":"The method adds a function called `name` on the `window` object of every frame in every page in the context. When\ncalled, the function executes `callback` and returns a [Promise] which resolves to the return value of `callback`.\n\nIf the `callback` returns a [Promise], it will be awaited.\n\nSee [`method: Page.exposeFunction`] for page-only version.\n\n**Usage**\n\nAn example of adding a `sha256` function to all pages in the context:\n\n```js\nconst { webkit } = require('playwright'); // Or 'chromium' or 'firefox'.\nconst crypto = require('crypto');\n\n(async () => {\n const browser = await webkit.launch({ headless: false });\n const context = await browser.newContext();\n await context.exposeFunction('sha256', text =>\n crypto.createHash('sha256').update(text).digest('hex'),\n );\n const page = await context.newPage();\n await page.setContent(`\n <script>\n async function onClick() {\n document.querySelector('div').textContent = await window.sha256('PLAYWRIGHT');\n }\n </script>\n <button onclick=\"onClick()\">Click me</button>\n <div></div>\n `);\n await page.getByRole('button').click();\n})();\n```\n\n```java\nimport com.microsoft.playwright.*;\n\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.Base64;\n\npublic class Example {\n public static void main(String[] args) {\n try (Playwright playwright = Playwright.create()) {\n BrowserType webkit = playwright.webkit()\n Browser browser = webkit.launch(new BrowserType.LaunchOptions().setHeadless(false));\n context.exposeFunction(\"sha256\", args -> {\n String text = (String) args[0];\n MessageDigest crypto;\n try {\n crypto = MessageDigest.getInstance(\"SHA-256\");\n } catch (NoSuchAlgorithmException e) {\n return null;\n }\n byte[] token = crypto.digest(text.getBytes(StandardCharsets.UTF_8));\n return Base64.getEncoder().encodeToString(token);\n });\n Page page = context.newPage();\n page.setContent(\"<script>\\n\" +\n \" async function onClick() {\\n\" +\n \" document.querySelector('div').textContent = await window.sha256('PLAYWRIGHT');\\n\" +\n \" }\\n\" +\n \"</script>\\n\" +\n \"<button onclick=\\\"onClick()\\\">Click me</button>\\n\" +\n \"<div></div>\\n\");\n page.getByRole(AriaRole.BUTTON).click();\n }\n }\n}\n```\n\n```py\nimport asyncio\nimport hashlib\nfrom playwright.async_api import async_playwright, Playwright\n\ndef sha256(text: str) -> str:\n m = hashlib.sha256()\n m.update(bytes(text, \"utf8\"))\n return m.hexdigest()\n\n\nasync def run(playwright: Playwright):\n webkit = playwright.webkit\n browser = await webkit.launch(headless=False)\n context = await browser.new_context()\n await context.expose_function(\"sha256\", sha256)\n page = await context.new_page()\n await page.set_content(\"\"\"\n <script>\n async function onClick() {\n document.querySelector('div').textContent = await window.sha256('PLAYWRIGHT');\n }\n </script>\n <button onclick=\"onClick()\">Click me</button>\n <div></div>\n \"\"\")\n await page.get_by_role(\"button\").click()\n\nasync def main():\n async with async_playwright() as playwright:\n await run(playwright)\nasyncio.run(main())\n```\n\n```py\nimport hashlib\nfrom playwright.sync_api import sync_playwright\n\ndef sha256(text: str) -> str:\n m = hashlib.sha256()\n m.update(bytes(text, \"utf8\"))\n return m.hexdigest()\n\n\ndef run(playwright: Playwright):\n webkit = playwright.webkit\n browser = webkit.launch(headless=False)\n context = browser.new_context()\n context.expose_function(\"sha256\", sha256)\n page = context.new_page()\n page.set_content(\"\"\"\n <script>\n async function onClick() {\n document.querySelector('div').textContent = await window.sha256('PLAYWRIGHT');\n }\n </script>\n <button onclick=\"onClick()\">Click me</button>\n <div></div>\n \"\"\")\n page.get_by_role(\"button\").click()\n\nwith sync_playwright() as playwright:\n run(playwright)\n```\n\n```csharp\nusing Microsoft.Playwright;\nusing System;\nusing System.Security.Cryptography;\nusing System.Threading.Tasks;\n\nclass BrowserContextExamples\n{\n public static async Task Main()\n {\n using var playwright = await Playwright.CreateAsync();\n var browser = await playwright.Webkit.LaunchAsync(new() { Headless = false });\n var context = await browser.NewContextAsync();\n\n await context.ExposeFunctionAsync(\"sha256\", (string input) =>\n {\n return Convert.ToBase64String(\n SHA256.Create().ComputeHash(System.Text.Encoding.UTF8.GetBytes(input)));\n });\n\n var page = await context.NewPageAsync();\n await page.SetContentAsync(\"<script>\\n\" +\n \" async function onClick() {\\n\" +\n \" document.querySelector('div').textContent = await window.sha256('PLAYWRIGHT');\\n\" +\n \" }\\n\" +\n \"</script>\\n\" +\n \"<button onclick=\\\"onClick()\\\">Click me</button>\\n\" +\n \"<div></div>\");\n\n await page.GetByRole(AriaRole.Button).ClickAsync();\n Console.WriteLine(await page.TextContentAsync(\"div\"));\n }\n}\n```\n","async":true,"alias":"exposeFunction","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Name of the function on the window object."}],"required":true,"comment":"Name of the function on the window object.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"callback","type":{"name":"function","expression":"[function]"},"spec":[{"type":"text","text":"Callback function that will be called in the Playwright's context."}],"required":true,"comment":"Callback function that will be called in the Playwright's context.","async":false,"alias":"callback","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"grantPermissions","type":{"name":"void"},"spec":[{"type":"text","text":"Grants specified permissions to the browser context. Only grants corresponding permissions to the given origin if↵specified."}],"required":true,"comment":"Grants specified permissions to the browser context. Only grants corresponding permissions to the given origin if\nspecified.","async":true,"alias":"grantPermissions","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"permissions","type":{"name":"Array","templates":[{"name":"string"}],"expression":"[Array]<[string]>"},"spec":[{"type":"text","text":"A permission or an array of permissions to grant. Permissions can be one of the following values:"},{"type":"li","text":"`'accelerometer'`","liType":"bullet"},{"type":"li","text":"`'accessibility-events'`","liType":"bullet"},{"type":"li","text":"`'ambient-light-sensor'`","liType":"bullet"},{"type":"li","text":"`'background-sync'`","liType":"bullet"},{"type":"li","text":"`'camera'`","liType":"bullet"},{"type":"li","text":"`'clipboard-read'`","liType":"bullet"},{"type":"li","text":"`'clipboard-write'`","liType":"bullet"},{"type":"li","text":"`'geolocation'`","liType":"bullet"},{"type":"li","text":"`'gyroscope'`","liType":"bullet"},{"type":"li","text":"`'magnetometer'`","liType":"bullet"},{"type":"li","text":"`'microphone'`","liType":"bullet"},{"type":"li","text":"`'midi-sysex'` (system-exclusive midi)","liType":"bullet"},{"type":"li","text":"`'midi'`","liType":"bullet"},{"type":"li","text":"`'notifications'`","liType":"bullet"},{"type":"li","text":"`'payment-handler'`","liType":"bullet"},{"type":"li","text":"`'storage-access'`","liType":"bullet"}],"required":true,"comment":"A permission or an array of permissions to grant. Permissions can be one of the following values:\n- `'accelerometer'`\n- `'accessibility-events'`\n- `'ambient-light-sensor'`\n- `'background-sync'`\n- `'camera'`\n- `'clipboard-read'`\n- `'clipboard-write'`\n- `'geolocation'`\n- `'gyroscope'`\n- `'magnetometer'`\n- `'microphone'`\n- `'midi-sysex'` (system-exclusive midi)\n- `'midi'`\n- `'notifications'`\n- `'payment-handler'`\n- `'storage-access'`","async":false,"alias":"permissions","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"origin","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"The [origin] to grant permissions to, e.g. \"https://example.com\"."}],"required":false,"comment":"The [origin] to grant permissions to, e.g. \"https://example.com\".","async":false,"alias":"origin","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.11","name":"newCDPSession","type":{"name":"CDPSession","expression":"[CDPSession]"},"spec":[{"type":"note","noteType":"note","text":"CDP sessions are only supported on Chromium-based browsers."},{"type":"text","text":"Returns the newly created session."}],"required":true,"comment":"**NOTE** CDP sessions are only supported on Chromium-based browsers.\n\nReturns the newly created session.","async":true,"alias":"newCDPSession","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.11","name":"page","type":{"name":"","union":[{"name":"Page"},{"name":"Frame"}],"expression":"[Page]|[Frame]"},"spec":[{"type":"text","text":"Target to create new session for. For backwards-compatibility, this parameter is↵named `page`, but it can be a `Page` or `Frame` type."}],"required":true,"comment":"Target to create new session for. For backwards-compatibility, this parameter is named `page`, but it can be a\n`Page` or `Frame` type.","async":false,"alias":"page","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"newPage","type":{"name":"Page","expression":"[Page]"},"spec":[{"type":"text","text":"Creates a new page in the browser context."}],"required":true,"comment":"Creates a new page in the browser context.","async":true,"alias":"newPage","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"pages","type":{"name":"Array","templates":[{"name":"Page"}],"expression":"[Array]<[Page]>"},"spec":[{"type":"text","text":"Returns all open pages in the context."}],"required":true,"comment":"Returns all open pages in the context.","async":false,"alias":"pages","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"property","langs":{"aliases":{"csharp":"APIRequest"},"types":{},"overrides":{}},"since":"v1.16","name":"request","type":{"name":"APIRequestContext","expression":"[APIRequestContext]"},"spec":[{"type":"text","text":"API testing helper associated with this context. Requests made with this API will use context cookies."}],"required":true,"comment":"API testing helper associated with this context. Requests made with this API will use context cookies.","async":false,"alias":"request","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"route","type":{"name":"void"},"spec":[{"type":"text","text":"Routing provides the capability to modify network requests that are made by any page in the browser context. Once route↵is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted."},{"type":"note","noteType":"note","text":"[`method: BrowserContext.route`] will not intercept requests intercepted by Service Worker. See [this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when using request interception by setting `Browser.newContext.serviceWorkers` to `'block'`."},{"type":"text","text":"**Usage**"},{"type":"text","text":"An example of a naive handler that aborts all image requests:"},{"type":"code","lines":["const context = await browser.newContext();","await context.route('**/*.{png,jpg,jpeg}', route => route.abort());","const page = await context.newPage();","await page.goto('https://example.com');","await browser.close();"],"codeLang":"js"},{"type":"code","lines":["BrowserContext context = browser.newContext();","context.route(\"**/*.{png,jpg,jpeg}\", route -> route.abort());","Page page = context.newPage();","page.navigate(\"https://example.com\");","browser.close();"],"codeLang":"java"},{"type":"code","lines":["context = await browser.new_context()","page = await context.new_page()","await context.route(\"**/*.{png,jpg,jpeg}\", lambda route: route.abort())","await page.goto(\"https://example.com\")","await browser.close()"],"codeLang":"python async"},{"type":"code","lines":["context = browser.new_context()","page = context.new_page()","context.route(\"**/*.{png,jpg,jpeg}\", lambda route: route.abort())","page.goto(\"https://example.com\")","browser.close()"],"codeLang":"python sync"},{"type":"code","lines":["var context = await browser.NewContextAsync();","var page = await context.NewPageAsync();","await context.RouteAsync(\"**/*.{png,jpg,jpeg}\", r => r.AbortAsync());","await page.GotoAsync(\"https://theverge.com\");","await browser.CloseAsync();"],"codeLang":"csharp"},{"type":"text","text":"or the same snippet using a regex pattern instead:"},{"type":"code","lines":["const context = await browser.newContext();","await context.route(/(\\.png$)|(\\.jpg$)/, route => route.abort());","const page = await context.newPage();","await page.goto('https://example.com');","await browser.close();"],"codeLang":"js"},{"type":"code","lines":["BrowserContext context = browser.newContext();","context.route(Pattern.compile(\"(\\\\.png$)|(\\\\.jpg$)\"), route -> route.abort());","Page page = context.newPage();","page.navigate(\"https://example.com\");","browser.close();"],"codeLang":"java"},{"type":"code","lines":["context = await browser.new_context()","page = await context.new_page()","await context.route(re.compile(r\"(\\.png$)|(\\.jpg$)\"), lambda route: route.abort())","page = await context.new_page()","await page.goto(\"https://example.com\")","await browser.close()"],"codeLang":"python async"},{"type":"code","lines":["context = browser.new_context()","page = context.new_page()","context.route(re.compile(r\"(\\.png$)|(\\.jpg$)\"), lambda route: route.abort())","page = await context.new_page()","page = context.new_page()","page.goto(\"https://example.com\")","browser.close()"],"codeLang":"python sync"},{"type":"code","lines":["var context = await browser.NewContextAsync();","var page = await context.NewPageAsync();","await context.RouteAsync(new Regex(\"(\\\\.png$)|(\\\\.jpg$)\"), r => r.AbortAsync());","await page.GotoAsync(\"https://theverge.com\");","await browser.CloseAsync();"],"codeLang":"csharp"},{"type":"text","text":"It is possible to examine the request to decide the route action. For example, mocking all requests that contain some post data, and leaving all other requests as is:"},{"type":"code","lines":["await context.route('/api/**', async route => {"," if (route.request().postData().includes('my-string'))"," await route.fulfill({ body: 'mocked-data' });"," else"," await route.continue();","});"],"codeLang":"js"},{"type":"code","lines":["context.route(\"/api/**\", route -> {"," if (route.request().postData().contains(\"my-string\"))"," route.fulfill(new Route.FulfillOptions().setBody(\"mocked-data\"));"," else"," route.resume();","});"],"codeLang":"java"},{"type":"code","lines":["async def handle_route(route: Route):"," if (\"my-string\" in route.request.post_data):"," await route.fulfill(body=\"mocked-data\")"," else:"," await route.continue_()","await context.route(\"/api/**\", handle_route)"],"codeLang":"python async"},{"type":"code","lines":["def handle_route(route: Route):"," if (\"my-string\" in route.request.post_data):"," route.fulfill(body=\"mocked-data\")"," else:"," route.continue_()","context.route(\"/api/**\", handle_route)"],"codeLang":"python sync"},{"type":"code","lines":["await page.RouteAsync(\"/api/**\", async r =>","{"," if (r.Request.PostData.Contains(\"my-string\"))"," await r.FulfillAsync(new() { Body = \"mocked-data\" });"," else"," await r.ContinueAsync();","});"],"codeLang":"csharp"},{"type":"text","text":"Page routes (set up with [`method: Page.route`]) take precedence over browser context routes when request matches both↵handlers."},{"type":"text","text":"To remove a route with its handler you can use [`method: BrowserContext.unroute`]."},{"type":"note","noteType":"note","text":"Enabling routing disables http cache."}],"required":true,"comment":"Routing provides the capability to modify network requests that are made by any page in the browser context. Once\nroute is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted.\n\n**NOTE** [`method: BrowserContext.route`] will not intercept requests intercepted by Service Worker. See\n[this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when\nusing request interception by setting `Browser.newContext.serviceWorkers` to `'block'`.\n\n**Usage**\n\nAn example of a naive handler that aborts all image requests:\n\n```js\nconst context = await browser.newContext();\nawait context.route('**/*.{png,jpg,jpeg}', route => route.abort());\nconst page = await context.newPage();\nawait page.goto('https://example.com');\nawait browser.close();\n```\n\n```java\nBrowserContext context = browser.newContext();\ncontext.route(\"**/*.{png,jpg,jpeg}\", route -> route.abort());\nPage page = context.newPage();\npage.navigate(\"https://example.com\");\nbrowser.close();\n```\n\n```py\ncontext = await browser.new_context()\npage = await context.new_page()\nawait context.route(\"**/*.{png,jpg,jpeg}\", lambda route: route.abort())\nawait page.goto(\"https://example.com\")\nawait browser.close()\n```\n\n```py\ncontext = browser.new_context()\npage = context.new_page()\ncontext.route(\"**/*.{png,jpg,jpeg}\", lambda route: route.abort())\npage.goto(\"https://example.com\")\nbrowser.close()\n```\n\n```csharp\nvar context = await browser.NewContextAsync();\nvar page = await context.NewPageAsync();\nawait context.RouteAsync(\"**/*.{png,jpg,jpeg}\", r => r.AbortAsync());\nawait page.GotoAsync(\"https://theverge.com\");\nawait browser.CloseAsync();\n```\n\nor the same snippet using a regex pattern instead:\n\n```js\nconst context = await browser.newContext();\nawait context.route(/(\\.png$)|(\\.jpg$)/, route => route.abort());\nconst page = await context.newPage();\nawait page.goto('https://example.com');\nawait browser.close();\n```\n\n```java\nBrowserContext context = browser.newContext();\ncontext.route(Pattern.compile(\"(\\\\.png$)|(\\\\.jpg$)\"), route -> route.abort());\nPage page = context.newPage();\npage.navigate(\"https://example.com\");\nbrowser.close();\n```\n\n```py\ncontext = await browser.new_context()\npage = await context.new_page()\nawait context.route(re.compile(r\"(\\.png$)|(\\.jpg$)\"), lambda route: route.abort())\npage = await context.new_page()\nawait page.goto(\"https://example.com\")\nawait browser.close()\n```\n\n```py\ncontext = browser.new_context()\npage = context.new_page()\ncontext.route(re.compile(r\"(\\.png$)|(\\.jpg$)\"), lambda route: route.abort())\npage = await context.new_page()\npage = context.new_page()\npage.goto(\"https://example.com\")\nbrowser.close()\n```\n\n```csharp\nvar context = await browser.NewContextAsync();\nvar page = await context.NewPageAsync();\nawait context.RouteAsync(new Regex(\"(\\\\.png$)|(\\\\.jpg$)\"), r => r.AbortAsync());\nawait page.GotoAsync(\"https://theverge.com\");\nawait browser.CloseAsync();\n```\n\nIt is possible to examine the request to decide the route action. For example, mocking all requests that contain\nsome post data, and leaving all other requests as is:\n\n```js\nawait context.route('/api/**', async route => {\n if (route.request().postData().includes('my-string'))\n await route.fulfill({ body: 'mocked-data' });\n else\n await route.continue();\n});\n```\n\n```java\ncontext.route(\"/api/**\", route -> {\n if (route.request().postData().contains(\"my-string\"))\n route.fulfill(new Route.FulfillOptions().setBody(\"mocked-data\"));\n else\n route.resume();\n});\n```\n\n```py\nasync def handle_route(route: Route):\n if (\"my-string\" in route.request.post_data):\n await route.fulfill(body=\"mocked-data\")\n else:\n await route.continue_()\nawait context.route(\"/api/**\", handle_route)\n```\n\n```py\ndef handle_route(route: Route):\n if (\"my-string\" in route.request.post_data):\n route.fulfill(body=\"mocked-data\")\n else:\n route.continue_()\ncontext.route(\"/api/**\", handle_route)\n```\n\n```csharp\nawait page.RouteAsync(\"/api/**\", async r =>\n{\n if (r.Request.PostData.Contains(\"my-string\"))\n await r.FulfillAsync(new() { Body = \"mocked-data\" });\n else\n await r.ContinueAsync();\n});\n```\n\nPage routes (set up with [`method: Page.route`]) take precedence over browser context routes when request matches\nboth handlers.\n\nTo remove a route with its handler you can use [`method: BrowserContext.unroute`].\n\n**NOTE** Enabling routing disables http cache.","async":true,"alias":"route","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"url","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"},{"name":"function","args":[{"name":"URL"}],"returnType":{"name":"boolean"}}],"expression":"[string]|[RegExp]|[function]([URL]):[boolean]"},"spec":[{"type":"text","text":"A glob pattern, regex pattern or predicate receiving [URL] to match while routing.↵When a `baseURL` via the context options was provided and the passed URL is a path,↵it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor."}],"required":true,"comment":"A glob pattern, regex pattern or predicate receiving [URL] to match while routing. When a `baseURL` via the context\noptions was provided and the passed URL is a path, it gets merged via the\n[`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"handler","type":{"name":"function","args":[{"name":"Route"},{"name":"Request"}],"returnType":{"name":"","union":[{"name":"Promise","templates":[{"name":"any"}]},{"name":"any"}]},"expression":"[function]([Route], [Request]): [Promise<any>|any]"},"spec":[{"type":"text","text":"handler function to route the request."}],"required":true,"comment":"handler function to route the request.","async":false,"alias":"handler","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"handler","type":{"name":"function","args":[{"name":"Route"}],"expression":"[function]([Route])"},"spec":[{"type":"text","text":"handler function to route the request."}],"required":true,"comment":"handler function to route the request.","async":false,"alias":"handler","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.15","name":"times","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"How often a route should be used. By default it will be used every time."}],"required":false,"comment":"How often a route should be used. By default it will be used every time.","async":false,"alias":"times","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.23","name":"routeFromHAR","type":{"name":"void"},"spec":[{"type":"text","text":"If specified the network requests that are made in the context will be served from the HAR file. Read more about [Replaying from HAR](../mock.md#replaying-from-har)."},{"type":"text","text":"Playwright will not serve requests intercepted by Service Worker from the HAR file. See [this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when using request interception by setting `Browser.newContext.serviceWorkers` to `'block'`."}],"required":true,"comment":"If specified the network requests that are made in the context will be served from the HAR file. Read more about\n[Replaying from HAR](../mock.md#replaying-from-har).\n\nPlaywright will not serve requests intercepted by Service Worker from the HAR file. See\n[this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when\nusing request interception by setting `Browser.newContext.serviceWorkers` to `'block'`.","async":true,"alias":"routeFromHAR","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.23","name":"har","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to a [HAR](http://www.softwareishard.com/blog/har-12-spec) file with prerecorded network data. If `path` is a relative path, then it is resolved relative to the current working directory."}],"required":true,"comment":"Path to a [HAR](http://www.softwareishard.com/blog/har-12-spec) file with prerecorded network data. If `path` is a\nrelative path, then it is resolved relative to the current working directory.","async":false,"alias":"har","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.23","name":"notFound","type":{"name":"HarNotFound","union":[{"name":"\"abort\""},{"name":"\"fallback\""}],"expression":"[HarNotFound]<\"abort\"|\"fallback\">"},"spec":[{"type":"li","text":"If set to 'abort' any request not found in the HAR file will be aborted.","liType":"bullet"},{"type":"li","text":"If set to 'fallback' falls through to the next route handler in the handler chain.","liType":"bullet"},{"type":"text","text":"Defaults to abort."}],"required":false,"comment":"- If set to 'abort' any request not found in the HAR file will be aborted.\n- If set to 'fallback' falls through to the next route handler in the handler chain.\n\nDefaults to abort.","async":false,"alias":"notFound","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.23","name":"update","type":{"name":"boolean","expression":"boolean"},"spec":[{"type":"text","text":"If specified, updates the given HAR with the actual network information instead of serving from file. The file is written to disk when [`method: BrowserContext.close`] is called."}],"required":false,"comment":"If specified, updates the given HAR with the actual network information instead of serving from file. The file is\nwritten to disk when [`method: BrowserContext.close`] is called.","async":false,"alias":"update","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.32","name":"updateContent","type":{"name":"RouteFromHarUpdateContentPolicy","union":[{"name":"\"embed\""},{"name":"\"attach\""}],"expression":"[RouteFromHarUpdateContentPolicy]<\"embed\"|\"attach\">"},"spec":[{"type":"text","text":"Optional setting to control resource content management. If `attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is specified, content is stored inline the HAR file."}],"required":false,"comment":"Optional setting to control resource content management. If `attach` is specified, resources are persisted as\nseparate files or entries in the ZIP archive. If `embed` is specified, content is stored inline the HAR file.","async":false,"alias":"updateContent","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.32","name":"updateMode","type":{"name":"HarMode","union":[{"name":"\"full\""},{"name":"\"minimal\""}],"expression":"[HarMode]<\"full\"|\"minimal\">"},"spec":[{"type":"text","text":"When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `minimal`."}],"required":false,"comment":"When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,\ncookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to\n`minimal`.","async":false,"alias":"updateMode","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.23","name":"url","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"A glob pattern, regular expression or predicate to match the request URL. Only requests with URL matching the pattern will be served from the HAR file. If not specified, all requests are served from the HAR file."}],"required":false,"comment":"A glob pattern, regular expression or predicate to match the request URL. Only requests with URL matching the\npattern will be served from the HAR file. If not specified, all requests are served from the HAR file.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.11","name":"serviceWorkers","type":{"name":"Array","templates":[{"name":"Worker"}],"expression":"[Array]<[Worker]>"},"spec":[{"type":"note","noteType":"note","text":"Service workers are only supported on Chromium-based browsers."},{"type":"text","text":"All existing service workers in the context."}],"required":true,"comment":"**NOTE** Service workers are only supported on Chromium-based browsers.\n\nAll existing service workers in the context.","async":false,"alias":"serviceWorkers","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"setDefaultNavigationTimeout","type":{"name":"void"},"spec":[{"type":"text","text":"This setting will change the default maximum navigation time for the following methods and related shortcuts:"},{"type":"li","text":"[`method: Page.goBack`]","liType":"bullet"},{"type":"li","text":"[`method: Page.goForward`]","liType":"bullet"},{"type":"li","text":"[`method: Page.goto`]","liType":"bullet"},{"type":"li","text":"[`method: Page.reload`]","liType":"bullet"},{"type":"li","text":"[`method: Page.setContent`]","liType":"bullet"},{"type":"li","text":"[`method: Page.waitForNavigation`]","liType":"bullet"},{"type":"note","noteType":"note","text":"[`method: Page.setDefaultNavigationTimeout`] and [`method: Page.setDefaultTimeout`] take priority over↵[`method: BrowserContext.setDefaultNavigationTimeout`]."}],"required":true,"comment":"This setting will change the default maximum navigation time for the following methods and related shortcuts:\n- [`method: Page.goBack`]\n- [`method: Page.goForward`]\n- [`method: Page.goto`]\n- [`method: Page.reload`]\n- [`method: Page.setContent`]\n- [`method: Page.waitForNavigation`]\n\n**NOTE** [`method: Page.setDefaultNavigationTimeout`] and [`method: Page.setDefaultTimeout`] take priority over\n[`method: BrowserContext.setDefaultNavigationTimeout`].","async":false,"alias":"setDefaultNavigationTimeout","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum navigation time in milliseconds"}],"required":true,"comment":"Maximum navigation time in milliseconds","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"setDefaultTimeout","type":{"name":"void"},"spec":[{"type":"text","text":"This setting will change the default maximum time for all the methods accepting `timeout` option."},{"type":"note","noteType":"note","text":"[`method: Page.setDefaultNavigationTimeout`], [`method: Page.setDefaultTimeout`] and↵[`method: BrowserContext.setDefaultNavigationTimeout`] take priority over [`method: BrowserContext.setDefaultTimeout`]."}],"required":true,"comment":"This setting will change the default maximum time for all the methods accepting `timeout` option.\n\n**NOTE** [`method: Page.setDefaultNavigationTimeout`], [`method: Page.setDefaultTimeout`] and\n[`method: BrowserContext.setDefaultNavigationTimeout`] take priority over\n[`method: BrowserContext.setDefaultTimeout`].","async":false,"alias":"setDefaultTimeout","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds"}],"required":true,"comment":"Maximum time in milliseconds","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"setExtraHTTPHeaders","type":{"name":"void"},"spec":[{"type":"text","text":"The extra HTTP headers will be sent with every request initiated by any page in the context. These headers are merged↵with page-specific extra HTTP headers set with [`method: Page.setExtraHTTPHeaders`]. If page overrides a particular↵header, page-specific header value will be used instead of the browser context header value."},{"type":"note","noteType":"note","text":"[`method: BrowserContext.setExtraHTTPHeaders`] does not guarantee the order of headers in the outgoing requests."}],"required":true,"comment":"The extra HTTP headers will be sent with every request initiated by any page in the context. These headers are\nmerged with page-specific extra HTTP headers set with [`method: Page.setExtraHTTPHeaders`]. If page overrides a\nparticular header, page-specific header value will be used instead of the browser context header value.\n\n**NOTE** [`method: BrowserContext.setExtraHTTPHeaders`] does not guarantee the order of headers in the outgoing\nrequests.","async":true,"alias":"setExtraHTTPHeaders","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"headers","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"An object containing additional HTTP headers to be sent with every request. All header values must be strings."}],"required":true,"comment":"An object containing additional HTTP headers to be sent with every request. All header values must be strings.","async":false,"alias":"headers","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"setGeolocation","type":{"name":"void"},"spec":[{"type":"text","text":"Sets the context's geolocation. Passing `null` or `undefined` emulates position unavailable."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await browserContext.setGeolocation({ latitude: 59.95, longitude: 30.31667 });"],"codeLang":"js"},{"type":"code","lines":["browserContext.setGeolocation(new Geolocation(59.95, 30.31667));"],"codeLang":"java"},{"type":"code","lines":["await browser_context.set_geolocation({\"latitude\": 59.95, \"longitude\": 30.31667})"],"codeLang":"python async"},{"type":"code","lines":["browser_context.set_geolocation({\"latitude\": 59.95, \"longitude\": 30.31667})"],"codeLang":"python sync"},{"type":"code","lines":["await context.SetGeolocationAsync(new Geolocation()","{"," Latitude = 59.95f,"," Longitude = 30.31667f","});"],"codeLang":"csharp"},{"type":"note","noteType":"note","text":"Consider using [`method: BrowserContext.grantPermissions`] to grant permissions for the browser context pages to read↵its geolocation."}],"required":true,"comment":"Sets the context's geolocation. Passing `null` or `undefined` emulates position unavailable.\n\n**Usage**\n\n```js\nawait browserContext.setGeolocation({ latitude: 59.95, longitude: 30.31667 });\n```\n\n```java\nbrowserContext.setGeolocation(new Geolocation(59.95, 30.31667));\n```\n\n```py\nawait browser_context.set_geolocation({\"latitude\": 59.95, \"longitude\": 30.31667})\n```\n\n```py\nbrowser_context.set_geolocation({\"latitude\": 59.95, \"longitude\": 30.31667})\n```\n\n```csharp\nawait context.SetGeolocationAsync(new Geolocation()\n{\n Latitude = 59.95f,\n Longitude = 30.31667f\n});\n```\n\n**NOTE** Consider using [`method: BrowserContext.grantPermissions`] to grant permissions for the browser context\npages to read its geolocation.","async":true,"alias":"setGeolocation","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"geolocation","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"latitude","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Latitude between -90 and 90."}],"required":true,"comment":"Latitude between -90 and 90.","async":false,"alias":"latitude","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"longitude","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Longitude between -180 and 180."}],"required":true,"comment":"Longitude between -180 and 180.","async":false,"alias":"longitude","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"accuracy","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Non-negative accuracy value. Defaults to `0`."}],"required":false,"comment":"Non-negative accuracy value. Defaults to `0`.","async":false,"alias":"accuracy","overloadIndex":0,"paramOrOption":null}]}],"expression":"[null]|[Object]"},"spec":[],"required":true,"comment":"","async":false,"alias":"geolocation","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","deprecated":"Browsers may cache credentials after successful authentication. Create a new browser context instead.","name":"setHTTPCredentials","type":{"name":"void"},"spec":[],"required":true,"comment":"","async":true,"alias":"setHTTPCredentials","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"httpCredentials","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"username","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"username","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"password","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"password","overloadIndex":0,"paramOrOption":null}]}],"expression":"[null]|[Object]"},"spec":[],"required":true,"comment":"","async":false,"alias":"httpCredentials","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"setOffline","type":{"name":"void"},"spec":[],"required":true,"comment":"","async":true,"alias":"setOffline","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"offline","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to emulate network being offline for the browser context."}],"required":true,"comment":"Whether to emulate network being offline for the browser context.","async":false,"alias":"offline","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"types":{"csharp":{"name":"string","expression":"[string]"},"java":{"name":"string","expression":"[string]"}}},"since":"v1.8","name":"storageState","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"cookies","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"domain","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"domain","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"path","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"expires","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Unix time in seconds."}],"required":true,"comment":"Unix time in seconds.","async":false,"alias":"expires","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"httpOnly","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"httpOnly","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"secure","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"secure","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"sameSite","type":{"name":"SameSiteAttribute","union":[{"name":"\"Strict\""},{"name":"\"Lax\""},{"name":"\"None\""}],"expression":"[SameSiteAttribute]<\"Strict\"|\"Lax\"|\"None\">"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"sameSite","overloadIndex":0,"paramOrOption":null}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"cookies","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"origins","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"origin","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"origin","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"localStorage","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"localStorage","overloadIndex":0,"paramOrOption":null}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"origins","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Returns storage state for this browser context, contains current cookies and local storage snapshot."}],"required":true,"comment":"Returns storage state for this browser context, contains current cookies and local storage snapshot.","async":true,"alias":"storageState","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"The file path to save the storage state to. If `path` is a relative path, then it is resolved relative to↵current working directory. If no path is provided, storage↵state is still returned, but won't be saved to the disk."}],"required":false,"comment":"The file path to save the storage state to. If `path` is a relative path, then it is resolved relative to current\nworking directory. If no path is provided, storage state is still returned, but won't be saved to the disk.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"property","langs":{},"since":"v1.12","name":"tracing","type":{"name":"Tracing","expression":"[Tracing]"},"spec":[],"required":true,"comment":"","async":false,"alias":"tracing","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.41","name":"unrouteAll","type":{"name":"void"},"spec":[{"type":"text","text":"Removes all routes created with [`method: BrowserContext.route`] and [`method: BrowserContext.routeFromHAR`]."}],"required":true,"comment":"Removes all routes created with [`method: BrowserContext.route`] and [`method: BrowserContext.routeFromHAR`].","async":true,"alias":"unrouteAll","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js","csharp","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.41","name":"behavior","type":{"name":"UnrouteBehavior","union":[{"name":"\"wait\""},{"name":"\"ignoreErrors\""},{"name":"\"default\""}],"expression":"[UnrouteBehavior]<\"wait\"|\"ignoreErrors\"|\"default\">"},"spec":[{"type":"text","text":"Specifies whether to wait for already running handlers and what to do if they throw errors:"},{"type":"li","text":"`'default'` - do not wait for current handler calls (if any) to finish, if unrouted handler throws, it may result in unhandled error","liType":"bullet"},{"type":"li","text":"`'wait'` - wait for current handler calls (if any) to finish","liType":"bullet"},{"type":"li","text":"`'ignoreErrors'` - do not wait for current handler calls (if any) to finish, all errors thrown by the handlers after unrouting are silently caught","liType":"bullet"}],"required":false,"comment":"Specifies whether to wait for already running handlers and what to do if they throw errors:\n- `'default'` - do not wait for current handler calls (if any) to finish, if unrouted handler throws, it may\n result in unhandled error\n- `'wait'` - wait for current handler calls (if any) to finish\n- `'ignoreErrors'` - do not wait for current handler calls (if any) to finish, all errors thrown by the handlers\n after unrouting are silently caught","async":false,"alias":"behavior","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"unroute","type":{"name":"void"},"spec":[{"type":"text","text":"Removes a route created with [`method: BrowserContext.route`]. When `handler` is not specified, removes all↵routes for the `url`."}],"required":true,"comment":"Removes a route created with [`method: BrowserContext.route`]. When `handler` is not specified, removes all routes\nfor the `url`.","async":true,"alias":"unroute","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"url","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"},{"name":"function","args":[{"name":"URL"}],"returnType":{"name":"boolean"}}],"expression":"[string]|[RegExp]|[function]([URL]):[boolean]"},"spec":[{"type":"text","text":"A glob pattern, regex pattern or predicate receiving [URL] used to register a routing with↵[`method: BrowserContext.route`]."}],"required":true,"comment":"A glob pattern, regex pattern or predicate receiving [URL] used to register a routing with\n[`method: BrowserContext.route`].","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"handler","type":{"name":"function","args":[{"name":"Route"},{"name":"Request"}],"returnType":{"name":"","union":[{"name":"Promise","templates":[{"name":"any"}]},{"name":"any"}]},"expression":"[function]([Route], [Request]): [Promise<any>|any]"},"spec":[{"type":"text","text":"Optional handler function used to register a routing with [`method: BrowserContext.route`]."}],"required":false,"comment":"Optional handler function used to register a routing with [`method: BrowserContext.route`].","async":false,"alias":"handler","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"handler","type":{"name":"function","args":[{"name":"Route"}],"expression":"[function]([Route])"},"spec":[{"type":"text","text":"Optional handler function used to register a routing with [`method: BrowserContext.route`]."}],"required":false,"comment":"Optional handler function used to register a routing with [`method: BrowserContext.route`].","async":false,"alias":"handler","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.32","name":"waitForCondition","type":{"name":"void"},"spec":[{"type":"text","text":"The method will block until the condition returns true. All Playwright events will↵be dispatched while the method is waiting for the condition."},{"type":"text","text":"**Usage**"},{"type":"text","text":"Use the method to wait for a condition that depends on page events:"},{"type":"code","lines":["List<String> failedUrls = new ArrayList<>();","context.onResponse(response -> {"," if (!response.ok()) {"," failedUrls.add(response.url());"," }","});","page1.getByText(\"Create user\").click();","page2.getByText(\"Submit button\").click();","context.waitForCondition(() -> failedUrls.size() > 3);"],"codeLang":"java"}],"required":true,"comment":"The method will block until the condition returns true. All Playwright events will be dispatched while the method\nis waiting for the condition.\n\n**Usage**\n\nUse the method to wait for a condition that depends on page events:\n\n```java\nList<String> failedUrls = new ArrayList<>();\ncontext.onResponse(response -> {\n if (!response.ok()) {\n failedUrls.add(response.url());\n }\n});\npage1.getByText(\"Create user\").click();\npage2.getByText(\"Submit button\").click();\ncontext.waitForCondition(() -> failedUrls.size() > 3);\n```\n","async":true,"alias":"waitForCondition","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.32","name":"condition","type":{"name":"BooleanSupplier","expression":"[BooleanSupplier]"},"spec":[{"type":"text","text":"Condition to wait for."}],"required":true,"comment":"Condition to wait for.","async":false,"alias":"condition","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.32","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default↵value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["java","python","csharp"],"aliases":{"python":"expect_console_message","csharp":"RunAndWaitForConsoleMessage"},"types":{"python":{"name":"EventContextManager","templates":[{"name":"ConsoleMessage"}],"expression":"[EventContextManager]<[ConsoleMessage]>"}},"overrides":{}},"since":"v1.34","name":"waitForConsoleMessage","type":{"name":"ConsoleMessage","expression":"[ConsoleMessage]"},"spec":[{"type":"text","text":"Performs action and waits for a `ConsoleMessage` to be logged by in the pages in the context. If predicate is provided, it passes↵`ConsoleMessage` value into the `predicate` function and waits for `predicate(message)` to return a truthy value.↵Will throw an error if the page is closed before the [`event: BrowserContext.console`] event is fired."}],"required":true,"comment":"Performs action and waits for a `ConsoleMessage` to be logged by in the pages in the context. If predicate is\nprovided, it passes `ConsoleMessage` value into the `predicate` function and waits for `predicate(message)` to\nreturn a truthy value. Will throw an error if the page is closed before the [`event: BrowserContext.console`] event\nis fired.","async":true,"alias":"waitForConsoleMessage","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.34","name":"action","type":{"name":"Func","templates":[{"name":"Task"}],"expression":"[Func<Task>]"},"spec":[{"type":"text","text":"Action that triggers the event."}],"required":true,"comment":"Action that triggers the event.","async":false,"alias":"action","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.34","name":"predicate","type":{"name":"function","args":[{"name":"ConsoleMessage"}],"returnType":{"name":"boolean"},"expression":"[function]([ConsoleMessage]):[boolean]"},"spec":[{"type":"text","text":"Receives the `ConsoleMessage` object and resolves to truthy value when the waiting should resolve."}],"required":false,"comment":"Receives the `ConsoleMessage` object and resolves to truthy value when the waiting should resolve.","async":false,"alias":"predicate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.34","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.↵The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`]."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.34","name":"callback","type":{"name":"Runnable","expression":"[Runnable]"},"spec":[{"type":"text","text":"Callback that performs the action triggering the event."}],"required":true,"comment":"Callback that performs the action triggering the event.","async":false,"alias":"callback","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["js","python"],"aliases":{"python":"expect_event"},"types":{"python":{"name":"EventContextManager","expression":"[EventContextManager]"}},"overrides":{}},"since":"v1.8","name":"waitForEvent","type":{"name":"any","expression":"[any]"},"spec":[{"type":"text","text":"Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy↵value. Will throw an error if the context closes before the event is fired. Returns the event data value."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const pagePromise = context.waitForEvent('page');","await page.getByRole('button').click();","const page = await pagePromise;"],"codeLang":"js"},{"type":"code","lines":["Page newPage = context.waitForPage(() -> page.getByRole(AriaRole.BUTTON).click());"],"codeLang":"java"},{"type":"code","lines":["async with context.expect_event(\"page\") as event_info:"," await page.get_by_role(\"button\").click()","page = await event_info.value"],"codeLang":"python async"},{"type":"code","lines":["with context.expect_event(\"page\") as event_info:"," page.get_by_role(\"button\").click()","page = event_info.value"],"codeLang":"python sync"},{"type":"code","lines":["var page = await context.RunAndWaitForPageAsync(async () =>","{"," await page.GetByRole(AriaRole.Button).ClickAsync();","});"],"codeLang":"csharp"}],"required":true,"comment":"Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy\nvalue. Will throw an error if the context closes before the event is fired. Returns the event data value.\n\n**Usage**\n\n```js\nconst pagePromise = context.waitForEvent('page');\nawait page.getByRole('button').click();\nconst page = await pagePromise;\n```\n\n```java\nPage newPage = context.waitForPage(() -> page.getByRole(AriaRole.BUTTON).click());\n```\n\n```py\nasync with context.expect_event(\"page\") as event_info:\n await page.get_by_role(\"button\").click()\npage = await event_info.value\n```\n\n```py\nwith context.expect_event(\"page\") as event_info:\n page.get_by_role(\"button\").click()\npage = event_info.value\n```\n\n```csharp\nvar page = await context.RunAndWaitForPageAsync(async () =>\n{\n await page.GetByRole(AriaRole.Button).ClickAsync();\n});\n```\n","async":true,"alias":"waitForEvent","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"event","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Event name, same one would pass into `browserContext.on(event)`."}],"required":true,"comment":"Event name, same one would pass into `browserContext.on(event)`.","async":false,"alias":"event","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"optionsOrPredicate","type":{"name":"","union":[{"name":"function"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"predicate","type":{"name":"function","expression":"[function]"},"spec":[{"type":"text","text":"Receives the event data and resolves to truthy value when the waiting should resolve."}],"required":true,"comment":"Receives the event data and resolves to truthy value when the waiting should resolve.","async":false,"alias":"predicate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] method."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `0` - no timeout. The default value can be changed via\n`actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] method.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]}],"expression":"[function]|[Object]"},"spec":[{"type":"text","text":"Either a predicate that receives an event or an options object. Optional."}],"required":false,"comment":"Either a predicate that receives an event or an options object. Optional.","async":false,"alias":"optionsOrPredicate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"predicate","type":{"name":"function","expression":"[function]"},"spec":[{"type":"text","text":"Receives the event data and resolves to truthy value when the waiting should resolve."}],"required":false,"comment":"Receives the event data and resolves to truthy value when the waiting should resolve.","async":false,"alias":"predicate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.↵The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`]."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["java","python","csharp"],"aliases":{"python":"expect_page","csharp":"RunAndWaitForPage"},"types":{"python":{"name":"EventContextManager","templates":[{"name":"Page"}],"expression":"[EventContextManager]<[Page]>"}},"overrides":{}},"since":"v1.9","name":"waitForPage","type":{"name":"Page","expression":"[Page]"},"spec":[{"type":"text","text":"Performs action and waits for a new `Page` to be created in the context. If predicate is provided, it passes↵`Page` value into the `predicate` function and waits for `predicate(event)` to return a truthy value.↵Will throw an error if the context closes before new `Page` is created."}],"required":true,"comment":"Performs action and waits for a new `Page` to be created in the context. If predicate is provided, it passes `Page`\nvalue into the `predicate` function and waits for `predicate(event)` to return a truthy value. Will throw an error\nif the context closes before new `Page` is created.","async":true,"alias":"waitForPage","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.12","name":"action","type":{"name":"Func","templates":[{"name":"Task"}],"expression":"[Func<Task>]"},"spec":[{"type":"text","text":"Action that triggers the event."}],"required":true,"comment":"Action that triggers the event.","async":false,"alias":"action","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"predicate","type":{"name":"function","args":[{"name":"Page"}],"returnType":{"name":"boolean"},"expression":"[function]([Page]):[boolean]"},"spec":[{"type":"text","text":"Receives the `Page` object and resolves to truthy value when the waiting should resolve."}],"required":false,"comment":"Receives the `Page` object and resolves to truthy value when the waiting should resolve.","async":false,"alias":"predicate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.↵The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`]."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"callback","type":{"name":"Runnable","expression":"[Runnable]"},"spec":[{"type":"text","text":"Callback that performs the action triggering the event."}],"required":true,"comment":"Callback that performs the action triggering the event.","async":false,"alias":"callback","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["python"],"aliases":{"python":"wait_for_event"},"types":{},"overrides":{}},"since":"v1.8","name":"waitForEvent2","type":{"name":"any","expression":"[any]"},"spec":[{"type":"note","noteType":"note","text":"In most cases, you should use [`method: BrowserContext.waitForEvent`]."},{"type":"text","text":"Waits for given `event` to fire. If predicate is provided, it passes↵event's value into the `predicate` function and waits for `predicate(event)` to return a truthy value.↵Will throw an error if the browser context is closed before the `event` is fired."}],"required":true,"comment":"**NOTE** In most cases, you should use [`method: BrowserContext.waitForEvent`].\n\nWaits for given `event` to fire. If predicate is provided, it passes event's value into the `predicate` function\nand waits for `predicate(event)` to return a truthy value. Will throw an error if the browser context is closed\nbefore the `event` is fired.","async":true,"alias":"waitForEvent2","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["js","python","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"event","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Event name, same one typically passed into `*.on(event)`."}],"required":true,"comment":"Event name, same one typically passed into `*.on(event)`.","async":false,"alias":"event","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"predicate","type":{"name":"function","expression":"[function]"},"spec":[{"type":"text","text":"Receives the event data and resolves to truthy value when the waiting should resolve."}],"required":false,"comment":"Receives the event data and resolves to truthy value when the waiting should resolve.","async":false,"alias":"predicate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.↵The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`]."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]}]},{"name":"BrowserServer","spec":[],"langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","members":[{"kind":"event","langs":{},"since":"v1.8","name":"close","type":{"name":"void"},"spec":[{"type":"text","text":"Emitted when the browser server closes."}],"required":true,"comment":"Emitted when the browser server closes.","async":false,"alias":"close","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"close","type":{"name":"void"},"spec":[{"type":"text","text":"Closes the browser gracefully and makes sure the process is terminated."}],"required":true,"comment":"Closes the browser gracefully and makes sure the process is terminated.","async":true,"alias":"close","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"kill","type":{"name":"void"},"spec":[{"type":"text","text":"Kills the browser process and waits for the process to exit."}],"required":true,"comment":"Kills the browser process and waits for the process to exit.","async":true,"alias":"kill","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"process","type":{"name":"ChildProcess","expression":"[ChildProcess]"},"spec":[{"type":"text","text":"Spawned browser application process."}],"required":true,"comment":"Spawned browser application process.","async":false,"alias":"process","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"wsEndpoint","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Browser websocket url."},{"type":"text","text":"Browser websocket endpoint which can be used as an argument to [`method: BrowserType.connect`] to establish connection↵to the browser."},{"type":"text","text":"Note that if the listen `host` option in `launchServer` options is not specified, localhost will be output anyway, even if the actual listening address is an unspecified address."}],"required":true,"comment":"Browser websocket url.\n\nBrowser websocket endpoint which can be used as an argument to [`method: BrowserType.connect`] to establish\nconnection to the browser.\n\nNote that if the listen `host` option in `launchServer` options is not specified, localhost will be output anyway,\neven if the actual listening address is an unspecified address.","async":false,"alias":"wsEndpoint","overloadIndex":0,"paramOrOption":null,"args":[]}]},{"name":"BrowserType","spec":[{"type":"text","text":"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:"},{"type":"code","lines":["const { chromium } = require('playwright'); // Or 'firefox' or 'webkit'.","","(async () => {"," const browser = await chromium.launch();"," const page = await browser.newPage();"," await page.goto('https://example.com');"," // other actions..."," await browser.close();","})();"],"codeLang":"js"},{"type":"code","lines":["import com.microsoft.playwright.*;","","public class Example {"," public static void main(String[] args) {"," try (Playwright playwright = Playwright.create()) {"," BrowserType chromium = playwright.chromium();"," Browser browser = chromium.launch();"," Page page = browser.newPage();"," page.navigate(\"https://example.com\");"," // other actions..."," browser.close();"," }"," }","}"],"codeLang":"java"},{"type":"code","lines":["import asyncio","from playwright.async_api import async_playwright, Playwright","","async def run(playwright: Playwright):"," chromium = playwright.chromium"," browser = await chromium.launch()"," page = await browser.new_page()"," await page.goto(\"https://example.com\")"," # other actions..."," await browser.close()","","async def main():"," async with async_playwright() as playwright:"," await run(playwright)","asyncio.run(main())"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import sync_playwright, Playwright","","def run(playwright: Playwright):"," chromium = playwright.chromium"," browser = chromium.launch()"," page = browser.new_page()"," page.goto(\"https://example.com\")"," # other actions..."," browser.close()","","with sync_playwright() as playwright:"," run(playwright)"],"codeLang":"python sync"},{"type":"code","lines":["using Microsoft.Playwright;","using System.Threading.Tasks;","","class BrowserTypeExamples","{"," public static async Task Run()"," {"," using var playwright = await Playwright.CreateAsync();"," var chromium = playwright.Chromium;"," var browser = await chromium.LaunchAsync();"," var page = await browser.NewPageAsync();"," await page.GotoAsync(\"https://www.bing.com\");"," // other actions"," await browser.CloseAsync();"," }","}"],"codeLang":"csharp"}],"langs":{},"comment":"BrowserType provides methods to launch a specific browser instance or connect to an existing one. The following is\na typical example of using Playwright to drive automation:\n\n```js\nconst { chromium } = require('playwright'); // Or 'firefox' or 'webkit'.\n\n(async () => {\n const browser = await chromium.launch();\n const page = await browser.newPage();\n await page.goto('https://example.com');\n // other actions...\n await browser.close();\n})();\n```\n\n```java\nimport com.microsoft.playwright.*;\n\npublic class Example {\n public static void main(String[] args) {\n try (Playwright playwright = Playwright.create()) {\n BrowserType chromium = playwright.chromium();\n Browser browser = chromium.launch();\n Page page = browser.newPage();\n page.navigate(\"https://example.com\");\n // other actions...\n browser.close();\n }\n }\n}\n```\n\n```py\nimport asyncio\nfrom playwright.async_api import async_playwright, Playwright\n\nasync def run(playwright: Playwright):\n chromium = playwright.chromium\n browser = await chromium.launch()\n page = await browser.new_page()\n await page.goto(\"https://example.com\")\n # other actions...\n await browser.close()\n\nasync def main():\n async with async_playwright() as playwright:\n await run(playwright)\nasyncio.run(main())\n```\n\n```py\nfrom playwright.sync_api import sync_playwright, Playwright\n\ndef run(playwright: Playwright):\n chromium = playwright.chromium\n browser = chromium.launch()\n page = browser.new_page()\n page.goto(\"https://example.com\")\n # other actions...\n browser.close()\n\nwith sync_playwright() as playwright:\n run(playwright)\n```\n\n```csharp\nusing Microsoft.Playwright;\nusing System.Threading.Tasks;\n\nclass BrowserTypeExamples\n{\n public static async Task Run()\n {\n using var playwright = await Playwright.CreateAsync();\n var chromium = playwright.Chromium;\n var browser = await chromium.LaunchAsync();\n var page = await browser.NewPageAsync();\n await page.GotoAsync(\"https://www.bing.com\");\n // other actions\n await browser.CloseAsync();\n }\n}\n```\n","since":"v1.8","members":[{"kind":"method","langs":{},"since":"v1.8","name":"connect","type":{"name":"Browser","expression":"[Browser]"},"spec":[{"type":"text","text":"This method attaches Playwright to an existing browser instance. When connecting to another browser launched via `BrowserType.launchServer` in Node.js, the major and minor version needs to match the client version (1.2.3 → is compatible with 1.2.x)."}],"required":true,"comment":"This method attaches Playwright to an existing browser instance. When connecting to another browser launched via\n`BrowserType.launchServer` in Node.js, the major and minor version needs to match the client version (1.2.3 → is\ncompatible with 1.2.x).","async":true,"alias":"connect","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.10","name":"wsEndpoint","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A browser websocket endpoint to connect to."}],"required":true,"comment":"A browser websocket endpoint to connect to.","async":false,"alias":"wsEndpoint","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.37","name":"exposeNetwork","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"This option exposes network available on the connecting client to the browser being connected to. Consists of a list of rules separated by comma."},{"type":"text","text":"Available rules:"},{"type":"li","text":"Hostname pattern, for example: `example.com`, `*.org:99`, `x.*.y.com`, `*foo.org`.","liType":"ordinal"},{"type":"li","text":"IP literal, for example: `127.0.0.1`, `0.0.0.0:99`, `[::1]`, `[0:0::1]:99`.","liType":"ordinal"},{"type":"li","text":"`<loopback>` that matches local loopback interfaces: `localhost`, `*.localhost`, `127.0.0.1`, `[::1]`.","liType":"ordinal"},{"type":"text","text":"Some common examples:"},{"type":"li","text":"`\"*\"` to expose all network.","liType":"ordinal"},{"type":"li","text":"`\"<loopback>\"` to expose localhost network.","liType":"ordinal"},{"type":"li","text":"`\"*.test.internal-domain,*.staging.internal-domain,<loopback>\"` to expose test/staging deployments and localhost.","liType":"ordinal"}],"required":false,"comment":"This option exposes network available on the connecting client to the browser being connected to. Consists of a\nlist of rules separated by comma.\n\nAvailable rules:\n1. Hostname pattern, for example: `example.com`, `*.org:99`, `x.*.y.com`, `*foo.org`.\n1. IP literal, for example: `127.0.0.1`, `0.0.0.0:99`, `[::1]`, `[0:0::1]:99`.\n1. `<loopback>` that matches local loopback interfaces: `localhost`, `*.localhost`, `127.0.0.1`, `[::1]`.\n\nSome common examples:\n1. `\"*\"` to expose all network.\n1. `\"<loopback>\"` to expose localhost network.\n1. `\"*.test.internal-domain,*.staging.internal-domain,<loopback>\"` to expose test/staging deployments and\n localhost.","async":false,"alias":"exposeNetwork","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"headers","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"Additional HTTP headers to be sent with web socket connect request. Optional."}],"required":false,"comment":"Additional HTTP headers to be sent with web socket connect request. Optional.","async":false,"alias":"headers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"logger","type":{"name":"Logger","expression":"[Logger]"},"spec":[{"type":"text","text":"Logger sink for Playwright logging. Optional."}],"required":false,"comment":"Logger sink for Playwright logging. Optional.","async":false,"alias":"logger","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.10","name":"slowMo","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Slows down Playwright operations by the specified amount of milliseconds. Useful so that you↵can see what is going on. Defaults to 0."}],"required":false,"comment":"Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going\non. Defaults to 0.","async":false,"alias":"slowMo","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.10","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds to wait for the connection to be established. Defaults to↵`0` (no timeout)."}],"required":false,"comment":"Maximum time in milliseconds to wait for the connection to be established. Defaults to `0` (no timeout).","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"connectOverCDP","type":{"name":"Browser","expression":"[Browser]"},"spec":[{"type":"text","text":"This method attaches Playwright to an existing browser instance using the Chrome DevTools Protocol."},{"type":"text","text":"The default browser context is accessible via [`method: Browser.contexts`]."},{"type":"note","noteType":"note","text":"Connecting over the Chrome DevTools Protocol is only supported for Chromium-based browsers."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const browser = await playwright.chromium.connectOverCDP('http://localhost:9222');","const defaultContext = browser.contexts()[0];","const page = defaultContext.pages()[0];"],"codeLang":"js"},{"type":"code","lines":["Browser browser = playwright.chromium().connectOverCDP(\"http://localhost:9222\");","BrowserContext defaultContext = browser.contexts().get(0);","Page page = defaultContext.pages().get(0);"],"codeLang":"java"},{"type":"code","lines":["browser = await playwright.chromium.connect_over_cdp(\"http://localhost:9222\")","default_context = browser.contexts[0]","page = default_context.pages[0]"],"codeLang":"python async"},{"type":"code","lines":["browser = playwright.chromium.connect_over_cdp(\"http://localhost:9222\")","default_context = browser.contexts[0]","page = default_context.pages[0]"],"codeLang":"python sync"},{"type":"code","lines":["var browser = await playwright.Chromium.ConnectOverCDPAsync(\"http://localhost:9222\");","var defaultContext = browser.Contexts[0];","var page = defaultContext.Pages[0];"],"codeLang":"csharp"}],"required":true,"comment":"This method attaches Playwright to an existing browser instance using the Chrome DevTools Protocol.\n\nThe default browser context is accessible via [`method: Browser.contexts`].\n\n**NOTE** Connecting over the Chrome DevTools Protocol is only supported for Chromium-based browsers.\n\n**Usage**\n\n```js\nconst browser = await playwright.chromium.connectOverCDP('http://localhost:9222');\nconst defaultContext = browser.contexts()[0];\nconst page = defaultContext.pages()[0];\n```\n\n```java\nBrowser browser = playwright.chromium().connectOverCDP(\"http://localhost:9222\");\nBrowserContext defaultContext = browser.contexts().get(0);\nPage page = defaultContext.pages().get(0);\n```\n\n```py\nbrowser = await playwright.chromium.connect_over_cdp(\"http://localhost:9222\")\ndefault_context = browser.contexts[0]\npage = default_context.pages[0]\n```\n\n```py\nbrowser = playwright.chromium.connect_over_cdp(\"http://localhost:9222\")\ndefault_context = browser.contexts[0]\npage = default_context.pages[0]\n```\n\n```csharp\nvar browser = await playwright.Chromium.ConnectOverCDPAsync(\"http://localhost:9222\");\nvar defaultContext = browser.Contexts[0];\nvar page = defaultContext.Pages[0];\n```\n","async":true,"alias":"connectOverCDP","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.11","name":"endpointURL","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A CDP websocket endpoint or http url to connect to. For example `http://localhost:9222/` or `ws://127.0.0.1:9222/devtools/browser/387adf4c-243f-4051-a181-46798f4a46f4`."}],"required":true,"comment":"A CDP websocket endpoint or http url to connect to. For example `http://localhost:9222/` or\n`ws://127.0.0.1:9222/devtools/browser/387adf4c-243f-4051-a181-46798f4a46f4`.","async":false,"alias":"endpointURL","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"endpointURL","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Deprecated, use the first argument instead. Optional."}],"required":false,"comment":"Deprecated, use the first argument instead. Optional.","async":false,"alias":"endpointURL","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"headers","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"Additional HTTP headers to be sent with connect request. Optional."}],"required":false,"comment":"Additional HTTP headers to be sent with connect request. Optional.","async":false,"alias":"headers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"logger","type":{"name":"Logger","expression":"[Logger]"},"spec":[{"type":"text","text":"Logger sink for Playwright logging. Optional."}],"required":false,"comment":"Logger sink for Playwright logging. Optional.","async":false,"alias":"logger","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"slowMo","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Slows down Playwright operations by the specified amount of milliseconds. Useful so that you↵can see what is going on. Defaults to 0."}],"required":false,"comment":"Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going\non. Defaults to 0.","async":false,"alias":"slowMo","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds to wait for the connection to be established. Defaults to↵`30000` (30 seconds). Pass `0` to disable timeout."}],"required":false,"comment":"Maximum time in milliseconds to wait for the connection to be established. Defaults to `30000` (30 seconds). Pass\n`0` to disable timeout.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"executablePath","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A path where Playwright expects to find a bundled browser executable."}],"required":true,"comment":"A path where Playwright expects to find a bundled browser executable.","async":false,"alias":"executablePath","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"launch","type":{"name":"Browser","expression":"[Browser]"},"spec":[{"type":"text","text":"Returns the browser instance."},{"type":"text","text":"**Usage**"},{"type":"text","text":"You can use `ignoreDefaultArgs` to filter out `--mute-audio` from default arguments:"},{"type":"code","lines":["const browser = await chromium.launch({ // Or 'firefox' or 'webkit'."," ignoreDefaultArgs: ['--mute-audio']","});"],"codeLang":"js"},{"type":"code","lines":["// Or \"firefox\" or \"webkit\".","Browser browser = chromium.launch(new BrowserType.LaunchOptions()"," .setIgnoreDefaultArgs(Arrays.asList(\"--mute-audio\")));"],"codeLang":"java"},{"type":"code","lines":["browser = await playwright.chromium.launch( # or \"firefox\" or \"webkit\"."," ignore_default_args=[\"--mute-audio\"]",")"],"codeLang":"python async"},{"type":"code","lines":["browser = playwright.chromium.launch( # or \"firefox\" or \"webkit\"."," ignore_default_args=[\"--mute-audio\"]",")"],"codeLang":"python sync"},{"type":"code","lines":["var browser = await playwright.Chromium.LaunchAsync(new() {"," IgnoreDefaultArgs = new[] { \"--mute-audio\" }","});"],"codeLang":"csharp"},{"type":"text","text":"> **Chromium-only** Playwright can also be used to control the Google Chrome or Microsoft Edge browsers, but it works best with the version of↵Chromium it is bundled with. There is no guarantee it will work with any other version. Use `executablePath`↵option with extreme caution."},{"type":"text","text":">"},{"type":"text","text":"> If Google Chrome (rather than Chromium) is preferred, a↵[Chrome Canary](https://www.google.com/chrome/browser/canary.html) or↵[Dev Channel](https://www.chromium.org/getting-involved/dev-channel) build is suggested."},{"type":"text","text":">"},{"type":"text","text":"> Stock browsers like Google Chrome and Microsoft Edge are suitable for tests that require proprietary media codecs for video playback. See [this article](https://www.howtogeek.com/202825/what%E2%80%99s-the-difference-between-chromium-and-chrome/) for other differences between Chromium and Chrome.↵[This article](https://chromium.googlesource.com/chromium/src/+/lkgr/docs/chromium_browser_vs_google_chrome.md)↵describes some differences for Linux users."}],"required":true,"comment":"Returns the browser instance.\n\n**Usage**\n\nYou can use `ignoreDefaultArgs` to filter out `--mute-audio` from default arguments:\n\n```js\nconst browser = await chromium.launch({ // Or 'firefox' or 'webkit'.\n ignoreDefaultArgs: ['--mute-audio']\n});\n```\n\n```java\n// Or \"firefox\" or \"webkit\".\nBrowser browser = chromium.launch(new BrowserType.LaunchOptions()\n .setIgnoreDefaultArgs(Arrays.asList(\"--mute-audio\")));\n```\n\n```py\nbrowser = await playwright.chromium.launch( # or \"firefox\" or \"webkit\".\n ignore_default_args=[\"--mute-audio\"]\n)\n```\n\n```py\nbrowser = playwright.chromium.launch( # or \"firefox\" or \"webkit\".\n ignore_default_args=[\"--mute-audio\"]\n)\n```\n\n```csharp\nvar browser = await playwright.Chromium.LaunchAsync(new() {\n IgnoreDefaultArgs = new[] { \"--mute-audio\" }\n});\n```\n\n> **Chromium-only** Playwright can also be used to control the Google Chrome or Microsoft Edge browsers, but it\nworks best with the version of Chromium it is bundled with. There is no guarantee it will work with any other\nversion. Use `executablePath` option with extreme caution.\n>\n> If Google Chrome (rather than Chromium) is preferred, a\n[Chrome Canary](https://www.google.com/chrome/browser/canary.html) or\n[Dev Channel](https://www.chromium.org/getting-involved/dev-channel) build is suggested.\n>\n> Stock browsers like Google Chrome and Microsoft Edge are suitable for tests that require proprietary media codecs\nfor video playback. See\n[this article](https://www.howtogeek.com/202825/what%E2%80%99s-the-difference-between-chromium-and-chrome/) for\nother differences between Chromium and Chrome.\n[This article](https://chromium.googlesource.com/chromium/src/+/lkgr/docs/chromium_browser_vs_google_chrome.md)\ndescribes some differences for Linux users.","async":true,"alias":"launch","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"args","type":{"name":"Array","templates":[{"name":"string"}],"expression":"[Array]<[string]>"},"spec":[{"type":"note","noteType":"warning","text":"Use custom browser args at your own risk, as some of them may break Playwright functionality."},{"type":"text","text":"Additional arguments to pass to the browser instance. The list of Chromium flags can be found↵[here](https://peter.sh/experiments/chromium-command-line-switches/)."}],"required":false,"comment":"**NOTE** Use custom browser args at your own risk, as some of them may break Playwright functionality.\n\nAdditional arguments to pass to the browser instance. The list of Chromium flags can be found\n[here](https://peter.sh/experiments/chromium-command-line-switches/).","async":false,"alias":"args","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"channel","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Browser distribution channel. Supported values are \"chrome\", \"chrome-beta\", \"chrome-dev\", \"chrome-canary\", \"msedge\", \"msedge-beta\", \"msedge-dev\", \"msedge-canary\". Read more about using [Google Chrome and Microsoft Edge](../browsers.md#google-chrome--microsoft-edge)."}],"required":false,"comment":"Browser distribution channel. Supported values are \"chrome\", \"chrome-beta\", \"chrome-dev\", \"chrome-canary\",\n\"msedge\", \"msedge-beta\", \"msedge-dev\", \"msedge-canary\". Read more about using\n[Google Chrome and Microsoft Edge](../browsers.md#google-chrome--microsoft-edge).","async":false,"alias":"channel","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"chromiumSandbox","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Enable Chromium sandboxing. Defaults to `false`."}],"required":false,"comment":"Enable Chromium sandboxing. Defaults to `false`.","async":false,"alias":"chromiumSandbox","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","deprecated":"Use [debugging tools](../debug.md) instead.","name":"devtools","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the↵`headless` option will be set `false`."}],"required":false,"comment":"**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the\n`headless` option will be set `false`.","async":false,"alias":"devtools","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"downloadsPath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is↵deleted when browser is closed. In either case, the downloads are deleted when the browser context they were created in↵is closed."}],"required":false,"comment":"If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and\nis deleted when browser is closed. In either case, the downloads are deleted when the browser context they were\ncreated in is closed.","async":false,"alias":"downloadsPath","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"env","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"Specify environment variables that will be visible to the browser. Defaults to `process.env`."}],"required":false,"comment":"Specify environment variables that will be visible to the browser. Defaults to `process.env`.","async":false,"alias":"env","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"env","type":{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}],"expression":"[Object]<[string], [string]|[float]|[boolean]>"},"spec":[{"type":"text","text":"Specify environment variables that will be visible to the browser. Defaults to `process.env`."}],"required":false,"comment":"Specify environment variables that will be visible to the browser. Defaults to `process.env`.","async":false,"alias":"env","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"executablePath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then↵it is resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium,↵Firefox or WebKit, use at your own risk."}],"required":false,"comment":"Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is\nresolved relative to the current working directory. Note that Playwright only works with the bundled Chromium,\nFirefox or WebKit, use at your own risk.","async":false,"alias":"executablePath","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"firefoxUserPrefs","type":{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}],"expression":"[Object]<[string], [string]|[float]|[boolean]>"},"spec":[{"type":"text","text":"Firefox user preferences. Learn more about the Firefox user preferences at↵[`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox)."}],"required":false,"comment":"Firefox user preferences. Learn more about the Firefox user preferences at\n[`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox).","async":false,"alias":"firefoxUserPrefs","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"firefoxUserPrefs","type":{"name":"Object","templates":[{"name":"string"},{"name":"any"}],"expression":"[Object]<[string], [any]>"},"spec":[{"type":"text","text":"Firefox user preferences. Learn more about the Firefox user preferences at↵[`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox)."}],"required":false,"comment":"Firefox user preferences. Learn more about the Firefox user preferences at\n[`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox).","async":false,"alias":"firefoxUserPrefs","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"handleSIGHUP","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Close the browser process on SIGHUP. Defaults to `true`."}],"required":false,"comment":"Close the browser process on SIGHUP. Defaults to `true`.","async":false,"alias":"handleSIGHUP","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"handleSIGINT","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Close the browser process on Ctrl-C. Defaults to `true`."}],"required":false,"comment":"Close the browser process on Ctrl-C. Defaults to `true`.","async":false,"alias":"handleSIGINT","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"handleSIGTERM","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Close the browser process on SIGTERM. Defaults to `true`."}],"required":false,"comment":"Close the browser process on SIGTERM. Defaults to `true`.","async":false,"alias":"handleSIGTERM","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"headless","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to run browser in headless mode. More details for↵[Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and↵[Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the↵`devtools` option is `true`."}],"required":false,"comment":"Whether to run browser in headless mode. More details for\n[Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and\n[Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the\n`devtools` option is `true`.","async":false,"alias":"headless","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"ignoreAllDefaultArgs","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`.↵Dangerous option; use with care. Defaults to `false`."}],"required":false,"comment":"If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. Dangerous\noption; use with care. Defaults to `false`.","async":false,"alias":"ignoreAllDefaultArgs","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"ignoreDefaultArgs","type":{"name":"","union":[{"name":"boolean"},{"name":"Array","templates":[{"name":"string"}]}],"expression":"[boolean]|[Array]<[string]>"},"spec":[{"type":"text","text":"If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. If an↵array is given, then filters out the given default arguments. Dangerous option; use with care. Defaults to `false`."}],"required":false,"comment":"If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. If an array is\ngiven, then filters out the given default arguments. Dangerous option; use with care. Defaults to `false`.","async":false,"alias":"ignoreDefaultArgs","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"ignoreDefaultArgs","type":{"name":"Array","templates":[{"name":"string"}],"expression":"[Array]<[string]>"},"spec":[{"type":"text","text":"If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`.↵Dangerous option; use with care."}],"required":false,"comment":"If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. Dangerous\noption; use with care.","async":false,"alias":"ignoreDefaultArgs","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"logger","type":{"name":"Logger","expression":"[Logger]"},"spec":[{"type":"text","text":"Logger sink for Playwright logging."}],"required":false,"comment":"Logger sink for Playwright logging.","async":false,"alias":"logger","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"proxy","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"server","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example↵`http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP↵proxy."}],"required":true,"comment":"Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or\n`socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.","async":false,"alias":"server","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"bypass","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org,↵.domain.com\"`."}],"required":false,"comment":"Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.","async":false,"alias":"bypass","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"username","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional username to use if HTTP proxy requires authentication."}],"required":false,"comment":"Optional username to use if HTTP proxy requires authentication.","async":false,"alias":"username","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"password","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional password to use if HTTP proxy requires authentication."}],"required":false,"comment":"Optional password to use if HTTP proxy requires authentication.","async":false,"alias":"password","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Network proxy settings."}],"required":false,"comment":"Network proxy settings.","async":false,"alias":"proxy","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"slowMo","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on."}],"required":false,"comment":"Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going\non.","async":false,"alias":"slowMo","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0` to↵disable timeout."}],"required":false,"comment":"Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0`\nto disable timeout.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"tracesDir","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"If specified, traces are saved into this directory."}],"required":false,"comment":"If specified, traces are saved into this directory.","async":false,"alias":"tracesDir","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"launchPersistentContext","type":{"name":"BrowserContext","expression":"[BrowserContext]"},"spec":[{"type":"text","text":"Returns the persistent browser context instance."},{"type":"text","text":"Launches browser that uses persistent storage located at `userDataDir` and returns the only context. Closing↵this context will automatically close the browser."}],"required":true,"comment":"Returns the persistent browser context instance.\n\nLaunches browser that uses persistent storage located at `userDataDir` and returns the only context. Closing this\ncontext will automatically close the browser.","async":true,"alias":"launchPersistentContext","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"userDataDir","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to a User Data Directory, which stores browser session data like cookies and local storage. More details for↵[Chromium](https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md#introduction) and↵[Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#User_Profile).↵Note that Chromium's user data directory is the **parent** directory of the \"Profile Path\" seen at `chrome://version`. Pass an empty string to↵use a temporary directory instead."}],"required":true,"comment":"Path to a User Data Directory, which stores browser session data like cookies and local storage. More details for\n[Chromium](https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md#introduction) and\n[Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#User_Profile). Note that Chromium's\nuser data directory is the **parent** directory of the \"Profile Path\" seen at `chrome://version`. Pass an empty\nstring to use a temporary directory instead.","async":false,"alias":"userDataDir","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"acceptDownloads","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted."}],"required":false,"comment":"Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted.","async":false,"alias":"acceptDownloads","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"args","type":{"name":"Array","templates":[{"name":"string"}],"expression":"[Array]<[string]>"},"spec":[{"type":"note","noteType":"warning","text":"Use custom browser args at your own risk, as some of them may break Playwright functionality."},{"type":"text","text":"Additional arguments to pass to the browser instance. The list of Chromium flags can be found↵[here](https://peter.sh/experiments/chromium-command-line-switches/)."}],"required":false,"comment":"**NOTE** Use custom browser args at your own risk, as some of them may break Playwright functionality.\n\nAdditional arguments to pass to the browser instance. The list of Chromium flags can be found\n[here](https://peter.sh/experiments/chromium-command-line-switches/).","async":false,"alias":"args","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"baseURL","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"When using [`method: Page.goto`], [`method: Page.route`], [`method: Page.waitForURL`], [`method: Page.waitForRequest`], or [`method: Page.waitForResponse`] it takes the base URL in consideration by using the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL. Unset by default. Examples:"},{"type":"li","text":"baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html`","liType":"bullet"},{"type":"li","text":"baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in `http://localhost:3000/foo/bar.html`","liType":"bullet"},{"type":"li","text":"baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in `http://localhost:3000/bar.html`","liType":"bullet"}],"required":false,"comment":"When using [`method: Page.goto`], [`method: Page.route`], [`method: Page.waitForURL`],\n[`method: Page.waitForRequest`], or [`method: Page.waitForResponse`] it takes the base URL in consideration by\nusing the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the\ncorresponding URL. Unset by default. Examples:\n- baseURL: `http://localhost:3000` and navigating to `/bar.html` results in `http://localhost:3000/bar.html`\n- baseURL: `http://localhost:3000/foo/` and navigating to `./bar.html` results in\n `http://localhost:3000/foo/bar.html`\n- baseURL: `http://localhost:3000/foo` (without trailing slash) and navigating to `./bar.html` results in\n `http://localhost:3000/bar.html`","async":false,"alias":"baseURL","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"bypassCSP","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Toggles bypassing page's Content-Security-Policy. Defaults to `false`."}],"required":false,"comment":"Toggles bypassing page's Content-Security-Policy. Defaults to `false`.","async":false,"alias":"bypassCSP","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"channel","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Browser distribution channel. Supported values are \"chrome\", \"chrome-beta\", \"chrome-dev\", \"chrome-canary\", \"msedge\", \"msedge-beta\", \"msedge-dev\", \"msedge-canary\". Read more about using [Google Chrome and Microsoft Edge](../browsers.md#google-chrome--microsoft-edge)."}],"required":false,"comment":"Browser distribution channel. Supported values are \"chrome\", \"chrome-beta\", \"chrome-dev\", \"chrome-canary\",\n\"msedge\", \"msedge-beta\", \"msedge-dev\", \"msedge-canary\". Read more about using\n[Google Chrome and Microsoft Edge](../browsers.md#google-chrome--microsoft-edge).","async":false,"alias":"channel","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"chromiumSandbox","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Enable Chromium sandboxing. Defaults to `false`."}],"required":false,"comment":"Enable Chromium sandboxing. Defaults to `false`.","async":false,"alias":"chromiumSandbox","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"colorScheme","type":{"name":"","union":[{"name":"null"},{"name":"ColorScheme","union":[{"name":"\"light\""},{"name":"\"dark\""},{"name":"\"no-preference\""}]}],"expression":"null|[ColorScheme]<\"light\"|\"dark\"|\"no-preference\">"},"spec":[{"type":"text","text":"Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See↵[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'light'`."}],"required":false,"comment":"Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to\n`'light'`.","async":false,"alias":"colorScheme","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"colorScheme","type":{"name":"ColorScheme","union":[{"name":"\"light\""},{"name":"\"dark\""},{"name":"\"no-preference\""},{"name":"\"null\""}],"expression":"[ColorScheme]<\"light\"|\"dark\"|\"no-preference\"|\"null\">"},"spec":[{"type":"text","text":"Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See↵[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'light'`."}],"required":false,"comment":"Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to\n`'light'`.","async":false,"alias":"colorScheme","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"deviceScaleFactor","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about [emulating devices with device scale factor](../emulation.md#devices)."}],"required":false,"comment":"Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about\n[emulating devices with device scale factor](../emulation.md#devices).","async":false,"alias":"deviceScaleFactor","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","deprecated":"Use [debugging tools](../debug.md) instead.","name":"devtools","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the↵`headless` option will be set `false`."}],"required":false,"comment":"**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the\n`headless` option will be set `false`.","async":false,"alias":"devtools","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"downloadsPath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is↵deleted when browser is closed. In either case, the downloads are deleted when the browser context they were created in↵is closed."}],"required":false,"comment":"If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and\nis deleted when browser is closed. In either case, the downloads are deleted when the browser context they were\ncreated in is closed.","async":false,"alias":"downloadsPath","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"env","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"Specify environment variables that will be visible to the browser. Defaults to `process.env`."}],"required":false,"comment":"Specify environment variables that will be visible to the browser. Defaults to `process.env`.","async":false,"alias":"env","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"env","type":{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}],"expression":"[Object]<[string], [string]|[float]|[boolean]>"},"spec":[{"type":"text","text":"Specify environment variables that will be visible to the browser. Defaults to `process.env`."}],"required":false,"comment":"Specify environment variables that will be visible to the browser. Defaults to `process.env`.","async":false,"alias":"env","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"executablePath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then↵it is resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium,↵Firefox or WebKit, use at your own risk."}],"required":false,"comment":"Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is\nresolved relative to the current working directory. Note that Playwright only works with the bundled Chromium,\nFirefox or WebKit, use at your own risk.","async":false,"alias":"executablePath","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"extraHTTPHeaders","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"An object containing additional HTTP headers to be sent with every request. Defaults to none."}],"required":false,"comment":"An object containing additional HTTP headers to be sent with every request. Defaults to none.","async":false,"alias":"extraHTTPHeaders","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.40","name":"firefoxUserPrefs","type":{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}],"expression":"[Object]<[string], [string]|[float]|[boolean]>"},"spec":[{"type":"text","text":"Firefox user preferences. Learn more about the Firefox user preferences at↵[`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox)."}],"required":false,"comment":"Firefox user preferences. Learn more about the Firefox user preferences at\n[`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox).","async":false,"alias":"firefoxUserPrefs","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.40","name":"firefoxUserPrefs","type":{"name":"Object","templates":[{"name":"string"},{"name":"any"}],"expression":"[Object]<[string], [any]>"},"spec":[{"type":"text","text":"Firefox user preferences. Learn more about the Firefox user preferences at↵[`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox)."}],"required":false,"comment":"Firefox user preferences. Learn more about the Firefox user preferences at\n[`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox).","async":false,"alias":"firefoxUserPrefs","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"forcedColors","type":{"name":"","union":[{"name":"null"},{"name":"ForcedColors","union":[{"name":"\"active\""},{"name":"\"none\""}]}],"expression":"null|[ForcedColors]<\"active\"|\"none\">"},"spec":[{"type":"text","text":"Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See [`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'none'`."}],"required":false,"comment":"Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See\n[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to\n`'none'`.","async":false,"alias":"forcedColors","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"forcedColors","type":{"name":"ForcedColors","union":[{"name":"\"active\""},{"name":"\"none\""},{"name":"\"null\""}],"expression":"[ForcedColors]<\"active\"|\"none\"|\"null\">"},"spec":[{"type":"text","text":"Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See [`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'none'`."}],"required":false,"comment":"Emulates `'forced-colors'` media feature, supported values are `'active'`, `'none'`. See\n[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to\n`'none'`.","async":false,"alias":"forcedColors","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"geolocation","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"latitude","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Latitude between -90 and 90."}],"required":true,"comment":"Latitude between -90 and 90.","async":false,"alias":"latitude","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"longitude","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Longitude between -180 and 180."}],"required":true,"comment":"Longitude between -180 and 180.","async":false,"alias":"longitude","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"accuracy","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Non-negative accuracy value. Defaults to `0`."}],"required":false,"comment":"Non-negative accuracy value. Defaults to `0`.","async":false,"alias":"accuracy","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[],"required":false,"comment":"","async":false,"alias":"geolocation","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"handleSIGHUP","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Close the browser process on SIGHUP. Defaults to `true`."}],"required":false,"comment":"Close the browser process on SIGHUP. Defaults to `true`.","async":false,"alias":"handleSIGHUP","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"handleSIGINT","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Close the browser process on Ctrl-C. Defaults to `true`."}],"required":false,"comment":"Close the browser process on Ctrl-C. Defaults to `true`.","async":false,"alias":"handleSIGINT","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"handleSIGTERM","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Close the browser process on SIGTERM. Defaults to `true`."}],"required":false,"comment":"Close the browser process on SIGTERM. Defaults to `true`.","async":false,"alias":"handleSIGTERM","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"hasTouch","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Specifies if viewport supports touch events. Defaults to false. Learn more about [mobile emulation](../emulation.md#devices)."}],"required":false,"comment":"Specifies if viewport supports touch events. Defaults to false. Learn more about\n[mobile emulation](../emulation.md#devices).","async":false,"alias":"hasTouch","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"headless","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to run browser in headless mode. More details for↵[Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and↵[Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the↵`devtools` option is `true`."}],"required":false,"comment":"Whether to run browser in headless mode. More details for\n[Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and\n[Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the\n`devtools` option is `true`.","async":false,"alias":"headless","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"httpCredentials","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"username","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"username","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"password","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"password","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"origin","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Restrain sending http credentials on specific origin (scheme://host:port)."}],"required":false,"comment":"Restrain sending http credentials on specific origin (scheme://host:port).","async":false,"alias":"origin","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"send","type":{"name":"HttpCredentialsSend","union":[{"name":"\"unauthorized\""},{"name":"\"always\""}],"expression":"[HttpCredentialsSend]<\"unauthorized\"|\"always\">"},"spec":[{"type":"text","text":"This option only applies to the requests sent from corresponding `APIRequestContext` and does not affect requests sent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with `WWW-Authenticate` header is received. Defaults to `'unauthorized'`."}],"required":false,"comment":"This option only applies to the requests sent from corresponding `APIRequestContext` and does not affect requests\nsent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with\nthe each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with\n`WWW-Authenticate` header is received. Defaults to `'unauthorized'`.","async":false,"alias":"send","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).↵If no origin is specified, the username and password are sent to any servers upon unauthorized responses."}],"required":false,"comment":"Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no\norigin is specified, the username and password are sent to any servers upon unauthorized responses.","async":false,"alias":"httpCredentials","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"ignoreAllDefaultArgs","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`.↵Dangerous option; use with care. Defaults to `false`."}],"required":false,"comment":"If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. Dangerous\noption; use with care. Defaults to `false`.","async":false,"alias":"ignoreAllDefaultArgs","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"ignoreDefaultArgs","type":{"name":"","union":[{"name":"boolean"},{"name":"Array","templates":[{"name":"string"}]}],"expression":"[boolean]|[Array]<[string]>"},"spec":[{"type":"text","text":"If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. If an↵array is given, then filters out the given default arguments. Dangerous option; use with care. Defaults to `false`."}],"required":false,"comment":"If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. If an array is\ngiven, then filters out the given default arguments. Dangerous option; use with care. Defaults to `false`.","async":false,"alias":"ignoreDefaultArgs","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"ignoreDefaultArgs","type":{"name":"Array","templates":[{"name":"string"}],"expression":"[Array]<[string]>"},"spec":[{"type":"text","text":"If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`.↵Dangerous option; use with care."}],"required":false,"comment":"If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. Dangerous\noption; use with care.","async":false,"alias":"ignoreDefaultArgs","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"ignoreHTTPSErrors","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to ignore HTTPS errors when sending network requests. Defaults to `false`."}],"required":false,"comment":"Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.","async":false,"alias":"ignoreHTTPSErrors","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"isMobile","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device, so you don't actually need to set it manually. Defaults to `false` and is not supported in Firefox. Learn more about [mobile emulation](../emulation.md#ismobile)."}],"required":false,"comment":"Whether the `meta viewport` tag is taken into account and touch events are enabled. isMobile is a part of device,\nso you don't actually need to set it manually. Defaults to `false` and is not supported in Firefox. Learn more\nabout [mobile emulation](../emulation.md#ismobile).","async":false,"alias":"isMobile","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"javaScriptEnabled","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether or not to enable JavaScript in the context. Defaults to `true`. Learn more about [disabling JavaScript](../emulation.md#javascript-enabled)."}],"required":false,"comment":"Whether or not to enable JavaScript in the context. Defaults to `true`. Learn more about\n[disabling JavaScript](../emulation.md#javascript-enabled).","async":false,"alias":"javaScriptEnabled","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"locale","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language` request header value as well as number and date formatting rules. Defaults to the system default locale. Learn more about emulation in our [emulation guide](../emulation.md#locale--timezone)."}],"required":false,"comment":"Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value,\n`Accept-Language` request header value as well as number and date formatting rules. Defaults to the system default\nlocale. Learn more about emulation in our [emulation guide](../emulation.md#locale--timezone).","async":false,"alias":"locale","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"logger","type":{"name":"Logger","expression":"[Logger]"},"spec":[{"type":"text","text":"Logger sink for Playwright logging."}],"required":false,"comment":"Logger sink for Playwright logging.","async":false,"alias":"logger","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"noViewport","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Does not enforce fixed viewport, allows resizing window in the headed mode."}],"required":false,"comment":"Does not enforce fixed viewport, allows resizing window in the headed mode.","async":false,"alias":"noViewport","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"offline","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to emulate network being offline. Defaults to `false`. Learn more about [network emulation](../emulation.md#offline)."}],"required":false,"comment":"Whether to emulate network being offline. Defaults to `false`. Learn more about\n[network emulation](../emulation.md#offline).","async":false,"alias":"offline","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"permissions","type":{"name":"Array","templates":[{"name":"string"}],"expression":"[Array]<[string]>"},"spec":[{"type":"text","text":"A list of permissions to grant to all pages in this context. See↵[`method: BrowserContext.grantPermissions`] for more details. Defaults to none."}],"required":false,"comment":"A list of permissions to grant to all pages in this context. See [`method: BrowserContext.grantPermissions`] for\nmore details. Defaults to none.","async":false,"alias":"permissions","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"proxy","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"server","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example↵`http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP↵proxy."}],"required":true,"comment":"Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or\n`socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.","async":false,"alias":"server","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"bypass","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org,↵.domain.com\"`."}],"required":false,"comment":"Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.","async":false,"alias":"bypass","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"username","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional username to use if HTTP proxy requires authentication."}],"required":false,"comment":"Optional username to use if HTTP proxy requires authentication.","async":false,"alias":"username","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"password","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional password to use if HTTP proxy requires authentication."}],"required":false,"comment":"Optional password to use if HTTP proxy requires authentication.","async":false,"alias":"password","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Network proxy settings."}],"required":false,"comment":"Network proxy settings.","async":false,"alias":"proxy","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"recordHar","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"omitContent","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Optional setting to control whether to omit request content from the HAR. Defaults to↵`false`. Deprecated, use `content` policy instead."}],"required":false,"comment":"Optional setting to control whether to omit request content from the HAR. Defaults to `false`. Deprecated, use\n`content` policy instead.","async":false,"alias":"omitContent","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"content","type":{"name":"HarContentPolicy","union":[{"name":"\"omit\""},{"name":"\"embed\""},{"name":"\"attach\""}],"expression":"[HarContentPolicy]<\"omit\"|\"embed\"|\"attach\">"},"spec":[{"type":"text","text":"Optional setting to control resource content management. If `omit` is specified, content is not persisted. If `attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is specified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output files and to `embed` for all other file extensions."}],"required":false,"comment":"Optional setting to control resource content management. If `omit` is specified, content is not persisted. If\n`attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is\nspecified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output\nfiles and to `embed` for all other file extensions.","async":false,"alias":"content","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path on the filesystem to write the HAR file to. If the file name ends with `.zip`, `content: 'attach'` is used by default."}],"required":true,"comment":"Path on the filesystem to write the HAR file to. If the file name ends with `.zip`, `content: 'attach'` is used by\ndefault.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mode","type":{"name":"HarMode","union":[{"name":"\"full\""},{"name":"\"minimal\""}],"expression":"[HarMode]<\"full\"|\"minimal\">"},"spec":[{"type":"text","text":"When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`."}],"required":false,"comment":"When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,\ncookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.","async":false,"alias":"mode","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"urlFilter","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"A glob or regex pattern to filter requests that are stored in the HAR. When a `baseURL` via the context options was provided and the passed URL is a path, it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. Defaults to none."}],"required":false,"comment":"A glob or regex pattern to filter requests that are stored in the HAR. When a `baseURL` via the context options was\nprovided and the passed URL is a path, it gets merged via the\n[`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. Defaults to none.","async":false,"alias":"urlFilter","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not↵specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be↵saved."}],"required":false,"comment":"Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file.\nIf not specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be\nsaved.","async":false,"alias":"recordHar","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_content"},"types":{},"overrides":{}},"since":"v1.8","name":"recordHarContent","type":{"name":"HarContentPolicy","union":[{"name":"\"omit\""},{"name":"\"embed\""},{"name":"\"attach\""}],"expression":"[HarContentPolicy]<\"omit\"|\"embed\"|\"attach\">"},"spec":[{"type":"text","text":"Optional setting to control resource content management. If `omit` is specified, content is not persisted. If `attach` is specified, resources are persisted as separate files and all of these files are archived along with the HAR file. Defaults to `embed`, which stores content inline the HAR file as per HAR specification."}],"required":false,"comment":"Optional setting to control resource content management. If `omit` is specified, content is not persisted. If\n`attach` is specified, resources are persisted as separate files and all of these files are archived along with the\nHAR file. Defaults to `embed`, which stores content inline the HAR file as per HAR specification.","async":false,"alias":"recordHarContent","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_mode"},"types":{},"overrides":{}},"since":"v1.8","name":"recordHarMode","type":{"name":"HarMode","union":[{"name":"\"full\""},{"name":"\"minimal\""}],"expression":"[HarMode]<\"full\"|\"minimal\">"},"spec":[{"type":"text","text":"When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`."}],"required":false,"comment":"When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,\ncookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.","async":false,"alias":"recordHarMode","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_omit_content"},"types":{},"overrides":{}},"since":"v1.8","name":"recordHarOmitContent","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Optional setting to control whether to omit request content from the HAR. Defaults to `false`."}],"required":false,"comment":"Optional setting to control whether to omit request content from the HAR. Defaults to `false`.","async":false,"alias":"recordHarOmitContent","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_path"},"types":{},"overrides":{}},"since":"v1.8","name":"recordHarPath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the↵specified HAR file on the filesystem. If not specified, the HAR is not recorded. Make sure to↵call [`method: BrowserContext.close`] for the HAR to be saved."}],"required":false,"comment":"Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file\non the filesystem. If not specified, the HAR is not recorded. Make sure to call [`method: BrowserContext.close`]\nfor the HAR to be saved.","async":false,"alias":"recordHarPath","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_url_filter"},"types":{},"overrides":{}},"since":"v1.8","name":"recordHarUrlFilter","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[],"required":false,"comment":"","async":false,"alias":"recordHarUrlFilter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"recordVideo","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"dir","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the directory to put videos into."}],"required":true,"comment":"Path to the directory to put videos into.","async":false,"alias":"dir","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"size","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame width."}],"required":true,"comment":"Video frame width.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame height."}],"required":true,"comment":"Video frame height.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport`↵scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450.↵Actual picture of each page will be scaled down if necessary to fit the specified size."}],"required":false,"comment":"Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to\nfit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of\neach page will be scaled down if necessary to fit the specified size.","async":false,"alias":"size","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make↵sure to await [`method: BrowserContext.close`] for videos to be saved."}],"required":false,"comment":"Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded.\nMake sure to await [`method: BrowserContext.close`] for videos to be saved.","async":false,"alias":"recordVideo","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_video_dir"},"types":{},"overrides":{}},"since":"v1.8","name":"recordVideoDir","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Enables video recording for all pages into the specified directory. If not specified videos are↵not recorded. Make sure to call [`method: BrowserContext.close`] for videos to be saved."}],"required":false,"comment":"Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make\nsure to call [`method: BrowserContext.close`] for videos to be saved.","async":false,"alias":"recordVideoDir","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_video_size"},"types":{},"overrides":{}},"since":"v1.8","name":"recordVideoSize","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame width."}],"required":true,"comment":"Video frame width.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame height."}],"required":true,"comment":"Video frame height.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Dimensions of the recorded videos. If not specified the size will be equal to `viewport`↵scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450.↵Actual picture of each page will be scaled down if necessary to fit the specified size."}],"required":false,"comment":"Dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into\n800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page\nwill be scaled down if necessary to fit the specified size.","async":false,"alias":"recordVideoSize","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"reducedMotion","type":{"name":"","union":[{"name":"null"},{"name":"ReducedMotion","union":[{"name":"\"reduce\""},{"name":"\"no-preference\""}]}],"expression":"null|[ReducedMotion]<\"reduce\"|\"no-preference\">"},"spec":[{"type":"text","text":"Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See [`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'no-preference'`."}],"required":false,"comment":"Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to\n`'no-preference'`.","async":false,"alias":"reducedMotion","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"reducedMotion","type":{"name":"ReducedMotion","union":[{"name":"\"reduce\""},{"name":"\"no-preference\""},{"name":"\"null\""}],"expression":"[ReducedMotion]<\"reduce\"|\"no-preference\"|\"null\">"},"spec":[{"type":"text","text":"Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See [`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to `'no-preference'`."}],"required":false,"comment":"Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `'null'` resets emulation to system defaults. Defaults to\n`'no-preference'`.","async":false,"alias":"reducedMotion","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"aliases":{"java":"screenSize","csharp":"screenSize"},"types":{},"overrides":{}},"since":"v1.8","name":"screen","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page width in pixels."}],"required":true,"comment":"page width in pixels.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page height in pixels."}],"required":true,"comment":"page height in pixels.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the↵`viewport` is set."}],"required":false,"comment":"Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the\n`viewport` is set.","async":false,"alias":"screen","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"serviceWorkers","type":{"name":"ServiceWorkerPolicy","union":[{"name":"\"allow\""},{"name":"\"block\""}],"expression":"[ServiceWorkerPolicy]<\"allow\"|\"block\">"},"spec":[{"type":"text","text":"Whether to allow sites to register Service workers. Defaults to `'allow'`."},{"type":"li","text":"`'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be registered.","liType":"bullet"},{"type":"li","text":"`'block'`: Playwright will block all registration of Service Workers.","liType":"bullet"}],"required":false,"comment":"Whether to allow sites to register Service workers. Defaults to `'allow'`.\n- `'allow'`: [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) can be\n registered.\n- `'block'`: Playwright will block all registration of Service Workers.","async":false,"alias":"serviceWorkers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"slowMo","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on."}],"required":false,"comment":"Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going\non.","async":false,"alias":"slowMo","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"strictSelectors","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations↵on selectors that imply single target DOM element will throw when more than one element matches the selector.↵This option does not affect any Locator APIs (Locators are always strict). Defaults to `false`.↵See `Locator` to learn more about the strict mode."}],"required":false,"comment":"If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations on\nselectors that imply single target DOM element will throw when more than one element matches the selector. This\noption does not affect any Locator APIs (Locators are always strict). Defaults to `false`. See `Locator` to learn\nmore about the strict mode.","async":false,"alias":"strictSelectors","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0` to↵disable timeout."}],"required":false,"comment":"Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0`\nto disable timeout.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"timezoneId","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Changes the timezone of the context. See [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)↵for a list of supported timezone IDs. Defaults to the system timezone."}],"required":false,"comment":"Changes the timezone of the context. See\n[ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)\nfor a list of supported timezone IDs. Defaults to the system timezone.","async":false,"alias":"timezoneId","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"tracesDir","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"If specified, traces are saved into this directory."}],"required":false,"comment":"If specified, traces are saved into this directory.","async":false,"alias":"tracesDir","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"userAgent","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Specific user agent to use in this context."}],"required":false,"comment":"Specific user agent to use in this context.","async":false,"alias":"userAgent","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","deprecated":"Use `recordVideo` instead.","name":"videoSize","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame width."}],"required":true,"comment":"Video frame width.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame height."}],"required":true,"comment":"Video frame height.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[],"required":false,"comment":"","async":false,"alias":"videoSize","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","deprecated":"Use `recordVideo` instead.","name":"videosPath","type":{"name":"path","expression":"[path]"},"spec":[],"required":false,"comment":"","async":false,"alias":"videosPath","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","java"],"aliases":{"java":"viewportSize"},"types":{},"overrides":{}},"since":"v1.8","name":"viewport","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page width in pixels."}],"required":true,"comment":"page width in pixels.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page height in pixels."}],"required":true,"comment":"page height in pixels.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}]}],"expression":"[null]|[Object]"},"spec":[{"type":"text","text":"Emulates consistent viewport for each page. Defaults to an 1280x720 viewport.↵Use `null` to disable the consistent viewport emulation. Learn more about [viewport emulation](../emulation#viewport)."},{"type":"note","noteType":"note","text":"The `null` value opts out from the default presets, makes viewport depend on the↵host window size defined by the operating system. It makes the execution of the↵tests non-deterministic."}],"required":false,"comment":"Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `null` to disable the consistent\nviewport emulation. Learn more about [viewport emulation](../emulation#viewport).\n\n**NOTE** The `null` value opts out from the default presets, makes viewport depend on the host window size defined\nby the operating system. It makes the execution of the tests non-deterministic.","async":false,"alias":"viewport","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{"csharp":"viewportSize"},"types":{},"overrides":{}},"since":"v1.8","name":"viewport","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page width in pixels."}],"required":true,"comment":"page width in pixels.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page height in pixels."}],"required":true,"comment":"page height in pixels.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}]}],"expression":"[null]|[Object]"},"spec":[{"type":"text","text":"Emulates consistent viewport for each page. Defaults to an 1280x720 viewport.↵Use `ViewportSize.NoViewport` to disable the consistent viewport emulation. Learn more about [viewport emulation](../emulation.md#viewport)."},{"type":"note","noteType":"note","text":"The `ViewportSize.NoViewport` value opts out from the default presets,↵makes viewport depend on the host window size defined by the operating system.↵It makes the execution of the tests non-deterministic."}],"required":false,"comment":"Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use `ViewportSize.NoViewport` to\ndisable the consistent viewport emulation. Learn more about [viewport emulation](../emulation.md#viewport).\n\n**NOTE** The `ViewportSize.NoViewport` value opts out from the default presets, makes viewport depend on the host\nwindow size defined by the operating system. It makes the execution of the tests non-deterministic.","async":false,"alias":"viewport","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"viewport","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page width in pixels."}],"required":true,"comment":"page width in pixels.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page height in pixels."}],"required":true,"comment":"page height in pixels.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}]}],"expression":"[null]|[Object]"},"spec":[{"type":"text","text":"Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed viewport. Learn more about [viewport emulation](../emulation.md#viewport)."}],"required":false,"comment":"Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `no_viewport` disables the fixed\nviewport. Learn more about [viewport emulation](../emulation.md#viewport).","async":false,"alias":"viewport","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"launchServer","type":{"name":"BrowserServer","expression":"[BrowserServer]"},"spec":[{"type":"text","text":"Returns the browser app instance. You can connect to it via [`method: BrowserType.connect`], which requires the major/minor client/server version to match (1.2.3 → is compatible with 1.2.x)."},{"type":"text","text":"**Usage**"},{"type":"text","text":"Launches browser server that client can connect to. An example of launching a browser executable and connecting to it↵later:"},{"type":"code","lines":["const { chromium } = require('playwright'); // Or 'webkit' or 'firefox'.","","(async () => {"," const browserServer = await chromium.launchServer();"," const wsEndpoint = browserServer.wsEndpoint();"," // Use web socket endpoint later to establish a connection."," const browser = await chromium.connect(wsEndpoint);"," // Close browser instance."," await browserServer.close();","})();"],"codeLang":"js"}],"required":true,"comment":"Returns the browser app instance. You can connect to it via [`method: BrowserType.connect`], which requires the\nmajor/minor client/server version to match (1.2.3 → is compatible with 1.2.x).\n\n**Usage**\n\nLaunches browser server that client can connect to. An example of launching a browser executable and connecting to\nit later:\n\n```js\nconst { chromium } = require('playwright'); // Or 'webkit' or 'firefox'.\n\n(async () => {\n const browserServer = await chromium.launchServer();\n const wsEndpoint = browserServer.wsEndpoint();\n // Use web socket endpoint later to establish a connection.\n const browser = await chromium.connect(wsEndpoint);\n // Close browser instance.\n await browserServer.close();\n})();\n```\n","async":true,"alias":"launchServer","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"args","type":{"name":"Array","templates":[{"name":"string"}],"expression":"[Array]<[string]>"},"spec":[{"type":"note","noteType":"warning","text":"Use custom browser args at your own risk, as some of them may break Playwright functionality."},{"type":"text","text":"Additional arguments to pass to the browser instance. The list of Chromium flags can be found↵[here](https://peter.sh/experiments/chromium-command-line-switches/)."}],"required":false,"comment":"**NOTE** Use custom browser args at your own risk, as some of them may break Playwright functionality.\n\nAdditional arguments to pass to the browser instance. The list of Chromium flags can be found\n[here](https://peter.sh/experiments/chromium-command-line-switches/).","async":false,"alias":"args","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"channel","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Browser distribution channel. Supported values are \"chrome\", \"chrome-beta\", \"chrome-dev\", \"chrome-canary\", \"msedge\", \"msedge-beta\", \"msedge-dev\", \"msedge-canary\". Read more about using [Google Chrome and Microsoft Edge](../browsers.md#google-chrome--microsoft-edge)."}],"required":false,"comment":"Browser distribution channel. Supported values are \"chrome\", \"chrome-beta\", \"chrome-dev\", \"chrome-canary\",\n\"msedge\", \"msedge-beta\", \"msedge-dev\", \"msedge-canary\". Read more about using\n[Google Chrome and Microsoft Edge](../browsers.md#google-chrome--microsoft-edge).","async":false,"alias":"channel","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"chromiumSandbox","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Enable Chromium sandboxing. Defaults to `false`."}],"required":false,"comment":"Enable Chromium sandboxing. Defaults to `false`.","async":false,"alias":"chromiumSandbox","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","deprecated":"Use [debugging tools](../debug.md) instead.","name":"devtools","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the↵`headless` option will be set `false`."}],"required":false,"comment":"**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the\n`headless` option will be set `false`.","async":false,"alias":"devtools","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"downloadsPath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is↵deleted when browser is closed. In either case, the downloads are deleted when the browser context they were created in↵is closed."}],"required":false,"comment":"If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and\nis deleted when browser is closed. In either case, the downloads are deleted when the browser context they were\ncreated in is closed.","async":false,"alias":"downloadsPath","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"env","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"Specify environment variables that will be visible to the browser. Defaults to `process.env`."}],"required":false,"comment":"Specify environment variables that will be visible to the browser. Defaults to `process.env`.","async":false,"alias":"env","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"env","type":{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}],"expression":"[Object]<[string], [string]|[float]|[boolean]>"},"spec":[{"type":"text","text":"Specify environment variables that will be visible to the browser. Defaults to `process.env`."}],"required":false,"comment":"Specify environment variables that will be visible to the browser. Defaults to `process.env`.","async":false,"alias":"env","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"executablePath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then↵it is resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium,↵Firefox or WebKit, use at your own risk."}],"required":false,"comment":"Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is\nresolved relative to the current working directory. Note that Playwright only works with the bundled Chromium,\nFirefox or WebKit, use at your own risk.","async":false,"alias":"executablePath","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"firefoxUserPrefs","type":{"name":"Object","templates":[{"name":"string"},{"name":"","union":[{"name":"string"},{"name":"float"},{"name":"boolean"}]}],"expression":"[Object]<[string], [string]|[float]|[boolean]>"},"spec":[{"type":"text","text":"Firefox user preferences. Learn more about the Firefox user preferences at↵[`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox)."}],"required":false,"comment":"Firefox user preferences. Learn more about the Firefox user preferences at\n[`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox).","async":false,"alias":"firefoxUserPrefs","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"firefoxUserPrefs","type":{"name":"Object","templates":[{"name":"string"},{"name":"any"}],"expression":"[Object]<[string], [any]>"},"spec":[{"type":"text","text":"Firefox user preferences. Learn more about the Firefox user preferences at↵[`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox)."}],"required":false,"comment":"Firefox user preferences. Learn more about the Firefox user preferences at\n[`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox).","async":false,"alias":"firefoxUserPrefs","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"handleSIGHUP","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Close the browser process on SIGHUP. Defaults to `true`."}],"required":false,"comment":"Close the browser process on SIGHUP. Defaults to `true`.","async":false,"alias":"handleSIGHUP","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"handleSIGINT","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Close the browser process on Ctrl-C. Defaults to `true`."}],"required":false,"comment":"Close the browser process on Ctrl-C. Defaults to `true`.","async":false,"alias":"handleSIGINT","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"handleSIGTERM","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Close the browser process on SIGTERM. Defaults to `true`."}],"required":false,"comment":"Close the browser process on SIGTERM. Defaults to `true`.","async":false,"alias":"handleSIGTERM","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"headless","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to run browser in headless mode. More details for↵[Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and↵[Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the↵`devtools` option is `true`."}],"required":false,"comment":"Whether to run browser in headless mode. More details for\n[Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and\n[Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the\n`devtools` option is `true`.","async":false,"alias":"headless","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.45","name":"host","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Host to use for the web socket. It is optional and if it is omitted, the server will accept connections on the unspecified IPv6 address (::) when IPv6 is available, or the unspecified IPv4 address (0.0.0.0) otherwise. Consider hardening it with picking a specific interface."}],"required":false,"comment":"Host to use for the web socket. It is optional and if it is omitted, the server will accept connections on the\nunspecified IPv6 address (::) when IPv6 is available, or the unspecified IPv4 address (0.0.0.0) otherwise. Consider\nhardening it with picking a specific interface.","async":false,"alias":"host","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"ignoreDefaultArgs","type":{"name":"","union":[{"name":"boolean"},{"name":"Array","templates":[{"name":"string"}]}],"expression":"[boolean]|[Array]<[string]>"},"spec":[{"type":"text","text":"If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. If an↵array is given, then filters out the given default arguments. Dangerous option; use with care. Defaults to `false`."}],"required":false,"comment":"If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. If an array is\ngiven, then filters out the given default arguments. Dangerous option; use with care. Defaults to `false`.","async":false,"alias":"ignoreDefaultArgs","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"logger","type":{"name":"Logger","expression":"[Logger]"},"spec":[{"type":"text","text":"Logger sink for Playwright logging."}],"required":false,"comment":"Logger sink for Playwright logging.","async":false,"alias":"logger","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"port","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Port to use for the web socket. Defaults to 0 that picks any available port."}],"required":false,"comment":"Port to use for the web socket. Defaults to 0 that picks any available port.","async":false,"alias":"port","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"proxy","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"server","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example↵`http://myproxy.com:3128` or `socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP↵proxy."}],"required":true,"comment":"Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example `http://myproxy.com:3128` or\n`socks5://myproxy.com:3128`. Short form `myproxy.com:3128` is considered an HTTP proxy.","async":false,"alias":"server","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"bypass","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org,↵.domain.com\"`."}],"required":false,"comment":"Optional comma-separated domains to bypass proxy, for example `\".com, chromium.org, .domain.com\"`.","async":false,"alias":"bypass","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"username","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional username to use if HTTP proxy requires authentication."}],"required":false,"comment":"Optional username to use if HTTP proxy requires authentication.","async":false,"alias":"username","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"password","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional password to use if HTTP proxy requires authentication."}],"required":false,"comment":"Optional password to use if HTTP proxy requires authentication.","async":false,"alias":"password","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Network proxy settings."}],"required":false,"comment":"Network proxy settings.","async":false,"alias":"proxy","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0` to↵disable timeout."}],"required":false,"comment":"Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0`\nto disable timeout.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"tracesDir","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"If specified, traces are saved into this directory."}],"required":false,"comment":"If specified, traces are saved into this directory.","async":false,"alias":"tracesDir","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.15","name":"wsPath","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Path at which to serve the Browser Server. For security, this defaults to an↵unguessable string."},{"type":"note","noteType":"warning","text":"Any process or web page (including those running in Playwright) with knowledge↵of the `wsPath` can take control of the OS user. For this reason, you should↵use an unguessable token when using this option."}],"required":false,"comment":"Path at which to serve the Browser Server. For security, this defaults to an unguessable string.\n\n**NOTE** Any process or web page (including those running in Playwright) with knowledge of the `wsPath` can take\ncontrol of the OS user. For this reason, you should use an unguessable token when using this option.","async":false,"alias":"wsPath","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Returns browser name. For example: `'chromium'`, `'webkit'` or `'firefox'`."}],"required":true,"comment":"Returns browser name. For example: `'chromium'`, `'webkit'` or `'firefox'`.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null,"args":[]}]},{"name":"CDPSession","spec":[{"type":"li","text":"extends: [EventEmitter]","liType":"bullet"},{"type":"text","text":"The `CDPSession` instances are used to talk raw Chrome Devtools Protocol:"},{"type":"li","text":"protocol methods can be called with `session.send` method.","liType":"bullet"},{"type":"li","text":"protocol events can be subscribed to with `session.on` method.","liType":"bullet"},{"type":"text","text":"Useful links:"},{"type":"li","text":"Documentation on DevTools Protocol can be found here:↵[DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/).","liType":"bullet"},{"type":"li","text":"Getting Started with DevTools Protocol:↵https://github.com/aslushnikov/getting-started-with-cdp/blob/master/README.md","liType":"bullet"},{"type":"code","lines":["const client = await page.context().newCDPSession(page);","await client.send('Animation.enable');","client.on('Animation.animationCreated', () => console.log('Animation created!'));","const response = await client.send('Animation.getPlaybackRate');","console.log('playback rate is ' + response.playbackRate);","await client.send('Animation.setPlaybackRate', {"," playbackRate: response.playbackRate / 2","});"],"codeLang":"js"},{"type":"code","lines":["client = await page.context.new_cdp_session(page)","await client.send(\"Animation.enable\")","client.on(\"Animation.animationCreated\", lambda: print(\"animation created!\"))","response = await client.send(\"Animation.getPlaybackRate\")","print(\"playback rate is \" + str(response[\"playbackRate\"]))","await client.send(\"Animation.setPlaybackRate\", {"," \"playbackRate\": response[\"playbackRate\"] / 2","})"],"codeLang":"python async"},{"type":"code","lines":["client = page.context.new_cdp_session(page)","client.send(\"Animation.enable\")","client.on(\"Animation.animationCreated\", lambda: print(\"animation created!\"))","response = client.send(\"Animation.getPlaybackRate\")","print(\"playback rate is \" + str(response[\"playbackRate\"]))","client.send(\"Animation.setPlaybackRate\", {"," \"playbackRate\": response[\"playbackRate\"] / 2","})"],"codeLang":"python sync"},{"type":"code","lines":["var client = await Page.Context.NewCDPSessionAsync(Page);","await client.SendAsync(\"Runtime.enable\");","client.Event(\"Animation.animationCreated\").OnEvent += (_, _) => Console.WriteLine(\"Animation created!\");","var response = await client.SendAsync(\"Animation.getPlaybackRate\");","var playbackRate = response.Value.GetProperty(\"playbackRate\").GetDouble();","Console.WriteLine(\"playback rate is \" + playbackRate);","await client.SendAsync(\"Animation.setPlaybackRate\", new() { { \"playbackRate\", playbackRate / 2 } });"],"codeLang":"csharp"},{"type":"code","lines":["CDPSession client = page.context().newCDPSession(page);","client.send(\"Runtime.enable\");","","client.on(\"Animation.animationCreated\", (event) -> System.out.println(\"Animation created!\"));","","JsonObject response = client.send(\"Animation.getPlaybackRate\");","double playbackRate = response.get(\"playbackRate\").getAsDouble();","System.out.println(\"playback rate is \" + playbackRate);","","JsonObject params = new JsonObject();","params.addProperty(\"playbackRate\", playbackRate / 2);","client.send(\"Animation.setPlaybackRate\", params);"],"codeLang":"java"}],"extends":"EventEmitter","langs":{},"comment":"- extends: [EventEmitter]\n\nThe `CDPSession` instances are used to talk raw Chrome Devtools Protocol:\n- protocol methods can be called with `session.send` method.\n- protocol events can be subscribed to with `session.on` method.\n\nUseful links:\n- Documentation on DevTools Protocol can be found here:\n [DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/).\n- Getting Started with DevTools Protocol:\n https://github.com/aslushnikov/getting-started-with-cdp/blob/master/README.md\n\n```js\nconst client = await page.context().newCDPSession(page);\nawait client.send('Animation.enable');\nclient.on('Animation.animationCreated', () => console.log('Animation created!'));\nconst response = await client.send('Animation.getPlaybackRate');\nconsole.log('playback rate is ' + response.playbackRate);\nawait client.send('Animation.setPlaybackRate', {\n playbackRate: response.playbackRate / 2\n});\n```\n\n```py\nclient = await page.context.new_cdp_session(page)\nawait client.send(\"Animation.enable\")\nclient.on(\"Animation.animationCreated\", lambda: print(\"animation created!\"))\nresponse = await client.send(\"Animation.getPlaybackRate\")\nprint(\"playback rate is \" + str(response[\"playbackRate\"]))\nawait client.send(\"Animation.setPlaybackRate\", {\n \"playbackRate\": response[\"playbackRate\"] / 2\n})\n```\n\n```py\nclient = page.context.new_cdp_session(page)\nclient.send(\"Animation.enable\")\nclient.on(\"Animation.animationCreated\", lambda: print(\"animation created!\"))\nresponse = client.send(\"Animation.getPlaybackRate\")\nprint(\"playback rate is \" + str(response[\"playbackRate\"]))\nclient.send(\"Animation.setPlaybackRate\", {\n \"playbackRate\": response[\"playbackRate\"] / 2\n})\n```\n\n```csharp\nvar client = await Page.Context.NewCDPSessionAsync(Page);\nawait client.SendAsync(\"Runtime.enable\");\nclient.Event(\"Animation.animationCreated\").OnEvent += (_, _) => Console.WriteLine(\"Animation created!\");\nvar response = await client.SendAsync(\"Animation.getPlaybackRate\");\nvar playbackRate = response.Value.GetProperty(\"playbackRate\").GetDouble();\nConsole.WriteLine(\"playback rate is \" + playbackRate);\nawait client.SendAsync(\"Animation.setPlaybackRate\", new() { { \"playbackRate\", playbackRate / 2 } });\n```\n\n```java\nCDPSession client = page.context().newCDPSession(page);\nclient.send(\"Runtime.enable\");\n\nclient.on(\"Animation.animationCreated\", (event) -> System.out.println(\"Animation created!\"));\n\nJsonObject response = client.send(\"Animation.getPlaybackRate\");\ndouble playbackRate = response.get(\"playbackRate\").getAsDouble();\nSystem.out.println(\"playback rate is \" + playbackRate);\n\nJsonObject params = new JsonObject();\nparams.addProperty(\"playbackRate\", playbackRate / 2);\nclient.send(\"Animation.setPlaybackRate\", params);\n```\n","since":"v1.8","members":[{"kind":"method","langs":{},"since":"v1.8","name":"detach","type":{"name":"void"},"spec":[{"type":"text","text":"Detaches the CDPSession from the target. Once detached, the CDPSession object won't emit any events and can't be used to↵send messages."}],"required":true,"comment":"Detaches the CDPSession from the target. Once detached, the CDPSession object won't emit any events and can't be\nused to send messages.","async":true,"alias":"detach","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"types":{"csharp":{"name":"JsonElement?","expression":"[JsonElement?]"},"java":{"name":"JsonObject","expression":"[JsonObject]"}}},"since":"v1.8","name":"send","type":{"name":"Object","expression":"[Object]"},"spec":[],"required":true,"comment":"","async":true,"alias":"send","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"method","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Protocol method name."}],"required":true,"comment":"Protocol method name.","async":false,"alias":"method","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"params","type":{"name":"Object","expression":"[Object]"},"spec":[{"type":"text","text":"Optional method parameters."}],"required":false,"comment":"Optional method parameters.","async":false,"alias":"params","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{"csharp":"args"},"types":{},"overrides":{}},"since":"v1.30","name":"params","type":{"name":"Map","templates":[{"name":"string"},{"name":"Object"}],"expression":"[Map<string, Object>]"},"spec":[{"type":"text","text":"Optional method parameters."}],"required":false,"comment":"Optional method parameters.","async":false,"alias":"params","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{"java":"args"},"types":{},"overrides":{}},"since":"v1.37","name":"params","type":{"name":"JsonObject","expression":"[JsonObject]"},"spec":[{"type":"text","text":"Optional method parameters."}],"required":false,"comment":"Optional method parameters.","async":false,"alias":"params","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v.1.30","name":"event","type":{"name":"CDPSessionEvent","expression":"[CDPSessionEvent]"},"spec":[{"type":"text","text":"Returns an event emitter for the given CDP event name."}],"required":true,"comment":"Returns an event emitter for the given CDP event name.","async":false,"alias":"event","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.30","name":"eventName","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"CDP event name."}],"required":true,"comment":"CDP event name.","async":false,"alias":"eventName","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.37","name":"on","type":{"name":"void"},"spec":[{"type":"text","text":"Register an event handler for events with the specified event name.↵The given handler will be called for every event with the given name."}],"required":true,"comment":"Register an event handler for events with the specified event name. The given handler will be called for every\nevent with the given name.","async":false,"alias":"on","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.37","name":"eventName","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"CDP event name."}],"required":true,"comment":"CDP event name.","async":false,"alias":"eventName","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.37","name":"handler","type":{"name":"function","args":[{"name":"JsonObject"}],"expression":"[function]([JsonObject])"},"spec":[{"type":"text","text":"Event handler."}],"required":true,"comment":"Event handler.","async":false,"alias":"handler","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.37","name":"off","type":{"name":"void"},"spec":[{"type":"text","text":"Unregister an event handler for events with the specified event name.↵The given handler will not be called anymore for events with the given name."}],"required":true,"comment":"Unregister an event handler for events with the specified event name. The given handler will not be called anymore\nfor events with the given name.","async":false,"alias":"off","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.37","name":"eventName","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"CDP event name."}],"required":true,"comment":"CDP event name.","async":false,"alias":"eventName","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.37","name":"handler","type":{"name":"function","args":[{"name":"JsonObject"}],"expression":"[function]([JsonObject])"},"spec":[{"type":"text","text":"Event handler."}],"required":true,"comment":"Event handler.","async":false,"alias":"handler","overloadIndex":0,"paramOrOption":null}]}]},{"name":"CDPSessionEvent","spec":[{"type":"text","text":"`CDPSessionEvent` objects are returned by page via the [`method: CDPSession.event`] method."},{"type":"text","text":"Each object represents a named event and allows handling of the event when it is raised."}],"langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"comment":"`CDPSessionEvent` objects are returned by page via the [`method: CDPSession.event`] method.\n\nEach object represents a named event and allows handling of the event when it is raised.","since":"v1.30","members":[{"kind":"event","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.30","name":"onEvent","type":{"name":"JsonElement?","expression":"[JsonElement?]"},"spec":[],"required":true,"comment":"","async":false,"alias":"onEvent","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"1.30","name":"eventName","type":{"name":"string","expression":"[string]"},"spec":[],"required":true,"comment":"","async":false,"alias":"eventName","overloadIndex":0,"paramOrOption":null,"args":[]}]},{"name":"Clock","spec":[{"type":"text","text":"Accurately simulating time-dependent behavior is essential for verifying the correctness of applications. Learn more about [clock emulation](../clock.md)."},{"type":"text","text":"Note that clock is installed for the entire `BrowserContext`, so the time↵in all the pages and iframes is controlled by the same clock."}],"langs":{},"comment":"Accurately simulating time-dependent behavior is essential for verifying the correctness of applications. Learn\nmore about [clock emulation](../clock.md).\n\nNote that clock is installed for the entire `BrowserContext`, so the time in all the pages and iframes is\ncontrolled by the same clock.","since":"v1.45","members":[{"kind":"method","langs":{},"since":"v1.45","name":"fastForward","type":{"name":"void"},"spec":[{"type":"text","text":"Advance the clock by jumping forward in time. Only fires due timers at most once. This is equivalent to user closing the laptop lid for a while and↵reopening it later, after given time."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.clock.fastForward(1000);","await page.clock.fastForward('30:00');"],"codeLang":"js"},{"type":"code","lines":["await page.clock.fast_forward(1000)","await page.clock.fast_forward(\"30:00\")"],"codeLang":"python async"},{"type":"code","lines":["page.clock.fast_forward(1000)","page.clock.fast_forward(\"30:00\")"],"codeLang":"python sync"},{"type":"code","lines":["page.clock().fastForward(1000);","page.clock().fastForward(\"30:00\");"],"codeLang":"java"},{"type":"code","lines":["await page.Clock.FastForwardAsync(1000);","await page.Clock.FastForwardAsync(\"30:00\");"],"codeLang":"csharp"}],"required":true,"comment":"Advance the clock by jumping forward in time. Only fires due timers at most once. This is equivalent to user\nclosing the laptop lid for a while and reopening it later, after given time.\n\n**Usage**\n\n```js\nawait page.clock.fastForward(1000);\nawait page.clock.fastForward('30:00');\n```\n\n```py\nawait page.clock.fast_forward(1000)\nawait page.clock.fast_forward(\"30:00\")\n```\n\n```py\npage.clock.fast_forward(1000)\npage.clock.fast_forward(\"30:00\")\n```\n\n```java\npage.clock().fastForward(1000);\npage.clock().fastForward(\"30:00\");\n```\n\n```csharp\nawait page.Clock.FastForwardAsync(1000);\nawait page.Clock.FastForwardAsync(\"30:00\");\n```\n","async":true,"alias":"fastForward","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.45","name":"ticks","type":{"name":"","union":[{"name":"long"},{"name":"string"}],"expression":"[long]|[string]"},"spec":[{"type":"text","text":"Time may be the number of milliseconds to advance the clock by or a human-readable string. Valid string formats are \"08\" for eight seconds, \"01:00\" for one minute and \"02:34:10\" for two hours, 34 minutes and ten seconds."}],"required":true,"comment":"Time may be the number of milliseconds to advance the clock by or a human-readable string. Valid string formats are\n\"08\" for eight seconds, \"01:00\" for one minute and \"02:34:10\" for two hours, 34 minutes and ten seconds.","async":false,"alias":"ticks","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.45","name":"install","type":{"name":"void"},"spec":[{"type":"text","text":"Install fake implementations for the following time-related functions:"},{"type":"li","text":"`Date`","liType":"bullet"},{"type":"li","text":"`setTimeout`","liType":"bullet"},{"type":"li","text":"`clearTimeout`","liType":"bullet"},{"type":"li","text":"`setInterval`","liType":"bullet"},{"type":"li","text":"`clearInterval`","liType":"bullet"},{"type":"li","text":"`requestAnimationFrame`","liType":"bullet"},{"type":"li","text":"`cancelAnimationFrame`","liType":"bullet"},{"type":"li","text":"`requestIdleCallback`","liType":"bullet"},{"type":"li","text":"`cancelIdleCallback`","liType":"bullet"},{"type":"li","text":"`performance`","liType":"bullet"},{"type":"text","text":"Fake timers are used to manually control the flow of time in tests. They allow you to advance time, fire timers, and control the behavior of time-dependent functions. See [`method: Clock.runFor`] and [`method: Clock.fastForward`] for more information."}],"required":true,"comment":"Install fake implementations for the following time-related functions:\n- `Date`\n- `setTimeout`\n- `clearTimeout`\n- `setInterval`\n- `clearInterval`\n- `requestAnimationFrame`\n- `cancelAnimationFrame`\n- `requestIdleCallback`\n- `cancelIdleCallback`\n- `performance`\n\nFake timers are used to manually control the flow of time in tests. They allow you to advance time, fire timers,\nand control the behavior of time-dependent functions. See [`method: Clock.runFor`] and\n[`method: Clock.fastForward`] for more information.","async":true,"alias":"install","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.45","name":"time","type":{"name":"","union":[{"name":"long"},{"name":"string"},{"name":"Date"}],"expression":"[long]|[string]|[Date]"},"spec":[{"type":"text","text":"Time to initialize with, current system time by default."}],"required":false,"comment":"Time to initialize with, current system time by default.","async":false,"alias":"time","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.45","name":"time","type":{"name":"","union":[{"name":"float"},{"name":"string"},{"name":"Date"}],"expression":"[float]|[string]|[Date]"},"spec":[{"type":"text","text":"Time to initialize with, current system time by default."}],"required":false,"comment":"Time to initialize with, current system time by default.","async":false,"alias":"time","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.45","name":"time","type":{"name":"","union":[{"name":"string"},{"name":"Date"}],"expression":"[string]|[Date]"},"spec":[{"type":"text","text":"Time to initialize with, current system time by default."}],"required":false,"comment":"Time to initialize with, current system time by default.","async":false,"alias":"time","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.45","name":"runFor","type":{"name":"void"},"spec":[{"type":"text","text":"Advance the clock, firing all the time-related callbacks."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.clock.runFor(1000);","await page.clock.runFor('30:00');"],"codeLang":"js"},{"type":"code","lines":["await page.clock.run_for(1000);","await page.clock.run_for(\"30:00\")"],"codeLang":"python async"},{"type":"code","lines":["page.clock.run_for(1000);","page.clock.run_for(\"30:00\")"],"codeLang":"python sync"},{"type":"code","lines":["page.clock().runFor(1000);","page.clock().runFor(\"30:00\");"],"codeLang":"java"},{"type":"code","lines":["await page.Clock.RunForAsync(1000);","await page.Clock.RunForAsync(\"30:00\");"],"codeLang":"csharp"}],"required":true,"comment":"Advance the clock, firing all the time-related callbacks.\n\n**Usage**\n\n```js\nawait page.clock.runFor(1000);\nawait page.clock.runFor('30:00');\n```\n\n```py\nawait page.clock.run_for(1000);\nawait page.clock.run_for(\"30:00\")\n```\n\n```py\npage.clock.run_for(1000);\npage.clock.run_for(\"30:00\")\n```\n\n```java\npage.clock().runFor(1000);\npage.clock().runFor(\"30:00\");\n```\n\n```csharp\nawait page.Clock.RunForAsync(1000);\nawait page.Clock.RunForAsync(\"30:00\");\n```\n","async":true,"alias":"runFor","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.45","name":"ticks","type":{"name":"","union":[{"name":"long"},{"name":"string"}],"expression":"[long]|[string]"},"spec":[{"type":"text","text":"Time may be the number of milliseconds to advance the clock by or a human-readable string. Valid string formats are \"08\" for eight seconds, \"01:00\" for one minute and \"02:34:10\" for two hours, 34 minutes and ten seconds."}],"required":true,"comment":"Time may be the number of milliseconds to advance the clock by or a human-readable string. Valid string formats are\n\"08\" for eight seconds, \"01:00\" for one minute and \"02:34:10\" for two hours, 34 minutes and ten seconds.","async":false,"alias":"ticks","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.45","name":"pauseAt","type":{"name":"void"},"spec":[{"type":"text","text":"Advance the clock by jumping forward in time and pause the time. Once this method is called, no timers↵are fired unless [`method: Clock.runFor`], [`method: Clock.fastForward`], [`method: Clock.pauseAt`] or [`method: Clock.resume`] is called."},{"type":"text","text":"Only fires due timers at most once.↵This is equivalent to user closing the laptop lid for a while and reopening it at the specified time and↵pausing."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.clock.pauseAt(new Date('2020-02-02'));","await page.clock.pauseAt('2020-02-02');"],"codeLang":"js"},{"type":"code","lines":["await page.clock.pause_at(datetime.datetime(2020, 2, 2))","await page.clock.pause_at(\"2020-02-02\")"],"codeLang":"python async"},{"type":"code","lines":["page.clock.pause_at(datetime.datetime(2020, 2, 2))","page.clock.pause_at(\"2020-02-02\")"],"codeLang":"python sync"},{"type":"code","lines":["SimpleDateFormat format = new SimpleDateFormat(\"yyy-MM-dd\");","page.clock().pauseAt(format.parse(\"2020-02-02\"));","page.clock().pauseAt(\"2020-02-02\");"],"codeLang":"java"},{"type":"code","lines":["await page.Clock.PauseAtAsync(DateTime.Parse(\"2020-02-02\"));","await page.Clock.PauseAtAsync(\"2020-02-02\");"],"codeLang":"csharp"}],"required":true,"comment":"Advance the clock by jumping forward in time and pause the time. Once this method is called, no timers are fired\nunless [`method: Clock.runFor`], [`method: Clock.fastForward`], [`method: Clock.pauseAt`] or\n[`method: Clock.resume`] is called.\n\nOnly fires due timers at most once. This is equivalent to user closing the laptop lid for a while and reopening it\nat the specified time and pausing.\n\n**Usage**\n\n```js\nawait page.clock.pauseAt(new Date('2020-02-02'));\nawait page.clock.pauseAt('2020-02-02');\n```\n\n```py\nawait page.clock.pause_at(datetime.datetime(2020, 2, 2))\nawait page.clock.pause_at(\"2020-02-02\")\n```\n\n```py\npage.clock.pause_at(datetime.datetime(2020, 2, 2))\npage.clock.pause_at(\"2020-02-02\")\n```\n\n```java\nSimpleDateFormat format = new SimpleDateFormat(\"yyy-MM-dd\");\npage.clock().pauseAt(format.parse(\"2020-02-02\"));\npage.clock().pauseAt(\"2020-02-02\");\n```\n\n```csharp\nawait page.Clock.PauseAtAsync(DateTime.Parse(\"2020-02-02\"));\nawait page.Clock.PauseAtAsync(\"2020-02-02\");\n```\n","async":true,"alias":"pauseAt","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.45","name":"time","type":{"name":"","union":[{"name":"long"},{"name":"string"},{"name":"Date"}],"expression":"[long]|[string]|[Date]"},"spec":[{"type":"text","text":"Time to pause at."}],"required":true,"comment":"Time to pause at.","async":false,"alias":"time","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.45","name":"time","type":{"name":"","union":[{"name":"float"},{"name":"string"},{"name":"Date"}],"expression":"[float]|[string]|[Date]"},"spec":[{"type":"text","text":"Time to pause at."}],"required":true,"comment":"Time to pause at.","async":false,"alias":"time","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.45","name":"time","type":{"name":"","union":[{"name":"Date"},{"name":"string"}],"expression":"[Date]|[string]"},"spec":[{"type":"text","text":"Time to pause at."}],"required":true,"comment":"Time to pause at.","async":false,"alias":"time","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.45","name":"resume","type":{"name":"void"},"spec":[{"type":"text","text":"Resumes timers. Once this method is called, time resumes flowing, timers are fired as usual."}],"required":true,"comment":"Resumes timers. Once this method is called, time resumes flowing, timers are fired as usual.","async":true,"alias":"resume","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.45","name":"setFixedTime","type":{"name":"void"},"spec":[{"type":"text","text":"Makes `Date.now` and `new Date()` return fixed fake time at all times,↵keeps all the timers running."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.clock.setFixedTime(Date.now());","await page.clock.setFixedTime(new Date('2020-02-02'));","await page.clock.setFixedTime('2020-02-02');"],"codeLang":"js"},{"type":"code","lines":["await page.clock.set_fixed_time(datetime.datetime.now())","await page.clock.set_fixed_time(datetime.datetime(2020, 2, 2))","await page.clock.set_fixed_time(\"2020-02-02\")"],"codeLang":"python async"},{"type":"code","lines":["page.clock.set_fixed_time(datetime.datetime.now())","page.clock.set_fixed_time(datetime.datetime(2020, 2, 2))","page.clock.set_fixed_time(\"2020-02-02\")"],"codeLang":"python sync"},{"type":"code","lines":["page.clock().setFixedTime(new Date());","page.clock().setFixedTime(new SimpleDateFormat(\"yyy-MM-dd\").parse(\"2020-02-02\"));","page.clock().setFixedTime(\"2020-02-02\");"],"codeLang":"java"},{"type":"code","lines":["await page.Clock.SetFixedTimeAsync(DateTime.Now);","await page.Clock.SetFixedTimeAsync(new DateTime(2020, 2, 2));","await page.Clock.SetFixedTimeAsync(\"2020-02-02\");"],"codeLang":"csharp"}],"required":true,"comment":"Makes `Date.now` and `new Date()` return fixed fake time at all times, keeps all the timers running.\n\n**Usage**\n\n```js\nawait page.clock.setFixedTime(Date.now());\nawait page.clock.setFixedTime(new Date('2020-02-02'));\nawait page.clock.setFixedTime('2020-02-02');\n```\n\n```py\nawait page.clock.set_fixed_time(datetime.datetime.now())\nawait page.clock.set_fixed_time(datetime.datetime(2020, 2, 2))\nawait page.clock.set_fixed_time(\"2020-02-02\")\n```\n\n```py\npage.clock.set_fixed_time(datetime.datetime.now())\npage.clock.set_fixed_time(datetime.datetime(2020, 2, 2))\npage.clock.set_fixed_time(\"2020-02-02\")\n```\n\n```java\npage.clock().setFixedTime(new Date());\npage.clock().setFixedTime(new SimpleDateFormat(\"yyy-MM-dd\").parse(\"2020-02-02\"));\npage.clock().setFixedTime(\"2020-02-02\");\n```\n\n```csharp\nawait page.Clock.SetFixedTimeAsync(DateTime.Now);\nawait page.Clock.SetFixedTimeAsync(new DateTime(2020, 2, 2));\nawait page.Clock.SetFixedTimeAsync(\"2020-02-02\");\n```\n","async":true,"alias":"setFixedTime","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.45","name":"time","type":{"name":"","union":[{"name":"long"},{"name":"string"},{"name":"Date"}],"expression":"[long]|[string]|[Date]"},"spec":[{"type":"text","text":"Time to be set in milliseconds."}],"required":true,"comment":"Time to be set in milliseconds.","async":false,"alias":"time","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.45","name":"time","type":{"name":"","union":[{"name":"float"},{"name":"string"},{"name":"Date"}],"expression":"[float]|[string]|[Date]"},"spec":[{"type":"text","text":"Time to be set."}],"required":true,"comment":"Time to be set.","async":false,"alias":"time","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.45","name":"time","type":{"name":"","union":[{"name":"string"},{"name":"Date"}],"expression":"[string]|[Date]"},"spec":[{"type":"text","text":"Time to be set."}],"required":true,"comment":"Time to be set.","async":false,"alias":"time","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.45","name":"setSystemTime","type":{"name":"void"},"spec":[{"type":"text","text":"Sets current system time but does not trigger any timers."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.clock.setSystemTime(Date.now());","await page.clock.setSystemTime(new Date('2020-02-02'));","await page.clock.setSystemTime('2020-02-02');"],"codeLang":"js"},{"type":"code","lines":["await page.clock.set_system_time(datetime.datetime.now())","await page.clock.set_system_time(datetime.datetime(2020, 2, 2))","await page.clock.set_system_time(\"2020-02-02\")"],"codeLang":"python async"},{"type":"code","lines":["page.clock.set_system_time(datetime.datetime.now())","page.clock.set_system_time(datetime.datetime(2020, 2, 2))","page.clock.set_system_time(\"2020-02-02\")"],"codeLang":"python sync"},{"type":"code","lines":["page.clock().setSystemTime(new Date());","page.clock().setSystemTime(new SimpleDateFormat(\"yyy-MM-dd\").parse(\"2020-02-02\"));","page.clock().setSystemTime(\"2020-02-02\");"],"codeLang":"java"},{"type":"code","lines":["await page.Clock.SetSystemTimeAsync(DateTime.Now);","await page.Clock.SetSystemTimeAsync(new DateTime(2020, 2, 2));","await page.Clock.SetSystemTimeAsync(\"2020-02-02\");"],"codeLang":"csharp"}],"required":true,"comment":"Sets current system time but does not trigger any timers.\n\n**Usage**\n\n```js\nawait page.clock.setSystemTime(Date.now());\nawait page.clock.setSystemTime(new Date('2020-02-02'));\nawait page.clock.setSystemTime('2020-02-02');\n```\n\n```py\nawait page.clock.set_system_time(datetime.datetime.now())\nawait page.clock.set_system_time(datetime.datetime(2020, 2, 2))\nawait page.clock.set_system_time(\"2020-02-02\")\n```\n\n```py\npage.clock.set_system_time(datetime.datetime.now())\npage.clock.set_system_time(datetime.datetime(2020, 2, 2))\npage.clock.set_system_time(\"2020-02-02\")\n```\n\n```java\npage.clock().setSystemTime(new Date());\npage.clock().setSystemTime(new SimpleDateFormat(\"yyy-MM-dd\").parse(\"2020-02-02\"));\npage.clock().setSystemTime(\"2020-02-02\");\n```\n\n```csharp\nawait page.Clock.SetSystemTimeAsync(DateTime.Now);\nawait page.Clock.SetSystemTimeAsync(new DateTime(2020, 2, 2));\nawait page.Clock.SetSystemTimeAsync(\"2020-02-02\");\n```\n","async":true,"alias":"setSystemTime","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.45","name":"time","type":{"name":"","union":[{"name":"long"},{"name":"string"},{"name":"Date"}],"expression":"[long]|[string]|[Date]"},"spec":[{"type":"text","text":"Time to be set in milliseconds."}],"required":true,"comment":"Time to be set in milliseconds.","async":false,"alias":"time","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.45","name":"time","type":{"name":"","union":[{"name":"float"},{"name":"string"},{"name":"Date"}],"expression":"[float]|[string]|[Date]"},"spec":[{"type":"text","text":"Time to be set."}],"required":true,"comment":"Time to be set.","async":false,"alias":"time","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.45","name":"time","type":{"name":"","union":[{"name":"string"},{"name":"Date"}],"expression":"[string]|[Date]"},"spec":[{"type":"text","text":"Time to be set."}],"required":true,"comment":"Time to be set.","async":false,"alias":"time","overloadIndex":0,"paramOrOption":null}]}]},{"name":"ConsoleMessage","spec":[{"type":"text","text":"`ConsoleMessage` objects are dispatched by page via the [`event: Page.console`] event.↵For each console message logged in the page there will be corresponding event in the Playwright↵context."},{"type":"code","lines":["// Listen for all console logs","page.on('console', msg => console.log(msg.text()));","","// Listen for all console events and handle errors","page.on('console', msg => {"," if (msg.type() === 'error')"," console.log(`Error text: \"${msg.text()}\"`);","});","","// Get the next console log","const msgPromise = page.waitForEvent('console');","await page.evaluate(() => {"," console.log('hello', 42, { foo: 'bar' }); // Issue console.log inside the page","});","const msg = await msgPromise;","","// Deconstruct console log arguments","await msg.args()[0].jsonValue(); // hello","await msg.args()[1].jsonValue(); // 42"],"codeLang":"js"},{"type":"code","lines":["// Listen for all console messages and print them to the standard output.","page.onConsoleMessage(msg -> System.out.println(msg.text()));","","// Listen for all console messages and print errors to the standard output.","page.onConsoleMessage(msg -> {"," if (\"error\".equals(msg.type()))"," System.out.println(\"Error text: \" + msg.text());","});","","// Get the next console message","ConsoleMessage msg = page.waitForConsoleMessage(() -> {"," // Issue console.log inside the page"," page.evaluate(\"console.log('hello', 42, { foo: 'bar' });\");","});","","// Deconstruct console.log arguments","msg.args().get(0).jsonValue() // hello","msg.args().get(1).jsonValue() // 42"],"codeLang":"java"},{"type":"code","lines":["# Listen for all console logs","page.on(\"console\", lambda msg: print(msg.text))","","# Listen for all console events and handle errors","page.on(\"console\", lambda msg: print(f\"error: {msg.text}\") if msg.type == \"error\" else None)","","# Get the next console log","async with page.expect_console_message() as msg_info:"," # Issue console.log inside the page"," await page.evaluate(\"console.log('hello', 42, { foo: 'bar' })\")","msg = await msg_info.value","","# Deconstruct print arguments","await msg.args[0].json_value() # hello","await msg.args[1].json_value() # 42"],"codeLang":"python async"},{"type":"code","lines":["# Listen for all console logs","page.on(\"console\", lambda msg: print(msg.text))","","# Listen for all console events and handle errors","page.on(\"console\", lambda msg: print(f\"error: {msg.text}\") if msg.type == \"error\" else None)","","# Get the next console log","with page.expect_console_message() as msg_info:"," # Issue console.log inside the page"," page.evaluate(\"console.log('hello', 42, { foo: 'bar' })\")","msg = msg_info.value","","# Deconstruct print arguments","msg.args[0].json_value() # hello","msg.args[1].json_value() # 42"],"codeLang":"python sync"},{"type":"code","lines":["// Listen for all console messages and print them to the standard output.","page.Console += (_, msg) => Console.WriteLine(msg.Text);","","// Listen for all console messages and print errors to the standard output.","page.Console += (_, msg) =>","{"," if (\"error\".Equals(msg.Type))"," Console.WriteLine(\"Error text: \" + msg.Text);","};","","// Get the next console message","var waitForMessageTask = page.WaitForConsoleMessageAsync();","await page.EvaluateAsync(\"console.log('hello', 42, { foo: 'bar' });\");","var message = await waitForMessageTask;","// Deconstruct console.log arguments","await message.Args.ElementAt(0).JsonValueAsync<string>(); // hello","await message.Args.ElementAt(1).JsonValueAsync<int>(); // 42"],"codeLang":"csharp"}],"langs":{},"comment":"`ConsoleMessage` objects are dispatched by page via the [`event: Page.console`] event. For each console message\nlogged in the page there will be corresponding event in the Playwright context.\n\n```js\n// Listen for all console logs\npage.on('console', msg => console.log(msg.text()));\n\n// Listen for all console events and handle errors\npage.on('console', msg => {\n if (msg.type() === 'error')\n console.log(`Error text: \"${msg.text()}\"`);\n});\n\n// Get the next console log\nconst msgPromise = page.waitForEvent('console');\nawait page.evaluate(() => {\n console.log('hello', 42, { foo: 'bar' }); // Issue console.log inside the page\n});\nconst msg = await msgPromise;\n\n// Deconstruct console log arguments\nawait msg.args()[0].jsonValue(); // hello\nawait msg.args()[1].jsonValue(); // 42\n```\n\n```java\n// Listen for all console messages and print them to the standard output.\npage.onConsoleMessage(msg -> System.out.println(msg.text()));\n\n// Listen for all console messages and print errors to the standard output.\npage.onConsoleMessage(msg -> {\n if (\"error\".equals(msg.type()))\n System.out.println(\"Error text: \" + msg.text());\n});\n\n// Get the next console message\nConsoleMessage msg = page.waitForConsoleMessage(() -> {\n // Issue console.log inside the page\n page.evaluate(\"console.log('hello', 42, { foo: 'bar' });\");\n});\n\n// Deconstruct console.log arguments\nmsg.args().get(0).jsonValue() // hello\nmsg.args().get(1).jsonValue() // 42\n```\n\n```py\n# Listen for all console logs\npage.on(\"console\", lambda msg: print(msg.text))\n\n# Listen for all console events and handle errors\npage.on(\"console\", lambda msg: print(f\"error: {msg.text}\") if msg.type == \"error\" else None)\n\n# Get the next console log\nasync with page.expect_console_message() as msg_info:\n # Issue console.log inside the page\n await page.evaluate(\"console.log('hello', 42, { foo: 'bar' })\")\nmsg = await msg_info.value\n\n# Deconstruct print arguments\nawait msg.args[0].json_value() # hello\nawait msg.args[1].json_value() # 42\n```\n\n```py\n# Listen for all console logs\npage.on(\"console\", lambda msg: print(msg.text))\n\n# Listen for all console events and handle errors\npage.on(\"console\", lambda msg: print(f\"error: {msg.text}\") if msg.type == \"error\" else None)\n\n# Get the next console log\nwith page.expect_console_message() as msg_info:\n # Issue console.log inside the page\n page.evaluate(\"console.log('hello', 42, { foo: 'bar' })\")\nmsg = msg_info.value\n\n# Deconstruct print arguments\nmsg.args[0].json_value() # hello\nmsg.args[1].json_value() # 42\n```\n\n```csharp\n// Listen for all console messages and print them to the standard output.\npage.Console += (_, msg) => Console.WriteLine(msg.Text);\n\n// Listen for all console messages and print errors to the standard output.\npage.Console += (_, msg) =>\n{\n if (\"error\".Equals(msg.Type))\n Console.WriteLine(\"Error text: \" + msg.Text);\n};\n\n// Get the next console message\nvar waitForMessageTask = page.WaitForConsoleMessageAsync();\nawait page.EvaluateAsync(\"console.log('hello', 42, { foo: 'bar' });\");\nvar message = await waitForMessageTask;\n// Deconstruct console.log arguments\nawait message.Args.ElementAt(0).JsonValueAsync<string>(); // hello\nawait message.Args.ElementAt(1).JsonValueAsync<int>(); // 42\n```\n","since":"v1.8","members":[{"kind":"method","langs":{},"since":"v1.8","name":"args","type":{"name":"Array","templates":[{"name":"JSHandle"}],"expression":"[Array]<[JSHandle]>"},"spec":[{"type":"text","text":"List of arguments passed to a `console` function call. See also [`event: Page.console`]."}],"required":true,"comment":"List of arguments passed to a `console` function call. See also [`event: Page.console`].","async":false,"alias":"args","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"location","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"url","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"URL of the resource."}],"required":true,"comment":"URL of the resource.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"lineNumber","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"0-based line number in the resource."}],"required":true,"comment":"0-based line number in the resource.","async":false,"alias":"lineNumber","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"columnNumber","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"0-based column number in the resource."}],"required":true,"comment":"0-based column number in the resource.","async":false,"alias":"columnNumber","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[],"required":true,"comment":"","async":false,"alias":"location","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"location","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"URL of the resource followed by 0-based line and column numbers in the resource formatted as `URL:line:column`."}],"required":true,"comment":"URL of the resource followed by 0-based line and column numbers in the resource formatted as `URL:line:column`.","async":false,"alias":"location","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.34","name":"page","type":{"name":"","union":[{"name":"null"},{"name":"Page"}],"expression":"[null]|[Page]"},"spec":[{"type":"text","text":"The page that produced this console message, if any."}],"required":true,"comment":"The page that produced this console message, if any.","async":false,"alias":"page","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"text","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"The text of the console message."}],"required":true,"comment":"The text of the console message.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"type","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"One of the following values: `'log'`, `'debug'`, `'info'`, `'error'`, `'warning'`, `'dir'`, `'dirxml'`, `'table'`,↵`'trace'`, `'clear'`, `'startGroup'`, `'startGroupCollapsed'`, `'endGroup'`, `'assert'`, `'profile'`, `'profileEnd'`,↵`'count'`, `'timeEnd'`."}],"required":true,"comment":"One of the following values: `'log'`, `'debug'`, `'info'`, `'error'`, `'warning'`, `'dir'`, `'dirxml'`, `'table'`,\n`'trace'`, `'clear'`, `'startGroup'`, `'startGroupCollapsed'`, `'endGroup'`, `'assert'`, `'profile'`,\n`'profileEnd'`, `'count'`, `'timeEnd'`.","async":false,"alias":"type","overloadIndex":0,"paramOrOption":null,"args":[]}]},{"name":"Coverage","spec":[{"type":"text","text":"Coverage gathers information about parts of JavaScript and CSS that were used by the page."},{"type":"text","text":"An example of using JavaScript coverage to produce Istanbul report for page load:"},{"type":"note","noteType":"note","text":"Coverage APIs are only supported on Chromium-based browsers."},{"type":"code","lines":["const { chromium } = require('playwright');","const v8toIstanbul = require('v8-to-istanbul');","","(async () => {"," const browser = await chromium.launch();"," const page = await browser.newPage();"," await page.coverage.startJSCoverage();"," await page.goto('https://chromium.org');"," const coverage = await page.coverage.stopJSCoverage();"," for (const entry of coverage) {"," const converter = v8toIstanbul('', 0, { source: entry.source });"," await converter.load();"," converter.applyCoverage(entry.functions);"," console.log(JSON.stringify(converter.toIstanbul()));"," }"," await browser.close();","})();"],"codeLang":"js"}],"langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"comment":"Coverage gathers information about parts of JavaScript and CSS that were used by the page.\n\nAn example of using JavaScript coverage to produce Istanbul report for page load:\n\n**NOTE** Coverage APIs are only supported on Chromium-based browsers.\n\n```js\nconst { chromium } = require('playwright');\nconst v8toIstanbul = require('v8-to-istanbul');\n\n(async () => {\n const browser = await chromium.launch();\n const page = await browser.newPage();\n await page.coverage.startJSCoverage();\n await page.goto('https://chromium.org');\n const coverage = await page.coverage.stopJSCoverage();\n for (const entry of coverage) {\n const converter = v8toIstanbul('', 0, { source: entry.source });\n await converter.load();\n converter.applyCoverage(entry.functions);\n console.log(JSON.stringify(converter.toIstanbul()));\n }\n await browser.close();\n})();\n```\n","since":"v1.11","members":[{"kind":"method","langs":{},"since":"v1.11","name":"startCSSCoverage","type":{"name":"void"},"spec":[{"type":"text","text":"Returns coverage is started"}],"required":true,"comment":"Returns coverage is started","async":true,"alias":"startCSSCoverage","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.11","name":"resetOnNavigation","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to reset coverage on every navigation. Defaults to `true`."}],"required":false,"comment":"Whether to reset coverage on every navigation. Defaults to `true`.","async":false,"alias":"resetOnNavigation","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.11","name":"startJSCoverage","type":{"name":"void"},"spec":[{"type":"text","text":"Returns coverage is started"},{"type":"note","noteType":"note","text":"Anonymous scripts are ones that don't have an associated url. These are scripts that are dynamically created↵on the page using `eval` or `new Function`. If `reportAnonymousScripts` is set to `true`, anonymous scripts↵will have `__playwright_evaluation_script__` as their URL."}],"required":true,"comment":"Returns coverage is started\n\n**NOTE** Anonymous scripts are ones that don't have an associated url. These are scripts that are dynamically\ncreated on the page using `eval` or `new Function`. If `reportAnonymousScripts` is set to `true`, anonymous scripts\nwill have `__playwright_evaluation_script__` as their URL.","async":true,"alias":"startJSCoverage","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.11","name":"reportAnonymousScripts","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether anonymous scripts generated by the page should be reported. Defaults to `false`."}],"required":false,"comment":"Whether anonymous scripts generated by the page should be reported. Defaults to `false`.","async":false,"alias":"reportAnonymousScripts","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"resetOnNavigation","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to reset coverage on every navigation. Defaults to `true`."}],"required":false,"comment":"Whether to reset coverage on every navigation. Defaults to `true`.","async":false,"alias":"resetOnNavigation","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.11","name":"stopCSSCoverage","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"url","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"StyleSheet URL"}],"required":true,"comment":"StyleSheet URL","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"text","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"StyleSheet content, if available."}],"required":false,"comment":"StyleSheet content, if available.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"ranges","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"start","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"A start offset in text, inclusive"}],"required":true,"comment":"A start offset in text, inclusive","async":false,"alias":"start","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"end","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"An end offset in text, exclusive"}],"required":true,"comment":"An end offset in text, exclusive","async":false,"alias":"end","overloadIndex":0,"paramOrOption":null}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":"StyleSheet ranges that were used. Ranges are sorted and non-overlapping."}],"required":true,"comment":"StyleSheet ranges that were used. Ranges are sorted and non-overlapping.","async":false,"alias":"ranges","overloadIndex":0,"paramOrOption":null}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":"Returns the array of coverage reports for all stylesheets"},{"type":"note","noteType":"note","text":"CSS Coverage doesn't include dynamically injected style tags without sourceURLs."}],"required":true,"comment":"Returns the array of coverage reports for all stylesheets\n\n**NOTE** CSS Coverage doesn't include dynamically injected style tags without sourceURLs.","async":true,"alias":"stopCSSCoverage","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.11","name":"stopJSCoverage","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"url","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Script URL"}],"required":true,"comment":"Script URL","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"scriptId","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Script ID"}],"required":true,"comment":"Script ID","async":false,"alias":"scriptId","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"source","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Script content, if applicable."}],"required":false,"comment":"Script content, if applicable.","async":false,"alias":"source","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"functions","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"functionName","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"functionName","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"isBlockCoverage","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"isBlockCoverage","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"ranges","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"count","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"count","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"startOffset","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"startOffset","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"endOffset","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"endOffset","overloadIndex":0,"paramOrOption":null}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"ranges","overloadIndex":0,"paramOrOption":null}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":"V8-specific coverage format."}],"required":true,"comment":"V8-specific coverage format.","async":false,"alias":"functions","overloadIndex":0,"paramOrOption":null}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":"Returns the array of coverage reports for all scripts"},{"type":"note","noteType":"note","text":"JavaScript Coverage doesn't include anonymous scripts by default. However, scripts with sourceURLs are↵reported."}],"required":true,"comment":"Returns the array of coverage reports for all scripts\n\n**NOTE** JavaScript Coverage doesn't include anonymous scripts by default. However, scripts with sourceURLs are\nreported.","async":true,"alias":"stopJSCoverage","overloadIndex":0,"paramOrOption":null,"args":[]}]},{"name":"Dialog","spec":[{"type":"text","text":"`Dialog` objects are dispatched by page via the [`event: Page.dialog`] event."},{"type":"text","text":"An example of using `Dialog` class:"},{"type":"code","lines":["const { chromium } = require('playwright'); // Or 'firefox' or 'webkit'.","","(async () => {"," const browser = await chromium.launch();"," const page = await browser.newPage();"," page.on('dialog', async dialog => {"," console.log(dialog.message());"," await dialog.dismiss();"," });"," await page.evaluate(() => alert('1'));"," await browser.close();","})();"],"codeLang":"js"},{"type":"code","lines":["import com.microsoft.playwright.*;","","public class Example {"," public static void main(String[] args) {"," try (Playwright playwright = Playwright.create()) {"," BrowserType chromium = playwright.chromium();"," Browser browser = chromium.launch();"," Page page = browser.newPage();"," page.onDialog(dialog -> {"," System.out.println(dialog.message());"," dialog.dismiss();"," });"," page.evaluate(\"alert('1')\");"," browser.close();"," }"," }","}"],"codeLang":"java"},{"type":"code","lines":["import asyncio","from playwright.async_api import async_playwright, Playwright","","async def handle_dialog(dialog):"," print(dialog.message)"," await dialog.dismiss()","","async def run(playwright: Playwright):"," chromium = playwright.chromium"," browser = await chromium.launch()"," page = await browser.new_page()"," page.on(\"dialog\", handle_dialog)"," page.evaluate(\"alert('1')\")"," await browser.close()","","async def main():"," async with async_playwright() as playwright:"," await run(playwright)","asyncio.run(main())"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import sync_playwright, Playwright","","def handle_dialog(dialog):"," print(dialog.message)"," dialog.dismiss()","","def run(playwright: Playwright):"," chromium = playwright.chromium"," browser = chromium.launch()"," page = browser.new_page()"," page.on(\"dialog\", handle_dialog)"," page.evaluate(\"alert('1')\")"," browser.close()","","with sync_playwright() as playwright:"," run(playwright)"],"codeLang":"python sync"},{"type":"code","lines":["using Microsoft.Playwright;","using System.Threading.Tasks;","","class DialogExample","{"," public static async Task Run()"," {"," using var playwright = await Playwright.CreateAsync();"," await using var browser = await playwright.Chromium.LaunchAsync();"," var page = await browser.NewPageAsync();",""," page.Dialog += async (_, dialog) =>"," {"," System.Console.WriteLine(dialog.Message);"," await dialog.DismissAsync();"," };",""," await page.EvaluateAsync(\"alert('1');\");"," }","}"],"codeLang":"csharp"},{"type":"note","noteType":"note","text":"Dialogs are dismissed automatically, unless there is a [`event: Page.dialog`] listener.↵When listener is present, it **must** either [`method: Dialog.accept`] or [`method: Dialog.dismiss`] the dialog - otherwise the page will [freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#never_blocking) waiting for the dialog, and actions like click will never finish."}],"langs":{},"comment":"`Dialog` objects are dispatched by page via the [`event: Page.dialog`] event.\n\nAn example of using `Dialog` class:\n\n```js\nconst { chromium } = require('playwright'); // Or 'firefox' or 'webkit'.\n\n(async () => {\n const browser = await chromium.launch();\n const page = await browser.newPage();\n page.on('dialog', async dialog => {\n console.log(dialog.message());\n await dialog.dismiss();\n });\n await page.evaluate(() => alert('1'));\n await browser.close();\n})();\n```\n\n```java\nimport com.microsoft.playwright.*;\n\npublic class Example {\n public static void main(String[] args) {\n try (Playwright playwright = Playwright.create()) {\n BrowserType chromium = playwright.chromium();\n Browser browser = chromium.launch();\n Page page = browser.newPage();\n page.onDialog(dialog -> {\n System.out.println(dialog.message());\n dialog.dismiss();\n });\n page.evaluate(\"alert('1')\");\n browser.close();\n }\n }\n}\n```\n\n```py\nimport asyncio\nfrom playwright.async_api import async_playwright, Playwright\n\nasync def handle_dialog(dialog):\n print(dialog.message)\n await dialog.dismiss()\n\nasync def run(playwright: Playwright):\n chromium = playwright.chromium\n browser = await chromium.launch()\n page = await browser.new_page()\n page.on(\"dialog\", handle_dialog)\n page.evaluate(\"alert('1')\")\n await browser.close()\n\nasync def main():\n async with async_playwright() as playwright:\n await run(playwright)\nasyncio.run(main())\n```\n\n```py\nfrom playwright.sync_api import sync_playwright, Playwright\n\ndef handle_dialog(dialog):\n print(dialog.message)\n dialog.dismiss()\n\ndef run(playwright: Playwright):\n chromium = playwright.chromium\n browser = chromium.launch()\n page = browser.new_page()\n page.on(\"dialog\", handle_dialog)\n page.evaluate(\"alert('1')\")\n browser.close()\n\nwith sync_playwright() as playwright:\n run(playwright)\n```\n\n```csharp\nusing Microsoft.Playwright;\nusing System.Threading.Tasks;\n\nclass DialogExample\n{\n public static async Task Run()\n {\n using var playwright = await Playwright.CreateAsync();\n await using var browser = await playwright.Chromium.LaunchAsync();\n var page = await browser.NewPageAsync();\n\n page.Dialog += async (_, dialog) =>\n {\n System.Console.WriteLine(dialog.Message);\n await dialog.DismissAsync();\n };\n\n await page.EvaluateAsync(\"alert('1');\");\n }\n}\n```\n\n**NOTE** Dialogs are dismissed automatically, unless there is a [`event: Page.dialog`] listener. When listener is\npresent, it **must** either [`method: Dialog.accept`] or [`method: Dialog.dismiss`] the dialog - otherwise the page\nwill [freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#never_blocking) waiting for the\ndialog, and actions like click will never finish.","since":"v1.8","members":[{"kind":"method","langs":{},"since":"v1.8","name":"accept","type":{"name":"void"},"spec":[{"type":"text","text":"Returns when the dialog has been accepted."}],"required":true,"comment":"Returns when the dialog has been accepted.","async":true,"alias":"accept","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"promptText","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A text to enter in prompt. Does not cause any effects if the dialog's `type` is not prompt. Optional."}],"required":false,"comment":"A text to enter in prompt. Does not cause any effects if the dialog's `type` is not prompt. Optional.","async":false,"alias":"promptText","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"defaultValue","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"If dialog is prompt, returns default prompt value. Otherwise, returns empty string."}],"required":true,"comment":"If dialog is prompt, returns default prompt value. Otherwise, returns empty string.","async":false,"alias":"defaultValue","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"dismiss","type":{"name":"void"},"spec":[{"type":"text","text":"Returns when the dialog has been dismissed."}],"required":true,"comment":"Returns when the dialog has been dismissed.","async":true,"alias":"dismiss","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"message","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A message displayed in the dialog."}],"required":true,"comment":"A message displayed in the dialog.","async":false,"alias":"message","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.34","name":"page","type":{"name":"","union":[{"name":"null"},{"name":"Page"}],"expression":"[null]|[Page]"},"spec":[{"type":"text","text":"The page that initiated this dialog, if available."}],"required":true,"comment":"The page that initiated this dialog, if available.","async":false,"alias":"page","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"type","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Returns dialog's type, can be one of `alert`, `beforeunload`, `confirm` or `prompt`."}],"required":true,"comment":"Returns dialog's type, can be one of `alert`, `beforeunload`, `confirm` or `prompt`.","async":false,"alias":"type","overloadIndex":0,"paramOrOption":null,"args":[]}]},{"name":"Download","spec":[{"type":"text","text":"`Download` objects are dispatched by page via the [`event: Page.download`] event."},{"type":"text","text":"All the downloaded files belonging to the browser context are deleted when the↵browser context is closed."},{"type":"text","text":"Download event is emitted once the download starts. Download path becomes available once download completes."},{"type":"code","lines":["// Start waiting for download before clicking. Note no await.","const downloadPromise = page.waitForEvent('download');","await page.getByText('Download file').click();","const download = await downloadPromise;","","// Wait for the download process to complete and save the downloaded file somewhere.","await download.saveAs('/path/to/save/at/' + download.suggestedFilename());"],"codeLang":"js"},{"type":"code","lines":["// Wait for the download to start","Download download = page.waitForDownload(() -> {"," // Perform the action that initiates download"," page.getByText(\"Download file\").click();","});","","// Wait for the download process to complete and save the downloaded file somewhere","download.saveAs(Paths.get(\"/path/to/save/at/\", download.suggestedFilename()));"],"codeLang":"java"},{"type":"code","lines":["# Start waiting for the download","async with page.expect_download() as download_info:"," # Perform the action that initiates download"," await page.get_by_text(\"Download file\").click()","download = await download_info.value","","# Wait for the download process to complete and save the downloaded file somewhere","await download.save_as(\"/path/to/save/at/\" + download.suggested_filename)"],"codeLang":"python async"},{"type":"code","lines":["# Start waiting for the download","with page.expect_download() as download_info:"," # Perform the action that initiates download"," page.get_by_text(\"Download file\").click()","download = download_info.value","","# Wait for the download process to complete and save the downloaded file somewhere","download.save_as(\"/path/to/save/at/\" + download.suggested_filename)"],"codeLang":"python sync"},{"type":"code","lines":["// Start the task of waiting for the download before clicking","var waitForDownloadTask = page.WaitForDownloadAsync();","await page.GetByText(\"Download file\").ClickAsync();","var download = await waitForDownloadTask;","","// Wait for the download process to complete and save the downloaded file somewhere","await download.SaveAsAsync(\"/path/to/save/at/\" + download.SuggestedFilename);"],"codeLang":"csharp"}],"langs":{},"comment":"`Download` objects are dispatched by page via the [`event: Page.download`] event.\n\nAll the downloaded files belonging to the browser context are deleted when the browser context is closed.\n\nDownload event is emitted once the download starts. Download path becomes available once download completes.\n\n```js\n// Start waiting for download before clicking. Note no await.\nconst downloadPromise = page.waitForEvent('download');\nawait page.getByText('Download file').click();\nconst download = await downloadPromise;\n\n// Wait for the download process to complete and save the downloaded file somewhere.\nawait download.saveAs('/path/to/save/at/' + download.suggestedFilename());\n```\n\n```java\n// Wait for the download to start\nDownload download = page.waitForDownload(() -> {\n // Perform the action that initiates download\n page.getByText(\"Download file\").click();\n});\n\n// Wait for the download process to complete and save the downloaded file somewhere\ndownload.saveAs(Paths.get(\"/path/to/save/at/\", download.suggestedFilename()));\n```\n\n```py\n# Start waiting for the download\nasync with page.expect_download() as download_info:\n # Perform the action that initiates download\n await page.get_by_text(\"Download file\").click()\ndownload = await download_info.value\n\n# Wait for the download process to complete and save the downloaded file somewhere\nawait download.save_as(\"/path/to/save/at/\" + download.suggested_filename)\n```\n\n```py\n# Start waiting for the download\nwith page.expect_download() as download_info:\n # Perform the action that initiates download\n page.get_by_text(\"Download file\").click()\ndownload = download_info.value\n\n# Wait for the download process to complete and save the downloaded file somewhere\ndownload.save_as(\"/path/to/save/at/\" + download.suggested_filename)\n```\n\n```csharp\n// Start the task of waiting for the download before clicking\nvar waitForDownloadTask = page.WaitForDownloadAsync();\nawait page.GetByText(\"Download file\").ClickAsync();\nvar download = await waitForDownloadTask;\n\n// Wait for the download process to complete and save the downloaded file somewhere\nawait download.SaveAsAsync(\"/path/to/save/at/\" + download.SuggestedFilename);\n```\n","since":"v1.8","members":[{"kind":"method","langs":{},"since":"v1.13","name":"cancel","type":{"name":"void"},"spec":[{"type":"text","text":"Cancels a download. Will not fail if the download is already finished or canceled.↵Upon successful cancellations, `download.failure()` would resolve to `'canceled'`."}],"required":true,"comment":"Cancels a download. Will not fail if the download is already finished or canceled. Upon successful cancellations,\n`download.failure()` would resolve to `'canceled'`.","async":true,"alias":"cancel","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"only":["java","js","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"createReadStream","type":{"name":"Readable","expression":"[Readable]"},"spec":[{"type":"text","text":"Returns a readable stream for a successful download, or throws for a failed/canceled download."}],"required":true,"comment":"Returns a readable stream for a successful download, or throws for a failed/canceled download.","async":true,"alias":"createReadStream","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"delete","type":{"name":"void"},"spec":[{"type":"text","text":"Deletes the downloaded file. Will wait for the download to finish if necessary."}],"required":true,"comment":"Deletes the downloaded file. Will wait for the download to finish if necessary.","async":true,"alias":"delete","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"failure","type":{"name":"","union":[{"name":"null"},{"name":"string"}],"expression":"[null]|[string]"},"spec":[{"type":"text","text":"Returns download error if any. Will wait for the download to finish if necessary."}],"required":true,"comment":"Returns download error if any. Will wait for the download to finish if necessary.","async":true,"alias":"failure","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.12","name":"page","type":{"name":"Page","expression":"[Page]"},"spec":[{"type":"text","text":"Get the page that the download belongs to."}],"required":true,"comment":"Get the page that the download belongs to.","async":false,"alias":"page","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Returns path to the downloaded file for a successful download, or throws for a failed/canceled download. The method will wait for the download to finish if necessary. The method throws when connected remotely."},{"type":"text","text":"Note that the download's file name is a random GUID, use [`method: Download.suggestedFilename`]↵to get suggested file name."}],"required":true,"comment":"Returns path to the downloaded file for a successful download, or throws for a failed/canceled download. The method\nwill wait for the download to finish if necessary. The method throws when connected remotely.\n\nNote that the download's file name is a random GUID, use [`method: Download.suggestedFilename`] to get suggested\nfile name.","async":true,"alias":"path","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"saveAs","type":{"name":"void"},"spec":[{"type":"text","text":"Copy the download to a user-specified path. It is safe to call this method while the download↵is still in progress. Will wait for the download to finish if necessary."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await download.saveAs('/path/to/save/at/' + download.suggestedFilename());"],"codeLang":"js"},{"type":"code","lines":["download.saveAs(Paths.get(\"/path/to/save/at/\", download.suggestedFilename()));"],"codeLang":"java"},{"type":"code","lines":["await download.save_as(\"/path/to/save/at/\" + download.suggested_filename)"],"codeLang":"python async"},{"type":"code","lines":["download.save_as(\"/path/to/save/at/\" + download.suggested_filename)"],"codeLang":"python sync"},{"type":"code","lines":["await download.SaveAsAsync(\"/path/to/save/at/\" + download.SuggestedFilename);"],"codeLang":"csharp"}],"required":true,"comment":"Copy the download to a user-specified path. It is safe to call this method while the download is still in progress.\nWill wait for the download to finish if necessary.\n\n**Usage**\n\n```js\nawait download.saveAs('/path/to/save/at/' + download.suggestedFilename());\n```\n\n```java\ndownload.saveAs(Paths.get(\"/path/to/save/at/\", download.suggestedFilename()));\n```\n\n```py\nawait download.save_as(\"/path/to/save/at/\" + download.suggested_filename)\n```\n\n```py\ndownload.save_as(\"/path/to/save/at/\" + download.suggested_filename)\n```\n\n```csharp\nawait download.SaveAsAsync(\"/path/to/save/at/\" + download.SuggestedFilename);\n```\n","async":true,"alias":"saveAs","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path where the download should be copied."}],"required":true,"comment":"Path where the download should be copied.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"suggestedFilename","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Returns suggested filename for this download. It is typically computed by the browser from the↵[`Content-Disposition`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition) response header↵or the `download` attribute. See the spec on [whatwg](https://html.spec.whatwg.org/#downloading-resources). Different↵browsers can use different logic for computing it."}],"required":true,"comment":"Returns suggested filename for this download. It is typically computed by the browser from the\n[`Content-Disposition`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition) response\nheader or the `download` attribute. See the spec on [whatwg](https://html.spec.whatwg.org/#downloading-resources).\nDifferent browsers can use different logic for computing it.","async":false,"alias":"suggestedFilename","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"url","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Returns downloaded url."}],"required":true,"comment":"Returns downloaded url.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null,"args":[]}]},{"name":"Electron","spec":[{"type":"text","text":"Playwright has **experimental** support for Electron automation. You can access electron namespace via:"},{"type":"code","lines":["const { _electron } = require('playwright');"],"codeLang":"js"},{"type":"text","text":"An example of the Electron automation script would be:"},{"type":"code","lines":["const { _electron: electron } = require('playwright');","","(async () => {"," // Launch Electron app."," const electronApp = await electron.launch({ args: ['main.js'] });",""," // Evaluation expression in the Electron context."," const appPath = await electronApp.evaluate(async ({ app }) => {"," // This runs in the main Electron process, parameter here is always"," // the result of the require('electron') in the main app script."," return app.getAppPath();"," });"," console.log(appPath);",""," // Get the first window that the app opens, wait if necessary."," const window = await electronApp.firstWindow();"," // Print the title."," console.log(await window.title());"," // Capture a screenshot."," await window.screenshot({ path: 'intro.png' });"," // Direct Electron console to Node terminal."," window.on('console', console.log);"," // Click button."," await window.click('text=Click me');"," // Exit app."," await electronApp.close();","})();"],"codeLang":"js"},{"type":"text","text":"**Supported Electron versions are:**"},{"type":"li","text":"v12.2.0+","liType":"bullet"},{"type":"li","text":"v13.4.0+","liType":"bullet"},{"type":"li","text":"v14+","liType":"bullet"},{"type":"text","text":"**Known issues:**"},{"type":"text","text":"If you are not able to launch Electron and it will end up in timeouts during launch, try the following:"},{"type":"li","text":"Ensure that `nodeCliInspect` ([FuseV1Options.EnableNodeCliInspectArguments](https://www.electronjs.org/docs/latest/tutorial/fuses#nodecliinspect)) fuse is **not** set to `false`.","liType":"bullet"}],"langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"comment":"Playwright has **experimental** support for Electron automation. You can access electron namespace via:\n\n```js\nconst { _electron } = require('playwright');\n```\n\nAn example of the Electron automation script would be:\n\n```js\nconst { _electron: electron } = require('playwright');\n\n(async () => {\n // Launch Electron app.\n const electronApp = await electron.launch({ args: ['main.js'] });\n\n // Evaluation expression in the Electron context.\n const appPath = await electronApp.evaluate(async ({ app }) => {\n // This runs in the main Electron process, parameter here is always\n // the result of the require('electron') in the main app script.\n return app.getAppPath();\n });\n console.log(appPath);\n\n // Get the first window that the app opens, wait if necessary.\n const window = await electronApp.firstWindow();\n // Print the title.\n console.log(await window.title());\n // Capture a screenshot.\n await window.screenshot({ path: 'intro.png' });\n // Direct Electron console to Node terminal.\n window.on('console', console.log);\n // Click button.\n await window.click('text=Click me');\n // Exit app.\n await electronApp.close();\n})();\n```\n\n**Supported Electron versions are:**\n- v12.2.0+\n- v13.4.0+\n- v14+\n\n**Known issues:**\n\nIf you are not able to launch Electron and it will end up in timeouts during launch, try the following:\n- Ensure that `nodeCliInspect`\n ([FuseV1Options.EnableNodeCliInspectArguments](https://www.electronjs.org/docs/latest/tutorial/fuses#nodecliinspect))\n fuse is **not** set to `false`.","since":"v1.9","members":[{"kind":"method","langs":{},"since":"v1.9","name":"launch","type":{"name":"ElectronApplication","expression":"[ElectronApplication]"},"spec":[{"type":"text","text":"Launches electron application specified with the `executablePath`."}],"required":true,"comment":"Launches electron application specified with the `executablePath`.","async":true,"alias":"launch","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.12","name":"acceptDownloads","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted."}],"required":false,"comment":"Whether to automatically download all the attachments. Defaults to `true` where all the downloads are accepted.","async":false,"alias":"acceptDownloads","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"args","type":{"name":"Array","templates":[{"name":"string"}],"expression":"[Array]<[string]>"},"spec":[{"type":"text","text":"Additional arguments to pass to the application when launching. You typically pass the main↵script name here."}],"required":false,"comment":"Additional arguments to pass to the application when launching. You typically pass the main script name here.","async":false,"alias":"args","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.12","name":"bypassCSP","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Toggles bypassing page's Content-Security-Policy. Defaults to `false`."}],"required":false,"comment":"Toggles bypassing page's Content-Security-Policy. Defaults to `false`.","async":false,"alias":"bypassCSP","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.12","name":"colorScheme","type":{"name":"","union":[{"name":"null"},{"name":"ColorScheme","union":[{"name":"\"light\""},{"name":"\"dark\""},{"name":"\"no-preference\""}]}],"expression":"null|[ColorScheme]<\"light\"|\"dark\"|\"no-preference\">"},"spec":[{"type":"text","text":"Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See↵[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to `'light'`."}],"required":false,"comment":"Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See\n[`method: Page.emulateMedia`] for more details. Passing `null` resets emulation to system defaults. Defaults to\n`'light'`.","async":false,"alias":"colorScheme","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"cwd","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Current working directory to launch application from."}],"required":false,"comment":"Current working directory to launch application from.","async":false,"alias":"cwd","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"env","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"Specifies environment variables that will be visible to Electron. Defaults to `process.env`."}],"required":false,"comment":"Specifies environment variables that will be visible to Electron. Defaults to `process.env`.","async":false,"alias":"env","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"executablePath","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Launches given Electron application. If not specified, launches the default Electron↵executable installed in this package, located at `node_modules/.bin/electron`."}],"required":false,"comment":"Launches given Electron application. If not specified, launches the default Electron executable installed in this\npackage, located at `node_modules/.bin/electron`.","async":false,"alias":"executablePath","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.12","name":"extraHTTPHeaders","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"An object containing additional HTTP headers to be sent with every request. Defaults to none."}],"required":false,"comment":"An object containing additional HTTP headers to be sent with every request. Defaults to none.","async":false,"alias":"extraHTTPHeaders","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.12","name":"geolocation","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"latitude","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Latitude between -90 and 90."}],"required":true,"comment":"Latitude between -90 and 90.","async":false,"alias":"latitude","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"longitude","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Longitude between -180 and 180."}],"required":true,"comment":"Longitude between -180 and 180.","async":false,"alias":"longitude","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"accuracy","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Non-negative accuracy value. Defaults to `0`."}],"required":false,"comment":"Non-negative accuracy value. Defaults to `0`.","async":false,"alias":"accuracy","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[],"required":false,"comment":"","async":false,"alias":"geolocation","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.12","name":"httpCredentials","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"username","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"username","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"password","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"password","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"origin","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Restrain sending http credentials on specific origin (scheme://host:port)."}],"required":false,"comment":"Restrain sending http credentials on specific origin (scheme://host:port).","async":false,"alias":"origin","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"send","type":{"name":"HttpCredentialsSend","union":[{"name":"\"unauthorized\""},{"name":"\"always\""}],"expression":"[HttpCredentialsSend]<\"unauthorized\"|\"always\">"},"spec":[{"type":"text","text":"This option only applies to the requests sent from corresponding `APIRequestContext` and does not affect requests sent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with the each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with `WWW-Authenticate` header is received. Defaults to `'unauthorized'`."}],"required":false,"comment":"This option only applies to the requests sent from corresponding `APIRequestContext` and does not affect requests\nsent from the browser. `'always'` - `Authorization` header with basic authentication credentials will be sent with\nthe each API request. `'unauthorized` - the credentials are only sent when 401 (Unauthorized) response with\n`WWW-Authenticate` header is received. Defaults to `'unauthorized'`.","async":false,"alias":"send","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).↵If no origin is specified, the username and password are sent to any servers upon unauthorized responses."}],"required":false,"comment":"Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no\norigin is specified, the username and password are sent to any servers upon unauthorized responses.","async":false,"alias":"httpCredentials","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.12","name":"ignoreHTTPSErrors","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to ignore HTTPS errors when sending network requests. Defaults to `false`."}],"required":false,"comment":"Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.","async":false,"alias":"ignoreHTTPSErrors","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.12","name":"locale","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language` request header value as well as number and date formatting rules. Defaults to the system default locale. Learn more about emulation in our [emulation guide](../emulation.md#locale--timezone)."}],"required":false,"comment":"Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value,\n`Accept-Language` request header value as well as number and date formatting rules. Defaults to the system default\nlocale. Learn more about emulation in our [emulation guide](../emulation.md#locale--timezone).","async":false,"alias":"locale","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.12","name":"offline","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to emulate network being offline. Defaults to `false`. Learn more about [network emulation](../emulation.md#offline)."}],"required":false,"comment":"Whether to emulate network being offline. Defaults to `false`. Learn more about\n[network emulation](../emulation.md#offline).","async":false,"alias":"offline","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.12","name":"recordHar","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"omitContent","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Optional setting to control whether to omit request content from the HAR. Defaults to↵`false`. Deprecated, use `content` policy instead."}],"required":false,"comment":"Optional setting to control whether to omit request content from the HAR. Defaults to `false`. Deprecated, use\n`content` policy instead.","async":false,"alias":"omitContent","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"content","type":{"name":"HarContentPolicy","union":[{"name":"\"omit\""},{"name":"\"embed\""},{"name":"\"attach\""}],"expression":"[HarContentPolicy]<\"omit\"|\"embed\"|\"attach\">"},"spec":[{"type":"text","text":"Optional setting to control resource content management. If `omit` is specified, content is not persisted. If `attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is specified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output files and to `embed` for all other file extensions."}],"required":false,"comment":"Optional setting to control resource content management. If `omit` is specified, content is not persisted. If\n`attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is\nspecified, content is stored inline the HAR file as per HAR specification. Defaults to `attach` for `.zip` output\nfiles and to `embed` for all other file extensions.","async":false,"alias":"content","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path on the filesystem to write the HAR file to. If the file name ends with `.zip`, `content: 'attach'` is used by default."}],"required":true,"comment":"Path on the filesystem to write the HAR file to. If the file name ends with `.zip`, `content: 'attach'` is used by\ndefault.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mode","type":{"name":"HarMode","union":[{"name":"\"full\""},{"name":"\"minimal\""}],"expression":"[HarMode]<\"full\"|\"minimal\">"},"spec":[{"type":"text","text":"When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`."}],"required":false,"comment":"When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,\ncookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.","async":false,"alias":"mode","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"urlFilter","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"A glob or regex pattern to filter requests that are stored in the HAR. When a `baseURL` via the context options was provided and the passed URL is a path, it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. Defaults to none."}],"required":false,"comment":"A glob or regex pattern to filter requests that are stored in the HAR. When a `baseURL` via the context options was\nprovided and the passed URL is a path, it gets merged via the\n[`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. Defaults to none.","async":false,"alias":"urlFilter","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not↵specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be↵saved."}],"required":false,"comment":"Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file.\nIf not specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be\nsaved.","async":false,"alias":"recordHar","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_omit_content"},"types":{},"overrides":{}},"since":"v1.12","name":"recordHarOmitContent","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Optional setting to control whether to omit request content from the HAR. Defaults to `false`."}],"required":false,"comment":"Optional setting to control whether to omit request content from the HAR. Defaults to `false`.","async":false,"alias":"recordHarOmitContent","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_path"},"types":{},"overrides":{}},"since":"v1.12","name":"recordHarPath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the↵specified HAR file on the filesystem. If not specified, the HAR is not recorded. Make sure to↵call [`method: BrowserContext.close`] for the HAR to be saved."}],"required":false,"comment":"Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into the specified HAR file\non the filesystem. If not specified, the HAR is not recorded. Make sure to call [`method: BrowserContext.close`]\nfor the HAR to be saved.","async":false,"alias":"recordHarPath","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.12","name":"recordVideo","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"dir","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the directory to put videos into."}],"required":true,"comment":"Path to the directory to put videos into.","async":false,"alias":"dir","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"size","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame width."}],"required":true,"comment":"Video frame width.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame height."}],"required":true,"comment":"Video frame height.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport`↵scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450.↵Actual picture of each page will be scaled down if necessary to fit the specified size."}],"required":false,"comment":"Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to\nfit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of\neach page will be scaled down if necessary to fit the specified size.","async":false,"alias":"size","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make↵sure to await [`method: BrowserContext.close`] for videos to be saved."}],"required":false,"comment":"Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded.\nMake sure to await [`method: BrowserContext.close`] for videos to be saved.","async":false,"alias":"recordVideo","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_video_dir"},"types":{},"overrides":{}},"since":"v1.12","name":"recordVideoDir","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Enables video recording for all pages into the specified directory. If not specified videos are↵not recorded. Make sure to call [`method: BrowserContext.close`] for videos to be saved."}],"required":false,"comment":"Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make\nsure to call [`method: BrowserContext.close`] for videos to be saved.","async":false,"alias":"recordVideoDir","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_video_size"},"types":{},"overrides":{}},"since":"v1.12","name":"recordVideoSize","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame width."}],"required":true,"comment":"Video frame width.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame height."}],"required":true,"comment":"Video frame height.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Dimensions of the recorded videos. If not specified the size will be equal to `viewport`↵scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450.↵Actual picture of each page will be scaled down if necessary to fit the specified size."}],"required":false,"comment":"Dimensions of the recorded videos. If not specified the size will be equal to `viewport` scaled down to fit into\n800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page\nwill be scaled down if necessary to fit the specified size.","async":false,"alias":"recordVideoSize","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.15","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds to wait for the application to start. Defaults to `30000` (30 seconds). Pass `0` to disable timeout."}],"required":false,"comment":"Maximum time in milliseconds to wait for the application to start. Defaults to `30000` (30 seconds). Pass `0` to\ndisable timeout.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.12","name":"timezoneId","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Changes the timezone of the context. See [ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)↵for a list of supported timezone IDs. Defaults to the system timezone."}],"required":false,"comment":"Changes the timezone of the context. See\n[ICU's metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1)\nfor a list of supported timezone IDs. Defaults to the system timezone.","async":false,"alias":"timezoneId","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.36","name":"tracesDir","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"If specified, traces are saved into this directory."}],"required":false,"comment":"If specified, traces are saved into this directory.","async":false,"alias":"tracesDir","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]}]},{"name":"ElectronApplication","spec":[{"type":"text","text":"Electron application representation. You can use [`method: Electron.launch`] to↵obtain the application instance. This instance you can control main electron process↵as well as work with Electron windows:"},{"type":"code","lines":["const { _electron: electron } = require('playwright');","","(async () => {"," // Launch Electron app."," const electronApp = await electron.launch({ args: ['main.js'] });",""," // Evaluation expression in the Electron context."," const appPath = await electronApp.evaluate(async ({ app }) => {"," // This runs in the main Electron process, parameter here is always"," // the result of the require('electron') in the main app script."," return app.getAppPath();"," });"," console.log(appPath);",""," // Get the first window that the app opens, wait if necessary."," const window = await electronApp.firstWindow();"," // Print the title."," console.log(await window.title());"," // Capture a screenshot."," await window.screenshot({ path: 'intro.png' });"," // Direct Electron console to Node terminal."," window.on('console', console.log);"," // Click button."," await window.click('text=Click me');"," // Exit app."," await electronApp.close();","})();"],"codeLang":"js"}],"langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"comment":"Electron application representation. You can use [`method: Electron.launch`] to obtain the application instance.\nThis instance you can control main electron process as well as work with Electron windows:\n\n```js\nconst { _electron: electron } = require('playwright');\n\n(async () => {\n // Launch Electron app.\n const electronApp = await electron.launch({ args: ['main.js'] });\n\n // Evaluation expression in the Electron context.\n const appPath = await electronApp.evaluate(async ({ app }) => {\n // This runs in the main Electron process, parameter here is always\n // the result of the require('electron') in the main app script.\n return app.getAppPath();\n });\n console.log(appPath);\n\n // Get the first window that the app opens, wait if necessary.\n const window = await electronApp.firstWindow();\n // Print the title.\n console.log(await window.title());\n // Capture a screenshot.\n await window.screenshot({ path: 'intro.png' });\n // Direct Electron console to Node terminal.\n window.on('console', console.log);\n // Click button.\n await window.click('text=Click me');\n // Exit app.\n await electronApp.close();\n})();\n```\n","since":"v1.9","members":[{"kind":"event","langs":{},"since":"v1.9","name":"close","type":{"name":"void"},"spec":[{"type":"text","text":"This event is issued when the application process has been terminated."}],"required":true,"comment":"This event is issued when the application process has been terminated.","async":false,"alias":"close","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.42","name":"console","type":{"name":"ConsoleMessage","expression":"[ConsoleMessage]"},"spec":[{"type":"text","text":"Emitted when JavaScript within the Electron main process calls one of console API methods, e.g. `console.log` or `console.dir`."},{"type":"text","text":"The arguments passed into `console.log` are available on the `ConsoleMessage` event handler argument."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["electronApp.on('console', async msg => {"," const values = [];"," for (const arg of msg.args())"," values.push(await arg.jsonValue());"," console.log(...values);","});","await electronApp.evaluate(() => console.log('hello', 5, { foo: 'bar' }));"],"codeLang":"js"}],"required":true,"comment":"Emitted when JavaScript within the Electron main process calls one of console API methods, e.g. `console.log` or\n`console.dir`.\n\nThe arguments passed into `console.log` are available on the `ConsoleMessage` event handler argument.\n\n**Usage**\n\n```js\nelectronApp.on('console', async msg => {\n const values = [];\n for (const arg of msg.args())\n values.push(await arg.jsonValue());\n console.log(...values);\n});\nawait electronApp.evaluate(() => console.log('hello', 5, { foo: 'bar' }));\n```\n","async":false,"alias":"console","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.9","name":"window","type":{"name":"Page","expression":"[Page]"},"spec":[{"type":"text","text":"This event is issued for every window that is created **and loaded** in Electron. It contains a `Page` that can↵be used for Playwright automation."}],"required":true,"comment":"This event is issued for every window that is created **and loaded** in Electron. It contains a `Page` that can be\nused for Playwright automation.","async":false,"alias":"window","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.11","name":"browserWindow","type":{"name":"JSHandle","expression":"[JSHandle]"},"spec":[{"type":"text","text":"Returns the BrowserWindow object that corresponds to the given Playwright page."}],"required":true,"comment":"Returns the BrowserWindow object that corresponds to the given Playwright page.","async":true,"alias":"browserWindow","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.11","name":"page","type":{"name":"Page","expression":"[Page]"},"spec":[{"type":"text","text":"Page to retrieve the window for."}],"required":true,"comment":"Page to retrieve the window for.","async":false,"alias":"page","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"close","type":{"name":"void"},"spec":[{"type":"text","text":"Closes Electron application."}],"required":true,"comment":"Closes Electron application.","async":true,"alias":"close","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.9","name":"context","type":{"name":"BrowserContext","expression":"[BrowserContext]"},"spec":[{"type":"text","text":"This method returns browser context that can be used for setting up context-wide routing, etc."}],"required":true,"comment":"This method returns browser context that can be used for setting up context-wide routing, etc.","async":false,"alias":"context","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.9","name":"evaluate","type":{"name":"Serializable","expression":"[Serializable]"},"spec":[{"type":"text","text":"Returns the return value of `expression`."},{"type":"text","text":"If the function passed to the [`method: ElectronApplication.evaluate`] returns a [Promise], then↵[`method: ElectronApplication.evaluate`] would wait for the promise to resolve and return its value."},{"type":"text","text":"If the function passed to the [`method: ElectronApplication.evaluate`] returns a non-[Serializable] value, then↵[`method: ElectronApplication.evaluate`] returns `undefined`. Playwright also supports transferring↵some additional values that are not serializable by `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`."}],"required":true,"comment":"Returns the return value of `expression`.\n\nIf the function passed to the [`method: ElectronApplication.evaluate`] returns a [Promise], then\n[`method: ElectronApplication.evaluate`] would wait for the promise to resolve and return its value.\n\nIf the function passed to the [`method: ElectronApplication.evaluate`] returns a non-[Serializable] value, then\n[`method: ElectronApplication.evaluate`] returns `undefined`. Playwright also supports transferring some additional\nvalues that are not serializable by `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`.","async":true,"alias":"evaluate","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"overrides":{"js":{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"expression","type":{"name":"","union":[{"name":"function"},{"name":"Electron"}],"expression":"[function]|[Electron]"},"spec":[{"type":"text","text":"Function to be evaluated in the main Electron process."}],"argsArray":[],"required":true,"comment":"Function to be evaluated in the main Electron process.","args":{},"clazz":null,"async":false,"alias":"pageFunction","overloadIndex":0,"paramOrOption":null}}},"since":"v1.9","name":"expression","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"JavaScript expression to be evaluated in the browser context. If the expression evaluates↵to a function, the function is automatically invoked."}],"required":true,"comment":"JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the\nfunction is automatically invoked.","async":false,"alias":"expression","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"arg","type":{"name":"EvaluationArgument","expression":"[EvaluationArgument]"},"spec":[{"type":"text","text":"Optional argument to pass to `expression`."}],"required":false,"comment":"Optional argument to pass to `expression`.","async":false,"alias":"arg","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"evaluateHandle","type":{"name":"JSHandle","expression":"[JSHandle]"},"spec":[{"type":"text","text":"Returns the return value of `expression` as a `JSHandle`."},{"type":"text","text":"The only difference between [`method: ElectronApplication.evaluate`] and [`method: ElectronApplication.evaluateHandle`] is that [`method: ElectronApplication.evaluateHandle`] returns `JSHandle`."},{"type":"text","text":"If the function passed to the [`method: ElectronApplication.evaluateHandle`] returns a [Promise], then↵[`method: ElectronApplication.evaluateHandle`] would wait for the promise to resolve and return its value."}],"required":true,"comment":"Returns the return value of `expression` as a `JSHandle`.\n\nThe only difference between [`method: ElectronApplication.evaluate`] and\n[`method: ElectronApplication.evaluateHandle`] is that [`method: ElectronApplication.evaluateHandle`] returns\n`JSHandle`.\n\nIf the function passed to the [`method: ElectronApplication.evaluateHandle`] returns a [Promise], then\n[`method: ElectronApplication.evaluateHandle`] would wait for the promise to resolve and return its value.","async":true,"alias":"evaluateHandle","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"overrides":{"js":{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"expression","type":{"name":"","union":[{"name":"function"},{"name":"Electron"}],"expression":"[function]|[Electron]"},"spec":[{"type":"text","text":"Function to be evaluated in the main Electron process."}],"argsArray":[],"required":true,"comment":"Function to be evaluated in the main Electron process.","args":{},"clazz":null,"async":false,"alias":"pageFunction","overloadIndex":0,"paramOrOption":null}}},"since":"v1.9","name":"expression","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"JavaScript expression to be evaluated in the browser context. If the expression evaluates↵to a function, the function is automatically invoked."}],"required":true,"comment":"JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the\nfunction is automatically invoked.","async":false,"alias":"expression","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"arg","type":{"name":"EvaluationArgument","expression":"[EvaluationArgument]"},"spec":[{"type":"text","text":"Optional argument to pass to `expression`."}],"required":false,"comment":"Optional argument to pass to `expression`.","async":false,"alias":"arg","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"firstWindow","type":{"name":"Page","expression":"[Page]"},"spec":[{"type":"text","text":"Convenience method that waits for the first application window to be opened."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const electronApp = await electron.launch({"," args: ['main.js']","});","const window = await electronApp.firstWindow();","// ..."],"codeLang":"js"}],"required":true,"comment":"Convenience method that waits for the first application window to be opened.\n\n**Usage**\n\n```js\nconst electronApp = await electron.launch({\n args: ['main.js']\n});\nconst window = await electronApp.firstWindow();\n// ...\n```\n","async":true,"alias":"firstWindow","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.33","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds).↵Pass `0` to disable timeout. The default value can be changed by using the↵[`method: BrowserContext.setDefaultTimeout`]."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.21","name":"process","type":{"name":"ChildProcess","expression":"[ChildProcess]"},"spec":[{"type":"text","text":"Returns the main process for this Electron Application."}],"required":true,"comment":"Returns the main process for this Electron Application.","async":false,"alias":"process","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.9","name":"waitForEvent","type":{"name":"any","expression":"[any]"},"spec":[{"type":"text","text":"Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy value. Will throw an error if the application is closed before the event is fired. Returns the event data value."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const windowPromise = electronApp.waitForEvent('window');","await mainWindow.click('button');","const window = await windowPromise;"],"codeLang":"js"}],"required":true,"comment":"Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy\nvalue. Will throw an error if the application is closed before the event is fired. Returns the event data value.\n\n**Usage**\n\n```js\nconst windowPromise = electronApp.waitForEvent('window');\nawait mainWindow.click('button');\nconst window = await windowPromise;\n```\n","async":true,"alias":"waitForEvent","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["js","python","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"event","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Event name, same one typically passed into `*.on(event)`."}],"required":true,"comment":"Event name, same one typically passed into `*.on(event)`.","async":false,"alias":"event","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"optionsOrPredicate","type":{"name":"","union":[{"name":"function"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"predicate","type":{"name":"function","expression":"[function]"},"spec":[{"type":"text","text":"receives the event data and resolves to truthy value when the waiting should resolve."}],"required":true,"comment":"receives the event data and resolves to truthy value when the waiting should resolve.","async":false,"alias":"predicate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to↵disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`]."}],"required":false,"comment":"maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]}],"expression":"[function]|[Object]"},"spec":[{"type":"text","text":"Either a predicate that receives an event or an options object. Optional."}],"required":false,"comment":"Either a predicate that receives an event or an options object. Optional.","async":false,"alias":"optionsOrPredicate","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"windows","type":{"name":"Array","templates":[{"name":"Page"}],"expression":"[Array]<[Page]>"},"spec":[{"type":"text","text":"Convenience method that returns all the opened windows."}],"required":true,"comment":"Convenience method that returns all the opened windows.","async":false,"alias":"windows","overloadIndex":0,"paramOrOption":null,"args":[]}]},{"name":"ElementHandle","spec":[{"type":"li","text":"extends: `JSHandle`","liType":"bullet"},{"type":"text","text":"ElementHandle represents an in-page DOM element. ElementHandles can be created with the [`method: Page.querySelector`] method."},{"type":"note","noteType":"warning[Discouraged]","text":"The use of ElementHandle is discouraged, use `Locator` objects and web-first assertions instead."},{"type":"code","lines":["const hrefElement = await page.$('a');","await hrefElement.click();"],"codeLang":"js"},{"type":"code","lines":["ElementHandle hrefElement = page.querySelector(\"a\");","hrefElement.click();"],"codeLang":"java"},{"type":"code","lines":["href_element = await page.query_selector(\"a\")","await href_element.click()"],"codeLang":"python async"},{"type":"code","lines":["href_element = page.query_selector(\"a\")","href_element.click()"],"codeLang":"python sync"},{"type":"code","lines":["var handle = await page.QuerySelectorAsync(\"a\");","await handle.ClickAsync();"],"codeLang":"csharp"},{"type":"text","text":"ElementHandle prevents DOM element from garbage collection unless the handle is disposed with↵[`method: JSHandle.dispose`]. ElementHandles are auto-disposed when their origin frame gets navigated."},{"type":"text","text":"ElementHandle instances can be used as an argument in [`method: Page.evalOnSelector`] and [`method: Page.evaluate`] methods."},{"type":"text","text":"The difference between the `Locator` and ElementHandle is that the ElementHandle points to a particular element, while `Locator` captures the logic of how to retrieve an element."},{"type":"text","text":"In the example below, handle points to a particular DOM element on page. If that element changes text or is used by React to render an entirely different component, handle is still pointing to that very DOM element. This can lead to unexpected behaviors."},{"type":"code","lines":["const handle = await page.$('text=Submit');","// ...","await handle.hover();","await handle.click();"],"codeLang":"js"},{"type":"code","lines":["ElementHandle handle = page.querySelector(\"text=Submit\");","handle.hover();","handle.click();"],"codeLang":"java"},{"type":"code","lines":["handle = await page.query_selector(\"text=Submit\")","await handle.hover()","await handle.click()"],"codeLang":"python async"},{"type":"code","lines":["handle = page.query_selector(\"text=Submit\")","handle.hover()","handle.click()"],"codeLang":"python sync"},{"type":"code","lines":["var handle = await page.QuerySelectorAsync(\"text=Submit\");","await handle.HoverAsync();","await handle.ClickAsync();"],"codeLang":"csharp"},{"type":"text","text":"With the locator, every time the `element` is used, up-to-date DOM element is located in the page using the selector. So in the snippet below, underlying DOM element is going to be located twice."},{"type":"code","lines":["const locator = page.getByText('Submit');","// ...","await locator.hover();","await locator.click();"],"codeLang":"js"},{"type":"code","lines":["Locator locator = page.getByText(\"Submit\");","locator.hover();","locator.click();"],"codeLang":"java"},{"type":"code","lines":["locator = page.get_by_text(\"Submit\")","await locator.hover()","await locator.click()"],"codeLang":"python async"},{"type":"code","lines":["locator = page.get_by_text(\"Submit\")","locator.hover()","locator.click()"],"codeLang":"python sync"},{"type":"code","lines":["var locator = page.GetByText(\"Submit\");","await locator.HoverAsync();","await locator.ClickAsync();"],"codeLang":"csharp"}],"extends":"JSHandle","langs":{},"comment":"- extends: `JSHandle`\n\nElementHandle represents an in-page DOM element. ElementHandles can be created with the\n[`method: Page.querySelector`] method.\n\n**NOTE** The use of ElementHandle is discouraged, use `Locator` objects and web-first assertions instead.\n\n```js\nconst hrefElement = await page.$('a');\nawait hrefElement.click();\n```\n\n```java\nElementHandle hrefElement = page.querySelector(\"a\");\nhrefElement.click();\n```\n\n```py\nhref_element = await page.query_selector(\"a\")\nawait href_element.click()\n```\n\n```py\nhref_element = page.query_selector(\"a\")\nhref_element.click()\n```\n\n```csharp\nvar handle = await page.QuerySelectorAsync(\"a\");\nawait handle.ClickAsync();\n```\n\nElementHandle prevents DOM element from garbage collection unless the handle is disposed with\n[`method: JSHandle.dispose`]. ElementHandles are auto-disposed when their origin frame gets navigated.\n\nElementHandle instances can be used as an argument in [`method: Page.evalOnSelector`] and [`method: Page.evaluate`]\nmethods.\n\nThe difference between the `Locator` and ElementHandle is that the ElementHandle points to a particular element,\nwhile `Locator` captures the logic of how to retrieve an element.\n\nIn the example below, handle points to a particular DOM element on page. If that element changes text or is used by\nReact to render an entirely different component, handle is still pointing to that very DOM element. This can lead\nto unexpected behaviors.\n\n```js\nconst handle = await page.$('text=Submit');\n// ...\nawait handle.hover();\nawait handle.click();\n```\n\n```java\nElementHandle handle = page.querySelector(\"text=Submit\");\nhandle.hover();\nhandle.click();\n```\n\n```py\nhandle = await page.query_selector(\"text=Submit\")\nawait handle.hover()\nawait handle.click()\n```\n\n```py\nhandle = page.query_selector(\"text=Submit\")\nhandle.hover()\nhandle.click()\n```\n\n```csharp\nvar handle = await page.QuerySelectorAsync(\"text=Submit\");\nawait handle.HoverAsync();\nawait handle.ClickAsync();\n```\n\nWith the locator, every time the `element` is used, up-to-date DOM element is located in the page using the\nselector. So in the snippet below, underlying DOM element is going to be located twice.\n\n```js\nconst locator = page.getByText('Submit');\n// ...\nawait locator.hover();\nawait locator.click();\n```\n\n```java\nLocator locator = page.getByText(\"Submit\");\nlocator.hover();\nlocator.click();\n```\n\n```py\nlocator = page.get_by_text(\"Submit\")\nawait locator.hover()\nawait locator.click()\n```\n\n```py\nlocator = page.get_by_text(\"Submit\")\nlocator.hover()\nlocator.click()\n```\n\n```csharp\nvar locator = page.GetByText(\"Submit\");\nawait locator.HoverAsync();\nawait locator.ClickAsync();\n```\n","since":"v1.8","members":[{"kind":"method","langs":{},"since":"v1.8","name":"boundingBox","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"the x coordinate of the element in pixels."}],"required":true,"comment":"the x coordinate of the element in pixels.","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"the y coordinate of the element in pixels."}],"required":true,"comment":"the y coordinate of the element in pixels.","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"the width of the element in pixels."}],"required":true,"comment":"the width of the element in pixels.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"the height of the element in pixels."}],"required":true,"comment":"the height of the element in pixels.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}]}],"expression":"[null]|[Object]"},"spec":[{"type":"text","text":"This method returns the bounding box of the element, or `null` if the element is not visible. The bounding box is↵calculated relative to the main frame viewport - which is usually the same as the browser window."},{"type":"text","text":"Scrolling affects the returned bounding box, similarly to↵[Element.getBoundingClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect). That↵means `x` and/or `y` may be negative."},{"type":"text","text":"Elements from child frames return the bounding box relative to the main frame, unlike the↵[Element.getBoundingClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect)."},{"type":"text","text":"Assuming the page is static, it is safe to use bounding box coordinates to perform input. For example, the following↵snippet should click the center of the element."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const box = await elementHandle.boundingBox();","await page.mouse.click(box.x + box.width / 2, box.y + box.height / 2);"],"codeLang":"js"},{"type":"code","lines":["BoundingBox box = elementHandle.boundingBox();","page.mouse().click(box.x + box.width / 2, box.y + box.height / 2);"],"codeLang":"java"},{"type":"code","lines":["box = await element_handle.bounding_box()","await page.mouse.click(box[\"x\"] + box[\"width\"] / 2, box[\"y\"] + box[\"height\"] / 2)"],"codeLang":"python async"},{"type":"code","lines":["box = element_handle.bounding_box()","page.mouse.click(box[\"x\"] + box[\"width\"] / 2, box[\"y\"] + box[\"height\"] / 2)"],"codeLang":"python sync"},{"type":"code","lines":["var box = await elementHandle.BoundingBoxAsync();","await page.Mouse.ClickAsync(box.X + box.Width / 2, box.Y + box.Height / 2);"],"codeLang":"csharp"}],"required":true,"comment":"This method returns the bounding box of the element, or `null` if the element is not visible. The bounding box is\ncalculated relative to the main frame viewport - which is usually the same as the browser window.\n\nScrolling affects the returned bounding box, similarly to\n[Element.getBoundingClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).\nThat means `x` and/or `y` may be negative.\n\nElements from child frames return the bounding box relative to the main frame, unlike the\n[Element.getBoundingClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).\n\nAssuming the page is static, it is safe to use bounding box coordinates to perform input. For example, the\nfollowing snippet should click the center of the element.\n\n**Usage**\n\n```js\nconst box = await elementHandle.boundingBox();\nawait page.mouse.click(box.x + box.width / 2, box.y + box.height / 2);\n```\n\n```java\nBoundingBox box = elementHandle.boundingBox();\npage.mouse().click(box.x + box.width / 2, box.y + box.height / 2);\n```\n\n```py\nbox = await element_handle.bounding_box()\nawait page.mouse.click(box[\"x\"] + box[\"width\"] / 2, box[\"y\"] + box[\"height\"] / 2)\n```\n\n```py\nbox = element_handle.bounding_box()\npage.mouse.click(box[\"x\"] + box[\"width\"] / 2, box[\"y\"] + box[\"height\"] / 2)\n```\n\n```csharp\nvar box = await elementHandle.BoundingBoxAsync();\nawait page.Mouse.ClickAsync(box.X + box.Width / 2, box.Y + box.Height / 2);\n```\n","async":true,"alias":"boundingBox","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.check`] instead. Read more about [locators](../locators.md).","name":"check","type":{"name":"void"},"spec":[{"type":"text","text":"This method checks the element by performing the following steps:"},{"type":"li","text":"Ensure that element is a checkbox or a radio input. If not, this method throws. If the element is already↵checked, this method returns immediately.","liType":"ordinal"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.mouse`] to click in the center of the element.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.","liType":"ordinal"},{"type":"li","text":"Ensure that the element is now checked. If not, this method throws.","liType":"ordinal"},{"type":"text","text":"If the element is detached from the DOM at any moment during the action, this method throws."},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."}],"required":true,"comment":"This method checks the element by performing the following steps:\n1. Ensure that element is a checkbox or a radio input. If not, this method throws. If the element is already\n checked, this method returns immediately.\n1. Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.mouse`] to click in the center of the element.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n1. Ensure that the element is now checked. If not, this method throws.\n\nIf the element is detached from the DOM at any moment during the action, this method throws.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.","async":true,"alias":"check","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.click`] instead. Read more about [locators](../locators.md).","name":"click","type":{"name":"void"},"spec":[{"type":"text","text":"This method clicks the element by performing the following steps:"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.mouse`] to click in the center of the element, or the specified `position`.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.","liType":"ordinal"},{"type":"text","text":"If the element is detached from the DOM at any moment during the action, this method throws."},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."}],"required":true,"comment":"This method clicks the element by performing the following steps:\n1. Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.mouse`] to click in the center of the element, or the specified `position`.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n\nIf the element is detached from the DOM at any moment during the action, this method throws.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.","async":true,"alias":"click","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"button","type":{"name":"MouseButton","union":[{"name":"\"left\""},{"name":"\"right\""},{"name":"\"middle\""}],"expression":"[MouseButton]<\"left\"|\"right\"|\"middle\">"},"spec":[{"type":"text","text":"Defaults to `left`."}],"required":false,"comment":"Defaults to `left`.","async":false,"alias":"button","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"clickCount","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"defaults to 1. See [UIEvent.detail]."}],"required":false,"comment":"defaults to 1. See [UIEvent.detail].","async":false,"alias":"clickCount","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"delay","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0."}],"required":false,"comment":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.","async":false,"alias":"delay","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"modifiers","type":{"name":"Array","templates":[{"name":"KeyboardModifier","union":[{"name":"\"Alt\""},{"name":"\"Control\""},{"name":"\"ControlOrMeta\""},{"name":"\"Meta\""},{"name":"\"Shift\""}]}],"expression":"[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"ControlOrMeta\"|\"Meta\"|\"Shift\">>"},"spec":[{"type":"text","text":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current↵modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to \"Control\" on Windows↵and Linux and to \"Meta\" on macOS."}],"required":false,"comment":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores\ncurrent modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to\n\"Control\" on Windows and Linux and to \"Meta\" on macOS.","async":false,"alias":"modifiers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"contentFrame","type":{"name":"","union":[{"name":"null"},{"name":"Frame"}],"expression":"[null]|[Frame]"},"spec":[{"type":"text","text":"Returns the content frame for element handles referencing iframe nodes, or `null` otherwise"}],"required":true,"comment":"Returns the content frame for element handles referencing iframe nodes, or `null` otherwise","async":true,"alias":"contentFrame","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"aliases":{"csharp":"DblClickAsync"},"types":{},"overrides":{}},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.dblclick`] instead. Read more about [locators](../locators.md).","name":"dblclick","type":{"name":"void"},"spec":[{"type":"text","text":"This method double clicks the element by performing the following steps:"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.mouse`] to double click in the center of the element, or the specified `position`.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that↵if the first click of the `dblclick()` triggers a navigation event, this method will throw.","liType":"ordinal"},{"type":"text","text":"If the element is detached from the DOM at any moment during the action, this method throws."},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."},{"type":"note","noteType":"note","text":"`elementHandle.dblclick()` dispatches two `click` events and a single `dblclick` event."}],"required":true,"comment":"This method double clicks the element by performing the following steps:\n1. Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.mouse`] to double click in the center of the element, or the specified `position`.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that if\n the first click of the `dblclick()` triggers a navigation event, this method will throw.\n\nIf the element is detached from the DOM at any moment during the action, this method throws.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.\n\n**NOTE** `elementHandle.dblclick()` dispatches two `click` events and a single `dblclick` event.","async":true,"alias":"dblclick","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"button","type":{"name":"MouseButton","union":[{"name":"\"left\""},{"name":"\"right\""},{"name":"\"middle\""}],"expression":"[MouseButton]<\"left\"|\"right\"|\"middle\">"},"spec":[{"type":"text","text":"Defaults to `left`."}],"required":false,"comment":"Defaults to `left`.","async":false,"alias":"button","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"delay","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0."}],"required":false,"comment":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.","async":false,"alias":"delay","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"modifiers","type":{"name":"Array","templates":[{"name":"KeyboardModifier","union":[{"name":"\"Alt\""},{"name":"\"Control\""},{"name":"\"ControlOrMeta\""},{"name":"\"Meta\""},{"name":"\"Shift\""}]}],"expression":"[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"ControlOrMeta\"|\"Meta\"|\"Shift\">>"},"spec":[{"type":"text","text":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current↵modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to \"Control\" on Windows↵and Linux and to \"Meta\" on macOS."}],"required":false,"comment":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores\ncurrent modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to\n\"Control\" on Windows and Linux and to \"Meta\" on macOS.","async":false,"alias":"modifiers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.dispatchEvent`] instead. Read more about [locators](../locators.md).","name":"dispatchEvent","type":{"name":"void"},"spec":[{"type":"text","text":"The snippet below dispatches the `click` event on the element. Regardless of the visibility state of the element, `click`↵is dispatched. This is equivalent to calling↵[element.click()](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/click)."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await elementHandle.dispatchEvent('click');"],"codeLang":"js"},{"type":"code","lines":["elementHandle.dispatchEvent(\"click\");"],"codeLang":"java"},{"type":"code","lines":["await element_handle.dispatch_event(\"click\")"],"codeLang":"python async"},{"type":"code","lines":["element_handle.dispatch_event(\"click\")"],"codeLang":"python sync"},{"type":"code","lines":["await elementHandle.DispatchEventAsync(\"click\");"],"codeLang":"csharp"},{"type":"text","text":"Under the hood, it creates an instance of an event based on the given `type`, initializes it with↵`eventInit` properties and dispatches it on the element. Events are `composed`, `cancelable` and bubble by↵default."},{"type":"text","text":"Since `eventInit` is event-specific, please refer to the events documentation for the lists of initial↵properties:"},{"type":"li","text":"[DeviceMotionEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceMotionEvent/DeviceMotionEvent)","liType":"bullet"},{"type":"li","text":"[DeviceOrientationEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceOrientationEvent/DeviceOrientationEvent)","liType":"bullet"},{"type":"li","text":"[DragEvent](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent/DragEvent)","liType":"bullet"},{"type":"li","text":"[Event](https://developer.mozilla.org/en-US/docs/Web/API/Event/Event)","liType":"bullet"},{"type":"li","text":"[FocusEvent](https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent/FocusEvent)","liType":"bullet"},{"type":"li","text":"[KeyboardEvent](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/KeyboardEvent)","liType":"bullet"},{"type":"li","text":"[MouseEvent](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/MouseEvent)","liType":"bullet"},{"type":"li","text":"[PointerEvent](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/PointerEvent)","liType":"bullet"},{"type":"li","text":"[TouchEvent](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/TouchEvent)","liType":"bullet"},{"type":"li","text":"[WheelEvent](https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent/WheelEvent)","liType":"bullet"},{"type":"text","text":"You can also specify `JSHandle` as the property value if you want live objects to be passed into the event:"},{"type":"code","lines":["// Note you can only create DataTransfer in Chromium and Firefox","const dataTransfer = await page.evaluateHandle(() => new DataTransfer());","await elementHandle.dispatchEvent('dragstart', { dataTransfer });"],"codeLang":"js"},{"type":"code","lines":["// Note you can only create DataTransfer in Chromium and Firefox","JSHandle dataTransfer = page.evaluateHandle(\"() => new DataTransfer()\");","Map<String, Object> arg = new HashMap<>();","arg.put(\"dataTransfer\", dataTransfer);","elementHandle.dispatchEvent(\"dragstart\", arg);"],"codeLang":"java"},{"type":"code","lines":["# note you can only create data_transfer in chromium and firefox","data_transfer = await page.evaluate_handle(\"new DataTransfer()\")","await element_handle.dispatch_event(\"#source\", \"dragstart\", {\"dataTransfer\": data_transfer})"],"codeLang":"python async"},{"type":"code","lines":["# note you can only create data_transfer in chromium and firefox","data_transfer = page.evaluate_handle(\"new DataTransfer()\")","element_handle.dispatch_event(\"#source\", \"dragstart\", {\"dataTransfer\": data_transfer})"],"codeLang":"python sync"},{"type":"code","lines":["var dataTransfer = await page.EvaluateHandleAsync(\"() => new DataTransfer()\");","await elementHandle.DispatchEventAsync(\"dragstart\", new Dictionary<string, object>","{"," { \"dataTransfer\", dataTransfer }","});"],"codeLang":"csharp"}],"required":true,"comment":"The snippet below dispatches the `click` event on the element. Regardless of the visibility state of the element,\n`click` is dispatched. This is equivalent to calling\n[element.click()](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/click).\n\n**Usage**\n\n```js\nawait elementHandle.dispatchEvent('click');\n```\n\n```java\nelementHandle.dispatchEvent(\"click\");\n```\n\n```py\nawait element_handle.dispatch_event(\"click\")\n```\n\n```py\nelement_handle.dispatch_event(\"click\")\n```\n\n```csharp\nawait elementHandle.DispatchEventAsync(\"click\");\n```\n\nUnder the hood, it creates an instance of an event based on the given `type`, initializes it with `eventInit`\nproperties and dispatches it on the element. Events are `composed`, `cancelable` and bubble by default.\n\nSince `eventInit` is event-specific, please refer to the events documentation for the lists of initial properties:\n- [DeviceMotionEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceMotionEvent/DeviceMotionEvent)\n- [DeviceOrientationEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceOrientationEvent/DeviceOrientationEvent)\n- [DragEvent](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent/DragEvent)\n- [Event](https://developer.mozilla.org/en-US/docs/Web/API/Event/Event)\n- [FocusEvent](https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent/FocusEvent)\n- [KeyboardEvent](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/KeyboardEvent)\n- [MouseEvent](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/MouseEvent)\n- [PointerEvent](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/PointerEvent)\n- [TouchEvent](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/TouchEvent)\n- [WheelEvent](https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent/WheelEvent)\n\nYou can also specify `JSHandle` as the property value if you want live objects to be passed into the event:\n\n```js\n// Note you can only create DataTransfer in Chromium and Firefox\nconst dataTransfer = await page.evaluateHandle(() => new DataTransfer());\nawait elementHandle.dispatchEvent('dragstart', { dataTransfer });\n```\n\n```java\n// Note you can only create DataTransfer in Chromium and Firefox\nJSHandle dataTransfer = page.evaluateHandle(\"() => new DataTransfer()\");\nMap<String, Object> arg = new HashMap<>();\narg.put(\"dataTransfer\", dataTransfer);\nelementHandle.dispatchEvent(\"dragstart\", arg);\n```\n\n```py\n# note you can only create data_transfer in chromium and firefox\ndata_transfer = await page.evaluate_handle(\"new DataTransfer()\")\nawait element_handle.dispatch_event(\"#source\", \"dragstart\", {\"dataTransfer\": data_transfer})\n```\n\n```py\n# note you can only create data_transfer in chromium and firefox\ndata_transfer = page.evaluate_handle(\"new DataTransfer()\")\nelement_handle.dispatch_event(\"#source\", \"dragstart\", {\"dataTransfer\": data_transfer})\n```\n\n```csharp\nvar dataTransfer = await page.EvaluateHandleAsync(\"() => new DataTransfer()\");\nawait elementHandle.DispatchEventAsync(\"dragstart\", new Dictionary<string, object>\n{\n { \"dataTransfer\", dataTransfer }\n});\n```\n","async":true,"alias":"dispatchEvent","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"type","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"DOM event type: `\"click\"`, `\"dragstart\"`, etc."}],"required":true,"comment":"DOM event type: `\"click\"`, `\"dragstart\"`, etc.","async":false,"alias":"type","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"eventInit","type":{"name":"EvaluationArgument","expression":"[EvaluationArgument]"},"spec":[{"type":"text","text":"Optional event-specific initialization properties."}],"required":false,"comment":"Optional event-specific initialization properties.","async":false,"alias":"eventInit","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"python":"eval_on_selector","js":"$eval"},"types":{},"overrides":{}},"since":"v1.9","discouraged":"This method does not wait for the element to pass actionability↵checks and therefore can lead to the flaky tests. Use [`method: Locator.evaluate`],↵other `Locator` helper methods or web-first assertions instead.","name":"evalOnSelector","type":{"name":"Serializable","expression":"[Serializable]"},"spec":[{"type":"text","text":"Returns the return value of `expression`."},{"type":"text","text":"The method finds an element matching the specified selector in the `ElementHandle`s subtree and passes it as a first↵argument to `expression`. If no elements match the selector, the method throws an error."},{"type":"text","text":"If `expression` returns a [Promise], then [`method: ElementHandle.evalOnSelector`] would wait for the promise to resolve and return its↵value."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const tweetHandle = await page.$('.tweet');","expect(await tweetHandle.$eval('.like', node => node.innerText)).toBe('100');","expect(await tweetHandle.$eval('.retweets', node => node.innerText)).toBe('10');"],"codeLang":"js"},{"type":"code","lines":["ElementHandle tweetHandle = page.querySelector(\".tweet\");","assertEquals(\"100\", tweetHandle.evalOnSelector(\".like\", \"node => node.innerText\"));","assertEquals(\"10\", tweetHandle.evalOnSelector(\".retweets\", \"node => node.innerText\"));"],"codeLang":"java"},{"type":"code","lines":["tweet_handle = await page.query_selector(\".tweet\")","assert await tweet_handle.eval_on_selector(\".like\", \"node => node.innerText\") == \"100\"","assert await tweet_handle.eval_on_selector(\".retweets\", \"node => node.innerText\") == \"10\""],"codeLang":"python async"},{"type":"code","lines":["tweet_handle = page.query_selector(\".tweet\")","assert tweet_handle.eval_on_selector(\".like\", \"node => node.innerText\") == \"100\"","assert tweet_handle.eval_on_selector(\".retweets\", \"node => node.innerText\") == \"10\""],"codeLang":"python sync"},{"type":"code","lines":["var tweetHandle = await page.QuerySelectorAsync(\".tweet\");","Assert.AreEqual(\"100\", await tweetHandle.EvalOnSelectorAsync(\".like\", \"node => node.innerText\"));","Assert.AreEqual(\"10\", await tweetHandle.EvalOnSelectorAsync(\".retweets\", \"node => node.innerText\"));"],"codeLang":"csharp"}],"required":true,"comment":"Returns the return value of `expression`.\n\nThe method finds an element matching the specified selector in the `ElementHandle`s subtree and passes it as a\nfirst argument to `expression`. If no elements match the selector, the method throws an error.\n\nIf `expression` returns a [Promise], then [`method: ElementHandle.evalOnSelector`] would wait for the promise to\nresolve and return its value.\n\n**Usage**\n\n```js\nconst tweetHandle = await page.$('.tweet');\nexpect(await tweetHandle.$eval('.like', node => node.innerText)).toBe('100');\nexpect(await tweetHandle.$eval('.retweets', node => node.innerText)).toBe('10');\n```\n\n```java\nElementHandle tweetHandle = page.querySelector(\".tweet\");\nassertEquals(\"100\", tweetHandle.evalOnSelector(\".like\", \"node => node.innerText\"));\nassertEquals(\"10\", tweetHandle.evalOnSelector(\".retweets\", \"node => node.innerText\"));\n```\n\n```py\ntweet_handle = await page.query_selector(\".tweet\")\nassert await tweet_handle.eval_on_selector(\".like\", \"node => node.innerText\") == \"100\"\nassert await tweet_handle.eval_on_selector(\".retweets\", \"node => node.innerText\") == \"10\"\n```\n\n```py\ntweet_handle = page.query_selector(\".tweet\")\nassert tweet_handle.eval_on_selector(\".like\", \"node => node.innerText\") == \"100\"\nassert tweet_handle.eval_on_selector(\".retweets\", \"node => node.innerText\") == \"10\"\n```\n\n```csharp\nvar tweetHandle = await page.QuerySelectorAsync(\".tweet\");\nAssert.AreEqual(\"100\", await tweetHandle.EvalOnSelectorAsync(\".like\", \"node => node.innerText\"));\nAssert.AreEqual(\"10\", await tweetHandle.EvalOnSelectorAsync(\".retweets\", \"node => node.innerText\"));\n```\n","async":true,"alias":"evalOnSelector","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to query for."}],"required":true,"comment":"A selector to query for.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"overrides":{"js":{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"expression","type":{"name":"","union":[{"name":"function","args":[{"name":"Element"}]},{"name":"string"}],"expression":"[function]([Element])|[string]"},"spec":[{"type":"text","text":"Function to be evaluated in the page context."}],"argsArray":[],"required":true,"comment":"Function to be evaluated in the page context.","args":{},"clazz":null,"async":false,"alias":"pageFunction","overloadIndex":0,"paramOrOption":null}}},"since":"v1.9","name":"expression","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"JavaScript expression to be evaluated in the browser context. If the expression evaluates↵to a function, the function is automatically invoked."}],"required":true,"comment":"JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the\nfunction is automatically invoked.","async":false,"alias":"expression","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"arg","type":{"name":"EvaluationArgument","expression":"[EvaluationArgument]"},"spec":[{"type":"text","text":"Optional argument to pass to `expression`."}],"required":false,"comment":"Optional argument to pass to `expression`.","async":false,"alias":"arg","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"python":"eval_on_selector_all","js":"$$eval"},"types":{},"overrides":{}},"since":"v1.9","discouraged":"In most cases, [`method: Locator.evaluateAll`],↵other `Locator` helper methods and web-first assertions do a better job.","name":"evalOnSelectorAll","type":{"name":"Serializable","expression":"[Serializable]"},"spec":[{"type":"text","text":"Returns the return value of `expression`."},{"type":"text","text":"The method finds all elements matching the specified selector in the `ElementHandle`'s subtree and passes an array of↵matched elements as a first argument to `expression`."},{"type":"text","text":"If `expression` returns a [Promise], then [`method: ElementHandle.evalOnSelectorAll`] would wait for the promise to resolve and return its↵value."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["<div class=\"feed\">"," <div class=\"tweet\">Hello!</div>"," <div class=\"tweet\">Hi!</div>","</div>"],"codeLang":"html"},{"type":"code","lines":["const feedHandle = await page.$('.feed');","expect(await feedHandle.$$eval('.tweet', nodes =>"," nodes.map(n => n.innerText))).toEqual(['Hello!', 'Hi!'],",");"],"codeLang":"js"},{"type":"code","lines":["ElementHandle feedHandle = page.querySelector(\".feed\");","assertEquals(Arrays.asList(\"Hello!\", \"Hi!\"), feedHandle.evalOnSelectorAll(\".tweet\", \"nodes => nodes.map(n => n.innerText)\"));"],"codeLang":"java"},{"type":"code","lines":["feed_handle = await page.query_selector(\".feed\")","assert await feed_handle.eval_on_selector_all(\".tweet\", \"nodes => nodes.map(n => n.innerText)\") == [\"hello!\", \"hi!\"]"],"codeLang":"python async"},{"type":"code","lines":["feed_handle = page.query_selector(\".feed\")","assert feed_handle.eval_on_selector_all(\".tweet\", \"nodes => nodes.map(n => n.innerText)\") == [\"hello!\", \"hi!\"]"],"codeLang":"python sync"},{"type":"code","lines":["var feedHandle = await page.QuerySelectorAsync(\".feed\");","Assert.AreEqual(new [] { \"Hello!\", \"Hi!\" }, await feedHandle.EvalOnSelectorAllAsync<string[]>(\".tweet\", \"nodes => nodes.map(n => n.innerText)\"));"],"codeLang":"csharp"}],"required":true,"comment":"Returns the return value of `expression`.\n\nThe method finds all elements matching the specified selector in the `ElementHandle`'s subtree and passes an array\nof matched elements as a first argument to `expression`.\n\nIf `expression` returns a [Promise], then [`method: ElementHandle.evalOnSelectorAll`] would wait for the promise to\nresolve and return its value.\n\n**Usage**\n\n```html\n<div class=\"feed\">\n <div class=\"tweet\">Hello!</div>\n <div class=\"tweet\">Hi!</div>\n</div>\n```\n\n```js\nconst feedHandle = await page.$('.feed');\nexpect(await feedHandle.$$eval('.tweet', nodes =>\n nodes.map(n => n.innerText))).toEqual(['Hello!', 'Hi!'],\n);\n```\n\n```java\nElementHandle feedHandle = page.querySelector(\".feed\");\nassertEquals(Arrays.asList(\"Hello!\", \"Hi!\"), feedHandle.evalOnSelectorAll(\".tweet\", \"nodes => nodes.map(n => n.innerText)\"));\n```\n\n```py\nfeed_handle = await page.query_selector(\".feed\")\nassert await feed_handle.eval_on_selector_all(\".tweet\", \"nodes => nodes.map(n => n.innerText)\") == [\"hello!\", \"hi!\"]\n```\n\n```py\nfeed_handle = page.query_selector(\".feed\")\nassert feed_handle.eval_on_selector_all(\".tweet\", \"nodes => nodes.map(n => n.innerText)\") == [\"hello!\", \"hi!\"]\n```\n\n```csharp\nvar feedHandle = await page.QuerySelectorAsync(\".feed\");\nAssert.AreEqual(new [] { \"Hello!\", \"Hi!\" }, await feedHandle.EvalOnSelectorAllAsync<string[]>(\".tweet\", \"nodes => nodes.map(n => n.innerText)\"));\n```\n","async":true,"alias":"evalOnSelectorAll","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to query for."}],"required":true,"comment":"A selector to query for.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"overrides":{"js":{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"expression","type":{"name":"","union":[{"name":"function","args":[{"name":"Array","templates":[{"name":"Element"}]}]},{"name":"string"}],"expression":"[function]([Array]<[Element]>)|[string]"},"spec":[{"type":"text","text":"Function to be evaluated in the page context."}],"argsArray":[],"required":true,"comment":"Function to be evaluated in the page context.","args":{},"clazz":null,"async":false,"alias":"pageFunction","overloadIndex":0,"paramOrOption":null}}},"since":"v1.9","name":"expression","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"JavaScript expression to be evaluated in the browser context. If the expression evaluates↵to a function, the function is automatically invoked."}],"required":true,"comment":"JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the\nfunction is automatically invoked.","async":false,"alias":"expression","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"arg","type":{"name":"EvaluationArgument","expression":"[EvaluationArgument]"},"spec":[{"type":"text","text":"Optional argument to pass to `expression`."}],"required":false,"comment":"Optional argument to pass to `expression`.","async":false,"alias":"arg","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.fill`] instead. Read more about [locators](../locators.md).","name":"fill","type":{"name":"void"},"spec":[{"type":"text","text":"This method waits for [actionability](../actionability.md) checks, focuses the element, fills it and triggers an `input` event after filling. Note that you can pass an empty string to clear the input field."},{"type":"text","text":"If the target element is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method throws an error. However, if the element is inside the `<label>` element that has an associated [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be filled instead."},{"type":"text","text":"To send fine-grained keyboard events, use [`method: Locator.pressSequentially`]."}],"required":true,"comment":"This method waits for [actionability](../actionability.md) checks, focuses the element, fills it and triggers an\n`input` event after filling. Note that you can pass an empty string to clear the input field.\n\nIf the target element is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method throws an\nerror. However, if the element is inside the `<label>` element that has an associated\n[control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be filled\ninstead.\n\nTo send fine-grained keyboard events, use [`method: Locator.pressSequentially`].","async":true,"alias":"fill","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Value to set for the `<input>`, `<textarea>` or `[contenteditable]` element."}],"required":true,"comment":"Value to set for the `<input>`, `<textarea>` or `[contenteditable]` element.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.13","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.focus`] instead. Read more about [locators](../locators.md).","name":"focus","type":{"name":"void"},"spec":[{"type":"text","text":"Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the element."}],"required":true,"comment":"Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the element.","async":true,"alias":"focus","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.getAttribute`] instead. Read more about [locators](../locators.md).","name":"getAttribute","type":{"name":"","union":[{"name":"null"},{"name":"string"}],"expression":"[null]|[string]"},"spec":[{"type":"text","text":"Returns element attribute value."}],"required":true,"comment":"Returns element attribute value.","async":true,"alias":"getAttribute","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Attribute name to get the value for."}],"required":true,"comment":"Attribute name to get the value for.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.hover`] instead. Read more about [locators](../locators.md).","name":"hover","type":{"name":"void"},"spec":[{"type":"text","text":"This method hovers over the element by performing the following steps:"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.mouse`] to hover over the center of the element, or the specified `position`.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.","liType":"ordinal"},{"type":"text","text":"If the element is detached from the DOM at any moment during the action, this method throws."},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."}],"required":true,"comment":"This method hovers over the element by performing the following steps:\n1. Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.mouse`] to hover over the center of the element, or the specified `position`.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n\nIf the element is detached from the DOM at any moment during the action, this method throws.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.","async":true,"alias":"hover","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"modifiers","type":{"name":"Array","templates":[{"name":"KeyboardModifier","union":[{"name":"\"Alt\""},{"name":"\"Control\""},{"name":"\"ControlOrMeta\""},{"name":"\"Meta\""},{"name":"\"Shift\""}]}],"expression":"[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"ControlOrMeta\"|\"Meta\"|\"Shift\">>"},"spec":[{"type":"text","text":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current↵modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to \"Control\" on Windows↵and Linux and to \"Meta\" on macOS."}],"required":false,"comment":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores\ncurrent modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to\n\"Control\" on Windows and Linux and to \"Meta\" on macOS.","async":false,"alias":"modifiers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.28","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.innerHTML`] instead. Read more about [locators](../locators.md).","name":"innerHTML","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Returns the `element.innerHTML`."}],"required":true,"comment":"Returns the `element.innerHTML`.","async":true,"alias":"innerHTML","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.innerText`] instead. Read more about [locators](../locators.md).","name":"innerText","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Returns the `element.innerText`."}],"required":true,"comment":"Returns the `element.innerText`.","async":true,"alias":"innerText","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.13","discouraged":"Use locator-based [`method: Locator.inputValue`] instead. Read more about [locators](../locators.md).","name":"inputValue","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element."},{"type":"text","text":"Throws for non-input elements. However, if the element is inside the `<label>` element that has an associated [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), returns the value of the control."}],"required":true,"comment":"Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element.\n\nThrows for non-input elements. However, if the element is inside the `<label>` element that has an associated\n[control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), returns the value of the\ncontrol.","async":true,"alias":"inputValue","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.13","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.13","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.isChecked`] instead. Read more about [locators](../locators.md).","name":"isChecked","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Returns whether the element is checked. Throws if the element is not a checkbox or radio input."}],"required":true,"comment":"Returns whether the element is checked. Throws if the element is not a checkbox or radio input.","async":true,"alias":"isChecked","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.isDisabled`] instead. Read more about [locators](../locators.md).","name":"isDisabled","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Returns whether the element is disabled, the opposite of [enabled](../actionability.md#enabled)."}],"required":true,"comment":"Returns whether the element is disabled, the opposite of [enabled](../actionability.md#enabled).","async":true,"alias":"isDisabled","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.isEditable`] instead. Read more about [locators](../locators.md).","name":"isEditable","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Returns whether the element is [editable](../actionability.md#editable)."}],"required":true,"comment":"Returns whether the element is [editable](../actionability.md#editable).","async":true,"alias":"isEditable","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.isEnabled`] instead. Read more about [locators](../locators.md).","name":"isEnabled","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Returns whether the element is [enabled](../actionability.md#enabled)."}],"required":true,"comment":"Returns whether the element is [enabled](../actionability.md#enabled).","async":true,"alias":"isEnabled","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.isHidden`] instead. Read more about [locators](../locators.md).","name":"isHidden","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Returns whether the element is hidden, the opposite of [visible](../actionability.md#visible)."}],"required":true,"comment":"Returns whether the element is hidden, the opposite of [visible](../actionability.md#visible).","async":true,"alias":"isHidden","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.isVisible`] instead. Read more about [locators](../locators.md).","name":"isVisible","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Returns whether the element is [visible](../actionability.md#visible)."}],"required":true,"comment":"Returns whether the element is [visible](../actionability.md#visible).","async":true,"alias":"isVisible","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"ownerFrame","type":{"name":"","union":[{"name":"null"},{"name":"Frame"}],"expression":"[null]|[Frame]"},"spec":[{"type":"text","text":"Returns the frame containing the given element."}],"required":true,"comment":"Returns the frame containing the given element.","async":true,"alias":"ownerFrame","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.press`] instead. Read more about [locators](../locators.md).","name":"press","type":{"name":"void"},"spec":[{"type":"text","text":"Focuses the element, and then uses [`method: Keyboard.down`] and [`method: Keyboard.up`]."},{"type":"text","text":"`key` can specify the intended↵[keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) value or a single character to↵generate the text for. A superset of the `key` values can be found↵[here](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values). Examples of the keys are:"},{"type":"text","text":"`F1` - `F12`, `Digit0`- `Digit9`, `KeyA`- `KeyZ`, `Backquote`, `Minus`, `Equal`, `Backslash`, `Backspace`, `Tab`,↵`Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`, etc."},{"type":"text","text":"Following modification shortcuts are also supported: `Shift`, `Control`, `Alt`, `Meta`, `ShiftLeft`, `ControlOrMeta`."},{"type":"text","text":"Holding down `Shift` will type the text that corresponds to the `key` in the upper case."},{"type":"text","text":"If `key` is a single character, it is case-sensitive, so the values `a` and `A` will generate different↵respective texts."},{"type":"text","text":"Shortcuts such as `key: \"Control+o\"`, `key: \"Control++` or `key: \"Control+Shift+T\"` are supported as well. When specified with the↵modifier, modifier is pressed and being held while the subsequent key is being pressed."}],"required":true,"comment":"Focuses the element, and then uses [`method: Keyboard.down`] and [`method: Keyboard.up`].\n\n`key` can specify the intended\n[keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) value or a single character\nto generate the text for. A superset of the `key` values can be found\n[here](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values). Examples of the keys are:\n\n`F1` - `F12`, `Digit0`- `Digit9`, `KeyA`- `KeyZ`, `Backquote`, `Minus`, `Equal`, `Backslash`, `Backspace`, `Tab`,\n`Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`,\netc.\n\nFollowing modification shortcuts are also supported: `Shift`, `Control`, `Alt`, `Meta`, `ShiftLeft`,\n`ControlOrMeta`.\n\nHolding down `Shift` will type the text that corresponds to the `key` in the upper case.\n\nIf `key` is a single character, it is case-sensitive, so the values `a` and `A` will generate different respective\ntexts.\n\nShortcuts such as `key: \"Control+o\"`, `key: \"Control++` or `key: \"Control+Shift+T\"` are supported as well. When\nspecified with the modifier, modifier is pressed and being held while the subsequent key is being pressed.","async":true,"alias":"press","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"key","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Name of the key to press or a character to generate, such as `ArrowLeft` or `a`."}],"required":true,"comment":"Name of the key to press or a character to generate, such as `ArrowLeft` or `a`.","async":false,"alias":"key","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"delay","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0."}],"required":false,"comment":"Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.","async":false,"alias":"delay","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"python":"query_selector","js":"$"},"types":{},"overrides":{}},"since":"v1.9","discouraged":"Use locator-based [`method: Page.locator`] instead. Read more about [locators](../locators.md).","name":"querySelector","type":{"name":"","union":[{"name":"null"},{"name":"ElementHandle"}],"expression":"[null]|[ElementHandle]"},"spec":[{"type":"text","text":"The method finds an element matching the specified selector in the `ElementHandle`'s subtree. If no elements match the selector,↵returns `null`."}],"required":true,"comment":"The method finds an element matching the specified selector in the `ElementHandle`'s subtree. If no elements match\nthe selector, returns `null`.","async":true,"alias":"querySelector","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to query for."}],"required":true,"comment":"A selector to query for.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"python":"query_selector_all","js":"$$"},"types":{},"overrides":{}},"since":"v1.9","discouraged":"Use locator-based [`method: Page.locator`] instead. Read more about [locators](../locators.md).","name":"querySelectorAll","type":{"name":"Array","templates":[{"name":"ElementHandle"}],"expression":"[Array]<[ElementHandle]>"},"spec":[{"type":"text","text":"The method finds all elements matching the specified selector in the `ElementHandle`s subtree. If no elements match the selector,↵returns empty array."}],"required":true,"comment":"The method finds all elements matching the specified selector in the `ElementHandle`s subtree. If no elements match\nthe selector, returns empty array.","async":true,"alias":"querySelectorAll","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to query for."}],"required":true,"comment":"A selector to query for.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.screenshot`] instead. Read more about [locators](../locators.md).","name":"screenshot","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"This method captures a screenshot of the page, clipped to the size and position of this particular element. If the element is covered by other elements, it will not be actually visible on the screenshot. If the element is a scrollable container, only the currently scrolled content will be visible on the screenshot."},{"type":"text","text":"This method waits for the [actionability](../actionability.md) checks, then scrolls element into view before taking a↵screenshot. If the element is detached from DOM, the method throws an error."},{"type":"text","text":"Returns the buffer with the captured screenshot."}],"required":true,"comment":"This method captures a screenshot of the page, clipped to the size and position of this particular element. If the\nelement is covered by other elements, it will not be actually visible on the screenshot. If the element is a\nscrollable container, only the currently scrolled content will be visible on the screenshot.\n\nThis method waits for the [actionability](../actionability.md) checks, then scrolls element into view before taking\na screenshot. If the element is detached from DOM, the method throws an error.\n\nReturns the buffer with the captured screenshot.","async":true,"alias":"screenshot","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"animations","type":{"name":"ScreenshotAnimations","union":[{"name":"\"disabled\""},{"name":"\"allow\""}],"expression":"[ScreenshotAnimations]<\"disabled\"|\"allow\">"},"spec":[{"type":"text","text":"When set to `\"disabled\"`, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment depending on their duration:"},{"type":"li","text":"finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.","liType":"bullet"},{"type":"li","text":"infinite animations are canceled to initial state, and then played over after the screenshot.","liType":"bullet"},{"type":"text","text":"Defaults to `\"allow\"` that leaves animations untouched."}],"required":false,"comment":"When set to `\"disabled\"`, stops CSS animations, CSS transitions and Web Animations. Animations get different\ntreatment depending on their duration:\n- finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.\n- infinite animations are canceled to initial state, and then played over after the screenshot.\n\nDefaults to `\"allow\"` that leaves animations untouched.","async":false,"alias":"animations","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"caret","type":{"name":"ScreenshotCaret","union":[{"name":"\"hide\""},{"name":"\"initial\""}],"expression":"[ScreenshotCaret]<\"hide\"|\"initial\">"},"spec":[{"type":"text","text":"When set to `\"hide\"`, screenshot will hide text caret. When set to `\"initial\"`, text caret behavior will not be changed. Defaults to `\"hide\"`."}],"required":false,"comment":"When set to `\"hide\"`, screenshot will hide text caret. When set to `\"initial\"`, text caret behavior will not be\nchanged. Defaults to `\"hide\"`.","async":false,"alias":"caret","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"mask","type":{"name":"Array","templates":[{"name":"Locator"}],"expression":"[Array]<[Locator]>"},"spec":[{"type":"text","text":"Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with↵a pink box `#FF00FF` (customized by `maskColor`) that completely covers its bounding box."}],"required":false,"comment":"Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink\nbox `#FF00FF` (customized by `maskColor`) that completely covers its bounding box.","async":false,"alias":"mask","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.35","name":"maskColor","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Specify the color of the overlay box for masked elements, in [CSS color format](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value). Default color is pink `#FF00FF`."}],"required":false,"comment":"Specify the color of the overlay box for masked elements, in\n[CSS color format](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value). Default color is pink `#FF00FF`.","async":false,"alias":"maskColor","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"omitBackground","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images.↵Defaults to `false`."}],"required":false,"comment":"Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images.\nDefaults to `false`.","async":false,"alias":"omitBackground","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a↵relative path, then it is resolved relative to the current working directory. If no path is provided, the image won't be↵saved to the disk."}],"required":false,"comment":"The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a\nrelative path, then it is resolved relative to the current working directory. If no path is provided, the image\nwon't be saved to the disk.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"quality","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"The quality of the image, between 0-100. Not applicable to `png` images."}],"required":false,"comment":"The quality of the image, between 0-100. Not applicable to `png` images.","async":false,"alias":"quality","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"scale","type":{"name":"ScreenshotScale","union":[{"name":"\"css\""},{"name":"\"device\""}],"expression":"[ScreenshotScale]<\"css\"|\"device\">"},"spec":[{"type":"text","text":"When set to `\"css\"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this will keep screenshots small. Using `\"device\"` option will produce a single pixel per each device pixel, so screenshots of high-dpi devices will be twice as large or even larger."},{"type":"text","text":"Defaults to `\"device\"`."}],"required":false,"comment":"When set to `\"css\"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this\nwill keep screenshots small. Using `\"device\"` option will produce a single pixel per each device pixel, so\nscreenshots of high-dpi devices will be twice as large or even larger.\n\nDefaults to `\"device\"`.","async":false,"alias":"scale","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.41","name":"style","type":{"name":"string","expression":"string"},"spec":[{"type":"text","text":"Text of the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make elements invisible↵or change their properties to help you creating repeatable screenshots. This stylesheet pierces the Shadow DOM and applies↵to the inner frames."}],"required":false,"comment":"Text of the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make\nelements invisible or change their properties to help you creating repeatable screenshots. This stylesheet pierces\nthe Shadow DOM and applies to the inner frames.","async":false,"alias":"style","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"type","type":{"name":"ScreenshotType","union":[{"name":"\"png\""},{"name":"\"jpeg\""}],"expression":"[ScreenshotType]<\"png\"|\"jpeg\">"},"spec":[{"type":"text","text":"Specify screenshot type, defaults to `png`."}],"required":false,"comment":"Specify screenshot type, defaults to `png`.","async":false,"alias":"type","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.scrollIntoViewIfNeeded`] instead. Read more about [locators](../locators.md).","name":"scrollIntoViewIfNeeded","type":{"name":"void"},"spec":[{"type":"text","text":"This method waits for [actionability](../actionability.md) checks, then tries to scroll element into view, unless it is↵completely visible as defined by↵[IntersectionObserver](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API)'s `ratio`."},{"type":"text","text":"Throws when `elementHandle` does not point to an element↵[connected](https://developer.mozilla.org/en-US/docs/Web/API/Node/isConnected) to a Document or a ShadowRoot."},{"type":"text","text":"See [scrolling](../input.md#scrolling) for alternative ways to scroll."}],"required":true,"comment":"This method waits for [actionability](../actionability.md) checks, then tries to scroll element into view, unless\nit is completely visible as defined by\n[IntersectionObserver](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API)'s `ratio`.\n\nThrows when `elementHandle` does not point to an element\n[connected](https://developer.mozilla.org/en-US/docs/Web/API/Node/isConnected) to a Document or a ShadowRoot.\n\nSee [scrolling](../input.md#scrolling) for alternative ways to scroll.","async":true,"alias":"scrollIntoViewIfNeeded","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.selectOption`] instead. Read more about [locators](../locators.md).","name":"selectOption","type":{"name":"Array","templates":[{"name":"string"}],"expression":"[Array]<[string]>"},"spec":[{"type":"text","text":"This method waits for [actionability](../actionability.md) checks, waits until all specified options are present in the `<select>` element and selects these options."},{"type":"text","text":"If the target element is not a `<select>` element, this method throws an error. However, if the element is inside the `<label>` element that has an associated [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be used instead."},{"type":"text","text":"Returns the array of option values that have been successfully selected."},{"type":"text","text":"Triggers a `change` and `input` event once all the provided options have been selected."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["// Single selection matching the value or label","handle.selectOption('blue');","","// single selection matching the label","handle.selectOption({ label: 'Blue' });","","// multiple selection","handle.selectOption(['red', 'green', 'blue']);"],"codeLang":"js"},{"type":"code","lines":["// Single selection matching the value or label","handle.selectOption(\"blue\");","// single selection matching the label","handle.selectOption(new SelectOption().setLabel(\"Blue\"));","// multiple selection","handle.selectOption(new String[] {\"red\", \"green\", \"blue\"});"],"codeLang":"java"},{"type":"code","lines":["# Single selection matching the value or label","await handle.select_option(\"blue\")","# single selection matching the label","await handle.select_option(label=\"blue\")","# multiple selection","await handle.select_option(value=[\"red\", \"green\", \"blue\"])"],"codeLang":"python async"},{"type":"code","lines":["# Single selection matching the value or label","handle.select_option(\"blue\")","# single selection matching both the label","handle.select_option(label=\"blue\")","# multiple selection","handle.select_option(value=[\"red\", \"green\", \"blue\"])"],"codeLang":"python sync"},{"type":"code","lines":["// Single selection matching the value or label","await handle.SelectOptionAsync(new[] { \"blue\" });","// single selection matching the label","await handle.SelectOptionAsync(new[] { new SelectOptionValue() { Label = \"blue\" } });","// multiple selection","await handle.SelectOptionAsync(new[] { \"red\", \"green\", \"blue\" });","// multiple selection for blue, red and second option","await handle.SelectOptionAsync(new[] {"," new SelectOptionValue() { Label = \"blue\" },"," new SelectOptionValue() { Index = 2 },"," new SelectOptionValue() { Value = \"red\" }});"],"codeLang":"csharp"}],"required":true,"comment":"This method waits for [actionability](../actionability.md) checks, waits until all specified options are present in\nthe `<select>` element and selects these options.\n\nIf the target element is not a `<select>` element, this method throws an error. However, if the element is inside\nthe `<label>` element that has an associated\n[control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be used\ninstead.\n\nReturns the array of option values that have been successfully selected.\n\nTriggers a `change` and `input` event once all the provided options have been selected.\n\n**Usage**\n\n```js\n// Single selection matching the value or label\nhandle.selectOption('blue');\n\n// single selection matching the label\nhandle.selectOption({ label: 'Blue' });\n\n// multiple selection\nhandle.selectOption(['red', 'green', 'blue']);\n```\n\n```java\n// Single selection matching the value or label\nhandle.selectOption(\"blue\");\n// single selection matching the label\nhandle.selectOption(new SelectOption().setLabel(\"Blue\"));\n// multiple selection\nhandle.selectOption(new String[] {\"red\", \"green\", \"blue\"});\n```\n\n```py\n# Single selection matching the value or label\nawait handle.select_option(\"blue\")\n# single selection matching the label\nawait handle.select_option(label=\"blue\")\n# multiple selection\nawait handle.select_option(value=[\"red\", \"green\", \"blue\"])\n```\n\n```py\n# Single selection matching the value or label\nhandle.select_option(\"blue\")\n# single selection matching both the label\nhandle.select_option(label=\"blue\")\n# multiple selection\nhandle.select_option(value=[\"red\", \"green\", \"blue\"])\n```\n\n```csharp\n// Single selection matching the value or label\nawait handle.SelectOptionAsync(new[] { \"blue\" });\n// single selection matching the label\nawait handle.SelectOptionAsync(new[] { new SelectOptionValue() { Label = \"blue\" } });\n// multiple selection\nawait handle.SelectOptionAsync(new[] { \"red\", \"green\", \"blue\" });\n// multiple selection for blue, red and second option\nawait handle.SelectOptionAsync(new[] {\n new SelectOptionValue() { Label = \"blue\" },\n new SelectOptionValue() { Index = 2 },\n new SelectOptionValue() { Value = \"red\" }});\n```\n","async":true,"alias":"selectOption","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["java","js","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"values","type":{"name":"","union":[{"name":"null"},{"name":"string"},{"name":"ElementHandle"},{"name":"Array","templates":[{"name":"string"}]},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Matches by `option.value`. Optional."}],"required":false,"comment":"Matches by `option.value`. Optional.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"label","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Matches by `option.label`. Optional."}],"required":false,"comment":"Matches by `option.label`. Optional.","async":false,"alias":"label","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"index","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Matches by the index. Optional."}],"required":false,"comment":"Matches by the index. Optional.","async":false,"alias":"index","overloadIndex":0,"paramOrOption":null}]},{"name":"Array","templates":[{"name":"ElementHandle"}]},{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Matches by `option.value`. Optional."}],"required":false,"comment":"Matches by `option.value`. Optional.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"label","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Matches by `option.label`. Optional."}],"required":false,"comment":"Matches by `option.label`. Optional.","async":false,"alias":"label","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"index","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Matches by the index. Optional."}],"required":false,"comment":"Matches by the index. Optional.","async":false,"alias":"index","overloadIndex":0,"paramOrOption":null}]}]}],"expression":"[null]|[string]|[ElementHandle]|[Array]<[string]>|[Object]|[Array]<[ElementHandle]>|[Array]<[Object]>"},"spec":[{"type":"text","text":"Options to select. If the `<select>` has the `multiple` attribute, all matching options are selected, otherwise only the↵first option matching one of the passed options is selected. String values are matching both values and labels. Option↵is considered matching if all specified properties match."}],"required":true,"comment":"Options to select. If the `<select>` has the `multiple` attribute, all matching options are selected, otherwise\nonly the first option matching one of the passed options is selected. String values are matching both values and\nlabels. Option is considered matching if all specified properties match.","async":false,"alias":"values","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.13","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"element","type":{"name":"","union":[{"name":"ElementHandle"},{"name":"Array","templates":[{"name":"ElementHandle"}]}],"expression":"[ElementHandle]|[Array]<[ElementHandle]>"},"spec":[{"type":"text","text":"Option elements to select. Optional."}],"required":false,"comment":"Option elements to select. Optional.","async":false,"alias":"element","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"index","type":{"name":"","union":[{"name":"int"},{"name":"Array","templates":[{"name":"int"}]}],"expression":"[int]|[Array]<[int]>"},"spec":[{"type":"text","text":"Options to select by index. Optional."}],"required":false,"comment":"Options to select by index. Optional.","async":false,"alias":"index","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"value","type":{"name":"","union":[{"name":"string"},{"name":"Array","templates":[{"name":"string"}]}],"expression":"[string]|[Array]<[string]>"},"spec":[{"type":"text","text":"Options to select by value. If the `<select>` has the `multiple` attribute, all given options are selected, otherwise↵only the first option matching one of the passed options is selected. Optional."}],"required":false,"comment":"Options to select by value. If the `<select>` has the `multiple` attribute, all given options are selected,\notherwise only the first option matching one of the passed options is selected. Optional.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"label","type":{"name":"","union":[{"name":"string"},{"name":"Array","templates":[{"name":"string"}]}],"expression":"[string]|[Array]<[string]>"},"spec":[{"type":"text","text":"Options to select by label. If the `<select>` has the `multiple` attribute, all given options are selected, otherwise↵only the first option matching one of the passed options is selected. Optional."}],"required":false,"comment":"Options to select by label. If the `<select>` has the `multiple` attribute, all given options are selected,\notherwise only the first option matching one of the passed options is selected. Optional.","async":false,"alias":"label","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.selectText`] instead. Read more about [locators](../locators.md).","name":"selectText","type":{"name":"void"},"spec":[{"type":"text","text":"This method waits for [actionability](../actionability.md) checks, then focuses the element and selects all its text↵content."},{"type":"text","text":"If the element is inside the `<label>` element that has an associated [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), focuses and selects text in the control instead."}],"required":true,"comment":"This method waits for [actionability](../actionability.md) checks, then focuses the element and selects all its\ntext content.\n\nIf the element is inside the `<label>` element that has an associated\n[control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), focuses and selects text in\nthe control instead.","async":true,"alias":"selectText","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.13","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.15","discouraged":"Use locator-based [`method: Locator.setChecked`] instead. Read more about [locators](../locators.md).","name":"setChecked","type":{"name":"void"},"spec":[{"type":"text","text":"This method checks or unchecks an element by performing the following steps:"},{"type":"li","text":"Ensure that element is a checkbox or a radio input. If not, this method throws.","liType":"ordinal"},{"type":"li","text":"If the element already has the right checked state, this method returns immediately.","liType":"ordinal"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is↵set. If the element is detached during the checks, the whole action is retried.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.mouse`] to click in the center of the element.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.","liType":"ordinal"},{"type":"li","text":"Ensure that the element is now checked or unchecked. If not, this method throws.","liType":"ordinal"},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."}],"required":true,"comment":"This method checks or unchecks an element by performing the following steps:\n1. Ensure that element is a checkbox or a radio input. If not, this method throws.\n1. If the element already has the right checked state, this method returns immediately.\n1. Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is set. If\n the element is detached during the checks, the whole action is retried.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.mouse`] to click in the center of the element.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n1. Ensure that the element is now checked or unchecked. If not, this method throws.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.","async":true,"alias":"setChecked","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"aliases":{"csharp":"checkedState"},"types":{},"overrides":{}},"since":"v1.15","name":"checked","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to check or uncheck the checkbox."}],"required":true,"comment":"Whether to check or uncheck the checkbox.","async":false,"alias":"checked","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.15","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.15","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.15","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.15","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.15","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.15","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.setInputFiles`] instead. Read more about [locators](../locators.md).","name":"setInputFiles","type":{"name":"void"},"spec":[{"type":"text","text":"Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then they↵are resolved relative to the current working directory. For empty array, clears the selected files.↵For inputs with a `[webkitdirectory]` attribute, only a single directory path is supported."},{"type":"text","text":"This method expects `ElementHandle` to point to an↵[input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input). However, if the element is inside the `<label>` element that has an associated [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), targets the control instead."}],"required":true,"comment":"Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then\nthey are resolved relative to the current working directory. For empty array, clears the selected files. For inputs\nwith a `[webkitdirectory]` attribute, only a single directory path is supported.\n\nThis method expects `ElementHandle` to point to an\n[input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input). However, if the element is inside\nthe `<label>` element that has an associated\n[control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), targets the control instead.","async":true,"alias":"setInputFiles","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"files","type":{"name":"","union":[{"name":"path"},{"name":"Array","templates":[{"name":"path"}]},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]},{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]}]}],"expression":"[path]|[Array]<[path]>|[Object]|[Array]<[Object]>"},"spec":[],"required":true,"comment":"","async":false,"alias":"files","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.tap`] instead. Read more about [locators](../locators.md).","name":"tap","type":{"name":"void"},"spec":[{"type":"text","text":"This method taps the element by performing the following steps:"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.touchscreen`] to tap the center of the element, or the specified `position`.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.","liType":"ordinal"},{"type":"text","text":"If the element is detached from the DOM at any moment during the action, this method throws."},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."},{"type":"note","noteType":"note","text":"`elementHandle.tap()` requires that the `hasTouch` option of the browser context be set to true."}],"required":true,"comment":"This method taps the element by performing the following steps:\n1. Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.touchscreen`] to tap the center of the element, or the specified `position`.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n\nIf the element is detached from the DOM at any moment during the action, this method throws.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.\n\n**NOTE** `elementHandle.tap()` requires that the `hasTouch` option of the browser context be set to true.","async":true,"alias":"tap","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"modifiers","type":{"name":"Array","templates":[{"name":"KeyboardModifier","union":[{"name":"\"Alt\""},{"name":"\"Control\""},{"name":"\"ControlOrMeta\""},{"name":"\"Meta\""},{"name":"\"Shift\""}]}],"expression":"[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"ControlOrMeta\"|\"Meta\"|\"Shift\">>"},"spec":[{"type":"text","text":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current↵modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to \"Control\" on Windows↵and Linux and to \"Meta\" on macOS."}],"required":false,"comment":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores\ncurrent modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to\n\"Control\" on Windows and Linux and to \"Meta\" on macOS.","async":false,"alias":"modifiers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.textContent`] instead. Read more about [locators](../locators.md).","name":"textContent","type":{"name":"","union":[{"name":"null"},{"name":"string"}],"expression":"[null]|[string]"},"spec":[{"type":"text","text":"Returns the `node.textContent`."}],"required":true,"comment":"Returns the `node.textContent`.","async":true,"alias":"textContent","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","deprecated":"In most cases, you should use [`method: Locator.fill`] instead. You only need to press keys one by one if there is special keyboard handling on the page - in this case use [`method: Locator.pressSequentially`].","name":"type","type":{"name":"void"},"spec":[{"type":"text","text":"Focuses the element, and then sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text."},{"type":"text","text":"To press a special key, like `Control` or `ArrowDown`, use [`method: ElementHandle.press`]."},{"type":"text","text":"**Usage**"}],"required":true,"comment":"Focuses the element, and then sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the\ntext.\n\nTo press a special key, like `Control` or `ArrowDown`, use [`method: ElementHandle.press`].\n\n**Usage**","async":true,"alias":"type","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"text","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A text to type into a focused element."}],"required":true,"comment":"A text to type into a focused element.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"delay","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to wait between key presses in milliseconds. Defaults to 0."}],"required":false,"comment":"Time to wait between key presses in milliseconds. Defaults to 0.","async":false,"alias":"delay","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.uncheck`] instead. Read more about [locators](../locators.md).","name":"uncheck","type":{"name":"void"},"spec":[{"type":"text","text":"This method checks the element by performing the following steps:"},{"type":"li","text":"Ensure that element is a checkbox or a radio input. If not, this method throws. If the element is already↵unchecked, this method returns immediately.","liType":"ordinal"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.mouse`] to click in the center of the element.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.","liType":"ordinal"},{"type":"li","text":"Ensure that the element is now unchecked. If not, this method throws.","liType":"ordinal"},{"type":"text","text":"If the element is detached from the DOM at any moment during the action, this method throws."},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."}],"required":true,"comment":"This method checks the element by performing the following steps:\n1. Ensure that element is a checkbox or a radio input. If not, this method throws. If the element is already\n unchecked, this method returns immediately.\n1. Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.mouse`] to click in the center of the element.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n1. Ensure that the element is now unchecked. If not, this method throws.\n\nIf the element is detached from the DOM at any moment during the action, this method throws.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.","async":true,"alias":"uncheck","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"waitForElementState","type":{"name":"void"},"spec":[{"type":"text","text":"Returns when the element satisfies the `state`."},{"type":"text","text":"Depending on the `state` parameter, this method waits for one of the [actionability](../actionability.md) checks↵to pass. This method throws when the element is detached while waiting, unless waiting for the `\"hidden\"` state."},{"type":"li","text":"`\"visible\"` Wait until the element is [visible](../actionability.md#visible).","liType":"bullet"},{"type":"li","text":"`\"hidden\"` Wait until the element is [not visible](../actionability.md#visible) or↵not attached. Note that waiting for hidden does not throw when the element detaches.","liType":"bullet"},{"type":"li","text":"`\"stable\"` Wait until the element is both [visible](../actionability.md#visible) and↵[stable](../actionability.md#stable).","liType":"bullet"},{"type":"li","text":"`\"enabled\"` Wait until the element is [enabled](../actionability.md#enabled).","liType":"bullet"},{"type":"li","text":"`\"disabled\"` Wait until the element is [not enabled](../actionability.md#enabled).","liType":"bullet"},{"type":"li","text":"`\"editable\"` Wait until the element is [editable](../actionability.md#editable).","liType":"bullet"},{"type":"text","text":"If the element does not satisfy the condition for the `timeout` milliseconds, this method will throw."}],"required":true,"comment":"Returns when the element satisfies the `state`.\n\nDepending on the `state` parameter, this method waits for one of the [actionability](../actionability.md) checks to\npass. This method throws when the element is detached while waiting, unless waiting for the `\"hidden\"` state.\n- `\"visible\"` Wait until the element is [visible](../actionability.md#visible).\n- `\"hidden\"` Wait until the element is [not visible](../actionability.md#visible) or not attached. Note that\n waiting for hidden does not throw when the element detaches.\n- `\"stable\"` Wait until the element is both [visible](../actionability.md#visible) and\n [stable](../actionability.md#stable).\n- `\"enabled\"` Wait until the element is [enabled](../actionability.md#enabled).\n- `\"disabled\"` Wait until the element is [not enabled](../actionability.md#enabled).\n- `\"editable\"` Wait until the element is [editable](../actionability.md#editable).\n\nIf the element does not satisfy the condition for the `timeout` milliseconds, this method will throw.","async":true,"alias":"waitForElementState","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"state","type":{"name":"ElementState","union":[{"name":"\"visible\""},{"name":"\"hidden\""},{"name":"\"stable\""},{"name":"\"enabled\""},{"name":"\"disabled\""},{"name":"\"editable\""}],"expression":"[ElementState]<\"visible\"|\"hidden\"|\"stable\"|\"enabled\"|\"disabled\"|\"editable\">"},"spec":[{"type":"text","text":"A state to wait for, see below for more details."}],"required":true,"comment":"A state to wait for, see below for more details.","async":false,"alias":"state","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use web assertions that assert visibility or a locator-based [`method: Locator.waitFor`] instead.","name":"waitForSelector","type":{"name":"","union":[{"name":"null"},{"name":"ElementHandle"}],"expression":"[null]|[ElementHandle]"},"spec":[{"type":"text","text":"Returns element specified by selector when it satisfies `state` option. Returns `null` if waiting for `hidden`↵or `detached`."},{"type":"text","text":"Wait for the `selector` relative to the element handle to satisfy `state` option (either↵appear/disappear from dom, or become visible/hidden). If at the moment of calling the method `selector` already↵satisfies the condition, the method will return immediately. If the selector doesn't satisfy the condition for the↵`timeout` milliseconds, the function will throw."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.setContent(`<div><span></span></div>`);","const div = await page.$('div');","// Waiting for the 'span' selector relative to the div.","const span = await div.waitForSelector('span', { state: 'attached' });"],"codeLang":"js"},{"type":"code","lines":["page.setContent(\"<div><span></span></div>\");","ElementHandle div = page.querySelector(\"div\");","// Waiting for the \"span\" selector relative to the div.","ElementHandle span = div.waitForSelector(\"span\", new ElementHandle.WaitForSelectorOptions()"," .setState(WaitForSelectorState.ATTACHED));"],"codeLang":"java"},{"type":"code","lines":["await page.set_content(\"<div><span></span></div>\")","div = await page.query_selector(\"div\")","# waiting for the \"span\" selector relative to the div.","span = await div.wait_for_selector(\"span\", state=\"attached\")"],"codeLang":"python async"},{"type":"code","lines":["page.set_content(\"<div><span></span></div>\")","div = page.query_selector(\"div\")","# waiting for the \"span\" selector relative to the div.","span = div.wait_for_selector(\"span\", state=\"attached\")"],"codeLang":"python sync"},{"type":"code","lines":["await page.SetContentAsync(\"<div><span></span></div>\");","var div = await page.QuerySelectorAsync(\"div\");","// Waiting for the \"span\" selector relative to the div.","var span = await page.WaitForSelectorAsync(\"span\", WaitForSelectorState.Attached);"],"codeLang":"csharp"},{"type":"note","noteType":"note","text":"This method does not work across navigations, use [`method: Page.waitForSelector`] instead."}],"required":true,"comment":"Returns element specified by selector when it satisfies `state` option. Returns `null` if waiting for `hidden` or\n`detached`.\n\nWait for the `selector` relative to the element handle to satisfy `state` option (either appear/disappear from dom,\nor become visible/hidden). If at the moment of calling the method `selector` already satisfies the condition, the\nmethod will return immediately. If the selector doesn't satisfy the condition for the `timeout` milliseconds, the\nfunction will throw.\n\n**Usage**\n\n```js\nawait page.setContent(`<div><span></span></div>`);\nconst div = await page.$('div');\n// Waiting for the 'span' selector relative to the div.\nconst span = await div.waitForSelector('span', { state: 'attached' });\n```\n\n```java\npage.setContent(\"<div><span></span></div>\");\nElementHandle div = page.querySelector(\"div\");\n// Waiting for the \"span\" selector relative to the div.\nElementHandle span = div.waitForSelector(\"span\", new ElementHandle.WaitForSelectorOptions()\n .setState(WaitForSelectorState.ATTACHED));\n```\n\n```py\nawait page.set_content(\"<div><span></span></div>\")\ndiv = await page.query_selector(\"div\")\n# waiting for the \"span\" selector relative to the div.\nspan = await div.wait_for_selector(\"span\", state=\"attached\")\n```\n\n```py\npage.set_content(\"<div><span></span></div>\")\ndiv = page.query_selector(\"div\")\n# waiting for the \"span\" selector relative to the div.\nspan = div.wait_for_selector(\"span\", state=\"attached\")\n```\n\n```csharp\nawait page.SetContentAsync(\"<div><span></span></div>\");\nvar div = await page.QuerySelectorAsync(\"div\");\n// Waiting for the \"span\" selector relative to the div.\nvar span = await page.WaitForSelectorAsync(\"span\", WaitForSelectorState.Attached);\n```\n\n**NOTE** This method does not work across navigations, use [`method: Page.waitForSelector`] instead.","async":true,"alias":"waitForSelector","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to query for."}],"required":true,"comment":"A selector to query for.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"state","type":{"name":"WaitForSelectorState","union":[{"name":"\"attached\""},{"name":"\"detached\""},{"name":"\"visible\""},{"name":"\"hidden\""}],"expression":"[WaitForSelectorState]<\"attached\"|\"detached\"|\"visible\"|\"hidden\">"},"spec":[{"type":"text","text":"Defaults to `'visible'`. Can be either:"},{"type":"li","text":"`'attached'` - wait for element to be present in DOM.","liType":"bullet"},{"type":"li","text":"`'detached'` - wait for element to not be present in DOM.","liType":"bullet"},{"type":"li","text":"`'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element without↵any content or with `display:none` has an empty bounding box and is not considered visible.","liType":"bullet"},{"type":"li","text":"`'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or `visibility:hidden`.↵This is opposite to the `'visible'` option.","liType":"bullet"}],"required":false,"comment":"Defaults to `'visible'`. Can be either:\n- `'attached'` - wait for element to be present in DOM.\n- `'detached'` - wait for element to not be present in DOM.\n- `'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element\n without any content or with `display:none` has an empty bounding box and is not considered visible.\n- `'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or\n `visibility:hidden`. This is opposite to the `'visible'` option.","async":false,"alias":"state","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.15","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]}]},{"name":"Error","spec":[{"type":"li","text":"extends: [Exception]","liType":"bullet"},{"type":"text","text":"Error is raised whenever certain operations are terminated abnormally, e.g.↵browser closes while [`method: Page.evaluate`] is running. All Playwright exceptions↵inherit from this class."}],"extends":"Exception","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"comment":"- extends: [Exception]\n\nError is raised whenever certain operations are terminated abnormally, e.g. browser closes while\n[`method: Page.evaluate`] is running. All Playwright exceptions inherit from this class.","since":"v1.11","members":[{"kind":"property","langs":{},"since":"v1.11","name":"message","type":{"name":"str","expression":"[str]"},"spec":[{"type":"text","text":"Message of the error."}],"required":true,"comment":"Message of the error.","async":false,"alias":"message","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"property","langs":{},"since":"v1.11","name":"name","type":{"name":"str","expression":"[str]"},"spec":[{"type":"text","text":"Name of the error which got thrown inside the browser. Optional."}],"required":false,"comment":"Name of the error which got thrown inside the browser. Optional.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"property","langs":{},"since":"v1.11","name":"stack","type":{"name":"str","expression":"[str]"},"spec":[{"type":"text","text":"Stack of the error which got thrown inside the browser. Optional."}],"required":false,"comment":"Stack of the error which got thrown inside the browser. Optional.","async":false,"alias":"stack","overloadIndex":0,"paramOrOption":null,"args":[]}]},{"name":"FileChooser","spec":[{"type":"text","text":"`FileChooser` objects are dispatched by the page in the [`event: Page.fileChooser`] event."},{"type":"code","lines":["// Start waiting for file chooser before clicking. Note no await.","const fileChooserPromise = page.waitForEvent('filechooser');","await page.getByText('Upload file').click();","const fileChooser = await fileChooserPromise;","await fileChooser.setFiles(path.join(__dirname, 'myfile.pdf'));"],"codeLang":"js"},{"type":"code","lines":["FileChooser fileChooser = page.waitForFileChooser(() -> page.getByText(\"Upload file\").click());","fileChooser.setFiles(Paths.get(\"myfile.pdf\"));"],"codeLang":"java"},{"type":"code","lines":["async with page.expect_file_chooser() as fc_info:"," await page.get_by_text(\"Upload file\").click()","file_chooser = await fc_info.value","await file_chooser.set_files(\"myfile.pdf\")"],"codeLang":"python async"},{"type":"code","lines":["with page.expect_file_chooser() as fc_info:"," page.get_by_text(\"Upload file\").click()","file_chooser = fc_info.value","file_chooser.set_files(\"myfile.pdf\")"],"codeLang":"python sync"},{"type":"code","lines":["var fileChooser = await page.RunAndWaitForFileChooserAsync(async () =>","{"," await page.GetByText(\"Upload file\").ClickAsync();","});","await fileChooser.SetFilesAsync(\"temp.txt\");"],"codeLang":"csharp"}],"langs":{},"comment":"`FileChooser` objects are dispatched by the page in the [`event: Page.fileChooser`] event.\n\n```js\n// Start waiting for file chooser before clicking. Note no await.\nconst fileChooserPromise = page.waitForEvent('filechooser');\nawait page.getByText('Upload file').click();\nconst fileChooser = await fileChooserPromise;\nawait fileChooser.setFiles(path.join(__dirname, 'myfile.pdf'));\n```\n\n```java\nFileChooser fileChooser = page.waitForFileChooser(() -> page.getByText(\"Upload file\").click());\nfileChooser.setFiles(Paths.get(\"myfile.pdf\"));\n```\n\n```py\nasync with page.expect_file_chooser() as fc_info:\n await page.get_by_text(\"Upload file\").click()\nfile_chooser = await fc_info.value\nawait file_chooser.set_files(\"myfile.pdf\")\n```\n\n```py\nwith page.expect_file_chooser() as fc_info:\n page.get_by_text(\"Upload file\").click()\nfile_chooser = fc_info.value\nfile_chooser.set_files(\"myfile.pdf\")\n```\n\n```csharp\nvar fileChooser = await page.RunAndWaitForFileChooserAsync(async () =>\n{\n await page.GetByText(\"Upload file\").ClickAsync();\n});\nawait fileChooser.SetFilesAsync(\"temp.txt\");\n```\n","since":"v1.8","members":[{"kind":"method","langs":{},"since":"v1.8","name":"element","type":{"name":"ElementHandle","expression":"[ElementHandle]"},"spec":[{"type":"text","text":"Returns input element associated with this file chooser."}],"required":true,"comment":"Returns input element associated with this file chooser.","async":false,"alias":"element","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"isMultiple","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Returns whether this file chooser accepts multiple files."}],"required":true,"comment":"Returns whether this file chooser accepts multiple files.","async":false,"alias":"isMultiple","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"page","type":{"name":"Page","expression":"[Page]"},"spec":[{"type":"text","text":"Returns page this file chooser belongs to."}],"required":true,"comment":"Returns page this file chooser belongs to.","async":false,"alias":"page","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"setFiles","type":{"name":"void"},"spec":[{"type":"text","text":"Sets the value of the file input this chooser is associated with. If some of the `filePaths` are relative paths, then↵they are resolved relative to the current working directory. For empty array, clears the selected files."}],"required":true,"comment":"Sets the value of the file input this chooser is associated with. If some of the `filePaths` are relative paths,\nthen they are resolved relative to the current working directory. For empty array, clears the selected files.","async":true,"alias":"setFiles","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"files","type":{"name":"","union":[{"name":"path"},{"name":"Array","templates":[{"name":"path"}]},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]},{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]}]}],"expression":"[path]|[Array]<[path]>|[Object]|[Array]<[Object]>"},"spec":[],"required":true,"comment":"","async":false,"alias":"files","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]}]},{"name":"FormData","spec":[{"type":"text","text":"The `FormData` is used create form data that is sent via `APIRequestContext`."},{"type":"code","lines":["import com.microsoft.playwright.options.FormData;","...","FormData form = FormData.create()"," .set(\"firstName\", \"John\")"," .set(\"lastName\", \"Doe\")"," .set(\"age\", 30);","page.request().post(\"http://localhost/submit\", RequestOptions.create().setForm(form));"],"codeLang":"java"}],"langs":{"only":["java","csharp"],"aliases":{},"types":{},"overrides":{}},"comment":"The `FormData` is used create form data that is sent via `APIRequestContext`.\n\n```java\nimport com.microsoft.playwright.options.FormData;\n...\nFormData form = FormData.create()\n .set(\"firstName\", \"John\")\n .set(\"lastName\", \"Doe\")\n .set(\"age\", 30);\npage.request().post(\"http://localhost/submit\", RequestOptions.create().setForm(form));\n```\n","since":"v1.18","members":[{"kind":"method","langs":{},"since":"v1.44","name":"append","type":{"name":"FormData","expression":"[FormData]"},"spec":[{"type":"text","text":"Appends a new value onto an existing key inside a FormData object, or adds the key if it↵does not already exist. File values can be passed either as `Path` or as `FilePayload`.↵Multiple fields with the same name can be added."},{"type":"text","text":"The difference between [`method: FormData.set`] and [`method: FormData.append`] is that if the specified key already exists,↵[`method: FormData.set`] will overwrite all existing values with the new one, whereas [`method: FormData.append`] will append↵the new value onto the end of the existing set of values."},{"type":"code","lines":["import com.microsoft.playwright.options.FormData;","...","FormData form = FormData.create()"," // Only name and value are set."," .append(\"firstName\", \"John\")"," // Name and value are set, filename and Content-Type are inferred from the file path."," .append(\"attachment\", Paths.get(\"pic.jpg\"))"," // Name, value, filename and Content-Type are set."," .append(\"attachment\", new FilePayload(\"table.csv\", \"text/csv\", Files.readAllBytes(Paths.get(\"my-tble.csv\"))));","page.request().post(\"http://localhost/submit\", RequestOptions.create().setForm(form));"],"codeLang":"java"},{"type":"code","lines":["var multipart = Context.APIRequest.CreateFormData();","// Only name and value are set.","multipart.Append(\"firstName\", \"John\");","// Name, value, filename and Content-Type are set.","multipart.Append(\"attachment\", new FilePayload()","{"," Name = \"pic.jpg\","," MimeType = \"image/jpeg\","," Buffer = File.ReadAllBytes(\"john.jpg\")","});","// Name, value, filename and Content-Type are set.","multipart.Append(\"attachment\", new FilePayload()","{"," Name = \"table.csv\","," MimeType = \"text/csv\","," Buffer = File.ReadAllBytes(\"my-tble.csv\")","});","await Page.APIRequest.PostAsync(\"https://localhost/submit\", new() { Multipart = multipart });"],"codeLang":"csharp"}],"required":true,"comment":"Appends a new value onto an existing key inside a FormData object, or adds the key if it does not already exist.\nFile values can be passed either as `Path` or as `FilePayload`. Multiple fields with the same name can be added.\n\nThe difference between [`method: FormData.set`] and [`method: FormData.append`] is that if the specified key\nalready exists, [`method: FormData.set`] will overwrite all existing values with the new one, whereas\n[`method: FormData.append`] will append the new value onto the end of the existing set of values.\n\n```java\nimport com.microsoft.playwright.options.FormData;\n...\nFormData form = FormData.create()\n // Only name and value are set.\n .append(\"firstName\", \"John\")\n // Name and value are set, filename and Content-Type are inferred from the file path.\n .append(\"attachment\", Paths.get(\"pic.jpg\"))\n // Name, value, filename and Content-Type are set.\n .append(\"attachment\", new FilePayload(\"table.csv\", \"text/csv\", Files.readAllBytes(Paths.get(\"my-tble.csv\"))));\npage.request().post(\"http://localhost/submit\", RequestOptions.create().setForm(form));\n```\n\n```csharp\nvar multipart = Context.APIRequest.CreateFormData();\n// Only name and value are set.\nmultipart.Append(\"firstName\", \"John\");\n// Name, value, filename and Content-Type are set.\nmultipart.Append(\"attachment\", new FilePayload()\n{\n Name = \"pic.jpg\",\n MimeType = \"image/jpeg\",\n Buffer = File.ReadAllBytes(\"john.jpg\")\n});\n// Name, value, filename and Content-Type are set.\nmultipart.Append(\"attachment\", new FilePayload()\n{\n Name = \"table.csv\",\n MimeType = \"text/csv\",\n Buffer = File.ReadAllBytes(\"my-tble.csv\")\n});\nawait Page.APIRequest.PostAsync(\"https://localhost/submit\", new() { Multipart = multipart });\n```\n","async":false,"alias":"append","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.44","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Field name."}],"required":true,"comment":"Field name.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"overrides":{"csharp":{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.44","name":"value","type":{"name":"","union":[{"name":"string"},{"name":"boolean"},{"name":"int"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"argsArray":[],"required":true,"comment":"File name","args":{},"clazz":null,"async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"argsArray":[],"required":true,"comment":"File type","args":{},"clazz":null,"async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"argsArray":[],"required":true,"comment":"File content","args":{},"clazz":null,"async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]}],"expression":"[string]|[boolean]|[int]|[Object]"},"spec":[{"type":"text","text":"Field value."}],"argsArray":[],"required":true,"comment":"Field value.","args":{},"clazz":null,"async":false,"alias":"value","overloadIndex":0,"paramOrOption":null}}},"since":"v1.44","name":"value","type":{"name":"","union":[{"name":"string"},{"name":"boolean"},{"name":"int"},{"name":"Path"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]}],"expression":"[string]|[boolean]|[int]|[Path]|[Object]"},"spec":[{"type":"text","text":"Field value."}],"required":true,"comment":"Field value.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"create","type":{"name":"FormData","expression":"[FormData]"},"spec":[{"type":"text","text":"Creates new instance of `FormData`."}],"required":true,"comment":"Creates new instance of `FormData`.","async":false,"alias":"create","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.18","name":"set","type":{"name":"FormData","expression":"[FormData]"},"spec":[{"type":"text","text":"Sets a field on the form. File values can be passed either as `Path` or as `FilePayload`."},{"type":"code","lines":["import com.microsoft.playwright.options.FormData;","...","FormData form = FormData.create()"," // Only name and value are set."," .set(\"firstName\", \"John\")"," // Name and value are set, filename and Content-Type are inferred from the file path."," .set(\"profilePicture1\", Paths.get(\"john.jpg\"))"," // Name, value, filename and Content-Type are set."," .set(\"profilePicture2\", new FilePayload(\"john.jpg\", \"image/jpeg\", Files.readAllBytes(Paths.get(\"john.jpg\"))))"," .set(\"age\", 30);","page.request().post(\"http://localhost/submit\", RequestOptions.create().setForm(form));"],"codeLang":"java"},{"type":"code","lines":["var multipart = Context.APIRequest.CreateFormData();","// Only name and value are set.","multipart.Set(\"firstName\", \"John\");","// Name, value, filename and Content-Type are set.","multipart.Set(\"profilePicture\", new FilePayload()","{"," Name = \"john.jpg\","," MimeType = \"image/jpeg\","," Buffer = File.ReadAllBytes(\"john.jpg\")","});","multipart.Set(\"age\", 30);","await Page.APIRequest.PostAsync(\"https://localhost/submit\", new() { Multipart = multipart });"],"codeLang":"csharp"}],"required":true,"comment":"Sets a field on the form. File values can be passed either as `Path` or as `FilePayload`.\n\n```java\nimport com.microsoft.playwright.options.FormData;\n...\nFormData form = FormData.create()\n // Only name and value are set.\n .set(\"firstName\", \"John\")\n // Name and value are set, filename and Content-Type are inferred from the file path.\n .set(\"profilePicture1\", Paths.get(\"john.jpg\"))\n // Name, value, filename and Content-Type are set.\n .set(\"profilePicture2\", new FilePayload(\"john.jpg\", \"image/jpeg\", Files.readAllBytes(Paths.get(\"john.jpg\"))))\n .set(\"age\", 30);\npage.request().post(\"http://localhost/submit\", RequestOptions.create().setForm(form));\n```\n\n```csharp\nvar multipart = Context.APIRequest.CreateFormData();\n// Only name and value are set.\nmultipart.Set(\"firstName\", \"John\");\n// Name, value, filename and Content-Type are set.\nmultipart.Set(\"profilePicture\", new FilePayload()\n{\n Name = \"john.jpg\",\n MimeType = \"image/jpeg\",\n Buffer = File.ReadAllBytes(\"john.jpg\")\n});\nmultipart.Set(\"age\", 30);\nawait Page.APIRequest.PostAsync(\"https://localhost/submit\", new() { Multipart = multipart });\n```\n","async":false,"alias":"set","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Field name."}],"required":true,"comment":"Field name.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"overrides":{"csharp":{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"value","type":{"name":"","union":[{"name":"string"},{"name":"boolean"},{"name":"int"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"argsArray":[],"required":true,"comment":"File name","args":{},"clazz":null,"async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"argsArray":[],"required":true,"comment":"File type","args":{},"clazz":null,"async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"argsArray":[],"required":true,"comment":"File content","args":{},"clazz":null,"async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]}],"expression":"[string]|[boolean]|[int]|[Object]"},"spec":[{"type":"text","text":"Field value."}],"argsArray":[],"required":true,"comment":"Field value.","args":{},"clazz":null,"async":false,"alias":"value","overloadIndex":0,"paramOrOption":null}}},"since":"v1.18","name":"value","type":{"name":"","union":[{"name":"string"},{"name":"boolean"},{"name":"int"},{"name":"Path"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]}],"expression":"[string]|[boolean]|[int]|[Path]|[Object]"},"spec":[{"type":"text","text":"Field value."}],"required":true,"comment":"Field value.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null}]}]},{"name":"Frame","spec":[{"type":"text","text":"At every point of time, page exposes its current frame tree via the [`method: Page.mainFrame`] and↵[`method: Frame.childFrames`] methods."},{"type":"text","text":"`Frame` object's lifecycle is controlled by three events, dispatched on the page object:"},{"type":"li","text":"[`event: Page.frameAttached`] - fired when the frame gets attached to the page. A Frame can be attached to the page↵only once.","liType":"bullet"},{"type":"li","text":"[`event: Page.frameNavigated`] - fired when the frame commits navigation to a different URL.","liType":"bullet"},{"type":"li","text":"[`event: Page.frameDetached`] - fired when the frame gets detached from the page. A Frame can be detached from the↵page only once.","liType":"bullet"},{"type":"text","text":"An example of dumping frame tree:"},{"type":"code","lines":["const { firefox } = require('playwright'); // Or 'chromium' or 'webkit'.","","(async () => {"," const browser = await firefox.launch();"," const page = await browser.newPage();"," await page.goto('https://www.google.com/chrome/browser/canary.html');"," dumpFrameTree(page.mainFrame(), '');"," await browser.close();",""," function dumpFrameTree(frame, indent) {"," console.log(indent + frame.url());"," for (const child of frame.childFrames())"," dumpFrameTree(child, indent + ' ');"," }","})();"],"codeLang":"js"},{"type":"code","lines":["import com.microsoft.playwright.*;","","public class Example {"," public static void main(String[] args) {"," try (Playwright playwright = Playwright.create()) {"," BrowserType firefox = playwright.firefox();"," Browser browser = firefox.launch();"," Page page = browser.newPage();"," page.navigate(\"https://www.google.com/chrome/browser/canary.html\");"," dumpFrameTree(page.mainFrame(), \"\");"," browser.close();"," }"," }"," static void dumpFrameTree(Frame frame, String indent) {"," System.out.println(indent + frame.url());"," for (Frame child : frame.childFrames()) {"," dumpFrameTree(child, indent + \" \");"," }"," }","}"],"codeLang":"java"},{"type":"code","lines":["import asyncio","from playwright.async_api import async_playwright, Playwright","","async def run(playwright: Playwright):"," firefox = playwright.firefox"," browser = await firefox.launch()"," page = await browser.new_page()"," await page.goto(\"https://www.theverge.com\")"," dump_frame_tree(page.main_frame, \"\")"," await browser.close()","","def dump_frame_tree(frame, indent):"," print(indent + frame.name + '@' + frame.url)"," for child in frame.child_frames:"," dump_frame_tree(child, indent + \" \")","","async def main():"," async with async_playwright() as playwright:"," await run(playwright)","asyncio.run(main())"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import sync_playwright, Playwright","","def run(playwright: Playwright):"," firefox = playwright.firefox"," browser = firefox.launch()"," page = browser.new_page()"," page.goto(\"https://www.theverge.com\")"," dump_frame_tree(page.main_frame, \"\")"," browser.close()","","def dump_frame_tree(frame, indent):"," print(indent + frame.name + '@' + frame.url)"," for child in frame.child_frames:"," dump_frame_tree(child, indent + \" \")","","with sync_playwright() as playwright:"," run(playwright)"],"codeLang":"python sync"},{"type":"code","lines":["using Microsoft.Playwright;","using System;","using System.Threading.Tasks;","","class FrameExamples","{"," public static async Task Main()"," {"," using var playwright = await Playwright.CreateAsync();"," await using var browser = await playwright.Firefox.LaunchAsync();"," var page = await browser.NewPageAsync();",""," await page.GotoAsync(\"https://www.bing.com\");"," DumpFrameTree(page.MainFrame, string.Empty);"," }",""," private static void DumpFrameTree(IFrame frame, string indent)"," {"," Console.WriteLine($\"{indent}{frame.Url}\");"," foreach (var child in frame.ChildFrames)"," DumpFrameTree(child, indent + \" \");"," }","}"],"codeLang":"csharp"}],"langs":{},"comment":"At every point of time, page exposes its current frame tree via the [`method: Page.mainFrame`] and\n[`method: Frame.childFrames`] methods.\n\n`Frame` object's lifecycle is controlled by three events, dispatched on the page object:\n- [`event: Page.frameAttached`] - fired when the frame gets attached to the page. A Frame can be attached to the\n page only once.\n- [`event: Page.frameNavigated`] - fired when the frame commits navigation to a different URL.\n- [`event: Page.frameDetached`] - fired when the frame gets detached from the page. A Frame can be detached from\n the page only once.\n\nAn example of dumping frame tree:\n\n```js\nconst { firefox } = require('playwright'); // Or 'chromium' or 'webkit'.\n\n(async () => {\n const browser = await firefox.launch();\n const page = await browser.newPage();\n await page.goto('https://www.google.com/chrome/browser/canary.html');\n dumpFrameTree(page.mainFrame(), '');\n await browser.close();\n\n function dumpFrameTree(frame, indent) {\n console.log(indent + frame.url());\n for (const child of frame.childFrames())\n dumpFrameTree(child, indent + ' ');\n }\n})();\n```\n\n```java\nimport com.microsoft.playwright.*;\n\npublic class Example {\n public static void main(String[] args) {\n try (Playwright playwright = Playwright.create()) {\n BrowserType firefox = playwright.firefox();\n Browser browser = firefox.launch();\n Page page = browser.newPage();\n page.navigate(\"https://www.google.com/chrome/browser/canary.html\");\n dumpFrameTree(page.mainFrame(), \"\");\n browser.close();\n }\n }\n static void dumpFrameTree(Frame frame, String indent) {\n System.out.println(indent + frame.url());\n for (Frame child : frame.childFrames()) {\n dumpFrameTree(child, indent + \" \");\n }\n }\n}\n```\n\n```py\nimport asyncio\nfrom playwright.async_api import async_playwright, Playwright\n\nasync def run(playwright: Playwright):\n firefox = playwright.firefox\n browser = await firefox.launch()\n page = await browser.new_page()\n await page.goto(\"https://www.theverge.com\")\n dump_frame_tree(page.main_frame, \"\")\n await browser.close()\n\ndef dump_frame_tree(frame, indent):\n print(indent + frame.name + '@' + frame.url)\n for child in frame.child_frames:\n dump_frame_tree(child, indent + \" \")\n\nasync def main():\n async with async_playwright() as playwright:\n await run(playwright)\nasyncio.run(main())\n```\n\n```py\nfrom playwright.sync_api import sync_playwright, Playwright\n\ndef run(playwright: Playwright):\n firefox = playwright.firefox\n browser = firefox.launch()\n page = browser.new_page()\n page.goto(\"https://www.theverge.com\")\n dump_frame_tree(page.main_frame, \"\")\n browser.close()\n\ndef dump_frame_tree(frame, indent):\n print(indent + frame.name + '@' + frame.url)\n for child in frame.child_frames:\n dump_frame_tree(child, indent + \" \")\n\nwith sync_playwright() as playwright:\n run(playwright)\n```\n\n```csharp\nusing Microsoft.Playwright;\nusing System;\nusing System.Threading.Tasks;\n\nclass FrameExamples\n{\n public static async Task Main()\n {\n using var playwright = await Playwright.CreateAsync();\n await using var browser = await playwright.Firefox.LaunchAsync();\n var page = await browser.NewPageAsync();\n\n await page.GotoAsync(\"https://www.bing.com\");\n DumpFrameTree(page.MainFrame, string.Empty);\n }\n\n private static void DumpFrameTree(IFrame frame, string indent)\n {\n Console.WriteLine($\"{indent}{frame.Url}\");\n foreach (var child in frame.ChildFrames)\n DumpFrameTree(child, indent + \" \");\n }\n}\n```\n","since":"v1.8","members":[{"kind":"method","langs":{},"since":"v1.8","name":"addScriptTag","type":{"name":"ElementHandle","expression":"[ElementHandle]"},"spec":[{"type":"text","text":"Returns the added tag when the script's onload fires or when the script content was injected into frame."},{"type":"text","text":"Adds a `<script>` tag into the page with the desired url or content."}],"required":true,"comment":"Returns the added tag when the script's onload fires or when the script content was injected into frame.\n\nAdds a `<script>` tag into the page with the desired url or content.","async":true,"alias":"addScriptTag","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"content","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Raw JavaScript content to be injected into frame."}],"required":false,"comment":"Raw JavaScript content to be injected into frame.","async":false,"alias":"content","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the JavaScript file to be injected into frame. If `path` is a relative path, then it is resolved relative to the↵current working directory."}],"required":false,"comment":"Path to the JavaScript file to be injected into frame. If `path` is a relative path, then it is resolved relative\nto the current working directory.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"type","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Script type. Use 'module' in order to load a Javascript ES6 module. See↵[script](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script) for more details."}],"required":false,"comment":"Script type. Use 'module' in order to load a Javascript ES6 module. See\n[script](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script) for more details.","async":false,"alias":"type","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"url","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"URL of a script to be added."}],"required":false,"comment":"URL of a script to be added.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"addStyleTag","type":{"name":"ElementHandle","expression":"[ElementHandle]"},"spec":[{"type":"text","text":"Returns the added tag when the stylesheet's onload fires or when the CSS content was injected into frame."},{"type":"text","text":"Adds a `<link rel=\"stylesheet\">` tag into the page with the desired url or a `<style type=\"text/css\">` tag with the↵content."}],"required":true,"comment":"Returns the added tag when the stylesheet's onload fires or when the CSS content was injected into frame.\n\nAdds a `<link rel=\"stylesheet\">` tag into the page with the desired url or a `<style type=\"text/css\">` tag with the\ncontent.","async":true,"alias":"addStyleTag","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"content","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Raw CSS content to be injected into frame."}],"required":false,"comment":"Raw CSS content to be injected into frame.","async":false,"alias":"content","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the CSS file to be injected into frame. If `path` is a relative path, then it is resolved relative to the↵current working directory."}],"required":false,"comment":"Path to the CSS file to be injected into frame. If `path` is a relative path, then it is resolved relative to the\ncurrent working directory.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"url","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"URL of the `<link>` tag."}],"required":false,"comment":"URL of the `<link>` tag.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.check`] instead. Read more about [locators](../locators.md).","name":"check","type":{"name":"void"},"spec":[{"type":"text","text":"This method checks an element matching `selector` by performing the following steps:"},{"type":"li","text":"Find an element matching `selector`. If there is none, wait until a matching element is attached to↵the DOM.","liType":"ordinal"},{"type":"li","text":"Ensure that matched element is a checkbox or a radio input. If not, this method throws. If the element is already↵checked, this method returns immediately.","liType":"ordinal"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is↵set. If the element is detached during the checks, the whole action is retried.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.mouse`] to click in the center of the element.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.","liType":"ordinal"},{"type":"li","text":"Ensure that the element is now checked. If not, this method throws.","liType":"ordinal"},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."}],"required":true,"comment":"This method checks an element matching `selector` by performing the following steps:\n1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.\n1. Ensure that matched element is a checkbox or a radio input. If not, this method throws. If the element is\n already checked, this method returns immediately.\n1. Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is set. If\n the element is detached during the checks, the whole action is retried.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.mouse`] to click in the center of the element.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n1. Ensure that the element is now checked. If not, this method throws.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.","async":true,"alias":"check","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"childFrames","type":{"name":"Array","templates":[{"name":"Frame"}],"expression":"[Array]<[Frame]>"},"spec":[],"required":true,"comment":"","async":false,"alias":"childFrames","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.click`] instead. Read more about [locators](../locators.md).","name":"click","type":{"name":"void"},"spec":[{"type":"text","text":"This method clicks an element matching `selector` by performing the following steps:"},{"type":"li","text":"Find an element matching `selector`. If there is none, wait until a matching element is attached to↵the DOM.","liType":"ordinal"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is↵set. If the element is detached during the checks, the whole action is retried.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.mouse`] to click in the center of the element, or the specified `position`.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.","liType":"ordinal"},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."}],"required":true,"comment":"This method clicks an element matching `selector` by performing the following steps:\n1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.\n1. Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is set. If\n the element is detached during the checks, the whole action is retried.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.mouse`] to click in the center of the element, or the specified `position`.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.","async":true,"alias":"click","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"button","type":{"name":"MouseButton","union":[{"name":"\"left\""},{"name":"\"right\""},{"name":"\"middle\""}],"expression":"[MouseButton]<\"left\"|\"right\"|\"middle\">"},"spec":[{"type":"text","text":"Defaults to `left`."}],"required":false,"comment":"Defaults to `left`.","async":false,"alias":"button","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"clickCount","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"defaults to 1. See [UIEvent.detail]."}],"required":false,"comment":"defaults to 1. See [UIEvent.detail].","async":false,"alias":"clickCount","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"delay","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0."}],"required":false,"comment":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.","async":false,"alias":"delay","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"modifiers","type":{"name":"Array","templates":[{"name":"KeyboardModifier","union":[{"name":"\"Alt\""},{"name":"\"Control\""},{"name":"\"ControlOrMeta\""},{"name":"\"Meta\""},{"name":"\"Shift\""}]}],"expression":"[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"ControlOrMeta\"|\"Meta\"|\"Shift\">>"},"spec":[{"type":"text","text":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current↵modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to \"Control\" on Windows↵and Linux and to \"Meta\" on macOS."}],"required":false,"comment":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores\ncurrent modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to\n\"Control\" on Windows and Linux and to \"Meta\" on macOS.","async":false,"alias":"modifiers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"content","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Gets the full HTML contents of the frame, including the doctype."}],"required":true,"comment":"Gets the full HTML contents of the frame, including the doctype.","async":true,"alias":"content","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"aliases":{"csharp":"DblClickAsync"},"types":{},"overrides":{}},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.dblclick`] instead. Read more about [locators](../locators.md).","name":"dblclick","type":{"name":"void"},"spec":[{"type":"text","text":"This method double clicks an element matching `selector` by performing the following steps:"},{"type":"li","text":"Find an element matching `selector`. If there is none, wait until a matching element is attached to↵the DOM.","liType":"ordinal"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is↵set. If the element is detached during the checks, the whole action is retried.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.mouse`] to double click in the center of the element, or the specified `position`.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that↵if the first click of the `dblclick()` triggers a navigation event, this method will throw.","liType":"ordinal"},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."},{"type":"note","noteType":"note","text":"`frame.dblclick()` dispatches two `click` events and a single `dblclick` event."}],"required":true,"comment":"This method double clicks an element matching `selector` by performing the following steps:\n1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.\n1. Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is set. If\n the element is detached during the checks, the whole action is retried.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.mouse`] to double click in the center of the element, or the specified `position`.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that if\n the first click of the `dblclick()` triggers a navigation event, this method will throw.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.\n\n**NOTE** `frame.dblclick()` dispatches two `click` events and a single `dblclick` event.","async":true,"alias":"dblclick","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"button","type":{"name":"MouseButton","union":[{"name":"\"left\""},{"name":"\"right\""},{"name":"\"middle\""}],"expression":"[MouseButton]<\"left\"|\"right\"|\"middle\">"},"spec":[{"type":"text","text":"Defaults to `left`."}],"required":false,"comment":"Defaults to `left`.","async":false,"alias":"button","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"delay","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0."}],"required":false,"comment":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.","async":false,"alias":"delay","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"modifiers","type":{"name":"Array","templates":[{"name":"KeyboardModifier","union":[{"name":"\"Alt\""},{"name":"\"Control\""},{"name":"\"ControlOrMeta\""},{"name":"\"Meta\""},{"name":"\"Shift\""}]}],"expression":"[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"ControlOrMeta\"|\"Meta\"|\"Shift\">>"},"spec":[{"type":"text","text":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current↵modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to \"Control\" on Windows↵and Linux and to \"Meta\" on macOS."}],"required":false,"comment":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores\ncurrent modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to\n\"Control\" on Windows and Linux and to \"Meta\" on macOS.","async":false,"alias":"modifiers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.dispatchEvent`] instead. Read more about [locators](../locators.md).","name":"dispatchEvent","type":{"name":"void"},"spec":[{"type":"text","text":"The snippet below dispatches the `click` event on the element. Regardless of the visibility state of the element, `click`↵is dispatched. This is equivalent to calling↵[element.click()](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/click)."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await frame.dispatchEvent('button#submit', 'click');"],"codeLang":"js"},{"type":"code","lines":["frame.dispatchEvent(\"button#submit\", \"click\");"],"codeLang":"java"},{"type":"code","lines":["await frame.dispatch_event(\"button#submit\", \"click\")"],"codeLang":"python async"},{"type":"code","lines":["frame.dispatch_event(\"button#submit\", \"click\")"],"codeLang":"python sync"},{"type":"code","lines":["await frame.DispatchEventAsync(\"button#submit\", \"click\");"],"codeLang":"csharp"},{"type":"text","text":"Under the hood, it creates an instance of an event based on the given `type`, initializes it with↵`eventInit` properties and dispatches it on the element. Events are `composed`, `cancelable` and bubble by↵default."},{"type":"text","text":"Since `eventInit` is event-specific, please refer to the events documentation for the lists of initial↵properties:"},{"type":"li","text":"[DeviceMotionEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceMotionEvent/DeviceMotionEvent)","liType":"bullet"},{"type":"li","text":"[DeviceOrientationEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceOrientationEvent/DeviceOrientationEvent)","liType":"bullet"},{"type":"li","text":"[DragEvent](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent/DragEvent)","liType":"bullet"},{"type":"li","text":"[Event](https://developer.mozilla.org/en-US/docs/Web/API/Event/Event)","liType":"bullet"},{"type":"li","text":"[FocusEvent](https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent/FocusEvent)","liType":"bullet"},{"type":"li","text":"[KeyboardEvent](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/KeyboardEvent)","liType":"bullet"},{"type":"li","text":"[MouseEvent](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/MouseEvent)","liType":"bullet"},{"type":"li","text":"[PointerEvent](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/PointerEvent)","liType":"bullet"},{"type":"li","text":"[TouchEvent](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/TouchEvent)","liType":"bullet"},{"type":"li","text":"[WheelEvent](https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent/WheelEvent)","liType":"bullet"},{"type":"text","text":"You can also specify `JSHandle` as the property value if you want live objects to be passed into the event:"},{"type":"code","lines":["// Note you can only create DataTransfer in Chromium and Firefox","const dataTransfer = await frame.evaluateHandle(() => new DataTransfer());","await frame.dispatchEvent('#source', 'dragstart', { dataTransfer });"],"codeLang":"js"},{"type":"code","lines":["// Note you can only create DataTransfer in Chromium and Firefox","JSHandle dataTransfer = frame.evaluateHandle(\"() => new DataTransfer()\");","Map<String, Object> arg = new HashMap<>();","arg.put(\"dataTransfer\", dataTransfer);","frame.dispatchEvent(\"#source\", \"dragstart\", arg);"],"codeLang":"java"},{"type":"code","lines":["# note you can only create data_transfer in chromium and firefox","data_transfer = await frame.evaluate_handle(\"new DataTransfer()\")","await frame.dispatch_event(\"#source\", \"dragstart\", { \"dataTransfer\": data_transfer })"],"codeLang":"python async"},{"type":"code","lines":["# note you can only create data_transfer in chromium and firefox","data_transfer = frame.evaluate_handle(\"new DataTransfer()\")","frame.dispatch_event(\"#source\", \"dragstart\", { \"dataTransfer\": data_transfer })"],"codeLang":"python sync"},{"type":"code","lines":["// Note you can only create DataTransfer in Chromium and Firefox","var dataTransfer = await frame.EvaluateHandleAsync(\"() => new DataTransfer()\");","await frame.DispatchEventAsync(\"#source\", \"dragstart\", new { dataTransfer });"],"codeLang":"csharp"}],"required":true,"comment":"The snippet below dispatches the `click` event on the element. Regardless of the visibility state of the element,\n`click` is dispatched. This is equivalent to calling\n[element.click()](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/click).\n\n**Usage**\n\n```js\nawait frame.dispatchEvent('button#submit', 'click');\n```\n\n```java\nframe.dispatchEvent(\"button#submit\", \"click\");\n```\n\n```py\nawait frame.dispatch_event(\"button#submit\", \"click\")\n```\n\n```py\nframe.dispatch_event(\"button#submit\", \"click\")\n```\n\n```csharp\nawait frame.DispatchEventAsync(\"button#submit\", \"click\");\n```\n\nUnder the hood, it creates an instance of an event based on the given `type`, initializes it with `eventInit`\nproperties and dispatches it on the element. Events are `composed`, `cancelable` and bubble by default.\n\nSince `eventInit` is event-specific, please refer to the events documentation for the lists of initial properties:\n- [DeviceMotionEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceMotionEvent/DeviceMotionEvent)\n- [DeviceOrientationEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceOrientationEvent/DeviceOrientationEvent)\n- [DragEvent](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent/DragEvent)\n- [Event](https://developer.mozilla.org/en-US/docs/Web/API/Event/Event)\n- [FocusEvent](https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent/FocusEvent)\n- [KeyboardEvent](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/KeyboardEvent)\n- [MouseEvent](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/MouseEvent)\n- [PointerEvent](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/PointerEvent)\n- [TouchEvent](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/TouchEvent)\n- [WheelEvent](https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent/WheelEvent)\n\nYou can also specify `JSHandle` as the property value if you want live objects to be passed into the event:\n\n```js\n// Note you can only create DataTransfer in Chromium and Firefox\nconst dataTransfer = await frame.evaluateHandle(() => new DataTransfer());\nawait frame.dispatchEvent('#source', 'dragstart', { dataTransfer });\n```\n\n```java\n// Note you can only create DataTransfer in Chromium and Firefox\nJSHandle dataTransfer = frame.evaluateHandle(\"() => new DataTransfer()\");\nMap<String, Object> arg = new HashMap<>();\narg.put(\"dataTransfer\", dataTransfer);\nframe.dispatchEvent(\"#source\", \"dragstart\", arg);\n```\n\n```py\n# note you can only create data_transfer in chromium and firefox\ndata_transfer = await frame.evaluate_handle(\"new DataTransfer()\")\nawait frame.dispatch_event(\"#source\", \"dragstart\", { \"dataTransfer\": data_transfer })\n```\n\n```py\n# note you can only create data_transfer in chromium and firefox\ndata_transfer = frame.evaluate_handle(\"new DataTransfer()\")\nframe.dispatch_event(\"#source\", \"dragstart\", { \"dataTransfer\": data_transfer })\n```\n\n```csharp\n// Note you can only create DataTransfer in Chromium and Firefox\nvar dataTransfer = await frame.EvaluateHandleAsync(\"() => new DataTransfer()\");\nawait frame.DispatchEventAsync(\"#source\", \"dragstart\", new { dataTransfer });\n```\n","async":true,"alias":"dispatchEvent","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"type","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"DOM event type: `\"click\"`, `\"dragstart\"`, etc."}],"required":true,"comment":"DOM event type: `\"click\"`, `\"dragstart\"`, etc.","async":false,"alias":"type","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"eventInit","type":{"name":"EvaluationArgument","expression":"[EvaluationArgument]"},"spec":[{"type":"text","text":"Optional event-specific initialization properties."}],"required":false,"comment":"Optional event-specific initialization properties.","async":false,"alias":"eventInit","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.13","name":"dragAndDrop","type":{"name":"void"},"spec":[],"required":true,"comment":"","async":true,"alias":"dragAndDrop","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.13","name":"source","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element to drag. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element to drag. If there are multiple elements satisfying the selector, the first will\nbe used.","async":false,"alias":"source","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.13","name":"target","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element to drop onto. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element to drop onto. If there are multiple elements satisfying the selector, the first\nwill be used.","async":false,"alias":"target","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.13","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.13","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"sourcePosition","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Clicks on the source element at this point relative to the top-left corner of the element's padding box. If not specified, some visible point of the element is used."}],"required":false,"comment":"Clicks on the source element at this point relative to the top-left corner of the element's padding box. If not\nspecified, some visible point of the element is used.","async":false,"alias":"sourcePosition","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"targetPosition","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Drops on the target element at this point relative to the top-left corner of the element's padding box. If not specified, some visible point of the element is used."}],"required":false,"comment":"Drops on the target element at this point relative to the top-left corner of the element's padding box. If not\nspecified, some visible point of the element is used.","async":false,"alias":"targetPosition","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.13","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.13","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.13","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"python":"eval_on_selector","js":"$eval"},"types":{},"overrides":{}},"since":"v1.9","discouraged":"This method does not wait for the element to pass the actionability↵checks and therefore can lead to the flaky tests. Use [`method: Locator.evaluate`], other `Locator` helper methods or web-first assertions instead.","name":"evalOnSelector","type":{"name":"Serializable","expression":"[Serializable]"},"spec":[{"type":"text","text":"Returns the return value of `expression`."},{"type":"text","text":"The method finds an element matching the specified selector within the frame and passes it as a first argument to↵`expression`. If no↵elements match the selector, the method throws an error."},{"type":"text","text":"If `expression` returns a [Promise], then [`method: Frame.evalOnSelector`] would wait for the promise to resolve and return its↵value."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const searchValue = await frame.$eval('#search', el => el.value);","const preloadHref = await frame.$eval('link[rel=preload]', el => el.href);","const html = await frame.$eval('.main-container', (e, suffix) => e.outerHTML + suffix, 'hello');"],"codeLang":"js"},{"type":"code","lines":["String searchValue = (String) frame.evalOnSelector(\"#search\", \"el => el.value\");","String preloadHref = (String) frame.evalOnSelector(\"link[rel=preload]\", \"el => el.href\");","String html = (String) frame.evalOnSelector(\".main-container\", \"(e, suffix) => e.outerHTML + suffix\", \"hello\");"],"codeLang":"java"},{"type":"code","lines":["search_value = await frame.eval_on_selector(\"#search\", \"el => el.value\")","preload_href = await frame.eval_on_selector(\"link[rel=preload]\", \"el => el.href\")","html = await frame.eval_on_selector(\".main-container\", \"(e, suffix) => e.outerHTML + suffix\", \"hello\")"],"codeLang":"python async"},{"type":"code","lines":["search_value = frame.eval_on_selector(\"#search\", \"el => el.value\")","preload_href = frame.eval_on_selector(\"link[rel=preload]\", \"el => el.href\")","html = frame.eval_on_selector(\".main-container\", \"(e, suffix) => e.outerHTML + suffix\", \"hello\")"],"codeLang":"python sync"},{"type":"code","lines":["var searchValue = await frame.EvalOnSelectorAsync<string>(\"#search\", \"el => el.value\");","var preloadHref = await frame.EvalOnSelectorAsync<string>(\"link[rel=preload]\", \"el => el.href\");","var html = await frame.EvalOnSelectorAsync(\".main-container\", \"(e, suffix) => e.outerHTML + suffix\", \"hello\");"],"codeLang":"csharp"}],"required":true,"comment":"Returns the return value of `expression`.\n\nThe method finds an element matching the specified selector within the frame and passes it as a first argument to\n`expression`. If no elements match the selector, the method throws an error.\n\nIf `expression` returns a [Promise], then [`method: Frame.evalOnSelector`] would wait for the promise to resolve\nand return its value.\n\n**Usage**\n\n```js\nconst searchValue = await frame.$eval('#search', el => el.value);\nconst preloadHref = await frame.$eval('link[rel=preload]', el => el.href);\nconst html = await frame.$eval('.main-container', (e, suffix) => e.outerHTML + suffix, 'hello');\n```\n\n```java\nString searchValue = (String) frame.evalOnSelector(\"#search\", \"el => el.value\");\nString preloadHref = (String) frame.evalOnSelector(\"link[rel=preload]\", \"el => el.href\");\nString html = (String) frame.evalOnSelector(\".main-container\", \"(e, suffix) => e.outerHTML + suffix\", \"hello\");\n```\n\n```py\nsearch_value = await frame.eval_on_selector(\"#search\", \"el => el.value\")\npreload_href = await frame.eval_on_selector(\"link[rel=preload]\", \"el => el.href\")\nhtml = await frame.eval_on_selector(\".main-container\", \"(e, suffix) => e.outerHTML + suffix\", \"hello\")\n```\n\n```py\nsearch_value = frame.eval_on_selector(\"#search\", \"el => el.value\")\npreload_href = frame.eval_on_selector(\"link[rel=preload]\", \"el => el.href\")\nhtml = frame.eval_on_selector(\".main-container\", \"(e, suffix) => e.outerHTML + suffix\", \"hello\")\n```\n\n```csharp\nvar searchValue = await frame.EvalOnSelectorAsync<string>(\"#search\", \"el => el.value\");\nvar preloadHref = await frame.EvalOnSelectorAsync<string>(\"link[rel=preload]\", \"el => el.href\");\nvar html = await frame.EvalOnSelectorAsync(\".main-container\", \"(e, suffix) => e.outerHTML + suffix\", \"hello\");\n```\n","async":true,"alias":"evalOnSelector","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to query for."}],"required":true,"comment":"A selector to query for.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"overrides":{"js":{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"expression","type":{"name":"","union":[{"name":"function","args":[{"name":"Element"}]},{"name":"string"}],"expression":"[function]([Element])|[string]"},"spec":[{"type":"text","text":"Function to be evaluated in the page context."}],"argsArray":[],"required":true,"comment":"Function to be evaluated in the page context.","args":{},"clazz":null,"async":false,"alias":"pageFunction","overloadIndex":0,"paramOrOption":null}}},"since":"v1.9","name":"expression","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"JavaScript expression to be evaluated in the browser context. If the expression evaluates↵to a function, the function is automatically invoked."}],"required":true,"comment":"JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the\nfunction is automatically invoked.","async":false,"alias":"expression","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"arg","type":{"name":"EvaluationArgument","expression":"[EvaluationArgument]"},"spec":[{"type":"text","text":"Optional argument to pass to `expression`."}],"required":false,"comment":"Optional argument to pass to `expression`.","async":false,"alias":"arg","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"python":"eval_on_selector_all","js":"$$eval"},"types":{},"overrides":{}},"since":"v1.9","discouraged":"In most cases, [`method: Locator.evaluateAll`],↵other `Locator` helper methods and web-first assertions do a better job.","name":"evalOnSelectorAll","type":{"name":"Serializable","expression":"[Serializable]"},"spec":[{"type":"text","text":"Returns the return value of `expression`."},{"type":"text","text":"The method finds all elements matching the specified selector within the frame and passes an array of matched elements↵as a first argument to `expression`."},{"type":"text","text":"If `expression` returns a [Promise], then [`method: Frame.evalOnSelectorAll`] would wait for the promise to resolve and return its↵value."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const divsCounts = await frame.$$eval('div', (divs, min) => divs.length >= min, 10);"],"codeLang":"js"},{"type":"code","lines":["boolean divsCounts = (boolean) page.evalOnSelectorAll(\"div\", \"(divs, min) => divs.length >= min\", 10);"],"codeLang":"java"},{"type":"code","lines":["divs_counts = await frame.eval_on_selector_all(\"div\", \"(divs, min) => divs.length >= min\", 10)"],"codeLang":"python async"},{"type":"code","lines":["divs_counts = frame.eval_on_selector_all(\"div\", \"(divs, min) => divs.length >= min\", 10)"],"codeLang":"python sync"},{"type":"code","lines":["var divsCount = await frame.EvalOnSelectorAllAsync<bool>(\"div\", \"(divs, min) => divs.length >= min\", 10);"],"codeLang":"csharp"}],"required":true,"comment":"Returns the return value of `expression`.\n\nThe method finds all elements matching the specified selector within the frame and passes an array of matched\nelements as a first argument to `expression`.\n\nIf `expression` returns a [Promise], then [`method: Frame.evalOnSelectorAll`] would wait for the promise to resolve\nand return its value.\n\n**Usage**\n\n```js\nconst divsCounts = await frame.$$eval('div', (divs, min) => divs.length >= min, 10);\n```\n\n```java\nboolean divsCounts = (boolean) page.evalOnSelectorAll(\"div\", \"(divs, min) => divs.length >= min\", 10);\n```\n\n```py\ndivs_counts = await frame.eval_on_selector_all(\"div\", \"(divs, min) => divs.length >= min\", 10)\n```\n\n```py\ndivs_counts = frame.eval_on_selector_all(\"div\", \"(divs, min) => divs.length >= min\", 10)\n```\n\n```csharp\nvar divsCount = await frame.EvalOnSelectorAllAsync<bool>(\"div\", \"(divs, min) => divs.length >= min\", 10);\n```\n","async":true,"alias":"evalOnSelectorAll","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to query for."}],"required":true,"comment":"A selector to query for.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"overrides":{"js":{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"expression","type":{"name":"","union":[{"name":"function","args":[{"name":"Array","templates":[{"name":"Element"}]}]},{"name":"string"}],"expression":"[function]([Array]<[Element]>)|[string]"},"spec":[{"type":"text","text":"Function to be evaluated in the page context."}],"argsArray":[],"required":true,"comment":"Function to be evaluated in the page context.","args":{},"clazz":null,"async":false,"alias":"pageFunction","overloadIndex":0,"paramOrOption":null}}},"since":"v1.9","name":"expression","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"JavaScript expression to be evaluated in the browser context. If the expression evaluates↵to a function, the function is automatically invoked."}],"required":true,"comment":"JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the\nfunction is automatically invoked.","async":false,"alias":"expression","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"arg","type":{"name":"EvaluationArgument","expression":"[EvaluationArgument]"},"spec":[{"type":"text","text":"Optional argument to pass to `expression`."}],"required":false,"comment":"Optional argument to pass to `expression`.","async":false,"alias":"arg","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"evaluate","type":{"name":"Serializable","expression":"[Serializable]"},"spec":[{"type":"text","text":"Returns the return value of `expression`."},{"type":"text","text":"If the function passed to the [`method: Frame.evaluate`] returns a [Promise], then [`method: Frame.evaluate`] would wait for the promise to↵resolve and return its value."},{"type":"text","text":"If the function passed to the [`method: Frame.evaluate`] returns a non-[Serializable] value, then↵[`method: Frame.evaluate`] returns `undefined`. Playwright also supports transferring some↵additional values that are not serializable by `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const result = await frame.evaluate(([x, y]) => {"," return Promise.resolve(x * y);","}, [7, 8]);","console.log(result); // prints \"56\""],"codeLang":"js"},{"type":"code","lines":["Object result = frame.evaluate(\"([x, y]) => {\\n\" +"," \" return Promise.resolve(x * y);\\n\" +"," \"}\", Arrays.asList(7, 8));","System.out.println(result); // prints \"56\""],"codeLang":"java"},{"type":"code","lines":["result = await frame.evaluate(\"([x, y]) => Promise.resolve(x * y)\", [7, 8])","print(result) # prints \"56\""],"codeLang":"python async"},{"type":"code","lines":["result = frame.evaluate(\"([x, y]) => Promise.resolve(x * y)\", [7, 8])","print(result) # prints \"56\""],"codeLang":"python sync"},{"type":"code","lines":["var result = await frame.EvaluateAsync<int>(\"([x, y]) => Promise.resolve(x * y)\", new[] { 7, 8 });","Console.WriteLine(result);"],"codeLang":"csharp"},{"type":"text","text":"A string can also be passed in instead of a function."},{"type":"code","lines":["console.log(await frame.evaluate('1 + 2')); // prints \"3\""],"codeLang":"js"},{"type":"code","lines":["System.out.println(frame.evaluate(\"1 + 2\")); // prints \"3\""],"codeLang":"java"},{"type":"code","lines":["print(await frame.evaluate(\"1 + 2\")) # prints \"3\"","x = 10","print(await frame.evaluate(f\"1 + {x}\")) # prints \"11\""],"codeLang":"python async"},{"type":"code","lines":["print(frame.evaluate(\"1 + 2\")) # prints \"3\"","x = 10","print(frame.evaluate(f\"1 + {x}\")) # prints \"11\""],"codeLang":"python sync"},{"type":"code","lines":["Console.WriteLine(await frame.EvaluateAsync<int>(\"1 + 2\")); // prints \"3\""],"codeLang":"csharp"},{"type":"text","text":"`ElementHandle` instances can be passed as an argument to the [`method: Frame.evaluate`]:"},{"type":"code","lines":["const bodyHandle = await frame.evaluate('document.body');","const html = await frame.evaluate(([body, suffix]) =>"," body.innerHTML + suffix, [bodyHandle, 'hello'],",");","await bodyHandle.dispose();"],"codeLang":"js"},{"type":"code","lines":["ElementHandle bodyHandle = frame.evaluate(\"document.body\");","String html = (String) frame.evaluate(\"([body, suffix]) => body.innerHTML + suffix\", Arrays.asList(bodyHandle, \"hello\"));","bodyHandle.dispose();"],"codeLang":"java"},{"type":"code","lines":["body_handle = await frame.evaluate(\"document.body\")","html = await frame.evaluate(\"([body, suffix]) => body.innerHTML + suffix\", [body_handle, \"hello\"])","await body_handle.dispose()"],"codeLang":"python async"},{"type":"code","lines":["body_handle = frame.evaluate(\"document.body\")","html = frame.evaluate(\"([body, suffix]) => body.innerHTML + suffix\", [body_handle, \"hello\"])","body_handle.dispose()"],"codeLang":"python sync"},{"type":"code","lines":["var bodyHandle = await frame.EvaluateAsync(\"document.body\");","var html = await frame.EvaluateAsync<string>(\"([body, suffix]) => body.innerHTML + suffix\", new object [] { bodyHandle, \"hello\" });","await bodyHandle.DisposeAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Returns the return value of `expression`.\n\nIf the function passed to the [`method: Frame.evaluate`] returns a [Promise], then [`method: Frame.evaluate`] would\nwait for the promise to resolve and return its value.\n\nIf the function passed to the [`method: Frame.evaluate`] returns a non-[Serializable] value, then\n[`method: Frame.evaluate`] returns `undefined`. Playwright also supports transferring some additional values that\nare not serializable by `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`.\n\n**Usage**\n\n```js\nconst result = await frame.evaluate(([x, y]) => {\n return Promise.resolve(x * y);\n}, [7, 8]);\nconsole.log(result); // prints \"56\"\n```\n\n```java\nObject result = frame.evaluate(\"([x, y]) => {\\n\" +\n \" return Promise.resolve(x * y);\\n\" +\n \"}\", Arrays.asList(7, 8));\nSystem.out.println(result); // prints \"56\"\n```\n\n```py\nresult = await frame.evaluate(\"([x, y]) => Promise.resolve(x * y)\", [7, 8])\nprint(result) # prints \"56\"\n```\n\n```py\nresult = frame.evaluate(\"([x, y]) => Promise.resolve(x * y)\", [7, 8])\nprint(result) # prints \"56\"\n```\n\n```csharp\nvar result = await frame.EvaluateAsync<int>(\"([x, y]) => Promise.resolve(x * y)\", new[] { 7, 8 });\nConsole.WriteLine(result);\n```\n\nA string can also be passed in instead of a function.\n\n```js\nconsole.log(await frame.evaluate('1 + 2')); // prints \"3\"\n```\n\n```java\nSystem.out.println(frame.evaluate(\"1 + 2\")); // prints \"3\"\n```\n\n```py\nprint(await frame.evaluate(\"1 + 2\")) # prints \"3\"\nx = 10\nprint(await frame.evaluate(f\"1 + {x}\")) # prints \"11\"\n```\n\n```py\nprint(frame.evaluate(\"1 + 2\")) # prints \"3\"\nx = 10\nprint(frame.evaluate(f\"1 + {x}\")) # prints \"11\"\n```\n\n```csharp\nConsole.WriteLine(await frame.EvaluateAsync<int>(\"1 + 2\")); // prints \"3\"\n```\n\n`ElementHandle` instances can be passed as an argument to the [`method: Frame.evaluate`]:\n\n```js\nconst bodyHandle = await frame.evaluate('document.body');\nconst html = await frame.evaluate(([body, suffix]) =>\n body.innerHTML + suffix, [bodyHandle, 'hello'],\n);\nawait bodyHandle.dispose();\n```\n\n```java\nElementHandle bodyHandle = frame.evaluate(\"document.body\");\nString html = (String) frame.evaluate(\"([body, suffix]) => body.innerHTML + suffix\", Arrays.asList(bodyHandle, \"hello\"));\nbodyHandle.dispose();\n```\n\n```py\nbody_handle = await frame.evaluate(\"document.body\")\nhtml = await frame.evaluate(\"([body, suffix]) => body.innerHTML + suffix\", [body_handle, \"hello\"])\nawait body_handle.dispose()\n```\n\n```py\nbody_handle = frame.evaluate(\"document.body\")\nhtml = frame.evaluate(\"([body, suffix]) => body.innerHTML + suffix\", [body_handle, \"hello\"])\nbody_handle.dispose()\n```\n\n```csharp\nvar bodyHandle = await frame.EvaluateAsync(\"document.body\");\nvar html = await frame.EvaluateAsync<string>(\"([body, suffix]) => body.innerHTML + suffix\", new object [] { bodyHandle, \"hello\" });\nawait bodyHandle.DisposeAsync();\n```\n","async":true,"alias":"evaluate","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"overrides":{"js":{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"expression","type":{"name":"","union":[{"name":"function"},{"name":"string"}],"expression":"[function]|[string]"},"spec":[{"type":"text","text":"Function to be evaluated in the page context."}],"argsArray":[],"required":true,"comment":"Function to be evaluated in the page context.","args":{},"clazz":null,"async":false,"alias":"pageFunction","overloadIndex":0,"paramOrOption":null}}},"since":"v1.8","name":"expression","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"JavaScript expression to be evaluated in the browser context. If the expression evaluates↵to a function, the function is automatically invoked."}],"required":true,"comment":"JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the\nfunction is automatically invoked.","async":false,"alias":"expression","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"arg","type":{"name":"EvaluationArgument","expression":"[EvaluationArgument]"},"spec":[{"type":"text","text":"Optional argument to pass to `expression`."}],"required":false,"comment":"Optional argument to pass to `expression`.","async":false,"alias":"arg","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"evaluateHandle","type":{"name":"JSHandle","expression":"[JSHandle]"},"spec":[{"type":"text","text":"Returns the return value of `expression` as a `JSHandle`."},{"type":"text","text":"The only difference between [`method: Frame.evaluate`] and [`method: Frame.evaluateHandle`] is that↵[`method: Frame.evaluateHandle`] returns `JSHandle`."},{"type":"text","text":"If the function, passed to the [`method: Frame.evaluateHandle`], returns a [Promise], then↵[`method: Frame.evaluateHandle`] would wait for the promise to resolve and return its value."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["// Handle for the window object","const aWindowHandle = await frame.evaluateHandle(() => Promise.resolve(window));"],"codeLang":"js"},{"type":"code","lines":["// Handle for the window object.","JSHandle aWindowHandle = frame.evaluateHandle(\"() => Promise.resolve(window)\");"],"codeLang":"java"},{"type":"code","lines":["a_window_handle = await frame.evaluate_handle(\"Promise.resolve(window)\")","a_window_handle # handle for the window object."],"codeLang":"python async"},{"type":"code","lines":["a_window_handle = frame.evaluate_handle(\"Promise.resolve(window)\")","a_window_handle # handle for the window object."],"codeLang":"python sync"},{"type":"code","lines":["// Handle for the window object.","var aWindowHandle = await frame.EvaluateHandleAsync(\"() => Promise.resolve(window)\");"],"codeLang":"csharp"},{"type":"text","text":"A string can also be passed in instead of a function."},{"type":"code","lines":["const aHandle = await frame.evaluateHandle('document'); // Handle for the 'document'."],"codeLang":"js"},{"type":"code","lines":["JSHandle aHandle = frame.evaluateHandle(\"document\"); // Handle for the \"document\"."],"codeLang":"java"},{"type":"code","lines":["a_handle = await page.evaluate_handle(\"document\") # handle for the \"document\""],"codeLang":"python async"},{"type":"code","lines":["a_handle = page.evaluate_handle(\"document\") # handle for the \"document\""],"codeLang":"python sync"},{"type":"code","lines":["var docHandle = await frame.EvaluateHandleAsync(\"document\"); // Handle for the `document`"],"codeLang":"csharp"},{"type":"text","text":"`JSHandle` instances can be passed as an argument to the [`method: Frame.evaluateHandle`]:"},{"type":"code","lines":["const aHandle = await frame.evaluateHandle(() => document.body);","const resultHandle = await frame.evaluateHandle(([body, suffix]) =>"," body.innerHTML + suffix, [aHandle, 'hello'],",");","console.log(await resultHandle.jsonValue());","await resultHandle.dispose();"],"codeLang":"js"},{"type":"code","lines":["JSHandle aHandle = frame.evaluateHandle(\"() => document.body\");","JSHandle resultHandle = frame.evaluateHandle(\"([body, suffix]) => body.innerHTML + suffix\", Arrays.asList(aHandle, \"hello\"));","System.out.println(resultHandle.jsonValue());","resultHandle.dispose();"],"codeLang":"java"},{"type":"code","lines":["a_handle = await page.evaluate_handle(\"document.body\")","result_handle = await page.evaluate_handle(\"body => body.innerHTML\", a_handle)","print(await result_handle.json_value())","await result_handle.dispose()"],"codeLang":"python async"},{"type":"code","lines":["a_handle = page.evaluate_handle(\"document.body\")","result_handle = page.evaluate_handle(\"body => body.innerHTML\", a_handle)","print(result_handle.json_value())","result_handle.dispose()"],"codeLang":"python sync"},{"type":"code","lines":["var handle = await frame.EvaluateHandleAsync(\"() => document.body\");","var resultHandle = await frame.EvaluateHandleAsync(\"([body, suffix]) => body.innerHTML + suffix\", new object[] { handle, \"hello\" });","Console.WriteLine(await resultHandle.JsonValueAsync<string>());","await resultHandle.DisposeAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Returns the return value of `expression` as a `JSHandle`.\n\nThe only difference between [`method: Frame.evaluate`] and [`method: Frame.evaluateHandle`] is that\n[`method: Frame.evaluateHandle`] returns `JSHandle`.\n\nIf the function, passed to the [`method: Frame.evaluateHandle`], returns a [Promise], then\n[`method: Frame.evaluateHandle`] would wait for the promise to resolve and return its value.\n\n**Usage**\n\n```js\n// Handle for the window object\nconst aWindowHandle = await frame.evaluateHandle(() => Promise.resolve(window));\n```\n\n```java\n// Handle for the window object.\nJSHandle aWindowHandle = frame.evaluateHandle(\"() => Promise.resolve(window)\");\n```\n\n```py\na_window_handle = await frame.evaluate_handle(\"Promise.resolve(window)\")\na_window_handle # handle for the window object.\n```\n\n```py\na_window_handle = frame.evaluate_handle(\"Promise.resolve(window)\")\na_window_handle # handle for the window object.\n```\n\n```csharp\n// Handle for the window object.\nvar aWindowHandle = await frame.EvaluateHandleAsync(\"() => Promise.resolve(window)\");\n```\n\nA string can also be passed in instead of a function.\n\n```js\nconst aHandle = await frame.evaluateHandle('document'); // Handle for the 'document'.\n```\n\n```java\nJSHandle aHandle = frame.evaluateHandle(\"document\"); // Handle for the \"document\".\n```\n\n```py\na_handle = await page.evaluate_handle(\"document\") # handle for the \"document\"\n```\n\n```py\na_handle = page.evaluate_handle(\"document\") # handle for the \"document\"\n```\n\n```csharp\nvar docHandle = await frame.EvaluateHandleAsync(\"document\"); // Handle for the `document`\n```\n\n`JSHandle` instances can be passed as an argument to the [`method: Frame.evaluateHandle`]:\n\n```js\nconst aHandle = await frame.evaluateHandle(() => document.body);\nconst resultHandle = await frame.evaluateHandle(([body, suffix]) =>\n body.innerHTML + suffix, [aHandle, 'hello'],\n);\nconsole.log(await resultHandle.jsonValue());\nawait resultHandle.dispose();\n```\n\n```java\nJSHandle aHandle = frame.evaluateHandle(\"() => document.body\");\nJSHandle resultHandle = frame.evaluateHandle(\"([body, suffix]) => body.innerHTML + suffix\", Arrays.asList(aHandle, \"hello\"));\nSystem.out.println(resultHandle.jsonValue());\nresultHandle.dispose();\n```\n\n```py\na_handle = await page.evaluate_handle(\"document.body\")\nresult_handle = await page.evaluate_handle(\"body => body.innerHTML\", a_handle)\nprint(await result_handle.json_value())\nawait result_handle.dispose()\n```\n\n```py\na_handle = page.evaluate_handle(\"document.body\")\nresult_handle = page.evaluate_handle(\"body => body.innerHTML\", a_handle)\nprint(result_handle.json_value())\nresult_handle.dispose()\n```\n\n```csharp\nvar handle = await frame.EvaluateHandleAsync(\"() => document.body\");\nvar resultHandle = await frame.EvaluateHandleAsync(\"([body, suffix]) => body.innerHTML + suffix\", new object[] { handle, \"hello\" });\nConsole.WriteLine(await resultHandle.JsonValueAsync<string>());\nawait resultHandle.DisposeAsync();\n```\n","async":true,"alias":"evaluateHandle","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"overrides":{"js":{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"expression","type":{"name":"","union":[{"name":"function"},{"name":"string"}],"expression":"[function]|[string]"},"spec":[{"type":"text","text":"Function to be evaluated in the page context."}],"argsArray":[],"required":true,"comment":"Function to be evaluated in the page context.","args":{},"clazz":null,"async":false,"alias":"pageFunction","overloadIndex":0,"paramOrOption":null}}},"since":"v1.8","name":"expression","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"JavaScript expression to be evaluated in the browser context. If the expression evaluates↵to a function, the function is automatically invoked."}],"required":true,"comment":"JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the\nfunction is automatically invoked.","async":false,"alias":"expression","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"arg","type":{"name":"EvaluationArgument","expression":"[EvaluationArgument]"},"spec":[{"type":"text","text":"Optional argument to pass to `expression`."}],"required":false,"comment":"Optional argument to pass to `expression`.","async":false,"alias":"arg","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.fill`] instead. Read more about [locators](../locators.md).","name":"fill","type":{"name":"void"},"spec":[{"type":"text","text":"This method waits for an element matching `selector`, waits for [actionability](../actionability.md) checks, focuses the element, fills it and triggers an `input` event after filling. Note that you can pass an empty string to clear the input field."},{"type":"text","text":"If the target element is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method throws an error. However, if the element is inside the `<label>` element that has an associated [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be filled instead."},{"type":"text","text":"To send fine-grained keyboard events, use [`method: Locator.pressSequentially`]."}],"required":true,"comment":"This method waits for an element matching `selector`, waits for [actionability](../actionability.md) checks,\nfocuses the element, fills it and triggers an `input` event after filling. Note that you can pass an empty string\nto clear the input field.\n\nIf the target element is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method throws an\nerror. However, if the element is inside the `<label>` element that has an associated\n[control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be filled\ninstead.\n\nTo send fine-grained keyboard events, use [`method: Locator.pressSequentially`].","async":true,"alias":"fill","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Value to fill for the `<input>`, `<textarea>` or `[contenteditable]` element."}],"required":true,"comment":"Value to fill for the `<input>`, `<textarea>` or `[contenteditable]` element.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.13","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.focus`] instead. Read more about [locators](../locators.md).","name":"focus","type":{"name":"void"},"spec":[{"type":"text","text":"This method fetches an element with `selector` and focuses it. If there's no element matching↵`selector`, the method waits until a matching element appears in the DOM."}],"required":true,"comment":"This method fetches an element with `selector` and focuses it. If there's no element matching `selector`, the\nmethod waits until a matching element appears in the DOM.","async":true,"alias":"focus","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"frameElement","type":{"name":"ElementHandle","expression":"[ElementHandle]"},"spec":[{"type":"text","text":"Returns the `frame` or `iframe` element handle which corresponds to this frame."},{"type":"text","text":"This is an inverse of [`method: ElementHandle.contentFrame`]. Note that returned handle actually belongs to the parent↵frame."},{"type":"text","text":"This method throws an error if the frame has been detached before `frameElement()` returns."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const frameElement = await frame.frameElement();","const contentFrame = await frameElement.contentFrame();","console.log(frame === contentFrame); // -> true"],"codeLang":"js"},{"type":"code","lines":["ElementHandle frameElement = frame.frameElement();","Frame contentFrame = frameElement.contentFrame();","System.out.println(frame == contentFrame); // -> true"],"codeLang":"java"},{"type":"code","lines":["frame_element = await frame.frame_element()","content_frame = await frame_element.content_frame()","assert frame == content_frame"],"codeLang":"python async"},{"type":"code","lines":["frame_element = frame.frame_element()","content_frame = frame_element.content_frame()","assert frame == content_frame"],"codeLang":"python sync"},{"type":"code","lines":["var frameElement = await frame.FrameElementAsync();","var contentFrame = await frameElement.ContentFrameAsync();","Console.WriteLine(frame == contentFrame); // -> True"],"codeLang":"csharp"}],"required":true,"comment":"Returns the `frame` or `iframe` element handle which corresponds to this frame.\n\nThis is an inverse of [`method: ElementHandle.contentFrame`]. Note that returned handle actually belongs to the\nparent frame.\n\nThis method throws an error if the frame has been detached before `frameElement()` returns.\n\n**Usage**\n\n```js\nconst frameElement = await frame.frameElement();\nconst contentFrame = await frameElement.contentFrame();\nconsole.log(frame === contentFrame); // -> true\n```\n\n```java\nElementHandle frameElement = frame.frameElement();\nFrame contentFrame = frameElement.contentFrame();\nSystem.out.println(frame == contentFrame); // -> true\n```\n\n```py\nframe_element = await frame.frame_element()\ncontent_frame = await frame_element.content_frame()\nassert frame == content_frame\n```\n\n```py\nframe_element = frame.frame_element()\ncontent_frame = frame_element.content_frame()\nassert frame == content_frame\n```\n\n```csharp\nvar frameElement = await frame.FrameElementAsync();\nvar contentFrame = await frameElement.ContentFrameAsync();\nConsole.WriteLine(frame == contentFrame); // -> True\n```\n","async":true,"alias":"frameElement","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.17","name":"frameLocator","type":{"name":"FrameLocator","expression":"[FrameLocator]"},"spec":[{"type":"text","text":"When working with iframes, you can create a frame locator that will enter the iframe and allow selecting elements↵in that iframe."},{"type":"text","text":"**Usage**"},{"type":"text","text":"Following snippet locates element with text \"Submit\" in the iframe with id `my-frame`, like `<iframe id=\"my-frame\">`:"},{"type":"code","lines":["const locator = frame.frameLocator('#my-iframe').getByText('Submit');","await locator.click();"],"codeLang":"js"},{"type":"code","lines":["Locator locator = frame.frameLocator(\"#my-iframe\").getByText(\"Submit\");","locator.click();"],"codeLang":"java"},{"type":"code","lines":["locator = frame.frame_locator(\"#my-iframe\").get_by_text(\"Submit\")","await locator.click()"],"codeLang":"python async"},{"type":"code","lines":["locator = frame.frame_locator(\"#my-iframe\").get_by_text(\"Submit\")","locator.click()"],"codeLang":"python sync"},{"type":"code","lines":["var locator = frame.FrameLocator(\"#my-iframe\").GetByText(\"Submit\");","await locator.ClickAsync();"],"codeLang":"csharp"}],"required":true,"comment":"When working with iframes, you can create a frame locator that will enter the iframe and allow selecting elements\nin that iframe.\n\n**Usage**\n\nFollowing snippet locates element with text \"Submit\" in the iframe with id `my-frame`, like `<iframe\nid=\"my-frame\">`:\n\n```js\nconst locator = frame.frameLocator('#my-iframe').getByText('Submit');\nawait locator.click();\n```\n\n```java\nLocator locator = frame.frameLocator(\"#my-iframe\").getByText(\"Submit\");\nlocator.click();\n```\n\n```py\nlocator = frame.frame_locator(\"#my-iframe\").get_by_text(\"Submit\")\nawait locator.click()\n```\n\n```py\nlocator = frame.frame_locator(\"#my-iframe\").get_by_text(\"Submit\")\nlocator.click()\n```\n\n```csharp\nvar locator = frame.FrameLocator(\"#my-iframe\").GetByText(\"Submit\");\nawait locator.ClickAsync();\n```\n","async":false,"alias":"frameLocator","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.17","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to use when resolving DOM element."}],"required":true,"comment":"A selector to use when resolving DOM element.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.getAttribute`] instead. Read more about [locators](../locators.md).","name":"getAttribute","type":{"name":"","union":[{"name":"null"},{"name":"string"}],"expression":"[null]|[string]"},"spec":[{"type":"text","text":"Returns element attribute value."}],"required":true,"comment":"Returns element attribute value.","async":true,"alias":"getAttribute","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Attribute name to get the value for."}],"required":true,"comment":"Attribute name to get the value for.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByAltText","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Allows locating elements by their alt text."},{"type":"text","text":"**Usage**"},{"type":"text","text":"For example, this method will find the image by alt text \"Playwright logo\":"},{"type":"code","lines":["<img alt='Playwright logo'>"],"codeLang":"html"},{"type":"code","lines":["await page.getByAltText('Playwright logo').click();"],"codeLang":"js"},{"type":"code","lines":["page.getByAltText(\"Playwright logo\").click();"],"codeLang":"java"},{"type":"code","lines":["await page.get_by_alt_text(\"Playwright logo\").click()"],"codeLang":"python async"},{"type":"code","lines":["page.get_by_alt_text(\"Playwright logo\").click()"],"codeLang":"python sync"},{"type":"code","lines":["await page.GetByAltText(\"Playwright logo\").ClickAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Allows locating elements by their alt text.\n\n**Usage**\n\nFor example, this method will find the image by alt text \"Playwright logo\":\n\n```html\n<img alt='Playwright logo'>\n```\n\n```js\nawait page.getByAltText('Playwright logo').click();\n```\n\n```java\npage.getByAltText(\"Playwright logo\").click();\n```\n\n```py\nawait page.get_by_alt_text(\"Playwright logo\").click()\n```\n\n```py\npage.get_by_alt_text(\"Playwright logo\").click()\n```\n\n```csharp\nawait page.GetByAltText(\"Playwright logo\").ClickAsync();\n```\n","async":false,"alias":"getByAltText","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"text","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Text to locate the element for."}],"required":true,"comment":"Text to locate the element for.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.27","name":"exact","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a\nregular expression. Note that exact match still trims whitespace.","async":false,"alias":"exact","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByLabel","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Allows locating input elements by the text of the associated `<label>` or `aria-labelledby` element, or by the `aria-label` attribute."},{"type":"text","text":"**Usage**"},{"type":"text","text":"For example, this method will find inputs by label \"Username\" and \"Password\" in the following DOM:"},{"type":"code","lines":["<input aria-label=\"Username\">","<label for=\"password-input\">Password:</label>","<input id=\"password-input\">"],"codeLang":"html"},{"type":"code","lines":["await page.getByLabel('Username').fill('john');","await page.getByLabel('Password').fill('secret');"],"codeLang":"js"},{"type":"code","lines":["page.getByLabel(\"Username\").fill(\"john\");","page.getByLabel(\"Password\").fill(\"secret\");"],"codeLang":"java"},{"type":"code","lines":["await page.get_by_label(\"Username\").fill(\"john\")","await page.get_by_label(\"Password\").fill(\"secret\")"],"codeLang":"python async"},{"type":"code","lines":["page.get_by_label(\"Username\").fill(\"john\")","page.get_by_label(\"Password\").fill(\"secret\")"],"codeLang":"python sync"},{"type":"code","lines":["await page.GetByLabel(\"Username\").FillAsync(\"john\");","await page.GetByLabel(\"Password\").FillAsync(\"secret\");"],"codeLang":"csharp"}],"required":true,"comment":"Allows locating input elements by the text of the associated `<label>` or `aria-labelledby` element, or by the\n`aria-label` attribute.\n\n**Usage**\n\nFor example, this method will find inputs by label \"Username\" and \"Password\" in the following DOM:\n\n```html\n<input aria-label=\"Username\">\n<label for=\"password-input\">Password:</label>\n<input id=\"password-input\">\n```\n\n```js\nawait page.getByLabel('Username').fill('john');\nawait page.getByLabel('Password').fill('secret');\n```\n\n```java\npage.getByLabel(\"Username\").fill(\"john\");\npage.getByLabel(\"Password\").fill(\"secret\");\n```\n\n```py\nawait page.get_by_label(\"Username\").fill(\"john\")\nawait page.get_by_label(\"Password\").fill(\"secret\")\n```\n\n```py\npage.get_by_label(\"Username\").fill(\"john\")\npage.get_by_label(\"Password\").fill(\"secret\")\n```\n\n```csharp\nawait page.GetByLabel(\"Username\").FillAsync(\"john\");\nawait page.GetByLabel(\"Password\").FillAsync(\"secret\");\n```\n","async":false,"alias":"getByLabel","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"text","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Text to locate the element for."}],"required":true,"comment":"Text to locate the element for.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.27","name":"exact","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a\nregular expression. Note that exact match still trims whitespace.","async":false,"alias":"exact","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByPlaceholder","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Allows locating input elements by the placeholder text."},{"type":"text","text":"**Usage**"},{"type":"text","text":"For example, consider the following DOM structure."},{"type":"code","lines":["<input type=\"email\" placeholder=\"name@example.com\" />"],"codeLang":"html"},{"type":"text","text":"You can fill the input after locating it by the placeholder text:"},{"type":"code","lines":["await page"," .getByPlaceholder('name@example.com')"," .fill('playwright@microsoft.com');"],"codeLang":"js"},{"type":"code","lines":["page.getByPlaceholder(\"name@example.com\").fill(\"playwright@microsoft.com\");"],"codeLang":"java"},{"type":"code","lines":["await page.get_by_placeholder(\"name@example.com\").fill(\"playwright@microsoft.com\")"],"codeLang":"python async"},{"type":"code","lines":["page.get_by_placeholder(\"name@example.com\").fill(\"playwright@microsoft.com\")"],"codeLang":"python sync"},{"type":"code","lines":["await page"," .GetByPlaceholder(\"name@example.com\")"," .FillAsync(\"playwright@microsoft.com\");"],"codeLang":"csharp"}],"required":true,"comment":"Allows locating input elements by the placeholder text.\n\n**Usage**\n\nFor example, consider the following DOM structure.\n\n```html\n<input type=\"email\" placeholder=\"name@example.com\" />\n```\n\nYou can fill the input after locating it by the placeholder text:\n\n```js\nawait page\n .getByPlaceholder('name@example.com')\n .fill('playwright@microsoft.com');\n```\n\n```java\npage.getByPlaceholder(\"name@example.com\").fill(\"playwright@microsoft.com\");\n```\n\n```py\nawait page.get_by_placeholder(\"name@example.com\").fill(\"playwright@microsoft.com\")\n```\n\n```py\npage.get_by_placeholder(\"name@example.com\").fill(\"playwright@microsoft.com\")\n```\n\n```csharp\nawait page\n .GetByPlaceholder(\"name@example.com\")\n .FillAsync(\"playwright@microsoft.com\");\n```\n","async":false,"alias":"getByPlaceholder","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"text","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Text to locate the element for."}],"required":true,"comment":"Text to locate the element for.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.27","name":"exact","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a\nregular expression. Note that exact match still trims whitespace.","async":false,"alias":"exact","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByRole","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"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)."},{"type":"text","text":"**Usage**"},{"type":"text","text":"Consider the following DOM structure."},{"type":"code","lines":["<h3>Sign up</h3>","<label>"," <input type=\"checkbox\" /> Subscribe","</label>","<br/>","<button>Submit</button>"],"codeLang":"html"},{"type":"text","text":"You can locate each element by it's implicit role:"},{"type":"code","lines":["await expect(page.getByRole('heading', { name: 'Sign up' })).toBeVisible();","","await page.getByRole('checkbox', { name: 'Subscribe' }).check();","","await page.getByRole('button', { name: /submit/i }).click();"],"codeLang":"js"},{"type":"code","lines":["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()"],"codeLang":"python async"},{"type":"code","lines":["expect(page.get_by_role(\"heading\", name=\"Sign up\")).to_be_visible()","","page.get_by_role(\"checkbox\", name=\"Subscribe\").check()","","page.get_by_role(\"button\", name=re.compile(\"submit\", re.IGNORECASE)).click()"],"codeLang":"python sync"},{"type":"code","lines":["assertThat(page"," .getByRole(AriaRole.HEADING,"," new Page.GetByRoleOptions().setName(\"Sign up\")))"," .isVisible();","","page.getByRole(AriaRole.CHECKBOX,"," new Page.GetByRoleOptions().setName(\"Subscribe\"))"," .check();","","page.getByRole(AriaRole.BUTTON,"," new Page.GetByRoleOptions().setName("," Pattern.compile(\"submit\", Pattern.CASE_INSENSITIVE)))"," .click();"],"codeLang":"java"},{"type":"code","lines":["await Expect(Page"," .GetByRole(AriaRole.Heading, new() { Name = \"Sign up\" }))"," .ToBeVisibleAsync();","","await page"," .GetByRole(AriaRole.Checkbox, new() { Name = \"Subscribe\" })"," .CheckAsync();","","await page"," .GetByRole(AriaRole.Button, new() {"," NameRegex = new Regex(\"submit\", RegexOptions.IgnoreCase)"," })"," .ClickAsync();"],"codeLang":"csharp"},{"type":"text","text":"**Details**"},{"type":"text","text":"Role selector **does not replace** accessibility audits and conformance tests, but rather gives early feedback about the ARIA guidelines."},{"type":"text","text":"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."}],"required":true,"comment":"Allows locating elements by their [ARIA role](https://www.w3.org/TR/wai-aria-1.2/#roles),\n[ARIA attributes](https://www.w3.org/TR/wai-aria-1.2/#aria-attributes) and\n[accessible name](https://w3c.github.io/accname/#dfn-accessible-name).\n\n**Usage**\n\nConsider the following DOM structure.\n\n```html\n<h3>Sign up</h3>\n<label>\n <input type=\"checkbox\" /> Subscribe\n</label>\n<br/>\n<button>Submit</button>\n```\n\nYou can locate each element by it's implicit role:\n\n```js\nawait expect(page.getByRole('heading', { name: 'Sign up' })).toBeVisible();\n\nawait page.getByRole('checkbox', { name: 'Subscribe' }).check();\n\nawait page.getByRole('button', { name: /submit/i }).click();\n```\n\n```py\nawait expect(page.get_by_role(\"heading\", name=\"Sign up\")).to_be_visible()\n\nawait page.get_by_role(\"checkbox\", name=\"Subscribe\").check()\n\nawait page.get_by_role(\"button\", name=re.compile(\"submit\", re.IGNORECASE)).click()\n```\n\n```py\nexpect(page.get_by_role(\"heading\", name=\"Sign up\")).to_be_visible()\n\npage.get_by_role(\"checkbox\", name=\"Subscribe\").check()\n\npage.get_by_role(\"button\", name=re.compile(\"submit\", re.IGNORECASE)).click()\n```\n\n```java\nassertThat(page\n .getByRole(AriaRole.HEADING,\n new Page.GetByRoleOptions().setName(\"Sign up\")))\n .isVisible();\n\npage.getByRole(AriaRole.CHECKBOX,\n new Page.GetByRoleOptions().setName(\"Subscribe\"))\n .check();\n\npage.getByRole(AriaRole.BUTTON,\n new Page.GetByRoleOptions().setName(\n Pattern.compile(\"submit\", Pattern.CASE_INSENSITIVE)))\n .click();\n```\n\n```csharp\nawait Expect(Page\n .GetByRole(AriaRole.Heading, new() { Name = \"Sign up\" }))\n .ToBeVisibleAsync();\n\nawait page\n .GetByRole(AriaRole.Checkbox, new() { Name = \"Subscribe\" })\n .CheckAsync();\n\nawait page\n .GetByRole(AriaRole.Button, new() {\n NameRegex = new Regex(\"submit\", RegexOptions.IgnoreCase)\n })\n .ClickAsync();\n```\n\n**Details**\n\nRole selector **does not replace** accessibility audits and conformance tests, but rather gives early feedback\nabout the ARIA guidelines.\n\nMany html elements have an implicitly [defined role](https://w3c.github.io/html-aam/#html-element-role-mappings)\nthat is recognized by the role selector. You can find all the\n[supported roles here](https://www.w3.org/TR/wai-aria-1.2/#role_definitions). ARIA guidelines **do not recommend**\nduplicating implicit roles and attributes by setting `role` and/or `aria-*` attributes to default values.","async":false,"alias":"getByRole","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"role","type":{"name":"AriaRole","union":[{"name":"\"alert\""},{"name":"\"alertdialog\""},{"name":"\"application\""},{"name":"\"article\""},{"name":"\"banner\""},{"name":"\"blockquote\""},{"name":"\"button\""},{"name":"\"caption\""},{"name":"\"cell\""},{"name":"\"checkbox\""},{"name":"\"code\""},{"name":"\"columnheader\""},{"name":"\"combobox\""},{"name":"\"complementary\""},{"name":"\"contentinfo\""},{"name":"\"definition\""},{"name":"\"deletion\""},{"name":"\"dialog\""},{"name":"\"directory\""},{"name":"\"document\""},{"name":"\"emphasis\""},{"name":"\"feed\""},{"name":"\"figure\""},{"name":"\"form\""},{"name":"\"generic\""},{"name":"\"grid\""},{"name":"\"gridcell\""},{"name":"\"group\""},{"name":"\"heading\""},{"name":"\"img\""},{"name":"\"insertion\""},{"name":"\"link\""},{"name":"\"list\""},{"name":"\"listbox\""},{"name":"\"listitem\""},{"name":"\"log\""},{"name":"\"main\""},{"name":"\"marquee\""},{"name":"\"math\""},{"name":"\"meter\""},{"name":"\"menu\""},{"name":"\"menubar\""},{"name":"\"menuitem\""},{"name":"\"menuitemcheckbox\""},{"name":"\"menuitemradio\""},{"name":"\"navigation\""},{"name":"\"none\""},{"name":"\"note\""},{"name":"\"option\""},{"name":"\"paragraph\""},{"name":"\"presentation\""},{"name":"\"progressbar\""},{"name":"\"radio\""},{"name":"\"radiogroup\""},{"name":"\"region\""},{"name":"\"row\""},{"name":"\"rowgroup\""},{"name":"\"rowheader\""},{"name":"\"scrollbar\""},{"name":"\"search\""},{"name":"\"searchbox\""},{"name":"\"separator\""},{"name":"\"slider\""},{"name":"\"spinbutton\""},{"name":"\"status\""},{"name":"\"strong\""},{"name":"\"subscript\""},{"name":"\"superscript\""},{"name":"\"switch\""},{"name":"\"tab\""},{"name":"\"table\""},{"name":"\"tablist\""},{"name":"\"tabpanel\""},{"name":"\"term\""},{"name":"\"textbox\""},{"name":"\"time\""},{"name":"\"timer\""},{"name":"\"toolbar\""},{"name":"\"tooltip\""},{"name":"\"tree\""},{"name":"\"treegrid\""},{"name":"\"treeitem\""}],"expression":"[AriaRole]<\"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\"|\"meter\"|\"menu\"|\"menubar\"|\"menuitem\"|\"menuitemcheckbox\"|\"menuitemradio\"|\"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\">"},"spec":[{"type":"text","text":"Required aria role."}],"required":true,"comment":"Required aria role.","async":false,"alias":"role","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.27","name":"checked","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"An attribute that is usually set by `aria-checked` or native `<input type=checkbox>` controls."},{"type":"text","text":"Learn more about [`aria-checked`](https://www.w3.org/TR/wai-aria-1.2/#aria-checked)."}],"required":false,"comment":"An attribute that is usually set by `aria-checked` or native `<input type=checkbox>` controls.\n\nLearn more about [`aria-checked`](https://www.w3.org/TR/wai-aria-1.2/#aria-checked).","async":false,"alias":"checked","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"disabled","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"An attribute that is usually set by `aria-disabled` or `disabled`."},{"type":"note","noteType":"note","text":"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)."}],"required":false,"comment":"An attribute that is usually set by `aria-disabled` or `disabled`.\n\n**NOTE** Unlike most other attributes, `disabled` is inherited through the DOM hierarchy. Learn more about\n[`aria-disabled`](https://www.w3.org/TR/wai-aria-1.2/#aria-disabled).","async":false,"alias":"disabled","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.28","name":"exact","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Whether `name` is matched exactly: case-sensitive and whole-string. Defaults to false. Ignored when `name` is a\nregular expression. Note that exact match still trims whitespace.","async":false,"alias":"exact","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"expanded","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"An attribute that is usually set by `aria-expanded`."},{"type":"text","text":"Learn more about [`aria-expanded`](https://www.w3.org/TR/wai-aria-1.2/#aria-expanded)."}],"required":false,"comment":"An attribute that is usually set by `aria-expanded`.\n\nLearn more about [`aria-expanded`](https://www.w3.org/TR/wai-aria-1.2/#aria-expanded).","async":false,"alias":"expanded","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"includeHidden","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."},{"type":"text","text":"Learn more about [`aria-hidden`](https://www.w3.org/TR/wai-aria-1.2/#aria-hidden)."}],"required":false,"comment":"Option that controls whether hidden elements are matched. By default, only non-hidden elements, as\n[defined by ARIA](https://www.w3.org/TR/wai-aria-1.2/#tree_exclusion), are matched by role selector.\n\nLearn more about [`aria-hidden`](https://www.w3.org/TR/wai-aria-1.2/#aria-hidden).","async":false,"alias":"includeHidden","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"level","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"A number attribute that is usually present for roles `heading`, `listitem`, `row`, `treeitem`, with default values for `<h1>-<h6>` elements."},{"type":"text","text":"Learn more about [`aria-level`](https://www.w3.org/TR/wai-aria-1.2/#aria-level)."}],"required":false,"comment":"A number attribute that is usually present for roles `heading`, `listitem`, `row`, `treeitem`, with default values\nfor `<h1>-<h6>` elements.\n\nLearn more about [`aria-level`](https://www.w3.org/TR/wai-aria-1.2/#aria-level).","async":false,"alias":"level","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"name","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"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."},{"type":"text","text":"Learn more about [accessible name](https://w3c.github.io/accname/#dfn-accessible-name)."}],"required":false,"comment":"Option to match the [accessible name](https://w3c.github.io/accname/#dfn-accessible-name). By default, matching is\ncase-insensitive and searches for a substring, use `exact` to control this behavior.\n\nLearn more about [accessible name](https://w3c.github.io/accname/#dfn-accessible-name).","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"pressed","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"An attribute that is usually set by `aria-pressed`."},{"type":"text","text":"Learn more about [`aria-pressed`](https://www.w3.org/TR/wai-aria-1.2/#aria-pressed)."}],"required":false,"comment":"An attribute that is usually set by `aria-pressed`.\n\nLearn more about [`aria-pressed`](https://www.w3.org/TR/wai-aria-1.2/#aria-pressed).","async":false,"alias":"pressed","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"selected","type":{"name":"boolean","expression":"boolean"},"spec":[{"type":"text","text":"An attribute that is usually set by `aria-selected`."},{"type":"text","text":"Learn more about [`aria-selected`](https://www.w3.org/TR/wai-aria-1.2/#aria-selected)."}],"required":false,"comment":"An attribute that is usually set by `aria-selected`.\n\nLearn more about [`aria-selected`](https://www.w3.org/TR/wai-aria-1.2/#aria-selected).","async":false,"alias":"selected","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByTestId","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Locate element by the test id."},{"type":"text","text":"**Usage**"},{"type":"text","text":"Consider the following DOM structure."},{"type":"code","lines":["<button data-testid=\"directions\">Itinéraire</button>"],"codeLang":"html"},{"type":"text","text":"You can locate the element by it's test id:"},{"type":"code","lines":["await page.getByTestId('directions').click();"],"codeLang":"js"},{"type":"code","lines":["page.getByTestId(\"directions\").click();"],"codeLang":"java"},{"type":"code","lines":["await page.get_by_test_id(\"directions\").click()"],"codeLang":"python async"},{"type":"code","lines":["page.get_by_test_id(\"directions\").click()"],"codeLang":"python sync"},{"type":"code","lines":["await page.GetByTestId(\"directions\").ClickAsync();"],"codeLang":"csharp"},{"type":"text","text":"**Details**"},{"type":"text","text":"By default, the `data-testid` attribute is used as a test id. Use [`method: Selectors.setTestIdAttribute`] to configure a different test id attribute if necessary."},{"type":"code","lines":["// Set custom test id attribute from @playwright/test config:","import { defineConfig } from '@playwright/test';","","export default defineConfig({"," use: {"," testIdAttribute: 'data-pw'"," },","});"],"codeLang":"js"}],"required":true,"comment":"Locate element by the test id.\n\n**Usage**\n\nConsider the following DOM structure.\n\n```html\n<button data-testid=\"directions\">Itinéraire</button>\n```\n\nYou can locate the element by it's test id:\n\n```js\nawait page.getByTestId('directions').click();\n```\n\n```java\npage.getByTestId(\"directions\").click();\n```\n\n```py\nawait page.get_by_test_id(\"directions\").click()\n```\n\n```py\npage.get_by_test_id(\"directions\").click()\n```\n\n```csharp\nawait page.GetByTestId(\"directions\").ClickAsync();\n```\n\n**Details**\n\nBy default, the `data-testid` attribute is used as a test id. Use [`method: Selectors.setTestIdAttribute`] to\nconfigure a different test id attribute if necessary.\n\n```js\n// Set custom test id attribute from @playwright/test config:\nimport { defineConfig } from '@playwright/test';\n\nexport default defineConfig({\n use: {\n testIdAttribute: 'data-pw'\n },\n});\n```\n","async":false,"alias":"getByTestId","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"testId","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Id to locate the element by."}],"required":true,"comment":"Id to locate the element by.","async":false,"alias":"testId","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByText","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Allows locating elements that contain given text."},{"type":"text","text":"See also [`method: Locator.filter`] that allows to match by another criteria, like an accessible role, and then filter by the text content."},{"type":"text","text":"**Usage**"},{"type":"text","text":"Consider the following DOM structure:"},{"type":"code","lines":["<div>Hello <span>world</span></div>","<div>Hello</div>"],"codeLang":"html"},{"type":"text","text":"You can locate by text substring, exact string, or a regular expression:"},{"type":"code","lines":["// Matches <span>","page.getByText('world');","","// Matches first <div>","page.getByText('Hello world');","","// Matches second <div>","page.getByText('Hello', { exact: true });","","// Matches both <div>s","page.getByText(/Hello/);","","// Matches second <div>","page.getByText(/^hello$/i);"],"codeLang":"js"},{"type":"code","lines":["# 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))"],"codeLang":"python async"},{"type":"code","lines":["# 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))"],"codeLang":"python sync"},{"type":"code","lines":["// Matches <span>","page.getByText(\"world\")","","// Matches first <div>","page.getByText(\"Hello world\")","","// Matches second <div>","page.getByText(\"Hello\", new Page.GetByTextOptions().setExact(true))","","// Matches both <div>s","page.getByText(Pattern.compile(\"Hello\"))","","// Matches second <div>","page.getByText(Pattern.compile(\"^hello$\", Pattern.CASE_INSENSITIVE))"],"codeLang":"java"},{"type":"code","lines":["// Matches <span>","page.GetByText(\"world\");","","// Matches first <div>","page.GetByText(\"Hello world\");","","// Matches second <div>","page.GetByText(\"Hello\", new() { Exact = true });","","// Matches both <div>s","page.GetByText(new Regex(\"Hello\"));","","// Matches second <div>","page.GetByText(new Regex(\"^hello$\", RegexOptions.IgnoreCase));"],"codeLang":"csharp"},{"type":"text","text":"**Details**"},{"type":"text","text":"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."},{"type":"text","text":"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\">`."}],"required":true,"comment":"Allows locating elements that contain given text.\n\nSee also [`method: Locator.filter`] that allows to match by another criteria, like an accessible role, and then\nfilter by the text content.\n\n**Usage**\n\nConsider the following DOM structure:\n\n```html\n<div>Hello <span>world</span></div>\n<div>Hello</div>\n```\n\nYou can locate by text substring, exact string, or a regular expression:\n\n```js\n// Matches <span>\npage.getByText('world');\n\n// Matches first <div>\npage.getByText('Hello world');\n\n// Matches second <div>\npage.getByText('Hello', { exact: true });\n\n// Matches both <div>s\npage.getByText(/Hello/);\n\n// Matches second <div>\npage.getByText(/^hello$/i);\n```\n\n```py\n# Matches <span>\npage.get_by_text(\"world\")\n\n# Matches first <div>\npage.get_by_text(\"Hello world\")\n\n# Matches second <div>\npage.get_by_text(\"Hello\", exact=True)\n\n# Matches both <div>s\npage.get_by_text(re.compile(\"Hello\"))\n\n# Matches second <div>\npage.get_by_text(re.compile(\"^hello$\", re.IGNORECASE))\n```\n\n```py\n# Matches <span>\npage.get_by_text(\"world\")\n\n# Matches first <div>\npage.get_by_text(\"Hello world\")\n\n# Matches second <div>\npage.get_by_text(\"Hello\", exact=True)\n\n# Matches both <div>s\npage.get_by_text(re.compile(\"Hello\"))\n\n# Matches second <div>\npage.get_by_text(re.compile(\"^hello$\", re.IGNORECASE))\n```\n\n```java\n// Matches <span>\npage.getByText(\"world\")\n\n// Matches first <div>\npage.getByText(\"Hello world\")\n\n// Matches second <div>\npage.getByText(\"Hello\", new Page.GetByTextOptions().setExact(true))\n\n// Matches both <div>s\npage.getByText(Pattern.compile(\"Hello\"))\n\n// Matches second <div>\npage.getByText(Pattern.compile(\"^hello$\", Pattern.CASE_INSENSITIVE))\n```\n\n```csharp\n// Matches <span>\npage.GetByText(\"world\");\n\n// Matches first <div>\npage.GetByText(\"Hello world\");\n\n// Matches second <div>\npage.GetByText(\"Hello\", new() { Exact = true });\n\n// Matches both <div>s\npage.GetByText(new Regex(\"Hello\"));\n\n// Matches second <div>\npage.GetByText(new Regex(\"^hello$\", RegexOptions.IgnoreCase));\n```\n\n**Details**\n\nMatching by text always normalizes whitespace, even with exact match. For example, it turns multiple spaces into\none, turns line breaks into spaces and ignores leading and trailing whitespace.\n\nInput elements of the type `button` and `submit` are matched by their `value` instead of the text content. For\nexample, locating by text `\"Log in\"` matches `<input type=button value=\"Log in\">`.","async":false,"alias":"getByText","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"text","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Text to locate the element for."}],"required":true,"comment":"Text to locate the element for.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.27","name":"exact","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a\nregular expression. Note that exact match still trims whitespace.","async":false,"alias":"exact","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByTitle","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Allows locating elements by their title attribute."},{"type":"text","text":"**Usage**"},{"type":"text","text":"Consider the following DOM structure."},{"type":"code","lines":["<span title='Issues count'>25 issues</span>"],"codeLang":"html"},{"type":"text","text":"You can check the issues count after locating it by the title text:"},{"type":"code","lines":["await expect(page.getByTitle('Issues count')).toHaveText('25 issues');"],"codeLang":"js"},{"type":"code","lines":["assertThat(page.getByTitle(\"Issues count\")).hasText(\"25 issues\");"],"codeLang":"java"},{"type":"code","lines":["await expect(page.get_by_title(\"Issues count\")).to_have_text(\"25 issues\")"],"codeLang":"python async"},{"type":"code","lines":["expect(page.get_by_title(\"Issues count\")).to_have_text(\"25 issues\")"],"codeLang":"python sync"},{"type":"code","lines":["await Expect(Page.GetByTitle(\"Issues count\")).toHaveText(\"25 issues\");"],"codeLang":"csharp"}],"required":true,"comment":"Allows locating elements by their title attribute.\n\n**Usage**\n\nConsider the following DOM structure.\n\n```html\n<span title='Issues count'>25 issues</span>\n```\n\nYou can check the issues count after locating it by the title text:\n\n```js\nawait expect(page.getByTitle('Issues count')).toHaveText('25 issues');\n```\n\n```java\nassertThat(page.getByTitle(\"Issues count\")).hasText(\"25 issues\");\n```\n\n```py\nawait expect(page.get_by_title(\"Issues count\")).to_have_text(\"25 issues\")\n```\n\n```py\nexpect(page.get_by_title(\"Issues count\")).to_have_text(\"25 issues\")\n```\n\n```csharp\nawait Expect(Page.GetByTitle(\"Issues count\")).toHaveText(\"25 issues\");\n```\n","async":false,"alias":"getByTitle","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"text","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Text to locate the element for."}],"required":true,"comment":"Text to locate the element for.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.27","name":"exact","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a\nregular expression. Note that exact match still trims whitespace.","async":false,"alias":"exact","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"navigate"},"types":{},"overrides":{}},"since":"v1.8","name":"goto","type":{"name":"","union":[{"name":"null"},{"name":"Response"}],"expression":"[null]|[Response]"},"spec":[{"type":"text","text":"Returns the main resource response. In case of multiple redirects, the navigation will resolve with the response of the↵last redirect."},{"type":"text","text":"The method will throw an error if:"},{"type":"li","text":"there's an SSL error (e.g. in case of self-signed certificates).","liType":"bullet"},{"type":"li","text":"target URL is invalid.","liType":"bullet"},{"type":"li","text":"the `timeout` is exceeded during navigation.","liType":"bullet"},{"type":"li","text":"the remote server does not respond or is unreachable.","liType":"bullet"},{"type":"li","text":"the main resource failed to load.","liType":"bullet"},{"type":"text","text":"The method will not throw an error when any valid HTTP status code is returned by the remote server, including 404↵\"Not Found\" and 500 \"Internal Server Error\". The status code for such responses can be retrieved by calling↵[`method: Response.status`]."},{"type":"note","noteType":"note","text":"The method either throws an error or returns a main resource response. The only exceptions are navigation to↵`about:blank` or navigation to the same URL with a different hash, which would succeed and return `null`."},{"type":"note","noteType":"note","text":"Headless mode doesn't support navigation to a PDF document. See the↵[upstream issue](https://bugs.chromium.org/p/chromium/issues/detail?id=761295)."}],"required":true,"comment":"Returns the main resource response. In case of multiple redirects, the navigation will resolve with the response of\nthe last redirect.\n\nThe method will throw an error if:\n- there's an SSL error (e.g. in case of self-signed certificates).\n- target URL is invalid.\n- the `timeout` is exceeded during navigation.\n- the remote server does not respond or is unreachable.\n- the main resource failed to load.\n\nThe method will not throw an error when any valid HTTP status code is returned by the remote server, including 404\n\"Not Found\" and 500 \"Internal Server Error\". The status code for such responses can be retrieved by calling\n[`method: Response.status`].\n\n**NOTE** The method either throws an error or returns a main resource response. The only exceptions are navigation\nto `about:blank` or navigation to the same URL with a different hash, which would succeed and return `null`.\n\n**NOTE** Headless mode doesn't support navigation to a PDF document. See the\n[upstream issue](https://bugs.chromium.org/p/chromium/issues/detail?id=761295).","async":true,"alias":"goto","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"url","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"URL to navigate frame to. The url should include scheme, e.g. `https://`."}],"required":true,"comment":"URL to navigate frame to. The url should include scheme, e.g. `https://`.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"referer","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Referer header value. If provided it will take preference over the referer header value set by↵[`method: Page.setExtraHTTPHeaders`]."}],"required":false,"comment":"Referer header value. If provided it will take preference over the referer header value set by\n[`method: Page.setExtraHTTPHeaders`].","async":false,"alias":"referer","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.↵The default value can be changed by using the↵[`method: BrowserContext.setDefaultNavigationTimeout`],↵[`method: BrowserContext.setDefaultTimeout`],↵[`method: Page.setDefaultNavigationTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `navigationTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultNavigationTimeout`],↵[`method: BrowserContext.setDefaultTimeout`],↵[`method: Page.setDefaultNavigationTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via\n`navigationTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"waitUntil","type":{"name":"WaitUntilState","union":[{"name":"\"load\""},{"name":"\"domcontentloaded\""},{"name":"\"networkidle\""},{"name":"\"commit\""}],"expression":"[WaitUntilState]<\"load\"|\"domcontentloaded\"|\"networkidle\"|\"commit\">"},"spec":[{"type":"text","text":"When to consider operation succeeded, defaults to `load`. Events can be either:"},{"type":"li","text":"`'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.","liType":"bullet"},{"type":"li","text":"`'load'` - consider operation to be finished when the `load` event is fired.","liType":"bullet"},{"type":"li","text":"`'networkidle'` - **DISCOURAGED** consider operation to be finished when there are no network connections for at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.","liType":"bullet"},{"type":"li","text":"`'commit'` - consider operation to be finished when network response is received and the document started loading.","liType":"bullet"}],"required":false,"comment":"When to consider operation succeeded, defaults to `load`. Events can be either:\n- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.\n- `'load'` - consider operation to be finished when the `load` event is fired.\n- `'networkidle'` - **DISCOURAGED** consider operation to be finished when there are no network connections for\n at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.\n- `'commit'` - consider operation to be finished when network response is received and the document started\n loading.","async":false,"alias":"waitUntil","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.hover`] instead. Read more about [locators](../locators.md).","name":"hover","type":{"name":"void"},"spec":[{"type":"text","text":"This method hovers over an element matching `selector` by performing the following steps:"},{"type":"li","text":"Find an element matching `selector`. If there is none, wait until a matching element is attached to↵the DOM.","liType":"ordinal"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is↵set. If the element is detached during the checks, the whole action is retried.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.mouse`] to hover over the center of the element, or the specified `position`.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.","liType":"ordinal"},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."}],"required":true,"comment":"This method hovers over an element matching `selector` by performing the following steps:\n1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.\n1. Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is set. If\n the element is detached during the checks, the whole action is retried.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.mouse`] to hover over the center of the element, or the specified `position`.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.","async":true,"alias":"hover","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"modifiers","type":{"name":"Array","templates":[{"name":"KeyboardModifier","union":[{"name":"\"Alt\""},{"name":"\"Control\""},{"name":"\"ControlOrMeta\""},{"name":"\"Meta\""},{"name":"\"Shift\""}]}],"expression":"[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"ControlOrMeta\"|\"Meta\"|\"Shift\">>"},"spec":[{"type":"text","text":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current↵modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to \"Control\" on Windows↵and Linux and to \"Meta\" on macOS."}],"required":false,"comment":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores\ncurrent modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to\n\"Control\" on Windows and Linux and to \"Meta\" on macOS.","async":false,"alias":"modifiers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.28","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.innerHTML`] instead. Read more about [locators](../locators.md).","name":"innerHTML","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Returns `element.innerHTML`."}],"required":true,"comment":"Returns `element.innerHTML`.","async":true,"alias":"innerHTML","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.innerText`] instead. Read more about [locators](../locators.md).","name":"innerText","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Returns `element.innerText`."}],"required":true,"comment":"Returns `element.innerText`.","async":true,"alias":"innerText","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.13","discouraged":"Use locator-based [`method: Locator.inputValue`] instead. Read more about [locators](../locators.md).","name":"inputValue","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element."},{"type":"text","text":"Throws for non-input elements. However, if the element is inside the `<label>` element that has an associated [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), returns the value of the control."}],"required":true,"comment":"Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element.\n\nThrows for non-input elements. However, if the element is inside the `<label>` element that has an associated\n[control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), returns the value of the\ncontrol.","async":true,"alias":"inputValue","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.13","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.13","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.13","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.isChecked`] instead. Read more about [locators](../locators.md).","name":"isChecked","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Returns whether the element is checked. Throws if the element is not a checkbox or radio input."}],"required":true,"comment":"Returns whether the element is checked. Throws if the element is not a checkbox or radio input.","async":true,"alias":"isChecked","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"isDetached","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Returns `true` if the frame has been detached, or `false` otherwise."}],"required":true,"comment":"Returns `true` if the frame has been detached, or `false` otherwise.","async":false,"alias":"isDetached","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.isDisabled`] instead. Read more about [locators](../locators.md).","name":"isDisabled","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Returns whether the element is disabled, the opposite of [enabled](../actionability.md#enabled)."}],"required":true,"comment":"Returns whether the element is disabled, the opposite of [enabled](../actionability.md#enabled).","async":true,"alias":"isDisabled","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.isEditable`] instead. Read more about [locators](../locators.md).","name":"isEditable","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Returns whether the element is [editable](../actionability.md#editable)."}],"required":true,"comment":"Returns whether the element is [editable](../actionability.md#editable).","async":true,"alias":"isEditable","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"isEnabled","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Returns whether the element is [enabled](../actionability.md#enabled)."}],"required":true,"comment":"Returns whether the element is [enabled](../actionability.md#enabled).","async":true,"alias":"isEnabled","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.isHidden`] instead. Read more about [locators](../locators.md).","name":"isHidden","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Returns whether the element is hidden, the opposite of [visible](../actionability.md#visible). `selector` that does not match any elements is considered hidden."}],"required":true,"comment":"Returns whether the element is hidden, the opposite of [visible](../actionability.md#visible). `selector` that\ndoes not match any elements is considered hidden.","async":true,"alias":"isHidden","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","deprecated":"This option is ignored. [`method: Frame.isHidden`] does not wait for the element to become hidden and returns immediately.","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[],"required":false,"comment":"","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.isVisible`] instead. Read more about [locators](../locators.md).","name":"isVisible","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Returns whether the element is [visible](../actionability.md#visible). `selector` that does not match any elements is considered not visible."}],"required":true,"comment":"Returns whether the element is [visible](../actionability.md#visible). `selector` that does not match any elements\nis considered not visible.","async":true,"alias":"isVisible","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","deprecated":"This option is ignored. [`method: Frame.isVisible`] does not wait for the element to become visible and returns immediately.","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[],"required":false,"comment":"","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"locator","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"The method returns an element locator that can be used to perform actions on this page / frame.↵Locator is resolved to the element immediately before performing an action, so a series of actions on the same locator can in fact be performed on different DOM elements. That would happen if the DOM structure between those actions has changed."},{"type":"text","text":"[Learn more about locators](../locators.md)."},{"type":"text","text":"[Learn more about locators](../locators.md)."}],"required":true,"comment":"The method returns an element locator that can be used to perform actions on this page / frame. Locator is resolved\nto the element immediately before performing an action, so a series of actions on the same locator can in fact be\nperformed on different DOM elements. That would happen if the DOM structure between those actions has changed.\n\n[Learn more about locators](../locators.md).\n\n[Learn more about locators](../locators.md).","async":false,"alias":"locator","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.14","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to use when resolving DOM element."}],"required":true,"comment":"A selector to use when resolving DOM element.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"has","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"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>`."},{"type":"text","text":"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`."},{"type":"text","text":"Note that outer and inner locators must belong to the same frame. Inner locator must not contain `FrameLocator`s."}],"required":false,"comment":"Narrows down the results of the method to those which contain elements matching this relative locator. For example,\n`article` that has `text=Playwright` matches `<article><div>Playwright</div></article>`.\n\nInner locator **must be relative** to the outer locator and is queried starting with the outer locator match, not\nthe document root. For example, you can find `content` that has `div` in\n`<article><content><div>Playwright</div></content></article>`. However, looking for `content` that has `article\ndiv` will fail, because the inner locator must be relative and should not use any elements outside the `content`.\n\nNote that outer and inner locators must belong to the same frame. Inner locator must not contain `FrameLocator`s.","async":false,"alias":"has","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.33","name":"hasNot","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"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>`."},{"type":"text","text":"Note that outer and inner locators must belong to the same frame. Inner locator must not contain `FrameLocator`s."}],"required":false,"comment":"Matches elements that do not contain an element that matches an inner locator. Inner locator is queried against the\nouter one. For example, `article` that does not have `div` matches `<article><span>Playwright</span></article>`.\n\nNote that outer and inner locators must belong to the same frame. Inner locator must not contain `FrameLocator`s.","async":false,"alias":"hasNot","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.33","name":"hasNotText","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Matches elements that do not contain specified text somewhere inside, possibly in a child or a descendant element.\nWhen passed a [string], matching is case-insensitive and searches for a substring.","async":false,"alias":"hasNotText","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"hasText","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"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>`."}],"required":false,"comment":"Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When\npassed a [string], matching is case-insensitive and searches for a substring. For example, `\"Playwright\"` matches\n`<article><div>Playwright</div></article>`.","async":false,"alias":"hasText","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Returns frame's name attribute as specified in the tag."},{"type":"text","text":"If the name is empty, returns the id attribute instead."},{"type":"note","noteType":"note","text":"This value is calculated once when the frame is created, and will not update if the attribute is changed later."}],"required":true,"comment":"Returns frame's name attribute as specified in the tag.\n\nIf the name is empty, returns the id attribute instead.\n\n**NOTE** This value is calculated once when the frame is created, and will not update if the attribute is changed\nlater.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"page","type":{"name":"Page","expression":"[Page]"},"spec":[{"type":"text","text":"Returns the page containing this frame."}],"required":true,"comment":"Returns the page containing this frame.","async":false,"alias":"page","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"parentFrame","type":{"name":"","union":[{"name":"null"},{"name":"Frame"}],"expression":"[null]|[Frame]"},"spec":[{"type":"text","text":"Parent frame, if any. Detached frames and main frames return `null`."}],"required":true,"comment":"Parent frame, if any. Detached frames and main frames return `null`.","async":false,"alias":"parentFrame","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.press`] instead. Read more about [locators](../locators.md).","name":"press","type":{"name":"void"},"spec":[{"type":"text","text":"`key` can specify the intended↵[keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) value or a single character to↵generate the text for. A superset of the `key` values can be found↵[here](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values). Examples of the keys are:"},{"type":"text","text":"`F1` - `F12`, `Digit0`- `Digit9`, `KeyA`- `KeyZ`, `Backquote`, `Minus`, `Equal`, `Backslash`, `Backspace`, `Tab`,↵`Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`, etc."},{"type":"text","text":"Following modification shortcuts are also supported: `Shift`, `Control`, `Alt`, `Meta`, `ShiftLeft`, `ControlOrMeta`.↵`ControlOrMeta` resolves to `Control` on Windows and Linux and to `Meta` on macOS."},{"type":"text","text":"Holding down `Shift` will type the text that corresponds to the `key` in the upper case."},{"type":"text","text":"If `key` is a single character, it is case-sensitive, so the values `a` and `A` will generate different↵respective texts."},{"type":"text","text":"Shortcuts such as `key: \"Control+o\"`, `key: \"Control++` or `key: \"Control+Shift+T\"` are supported as well. When specified with the↵modifier, modifier is pressed and being held while the subsequent key is being pressed."}],"required":true,"comment":"`key` can specify the intended\n[keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) value or a single character\nto generate the text for. A superset of the `key` values can be found\n[here](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values). Examples of the keys are:\n\n`F1` - `F12`, `Digit0`- `Digit9`, `KeyA`- `KeyZ`, `Backquote`, `Minus`, `Equal`, `Backslash`, `Backspace`, `Tab`,\n`Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`,\netc.\n\nFollowing modification shortcuts are also supported: `Shift`, `Control`, `Alt`, `Meta`, `ShiftLeft`,\n`ControlOrMeta`. `ControlOrMeta` resolves to `Control` on Windows and Linux and to `Meta` on macOS.\n\nHolding down `Shift` will type the text that corresponds to the `key` in the upper case.\n\nIf `key` is a single character, it is case-sensitive, so the values `a` and `A` will generate different respective\ntexts.\n\nShortcuts such as `key: \"Control+o\"`, `key: \"Control++` or `key: \"Control+Shift+T\"` are supported as well. When\nspecified with the modifier, modifier is pressed and being held while the subsequent key is being pressed.","async":true,"alias":"press","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"key","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Name of the key to press or a character to generate, such as `ArrowLeft` or `a`."}],"required":true,"comment":"Name of the key to press or a character to generate, such as `ArrowLeft` or `a`.","async":false,"alias":"key","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"delay","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0."}],"required":false,"comment":"Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.","async":false,"alias":"delay","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"python":"query_selector","js":"$"},"types":{},"overrides":{}},"since":"v1.9","discouraged":"Use locator-based [`method: Frame.locator`] instead. Read more about [locators](../locators.md).","name":"querySelector","type":{"name":"","union":[{"name":"null"},{"name":"ElementHandle"}],"expression":"[null]|[ElementHandle]"},"spec":[{"type":"text","text":"Returns the ElementHandle pointing to the frame element."},{"type":"note","noteType":"caution","text":"The use of `ElementHandle` is discouraged, use `Locator` objects and web-first assertions instead."},{"type":"text","text":"The method finds an element matching the specified selector within the frame. If no elements match the selector,↵returns `null`."}],"required":true,"comment":"Returns the ElementHandle pointing to the frame element.\n\n**NOTE** The use of `ElementHandle` is discouraged, use `Locator` objects and web-first assertions instead.\n\nThe method finds an element matching the specified selector within the frame. If no elements match the selector,\nreturns `null`.","async":true,"alias":"querySelector","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to query for."}],"required":true,"comment":"A selector to query for.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"python":"query_selector_all","js":"$$"},"types":{},"overrides":{}},"since":"v1.9","discouraged":"Use locator-based [`method: Frame.locator`] instead. Read more about [locators](../locators.md).","name":"querySelectorAll","type":{"name":"Array","templates":[{"name":"ElementHandle"}],"expression":"[Array]<[ElementHandle]>"},"spec":[{"type":"text","text":"Returns the ElementHandles pointing to the frame elements."},{"type":"note","noteType":"caution","text":"The use of `ElementHandle` is discouraged, use `Locator` objects instead."},{"type":"text","text":"The method finds all elements matching the specified selector within the frame. If no elements match the selector,↵returns empty array."}],"required":true,"comment":"Returns the ElementHandles pointing to the frame elements.\n\n**NOTE** The use of `ElementHandle` is discouraged, use `Locator` objects instead.\n\nThe method finds all elements matching the specified selector within the frame. If no elements match the selector,\nreturns empty array.","async":true,"alias":"querySelectorAll","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to query for."}],"required":true,"comment":"A selector to query for.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.selectOption`] instead. Read more about [locators](../locators.md).","name":"selectOption","type":{"name":"Array","templates":[{"name":"string"}],"expression":"[Array]<[string]>"},"spec":[{"type":"text","text":"This method waits for an element matching `selector`, waits for [actionability](../actionability.md) checks, waits until all specified options are present in the `<select>` element and selects these options."},{"type":"text","text":"If the target element is not a `<select>` element, this method throws an error. However, if the element is inside the `<label>` element that has an associated [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be used instead."},{"type":"text","text":"Returns the array of option values that have been successfully selected."},{"type":"text","text":"Triggers a `change` and `input` event once all the provided options have been selected."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["// Single selection matching the value or label","frame.selectOption('select#colors', 'blue');","","// single selection matching both the value and the label","frame.selectOption('select#colors', { label: 'Blue' });","","// multiple selection","frame.selectOption('select#colors', 'red', 'green', 'blue');"],"codeLang":"js"},{"type":"code","lines":["// Single selection matching the value or label","frame.selectOption(\"select#colors\", \"blue\");","// single selection matching both the value and the label","frame.selectOption(\"select#colors\", new SelectOption().setLabel(\"Blue\"));","// multiple selection","frame.selectOption(\"select#colors\", new String[] {\"red\", \"green\", \"blue\"});"],"codeLang":"java"},{"type":"code","lines":["# Single selection matching the value or label","await frame.select_option(\"select#colors\", \"blue\")","# single selection matching the label","await frame.select_option(\"select#colors\", label=\"blue\")","# multiple selection","await frame.select_option(\"select#colors\", value=[\"red\", \"green\", \"blue\"])"],"codeLang":"python async"},{"type":"code","lines":["# Single selection matching the value or label","frame.select_option(\"select#colors\", \"blue\")","# single selection matching both the label","frame.select_option(\"select#colors\", label=\"blue\")","# multiple selection","frame.select_option(\"select#colors\", value=[\"red\", \"green\", \"blue\"])"],"codeLang":"python sync"},{"type":"code","lines":["// Single selection matching the value or label","await frame.SelectOptionAsync(\"select#colors\", new[] { \"blue\" });","// single selection matching both the value and the label","await frame.SelectOptionAsync(\"select#colors\", new[] { new SelectOptionValue() { Label = \"blue\" } });","// multiple selection","await frame.SelectOptionAsync(\"select#colors\", new[] { \"red\", \"green\", \"blue\" });"],"codeLang":"csharp"}],"required":true,"comment":"This method waits for an element matching `selector`, waits for [actionability](../actionability.md) checks, waits\nuntil all specified options are present in the `<select>` element and selects these options.\n\nIf the target element is not a `<select>` element, this method throws an error. However, if the element is inside\nthe `<label>` element that has an associated\n[control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be used\ninstead.\n\nReturns the array of option values that have been successfully selected.\n\nTriggers a `change` and `input` event once all the provided options have been selected.\n\n**Usage**\n\n```js\n// Single selection matching the value or label\nframe.selectOption('select#colors', 'blue');\n\n// single selection matching both the value and the label\nframe.selectOption('select#colors', { label: 'Blue' });\n\n// multiple selection\nframe.selectOption('select#colors', 'red', 'green', 'blue');\n```\n\n```java\n// Single selection matching the value or label\nframe.selectOption(\"select#colors\", \"blue\");\n// single selection matching both the value and the label\nframe.selectOption(\"select#colors\", new SelectOption().setLabel(\"Blue\"));\n// multiple selection\nframe.selectOption(\"select#colors\", new String[] {\"red\", \"green\", \"blue\"});\n```\n\n```py\n# Single selection matching the value or label\nawait frame.select_option(\"select#colors\", \"blue\")\n# single selection matching the label\nawait frame.select_option(\"select#colors\", label=\"blue\")\n# multiple selection\nawait frame.select_option(\"select#colors\", value=[\"red\", \"green\", \"blue\"])\n```\n\n```py\n# Single selection matching the value or label\nframe.select_option(\"select#colors\", \"blue\")\n# single selection matching both the label\nframe.select_option(\"select#colors\", label=\"blue\")\n# multiple selection\nframe.select_option(\"select#colors\", value=[\"red\", \"green\", \"blue\"])\n```\n\n```csharp\n// Single selection matching the value or label\nawait frame.SelectOptionAsync(\"select#colors\", new[] { \"blue\" });\n// single selection matching both the value and the label\nawait frame.SelectOptionAsync(\"select#colors\", new[] { new SelectOptionValue() { Label = \"blue\" } });\n// multiple selection\nawait frame.SelectOptionAsync(\"select#colors\", new[] { \"red\", \"green\", \"blue\" });\n```\n","async":true,"alias":"selectOption","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to query for."}],"required":true,"comment":"A selector to query for.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","js","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"values","type":{"name":"","union":[{"name":"null"},{"name":"string"},{"name":"ElementHandle"},{"name":"Array","templates":[{"name":"string"}]},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Matches by `option.value`. Optional."}],"required":false,"comment":"Matches by `option.value`. Optional.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"label","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Matches by `option.label`. Optional."}],"required":false,"comment":"Matches by `option.label`. Optional.","async":false,"alias":"label","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"index","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Matches by the index. Optional."}],"required":false,"comment":"Matches by the index. Optional.","async":false,"alias":"index","overloadIndex":0,"paramOrOption":null}]},{"name":"Array","templates":[{"name":"ElementHandle"}]},{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Matches by `option.value`. Optional."}],"required":false,"comment":"Matches by `option.value`. Optional.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"label","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Matches by `option.label`. Optional."}],"required":false,"comment":"Matches by `option.label`. Optional.","async":false,"alias":"label","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"index","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Matches by the index. Optional."}],"required":false,"comment":"Matches by the index. Optional.","async":false,"alias":"index","overloadIndex":0,"paramOrOption":null}]}]}],"expression":"[null]|[string]|[ElementHandle]|[Array]<[string]>|[Object]|[Array]<[ElementHandle]>|[Array]<[Object]>"},"spec":[{"type":"text","text":"Options to select. If the `<select>` has the `multiple` attribute, all matching options are selected, otherwise only the↵first option matching one of the passed options is selected. String values are matching both values and labels. Option↵is considered matching if all specified properties match."}],"required":true,"comment":"Options to select. If the `<select>` has the `multiple` attribute, all matching options are selected, otherwise\nonly the first option matching one of the passed options is selected. String values are matching both values and\nlabels. Option is considered matching if all specified properties match.","async":false,"alias":"values","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.13","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"element","type":{"name":"","union":[{"name":"ElementHandle"},{"name":"Array","templates":[{"name":"ElementHandle"}]}],"expression":"[ElementHandle]|[Array]<[ElementHandle]>"},"spec":[{"type":"text","text":"Option elements to select. Optional."}],"required":false,"comment":"Option elements to select. Optional.","async":false,"alias":"element","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"index","type":{"name":"","union":[{"name":"int"},{"name":"Array","templates":[{"name":"int"}]}],"expression":"[int]|[Array]<[int]>"},"spec":[{"type":"text","text":"Options to select by index. Optional."}],"required":false,"comment":"Options to select by index. Optional.","async":false,"alias":"index","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"value","type":{"name":"","union":[{"name":"string"},{"name":"Array","templates":[{"name":"string"}]}],"expression":"[string]|[Array]<[string]>"},"spec":[{"type":"text","text":"Options to select by value. If the `<select>` has the `multiple` attribute, all given options are selected, otherwise↵only the first option matching one of the passed options is selected. Optional."}],"required":false,"comment":"Options to select by value. If the `<select>` has the `multiple` attribute, all given options are selected,\notherwise only the first option matching one of the passed options is selected. Optional.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"label","type":{"name":"","union":[{"name":"string"},{"name":"Array","templates":[{"name":"string"}]}],"expression":"[string]|[Array]<[string]>"},"spec":[{"type":"text","text":"Options to select by label. If the `<select>` has the `multiple` attribute, all given options are selected, otherwise↵only the first option matching one of the passed options is selected. Optional."}],"required":false,"comment":"Options to select by label. If the `<select>` has the `multiple` attribute, all given options are selected,\notherwise only the first option matching one of the passed options is selected. Optional.","async":false,"alias":"label","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.15","discouraged":"Use locator-based [`method: Locator.setChecked`] instead. Read more about [locators](../locators.md).","name":"setChecked","type":{"name":"void"},"spec":[{"type":"text","text":"This method checks or unchecks an element matching `selector` by performing the following steps:"},{"type":"li","text":"Find an element matching `selector`. If there is none, wait until a matching element is attached to↵the DOM.","liType":"ordinal"},{"type":"li","text":"Ensure that matched element is a checkbox or a radio input. If not, this method throws.","liType":"ordinal"},{"type":"li","text":"If the element already has the right checked state, this method returns immediately.","liType":"ordinal"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is↵set. If the element is detached during the checks, the whole action is retried.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.mouse`] to click in the center of the element.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.","liType":"ordinal"},{"type":"li","text":"Ensure that the element is now checked or unchecked. If not, this method throws.","liType":"ordinal"},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."}],"required":true,"comment":"This method checks or unchecks an element matching `selector` by performing the following steps:\n1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.\n1. Ensure that matched element is a checkbox or a radio input. If not, this method throws.\n1. If the element already has the right checked state, this method returns immediately.\n1. Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is set. If\n the element is detached during the checks, the whole action is retried.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.mouse`] to click in the center of the element.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n1. Ensure that the element is now checked or unchecked. If not, this method throws.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.","async":true,"alias":"setChecked","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.15","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"aliases":{"csharp":"checkedState"},"types":{},"overrides":{}},"since":"v1.15","name":"checked","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to check or uncheck the checkbox."}],"required":true,"comment":"Whether to check or uncheck the checkbox.","async":false,"alias":"checked","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.15","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.15","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.15","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.15","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.15","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.15","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.15","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"setContent","type":{"name":"void"},"spec":[{"type":"text","text":"This method internally calls [document.write()](https://developer.mozilla.org/en-US/docs/Web/API/Document/write), inheriting all its specific characteristics and behaviors."}],"required":true,"comment":"This method internally calls [document.write()](https://developer.mozilla.org/en-US/docs/Web/API/Document/write),\ninheriting all its specific characteristics and behaviors.","async":true,"alias":"setContent","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"html","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"HTML markup to assign to the page."}],"required":true,"comment":"HTML markup to assign to the page.","async":false,"alias":"html","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.↵The default value can be changed by using the↵[`method: BrowserContext.setDefaultNavigationTimeout`],↵[`method: BrowserContext.setDefaultTimeout`],↵[`method: Page.setDefaultNavigationTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `navigationTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultNavigationTimeout`],↵[`method: BrowserContext.setDefaultTimeout`],↵[`method: Page.setDefaultNavigationTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via\n`navigationTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"waitUntil","type":{"name":"WaitUntilState","union":[{"name":"\"load\""},{"name":"\"domcontentloaded\""},{"name":"\"networkidle\""},{"name":"\"commit\""}],"expression":"[WaitUntilState]<\"load\"|\"domcontentloaded\"|\"networkidle\"|\"commit\">"},"spec":[{"type":"text","text":"When to consider operation succeeded, defaults to `load`. Events can be either:"},{"type":"li","text":"`'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.","liType":"bullet"},{"type":"li","text":"`'load'` - consider operation to be finished when the `load` event is fired.","liType":"bullet"},{"type":"li","text":"`'networkidle'` - **DISCOURAGED** consider operation to be finished when there are no network connections for at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.","liType":"bullet"},{"type":"li","text":"`'commit'` - consider operation to be finished when network response is received and the document started loading.","liType":"bullet"}],"required":false,"comment":"When to consider operation succeeded, defaults to `load`. Events can be either:\n- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.\n- `'load'` - consider operation to be finished when the `load` event is fired.\n- `'networkidle'` - **DISCOURAGED** consider operation to be finished when there are no network connections for\n at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.\n- `'commit'` - consider operation to be finished when network response is received and the document started\n loading.","async":false,"alias":"waitUntil","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.setInputFiles`] instead. Read more about [locators](../locators.md).","name":"setInputFiles","type":{"name":"void"},"spec":[{"type":"text","text":"Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then they↵are resolved relative to the current working directory. For empty array, clears the selected files."},{"type":"text","text":"This method expects `selector` to point to an↵[input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input). However, if the element is inside the `<label>` element that has an associated [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), targets the control instead."}],"required":true,"comment":"Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then\nthey are resolved relative to the current working directory. For empty array, clears the selected files.\n\nThis method expects `selector` to point to an\n[input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input). However, if the element is inside\nthe `<label>` element that has an associated\n[control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), targets the control instead.","async":true,"alias":"setInputFiles","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"files","type":{"name":"","union":[{"name":"path"},{"name":"Array","templates":[{"name":"path"}]},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]},{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]}]}],"expression":"[path]|[Array]<[path]>|[Object]|[Array]<[Object]>"},"spec":[],"required":true,"comment":"","async":false,"alias":"files","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.tap`] instead. Read more about [locators](../locators.md).","name":"tap","type":{"name":"void"},"spec":[{"type":"text","text":"This method taps an element matching `selector` by performing the following steps:"},{"type":"li","text":"Find an element matching `selector`. If there is none, wait until a matching element is attached to↵the DOM.","liType":"ordinal"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is↵set. If the element is detached during the checks, the whole action is retried.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.touchscreen`] to tap the center of the element, or the specified `position`.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.","liType":"ordinal"},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."},{"type":"note","noteType":"note","text":"`frame.tap()` requires that the `hasTouch` option of the browser context be set to true."}],"required":true,"comment":"This method taps an element matching `selector` by performing the following steps:\n1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.\n1. Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is set. If\n the element is detached during the checks, the whole action is retried.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.touchscreen`] to tap the center of the element, or the specified `position`.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.\n\n**NOTE** `frame.tap()` requires that the `hasTouch` option of the browser context be set to true.","async":true,"alias":"tap","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"modifiers","type":{"name":"Array","templates":[{"name":"KeyboardModifier","union":[{"name":"\"Alt\""},{"name":"\"Control\""},{"name":"\"ControlOrMeta\""},{"name":"\"Meta\""},{"name":"\"Shift\""}]}],"expression":"[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"ControlOrMeta\"|\"Meta\"|\"Shift\">>"},"spec":[{"type":"text","text":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current↵modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to \"Control\" on Windows↵and Linux and to \"Meta\" on macOS."}],"required":false,"comment":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores\ncurrent modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to\n\"Control\" on Windows and Linux and to \"Meta\" on macOS.","async":false,"alias":"modifiers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.textContent`] instead. Read more about [locators](../locators.md).","name":"textContent","type":{"name":"","union":[{"name":"null"},{"name":"string"}],"expression":"[null]|[string]"},"spec":[{"type":"text","text":"Returns `element.textContent`."}],"required":true,"comment":"Returns `element.textContent`.","async":true,"alias":"textContent","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"title","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Returns the page title."}],"required":true,"comment":"Returns the page title.","async":true,"alias":"title","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","deprecated":"In most cases, you should use [`method: Locator.fill`] instead. You only need to press keys one by one if there is special keyboard handling on the page - in this case use [`method: Locator.pressSequentially`].","name":"type","type":{"name":"void"},"spec":[{"type":"text","text":"Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text. `frame.type` can be used to↵send fine-grained keyboard events. To fill values in form fields, use [`method: Frame.fill`]."},{"type":"text","text":"To press a special key, like `Control` or `ArrowDown`, use [`method: Keyboard.press`]."},{"type":"text","text":"**Usage**"}],"required":true,"comment":"Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text. `frame.type` can be used\nto send fine-grained keyboard events. To fill values in form fields, use [`method: Frame.fill`].\n\nTo press a special key, like `Control` or `ArrowDown`, use [`method: Keyboard.press`].\n\n**Usage**","async":true,"alias":"type","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"text","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A text to type into a focused element."}],"required":true,"comment":"A text to type into a focused element.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"delay","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to wait between key presses in milliseconds. Defaults to 0."}],"required":false,"comment":"Time to wait between key presses in milliseconds. Defaults to 0.","async":false,"alias":"delay","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.uncheck`] instead. Read more about [locators](../locators.md).","name":"uncheck","type":{"name":"void"},"spec":[{"type":"text","text":"This method checks an element matching `selector` by performing the following steps:"},{"type":"li","text":"Find an element matching `selector`. If there is none, wait until a matching element is attached to↵the DOM.","liType":"ordinal"},{"type":"li","text":"Ensure that matched element is a checkbox or a radio input. If not, this method throws. If the element is already↵unchecked, this method returns immediately.","liType":"ordinal"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is↵set. If the element is detached during the checks, the whole action is retried.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.mouse`] to click in the center of the element.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.","liType":"ordinal"},{"type":"li","text":"Ensure that the element is now unchecked. If not, this method throws.","liType":"ordinal"},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."}],"required":true,"comment":"This method checks an element matching `selector` by performing the following steps:\n1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.\n1. Ensure that matched element is a checkbox or a radio input. If not, this method throws. If the element is\n already unchecked, this method returns immediately.\n1. Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is set. If\n the element is detached during the checks, the whole action is retried.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.mouse`] to click in the center of the element.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n1. Ensure that the element is now unchecked. If not, this method throws.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.","async":true,"alias":"uncheck","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"url","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Returns frame's url."}],"required":true,"comment":"Returns frame's url.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"waitForFunction","type":{"name":"JSHandle","expression":"[JSHandle]"},"spec":[{"type":"text","text":"Returns when the `expression` returns a truthy value, returns that value."},{"type":"text","text":"**Usage**"},{"type":"text","text":"The [`method: Frame.waitForFunction`] can be used to observe viewport size change:"},{"type":"code","lines":["const { firefox } = require('playwright'); // Or 'chromium' or 'webkit'.","","(async () => {"," const browser = await firefox.launch();"," const page = await browser.newPage();"," const watchDog = page.mainFrame().waitForFunction('window.innerWidth < 100');"," await page.setViewportSize({ width: 50, height: 50 });"," await watchDog;"," await browser.close();","})();"],"codeLang":"js"},{"type":"code","lines":["import com.microsoft.playwright.*;","","public class Example {"," public static void main(String[] args) {"," try (Playwright playwright = Playwright.create()) {"," BrowserType firefox = playwright.firefox();"," Browser browser = firefox.launch();"," Page page = browser.newPage();"," page.setViewportSize(50, 50);"," page.mainFrame().waitForFunction(\"window.innerWidth < 100\");"," browser.close();"," }"," }","}"],"codeLang":"java"},{"type":"code","lines":["import asyncio","from playwright.async_api import async_playwright, Playwright","","async def run(playwright: Playwright):"," webkit = playwright.webkit"," browser = await webkit.launch()"," page = await browser.new_page()"," await page.evaluate(\"window.x = 0; setTimeout(() => { window.x = 100 }, 1000);\")"," await page.main_frame.wait_for_function(\"() => window.x > 0\")"," await browser.close()","","async def main():"," async with async_playwright() as playwright:"," await run(playwright)","asyncio.run(main())"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import sync_playwright, Playwright","","def run(playwright: Playwright):"," webkit = playwright.webkit"," browser = webkit.launch()"," page = browser.new_page()"," page.evaluate(\"window.x = 0; setTimeout(() => { window.x = 100 }, 1000);\")"," page.main_frame.wait_for_function(\"() => window.x > 0\")"," browser.close()","","with sync_playwright() as playwright:"," run(playwright)"],"codeLang":"python sync"},{"type":"code","lines":["using Microsoft.Playwright;","using System.Threading.Tasks;","","class FrameExamples","{"," public static async Task Main()"," {"," using var playwright = await Playwright.CreateAsync();"," await using var browser = await playwright.Firefox.LaunchAsync();"," var page = await browser.NewPageAsync();"," await page.SetViewportSizeAsync(50, 50);"," await page.MainFrame.WaitForFunctionAsync(\"window.innerWidth < 100\");"," }","}"],"codeLang":"csharp"},{"type":"text","text":"To pass an argument to the predicate of `frame.waitForFunction` function:"},{"type":"code","lines":["const selector = '.foo';","await frame.waitForFunction(selector => !!document.querySelector(selector), selector);"],"codeLang":"js"},{"type":"code","lines":["String selector = \".foo\";","frame.waitForFunction(\"selector => !!document.querySelector(selector)\", selector);"],"codeLang":"java"},{"type":"code","lines":["selector = \".foo\"","await frame.wait_for_function(\"selector => !!document.querySelector(selector)\", selector)"],"codeLang":"python async"},{"type":"code","lines":["selector = \".foo\"","frame.wait_for_function(\"selector => !!document.querySelector(selector)\", selector)"],"codeLang":"python sync"},{"type":"code","lines":["var selector = \".foo\";","await page.MainFrame.WaitForFunctionAsync(\"selector => !!document.querySelector(selector)\", selector);"],"codeLang":"csharp"}],"required":true,"comment":"Returns when the `expression` returns a truthy value, returns that value.\n\n**Usage**\n\nThe [`method: Frame.waitForFunction`] can be used to observe viewport size change:\n\n```js\nconst { firefox } = require('playwright'); // Or 'chromium' or 'webkit'.\n\n(async () => {\n const browser = await firefox.launch();\n const page = await browser.newPage();\n const watchDog = page.mainFrame().waitForFunction('window.innerWidth < 100');\n await page.setViewportSize({ width: 50, height: 50 });\n await watchDog;\n await browser.close();\n})();\n```\n\n```java\nimport com.microsoft.playwright.*;\n\npublic class Example {\n public static void main(String[] args) {\n try (Playwright playwright = Playwright.create()) {\n BrowserType firefox = playwright.firefox();\n Browser browser = firefox.launch();\n Page page = browser.newPage();\n page.setViewportSize(50, 50);\n page.mainFrame().waitForFunction(\"window.innerWidth < 100\");\n browser.close();\n }\n }\n}\n```\n\n```py\nimport asyncio\nfrom playwright.async_api import async_playwright, Playwright\n\nasync def run(playwright: Playwright):\n webkit = playwright.webkit\n browser = await webkit.launch()\n page = await browser.new_page()\n await page.evaluate(\"window.x = 0; setTimeout(() => { window.x = 100 }, 1000);\")\n await page.main_frame.wait_for_function(\"() => window.x > 0\")\n await browser.close()\n\nasync def main():\n async with async_playwright() as playwright:\n await run(playwright)\nasyncio.run(main())\n```\n\n```py\nfrom playwright.sync_api import sync_playwright, Playwright\n\ndef run(playwright: Playwright):\n webkit = playwright.webkit\n browser = webkit.launch()\n page = browser.new_page()\n page.evaluate(\"window.x = 0; setTimeout(() => { window.x = 100 }, 1000);\")\n page.main_frame.wait_for_function(\"() => window.x > 0\")\n browser.close()\n\nwith sync_playwright() as playwright:\n run(playwright)\n```\n\n```csharp\nusing Microsoft.Playwright;\nusing System.Threading.Tasks;\n\nclass FrameExamples\n{\n public static async Task Main()\n {\n using var playwright = await Playwright.CreateAsync();\n await using var browser = await playwright.Firefox.LaunchAsync();\n var page = await browser.NewPageAsync();\n await page.SetViewportSizeAsync(50, 50);\n await page.MainFrame.WaitForFunctionAsync(\"window.innerWidth < 100\");\n }\n}\n```\n\nTo pass an argument to the predicate of `frame.waitForFunction` function:\n\n```js\nconst selector = '.foo';\nawait frame.waitForFunction(selector => !!document.querySelector(selector), selector);\n```\n\n```java\nString selector = \".foo\";\nframe.waitForFunction(\"selector => !!document.querySelector(selector)\", selector);\n```\n\n```py\nselector = \".foo\"\nawait frame.wait_for_function(\"selector => !!document.querySelector(selector)\", selector)\n```\n\n```py\nselector = \".foo\"\nframe.wait_for_function(\"selector => !!document.querySelector(selector)\", selector)\n```\n\n```csharp\nvar selector = \".foo\";\nawait page.MainFrame.WaitForFunctionAsync(\"selector => !!document.querySelector(selector)\", selector);\n```\n","async":true,"alias":"waitForFunction","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"overrides":{"js":{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"expression","type":{"name":"","union":[{"name":"function"},{"name":"string"}],"expression":"[function]|[string]"},"spec":[{"type":"text","text":"Function to be evaluated in the page context."}],"argsArray":[],"required":true,"comment":"Function to be evaluated in the page context.","args":{},"clazz":null,"async":false,"alias":"pageFunction","overloadIndex":0,"paramOrOption":null}}},"since":"v1.8","name":"expression","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"JavaScript expression to be evaluated in the browser context. If the expression evaluates↵to a function, the function is automatically invoked."}],"required":true,"comment":"JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the\nfunction is automatically invoked.","async":false,"alias":"expression","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"arg","type":{"name":"EvaluationArgument","expression":"[EvaluationArgument]"},"spec":[{"type":"text","text":"Optional argument to pass to `expression`."}],"required":false,"comment":"Optional argument to pass to `expression`.","async":false,"alias":"arg","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"polling","type":{"name":"","union":[{"name":"float"},{"name":"\"raf\""}],"expression":"[float]|\"raf\""},"spec":[{"type":"text","text":"If `polling` is `'raf'`, then `expression` is constantly executed in `requestAnimationFrame`↵callback. If `polling` is a number, then it is treated as an interval in milliseconds at which the function↵would be executed. Defaults to `raf`."}],"required":false,"comment":"If `polling` is `'raf'`, then `expression` is constantly executed in `requestAnimationFrame` callback. If `polling`\nis a number, then it is treated as an interval in milliseconds at which the function would be executed. Defaults to\n`raf`.","async":false,"alias":"polling","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"pollingInterval","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"If specified, then it is treated as an interval in milliseconds at which the function would be executed. By default if the option is not specified `expression` is executed in `requestAnimationFrame` callback."}],"required":false,"comment":"If specified, then it is treated as an interval in milliseconds at which the function would be executed. By default\nif the option is not specified `expression` is executed in `requestAnimationFrame` callback.","async":false,"alias":"pollingInterval","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default↵value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `0` - no timeout. The default value can be changed via\n`actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"waitForLoadState","type":{"name":"void"},"spec":[{"type":"text","text":"Waits for the required load state to be reached."},{"type":"text","text":"This returns when the frame reaches a required load state, `load` by default. The navigation must have been committed↵when this method is called. If current document has already reached the required state, resolves immediately."},{"type":"note","noteType":"note","text":"Most of the time, this method is not needed because Playwright [auto-waits before every action](../actionability.md)."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await frame.click('button'); // Click triggers navigation.","await frame.waitForLoadState(); // Waits for 'load' state by default."],"codeLang":"js"},{"type":"code","lines":["frame.click(\"button\"); // Click triggers navigation.","frame.waitForLoadState(); // Waits for \"load\" state by default."],"codeLang":"java"},{"type":"code","lines":["await frame.click(\"button\") # click triggers navigation.","await frame.wait_for_load_state() # the promise resolves after \"load\" event."],"codeLang":"python async"},{"type":"code","lines":["frame.click(\"button\") # click triggers navigation.","frame.wait_for_load_state() # the promise resolves after \"load\" event."],"codeLang":"python sync"},{"type":"code","lines":["await frame.ClickAsync(\"button\");","await frame.WaitForLoadStateAsync(); // Defaults to LoadState.Load"],"codeLang":"csharp"}],"required":true,"comment":"Waits for the required load state to be reached.\n\nThis returns when the frame reaches a required load state, `load` by default. The navigation must have been\ncommitted when this method is called. If current document has already reached the required state, resolves\nimmediately.\n\n**NOTE** Most of the time, this method is not needed because Playwright\n[auto-waits before every action](../actionability.md).\n\n**Usage**\n\n```js\nawait frame.click('button'); // Click triggers navigation.\nawait frame.waitForLoadState(); // Waits for 'load' state by default.\n```\n\n```java\nframe.click(\"button\"); // Click triggers navigation.\nframe.waitForLoadState(); // Waits for \"load\" state by default.\n```\n\n```py\nawait frame.click(\"button\") # click triggers navigation.\nawait frame.wait_for_load_state() # the promise resolves after \"load\" event.\n```\n\n```py\nframe.click(\"button\") # click triggers navigation.\nframe.wait_for_load_state() # the promise resolves after \"load\" event.\n```\n\n```csharp\nawait frame.ClickAsync(\"button\");\nawait frame.WaitForLoadStateAsync(); // Defaults to LoadState.Load\n```\n","async":true,"alias":"waitForLoadState","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"state","type":{"name":"LoadState","union":[{"name":"\"load\""},{"name":"\"domcontentloaded\""},{"name":"\"networkidle\""}],"expression":"[LoadState]<\"load\"|\"domcontentloaded\"|\"networkidle\">"},"spec":[{"type":"text","text":"Optional load state to wait for, defaults to `load`. If the state has been already reached while loading current document, the↵method resolves immediately. Can be one of:"},{"type":"li","text":"`'load'` - wait for the `load` event to be fired.","liType":"bullet"},{"type":"li","text":"`'domcontentloaded'` - wait for the `DOMContentLoaded` event to be fired.","liType":"bullet"},{"type":"li","text":"`'networkidle'` - **DISCOURAGED** wait until there are no network connections for at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.","liType":"bullet"}],"required":false,"comment":"Optional load state to wait for, defaults to `load`. If the state has been already reached while loading current\ndocument, the method resolves immediately. Can be one of:\n- `'load'` - wait for the `load` event to be fired.\n- `'domcontentloaded'` - wait for the `DOMContentLoaded` event to be fired.\n- `'networkidle'` - **DISCOURAGED** wait until there are no network connections for at least `500` ms. Don't use\n this method for testing, rely on web assertions to assess readiness instead.","async":false,"alias":"state","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.↵The default value can be changed by using the↵[`method: BrowserContext.setDefaultNavigationTimeout`],↵[`method: BrowserContext.setDefaultTimeout`],↵[`method: Page.setDefaultNavigationTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `navigationTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultNavigationTimeout`],↵[`method: BrowserContext.setDefaultTimeout`],↵[`method: Page.setDefaultNavigationTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via\n`navigationTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"python":"expect_navigation","csharp":"RunAndWaitForNavigation"},"types":{"python":{"name":"EventContextManager","templates":[{"name":"Response"}],"expression":"[EventContextManager]<[Response]>"}},"overrides":{}},"since":"v1.8","deprecated":"This method is inherently racy, please use [`method: Frame.waitForURL`] instead.","name":"waitForNavigation","type":{"name":"","union":[{"name":"null"},{"name":"Response"}],"expression":"[null]|[Response]"},"spec":[{"type":"text","text":"Waits for the frame navigation and returns the main resource response. In case of multiple redirects, the navigation↵will resolve with the response of the last redirect. In case of navigation to a different anchor or navigation due to↵History API usage, the navigation will resolve with `null`."},{"type":"text","text":"**Usage**"},{"type":"text","text":"This method waits for the frame to navigate to a new URL. It is useful for when you run code which will indirectly cause↵the frame to navigate. Consider this example:"},{"type":"code","lines":["// Start waiting for navigation before clicking. Note no await.","const navigationPromise = page.waitForNavigation();","await page.getByText('Navigate after timeout').click();","await navigationPromise;"],"codeLang":"js"},{"type":"code","lines":["// The method returns after navigation has finished","frame.waitForNavigation(() -> {"," // Clicking the link will indirectly cause a navigation"," frame.click(\"a.delayed-navigation\");","});"],"codeLang":"java"},{"type":"code","lines":["async with frame.expect_navigation():"," await frame.click(\"a.delayed-navigation\") # clicking the link will indirectly cause a navigation","# Resolves after navigation has finished"],"codeLang":"python async"},{"type":"code","lines":["with frame.expect_navigation():"," frame.click(\"a.delayed-navigation\") # clicking the link will indirectly cause a navigation","# Resolves after navigation has finished"],"codeLang":"python sync"},{"type":"code","lines":["await frame.RunAndWaitForNavigationAsync(async () =>","{"," // Clicking the link will indirectly cause a navigation."," await frame.ClickAsync(\"a.delayed-navigation\");","});","","// Resolves after navigation has finished"],"codeLang":"csharp"},{"type":"note","noteType":"note","text":"Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API) to change the URL is considered↵a navigation."}],"required":true,"comment":"Waits for the frame navigation and returns the main resource response. In case of multiple redirects, the\nnavigation will resolve with the response of the last redirect. In case of navigation to a different anchor or\nnavigation due to History API usage, the navigation will resolve with `null`.\n\n**Usage**\n\nThis method waits for the frame to navigate to a new URL. It is useful for when you run code which will indirectly\ncause the frame to navigate. Consider this example:\n\n```js\n// Start waiting for navigation before clicking. Note no await.\nconst navigationPromise = page.waitForNavigation();\nawait page.getByText('Navigate after timeout').click();\nawait navigationPromise;\n```\n\n```java\n// The method returns after navigation has finished\nframe.waitForNavigation(() -> {\n // Clicking the link will indirectly cause a navigation\n frame.click(\"a.delayed-navigation\");\n});\n```\n\n```py\nasync with frame.expect_navigation():\n await frame.click(\"a.delayed-navigation\") # clicking the link will indirectly cause a navigation\n# Resolves after navigation has finished\n```\n\n```py\nwith frame.expect_navigation():\n frame.click(\"a.delayed-navigation\") # clicking the link will indirectly cause a navigation\n# Resolves after navigation has finished\n```\n\n```csharp\nawait frame.RunAndWaitForNavigationAsync(async () =>\n{\n // Clicking the link will indirectly cause a navigation.\n await frame.ClickAsync(\"a.delayed-navigation\");\n});\n\n// Resolves after navigation has finished\n```\n\n**NOTE** Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API) to change the URL\nis considered a navigation.","async":true,"alias":"waitForNavigation","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.12","name":"action","type":{"name":"Func","templates":[{"name":"Task"}],"expression":"[Func<Task>]"},"spec":[{"type":"text","text":"Action that triggers the event."}],"required":true,"comment":"Action that triggers the event.","async":false,"alias":"action","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.↵The default value can be changed by using the↵[`method: BrowserContext.setDefaultNavigationTimeout`],↵[`method: BrowserContext.setDefaultTimeout`],↵[`method: Page.setDefaultNavigationTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `navigationTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultNavigationTimeout`],↵[`method: BrowserContext.setDefaultTimeout`],↵[`method: Page.setDefaultNavigationTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via\n`navigationTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"url","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"},{"name":"function","args":[{"name":"URL"}],"returnType":{"name":"boolean"}}],"expression":"[string]|[RegExp]|[function]([URL]):[boolean]"},"spec":[{"type":"text","text":"A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if↵the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly↵equal to the string."}],"required":false,"comment":"A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if\nthe parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly\nequal to the string.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"waitUntil","type":{"name":"WaitUntilState","union":[{"name":"\"load\""},{"name":"\"domcontentloaded\""},{"name":"\"networkidle\""},{"name":"\"commit\""}],"expression":"[WaitUntilState]<\"load\"|\"domcontentloaded\"|\"networkidle\"|\"commit\">"},"spec":[{"type":"text","text":"When to consider operation succeeded, defaults to `load`. Events can be either:"},{"type":"li","text":"`'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.","liType":"bullet"},{"type":"li","text":"`'load'` - consider operation to be finished when the `load` event is fired.","liType":"bullet"},{"type":"li","text":"`'networkidle'` - **DISCOURAGED** consider operation to be finished when there are no network connections for at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.","liType":"bullet"},{"type":"li","text":"`'commit'` - consider operation to be finished when network response is received and the document started loading.","liType":"bullet"}],"required":false,"comment":"When to consider operation succeeded, defaults to `load`. Events can be either:\n- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.\n- `'load'` - consider operation to be finished when the `load` event is fired.\n- `'networkidle'` - **DISCOURAGED** consider operation to be finished when there are no network connections for\n at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.\n- `'commit'` - consider operation to be finished when network response is received and the document started\n loading.","async":false,"alias":"waitUntil","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"callback","type":{"name":"Runnable","expression":"[Runnable]"},"spec":[{"type":"text","text":"Callback that performs the action triggering the event."}],"required":true,"comment":"Callback that performs the action triggering the event.","async":false,"alias":"callback","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use web assertions that assert visibility or a locator-based [`method: Locator.waitFor`] instead.↵Read more about [locators](../locators.md).","name":"waitForSelector","type":{"name":"","union":[{"name":"null"},{"name":"ElementHandle"}],"expression":"[null]|[ElementHandle]"},"spec":[{"type":"text","text":"Returns when element specified by selector satisfies `state` option. Returns `null` if waiting for `hidden` or↵`detached`."},{"type":"note","noteType":"note","text":"Playwright automatically waits for element to be ready before performing an action. Using↵`Locator` objects and web-first assertions make the code wait-for-selector-free."},{"type":"text","text":"Wait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become↵visible/hidden). If at the moment of calling the method `selector` already satisfies the condition, the method↵will return immediately. If the selector doesn't satisfy the condition for the `timeout` milliseconds, the↵function will throw."},{"type":"text","text":"**Usage**"},{"type":"text","text":"This method works across navigations:"},{"type":"code","lines":["const { chromium } = require('playwright'); // Or 'firefox' or 'webkit'.","","(async () => {"," const browser = await chromium.launch();"," const page = await browser.newPage();"," for (const currentURL of ['https://google.com', 'https://bbc.com']) {"," await page.goto(currentURL);"," const element = await page.mainFrame().waitForSelector('img');"," console.log('Loaded image: ' + await element.getAttribute('src'));"," }"," await browser.close();","})();"],"codeLang":"js"},{"type":"code","lines":["import com.microsoft.playwright.*;","","public class Example {"," public static void main(String[] args) {"," try (Playwright playwright = Playwright.create()) {"," BrowserType chromium = playwright.chromium();"," Browser browser = chromium.launch();"," Page page = browser.newPage();"," for (String currentURL : Arrays.asList(\"https://google.com\", \"https://bbc.com\")) {"," page.navigate(currentURL);"," ElementHandle element = page.mainFrame().waitForSelector(\"img\");"," System.out.println(\"Loaded image: \" + element.getAttribute(\"src\"));"," }"," browser.close();"," }"," }","}"],"codeLang":"java"},{"type":"code","lines":["import asyncio","from playwright.async_api import async_playwright, Playwright","","async def run(playwright: Playwright):"," chromium = playwright.chromium"," browser = await chromium.launch()"," page = await browser.new_page()"," for current_url in [\"https://google.com\", \"https://bbc.com\"]:"," await page.goto(current_url, wait_until=\"domcontentloaded\")"," element = await page.main_frame.wait_for_selector(\"img\")"," print(\"Loaded image: \" + str(await element.get_attribute(\"src\")))"," await browser.close()","","async def main():"," async with async_playwright() as playwright:"," await run(playwright)","asyncio.run(main())"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import sync_playwright, Playwright","","def run(playwright: Playwright):"," chromium = playwright.chromium"," browser = chromium.launch()"," page = browser.new_page()"," for current_url in [\"https://google.com\", \"https://bbc.com\"]:"," page.goto(current_url, wait_until=\"domcontentloaded\")"," element = page.main_frame.wait_for_selector(\"img\")"," print(\"Loaded image: \" + str(element.get_attribute(\"src\")))"," browser.close()","","with sync_playwright() as playwright:"," run(playwright)"],"codeLang":"python sync"},{"type":"code","lines":["using Microsoft.Playwright;","using System;","using System.Threading.Tasks;","","class FrameExamples","{"," public static async Task Main()"," {"," using var playwright = await Playwright.CreateAsync();"," await using var browser = await playwright.Chromium.LaunchAsync();"," var page = await browser.NewPageAsync();",""," foreach (var currentUrl in new[] { \"https://www.google.com\", \"https://bbc.com\" })"," {"," await page.GotoAsync(currentUrl);"," element = await page.MainFrame.WaitForSelectorAsync(\"img\");"," Console.WriteLine($\"Loaded image: {await element.GetAttributeAsync(\"src\")}\");"," }"," }","}"],"codeLang":"csharp"}],"required":true,"comment":"Returns when element specified by selector satisfies `state` option. Returns `null` if waiting for `hidden` or\n`detached`.\n\n**NOTE** Playwright automatically waits for element to be ready before performing an action. Using `Locator`\nobjects and web-first assertions make the code wait-for-selector-free.\n\nWait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If\nat the moment of calling the method `selector` already satisfies the condition, the method will return immediately.\nIf the selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.\n\n**Usage**\n\nThis method works across navigations:\n\n```js\nconst { chromium } = require('playwright'); // Or 'firefox' or 'webkit'.\n\n(async () => {\n const browser = await chromium.launch();\n const page = await browser.newPage();\n for (const currentURL of ['https://google.com', 'https://bbc.com']) {\n await page.goto(currentURL);\n const element = await page.mainFrame().waitForSelector('img');\n console.log('Loaded image: ' + await element.getAttribute('src'));\n }\n await browser.close();\n})();\n```\n\n```java\nimport com.microsoft.playwright.*;\n\npublic class Example {\n public static void main(String[] args) {\n try (Playwright playwright = Playwright.create()) {\n BrowserType chromium = playwright.chromium();\n Browser browser = chromium.launch();\n Page page = browser.newPage();\n for (String currentURL : Arrays.asList(\"https://google.com\", \"https://bbc.com\")) {\n page.navigate(currentURL);\n ElementHandle element = page.mainFrame().waitForSelector(\"img\");\n System.out.println(\"Loaded image: \" + element.getAttribute(\"src\"));\n }\n browser.close();\n }\n }\n}\n```\n\n```py\nimport asyncio\nfrom playwright.async_api import async_playwright, Playwright\n\nasync def run(playwright: Playwright):\n chromium = playwright.chromium\n browser = await chromium.launch()\n page = await browser.new_page()\n for current_url in [\"https://google.com\", \"https://bbc.com\"]:\n await page.goto(current_url, wait_until=\"domcontentloaded\")\n element = await page.main_frame.wait_for_selector(\"img\")\n print(\"Loaded image: \" + str(await element.get_attribute(\"src\")))\n await browser.close()\n\nasync def main():\n async with async_playwright() as playwright:\n await run(playwright)\nasyncio.run(main())\n```\n\n```py\nfrom playwright.sync_api import sync_playwright, Playwright\n\ndef run(playwright: Playwright):\n chromium = playwright.chromium\n browser = chromium.launch()\n page = browser.new_page()\n for current_url in [\"https://google.com\", \"https://bbc.com\"]:\n page.goto(current_url, wait_until=\"domcontentloaded\")\n element = page.main_frame.wait_for_selector(\"img\")\n print(\"Loaded image: \" + str(element.get_attribute(\"src\")))\n browser.close()\n\nwith sync_playwright() as playwright:\n run(playwright)\n```\n\n```csharp\nusing Microsoft.Playwright;\nusing System;\nusing System.Threading.Tasks;\n\nclass FrameExamples\n{\n public static async Task Main()\n {\n using var playwright = await Playwright.CreateAsync();\n await using var browser = await playwright.Chromium.LaunchAsync();\n var page = await browser.NewPageAsync();\n\n foreach (var currentUrl in new[] { \"https://www.google.com\", \"https://bbc.com\" })\n {\n await page.GotoAsync(currentUrl);\n element = await page.MainFrame.WaitForSelectorAsync(\"img\");\n Console.WriteLine($\"Loaded image: {await element.GetAttributeAsync(\"src\")}\");\n }\n }\n}\n```\n","async":true,"alias":"waitForSelector","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to query for."}],"required":true,"comment":"A selector to query for.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"state","type":{"name":"WaitForSelectorState","union":[{"name":"\"attached\""},{"name":"\"detached\""},{"name":"\"visible\""},{"name":"\"hidden\""}],"expression":"[WaitForSelectorState]<\"attached\"|\"detached\"|\"visible\"|\"hidden\">"},"spec":[{"type":"text","text":"Defaults to `'visible'`. Can be either:"},{"type":"li","text":"`'attached'` - wait for element to be present in DOM.","liType":"bullet"},{"type":"li","text":"`'detached'` - wait for element to not be present in DOM.","liType":"bullet"},{"type":"li","text":"`'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element without↵any content or with `display:none` has an empty bounding box and is not considered visible.","liType":"bullet"},{"type":"li","text":"`'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or `visibility:hidden`.↵This is opposite to the `'visible'` option.","liType":"bullet"}],"required":false,"comment":"Defaults to `'visible'`. Can be either:\n- `'attached'` - wait for element to be present in DOM.\n- `'detached'` - wait for element to not be present in DOM.\n- `'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element\n without any content or with `display:none` has an empty bounding box and is not considered visible.\n- `'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or\n `visibility:hidden`. This is opposite to the `'visible'` option.","async":false,"alias":"state","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Never wait for timeout in production. Tests that wait for time are↵inherently flaky. Use `Locator` actions and web assertions that wait automatically.","name":"waitForTimeout","type":{"name":"void"},"spec":[{"type":"text","text":"Waits for the given `timeout` in milliseconds."},{"type":"text","text":"Note that `frame.waitForTimeout()` should only be used for debugging. Tests using the timer in production are going to↵be flaky. Use signals such as network events, selectors becoming visible and others instead."}],"required":true,"comment":"Waits for the given `timeout` in milliseconds.\n\nNote that `frame.waitForTimeout()` should only be used for debugging. Tests using the timer in production are going\nto be flaky. Use signals such as network events, selectors becoming visible and others instead.","async":true,"alias":"waitForTimeout","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"A timeout to wait for"}],"required":true,"comment":"A timeout to wait for","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.11","name":"waitForURL","type":{"name":"void"},"spec":[{"type":"text","text":"Waits for the frame to navigate to the given URL."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await frame.click('a.delayed-navigation'); // Clicking the link will indirectly cause a navigation","await frame.waitForURL('**/target.html');"],"codeLang":"js"},{"type":"code","lines":["frame.click(\"a.delayed-navigation\"); // Clicking the link will indirectly cause a navigation","frame.waitForURL(\"**/target.html\");"],"codeLang":"java"},{"type":"code","lines":["await frame.click(\"a.delayed-navigation\") # clicking the link will indirectly cause a navigation","await frame.wait_for_url(\"**/target.html\")"],"codeLang":"python async"},{"type":"code","lines":["frame.click(\"a.delayed-navigation\") # clicking the link will indirectly cause a navigation","frame.wait_for_url(\"**/target.html\")"],"codeLang":"python sync"},{"type":"code","lines":["await frame.ClickAsync(\"a.delayed-navigation\"); // clicking the link will indirectly cause a navigation","await frame.WaitForURLAsync(\"**/target.html\");"],"codeLang":"csharp"}],"required":true,"comment":"Waits for the frame to navigate to the given URL.\n\n**Usage**\n\n```js\nawait frame.click('a.delayed-navigation'); // Clicking the link will indirectly cause a navigation\nawait frame.waitForURL('**/target.html');\n```\n\n```java\nframe.click(\"a.delayed-navigation\"); // Clicking the link will indirectly cause a navigation\nframe.waitForURL(\"**/target.html\");\n```\n\n```py\nawait frame.click(\"a.delayed-navigation\") # clicking the link will indirectly cause a navigation\nawait frame.wait_for_url(\"**/target.html\")\n```\n\n```py\nframe.click(\"a.delayed-navigation\") # clicking the link will indirectly cause a navigation\nframe.wait_for_url(\"**/target.html\")\n```\n\n```csharp\nawait frame.ClickAsync(\"a.delayed-navigation\"); // clicking the link will indirectly cause a navigation\nawait frame.WaitForURLAsync(\"**/target.html\");\n```\n","async":true,"alias":"waitForURL","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.11","name":"url","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"},{"name":"function","args":[{"name":"URL"}],"returnType":{"name":"boolean"}}],"expression":"[string]|[RegExp]|[function]([URL]):[boolean]"},"spec":[{"type":"text","text":"A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if↵the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly↵equal to the string."}],"required":true,"comment":"A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if\nthe parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly\nequal to the string.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.11","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.↵The default value can be changed by using the↵[`method: BrowserContext.setDefaultNavigationTimeout`],↵[`method: BrowserContext.setDefaultTimeout`],↵[`method: Page.setDefaultNavigationTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.11","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `navigationTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultNavigationTimeout`],↵[`method: BrowserContext.setDefaultTimeout`],↵[`method: Page.setDefaultNavigationTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via\n`navigationTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"waitUntil","type":{"name":"WaitUntilState","union":[{"name":"\"load\""},{"name":"\"domcontentloaded\""},{"name":"\"networkidle\""},{"name":"\"commit\""}],"expression":"[WaitUntilState]<\"load\"|\"domcontentloaded\"|\"networkidle\"|\"commit\">"},"spec":[{"type":"text","text":"When to consider operation succeeded, defaults to `load`. Events can be either:"},{"type":"li","text":"`'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.","liType":"bullet"},{"type":"li","text":"`'load'` - consider operation to be finished when the `load` event is fired.","liType":"bullet"},{"type":"li","text":"`'networkidle'` - **DISCOURAGED** consider operation to be finished when there are no network connections for at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.","liType":"bullet"},{"type":"li","text":"`'commit'` - consider operation to be finished when network response is received and the document started loading.","liType":"bullet"}],"required":false,"comment":"When to consider operation succeeded, defaults to `load`. Events can be either:\n- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.\n- `'load'` - consider operation to be finished when the `load` event is fired.\n- `'networkidle'` - **DISCOURAGED** consider operation to be finished when there are no network connections for\n at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.\n- `'commit'` - consider operation to be finished when network response is received and the document started\n loading.","async":false,"alias":"waitUntil","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]}]},{"name":"FrameLocator","spec":[{"type":"text","text":"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 [`method: Page.frameLocator`] or [`method: Locator.frameLocator`] method."},{"type":"code","lines":["const locator = page.frameLocator('#my-frame').getByText('Submit');","await locator.click();"],"codeLang":"js"},{"type":"code","lines":["Locator locator = page.frameLocator(\"#my-frame\").getByText(\"Submit\");","locator.click();"],"codeLang":"java"},{"type":"code","lines":["locator = page.frame_locator(\"#my-frame\").get_by_text(\"Submit\")","await locator.click()"],"codeLang":"python async"},{"type":"code","lines":["locator = page.frame_locator(\"my-frame\").get_by_text(\"Submit\")","locator.click()"],"codeLang":"python sync"},{"type":"code","lines":["var locator = page.FrameLocator(\"#my-frame\").GetByText(\"Submit\");","await locator.ClickAsync();"],"codeLang":"csharp"},{"type":"text","text":"**Strictness**"},{"type":"text","text":"Frame locators are strict. This means that all operations on frame locators will throw if more than one element matches a given selector."},{"type":"code","lines":["// Throws if there are several frames in DOM:","await page.frameLocator('.result-frame').getByRole('button').click();","","// Works because we explicitly tell locator to pick the first frame:","await page.frameLocator('.result-frame').first().getByRole('button').click();"],"codeLang":"js"},{"type":"code","lines":["# Throws if there are several frames in DOM:","await page.frame_locator('.result-frame').get_by_role('button').click()","","# Works because we explicitly tell locator to pick the first frame:","await page.frame_locator('.result-frame').first.get_by_role('button').click()"],"codeLang":"python async"},{"type":"code","lines":["# Throws if there are several frames in DOM:","page.frame_locator('.result-frame').get_by_role('button').click()","","# Works because we explicitly tell locator to pick the first frame:","page.frame_locator('.result-frame').first.get_by_role('button').click()"],"codeLang":"python sync"},{"type":"code","lines":["// Throws if there are several frames in DOM:","page.frame_locator(\".result-frame\").getByRole(AriaRole.BUTTON).click();","","// Works because we explicitly tell locator to pick the first frame:","page.frame_locator(\".result-frame\").first().getByRole(AriaRole.BUTTON).click();"],"codeLang":"java"},{"type":"code","lines":["// Throws if there are several frames in DOM:","await page.FrameLocator(\".result-frame\").GetByRole(AriaRole.Button).ClickAsync();","","// Works because we explicitly tell locator to pick the first frame:","await page.FrameLocator(\".result-frame\").First.getByRole(AriaRole.Button).ClickAsync();"],"codeLang":"csharp"},{"type":"text","text":"**Converting Locator to FrameLocator**"},{"type":"text","text":"If you have a `Locator` object pointing to an `iframe` it can be converted to `FrameLocator` using [`method: Locator.contentFrame`]."},{"type":"text","text":"**Converting FrameLocator to Locator**"},{"type":"text","text":"If you have a `FrameLocator` object it can be converted to `Locator` pointing to the same `iframe` using [`method: FrameLocator.owner`]."}],"langs":{},"comment":"FrameLocator represents a view to the `iframe` on the page. It captures the logic sufficient to retrieve the\n`iframe` and locate elements in that iframe. FrameLocator can be created with either [`method: Page.frameLocator`]\nor [`method: Locator.frameLocator`] method.\n\n```js\nconst locator = page.frameLocator('#my-frame').getByText('Submit');\nawait locator.click();\n```\n\n```java\nLocator locator = page.frameLocator(\"#my-frame\").getByText(\"Submit\");\nlocator.click();\n```\n\n```py\nlocator = page.frame_locator(\"#my-frame\").get_by_text(\"Submit\")\nawait locator.click()\n```\n\n```py\nlocator = page.frame_locator(\"my-frame\").get_by_text(\"Submit\")\nlocator.click()\n```\n\n```csharp\nvar locator = page.FrameLocator(\"#my-frame\").GetByText(\"Submit\");\nawait locator.ClickAsync();\n```\n\n**Strictness**\n\nFrame locators are strict. This means that all operations on frame locators will throw if more than one element\nmatches a given selector.\n\n```js\n// Throws if there are several frames in DOM:\nawait page.frameLocator('.result-frame').getByRole('button').click();\n\n// Works because we explicitly tell locator to pick the first frame:\nawait page.frameLocator('.result-frame').first().getByRole('button').click();\n```\n\n```py\n# Throws if there are several frames in DOM:\nawait page.frame_locator('.result-frame').get_by_role('button').click()\n\n# Works because we explicitly tell locator to pick the first frame:\nawait page.frame_locator('.result-frame').first.get_by_role('button').click()\n```\n\n```py\n# Throws if there are several frames in DOM:\npage.frame_locator('.result-frame').get_by_role('button').click()\n\n# Works because we explicitly tell locator to pick the first frame:\npage.frame_locator('.result-frame').first.get_by_role('button').click()\n```\n\n```java\n// Throws if there are several frames in DOM:\npage.frame_locator(\".result-frame\").getByRole(AriaRole.BUTTON).click();\n\n// Works because we explicitly tell locator to pick the first frame:\npage.frame_locator(\".result-frame\").first().getByRole(AriaRole.BUTTON).click();\n```\n\n```csharp\n// Throws if there are several frames in DOM:\nawait page.FrameLocator(\".result-frame\").GetByRole(AriaRole.Button).ClickAsync();\n\n// Works because we explicitly tell locator to pick the first frame:\nawait page.FrameLocator(\".result-frame\").First.getByRole(AriaRole.Button).ClickAsync();\n```\n\n**Converting Locator to FrameLocator**\n\nIf you have a `Locator` object pointing to an `iframe` it can be converted to `FrameLocator` using\n[`method: Locator.contentFrame`].\n\n**Converting FrameLocator to Locator**\n\nIf you have a `FrameLocator` object it can be converted to `Locator` pointing to the same `iframe` using\n[`method: FrameLocator.owner`].","since":"v1.17","members":[{"kind":"method","langs":{},"since":"v1.17","name":"first","type":{"name":"FrameLocator","expression":"[FrameLocator]"},"spec":[{"type":"text","text":"Returns locator to the first matching frame."}],"required":true,"comment":"Returns locator to the first matching frame.","async":false,"alias":"first","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.17","name":"frameLocator","type":{"name":"FrameLocator","expression":"[FrameLocator]"},"spec":[{"type":"text","text":"When working with iframes, you can create a frame locator that will enter the iframe and allow selecting elements↵in that iframe."}],"required":true,"comment":"When working with iframes, you can create a frame locator that will enter the iframe and allow selecting elements\nin that iframe.","async":false,"alias":"frameLocator","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.17","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to use when resolving DOM element."}],"required":true,"comment":"A selector to use when resolving DOM element.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByAltText","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Allows locating elements by their alt text."},{"type":"text","text":"**Usage**"},{"type":"text","text":"For example, this method will find the image by alt text \"Playwright logo\":"},{"type":"code","lines":["<img alt='Playwright logo'>"],"codeLang":"html"},{"type":"code","lines":["await page.getByAltText('Playwright logo').click();"],"codeLang":"js"},{"type":"code","lines":["page.getByAltText(\"Playwright logo\").click();"],"codeLang":"java"},{"type":"code","lines":["await page.get_by_alt_text(\"Playwright logo\").click()"],"codeLang":"python async"},{"type":"code","lines":["page.get_by_alt_text(\"Playwright logo\").click()"],"codeLang":"python sync"},{"type":"code","lines":["await page.GetByAltText(\"Playwright logo\").ClickAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Allows locating elements by their alt text.\n\n**Usage**\n\nFor example, this method will find the image by alt text \"Playwright logo\":\n\n```html\n<img alt='Playwright logo'>\n```\n\n```js\nawait page.getByAltText('Playwright logo').click();\n```\n\n```java\npage.getByAltText(\"Playwright logo\").click();\n```\n\n```py\nawait page.get_by_alt_text(\"Playwright logo\").click()\n```\n\n```py\npage.get_by_alt_text(\"Playwright logo\").click()\n```\n\n```csharp\nawait page.GetByAltText(\"Playwright logo\").ClickAsync();\n```\n","async":false,"alias":"getByAltText","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"text","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Text to locate the element for."}],"required":true,"comment":"Text to locate the element for.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.27","name":"exact","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a\nregular expression. Note that exact match still trims whitespace.","async":false,"alias":"exact","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByLabel","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Allows locating input elements by the text of the associated `<label>` or `aria-labelledby` element, or by the `aria-label` attribute."},{"type":"text","text":"**Usage**"},{"type":"text","text":"For example, this method will find inputs by label \"Username\" and \"Password\" in the following DOM:"},{"type":"code","lines":["<input aria-label=\"Username\">","<label for=\"password-input\">Password:</label>","<input id=\"password-input\">"],"codeLang":"html"},{"type":"code","lines":["await page.getByLabel('Username').fill('john');","await page.getByLabel('Password').fill('secret');"],"codeLang":"js"},{"type":"code","lines":["page.getByLabel(\"Username\").fill(\"john\");","page.getByLabel(\"Password\").fill(\"secret\");"],"codeLang":"java"},{"type":"code","lines":["await page.get_by_label(\"Username\").fill(\"john\")","await page.get_by_label(\"Password\").fill(\"secret\")"],"codeLang":"python async"},{"type":"code","lines":["page.get_by_label(\"Username\").fill(\"john\")","page.get_by_label(\"Password\").fill(\"secret\")"],"codeLang":"python sync"},{"type":"code","lines":["await page.GetByLabel(\"Username\").FillAsync(\"john\");","await page.GetByLabel(\"Password\").FillAsync(\"secret\");"],"codeLang":"csharp"}],"required":true,"comment":"Allows locating input elements by the text of the associated `<label>` or `aria-labelledby` element, or by the\n`aria-label` attribute.\n\n**Usage**\n\nFor example, this method will find inputs by label \"Username\" and \"Password\" in the following DOM:\n\n```html\n<input aria-label=\"Username\">\n<label for=\"password-input\">Password:</label>\n<input id=\"password-input\">\n```\n\n```js\nawait page.getByLabel('Username').fill('john');\nawait page.getByLabel('Password').fill('secret');\n```\n\n```java\npage.getByLabel(\"Username\").fill(\"john\");\npage.getByLabel(\"Password\").fill(\"secret\");\n```\n\n```py\nawait page.get_by_label(\"Username\").fill(\"john\")\nawait page.get_by_label(\"Password\").fill(\"secret\")\n```\n\n```py\npage.get_by_label(\"Username\").fill(\"john\")\npage.get_by_label(\"Password\").fill(\"secret\")\n```\n\n```csharp\nawait page.GetByLabel(\"Username\").FillAsync(\"john\");\nawait page.GetByLabel(\"Password\").FillAsync(\"secret\");\n```\n","async":false,"alias":"getByLabel","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"text","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Text to locate the element for."}],"required":true,"comment":"Text to locate the element for.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.27","name":"exact","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a\nregular expression. Note that exact match still trims whitespace.","async":false,"alias":"exact","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByPlaceholder","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Allows locating input elements by the placeholder text."},{"type":"text","text":"**Usage**"},{"type":"text","text":"For example, consider the following DOM structure."},{"type":"code","lines":["<input type=\"email\" placeholder=\"name@example.com\" />"],"codeLang":"html"},{"type":"text","text":"You can fill the input after locating it by the placeholder text:"},{"type":"code","lines":["await page"," .getByPlaceholder('name@example.com')"," .fill('playwright@microsoft.com');"],"codeLang":"js"},{"type":"code","lines":["page.getByPlaceholder(\"name@example.com\").fill(\"playwright@microsoft.com\");"],"codeLang":"java"},{"type":"code","lines":["await page.get_by_placeholder(\"name@example.com\").fill(\"playwright@microsoft.com\")"],"codeLang":"python async"},{"type":"code","lines":["page.get_by_placeholder(\"name@example.com\").fill(\"playwright@microsoft.com\")"],"codeLang":"python sync"},{"type":"code","lines":["await page"," .GetByPlaceholder(\"name@example.com\")"," .FillAsync(\"playwright@microsoft.com\");"],"codeLang":"csharp"}],"required":true,"comment":"Allows locating input elements by the placeholder text.\n\n**Usage**\n\nFor example, consider the following DOM structure.\n\n```html\n<input type=\"email\" placeholder=\"name@example.com\" />\n```\n\nYou can fill the input after locating it by the placeholder text:\n\n```js\nawait page\n .getByPlaceholder('name@example.com')\n .fill('playwright@microsoft.com');\n```\n\n```java\npage.getByPlaceholder(\"name@example.com\").fill(\"playwright@microsoft.com\");\n```\n\n```py\nawait page.get_by_placeholder(\"name@example.com\").fill(\"playwright@microsoft.com\")\n```\n\n```py\npage.get_by_placeholder(\"name@example.com\").fill(\"playwright@microsoft.com\")\n```\n\n```csharp\nawait page\n .GetByPlaceholder(\"name@example.com\")\n .FillAsync(\"playwright@microsoft.com\");\n```\n","async":false,"alias":"getByPlaceholder","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"text","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Text to locate the element for."}],"required":true,"comment":"Text to locate the element for.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.27","name":"exact","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a\nregular expression. Note that exact match still trims whitespace.","async":false,"alias":"exact","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByRole","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"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)."},{"type":"text","text":"**Usage**"},{"type":"text","text":"Consider the following DOM structure."},{"type":"code","lines":["<h3>Sign up</h3>","<label>"," <input type=\"checkbox\" /> Subscribe","</label>","<br/>","<button>Submit</button>"],"codeLang":"html"},{"type":"text","text":"You can locate each element by it's implicit role:"},{"type":"code","lines":["await expect(page.getByRole('heading', { name: 'Sign up' })).toBeVisible();","","await page.getByRole('checkbox', { name: 'Subscribe' }).check();","","await page.getByRole('button', { name: /submit/i }).click();"],"codeLang":"js"},{"type":"code","lines":["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()"],"codeLang":"python async"},{"type":"code","lines":["expect(page.get_by_role(\"heading\", name=\"Sign up\")).to_be_visible()","","page.get_by_role(\"checkbox\", name=\"Subscribe\").check()","","page.get_by_role(\"button\", name=re.compile(\"submit\", re.IGNORECASE)).click()"],"codeLang":"python sync"},{"type":"code","lines":["assertThat(page"," .getByRole(AriaRole.HEADING,"," new Page.GetByRoleOptions().setName(\"Sign up\")))"," .isVisible();","","page.getByRole(AriaRole.CHECKBOX,"," new Page.GetByRoleOptions().setName(\"Subscribe\"))"," .check();","","page.getByRole(AriaRole.BUTTON,"," new Page.GetByRoleOptions().setName("," Pattern.compile(\"submit\", Pattern.CASE_INSENSITIVE)))"," .click();"],"codeLang":"java"},{"type":"code","lines":["await Expect(Page"," .GetByRole(AriaRole.Heading, new() { Name = \"Sign up\" }))"," .ToBeVisibleAsync();","","await page"," .GetByRole(AriaRole.Checkbox, new() { Name = \"Subscribe\" })"," .CheckAsync();","","await page"," .GetByRole(AriaRole.Button, new() {"," NameRegex = new Regex(\"submit\", RegexOptions.IgnoreCase)"," })"," .ClickAsync();"],"codeLang":"csharp"},{"type":"text","text":"**Details**"},{"type":"text","text":"Role selector **does not replace** accessibility audits and conformance tests, but rather gives early feedback about the ARIA guidelines."},{"type":"text","text":"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."}],"required":true,"comment":"Allows locating elements by their [ARIA role](https://www.w3.org/TR/wai-aria-1.2/#roles),\n[ARIA attributes](https://www.w3.org/TR/wai-aria-1.2/#aria-attributes) and\n[accessible name](https://w3c.github.io/accname/#dfn-accessible-name).\n\n**Usage**\n\nConsider the following DOM structure.\n\n```html\n<h3>Sign up</h3>\n<label>\n <input type=\"checkbox\" /> Subscribe\n</label>\n<br/>\n<button>Submit</button>\n```\n\nYou can locate each element by it's implicit role:\n\n```js\nawait expect(page.getByRole('heading', { name: 'Sign up' })).toBeVisible();\n\nawait page.getByRole('checkbox', { name: 'Subscribe' }).check();\n\nawait page.getByRole('button', { name: /submit/i }).click();\n```\n\n```py\nawait expect(page.get_by_role(\"heading\", name=\"Sign up\")).to_be_visible()\n\nawait page.get_by_role(\"checkbox\", name=\"Subscribe\").check()\n\nawait page.get_by_role(\"button\", name=re.compile(\"submit\", re.IGNORECASE)).click()\n```\n\n```py\nexpect(page.get_by_role(\"heading\", name=\"Sign up\")).to_be_visible()\n\npage.get_by_role(\"checkbox\", name=\"Subscribe\").check()\n\npage.get_by_role(\"button\", name=re.compile(\"submit\", re.IGNORECASE)).click()\n```\n\n```java\nassertThat(page\n .getByRole(AriaRole.HEADING,\n new Page.GetByRoleOptions().setName(\"Sign up\")))\n .isVisible();\n\npage.getByRole(AriaRole.CHECKBOX,\n new Page.GetByRoleOptions().setName(\"Subscribe\"))\n .check();\n\npage.getByRole(AriaRole.BUTTON,\n new Page.GetByRoleOptions().setName(\n Pattern.compile(\"submit\", Pattern.CASE_INSENSITIVE)))\n .click();\n```\n\n```csharp\nawait Expect(Page\n .GetByRole(AriaRole.Heading, new() { Name = \"Sign up\" }))\n .ToBeVisibleAsync();\n\nawait page\n .GetByRole(AriaRole.Checkbox, new() { Name = \"Subscribe\" })\n .CheckAsync();\n\nawait page\n .GetByRole(AriaRole.Button, new() {\n NameRegex = new Regex(\"submit\", RegexOptions.IgnoreCase)\n })\n .ClickAsync();\n```\n\n**Details**\n\nRole selector **does not replace** accessibility audits and conformance tests, but rather gives early feedback\nabout the ARIA guidelines.\n\nMany html elements have an implicitly [defined role](https://w3c.github.io/html-aam/#html-element-role-mappings)\nthat is recognized by the role selector. You can find all the\n[supported roles here](https://www.w3.org/TR/wai-aria-1.2/#role_definitions). ARIA guidelines **do not recommend**\nduplicating implicit roles and attributes by setting `role` and/or `aria-*` attributes to default values.","async":false,"alias":"getByRole","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"role","type":{"name":"AriaRole","union":[{"name":"\"alert\""},{"name":"\"alertdialog\""},{"name":"\"application\""},{"name":"\"article\""},{"name":"\"banner\""},{"name":"\"blockquote\""},{"name":"\"button\""},{"name":"\"caption\""},{"name":"\"cell\""},{"name":"\"checkbox\""},{"name":"\"code\""},{"name":"\"columnheader\""},{"name":"\"combobox\""},{"name":"\"complementary\""},{"name":"\"contentinfo\""},{"name":"\"definition\""},{"name":"\"deletion\""},{"name":"\"dialog\""},{"name":"\"directory\""},{"name":"\"document\""},{"name":"\"emphasis\""},{"name":"\"feed\""},{"name":"\"figure\""},{"name":"\"form\""},{"name":"\"generic\""},{"name":"\"grid\""},{"name":"\"gridcell\""},{"name":"\"group\""},{"name":"\"heading\""},{"name":"\"img\""},{"name":"\"insertion\""},{"name":"\"link\""},{"name":"\"list\""},{"name":"\"listbox\""},{"name":"\"listitem\""},{"name":"\"log\""},{"name":"\"main\""},{"name":"\"marquee\""},{"name":"\"math\""},{"name":"\"meter\""},{"name":"\"menu\""},{"name":"\"menubar\""},{"name":"\"menuitem\""},{"name":"\"menuitemcheckbox\""},{"name":"\"menuitemradio\""},{"name":"\"navigation\""},{"name":"\"none\""},{"name":"\"note\""},{"name":"\"option\""},{"name":"\"paragraph\""},{"name":"\"presentation\""},{"name":"\"progressbar\""},{"name":"\"radio\""},{"name":"\"radiogroup\""},{"name":"\"region\""},{"name":"\"row\""},{"name":"\"rowgroup\""},{"name":"\"rowheader\""},{"name":"\"scrollbar\""},{"name":"\"search\""},{"name":"\"searchbox\""},{"name":"\"separator\""},{"name":"\"slider\""},{"name":"\"spinbutton\""},{"name":"\"status\""},{"name":"\"strong\""},{"name":"\"subscript\""},{"name":"\"superscript\""},{"name":"\"switch\""},{"name":"\"tab\""},{"name":"\"table\""},{"name":"\"tablist\""},{"name":"\"tabpanel\""},{"name":"\"term\""},{"name":"\"textbox\""},{"name":"\"time\""},{"name":"\"timer\""},{"name":"\"toolbar\""},{"name":"\"tooltip\""},{"name":"\"tree\""},{"name":"\"treegrid\""},{"name":"\"treeitem\""}],"expression":"[AriaRole]<\"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\"|\"meter\"|\"menu\"|\"menubar\"|\"menuitem\"|\"menuitemcheckbox\"|\"menuitemradio\"|\"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\">"},"spec":[{"type":"text","text":"Required aria role."}],"required":true,"comment":"Required aria role.","async":false,"alias":"role","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.27","name":"checked","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"An attribute that is usually set by `aria-checked` or native `<input type=checkbox>` controls."},{"type":"text","text":"Learn more about [`aria-checked`](https://www.w3.org/TR/wai-aria-1.2/#aria-checked)."}],"required":false,"comment":"An attribute that is usually set by `aria-checked` or native `<input type=checkbox>` controls.\n\nLearn more about [`aria-checked`](https://www.w3.org/TR/wai-aria-1.2/#aria-checked).","async":false,"alias":"checked","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"disabled","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"An attribute that is usually set by `aria-disabled` or `disabled`."},{"type":"note","noteType":"note","text":"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)."}],"required":false,"comment":"An attribute that is usually set by `aria-disabled` or `disabled`.\n\n**NOTE** Unlike most other attributes, `disabled` is inherited through the DOM hierarchy. Learn more about\n[`aria-disabled`](https://www.w3.org/TR/wai-aria-1.2/#aria-disabled).","async":false,"alias":"disabled","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.28","name":"exact","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Whether `name` is matched exactly: case-sensitive and whole-string. Defaults to false. Ignored when `name` is a\nregular expression. Note that exact match still trims whitespace.","async":false,"alias":"exact","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"expanded","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"An attribute that is usually set by `aria-expanded`."},{"type":"text","text":"Learn more about [`aria-expanded`](https://www.w3.org/TR/wai-aria-1.2/#aria-expanded)."}],"required":false,"comment":"An attribute that is usually set by `aria-expanded`.\n\nLearn more about [`aria-expanded`](https://www.w3.org/TR/wai-aria-1.2/#aria-expanded).","async":false,"alias":"expanded","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"includeHidden","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."},{"type":"text","text":"Learn more about [`aria-hidden`](https://www.w3.org/TR/wai-aria-1.2/#aria-hidden)."}],"required":false,"comment":"Option that controls whether hidden elements are matched. By default, only non-hidden elements, as\n[defined by ARIA](https://www.w3.org/TR/wai-aria-1.2/#tree_exclusion), are matched by role selector.\n\nLearn more about [`aria-hidden`](https://www.w3.org/TR/wai-aria-1.2/#aria-hidden).","async":false,"alias":"includeHidden","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"level","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"A number attribute that is usually present for roles `heading`, `listitem`, `row`, `treeitem`, with default values for `<h1>-<h6>` elements."},{"type":"text","text":"Learn more about [`aria-level`](https://www.w3.org/TR/wai-aria-1.2/#aria-level)."}],"required":false,"comment":"A number attribute that is usually present for roles `heading`, `listitem`, `row`, `treeitem`, with default values\nfor `<h1>-<h6>` elements.\n\nLearn more about [`aria-level`](https://www.w3.org/TR/wai-aria-1.2/#aria-level).","async":false,"alias":"level","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"name","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"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."},{"type":"text","text":"Learn more about [accessible name](https://w3c.github.io/accname/#dfn-accessible-name)."}],"required":false,"comment":"Option to match the [accessible name](https://w3c.github.io/accname/#dfn-accessible-name). By default, matching is\ncase-insensitive and searches for a substring, use `exact` to control this behavior.\n\nLearn more about [accessible name](https://w3c.github.io/accname/#dfn-accessible-name).","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"pressed","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"An attribute that is usually set by `aria-pressed`."},{"type":"text","text":"Learn more about [`aria-pressed`](https://www.w3.org/TR/wai-aria-1.2/#aria-pressed)."}],"required":false,"comment":"An attribute that is usually set by `aria-pressed`.\n\nLearn more about [`aria-pressed`](https://www.w3.org/TR/wai-aria-1.2/#aria-pressed).","async":false,"alias":"pressed","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"selected","type":{"name":"boolean","expression":"boolean"},"spec":[{"type":"text","text":"An attribute that is usually set by `aria-selected`."},{"type":"text","text":"Learn more about [`aria-selected`](https://www.w3.org/TR/wai-aria-1.2/#aria-selected)."}],"required":false,"comment":"An attribute that is usually set by `aria-selected`.\n\nLearn more about [`aria-selected`](https://www.w3.org/TR/wai-aria-1.2/#aria-selected).","async":false,"alias":"selected","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByTestId","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Locate element by the test id."},{"type":"text","text":"**Usage**"},{"type":"text","text":"Consider the following DOM structure."},{"type":"code","lines":["<button data-testid=\"directions\">Itinéraire</button>"],"codeLang":"html"},{"type":"text","text":"You can locate the element by it's test id:"},{"type":"code","lines":["await page.getByTestId('directions').click();"],"codeLang":"js"},{"type":"code","lines":["page.getByTestId(\"directions\").click();"],"codeLang":"java"},{"type":"code","lines":["await page.get_by_test_id(\"directions\").click()"],"codeLang":"python async"},{"type":"code","lines":["page.get_by_test_id(\"directions\").click()"],"codeLang":"python sync"},{"type":"code","lines":["await page.GetByTestId(\"directions\").ClickAsync();"],"codeLang":"csharp"},{"type":"text","text":"**Details**"},{"type":"text","text":"By default, the `data-testid` attribute is used as a test id. Use [`method: Selectors.setTestIdAttribute`] to configure a different test id attribute if necessary."},{"type":"code","lines":["// Set custom test id attribute from @playwright/test config:","import { defineConfig } from '@playwright/test';","","export default defineConfig({"," use: {"," testIdAttribute: 'data-pw'"," },","});"],"codeLang":"js"}],"required":true,"comment":"Locate element by the test id.\n\n**Usage**\n\nConsider the following DOM structure.\n\n```html\n<button data-testid=\"directions\">Itinéraire</button>\n```\n\nYou can locate the element by it's test id:\n\n```js\nawait page.getByTestId('directions').click();\n```\n\n```java\npage.getByTestId(\"directions\").click();\n```\n\n```py\nawait page.get_by_test_id(\"directions\").click()\n```\n\n```py\npage.get_by_test_id(\"directions\").click()\n```\n\n```csharp\nawait page.GetByTestId(\"directions\").ClickAsync();\n```\n\n**Details**\n\nBy default, the `data-testid` attribute is used as a test id. Use [`method: Selectors.setTestIdAttribute`] to\nconfigure a different test id attribute if necessary.\n\n```js\n// Set custom test id attribute from @playwright/test config:\nimport { defineConfig } from '@playwright/test';\n\nexport default defineConfig({\n use: {\n testIdAttribute: 'data-pw'\n },\n});\n```\n","async":false,"alias":"getByTestId","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"testId","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Id to locate the element by."}],"required":true,"comment":"Id to locate the element by.","async":false,"alias":"testId","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByText","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Allows locating elements that contain given text."},{"type":"text","text":"See also [`method: Locator.filter`] that allows to match by another criteria, like an accessible role, and then filter by the text content."},{"type":"text","text":"**Usage**"},{"type":"text","text":"Consider the following DOM structure:"},{"type":"code","lines":["<div>Hello <span>world</span></div>","<div>Hello</div>"],"codeLang":"html"},{"type":"text","text":"You can locate by text substring, exact string, or a regular expression:"},{"type":"code","lines":["// Matches <span>","page.getByText('world');","","// Matches first <div>","page.getByText('Hello world');","","// Matches second <div>","page.getByText('Hello', { exact: true });","","// Matches both <div>s","page.getByText(/Hello/);","","// Matches second <div>","page.getByText(/^hello$/i);"],"codeLang":"js"},{"type":"code","lines":["# 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))"],"codeLang":"python async"},{"type":"code","lines":["# 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))"],"codeLang":"python sync"},{"type":"code","lines":["// Matches <span>","page.getByText(\"world\")","","// Matches first <div>","page.getByText(\"Hello world\")","","// Matches second <div>","page.getByText(\"Hello\", new Page.GetByTextOptions().setExact(true))","","// Matches both <div>s","page.getByText(Pattern.compile(\"Hello\"))","","// Matches second <div>","page.getByText(Pattern.compile(\"^hello$\", Pattern.CASE_INSENSITIVE))"],"codeLang":"java"},{"type":"code","lines":["// Matches <span>","page.GetByText(\"world\");","","// Matches first <div>","page.GetByText(\"Hello world\");","","// Matches second <div>","page.GetByText(\"Hello\", new() { Exact = true });","","// Matches both <div>s","page.GetByText(new Regex(\"Hello\"));","","// Matches second <div>","page.GetByText(new Regex(\"^hello$\", RegexOptions.IgnoreCase));"],"codeLang":"csharp"},{"type":"text","text":"**Details**"},{"type":"text","text":"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."},{"type":"text","text":"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\">`."}],"required":true,"comment":"Allows locating elements that contain given text.\n\nSee also [`method: Locator.filter`] that allows to match by another criteria, like an accessible role, and then\nfilter by the text content.\n\n**Usage**\n\nConsider the following DOM structure:\n\n```html\n<div>Hello <span>world</span></div>\n<div>Hello</div>\n```\n\nYou can locate by text substring, exact string, or a regular expression:\n\n```js\n// Matches <span>\npage.getByText('world');\n\n// Matches first <div>\npage.getByText('Hello world');\n\n// Matches second <div>\npage.getByText('Hello', { exact: true });\n\n// Matches both <div>s\npage.getByText(/Hello/);\n\n// Matches second <div>\npage.getByText(/^hello$/i);\n```\n\n```py\n# Matches <span>\npage.get_by_text(\"world\")\n\n# Matches first <div>\npage.get_by_text(\"Hello world\")\n\n# Matches second <div>\npage.get_by_text(\"Hello\", exact=True)\n\n# Matches both <div>s\npage.get_by_text(re.compile(\"Hello\"))\n\n# Matches second <div>\npage.get_by_text(re.compile(\"^hello$\", re.IGNORECASE))\n```\n\n```py\n# Matches <span>\npage.get_by_text(\"world\")\n\n# Matches first <div>\npage.get_by_text(\"Hello world\")\n\n# Matches second <div>\npage.get_by_text(\"Hello\", exact=True)\n\n# Matches both <div>s\npage.get_by_text(re.compile(\"Hello\"))\n\n# Matches second <div>\npage.get_by_text(re.compile(\"^hello$\", re.IGNORECASE))\n```\n\n```java\n// Matches <span>\npage.getByText(\"world\")\n\n// Matches first <div>\npage.getByText(\"Hello world\")\n\n// Matches second <div>\npage.getByText(\"Hello\", new Page.GetByTextOptions().setExact(true))\n\n// Matches both <div>s\npage.getByText(Pattern.compile(\"Hello\"))\n\n// Matches second <div>\npage.getByText(Pattern.compile(\"^hello$\", Pattern.CASE_INSENSITIVE))\n```\n\n```csharp\n// Matches <span>\npage.GetByText(\"world\");\n\n// Matches first <div>\npage.GetByText(\"Hello world\");\n\n// Matches second <div>\npage.GetByText(\"Hello\", new() { Exact = true });\n\n// Matches both <div>s\npage.GetByText(new Regex(\"Hello\"));\n\n// Matches second <div>\npage.GetByText(new Regex(\"^hello$\", RegexOptions.IgnoreCase));\n```\n\n**Details**\n\nMatching by text always normalizes whitespace, even with exact match. For example, it turns multiple spaces into\none, turns line breaks into spaces and ignores leading and trailing whitespace.\n\nInput elements of the type `button` and `submit` are matched by their `value` instead of the text content. For\nexample, locating by text `\"Log in\"` matches `<input type=button value=\"Log in\">`.","async":false,"alias":"getByText","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"text","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Text to locate the element for."}],"required":true,"comment":"Text to locate the element for.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.27","name":"exact","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a\nregular expression. Note that exact match still trims whitespace.","async":false,"alias":"exact","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByTitle","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Allows locating elements by their title attribute."},{"type":"text","text":"**Usage**"},{"type":"text","text":"Consider the following DOM structure."},{"type":"code","lines":["<span title='Issues count'>25 issues</span>"],"codeLang":"html"},{"type":"text","text":"You can check the issues count after locating it by the title text:"},{"type":"code","lines":["await expect(page.getByTitle('Issues count')).toHaveText('25 issues');"],"codeLang":"js"},{"type":"code","lines":["assertThat(page.getByTitle(\"Issues count\")).hasText(\"25 issues\");"],"codeLang":"java"},{"type":"code","lines":["await expect(page.get_by_title(\"Issues count\")).to_have_text(\"25 issues\")"],"codeLang":"python async"},{"type":"code","lines":["expect(page.get_by_title(\"Issues count\")).to_have_text(\"25 issues\")"],"codeLang":"python sync"},{"type":"code","lines":["await Expect(Page.GetByTitle(\"Issues count\")).toHaveText(\"25 issues\");"],"codeLang":"csharp"}],"required":true,"comment":"Allows locating elements by their title attribute.\n\n**Usage**\n\nConsider the following DOM structure.\n\n```html\n<span title='Issues count'>25 issues</span>\n```\n\nYou can check the issues count after locating it by the title text:\n\n```js\nawait expect(page.getByTitle('Issues count')).toHaveText('25 issues');\n```\n\n```java\nassertThat(page.getByTitle(\"Issues count\")).hasText(\"25 issues\");\n```\n\n```py\nawait expect(page.get_by_title(\"Issues count\")).to_have_text(\"25 issues\")\n```\n\n```py\nexpect(page.get_by_title(\"Issues count\")).to_have_text(\"25 issues\")\n```\n\n```csharp\nawait Expect(Page.GetByTitle(\"Issues count\")).toHaveText(\"25 issues\");\n```\n","async":false,"alias":"getByTitle","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"text","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Text to locate the element for."}],"required":true,"comment":"Text to locate the element for.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.27","name":"exact","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a\nregular expression. Note that exact match still trims whitespace.","async":false,"alias":"exact","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.17","name":"last","type":{"name":"FrameLocator","expression":"[FrameLocator]"},"spec":[{"type":"text","text":"Returns locator to the last matching frame."}],"required":true,"comment":"Returns locator to the last matching frame.","async":false,"alias":"last","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.17","name":"locator","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"The method finds an element matching the specified selector in the locator's subtree. It also accepts filter options, similar to [`method: Locator.filter`] method."},{"type":"text","text":"[Learn more about locators](../locators.md)."}],"required":true,"comment":"The method finds an element matching the specified selector in the locator's subtree. It also accepts filter\noptions, similar to [`method: Locator.filter`] method.\n\n[Learn more about locators](../locators.md).","async":false,"alias":"locator","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.17","name":"selectorOrLocator","type":{"name":"","union":[{"name":"string"},{"name":"Locator"}],"expression":"[string]|[Locator]"},"spec":[{"type":"text","text":"A selector or locator to use when resolving DOM element."}],"required":true,"comment":"A selector or locator to use when resolving DOM element.","async":false,"alias":"selectorOrLocator","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.17","name":"has","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"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>`."},{"type":"text","text":"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`."},{"type":"text","text":"Note that outer and inner locators must belong to the same frame. Inner locator must not contain `FrameLocator`s."}],"required":false,"comment":"Narrows down the results of the method to those which contain elements matching this relative locator. For example,\n`article` that has `text=Playwright` matches `<article><div>Playwright</div></article>`.\n\nInner locator **must be relative** to the outer locator and is queried starting with the outer locator match, not\nthe document root. For example, you can find `content` that has `div` in\n`<article><content><div>Playwright</div></content></article>`. However, looking for `content` that has `article\ndiv` will fail, because the inner locator must be relative and should not use any elements outside the `content`.\n\nNote that outer and inner locators must belong to the same frame. Inner locator must not contain `FrameLocator`s.","async":false,"alias":"has","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.33","name":"hasNot","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"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>`."},{"type":"text","text":"Note that outer and inner locators must belong to the same frame. Inner locator must not contain `FrameLocator`s."}],"required":false,"comment":"Matches elements that do not contain an element that matches an inner locator. Inner locator is queried against the\nouter one. For example, `article` that does not have `div` matches `<article><span>Playwright</span></article>`.\n\nNote that outer and inner locators must belong to the same frame. Inner locator must not contain `FrameLocator`s.","async":false,"alias":"hasNot","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.33","name":"hasNotText","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Matches elements that do not contain specified text somewhere inside, possibly in a child or a descendant element.\nWhen passed a [string], matching is case-insensitive and searches for a substring.","async":false,"alias":"hasNotText","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.17","name":"hasText","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"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>`."}],"required":false,"comment":"Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When\npassed a [string], matching is case-insensitive and searches for a substring. For example, `\"Playwright\"` matches\n`<article><div>Playwright</div></article>`.","async":false,"alias":"hasText","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.17","name":"nth","type":{"name":"FrameLocator","expression":"[FrameLocator]"},"spec":[{"type":"text","text":"Returns locator to the n-th matching frame. It's zero based, `nth(0)` selects the first frame."}],"required":true,"comment":"Returns locator to the n-th matching frame. It's zero based, `nth(0)` selects the first frame.","async":false,"alias":"nth","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.17","name":"index","type":{"name":"int","expression":"[int]"},"spec":[],"required":true,"comment":"","async":false,"alias":"index","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.43","name":"owner","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Returns a `Locator` object pointing to the same `iframe` as this frame locator."},{"type":"text","text":"Useful when you have a `FrameLocator` object obtained somewhere, and later on would like to interact with the `iframe` element."},{"type":"text","text":"For a reverse operation, use [`method: Locator.contentFrame`]."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const frameLocator = page.frameLocator('iframe[name=\"embedded\"]');","// ...","const locator = frameLocator.owner();","await expect(locator).toBeVisible();"],"codeLang":"js"},{"type":"code","lines":["FrameLocator frameLocator = page.frameLocator(\"iframe[name=\\\"embedded\\\"]\");","// ...","Locator locator = frameLocator.owner();","assertThat(locator).isVisible();"],"codeLang":"java"},{"type":"code","lines":["frame_locator = page.frame_locator(\"iframe[name=\\\"embedded\\\"]\")","# ...","locator = frame_locator.owner","await expect(locator).to_be_visible()"],"codeLang":"python async"},{"type":"code","lines":["frame_locator = page.frame_locator(\"iframe[name=\\\"embedded\\\"]\")","# ...","locator = frame_locator.owner","expect(locator).to_be_visible()"],"codeLang":"python sync"},{"type":"code","lines":["var frameLocator = Page.FrameLocator(\"iframe[name=\\\"embedded\\\"]\");","// ...","var locator = frameLocator.Owner;","await Expect(locator).ToBeVisibleAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Returns a `Locator` object pointing to the same `iframe` as this frame locator.\n\nUseful when you have a `FrameLocator` object obtained somewhere, and later on would like to interact with the\n`iframe` element.\n\nFor a reverse operation, use [`method: Locator.contentFrame`].\n\n**Usage**\n\n```js\nconst frameLocator = page.frameLocator('iframe[name=\"embedded\"]');\n// ...\nconst locator = frameLocator.owner();\nawait expect(locator).toBeVisible();\n```\n\n```java\nFrameLocator frameLocator = page.frameLocator(\"iframe[name=\\\"embedded\\\"]\");\n// ...\nLocator locator = frameLocator.owner();\nassertThat(locator).isVisible();\n```\n\n```py\nframe_locator = page.frame_locator(\"iframe[name=\\\"embedded\\\"]\")\n# ...\nlocator = frame_locator.owner\nawait expect(locator).to_be_visible()\n```\n\n```py\nframe_locator = page.frame_locator(\"iframe[name=\\\"embedded\\\"]\")\n# ...\nlocator = frame_locator.owner\nexpect(locator).to_be_visible()\n```\n\n```csharp\nvar frameLocator = Page.FrameLocator(\"iframe[name=\\\"embedded\\\"]\");\n// ...\nvar locator = frameLocator.Owner;\nawait Expect(locator).ToBeVisibleAsync();\n```\n","async":false,"alias":"owner","overloadIndex":0,"paramOrOption":null,"args":[]}]},{"name":"GenericAssertions","spec":[{"type":"text","text":"The `GenericAssertions` class provides assertion methods that can be used to make assertions about any values in the tests. A new instance of `GenericAssertions` is created by calling [`method: PlaywrightAssertions.expectGeneric`]:"},{"type":"code","lines":["import { test, expect } from '@playwright/test';","","test('assert a value', async ({ page }) => {"," const value = 1;"," expect(value).toBe(2);","});"],"codeLang":"js"}],"langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"comment":"The `GenericAssertions` class provides assertion methods that can be used to make assertions about any values in\nthe tests. A new instance of `GenericAssertions` is created by calling\n[`method: PlaywrightAssertions.expectGeneric`]:\n\n```js\nimport { test, expect } from '@playwright/test';\n\ntest('assert a value', async ({ page }) => {\n const value = 1;\n expect(value).toBe(2);\n});\n```\n","since":"v1.9","members":[{"kind":"property","langs":{},"since":"v1.9","name":"not","type":{"name":"GenericAssertions","expression":"[GenericAssertions]"},"spec":[{"type":"text","text":"Makes the assertion check for the opposite condition. For example, the following code passes:"},{"type":"code","lines":["const value = 1;","expect(value).not.toBe(2);"],"codeLang":"js"}],"required":true,"comment":"Makes the assertion check for the opposite condition. For example, the following code passes:\n\n```js\nconst value = 1;\nexpect(value).not.toBe(2);\n```\n","async":false,"alias":"not","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.9","name":"toBe","type":{"name":"void"},"spec":[{"type":"text","text":"Compares value with `expected` by calling `Object.is`. This method compares objects by reference instead of their contents, similarly to the strict equality operator `===`."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const value = { prop: 1 };","expect(value).toBe(value);","expect(value).not.toBe({});","expect(value.prop).toBe(1);"],"codeLang":"js"}],"required":true,"comment":"Compares value with `expected` by calling `Object.is`. This method compares objects by reference instead of their\ncontents, similarly to the strict equality operator `===`.\n\n**Usage**\n\n```js\nconst value = { prop: 1 };\nexpect(value).toBe(value);\nexpect(value).not.toBe({});\nexpect(value.prop).toBe(1);\n```\n","async":false,"alias":"toBe","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"expected","type":{"name":"any","expression":"[any]"},"spec":[{"type":"text","text":"Expected value."}],"required":true,"comment":"Expected value.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"toBeCloseTo","type":{"name":"void"},"spec":[{"type":"text","text":"Compares floating point numbers for approximate equality. Use this method instead of [`method: GenericAssertions.toBe`] when comparing floating point numbers."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["expect(0.1 + 0.2).not.toBe(0.3);","expect(0.1 + 0.2).toBeCloseTo(0.3, 5);"],"codeLang":"js"}],"required":true,"comment":"Compares floating point numbers for approximate equality. Use this method instead of\n[`method: GenericAssertions.toBe`] when comparing floating point numbers.\n\n**Usage**\n\n```js\nexpect(0.1 + 0.2).not.toBe(0.3);\nexpect(0.1 + 0.2).toBeCloseTo(0.3, 5);\n```\n","async":false,"alias":"toBeCloseTo","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"expected","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Expected value."}],"required":true,"comment":"Expected value.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"numDigits","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"The number of decimal digits after the decimal point that must be equal."}],"required":false,"comment":"The number of decimal digits after the decimal point that must be equal.","async":false,"alias":"numDigits","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"toBeDefined","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures that value is not `undefined`."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const value = null;","expect(value).toBeDefined();"],"codeLang":"js"}],"required":true,"comment":"Ensures that value is not `undefined`.\n\n**Usage**\n\n```js\nconst value = null;\nexpect(value).toBeDefined();\n```\n","async":false,"alias":"toBeDefined","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.9","name":"toBeFalsy","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures that value is false in a boolean context, one of `false`, `0`, `''`, `null`, `undefined` or `NaN`. Use this method when you don't care about the specific value."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const value = null;","expect(value).toBeFalsy();"],"codeLang":"js"}],"required":true,"comment":"Ensures that value is false in a boolean context, one of `false`, `0`, `''`, `null`, `undefined` or `NaN`. Use this\nmethod when you don't care about the specific value.\n\n**Usage**\n\n```js\nconst value = null;\nexpect(value).toBeFalsy();\n```\n","async":false,"alias":"toBeFalsy","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.9","name":"toBeGreaterThan","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures that `value > expected` for number or big integer values."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const value = 42;","expect(value).toBeGreaterThan(1);"],"codeLang":"js"}],"required":true,"comment":"Ensures that `value > expected` for number or big integer values.\n\n**Usage**\n\n```js\nconst value = 42;\nexpect(value).toBeGreaterThan(1);\n```\n","async":false,"alias":"toBeGreaterThan","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"expected","type":{"name":"","union":[{"name":"float"},{"name":"bigint"}],"expression":"[float]|[bigint]"},"spec":[{"type":"text","text":"The value to compare to."}],"required":true,"comment":"The value to compare to.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"toBeGreaterThanOrEqual","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures that `value >= expected` for number or big integer values."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const value = 42;","expect(value).toBeGreaterThanOrEqual(42);"],"codeLang":"js"}],"required":true,"comment":"Ensures that `value >= expected` for number or big integer values.\n\n**Usage**\n\n```js\nconst value = 42;\nexpect(value).toBeGreaterThanOrEqual(42);\n```\n","async":false,"alias":"toBeGreaterThanOrEqual","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"expected","type":{"name":"","union":[{"name":"float"},{"name":"bigint"}],"expression":"[float]|[bigint]"},"spec":[{"type":"text","text":"The value to compare to."}],"required":true,"comment":"The value to compare to.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"toBeInstanceOf","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures that value is an instance of a class. Uses `instanceof` operator."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["expect(page).toBeInstanceOf(Page);","","class Example {}","expect(new Example()).toBeInstanceOf(Example);"],"codeLang":"js"}],"required":true,"comment":"Ensures that value is an instance of a class. Uses `instanceof` operator.\n\n**Usage**\n\n```js\nexpect(page).toBeInstanceOf(Page);\n\nclass Example {}\nexpect(new Example()).toBeInstanceOf(Example);\n```\n","async":false,"alias":"toBeInstanceOf","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"expected","type":{"name":"Function","expression":"[Function]"},"spec":[{"type":"text","text":"The class or constructor function."}],"required":true,"comment":"The class or constructor function.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"toBeLessThan","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures that `value < expected` for number or big integer values."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const value = 42;","expect(value).toBeLessThan(100);"],"codeLang":"js"}],"required":true,"comment":"Ensures that `value < expected` for number or big integer values.\n\n**Usage**\n\n```js\nconst value = 42;\nexpect(value).toBeLessThan(100);\n```\n","async":false,"alias":"toBeLessThan","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"expected","type":{"name":"","union":[{"name":"float"},{"name":"bigint"}],"expression":"[float]|[bigint]"},"spec":[{"type":"text","text":"The value to compare to."}],"required":true,"comment":"The value to compare to.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"toBeLessThanOrEqual","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures that `value <= expected` for number or big integer values."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const value = 42;","expect(value).toBeLessThanOrEqual(42);"],"codeLang":"js"}],"required":true,"comment":"Ensures that `value <= expected` for number or big integer values.\n\n**Usage**\n\n```js\nconst value = 42;\nexpect(value).toBeLessThanOrEqual(42);\n```\n","async":false,"alias":"toBeLessThanOrEqual","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"expected","type":{"name":"","union":[{"name":"float"},{"name":"bigint"}],"expression":"[float]|[bigint]"},"spec":[{"type":"text","text":"The value to compare to."}],"required":true,"comment":"The value to compare to.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"toBeNaN","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures that value is `NaN`."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const value = NaN;","expect(value).toBeNaN();"],"codeLang":"js"}],"required":true,"comment":"Ensures that value is `NaN`.\n\n**Usage**\n\n```js\nconst value = NaN;\nexpect(value).toBeNaN();\n```\n","async":false,"alias":"toBeNaN","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.9","name":"toBeNull","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures that value is `null`."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const value = null;","expect(value).toBeNull();"],"codeLang":"js"}],"required":true,"comment":"Ensures that value is `null`.\n\n**Usage**\n\n```js\nconst value = null;\nexpect(value).toBeNull();\n```\n","async":false,"alias":"toBeNull","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.9","name":"toBeTruthy","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures that value is true in a boolean context, **anything but** `false`, `0`, `''`, `null`, `undefined` or `NaN`. Use this method when you don't care about the specific value."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const value = { example: 'value' };","expect(value).toBeTruthy();"],"codeLang":"js"}],"required":true,"comment":"Ensures that value is true in a boolean context, **anything but** `false`, `0`, `''`, `null`, `undefined` or `NaN`.\nUse this method when you don't care about the specific value.\n\n**Usage**\n\n```js\nconst value = { example: 'value' };\nexpect(value).toBeTruthy();\n```\n","async":false,"alias":"toBeTruthy","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.9","name":"toBeUndefined","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures that value is `undefined`."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const value = undefined;","expect(value).toBeUndefined();"],"codeLang":"js"}],"required":true,"comment":"Ensures that value is `undefined`.\n\n**Usage**\n\n```js\nconst value = undefined;\nexpect(value).toBeUndefined();\n```\n","async":false,"alias":"toBeUndefined","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.9","name":"toContain#1","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures that string value contains an expected substring. Comparison is case-sensitive."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const value = 'Hello, World';","expect(value).toContain('World');","expect(value).toContain(',');"],"codeLang":"js"}],"required":true,"comment":"Ensures that string value contains an expected substring. Comparison is case-sensitive.\n\n**Usage**\n\n```js\nconst value = 'Hello, World';\nexpect(value).toContain('World');\nexpect(value).toContain(',');\n```\n","async":false,"alias":"toContain","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"expected","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Expected substring."}],"required":true,"comment":"Expected substring.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"toContain#2","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures that value is an `Array` or `Set` and contains an expected item."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const value = [1, 2, 3];","expect(value).toContain(2);","expect(new Set(value)).toContain(2);"],"codeLang":"js"}],"required":true,"comment":"Ensures that value is an `Array` or `Set` and contains an expected item.\n\n**Usage**\n\n```js\nconst value = [1, 2, 3];\nexpect(value).toContain(2);\nexpect(new Set(value)).toContain(2);\n```\n","async":false,"alias":"toContain","overloadIndex":1,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"expected","type":{"name":"any","expression":"[any]"},"spec":[{"type":"text","text":"Expected value in the collection."}],"required":true,"comment":"Expected value in the collection.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"toContainEqual","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures that value is an `Array` or `Set` and contains an item equal to the expected."},{"type":"text","text":"For objects, this method recursively checks equality of all fields, rather than comparing objects by reference as performed by [`method: GenericAssertions.toContain#2`]."},{"type":"text","text":"For primitive values, this method is equivalent to [`method: GenericAssertions.toContain#2`]."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const value = ["," { example: 1 },"," { another: 2 },"," { more: 3 },","];","expect(value).toContainEqual({ another: 2 });","expect(new Set(value)).toContainEqual({ another: 2 });"],"codeLang":"js"}],"required":true,"comment":"Ensures that value is an `Array` or `Set` and contains an item equal to the expected.\n\nFor objects, this method recursively checks equality of all fields, rather than comparing objects by reference as\nperformed by [`method: GenericAssertions.toContain#2`].\n\nFor primitive values, this method is equivalent to [`method: GenericAssertions.toContain#2`].\n\n**Usage**\n\n```js\nconst value = [\n { example: 1 },\n { another: 2 },\n { more: 3 },\n];\nexpect(value).toContainEqual({ another: 2 });\nexpect(new Set(value)).toContainEqual({ another: 2 });\n```\n","async":false,"alias":"toContainEqual","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"expected","type":{"name":"any","expression":"[any]"},"spec":[{"type":"text","text":"Expected value in the collection."}],"required":true,"comment":"Expected value in the collection.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"toEqual","type":{"name":"void"},"spec":[{"type":"text","text":"Compares contents of the value with contents of `expected`, performing \"deep equality\" check."},{"type":"text","text":"For objects, this method recursively checks equality of all fields, rather than comparing objects by reference as performed by [`method: GenericAssertions.toBe`]."},{"type":"text","text":"For primitive values, this method is equivalent to [`method: GenericAssertions.toBe`]."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const value = { prop: 1 };","expect(value).toEqual({ prop: 1 });"],"codeLang":"js"},{"type":"text","text":"**Non-strict equality**"},{"type":"text","text":"[`method: GenericAssertions.toEqual`] performs deep equality check that compares contents of the received and expected values. To ensure two objects reference the same instance, use [`method: GenericAssertions.toBe`] instead."},{"type":"text","text":"[`method: GenericAssertions.toEqual`] ignores `undefined` properties and array items, and does not insist on object types being equal. For stricter matching, use [`method: GenericAssertions.toStrictEqual`]."},{"type":"text","text":"**Pattern matching**"},{"type":"text","text":"[`method: GenericAssertions.toEqual`] can be also used to perform pattern matching on objects, arrays and primitive types, with the help of the following matchers:"},{"type":"li","text":"[`method: GenericAssertions.any`]","liType":"bullet"},{"type":"li","text":"[`method: GenericAssertions.anything`]","liType":"bullet"},{"type":"li","text":"[`method: GenericAssertions.arrayContaining`]","liType":"bullet"},{"type":"li","text":"[`method: GenericAssertions.closeTo`]","liType":"bullet"},{"type":"li","text":"[`method: GenericAssertions.objectContaining`]","liType":"bullet"},{"type":"li","text":"[`method: GenericAssertions.stringContaining`]","liType":"bullet"},{"type":"li","text":"[`method: GenericAssertions.stringMatching`]","liType":"bullet"},{"type":"text","text":"Here is an example that asserts some of the values inside a complex object:"},{"type":"code","lines":["expect({"," list: [1, 2, 3],"," obj: { prop: 'Hello world!', another: 'some other value' },"," extra: 'extra',","}).toEqual(expect.objectContaining({"," list: expect.arrayContaining([2, 3]),"," obj: expect.objectContaining({ prop: expect.stringContaining('Hello') }),","}));"],"codeLang":"js"}],"required":true,"comment":"Compares contents of the value with contents of `expected`, performing \"deep equality\" check.\n\nFor objects, this method recursively checks equality of all fields, rather than comparing objects by reference as\nperformed by [`method: GenericAssertions.toBe`].\n\nFor primitive values, this method is equivalent to [`method: GenericAssertions.toBe`].\n\n**Usage**\n\n```js\nconst value = { prop: 1 };\nexpect(value).toEqual({ prop: 1 });\n```\n\n**Non-strict equality**\n\n[`method: GenericAssertions.toEqual`] performs deep equality check that compares contents of the received and\nexpected values. To ensure two objects reference the same instance, use [`method: GenericAssertions.toBe`] instead.\n\n[`method: GenericAssertions.toEqual`] ignores `undefined` properties and array items, and does not insist on object\ntypes being equal. For stricter matching, use [`method: GenericAssertions.toStrictEqual`].\n\n**Pattern matching**\n\n[`method: GenericAssertions.toEqual`] can be also used to perform pattern matching on objects, arrays and primitive\ntypes, with the help of the following matchers:\n- [`method: GenericAssertions.any`]\n- [`method: GenericAssertions.anything`]\n- [`method: GenericAssertions.arrayContaining`]\n- [`method: GenericAssertions.closeTo`]\n- [`method: GenericAssertions.objectContaining`]\n- [`method: GenericAssertions.stringContaining`]\n- [`method: GenericAssertions.stringMatching`]\n\nHere is an example that asserts some of the values inside a complex object:\n\n```js\nexpect({\n list: [1, 2, 3],\n obj: { prop: 'Hello world!', another: 'some other value' },\n extra: 'extra',\n}).toEqual(expect.objectContaining({\n list: expect.arrayContaining([2, 3]),\n obj: expect.objectContaining({ prop: expect.stringContaining('Hello') }),\n}));\n```\n","async":false,"alias":"toEqual","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"expected","type":{"name":"any","expression":"[any]"},"spec":[{"type":"text","text":"Expected value."}],"required":true,"comment":"Expected value.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"toHaveLength","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures that value has a `.length` property equal to `expected`. Useful for arrays and strings."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["expect('Hello, World').toHaveLength(12);","expect([1, 2, 3]).toHaveLength(3);"],"codeLang":"js"}],"required":true,"comment":"Ensures that value has a `.length` property equal to `expected`. Useful for arrays and strings.\n\n**Usage**\n\n```js\nexpect('Hello, World').toHaveLength(12);\nexpect([1, 2, 3]).toHaveLength(3);\n```\n","async":false,"alias":"toHaveLength","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"expected","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Expected length."}],"required":true,"comment":"Expected length.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"toHaveProperty","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures that property at provided `keyPath` exists on the object and optionally checks that property is equal to the `expected`. Equality is checked recursively, similarly to [`method: GenericAssertions.toEqual`]."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const value = {"," a: {"," b: [42],"," },"," c: true,","};","expect(value).toHaveProperty('a.b');","expect(value).toHaveProperty('a.b', [42]);","expect(value).toHaveProperty('a.b[0]', 42);","expect(value).toHaveProperty('c');","expect(value).toHaveProperty('c', true);"],"codeLang":"js"}],"required":true,"comment":"Ensures that property at provided `keyPath` exists on the object and optionally checks that property is equal to\nthe `expected`. Equality is checked recursively, similarly to [`method: GenericAssertions.toEqual`].\n\n**Usage**\n\n```js\nconst value = {\n a: {\n b: [42],\n },\n c: true,\n};\nexpect(value).toHaveProperty('a.b');\nexpect(value).toHaveProperty('a.b', [42]);\nexpect(value).toHaveProperty('a.b[0]', 42);\nexpect(value).toHaveProperty('c');\nexpect(value).toHaveProperty('c', true);\n```\n","async":false,"alias":"toHaveProperty","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"keyPath","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Path to the property. Use dot notation `a.b` to check nested properties and indexed `a[2]` notation to check nested array items."}],"required":true,"comment":"Path to the property. Use dot notation `a.b` to check nested properties and indexed `a[2]` notation to check nested\narray items.","async":false,"alias":"keyPath","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"expected","type":{"name":"any","expression":"[any]"},"spec":[{"type":"text","text":"Optional expected value to compare the property to."}],"required":false,"comment":"Optional expected value to compare the property to.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"toMatch","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures that string value matches a regular expression."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const value = 'Is 42 enough?';","expect(value).toMatch(/Is \\d+ enough/);"],"codeLang":"js"}],"required":true,"comment":"Ensures that string value matches a regular expression.\n\n**Usage**\n\n```js\nconst value = 'Is 42 enough?';\nexpect(value).toMatch(/Is \\d+ enough/);\n```\n","async":false,"alias":"toMatch","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"expected","type":{"name":"","union":[{"name":"RegExp"},{"name":"string"}],"expression":"[RegExp]|[string]"},"spec":[{"type":"text","text":"Regular expression to match against."}],"required":true,"comment":"Regular expression to match against.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"toMatchObject","type":{"name":"void"},"spec":[{"type":"text","text":"Compares contents of the value with contents of `expected`, performing \"deep equality\" check. Allows extra properties to be present in the value, unlike [`method: GenericAssertions.toEqual`], so you can check just a subset of object properties."},{"type":"text","text":"When comparing arrays, the number of items must match, and each item is checked recursively."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const value = {"," a: 1,"," b: 2,"," c: true,","};","expect(value).toMatchObject({ a: 1, c: true });","expect(value).toMatchObject({ b: 2, c: true });","","expect([{ a: 1, b: 2 }]).toMatchObject([{ a: 1 }]);"],"codeLang":"js"}],"required":true,"comment":"Compares contents of the value with contents of `expected`, performing \"deep equality\" check. Allows extra\nproperties to be present in the value, unlike [`method: GenericAssertions.toEqual`], so you can check just a subset\nof object properties.\n\nWhen comparing arrays, the number of items must match, and each item is checked recursively.\n\n**Usage**\n\n```js\nconst value = {\n a: 1,\n b: 2,\n c: true,\n};\nexpect(value).toMatchObject({ a: 1, c: true });\nexpect(value).toMatchObject({ b: 2, c: true });\n\nexpect([{ a: 1, b: 2 }]).toMatchObject([{ a: 1 }]);\n```\n","async":false,"alias":"toMatchObject","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"expected","type":{"name":"","union":[{"name":"Object"},{"name":"Array"}],"expression":"[Object]|[Array]"},"spec":[{"type":"text","text":"The expected object value to match against."}],"required":true,"comment":"The expected object value to match against.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"toStrictEqual","type":{"name":"void"},"spec":[{"type":"text","text":"Compares contents of the value with contents of `expected` **and** their types."},{"type":"text","text":"Differences from [`method: GenericAssertions.toEqual`]:"},{"type":"li","text":"Keys with undefined properties are checked. For example, `{ a: undefined, b: 2 }` does not match `{ b: 2 }`.","liType":"bullet"},{"type":"li","text":"Array sparseness is checked. For example, `[, 1]` does not match `[undefined, 1]`.","liType":"bullet"},{"type":"li","text":"Object types are checked to be equal. For example, a class instance with fields `a` and `b` will not equal a literal object with fields `a` and `b`.","liType":"bullet"},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const value = { prop: 1 };","expect(value).toStrictEqual({ prop: 1 });"],"codeLang":"js"}],"required":true,"comment":"Compares contents of the value with contents of `expected` **and** their types.\n\nDifferences from [`method: GenericAssertions.toEqual`]:\n- Keys with undefined properties are checked. For example, `{ a: undefined, b: 2 }` does not match `{ b: 2 }`.\n- Array sparseness is checked. For example, `[, 1]` does not match `[undefined, 1]`.\n- Object types are checked to be equal. For example, a class instance with fields `a` and `b` will not equal a\n literal object with fields `a` and `b`.\n\n**Usage**\n\n```js\nconst value = { prop: 1 };\nexpect(value).toStrictEqual({ prop: 1 });\n```\n","async":false,"alias":"toStrictEqual","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"expected","type":{"name":"any","expression":"[any]"},"spec":[{"type":"text","text":"Expected value."}],"required":true,"comment":"Expected value.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"toThrow","type":{"name":"void"},"spec":[{"type":"text","text":"Calls the function and ensures it throws an error."},{"type":"text","text":"Optionally compares the error with `expected`. Allowed expected values:"},{"type":"li","text":"Regular expression - error message should **match** the pattern.","liType":"bullet"},{"type":"li","text":"String - error message should **include** the substring.","liType":"bullet"},{"type":"li","text":"Error object - error message should be **equal to** the message property of the object.","liType":"bullet"},{"type":"li","text":"Error class - error object should be an **instance of** the class.","liType":"bullet"},{"type":"text","text":"**Usage**"},{"type":"code","lines":["expect(() => {"," throw new Error('Something bad');","}).toThrow();","","expect(() => {"," throw new Error('Something bad');","}).toThrow(/something/);","","expect(() => {"," throw new Error('Something bad');","}).toThrow(Error);"],"codeLang":"js"}],"required":true,"comment":"Calls the function and ensures it throws an error.\n\nOptionally compares the error with `expected`. Allowed expected values:\n- Regular expression - error message should **match** the pattern.\n- String - error message should **include** the substring.\n- Error object - error message should be **equal to** the message property of the object.\n- Error class - error object should be an **instance of** the class.\n\n**Usage**\n\n```js\nexpect(() => {\n throw new Error('Something bad');\n}).toThrow();\n\nexpect(() => {\n throw new Error('Something bad');\n}).toThrow(/something/);\n\nexpect(() => {\n throw new Error('Something bad');\n}).toThrow(Error);\n```\n","async":false,"alias":"toThrow","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"expected","type":{"name":"any","expression":"[any]"},"spec":[{"type":"text","text":"Expected error message or error object."}],"required":false,"comment":"Expected error message or error object.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"toThrowError","type":{"name":"void"},"spec":[{"type":"text","text":"An alias for [`method: GenericAssertions.toThrow`]."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["expect(() => {"," throw new Error('Something bad');","}).toThrowError();"],"codeLang":"js"}],"required":true,"comment":"An alias for [`method: GenericAssertions.toThrow`].\n\n**Usage**\n\n```js\nexpect(() => {\n throw new Error('Something bad');\n}).toThrowError();\n```\n","async":false,"alias":"toThrowError","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"expected","type":{"name":"any","expression":"[any]"},"spec":[{"type":"text","text":"Expected error message or error object."}],"required":false,"comment":"Expected error message or error object.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"any","type":{"name":"void"},"spec":[{"type":"text","text":"`expect.any()` matches any object instance created from the `constructor` or a corresponding primitive type. Use it inside [`method: GenericAssertions.toEqual`] to perform pattern matching."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["// Match instance of a class.","class Example {}","expect(new Example()).toEqual(expect.any(Example));","","// Match any number.","expect({ prop: 1 }).toEqual({ prop: expect.any(Number) });","","// Match any string.","expect('abc').toEqual(expect.any(String));"],"codeLang":"js"}],"required":true,"comment":"`expect.any()` matches any object instance created from the `constructor` or a corresponding primitive type. Use it\ninside [`method: GenericAssertions.toEqual`] to perform pattern matching.\n\n**Usage**\n\n```js\n// Match instance of a class.\nclass Example {}\nexpect(new Example()).toEqual(expect.any(Example));\n\n// Match any number.\nexpect({ prop: 1 }).toEqual({ prop: expect.any(Number) });\n\n// Match any string.\nexpect('abc').toEqual(expect.any(String));\n```\n","async":false,"alias":"any","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"constructor","type":{"name":"Function","expression":"[Function]"},"spec":[{"type":"text","text":"Constructor of the expected object like `ExampleClass`, or a primitive boxed type like `Number`."}],"required":true,"comment":"Constructor of the expected object like `ExampleClass`, or a primitive boxed type like `Number`.","async":false,"alias":"constructor","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"anything","type":{"name":"void"},"spec":[{"type":"text","text":"`expect.anything()` matches everything except `null` and `undefined`. Use it inside [`method: GenericAssertions.toEqual`] to perform pattern matching."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const value = { prop: 1 };","expect(value).toEqual({ prop: expect.anything() });","expect(value).not.toEqual({ otherProp: expect.anything() });"],"codeLang":"js"}],"required":true,"comment":"`expect.anything()` matches everything except `null` and `undefined`. Use it inside\n[`method: GenericAssertions.toEqual`] to perform pattern matching.\n\n**Usage**\n\n```js\nconst value = { prop: 1 };\nexpect(value).toEqual({ prop: expect.anything() });\nexpect(value).not.toEqual({ otherProp: expect.anything() });\n```\n","async":false,"alias":"anything","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.9","name":"arrayContaining","type":{"name":"void"},"spec":[{"type":"text","text":"`expect.arrayContaining()` matches an array that contains all of the elements in the expected array, in any order. Note that received array may be a superset of the expected array and contain some extra elements."},{"type":"text","text":"Use this method inside [`method: GenericAssertions.toEqual`] to perform pattern matching."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["expect([1, 2, 3]).toEqual(expect.arrayContaining([3, 1]));","expect([1, 2, 3]).not.toEqual(expect.arrayContaining([1, 4]));"],"codeLang":"js"}],"required":true,"comment":"`expect.arrayContaining()` matches an array that contains all of the elements in the expected array, in any order.\nNote that received array may be a superset of the expected array and contain some extra elements.\n\nUse this method inside [`method: GenericAssertions.toEqual`] to perform pattern matching.\n\n**Usage**\n\n```js\nexpect([1, 2, 3]).toEqual(expect.arrayContaining([3, 1]));\nexpect([1, 2, 3]).not.toEqual(expect.arrayContaining([1, 4]));\n```\n","async":false,"alias":"arrayContaining","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"expected","type":{"name":"Array","templates":[{"name":"any"}],"expression":"[Array]<[any]>"},"spec":[{"type":"text","text":"Expected array that is a subset of the received value."}],"required":true,"comment":"Expected array that is a subset of the received value.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"closeTo","type":{"name":"void"},"spec":[{"type":"text","text":"Compares floating point numbers for approximate equality. Use this method inside [`method: GenericAssertions.toEqual`] to perform pattern matching. When just comparing two numbers, prefer [`method: GenericAssertions.toBeCloseTo`]."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["expect({ prop: 0.1 + 0.2 }).not.toEqual({ prop: 0.3 });","expect({ prop: 0.1 + 0.2 }).toEqual({ prop: expect.closeTo(0.3, 5) });"],"codeLang":"js"}],"required":true,"comment":"Compares floating point numbers for approximate equality. Use this method inside\n[`method: GenericAssertions.toEqual`] to perform pattern matching. When just comparing two numbers, prefer\n[`method: GenericAssertions.toBeCloseTo`].\n\n**Usage**\n\n```js\nexpect({ prop: 0.1 + 0.2 }).not.toEqual({ prop: 0.3 });\nexpect({ prop: 0.1 + 0.2 }).toEqual({ prop: expect.closeTo(0.3, 5) });\n```\n","async":false,"alias":"closeTo","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"expected","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Expected value."}],"required":true,"comment":"Expected value.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"numDigits","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"The number of decimal digits after the decimal point that must be equal."}],"required":false,"comment":"The number of decimal digits after the decimal point that must be equal.","async":false,"alias":"numDigits","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"objectContaining","type":{"name":"void"},"spec":[{"type":"text","text":"`expect.objectContaining()` matches an object that contains and matches all of the properties in the expected object. Note that received object may be a superset of the expected object and contain some extra properties."},{"type":"text","text":"Use this method inside [`method: GenericAssertions.toEqual`] to perform pattern matching. Object properties can be matchers to further relax the expectation. See examples."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["// Assert some of the properties.","expect({ foo: 1, bar: 2 }).toEqual(expect.objectContaining({ foo: 1 }));","","// Matchers can be used on the properties as well.","expect({ foo: 1, bar: 2 }).toEqual(expect.objectContaining({ bar: expect.any(Number) }));","","// Complex matching of sub-properties.","expect({"," list: [1, 2, 3],"," obj: { prop: 'Hello world!', another: 'some other value' },"," extra: 'extra',","}).toEqual(expect.objectContaining({"," list: expect.arrayContaining([2, 3]),"," obj: expect.objectContaining({ prop: expect.stringContaining('Hello') }),","}));"],"codeLang":"js"}],"required":true,"comment":"`expect.objectContaining()` matches an object that contains and matches all of the properties in the expected\nobject. Note that received object may be a superset of the expected object and contain some extra properties.\n\nUse this method inside [`method: GenericAssertions.toEqual`] to perform pattern matching. Object properties can be\nmatchers to further relax the expectation. See examples.\n\n**Usage**\n\n```js\n// Assert some of the properties.\nexpect({ foo: 1, bar: 2 }).toEqual(expect.objectContaining({ foo: 1 }));\n\n// Matchers can be used on the properties as well.\nexpect({ foo: 1, bar: 2 }).toEqual(expect.objectContaining({ bar: expect.any(Number) }));\n\n// Complex matching of sub-properties.\nexpect({\n list: [1, 2, 3],\n obj: { prop: 'Hello world!', another: 'some other value' },\n extra: 'extra',\n}).toEqual(expect.objectContaining({\n list: expect.arrayContaining([2, 3]),\n obj: expect.objectContaining({ prop: expect.stringContaining('Hello') }),\n}));\n```\n","async":false,"alias":"objectContaining","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"expected","type":{"name":"Object","expression":"[Object]"},"spec":[{"type":"text","text":"Expected object pattern that contains a subset of the properties."}],"required":true,"comment":"Expected object pattern that contains a subset of the properties.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"stringContaining","type":{"name":"void"},"spec":[{"type":"text","text":"`expect.stringContaining()` matches a string that contains the expected substring. Use this method inside [`method: GenericAssertions.toEqual`] to perform pattern matching."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["expect('Hello world!').toEqual(expect.stringContaining('Hello'));"],"codeLang":"js"}],"required":true,"comment":"`expect.stringContaining()` matches a string that contains the expected substring. Use this method inside\n[`method: GenericAssertions.toEqual`] to perform pattern matching.\n\n**Usage**\n\n```js\nexpect('Hello world!').toEqual(expect.stringContaining('Hello'));\n```\n","async":false,"alias":"stringContaining","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"expected","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Expected substring."}],"required":true,"comment":"Expected substring.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.9","name":"stringMatching","type":{"name":"void"},"spec":[{"type":"text","text":"`expect.stringMatching()` matches a received string that in turn matches the expected pattern. Use this method inside [`method: GenericAssertions.toEqual`] to perform pattern matching."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["expect('123ms').toEqual(expect.stringMatching(/\\d+m?s/));","","// Inside another matcher.","expect({"," status: 'passed',"," time: '123ms',","}).toEqual({"," status: expect.stringMatching(/passed|failed/),"," time: expect.stringMatching(/\\d+m?s/),","});"],"codeLang":"js"}],"required":true,"comment":"`expect.stringMatching()` matches a received string that in turn matches the expected pattern. Use this method\ninside [`method: GenericAssertions.toEqual`] to perform pattern matching.\n\n**Usage**\n\n```js\nexpect('123ms').toEqual(expect.stringMatching(/\\d+m?s/));\n\n// Inside another matcher.\nexpect({\n status: 'passed',\n time: '123ms',\n}).toEqual({\n status: expect.stringMatching(/passed|failed/),\n time: expect.stringMatching(/\\d+m?s/),\n});\n```\n","async":false,"alias":"stringMatching","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"expected","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Pattern that expected string should match."}],"required":true,"comment":"Pattern that expected string should match.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null}]}]},{"name":"JSHandle","spec":[{"type":"text","text":"JSHandle represents an in-page JavaScript object. JSHandles can be created with the [`method: Page.evaluateHandle`]↵method."},{"type":"code","lines":["const windowHandle = await page.evaluateHandle(() => window);","// ..."],"codeLang":"js"},{"type":"code","lines":["JSHandle windowHandle = page.evaluateHandle(\"() => window\");","// ..."],"codeLang":"java"},{"type":"code","lines":["window_handle = await page.evaluate_handle(\"window\")","# ..."],"codeLang":"python async"},{"type":"code","lines":["window_handle = page.evaluate_handle(\"window\")","# ..."],"codeLang":"python sync"},{"type":"code","lines":["var windowHandle = await page.EvaluateHandleAsync(\"() => window\");"],"codeLang":"csharp"},{"type":"text","text":"JSHandle prevents the referenced JavaScript object being garbage collected unless the handle is exposed with↵[`method: JSHandle.dispose`]. JSHandles are auto-disposed when their origin frame gets navigated or the parent context↵gets destroyed."},{"type":"text","text":"JSHandle instances can be used as an argument in [`method: Page.evalOnSelector`], [`method: Page.evaluate`] and↵[`method: Page.evaluateHandle`] methods."}],"langs":{},"comment":"JSHandle represents an in-page JavaScript object. JSHandles can be created with the [`method: Page.evaluateHandle`]\nmethod.\n\n```js\nconst windowHandle = await page.evaluateHandle(() => window);\n// ...\n```\n\n```java\nJSHandle windowHandle = page.evaluateHandle(\"() => window\");\n// ...\n```\n\n```py\nwindow_handle = await page.evaluate_handle(\"window\")\n# ...\n```\n\n```py\nwindow_handle = page.evaluate_handle(\"window\")\n# ...\n```\n\n```csharp\nvar windowHandle = await page.EvaluateHandleAsync(\"() => window\");\n```\n\nJSHandle prevents the referenced JavaScript object being garbage collected unless the handle is exposed with\n[`method: JSHandle.dispose`]. JSHandles are auto-disposed when their origin frame gets navigated or the parent\ncontext gets destroyed.\n\nJSHandle instances can be used as an argument in [`method: Page.evalOnSelector`], [`method: Page.evaluate`] and\n[`method: Page.evaluateHandle`] methods.","since":"v1.8","members":[{"kind":"method","langs":{},"since":"v1.8","name":"asElement","type":{"name":"","union":[{"name":"null"},{"name":"ElementHandle"}],"expression":"[null]|[ElementHandle]"},"spec":[{"type":"text","text":"Returns either `null` or the object handle itself, if the object handle is an instance of `ElementHandle`."}],"required":true,"comment":"Returns either `null` or the object handle itself, if the object handle is an instance of `ElementHandle`.","async":false,"alias":"asElement","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"dispose","type":{"name":"void"},"spec":[{"type":"text","text":"The `jsHandle.dispose` method stops referencing the element handle."}],"required":true,"comment":"The `jsHandle.dispose` method stops referencing the element handle.","async":true,"alias":"dispose","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"evaluate","type":{"name":"Serializable","expression":"[Serializable]"},"spec":[{"type":"text","text":"Returns the return value of `expression`."},{"type":"text","text":"This method passes this handle as the first argument to `expression`."},{"type":"text","text":"If `expression` returns a [Promise], then `handle.evaluate` would wait for the promise to resolve and return↵its value."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const tweetHandle = await page.$('.tweet .retweets');","expect(await tweetHandle.evaluate(node => node.innerText)).toBe('10 retweets');"],"codeLang":"js"},{"type":"code","lines":["ElementHandle tweetHandle = page.querySelector(\".tweet .retweets\");","assertEquals(\"10 retweets\", tweetHandle.evaluate(\"node => node.innerText\"));"],"codeLang":"java"},{"type":"code","lines":["tweet_handle = await page.query_selector(\".tweet .retweets\")","assert await tweet_handle.evaluate(\"node => node.innerText\") == \"10 retweets\""],"codeLang":"python async"},{"type":"code","lines":["tweet_handle = page.query_selector(\".tweet .retweets\")","assert tweet_handle.evaluate(\"node => node.innerText\") == \"10 retweets\""],"codeLang":"python sync"},{"type":"code","lines":["var tweetHandle = await page.QuerySelectorAsync(\".tweet .retweets\");","Assert.AreEqual(\"10 retweets\", await tweetHandle.EvaluateAsync(\"node => node.innerText\"));"],"codeLang":"csharp"}],"required":true,"comment":"Returns the return value of `expression`.\n\nThis method passes this handle as the first argument to `expression`.\n\nIf `expression` returns a [Promise], then `handle.evaluate` would wait for the promise to resolve and return its\nvalue.\n\n**Usage**\n\n```js\nconst tweetHandle = await page.$('.tweet .retweets');\nexpect(await tweetHandle.evaluate(node => node.innerText)).toBe('10 retweets');\n```\n\n```java\nElementHandle tweetHandle = page.querySelector(\".tweet .retweets\");\nassertEquals(\"10 retweets\", tweetHandle.evaluate(\"node => node.innerText\"));\n```\n\n```py\ntweet_handle = await page.query_selector(\".tweet .retweets\")\nassert await tweet_handle.evaluate(\"node => node.innerText\") == \"10 retweets\"\n```\n\n```py\ntweet_handle = page.query_selector(\".tweet .retweets\")\nassert tweet_handle.evaluate(\"node => node.innerText\") == \"10 retweets\"\n```\n\n```csharp\nvar tweetHandle = await page.QuerySelectorAsync(\".tweet .retweets\");\nAssert.AreEqual(\"10 retweets\", await tweetHandle.EvaluateAsync(\"node => node.innerText\"));\n```\n","async":true,"alias":"evaluate","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"overrides":{"js":{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"expression","type":{"name":"","union":[{"name":"function"},{"name":"string"}],"expression":"[function]|[string]"},"spec":[{"type":"text","text":"Function to be evaluated in the page context."}],"argsArray":[],"required":true,"comment":"Function to be evaluated in the page context.","args":{},"clazz":null,"async":false,"alias":"pageFunction","overloadIndex":0,"paramOrOption":null}}},"since":"v1.8","name":"expression","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"JavaScript expression to be evaluated in the browser context. If the expression evaluates↵to a function, the function is automatically invoked."}],"required":true,"comment":"JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the\nfunction is automatically invoked.","async":false,"alias":"expression","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"arg","type":{"name":"EvaluationArgument","expression":"[EvaluationArgument]"},"spec":[{"type":"text","text":"Optional argument to pass to `expression`."}],"required":false,"comment":"Optional argument to pass to `expression`.","async":false,"alias":"arg","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"evaluateHandle","type":{"name":"JSHandle","expression":"[JSHandle]"},"spec":[{"type":"text","text":"Returns the return value of `expression` as a `JSHandle`."},{"type":"text","text":"This method passes this handle as the first argument to `expression`."},{"type":"text","text":"The only difference between `jsHandle.evaluate` and `jsHandle.evaluateHandle` is that `jsHandle.evaluateHandle` returns `JSHandle`."},{"type":"text","text":"If the function passed to the `jsHandle.evaluateHandle` returns a [Promise], then `jsHandle.evaluateHandle` would wait↵for the promise to resolve and return its value."},{"type":"text","text":"See [`method: Page.evaluateHandle`] for more details."}],"required":true,"comment":"Returns the return value of `expression` as a `JSHandle`.\n\nThis method passes this handle as the first argument to `expression`.\n\nThe only difference between `jsHandle.evaluate` and `jsHandle.evaluateHandle` is that `jsHandle.evaluateHandle`\nreturns `JSHandle`.\n\nIf the function passed to the `jsHandle.evaluateHandle` returns a [Promise], then `jsHandle.evaluateHandle` would\nwait for the promise to resolve and return its value.\n\nSee [`method: Page.evaluateHandle`] for more details.","async":true,"alias":"evaluateHandle","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"overrides":{"js":{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"expression","type":{"name":"","union":[{"name":"function"},{"name":"string"}],"expression":"[function]|[string]"},"spec":[{"type":"text","text":"Function to be evaluated in the page context."}],"argsArray":[],"required":true,"comment":"Function to be evaluated in the page context.","args":{},"clazz":null,"async":false,"alias":"pageFunction","overloadIndex":0,"paramOrOption":null}}},"since":"v1.8","name":"expression","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"JavaScript expression to be evaluated in the browser context. If the expression evaluates↵to a function, the function is automatically invoked."}],"required":true,"comment":"JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the\nfunction is automatically invoked.","async":false,"alias":"expression","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"arg","type":{"name":"EvaluationArgument","expression":"[EvaluationArgument]"},"spec":[{"type":"text","text":"Optional argument to pass to `expression`."}],"required":false,"comment":"Optional argument to pass to `expression`.","async":false,"alias":"arg","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"getProperties","type":{"name":"Map","templates":[{"name":"string"},{"name":"JSHandle"}],"expression":"[Map]<[string], [JSHandle]>"},"spec":[{"type":"text","text":"The method returns a map with **own property names** as keys and JSHandle instances for the property values."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const handle = await page.evaluateHandle(() => ({ window, document }));","const properties = await handle.getProperties();","const windowHandle = properties.get('window');","const documentHandle = properties.get('document');","await handle.dispose();"],"codeLang":"js"},{"type":"code","lines":["JSHandle handle = page.evaluateHandle(\"() => ({ window, document })\");","Map<String, JSHandle> properties = handle.getProperties();","JSHandle windowHandle = properties.get(\"window\");","JSHandle documentHandle = properties.get(\"document\");","handle.dispose();"],"codeLang":"java"},{"type":"code","lines":["handle = await page.evaluate_handle(\"({ window, document })\")","properties = await handle.get_properties()","window_handle = properties.get(\"window\")","document_handle = properties.get(\"document\")","await handle.dispose()"],"codeLang":"python async"},{"type":"code","lines":["handle = page.evaluate_handle(\"({ window, document })\")","properties = handle.get_properties()","window_handle = properties.get(\"window\")","document_handle = properties.get(\"document\")","handle.dispose()"],"codeLang":"python sync"},{"type":"code","lines":["var handle = await page.EvaluateHandleAsync(\"() => ({ window, document }\");","var properties = await handle.GetPropertiesAsync();","var windowHandle = properties[\"window\"];","var documentHandle = properties[\"document\"];","await handle.DisposeAsync();"],"codeLang":"csharp"}],"required":true,"comment":"The method returns a map with **own property names** as keys and JSHandle instances for the property values.\n\n**Usage**\n\n```js\nconst handle = await page.evaluateHandle(() => ({ window, document }));\nconst properties = await handle.getProperties();\nconst windowHandle = properties.get('window');\nconst documentHandle = properties.get('document');\nawait handle.dispose();\n```\n\n```java\nJSHandle handle = page.evaluateHandle(\"() => ({ window, document })\");\nMap<String, JSHandle> properties = handle.getProperties();\nJSHandle windowHandle = properties.get(\"window\");\nJSHandle documentHandle = properties.get(\"document\");\nhandle.dispose();\n```\n\n```py\nhandle = await page.evaluate_handle(\"({ window, document })\")\nproperties = await handle.get_properties()\nwindow_handle = properties.get(\"window\")\ndocument_handle = properties.get(\"document\")\nawait handle.dispose()\n```\n\n```py\nhandle = page.evaluate_handle(\"({ window, document })\")\nproperties = handle.get_properties()\nwindow_handle = properties.get(\"window\")\ndocument_handle = properties.get(\"document\")\nhandle.dispose()\n```\n\n```csharp\nvar handle = await page.EvaluateHandleAsync(\"() => ({ window, document }\");\nvar properties = await handle.GetPropertiesAsync();\nvar windowHandle = properties[\"window\"];\nvar documentHandle = properties[\"document\"];\nawait handle.DisposeAsync();\n```\n","async":true,"alias":"getProperties","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"getProperty","type":{"name":"JSHandle","expression":"[JSHandle]"},"spec":[{"type":"text","text":"Fetches a single property from the referenced object."}],"required":true,"comment":"Fetches a single property from the referenced object.","async":true,"alias":"getProperty","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"propertyName","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"property to get"}],"required":true,"comment":"property to get","async":false,"alias":"propertyName","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"jsonValue","type":{"name":"Serializable","expression":"[Serializable]"},"spec":[{"type":"text","text":"Returns a JSON representation of the object. If the object has a `toJSON` function, it **will not be called**."},{"type":"note","noteType":"note","text":"The method will return an empty JSON object if the referenced object is not stringifiable. It will throw an error if the↵object has circular references."}],"required":true,"comment":"Returns a JSON representation of the object. If the object has a `toJSON` function, it **will not be called**.\n\n**NOTE** The method will return an empty JSON object if the referenced object is not stringifiable. It will throw\nan error if the object has circular references.","async":true,"alias":"jsonValue","overloadIndex":0,"paramOrOption":null,"args":[]}]},{"name":"Keyboard","spec":[{"type":"text","text":"Keyboard provides an api for managing a virtual keyboard. The high level api is [`method: Keyboard.type`], which takes↵raw characters and generates proper `keydown`, `keypress`/`input`, and `keyup` events on your page."},{"type":"text","text":"For finer control, you can use [`method: Keyboard.down`], [`method: Keyboard.up`], and [`method: Keyboard.insertText`]↵to manually fire events as if they were generated from a real keyboard."},{"type":"text","text":"An example of holding down `Shift` in order to select and delete some text:"},{"type":"code","lines":["await page.keyboard.type('Hello World!');","await page.keyboard.press('ArrowLeft');","","await page.keyboard.down('Shift');","for (let i = 0; i < ' World'.length; i++)"," await page.keyboard.press('ArrowLeft');","await page.keyboard.up('Shift');","","await page.keyboard.press('Backspace');","// Result text will end up saying 'Hello!'"],"codeLang":"js"},{"type":"code","lines":["page.keyboard().type(\"Hello World!\");","page.keyboard().press(\"ArrowLeft\");","page.keyboard().down(\"Shift\");","for (int i = 0; i < \" World\".length(); i++)"," page.keyboard().press(\"ArrowLeft\");","page.keyboard().up(\"Shift\");","page.keyboard().press(\"Backspace\");","// Result text will end up saying \"Hello!\""],"codeLang":"java"},{"type":"code","lines":["await page.keyboard.type(\"Hello World!\")","await page.keyboard.press(\"ArrowLeft\")","await page.keyboard.down(\"Shift\")","for i in range(6):"," await page.keyboard.press(\"ArrowLeft\")","await page.keyboard.up(\"Shift\")","await page.keyboard.press(\"Backspace\")","# result text will end up saying \"Hello!\""],"codeLang":"python async"},{"type":"code","lines":["page.keyboard.type(\"Hello World!\")","page.keyboard.press(\"ArrowLeft\")","page.keyboard.down(\"Shift\")","for i in range(6):"," page.keyboard.press(\"ArrowLeft\")","page.keyboard.up(\"Shift\")","page.keyboard.press(\"Backspace\")","# result text will end up saying \"Hello!\""],"codeLang":"python sync"},{"type":"code","lines":["await page.Keyboard.TypeAsync(\"Hello World!\");","await page.Keyboard.PressAsync(\"ArrowLeft\");","","await page.Keyboard.DownAsync(\"Shift\");","for (int i = 0; i < \" World\".Length; i++)"," await page.Keyboard.PressAsync(\"ArrowLeft\");","","await page.Keyboard.UpAsync(\"Shift\");","","await page.Keyboard.PressAsync(\"Backspace\");","// Result text will end up saying \"Hello!\""],"codeLang":"csharp"},{"type":"text","text":"An example of pressing uppercase `A`"},{"type":"code","lines":["await page.keyboard.press('Shift+KeyA');","// or","await page.keyboard.press('Shift+A');"],"codeLang":"js"},{"type":"code","lines":["page.keyboard().press(\"Shift+KeyA\");","// or","page.keyboard().press(\"Shift+A\");"],"codeLang":"java"},{"type":"code","lines":["await page.keyboard.press(\"Shift+KeyA\")","# or","await page.keyboard.press(\"Shift+A\")"],"codeLang":"python async"},{"type":"code","lines":["page.keyboard.press(\"Shift+KeyA\")","# or","page.keyboard.press(\"Shift+A\")"],"codeLang":"python sync"},{"type":"code","lines":["await page.Keyboard.PressAsync(\"Shift+KeyA\");","// or","await page.Keyboard.PressAsync(\"Shift+A\");"],"codeLang":"csharp"},{"type":"text","text":"An example to trigger select-all with the keyboard"},{"type":"code","lines":["// on Windows and Linux","await page.keyboard.press('Control+A');","// on macOS","await page.keyboard.press('Meta+A');"],"codeLang":"js"},{"type":"code","lines":["// on Windows and Linux","page.keyboard().press(\"Control+A\");","// on macOS","page.keyboard().press(\"Meta+A\");"],"codeLang":"java"},{"type":"code","lines":["# on windows and linux","await page.keyboard.press(\"Control+A\")","# on mac_os","await page.keyboard.press(\"Meta+A\")"],"codeLang":"python async"},{"type":"code","lines":["# on windows and linux","page.keyboard.press(\"Control+A\")","# on mac_os","page.keyboard.press(\"Meta+A\")"],"codeLang":"python sync"},{"type":"code","lines":["// on Windows and Linux","await page.Keyboard.PressAsync(\"Control+A\");","// on macOS","await page.Keyboard.PressAsync(\"Meta+A\");"],"codeLang":"csharp"}],"langs":{},"comment":"Keyboard provides an api for managing a virtual keyboard. The high level api is [`method: Keyboard.type`], which\ntakes raw characters and generates proper `keydown`, `keypress`/`input`, and `keyup` events on your page.\n\nFor finer control, you can use [`method: Keyboard.down`], [`method: Keyboard.up`], and\n[`method: Keyboard.insertText`] to manually fire events as if they were generated from a real keyboard.\n\nAn example of holding down `Shift` in order to select and delete some text:\n\n```js\nawait page.keyboard.type('Hello World!');\nawait page.keyboard.press('ArrowLeft');\n\nawait page.keyboard.down('Shift');\nfor (let i = 0; i < ' World'.length; i++)\n await page.keyboard.press('ArrowLeft');\nawait page.keyboard.up('Shift');\n\nawait page.keyboard.press('Backspace');\n// Result text will end up saying 'Hello!'\n```\n\n```java\npage.keyboard().type(\"Hello World!\");\npage.keyboard().press(\"ArrowLeft\");\npage.keyboard().down(\"Shift\");\nfor (int i = 0; i < \" World\".length(); i++)\n page.keyboard().press(\"ArrowLeft\");\npage.keyboard().up(\"Shift\");\npage.keyboard().press(\"Backspace\");\n// Result text will end up saying \"Hello!\"\n```\n\n```py\nawait page.keyboard.type(\"Hello World!\")\nawait page.keyboard.press(\"ArrowLeft\")\nawait page.keyboard.down(\"Shift\")\nfor i in range(6):\n await page.keyboard.press(\"ArrowLeft\")\nawait page.keyboard.up(\"Shift\")\nawait page.keyboard.press(\"Backspace\")\n# result text will end up saying \"Hello!\"\n```\n\n```py\npage.keyboard.type(\"Hello World!\")\npage.keyboard.press(\"ArrowLeft\")\npage.keyboard.down(\"Shift\")\nfor i in range(6):\n page.keyboard.press(\"ArrowLeft\")\npage.keyboard.up(\"Shift\")\npage.keyboard.press(\"Backspace\")\n# result text will end up saying \"Hello!\"\n```\n\n```csharp\nawait page.Keyboard.TypeAsync(\"Hello World!\");\nawait page.Keyboard.PressAsync(\"ArrowLeft\");\n\nawait page.Keyboard.DownAsync(\"Shift\");\nfor (int i = 0; i < \" World\".Length; i++)\n await page.Keyboard.PressAsync(\"ArrowLeft\");\n\nawait page.Keyboard.UpAsync(\"Shift\");\n\nawait page.Keyboard.PressAsync(\"Backspace\");\n// Result text will end up saying \"Hello!\"\n```\n\nAn example of pressing uppercase `A`\n\n```js\nawait page.keyboard.press('Shift+KeyA');\n// or\nawait page.keyboard.press('Shift+A');\n```\n\n```java\npage.keyboard().press(\"Shift+KeyA\");\n// or\npage.keyboard().press(\"Shift+A\");\n```\n\n```py\nawait page.keyboard.press(\"Shift+KeyA\")\n# or\nawait page.keyboard.press(\"Shift+A\")\n```\n\n```py\npage.keyboard.press(\"Shift+KeyA\")\n# or\npage.keyboard.press(\"Shift+A\")\n```\n\n```csharp\nawait page.Keyboard.PressAsync(\"Shift+KeyA\");\n// or\nawait page.Keyboard.PressAsync(\"Shift+A\");\n```\n\nAn example to trigger select-all with the keyboard\n\n```js\n// on Windows and Linux\nawait page.keyboard.press('Control+A');\n// on macOS\nawait page.keyboard.press('Meta+A');\n```\n\n```java\n// on Windows and Linux\npage.keyboard().press(\"Control+A\");\n// on macOS\npage.keyboard().press(\"Meta+A\");\n```\n\n```py\n# on windows and linux\nawait page.keyboard.press(\"Control+A\")\n# on mac_os\nawait page.keyboard.press(\"Meta+A\")\n```\n\n```py\n# on windows and linux\npage.keyboard.press(\"Control+A\")\n# on mac_os\npage.keyboard.press(\"Meta+A\")\n```\n\n```csharp\n// on Windows and Linux\nawait page.Keyboard.PressAsync(\"Control+A\");\n// on macOS\nawait page.Keyboard.PressAsync(\"Meta+A\");\n```\n","since":"v1.8","members":[{"kind":"method","langs":{},"since":"v1.8","name":"down","type":{"name":"void"},"spec":[{"type":"text","text":"Dispatches a `keydown` event."},{"type":"text","text":"`key` can specify the intended↵[keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) value or a single character to↵generate the text for. A superset of the `key` values can be found↵[here](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values). Examples of the keys are:"},{"type":"text","text":"`F1` - `F12`, `Digit0`- `Digit9`, `KeyA`- `KeyZ`, `Backquote`, `Minus`, `Equal`, `Backslash`, `Backspace`, `Tab`,↵`Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`, etc."},{"type":"text","text":"Following modification shortcuts are also supported: `Shift`, `Control`, `Alt`, `Meta`, `ShiftLeft`, `ControlOrMeta`.↵`ControlOrMeta` resolves to `Control` on Windows and Linux and to `Meta` on macOS."},{"type":"text","text":"Holding down `Shift` will type the text that corresponds to the `key` in the upper case."},{"type":"text","text":"If `key` is a single character, it is case-sensitive, so the values `a` and `A` will generate different↵respective texts."},{"type":"text","text":"If `key` is a modifier key, `Shift`, `Meta`, `Control`, or `Alt`, subsequent key presses will be sent with that↵modifier active. To release the modifier key, use [`method: Keyboard.up`]."},{"type":"text","text":"After the key is pressed once, subsequent calls to [`method: Keyboard.down`] will have↵[repeat](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat) set to true. To release the key, use↵[`method: Keyboard.up`]."},{"type":"note","noteType":"note","text":"Modifier keys DO influence `keyboard.down`. Holding down `Shift` will type the text in upper case."}],"required":true,"comment":"Dispatches a `keydown` event.\n\n`key` can specify the intended\n[keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) value or a single character\nto generate the text for. A superset of the `key` values can be found\n[here](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values). Examples of the keys are:\n\n`F1` - `F12`, `Digit0`- `Digit9`, `KeyA`- `KeyZ`, `Backquote`, `Minus`, `Equal`, `Backslash`, `Backspace`, `Tab`,\n`Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`,\netc.\n\nFollowing modification shortcuts are also supported: `Shift`, `Control`, `Alt`, `Meta`, `ShiftLeft`,\n`ControlOrMeta`. `ControlOrMeta` resolves to `Control` on Windows and Linux and to `Meta` on macOS.\n\nHolding down `Shift` will type the text that corresponds to the `key` in the upper case.\n\nIf `key` is a single character, it is case-sensitive, so the values `a` and `A` will generate different respective\ntexts.\n\nIf `key` is a modifier key, `Shift`, `Meta`, `Control`, or `Alt`, subsequent key presses will be sent with that\nmodifier active. To release the modifier key, use [`method: Keyboard.up`].\n\nAfter the key is pressed once, subsequent calls to [`method: Keyboard.down`] will have\n[repeat](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat) set to true. To release the key,\nuse [`method: Keyboard.up`].\n\n**NOTE** Modifier keys DO influence `keyboard.down`. Holding down `Shift` will type the text in upper case.","async":true,"alias":"down","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"key","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Name of the key to press or a character to generate, such as `ArrowLeft` or `a`."}],"required":true,"comment":"Name of the key to press or a character to generate, such as `ArrowLeft` or `a`.","async":false,"alias":"key","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"insertText","type":{"name":"void"},"spec":[{"type":"text","text":"Dispatches only `input` event, does not emit the `keydown`, `keyup` or `keypress` events."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["page.keyboard.insertText('嗨');"],"codeLang":"js"},{"type":"code","lines":["page.keyboard().insertText(\"嗨\");"],"codeLang":"java"},{"type":"code","lines":["await page.keyboard.insert_text(\"嗨\")"],"codeLang":"python async"},{"type":"code","lines":["page.keyboard.insert_text(\"嗨\")"],"codeLang":"python sync"},{"type":"code","lines":["await page.Keyboard.PressAsync(\"嗨\");"],"codeLang":"csharp"},{"type":"note","noteType":"note","text":"Modifier keys DO NOT effect `keyboard.insertText`. Holding down `Shift` will not type the text in upper case."}],"required":true,"comment":"Dispatches only `input` event, does not emit the `keydown`, `keyup` or `keypress` events.\n\n**Usage**\n\n```js\npage.keyboard.insertText('嗨');\n```\n\n```java\npage.keyboard().insertText(\"嗨\");\n```\n\n```py\nawait page.keyboard.insert_text(\"嗨\")\n```\n\n```py\npage.keyboard.insert_text(\"嗨\")\n```\n\n```csharp\nawait page.Keyboard.PressAsync(\"嗨\");\n```\n\n**NOTE** Modifier keys DO NOT effect `keyboard.insertText`. Holding down `Shift` will not type the text in upper\ncase.","async":true,"alias":"insertText","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"text","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Sets input to the specified text value."}],"required":true,"comment":"Sets input to the specified text value.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"press","type":{"name":"void"},"spec":[{"type":"note","noteType":"tip","text":"In most cases, you should use [`method: Locator.press`] instead."},{"type":"text","text":"`key` can specify the intended↵[keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) value or a single character to↵generate the text for. A superset of the `key` values can be found↵[here](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values). Examples of the keys are:"},{"type":"text","text":"`F1` - `F12`, `Digit0`- `Digit9`, `KeyA`- `KeyZ`, `Backquote`, `Minus`, `Equal`, `Backslash`, `Backspace`, `Tab`,↵`Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`, etc."},{"type":"text","text":"Following modification shortcuts are also supported: `Shift`, `Control`, `Alt`, `Meta`, `ShiftLeft`, `ControlOrMeta`.↵`ControlOrMeta` resolves to `Control` on Windows and Linux and to `Meta` on macOS."},{"type":"text","text":"Holding down `Shift` will type the text that corresponds to the `key` in the upper case."},{"type":"text","text":"If `key` is a single character, it is case-sensitive, so the values `a` and `A` will generate different↵respective texts."},{"type":"text","text":"Shortcuts such as `key: \"Control+o\"`, `key: \"Control++` or `key: \"Control+Shift+T\"` are supported as well. When specified with the↵modifier, modifier is pressed and being held while the subsequent key is being pressed."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const page = await browser.newPage();","await page.goto('https://keycode.info');","await page.keyboard.press('A');","await page.screenshot({ path: 'A.png' });","await page.keyboard.press('ArrowLeft');","await page.screenshot({ path: 'ArrowLeft.png' });","await page.keyboard.press('Shift+O');","await page.screenshot({ path: 'O.png' });","await browser.close();"],"codeLang":"js"},{"type":"code","lines":["Page page = browser.newPage();","page.navigate(\"https://keycode.info\");","page.keyboard().press(\"A\");","page.screenshot(new Page.ScreenshotOptions().setPath(Paths.get(\"A.png\"));","page.keyboard().press(\"ArrowLeft\");","page.screenshot(new Page.ScreenshotOptions().setPath(Paths.get(\"ArrowLeft.png\")));","page.keyboard().press(\"Shift+O\");","page.screenshot(new Page.ScreenshotOptions().setPath(Paths.get(\"O.png\")));","browser.close();"],"codeLang":"java"},{"type":"code","lines":["page = await browser.new_page()","await page.goto(\"https://keycode.info\")","await page.keyboard.press(\"a\")","await page.screenshot(path=\"a.png\")","await page.keyboard.press(\"ArrowLeft\")","await page.screenshot(path=\"arrow_left.png\")","await page.keyboard.press(\"Shift+O\")","await page.screenshot(path=\"o.png\")","await browser.close()"],"codeLang":"python async"},{"type":"code","lines":["page = browser.new_page()","page.goto(\"https://keycode.info\")","page.keyboard.press(\"a\")","page.screenshot(path=\"a.png\")","page.keyboard.press(\"ArrowLeft\")","page.screenshot(path=\"arrow_left.png\")","page.keyboard.press(\"Shift+O\")","page.screenshot(path=\"o.png\")","browser.close()"],"codeLang":"python sync"},{"type":"code","lines":["await page.GotoAsync(\"https://keycode.info\");","await page.Keyboard.PressAsync(\"A\");","await page.ScreenshotAsync(new() { Path = \"A.png\" });","await page.Keyboard.PressAsync(\"ArrowLeft\");","await page.ScreenshotAsync(new() { Path = \"ArrowLeft.png\" });","await page.Keyboard.PressAsync(\"Shift+O\");","await page.ScreenshotAsync(new() { Path = \"O.png\" });","await browser.CloseAsync();"],"codeLang":"csharp"},{"type":"text","text":"Shortcut for [`method: Keyboard.down`] and [`method: Keyboard.up`]."}],"required":true,"comment":"**NOTE** In most cases, you should use [`method: Locator.press`] instead.\n\n`key` can specify the intended\n[keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) value or a single character\nto generate the text for. A superset of the `key` values can be found\n[here](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values). Examples of the keys are:\n\n`F1` - `F12`, `Digit0`- `Digit9`, `KeyA`- `KeyZ`, `Backquote`, `Minus`, `Equal`, `Backslash`, `Backspace`, `Tab`,\n`Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`,\netc.\n\nFollowing modification shortcuts are also supported: `Shift`, `Control`, `Alt`, `Meta`, `ShiftLeft`,\n`ControlOrMeta`. `ControlOrMeta` resolves to `Control` on Windows and Linux and to `Meta` on macOS.\n\nHolding down `Shift` will type the text that corresponds to the `key` in the upper case.\n\nIf `key` is a single character, it is case-sensitive, so the values `a` and `A` will generate different respective\ntexts.\n\nShortcuts such as `key: \"Control+o\"`, `key: \"Control++` or `key: \"Control+Shift+T\"` are supported as well. When\nspecified with the modifier, modifier is pressed and being held while the subsequent key is being pressed.\n\n**Usage**\n\n```js\nconst page = await browser.newPage();\nawait page.goto('https://keycode.info');\nawait page.keyboard.press('A');\nawait page.screenshot({ path: 'A.png' });\nawait page.keyboard.press('ArrowLeft');\nawait page.screenshot({ path: 'ArrowLeft.png' });\nawait page.keyboard.press('Shift+O');\nawait page.screenshot({ path: 'O.png' });\nawait browser.close();\n```\n\n```java\nPage page = browser.newPage();\npage.navigate(\"https://keycode.info\");\npage.keyboard().press(\"A\");\npage.screenshot(new Page.ScreenshotOptions().setPath(Paths.get(\"A.png\"));\npage.keyboard().press(\"ArrowLeft\");\npage.screenshot(new Page.ScreenshotOptions().setPath(Paths.get(\"ArrowLeft.png\")));\npage.keyboard().press(\"Shift+O\");\npage.screenshot(new Page.ScreenshotOptions().setPath(Paths.get(\"O.png\")));\nbrowser.close();\n```\n\n```py\npage = await browser.new_page()\nawait page.goto(\"https://keycode.info\")\nawait page.keyboard.press(\"a\")\nawait page.screenshot(path=\"a.png\")\nawait page.keyboard.press(\"ArrowLeft\")\nawait page.screenshot(path=\"arrow_left.png\")\nawait page.keyboard.press(\"Shift+O\")\nawait page.screenshot(path=\"o.png\")\nawait browser.close()\n```\n\n```py\npage = browser.new_page()\npage.goto(\"https://keycode.info\")\npage.keyboard.press(\"a\")\npage.screenshot(path=\"a.png\")\npage.keyboard.press(\"ArrowLeft\")\npage.screenshot(path=\"arrow_left.png\")\npage.keyboard.press(\"Shift+O\")\npage.screenshot(path=\"o.png\")\nbrowser.close()\n```\n\n```csharp\nawait page.GotoAsync(\"https://keycode.info\");\nawait page.Keyboard.PressAsync(\"A\");\nawait page.ScreenshotAsync(new() { Path = \"A.png\" });\nawait page.Keyboard.PressAsync(\"ArrowLeft\");\nawait page.ScreenshotAsync(new() { Path = \"ArrowLeft.png\" });\nawait page.Keyboard.PressAsync(\"Shift+O\");\nawait page.ScreenshotAsync(new() { Path = \"O.png\" });\nawait browser.CloseAsync();\n```\n\nShortcut for [`method: Keyboard.down`] and [`method: Keyboard.up`].","async":true,"alias":"press","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"key","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Name of the key to press or a character to generate, such as `ArrowLeft` or `a`."}],"required":true,"comment":"Name of the key to press or a character to generate, such as `ArrowLeft` or `a`.","async":false,"alias":"key","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"delay","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0."}],"required":false,"comment":"Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.","async":false,"alias":"delay","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"type","type":{"name":"void"},"spec":[{"type":"note","noteType":"caution","text":"In most cases, you should use [`method: Locator.fill`] instead. You only need to press keys one by one if there is special keyboard handling on the page - in this case use [`method: Locator.pressSequentially`]."},{"type":"text","text":"Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text."},{"type":"text","text":"To press a special key, like `Control` or `ArrowDown`, use [`method: Keyboard.press`]."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.keyboard.type('Hello'); // Types instantly","await page.keyboard.type('World', { delay: 100 }); // Types slower, like a user"],"codeLang":"js"},{"type":"code","lines":["// Types instantly","page.keyboard().type(\"Hello\");","// Types slower, like a user","page.keyboard().type(\"World\", new Keyboard.TypeOptions().setDelay(100));"],"codeLang":"java"},{"type":"code","lines":["await page.keyboard.type(\"Hello\") # types instantly","await page.keyboard.type(\"World\", delay=100) # types slower, like a user"],"codeLang":"python async"},{"type":"code","lines":["page.keyboard.type(\"Hello\") # types instantly","page.keyboard.type(\"World\", delay=100) # types slower, like a user"],"codeLang":"python sync"},{"type":"code","lines":["await page.Keyboard.TypeAsync(\"Hello\"); // types instantly","await page.Keyboard.TypeAsync(\"World\", new() { Delay = 100 }); // types slower, like a user"],"codeLang":"csharp"},{"type":"note","noteType":"note","text":"Modifier keys DO NOT effect `keyboard.type`. Holding down `Shift` will not type the text in upper case."},{"type":"note","noteType":"note","text":"For characters that are not on a US keyboard, only an `input` event will be sent."}],"required":true,"comment":"**NOTE** In most cases, you should use [`method: Locator.fill`] instead. You only need to press keys one by one if\nthere is special keyboard handling on the page - in this case use [`method: Locator.pressSequentially`].\n\nSends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text.\n\nTo press a special key, like `Control` or `ArrowDown`, use [`method: Keyboard.press`].\n\n**Usage**\n\n```js\nawait page.keyboard.type('Hello'); // Types instantly\nawait page.keyboard.type('World', { delay: 100 }); // Types slower, like a user\n```\n\n```java\n// Types instantly\npage.keyboard().type(\"Hello\");\n// Types slower, like a user\npage.keyboard().type(\"World\", new Keyboard.TypeOptions().setDelay(100));\n```\n\n```py\nawait page.keyboard.type(\"Hello\") # types instantly\nawait page.keyboard.type(\"World\", delay=100) # types slower, like a user\n```\n\n```py\npage.keyboard.type(\"Hello\") # types instantly\npage.keyboard.type(\"World\", delay=100) # types slower, like a user\n```\n\n```csharp\nawait page.Keyboard.TypeAsync(\"Hello\"); // types instantly\nawait page.Keyboard.TypeAsync(\"World\", new() { Delay = 100 }); // types slower, like a user\n```\n\n**NOTE** Modifier keys DO NOT effect `keyboard.type`. Holding down `Shift` will not type the text in upper case.\n\n**NOTE** For characters that are not on a US keyboard, only an `input` event will be sent.","async":true,"alias":"type","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"text","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A text to type into a focused element."}],"required":true,"comment":"A text to type into a focused element.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"delay","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to wait between key presses in milliseconds. Defaults to 0."}],"required":false,"comment":"Time to wait between key presses in milliseconds. Defaults to 0.","async":false,"alias":"delay","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"up","type":{"name":"void"},"spec":[{"type":"text","text":"Dispatches a `keyup` event."}],"required":true,"comment":"Dispatches a `keyup` event.","async":true,"alias":"up","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"key","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Name of the key to press or a character to generate, such as `ArrowLeft` or `a`."}],"required":true,"comment":"Name of the key to press or a character to generate, such as `ArrowLeft` or `a`.","async":false,"alias":"key","overloadIndex":0,"paramOrOption":null}]}]},{"name":"Locator","spec":[{"type":"text","text":"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 [`method: Page.locator`] method."},{"type":"text","text":"[Learn more about locators](../locators.md)."}],"langs":{},"comment":"Locators are the central piece of Playwright's auto-waiting and retry-ability. In a nutshell, locators represent a\nway to find element(s) on the page at any moment. A locator can be created with the [`method: Page.locator`]\nmethod.\n\n[Learn more about locators](../locators.md).","since":"v1.14","members":[{"kind":"method","langs":{},"since":"v1.29","name":"all","type":{"name":"Array","templates":[{"name":"Locator"}],"expression":"[Array]<[Locator]>"},"spec":[{"type":"text","text":"When the locator points to a list of elements, this returns an array of locators, pointing to their respective elements."},{"type":"note","noteType":"note","text":"[`method: Locator.all`] does not wait for elements to match the locator, and instead immediately returns whatever is present in the page.↵↵When the list of elements changes dynamically, [`method: Locator.all`] will produce unpredictable and flaky results.↵↵When the list of elements is stable, but loaded dynamically, wait for the full list to finish loading before calling [`method: Locator.all`]."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["for (const li of await page.getByRole('listitem').all())"," await li.click();"],"codeLang":"js"},{"type":"code","lines":["for li in await page.get_by_role('listitem').all():"," await li.click();"],"codeLang":"python async"},{"type":"code","lines":["for li in page.get_by_role('listitem').all():"," li.click();"],"codeLang":"python sync"},{"type":"code","lines":["for (Locator li : page.getByRole('listitem').all())"," li.click();"],"codeLang":"java"},{"type":"code","lines":["foreach (var li in await page.GetByRole(\"listitem\").AllAsync())"," await li.ClickAsync();"],"codeLang":"csharp"}],"required":true,"comment":"When the locator points to a list of elements, this returns an array of locators, pointing to their respective\nelements.\n\n**NOTE** [`method: Locator.all`] does not wait for elements to match the locator, and instead immediately returns\nwhatever is present in the page. When the list of elements changes dynamically, [`method: Locator.all`] will\nproduce unpredictable and flaky results. When the list of elements is stable, but loaded dynamically, wait for the\nfull list to finish loading before calling [`method: Locator.all`].\n\n**Usage**\n\n```js\nfor (const li of await page.getByRole('listitem').all())\n await li.click();\n```\n\n```py\nfor li in await page.get_by_role('listitem').all():\n await li.click();\n```\n\n```py\nfor li in page.get_by_role('listitem').all():\n li.click();\n```\n\n```java\nfor (Locator li : page.getByRole('listitem').all())\n li.click();\n```\n\n```csharp\nforeach (var li in await page.GetByRole(\"listitem\").AllAsync())\n await li.ClickAsync();\n```\n","async":true,"alias":"all","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.14","name":"allInnerTexts","type":{"name":"Array","templates":[{"name":"string"}],"expression":"[Array]<[string]>"},"spec":[{"type":"text","text":"Returns an array of `node.innerText` values for all matching nodes."},{"type":"note","noteType":"warning[Asserting text]","text":"If you need to assert text on the page, prefer [`method: LocatorAssertions.toHaveText`] with `useInnerText` option to avoid flakiness. See [assertions guide](../test-assertions.md) for more details."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const texts = await page.getByRole('link').allInnerTexts();"],"codeLang":"js"},{"type":"code","lines":["texts = await page.get_by_role(\"link\").all_inner_texts()"],"codeLang":"python async"},{"type":"code","lines":["texts = page.get_by_role(\"link\").all_inner_texts()"],"codeLang":"python sync"},{"type":"code","lines":["String[] texts = page.getByRole(AriaRole.LINK).allInnerTexts();"],"codeLang":"java"},{"type":"code","lines":["var texts = await page.GetByRole(AriaRole.Link).AllInnerTextsAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Returns an array of `node.innerText` values for all matching nodes.\n\n**NOTE** If you need to assert text on the page, prefer [`method: LocatorAssertions.toHaveText`] with\n`useInnerText` option to avoid flakiness. See [assertions guide](../test-assertions.md) for more details.\n\n**Usage**\n\n```js\nconst texts = await page.getByRole('link').allInnerTexts();\n```\n\n```py\ntexts = await page.get_by_role(\"link\").all_inner_texts()\n```\n\n```py\ntexts = page.get_by_role(\"link\").all_inner_texts()\n```\n\n```java\nString[] texts = page.getByRole(AriaRole.LINK).allInnerTexts();\n```\n\n```csharp\nvar texts = await page.GetByRole(AriaRole.Link).AllInnerTextsAsync();\n```\n","async":true,"alias":"allInnerTexts","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.14","name":"allTextContents","type":{"name":"Array","templates":[{"name":"string"}],"expression":"[Array]<[string]>"},"spec":[{"type":"text","text":"Returns an array of `node.textContent` values for all matching nodes."},{"type":"note","noteType":"warning[Asserting text]","text":"If you need to assert text on the page, prefer [`method: LocatorAssertions.toHaveText`] to avoid flakiness. See [assertions guide](../test-assertions.md) for more details."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const texts = await page.getByRole('link').allTextContents();"],"codeLang":"js"},{"type":"code","lines":["texts = await page.get_by_role(\"link\").all_text_contents()"],"codeLang":"python async"},{"type":"code","lines":["texts = page.get_by_role(\"link\").all_text_contents()"],"codeLang":"python sync"},{"type":"code","lines":["String[] texts = page.getByRole(AriaRole.LINK).allTextContents();"],"codeLang":"java"},{"type":"code","lines":["var texts = await page.GetByRole(AriaRole.Link).AllTextContentsAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Returns an array of `node.textContent` values for all matching nodes.\n\n**NOTE** If you need to assert text on the page, prefer [`method: LocatorAssertions.toHaveText`] to avoid\nflakiness. See [assertions guide](../test-assertions.md) for more details.\n\n**Usage**\n\n```js\nconst texts = await page.getByRole('link').allTextContents();\n```\n\n```py\ntexts = await page.get_by_role(\"link\").all_text_contents()\n```\n\n```py\ntexts = page.get_by_role(\"link\").all_text_contents()\n```\n\n```java\nString[] texts = page.getByRole(AriaRole.LINK).allTextContents();\n```\n\n```csharp\nvar texts = await page.GetByRole(AriaRole.Link).AllTextContentsAsync();\n```\n","async":true,"alias":"allTextContents","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"aliases":{"python":"and_"},"types":{},"overrides":{}},"since":"v1.34","name":"and","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Creates a locator that matches both this locator and the argument locator."},{"type":"text","text":"**Usage**"},{"type":"text","text":"The following example finds a button with a specific title."},{"type":"code","lines":["const button = page.getByRole('button').and(page.getByTitle('Subscribe'));"],"codeLang":"js"},{"type":"code","lines":["Locator button = page.getByRole(AriaRole.BUTTON).and(page.getByTitle(\"Subscribe\"));"],"codeLang":"java"},{"type":"code","lines":["button = page.get_by_role(\"button\").and_(page.getByTitle(\"Subscribe\"))"],"codeLang":"python async"},{"type":"code","lines":["button = page.get_by_role(\"button\").and_(page.getByTitle(\"Subscribe\"))"],"codeLang":"python sync"},{"type":"code","lines":["var button = page.GetByRole(AriaRole.Button).And(page.GetByTitle(\"Subscribe\"));"],"codeLang":"csharp"}],"required":true,"comment":"Creates a locator that matches both this locator and the argument locator.\n\n**Usage**\n\nThe following example finds a button with a specific title.\n\n```js\nconst button = page.getByRole('button').and(page.getByTitle('Subscribe'));\n```\n\n```java\nLocator button = page.getByRole(AriaRole.BUTTON).and(page.getByTitle(\"Subscribe\"));\n```\n\n```py\nbutton = page.get_by_role(\"button\").and_(page.getByTitle(\"Subscribe\"))\n```\n\n```py\nbutton = page.get_by_role(\"button\").and_(page.getByTitle(\"Subscribe\"))\n```\n\n```csharp\nvar button = page.GetByRole(AriaRole.Button).And(page.GetByTitle(\"Subscribe\"));\n```\n","async":false,"alias":"and","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.34","name":"locator","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Additional locator to match."}],"required":true,"comment":"Additional locator to match.","async":false,"alias":"locator","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.28","name":"blur","type":{"name":"void"},"spec":[{"type":"text","text":"Calls [blur](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/blur) on the element."}],"required":true,"comment":"Calls [blur](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/blur) on the element.","async":true,"alias":"blur","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.28","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.28","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"boundingBox","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"the x coordinate of the element in pixels."}],"required":true,"comment":"the x coordinate of the element in pixels.","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"the y coordinate of the element in pixels."}],"required":true,"comment":"the y coordinate of the element in pixels.","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"the width of the element in pixels."}],"required":true,"comment":"the width of the element in pixels.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"the height of the element in pixels."}],"required":true,"comment":"the height of the element in pixels.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}]}],"expression":"[null]|[Object]"},"spec":[{"type":"text","text":"This method returns the bounding box of the element matching the locator, or `null` if the element is not visible. The bounding box is↵calculated relative to the main frame viewport - which is usually the same as the browser window."},{"type":"text","text":"**Details**"},{"type":"text","text":"Scrolling affects the returned bounding box, similarly to↵[Element.getBoundingClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect). That↵means `x` and/or `y` may be negative."},{"type":"text","text":"Elements from child frames return the bounding box relative to the main frame, unlike the↵[Element.getBoundingClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect)."},{"type":"text","text":"Assuming the page is static, it is safe to use bounding box coordinates to perform input. For example, the following↵snippet should click the center of the element."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const box = await page.getByRole('button').boundingBox();","await page.mouse.click(box.x + box.width / 2, box.y + box.height / 2);"],"codeLang":"js"},{"type":"code","lines":["BoundingBox box = page.getByRole(AriaRole.BUTTON).boundingBox();","page.mouse().click(box.x + box.width / 2, box.y + box.height / 2);"],"codeLang":"java"},{"type":"code","lines":["box = await page.get_by_role(\"button\").bounding_box()","await page.mouse.click(box[\"x\"] + box[\"width\"] / 2, box[\"y\"] + box[\"height\"] / 2)"],"codeLang":"python async"},{"type":"code","lines":["box = page.get_by_role(\"button\").bounding_box()","page.mouse.click(box[\"x\"] + box[\"width\"] / 2, box[\"y\"] + box[\"height\"] / 2)"],"codeLang":"python sync"},{"type":"code","lines":["var box = await page.GetByRole(AriaRole.Button).BoundingBoxAsync();","await page.Mouse.ClickAsync(box.X + box.Width / 2, box.Y + box.Height / 2);"],"codeLang":"csharp"}],"required":true,"comment":"This method returns the bounding box of the element matching the locator, or `null` if the element is not visible.\nThe bounding box is calculated relative to the main frame viewport - which is usually the same as the browser\nwindow.\n\n**Details**\n\nScrolling affects the returned bounding box, similarly to\n[Element.getBoundingClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).\nThat means `x` and/or `y` may be negative.\n\nElements from child frames return the bounding box relative to the main frame, unlike the\n[Element.getBoundingClientRect](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).\n\nAssuming the page is static, it is safe to use bounding box coordinates to perform input. For example, the\nfollowing snippet should click the center of the element.\n\n**Usage**\n\n```js\nconst box = await page.getByRole('button').boundingBox();\nawait page.mouse.click(box.x + box.width / 2, box.y + box.height / 2);\n```\n\n```java\nBoundingBox box = page.getByRole(AriaRole.BUTTON).boundingBox();\npage.mouse().click(box.x + box.width / 2, box.y + box.height / 2);\n```\n\n```py\nbox = await page.get_by_role(\"button\").bounding_box()\nawait page.mouse.click(box[\"x\"] + box[\"width\"] / 2, box[\"y\"] + box[\"height\"] / 2)\n```\n\n```py\nbox = page.get_by_role(\"button\").bounding_box()\npage.mouse.click(box[\"x\"] + box[\"width\"] / 2, box[\"y\"] + box[\"height\"] / 2)\n```\n\n```csharp\nvar box = await page.GetByRole(AriaRole.Button).BoundingBoxAsync();\nawait page.Mouse.ClickAsync(box.X + box.Width / 2, box.Y + box.Height / 2);\n```\n","async":true,"alias":"boundingBox","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"check","type":{"name":"void"},"spec":[{"type":"text","text":"Ensure that checkbox or radio element is checked."},{"type":"text","text":"**Details**"},{"type":"text","text":"Performs the following steps:"},{"type":"li","text":"Ensure that element is a checkbox or a radio input. If not, this method throws. If the element is already↵checked, this method returns immediately.","liType":"ordinal"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.mouse`] to click in the center of the element.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.","liType":"ordinal"},{"type":"li","text":"Ensure that the element is now checked. If not, this method throws.","liType":"ordinal"},{"type":"text","text":"If the element is detached from the DOM at any moment during the action, this method throws."},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.getByRole('checkbox').check();"],"codeLang":"js"},{"type":"code","lines":["page.getByRole(AriaRole.CHECKBOX).check();"],"codeLang":"java"},{"type":"code","lines":["await page.get_by_role(\"checkbox\").check()"],"codeLang":"python async"},{"type":"code","lines":["page.get_by_role(\"checkbox\").check()"],"codeLang":"python sync"},{"type":"code","lines":["await page.GetByRole(AriaRole.Checkbox).CheckAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Ensure that checkbox or radio element is checked.\n\n**Details**\n\nPerforms the following steps:\n1. Ensure that element is a checkbox or a radio input. If not, this method throws. If the element is already\n checked, this method returns immediately.\n1. Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.mouse`] to click in the center of the element.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n1. Ensure that the element is now checked. If not, this method throws.\n\nIf the element is detached from the DOM at any moment during the action, this method throws.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.\n\n**Usage**\n\n```js\nawait page.getByRole('checkbox').check();\n```\n\n```java\npage.getByRole(AriaRole.CHECKBOX).check();\n```\n\n```py\nawait page.get_by_role(\"checkbox\").check()\n```\n\n```py\npage.get_by_role(\"checkbox\").check()\n```\n\n```csharp\nawait page.GetByRole(AriaRole.Checkbox).CheckAsync();\n```\n","async":true,"alias":"check","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.28","name":"clear","type":{"name":"void"},"spec":[{"type":"text","text":"Clear the input field."},{"type":"text","text":"**Details**"},{"type":"text","text":"This method waits for [actionability](../actionability.md) checks, focuses the element, clears it and triggers an `input` event after clearing."},{"type":"text","text":"If the target element is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method throws an error. However, if the element is inside the `<label>` element that has an associated [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be cleared instead."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.getByRole('textbox').clear();"],"codeLang":"js"},{"type":"code","lines":["page.getByRole(AriaRole.TEXTBOX).clear();"],"codeLang":"java"},{"type":"code","lines":["await page.get_by_role(\"textbox\").clear()"],"codeLang":"python async"},{"type":"code","lines":["page.get_by_role(\"textbox\").clear()"],"codeLang":"python sync"},{"type":"code","lines":["await page.GetByRole(AriaRole.Textbox).ClearAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Clear the input field.\n\n**Details**\n\nThis method waits for [actionability](../actionability.md) checks, focuses the element, clears it and triggers an\n`input` event after clearing.\n\nIf the target element is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method throws an\nerror. However, if the element is inside the `<label>` element that has an associated\n[control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be cleared\ninstead.\n\n**Usage**\n\n```js\nawait page.getByRole('textbox').clear();\n```\n\n```java\npage.getByRole(AriaRole.TEXTBOX).clear();\n```\n\n```py\nawait page.get_by_role(\"textbox\").clear()\n```\n\n```py\npage.get_by_role(\"textbox\").clear()\n```\n\n```csharp\nawait page.GetByRole(AriaRole.Textbox).ClearAsync();\n```\n","async":true,"alias":"clear","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.28","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.28","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.28","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.28","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"click","type":{"name":"void"},"spec":[{"type":"text","text":"Click an element."},{"type":"text","text":"**Details**"},{"type":"text","text":"This method clicks the element by performing the following steps:"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.mouse`] to click in the center of the element, or the specified `position`.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.","liType":"ordinal"},{"type":"text","text":"If the element is detached from the DOM at any moment during the action, this method throws."},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."},{"type":"text","text":"**Usage**"},{"type":"text","text":"Click a button:"},{"type":"code","lines":["await page.getByRole('button').click();"],"codeLang":"js"},{"type":"code","lines":["page.getByRole(AriaRole.BUTTON).click();"],"codeLang":"java"},{"type":"code","lines":["await page.get_by_role(\"button\").click()"],"codeLang":"python async"},{"type":"code","lines":["page.get_by_role(\"button\").click()"],"codeLang":"python sync"},{"type":"code","lines":["await page.GetByRole(AriaRole.Button).ClickAsync();"],"codeLang":"csharp"},{"type":"text","text":"Shift-right-click at a specific position on a canvas:"},{"type":"code","lines":["await page.locator('canvas').click({"," button: 'right',"," modifiers: ['Shift'],"," position: { x: 23, y: 32 },","});"],"codeLang":"js"},{"type":"code","lines":["page.locator(\"canvas\").click(new Locator.ClickOptions()"," .setButton(MouseButton.RIGHT)"," .setModifiers(Arrays.asList(KeyboardModifier.SHIFT))"," .setPosition(23, 32));"],"codeLang":"java"},{"type":"code","lines":["await page.locator(\"canvas\").click("," button=\"right\", modifiers=[\"Shift\"], position={\"x\": 23, \"y\": 32}",")"],"codeLang":"python async"},{"type":"code","lines":["page.locator(\"canvas\").click("," button=\"right\", modifiers=[\"Shift\"], position={\"x\": 23, \"y\": 32}",")"],"codeLang":"python sync"},{"type":"code","lines":["await page.Locator(\"canvas\").ClickAsync(new() {"," Button = MouseButton.Right,"," Modifiers = new[] { KeyboardModifier.Shift },"," Position = new Position { X = 0, Y = 0 }","});"],"codeLang":"csharp"}],"required":true,"comment":"Click an element.\n\n**Details**\n\nThis method clicks the element by performing the following steps:\n1. Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.mouse`] to click in the center of the element, or the specified `position`.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n\nIf the element is detached from the DOM at any moment during the action, this method throws.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.\n\n**Usage**\n\nClick a button:\n\n```js\nawait page.getByRole('button').click();\n```\n\n```java\npage.getByRole(AriaRole.BUTTON).click();\n```\n\n```py\nawait page.get_by_role(\"button\").click()\n```\n\n```py\npage.get_by_role(\"button\").click()\n```\n\n```csharp\nawait page.GetByRole(AriaRole.Button).ClickAsync();\n```\n\nShift-right-click at a specific position on a canvas:\n\n```js\nawait page.locator('canvas').click({\n button: 'right',\n modifiers: ['Shift'],\n position: { x: 23, y: 32 },\n});\n```\n\n```java\npage.locator(\"canvas\").click(new Locator.ClickOptions()\n .setButton(MouseButton.RIGHT)\n .setModifiers(Arrays.asList(KeyboardModifier.SHIFT))\n .setPosition(23, 32));\n```\n\n```py\nawait page.locator(\"canvas\").click(\n button=\"right\", modifiers=[\"Shift\"], position={\"x\": 23, \"y\": 32}\n)\n```\n\n```py\npage.locator(\"canvas\").click(\n button=\"right\", modifiers=[\"Shift\"], position={\"x\": 23, \"y\": 32}\n)\n```\n\n```csharp\nawait page.Locator(\"canvas\").ClickAsync(new() {\n Button = MouseButton.Right,\n Modifiers = new[] { KeyboardModifier.Shift },\n Position = new Position { X = 0, Y = 0 }\n});\n```\n","async":true,"alias":"click","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"button","type":{"name":"MouseButton","union":[{"name":"\"left\""},{"name":"\"right\""},{"name":"\"middle\""}],"expression":"[MouseButton]<\"left\"|\"right\"|\"middle\">"},"spec":[{"type":"text","text":"Defaults to `left`."}],"required":false,"comment":"Defaults to `left`.","async":false,"alias":"button","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"clickCount","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"defaults to 1. See [UIEvent.detail]."}],"required":false,"comment":"defaults to 1. See [UIEvent.detail].","async":false,"alias":"clickCount","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"delay","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0."}],"required":false,"comment":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.","async":false,"alias":"delay","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"modifiers","type":{"name":"Array","templates":[{"name":"KeyboardModifier","union":[{"name":"\"Alt\""},{"name":"\"Control\""},{"name":"\"ControlOrMeta\""},{"name":"\"Meta\""},{"name":"\"Shift\""}]}],"expression":"[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"ControlOrMeta\"|\"Meta\"|\"Shift\">>"},"spec":[{"type":"text","text":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current↵modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to \"Control\" on Windows↵and Linux and to \"Meta\" on macOS."}],"required":false,"comment":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores\ncurrent modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to\n\"Control\" on Windows and Linux and to \"Meta\" on macOS.","async":false,"alias":"modifiers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"count","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Returns the number of elements matching the locator."},{"type":"note","noteType":"warning[Asserting count]","text":"If you need to assert the number of elements on the page, prefer [`method: LocatorAssertions.toHaveCount`] to avoid flakiness. See [assertions guide](../test-assertions.md) for more details."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const count = await page.getByRole('listitem').count();"],"codeLang":"js"},{"type":"code","lines":["count = await page.get_by_role(\"listitem\").count()"],"codeLang":"python async"},{"type":"code","lines":["count = page.get_by_role(\"listitem\").count()"],"codeLang":"python sync"},{"type":"code","lines":["int count = page.getByRole(AriaRole.LISTITEM).count();"],"codeLang":"java"},{"type":"code","lines":["int count = await page.GetByRole(AriaRole.Listitem).CountAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Returns the number of elements matching the locator.\n\n**NOTE** If you need to assert the number of elements on the page, prefer [`method: LocatorAssertions.toHaveCount`]\nto avoid flakiness. See [assertions guide](../test-assertions.md) for more details.\n\n**Usage**\n\n```js\nconst count = await page.getByRole('listitem').count();\n```\n\n```py\ncount = await page.get_by_role(\"listitem\").count()\n```\n\n```py\ncount = page.get_by_role(\"listitem\").count()\n```\n\n```java\nint count = page.getByRole(AriaRole.LISTITEM).count();\n```\n\n```csharp\nint count = await page.GetByRole(AriaRole.Listitem).CountAsync();\n```\n","async":true,"alias":"count","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"aliases":{"csharp":"DblClickAsync"},"types":{},"overrides":{}},"since":"v1.14","name":"dblclick","type":{"name":"void"},"spec":[{"type":"text","text":"Double-click an element."},{"type":"text","text":"**Details**"},{"type":"text","text":"This method double clicks the element by performing the following steps:"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.mouse`] to double click in the center of the element, or the specified `position`.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that↵if the first click of the `dblclick()` triggers a navigation event, this method will throw.","liType":"ordinal"},{"type":"text","text":"If the element is detached from the DOM at any moment during the action, this method throws."},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."},{"type":"note","noteType":"note","text":"`element.dblclick()` dispatches two `click` events and a single `dblclick` event."}],"required":true,"comment":"Double-click an element.\n\n**Details**\n\nThis method double clicks the element by performing the following steps:\n1. Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.mouse`] to double click in the center of the element, or the specified `position`.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that if\n the first click of the `dblclick()` triggers a navigation event, this method will throw.\n\nIf the element is detached from the DOM at any moment during the action, this method throws.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.\n\n**NOTE** `element.dblclick()` dispatches two `click` events and a single `dblclick` event.","async":true,"alias":"dblclick","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"button","type":{"name":"MouseButton","union":[{"name":"\"left\""},{"name":"\"right\""},{"name":"\"middle\""}],"expression":"[MouseButton]<\"left\"|\"right\"|\"middle\">"},"spec":[{"type":"text","text":"Defaults to `left`."}],"required":false,"comment":"Defaults to `left`.","async":false,"alias":"button","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"delay","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0."}],"required":false,"comment":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.","async":false,"alias":"delay","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"modifiers","type":{"name":"Array","templates":[{"name":"KeyboardModifier","union":[{"name":"\"Alt\""},{"name":"\"Control\""},{"name":"\"ControlOrMeta\""},{"name":"\"Meta\""},{"name":"\"Shift\""}]}],"expression":"[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"ControlOrMeta\"|\"Meta\"|\"Shift\">>"},"spec":[{"type":"text","text":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current↵modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to \"Control\" on Windows↵and Linux and to \"Meta\" on macOS."}],"required":false,"comment":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores\ncurrent modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to\n\"Control\" on Windows and Linux and to \"Meta\" on macOS.","async":false,"alias":"modifiers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"dispatchEvent","type":{"name":"void"},"spec":[{"type":"text","text":"Programmatically dispatch an event on the matching element."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await locator.dispatchEvent('click');"],"codeLang":"js"},{"type":"code","lines":["locator.dispatchEvent(\"click\");"],"codeLang":"java"},{"type":"code","lines":["await locator.dispatch_event(\"click\")"],"codeLang":"python async"},{"type":"code","lines":["locator.dispatch_event(\"click\")"],"codeLang":"python sync"},{"type":"code","lines":["await locator.DispatchEventAsync(\"click\");"],"codeLang":"csharp"},{"type":"text","text":"**Details**"},{"type":"text","text":"The snippet above dispatches the `click` event on the element. Regardless of the visibility state of the element, `click`↵is dispatched. This is equivalent to calling↵[element.click()](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/click)."},{"type":"text","text":"Under the hood, it creates an instance of an event based on the given `type`, initializes it with↵`eventInit` properties and dispatches it on the element. Events are `composed`, `cancelable` and bubble by↵default."},{"type":"text","text":"Since `eventInit` is event-specific, please refer to the events documentation for the lists of initial↵properties:"},{"type":"li","text":"[DeviceMotionEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceMotionEvent/DeviceMotionEvent)","liType":"bullet"},{"type":"li","text":"[DeviceOrientationEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceOrientationEvent/DeviceOrientationEvent)","liType":"bullet"},{"type":"li","text":"[DragEvent](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent/DragEvent)","liType":"bullet"},{"type":"li","text":"[Event](https://developer.mozilla.org/en-US/docs/Web/API/Event/Event)","liType":"bullet"},{"type":"li","text":"[FocusEvent](https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent/FocusEvent)","liType":"bullet"},{"type":"li","text":"[KeyboardEvent](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/KeyboardEvent)","liType":"bullet"},{"type":"li","text":"[MouseEvent](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/MouseEvent)","liType":"bullet"},{"type":"li","text":"[PointerEvent](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/PointerEvent)","liType":"bullet"},{"type":"li","text":"[TouchEvent](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/TouchEvent)","liType":"bullet"},{"type":"li","text":"[WheelEvent](https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent/WheelEvent)","liType":"bullet"},{"type":"text","text":"You can also specify `JSHandle` as the property value if you want live objects to be passed into the event:"},{"type":"code","lines":["// Note you can only create DataTransfer in Chromium and Firefox","const dataTransfer = await page.evaluateHandle(() => new DataTransfer());","await locator.dispatchEvent('dragstart', { dataTransfer });"],"codeLang":"js"},{"type":"code","lines":["// Note you can only create DataTransfer in Chromium and Firefox","JSHandle dataTransfer = page.evaluateHandle(\"() => new DataTransfer()\");","Map<String, Object> arg = new HashMap<>();","arg.put(\"dataTransfer\", dataTransfer);","locator.dispatchEvent(\"dragstart\", arg);"],"codeLang":"java"},{"type":"code","lines":["# note you can only create data_transfer in chromium and firefox","data_transfer = await page.evaluate_handle(\"new DataTransfer()\")","await locator.dispatch_event(\"#source\", \"dragstart\", {\"dataTransfer\": data_transfer})"],"codeLang":"python async"},{"type":"code","lines":["# note you can only create data_transfer in chromium and firefox","data_transfer = page.evaluate_handle(\"new DataTransfer()\")","locator.dispatch_event(\"#source\", \"dragstart\", {\"dataTransfer\": data_transfer})"],"codeLang":"python sync"},{"type":"code","lines":["var dataTransfer = await page.EvaluateHandleAsync(\"() => new DataTransfer()\");","await locator.DispatchEventAsync(\"dragstart\", new Dictionary<string, object>","{"," { \"dataTransfer\", dataTransfer }","});"],"codeLang":"csharp"}],"required":true,"comment":"Programmatically dispatch an event on the matching element.\n\n**Usage**\n\n```js\nawait locator.dispatchEvent('click');\n```\n\n```java\nlocator.dispatchEvent(\"click\");\n```\n\n```py\nawait locator.dispatch_event(\"click\")\n```\n\n```py\nlocator.dispatch_event(\"click\")\n```\n\n```csharp\nawait locator.DispatchEventAsync(\"click\");\n```\n\n**Details**\n\nThe snippet above dispatches the `click` event on the element. Regardless of the visibility state of the element,\n`click` is dispatched. This is equivalent to calling\n[element.click()](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/click).\n\nUnder the hood, it creates an instance of an event based on the given `type`, initializes it with `eventInit`\nproperties and dispatches it on the element. Events are `composed`, `cancelable` and bubble by default.\n\nSince `eventInit` is event-specific, please refer to the events documentation for the lists of initial properties:\n- [DeviceMotionEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceMotionEvent/DeviceMotionEvent)\n- [DeviceOrientationEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceOrientationEvent/DeviceOrientationEvent)\n- [DragEvent](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent/DragEvent)\n- [Event](https://developer.mozilla.org/en-US/docs/Web/API/Event/Event)\n- [FocusEvent](https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent/FocusEvent)\n- [KeyboardEvent](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/KeyboardEvent)\n- [MouseEvent](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/MouseEvent)\n- [PointerEvent](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/PointerEvent)\n- [TouchEvent](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/TouchEvent)\n- [WheelEvent](https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent/WheelEvent)\n\nYou can also specify `JSHandle` as the property value if you want live objects to be passed into the event:\n\n```js\n// Note you can only create DataTransfer in Chromium and Firefox\nconst dataTransfer = await page.evaluateHandle(() => new DataTransfer());\nawait locator.dispatchEvent('dragstart', { dataTransfer });\n```\n\n```java\n// Note you can only create DataTransfer in Chromium and Firefox\nJSHandle dataTransfer = page.evaluateHandle(\"() => new DataTransfer()\");\nMap<String, Object> arg = new HashMap<>();\narg.put(\"dataTransfer\", dataTransfer);\nlocator.dispatchEvent(\"dragstart\", arg);\n```\n\n```py\n# note you can only create data_transfer in chromium and firefox\ndata_transfer = await page.evaluate_handle(\"new DataTransfer()\")\nawait locator.dispatch_event(\"#source\", \"dragstart\", {\"dataTransfer\": data_transfer})\n```\n\n```py\n# note you can only create data_transfer in chromium and firefox\ndata_transfer = page.evaluate_handle(\"new DataTransfer()\")\nlocator.dispatch_event(\"#source\", \"dragstart\", {\"dataTransfer\": data_transfer})\n```\n\n```csharp\nvar dataTransfer = await page.EvaluateHandleAsync(\"() => new DataTransfer()\");\nawait locator.DispatchEventAsync(\"dragstart\", new Dictionary<string, object>\n{\n { \"dataTransfer\", dataTransfer }\n});\n```\n","async":true,"alias":"dispatchEvent","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.14","name":"type","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"DOM event type: `\"click\"`, `\"dragstart\"`, etc."}],"required":true,"comment":"DOM event type: `\"click\"`, `\"dragstart\"`, etc.","async":false,"alias":"type","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"eventInit","type":{"name":"EvaluationArgument","expression":"[EvaluationArgument]"},"spec":[{"type":"text","text":"Optional event-specific initialization properties."}],"required":false,"comment":"Optional event-specific initialization properties.","async":false,"alias":"eventInit","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.18","name":"dragTo","type":{"name":"void"},"spec":[{"type":"text","text":"Drag the source element towards the target element and drop it."},{"type":"text","text":"**Details**"},{"type":"text","text":"This method drags the locator to another target locator or target position. It will↵first move to the source element, perform a `mousedown`, then move to the target↵element or position and perform a `mouseup`."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const source = page.locator('#source');","const target = page.locator('#target');","","await source.dragTo(target);","// or specify exact positions relative to the top-left corners of the elements:","await source.dragTo(target, {"," sourcePosition: { x: 34, y: 7 },"," targetPosition: { x: 10, y: 20 },","});"],"codeLang":"js"},{"type":"code","lines":["Locator source = page.locator(\"#source\");","Locator target = page.locator(\"#target\");","","source.dragTo(target);","// or specify exact positions relative to the top-left corners of the elements:","source.dragTo(target, new Locator.DragToOptions()"," .setSourcePosition(34, 7).setTargetPosition(10, 20));"],"codeLang":"java"},{"type":"code","lines":["source = page.locator(\"#source\")","target = page.locator(\"#target\")","","await source.drag_to(target)","# or specify exact positions relative to the top-left corners of the elements:","await source.drag_to("," target,"," source_position={\"x\": 34, \"y\": 7},"," target_position={\"x\": 10, \"y\": 20}",")"],"codeLang":"python async"},{"type":"code","lines":["source = page.locator(\"#source\")","target = page.locator(\"#target\")","","source.drag_to(target)","# or specify exact positions relative to the top-left corners of the elements:","source.drag_to("," target,"," source_position={\"x\": 34, \"y\": 7},"," target_position={\"x\": 10, \"y\": 20}",")"],"codeLang":"python sync"},{"type":"code","lines":["var source = Page.Locator(\"#source\");","var target = Page.Locator(\"#target\");","","await source.DragToAsync(target);","// or specify exact positions relative to the top-left corners of the elements:","await source.DragToAsync(target, new()","{"," SourcePosition = new() { X = 34, Y = 7 },"," TargetPosition = new() { X = 10, Y = 20 },","});"],"codeLang":"csharp"}],"required":true,"comment":"Drag the source element towards the target element and drop it.\n\n**Details**\n\nThis method drags the locator to another target locator or target position. It will first move to the source\nelement, perform a `mousedown`, then move to the target element or position and perform a `mouseup`.\n\n**Usage**\n\n```js\nconst source = page.locator('#source');\nconst target = page.locator('#target');\n\nawait source.dragTo(target);\n// or specify exact positions relative to the top-left corners of the elements:\nawait source.dragTo(target, {\n sourcePosition: { x: 34, y: 7 },\n targetPosition: { x: 10, y: 20 },\n});\n```\n\n```java\nLocator source = page.locator(\"#source\");\nLocator target = page.locator(\"#target\");\n\nsource.dragTo(target);\n// or specify exact positions relative to the top-left corners of the elements:\nsource.dragTo(target, new Locator.DragToOptions()\n .setSourcePosition(34, 7).setTargetPosition(10, 20));\n```\n\n```py\nsource = page.locator(\"#source\")\ntarget = page.locator(\"#target\")\n\nawait source.drag_to(target)\n# or specify exact positions relative to the top-left corners of the elements:\nawait source.drag_to(\n target,\n source_position={\"x\": 34, \"y\": 7},\n target_position={\"x\": 10, \"y\": 20}\n)\n```\n\n```py\nsource = page.locator(\"#source\")\ntarget = page.locator(\"#target\")\n\nsource.drag_to(target)\n# or specify exact positions relative to the top-left corners of the elements:\nsource.drag_to(\n target,\n source_position={\"x\": 34, \"y\": 7},\n target_position={\"x\": 10, \"y\": 20}\n)\n```\n\n```csharp\nvar source = Page.Locator(\"#source\");\nvar target = Page.Locator(\"#target\");\n\nawait source.DragToAsync(target);\n// or specify exact positions relative to the top-left corners of the elements:\nawait source.DragToAsync(target, new()\n{\n SourcePosition = new() { X = 34, Y = 7 },\n TargetPosition = new() { X = 10, Y = 20 },\n});\n```\n","async":true,"alias":"dragTo","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"target","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Locator of the element to drag to."}],"required":true,"comment":"Locator of the element to drag to.","async":false,"alias":"target","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.18","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.18","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.18","name":"sourcePosition","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Clicks on the source element at this point relative to the top-left corner of the element's padding box. If not specified, some visible point of the element is used."}],"required":false,"comment":"Clicks on the source element at this point relative to the top-left corner of the element's padding box. If not\nspecified, some visible point of the element is used.","async":false,"alias":"sourcePosition","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.18","name":"targetPosition","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Drops on the target element at this point relative to the top-left corner of the element's padding box. If not specified, some visible point of the element is used."}],"required":false,"comment":"Drops on the target element at this point relative to the top-left corner of the element's padding box. If not\nspecified, some visible point of the element is used.","async":false,"alias":"targetPosition","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.18","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","discouraged":"Always prefer using `Locator`s and web assertions over `ElementHandle`s because latter are inherently racy.","name":"elementHandle","type":{"name":"ElementHandle","expression":"[ElementHandle]"},"spec":[{"type":"text","text":"Resolves given locator to the first matching DOM element. If there are no matching elements, waits for one. If multiple elements match the locator, throws."}],"required":true,"comment":"Resolves given locator to the first matching DOM element. If there are no matching elements, waits for one. If\nmultiple elements match the locator, throws.","async":true,"alias":"elementHandle","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","discouraged":"Always prefer using `Locator`s and web assertions over `ElementHandle`s because latter are inherently racy.","name":"elementHandles","type":{"name":"Array","templates":[{"name":"ElementHandle"}],"expression":"[Array]<[ElementHandle]>"},"spec":[{"type":"text","text":"Resolves given locator to all matching DOM elements. If there are no matching elements, returns an empty list."}],"required":true,"comment":"Resolves given locator to all matching DOM elements. If there are no matching elements, returns an empty list.","async":true,"alias":"elementHandles","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.43","name":"contentFrame","type":{"name":"FrameLocator","expression":"[FrameLocator]"},"spec":[{"type":"text","text":"Returns a `FrameLocator` object pointing to the same `iframe` as this locator."},{"type":"text","text":"Useful when you have a `Locator` object obtained somewhere, and later on would like to interact with the content inside the frame."},{"type":"text","text":"For a reverse operation, use [`method: FrameLocator.owner`]."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const locator = page.locator('iframe[name=\"embedded\"]');","// ...","const frameLocator = locator.contentFrame();","await frameLocator.getByRole('button').click();"],"codeLang":"js"},{"type":"code","lines":["Locator locator = page.locator(\"iframe[name=\\\"embedded\\\"]\");","// ...","FrameLocator frameLocator = locator.contentFrame();","frameLocator.getByRole(AriaRole.BUTTON).click();"],"codeLang":"java"},{"type":"code","lines":["locator = page.locator(\"iframe[name=\\\"embedded\\\"]\")","# ...","frame_locator = locator.content_frame","await frame_locator.get_by_role(\"button\").click()"],"codeLang":"python async"},{"type":"code","lines":["locator = page.locator(\"iframe[name=\\\"embedded\\\"]\")","# ...","frame_locator = locator.content_frame","frame_locator.get_by_role(\"button\").click()"],"codeLang":"python sync"},{"type":"code","lines":["var locator = Page.Locator(\"iframe[name=\\\"embedded\\\"]\");","// ...","var frameLocator = locator.ContentFrame;","await frameLocator.GetByRole(AriaRole.Button).ClickAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Returns a `FrameLocator` object pointing to the same `iframe` as this locator.\n\nUseful when you have a `Locator` object obtained somewhere, and later on would like to interact with the content\ninside the frame.\n\nFor a reverse operation, use [`method: FrameLocator.owner`].\n\n**Usage**\n\n```js\nconst locator = page.locator('iframe[name=\"embedded\"]');\n// ...\nconst frameLocator = locator.contentFrame();\nawait frameLocator.getByRole('button').click();\n```\n\n```java\nLocator locator = page.locator(\"iframe[name=\\\"embedded\\\"]\");\n// ...\nFrameLocator frameLocator = locator.contentFrame();\nframeLocator.getByRole(AriaRole.BUTTON).click();\n```\n\n```py\nlocator = page.locator(\"iframe[name=\\\"embedded\\\"]\")\n# ...\nframe_locator = locator.content_frame\nawait frame_locator.get_by_role(\"button\").click()\n```\n\n```py\nlocator = page.locator(\"iframe[name=\\\"embedded\\\"]\")\n# ...\nframe_locator = locator.content_frame\nframe_locator.get_by_role(\"button\").click()\n```\n\n```csharp\nvar locator = Page.Locator(\"iframe[name=\\\"embedded\\\"]\");\n// ...\nvar frameLocator = locator.ContentFrame;\nawait frameLocator.GetByRole(AriaRole.Button).ClickAsync();\n```\n","async":false,"alias":"contentFrame","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.14","name":"evaluate","type":{"name":"Serializable","expression":"[Serializable]"},"spec":[{"type":"text","text":"Execute JavaScript code in the page, taking the matching element as an argument."},{"type":"text","text":"**Details**"},{"type":"text","text":"Returns the return value of `expression`, called with the matching element as a first argument, and `arg` as a second argument."},{"type":"text","text":"If `expression` returns a [Promise], this method will wait for the promise to resolve and return its value."},{"type":"text","text":"If `expression` throws or rejects, this method throws."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const tweets = page.locator('.tweet .retweets');","expect(await tweets.evaluate(node => node.innerText)).toBe('10 retweets');"],"codeLang":"js"},{"type":"code","lines":["Locator tweets = page.locator(\".tweet .retweets\");","assertEquals(\"10 retweets\", tweets.evaluate(\"node => node.innerText\"));"],"codeLang":"java"},{"type":"code","lines":["tweets = page.locator(\".tweet .retweets\")","assert await tweets.evaluate(\"node => node.innerText\") == \"10 retweets\""],"codeLang":"python async"},{"type":"code","lines":["tweets = page.locator(\".tweet .retweets\")","assert tweets.evaluate(\"node => node.innerText\") == \"10 retweets\""],"codeLang":"python sync"},{"type":"code","lines":["var tweets = page.Locator(\".tweet .retweets\");","Assert.AreEqual(\"10 retweets\", await tweets.EvaluateAsync(\"node => node.innerText\"));"],"codeLang":"csharp"}],"required":true,"comment":"Execute JavaScript code in the page, taking the matching element as an argument.\n\n**Details**\n\nReturns the return value of `expression`, called with the matching element as a first argument, and `arg` as a\nsecond argument.\n\nIf `expression` returns a [Promise], this method will wait for the promise to resolve and return its value.\n\nIf `expression` throws or rejects, this method throws.\n\n**Usage**\n\n```js\nconst tweets = page.locator('.tweet .retweets');\nexpect(await tweets.evaluate(node => node.innerText)).toBe('10 retweets');\n```\n\n```java\nLocator tweets = page.locator(\".tweet .retweets\");\nassertEquals(\"10 retweets\", tweets.evaluate(\"node => node.innerText\"));\n```\n\n```py\ntweets = page.locator(\".tweet .retweets\")\nassert await tweets.evaluate(\"node => node.innerText\") == \"10 retweets\"\n```\n\n```py\ntweets = page.locator(\".tweet .retweets\")\nassert tweets.evaluate(\"node => node.innerText\") == \"10 retweets\"\n```\n\n```csharp\nvar tweets = page.Locator(\".tweet .retweets\");\nAssert.AreEqual(\"10 retweets\", await tweets.EvaluateAsync(\"node => node.innerText\"));\n```\n","async":true,"alias":"evaluate","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"overrides":{"js":{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"expression","type":{"name":"","union":[{"name":"function"},{"name":"string"}],"expression":"[function]|[string]"},"spec":[{"type":"text","text":"Function to be evaluated in the page context."}],"argsArray":[],"required":true,"comment":"Function to be evaluated in the page context.","args":{},"clazz":null,"async":false,"alias":"pageFunction","overloadIndex":0,"paramOrOption":null}}},"since":"v1.14","name":"expression","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"JavaScript expression to be evaluated in the browser context. If the expression evaluates↵to a function, the function is automatically invoked."}],"required":true,"comment":"JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the\nfunction is automatically invoked.","async":false,"alias":"expression","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"arg","type":{"name":"EvaluationArgument","expression":"[EvaluationArgument]"},"spec":[{"type":"text","text":"Optional argument to pass to `expression`."}],"required":false,"comment":"Optional argument to pass to `expression`.","async":false,"alias":"arg","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"evaluateAll","type":{"name":"Serializable","expression":"[Serializable]"},"spec":[{"type":"text","text":"Execute JavaScript code in the page, taking all matching elements as an argument."},{"type":"text","text":"**Details**"},{"type":"text","text":"Returns the return value of `expression`, called with an array of all matching elements as a first argument, and `arg` as a second argument."},{"type":"text","text":"If `expression` returns a [Promise], this method will wait for the promise to resolve and return its value."},{"type":"text","text":"If `expression` throws or rejects, this method throws."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const locator = page.locator('div');","const moreThanTen = await locator.evaluateAll((divs, min) => divs.length > min, 10);"],"codeLang":"js"},{"type":"code","lines":["Locator locator = page.locator(\"div\");","boolean moreThanTen = (boolean) locator.evaluateAll(\"(divs, min) => divs.length > min\", 10);"],"codeLang":"java"},{"type":"code","lines":["locator = page.locator(\"div\")","more_than_ten = await locator.evaluate_all(\"(divs, min) => divs.length > min\", 10)"],"codeLang":"python async"},{"type":"code","lines":["locator = page.locator(\"div\")","more_than_ten = locator.evaluate_all(\"(divs, min) => divs.length > min\", 10)"],"codeLang":"python sync"},{"type":"code","lines":["var locator = page.Locator(\"div\");","var moreThanTen = await locator.EvaluateAllAsync<bool>(\"(divs, min) => divs.length > min\", 10);"],"codeLang":"csharp"}],"required":true,"comment":"Execute JavaScript code in the page, taking all matching elements as an argument.\n\n**Details**\n\nReturns the return value of `expression`, called with an array of all matching elements as a first argument, and\n`arg` as a second argument.\n\nIf `expression` returns a [Promise], this method will wait for the promise to resolve and return its value.\n\nIf `expression` throws or rejects, this method throws.\n\n**Usage**\n\n```js\nconst locator = page.locator('div');\nconst moreThanTen = await locator.evaluateAll((divs, min) => divs.length > min, 10);\n```\n\n```java\nLocator locator = page.locator(\"div\");\nboolean moreThanTen = (boolean) locator.evaluateAll(\"(divs, min) => divs.length > min\", 10);\n```\n\n```py\nlocator = page.locator(\"div\")\nmore_than_ten = await locator.evaluate_all(\"(divs, min) => divs.length > min\", 10)\n```\n\n```py\nlocator = page.locator(\"div\")\nmore_than_ten = locator.evaluate_all(\"(divs, min) => divs.length > min\", 10)\n```\n\n```csharp\nvar locator = page.Locator(\"div\");\nvar moreThanTen = await locator.EvaluateAllAsync<bool>(\"(divs, min) => divs.length > min\", 10);\n```\n","async":true,"alias":"evaluateAll","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"overrides":{"js":{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"expression","type":{"name":"","union":[{"name":"function"},{"name":"string"}],"expression":"[function]|[string]"},"spec":[{"type":"text","text":"Function to be evaluated in the page context."}],"argsArray":[],"required":true,"comment":"Function to be evaluated in the page context.","args":{},"clazz":null,"async":false,"alias":"pageFunction","overloadIndex":0,"paramOrOption":null}}},"since":"v1.14","name":"expression","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"JavaScript expression to be evaluated in the browser context. If the expression evaluates↵to a function, the function is automatically invoked."}],"required":true,"comment":"JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the\nfunction is automatically invoked.","async":false,"alias":"expression","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"arg","type":{"name":"EvaluationArgument","expression":"[EvaluationArgument]"},"spec":[{"type":"text","text":"Optional argument to pass to `expression`."}],"required":false,"comment":"Optional argument to pass to `expression`.","async":false,"alias":"arg","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"evaluateHandle","type":{"name":"JSHandle","expression":"[JSHandle]"},"spec":[{"type":"text","text":"Execute JavaScript code in the page, taking the matching element as an argument, and return a `JSHandle` with the result."},{"type":"text","text":"**Details**"},{"type":"text","text":"Returns the return value of `expression` as a`JSHandle`, called with the matching element as a first argument, and `arg` as a second argument."},{"type":"text","text":"The only difference between [`method: Locator.evaluate`] and [`method: Locator.evaluateHandle`] is that [`method: Locator.evaluateHandle`] returns `JSHandle`."},{"type":"text","text":"If `expression` returns a [Promise], this method will wait for the promise to resolve and return its value."},{"type":"text","text":"If `expression` throws or rejects, this method throws."},{"type":"text","text":"See [`method: Page.evaluateHandle`] for more details."}],"required":true,"comment":"Execute JavaScript code in the page, taking the matching element as an argument, and return a `JSHandle` with the\nresult.\n\n**Details**\n\nReturns the return value of `expression` as a`JSHandle`, called with the matching element as a first argument, and\n`arg` as a second argument.\n\nThe only difference between [`method: Locator.evaluate`] and [`method: Locator.evaluateHandle`] is that\n[`method: Locator.evaluateHandle`] returns `JSHandle`.\n\nIf `expression` returns a [Promise], this method will wait for the promise to resolve and return its value.\n\nIf `expression` throws or rejects, this method throws.\n\nSee [`method: Page.evaluateHandle`] for more details.","async":true,"alias":"evaluateHandle","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"overrides":{"js":{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"expression","type":{"name":"","union":[{"name":"function"},{"name":"string"}],"expression":"[function]|[string]"},"spec":[{"type":"text","text":"Function to be evaluated in the page context."}],"argsArray":[],"required":true,"comment":"Function to be evaluated in the page context.","args":{},"clazz":null,"async":false,"alias":"pageFunction","overloadIndex":0,"paramOrOption":null}}},"since":"v1.14","name":"expression","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"JavaScript expression to be evaluated in the browser context. If the expression evaluates↵to a function, the function is automatically invoked."}],"required":true,"comment":"JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the\nfunction is automatically invoked.","async":false,"alias":"expression","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"arg","type":{"name":"EvaluationArgument","expression":"[EvaluationArgument]"},"spec":[{"type":"text","text":"Optional argument to pass to `expression`."}],"required":false,"comment":"Optional argument to pass to `expression`.","async":false,"alias":"arg","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"fill","type":{"name":"void"},"spec":[{"type":"text","text":"Set a value to the input field."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.getByRole('textbox').fill('example value');"],"codeLang":"js"},{"type":"code","lines":["page.getByRole(AriaRole.TEXTBOX).fill(\"example value\");"],"codeLang":"java"},{"type":"code","lines":["await page.get_by_role(\"textbox\").fill(\"example value\")"],"codeLang":"python async"},{"type":"code","lines":["page.get_by_role(\"textbox\").fill(\"example value\")"],"codeLang":"python sync"},{"type":"code","lines":["await page.GetByRole(AriaRole.Textbox).FillAsync(\"example value\");"],"codeLang":"csharp"},{"type":"text","text":"**Details**"},{"type":"text","text":"This method waits for [actionability](../actionability.md) checks, focuses the element, fills it and triggers an `input` event after filling. Note that you can pass an empty string to clear the input field."},{"type":"text","text":"If the target element is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method throws an error. However, if the element is inside the `<label>` element that has an associated [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be filled instead."},{"type":"text","text":"To send fine-grained keyboard events, use [`method: Locator.pressSequentially`]."}],"required":true,"comment":"Set a value to the input field.\n\n**Usage**\n\n```js\nawait page.getByRole('textbox').fill('example value');\n```\n\n```java\npage.getByRole(AriaRole.TEXTBOX).fill(\"example value\");\n```\n\n```py\nawait page.get_by_role(\"textbox\").fill(\"example value\")\n```\n\n```py\npage.get_by_role(\"textbox\").fill(\"example value\")\n```\n\n```csharp\nawait page.GetByRole(AriaRole.Textbox).FillAsync(\"example value\");\n```\n\n**Details**\n\nThis method waits for [actionability](../actionability.md) checks, focuses the element, fills it and triggers an\n`input` event after filling. Note that you can pass an empty string to clear the input field.\n\nIf the target element is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method throws an\nerror. However, if the element is inside the `<label>` element that has an associated\n[control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be filled\ninstead.\n\nTo send fine-grained keyboard events, use [`method: Locator.pressSequentially`].","async":true,"alias":"fill","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.14","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Value to set for the `<input>`, `<textarea>` or `[contenteditable]` element."}],"required":true,"comment":"Value to set for the `<input>`, `<textarea>` or `[contenteditable]` element.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.22","name":"filter","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"This method narrows existing locator according to the options, for example filters by text.↵It can be chained to filter multiple times."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const rowLocator = page.locator('tr');","// ...","await rowLocator"," .filter({ hasText: 'text in column 1' })"," .filter({ has: page.getByRole('button', { name: 'column 2 button' }) })"," .screenshot();"],"codeLang":"js"},{"type":"code","lines":["Locator rowLocator = page.locator(\"tr\");","// ...","rowLocator"," .filter(new Locator.FilterOptions().setHasText(\"text in column 1\"))"," .filter(new Locator.FilterOptions().setHas("," page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName(\"column 2 button\"))"," ))"," .screenshot();"],"codeLang":"java"},{"type":"code","lines":["row_locator = page.locator(\"tr\")","# ...","await row_locator.filter(has_text=\"text in column 1\").filter("," has=page.get_by_role(\"button\", name=\"column 2 button\")",").screenshot()",""],"codeLang":"python async"},{"type":"code","lines":["row_locator = page.locator(\"tr\")","# ...","row_locator.filter(has_text=\"text in column 1\").filter("," has=page.get_by_role(\"button\", name=\"column 2 button\")",").screenshot()"],"codeLang":"python sync"},{"type":"code","lines":["var rowLocator = page.Locator(\"tr\");","// ...","await rowLocator"," .Filter(new() { HasText = \"text in column 1\" })"," .Filter(new() {"," Has = page.GetByRole(AriaRole.Button, new() { Name = \"column 2 button\" } )"," })"," .ScreenshotAsync();"],"codeLang":"csharp"}],"required":true,"comment":"This method narrows existing locator according to the options, for example filters by text. It can be chained to\nfilter multiple times.\n\n**Usage**\n\n```js\nconst rowLocator = page.locator('tr');\n// ...\nawait rowLocator\n .filter({ hasText: 'text in column 1' })\n .filter({ has: page.getByRole('button', { name: 'column 2 button' }) })\n .screenshot();\n```\n\n```java\nLocator rowLocator = page.locator(\"tr\");\n// ...\nrowLocator\n .filter(new Locator.FilterOptions().setHasText(\"text in column 1\"))\n .filter(new Locator.FilterOptions().setHas(\n page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName(\"column 2 button\"))\n ))\n .screenshot();\n```\n\n```py\nrow_locator = page.locator(\"tr\")\n# ...\nawait row_locator.filter(has_text=\"text in column 1\").filter(\n has=page.get_by_role(\"button\", name=\"column 2 button\")\n).screenshot()\n\n```\n\n```py\nrow_locator = page.locator(\"tr\")\n# ...\nrow_locator.filter(has_text=\"text in column 1\").filter(\n has=page.get_by_role(\"button\", name=\"column 2 button\")\n).screenshot()\n```\n\n```csharp\nvar rowLocator = page.Locator(\"tr\");\n// ...\nawait rowLocator\n .Filter(new() { HasText = \"text in column 1\" })\n .Filter(new() {\n Has = page.GetByRole(AriaRole.Button, new() { Name = \"column 2 button\" } )\n })\n .ScreenshotAsync();\n```\n","async":false,"alias":"filter","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.22","name":"has","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"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>`."},{"type":"text","text":"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`."},{"type":"text","text":"Note that outer and inner locators must belong to the same frame. Inner locator must not contain `FrameLocator`s."}],"required":false,"comment":"Narrows down the results of the method to those which contain elements matching this relative locator. For example,\n`article` that has `text=Playwright` matches `<article><div>Playwright</div></article>`.\n\nInner locator **must be relative** to the outer locator and is queried starting with the outer locator match, not\nthe document root. For example, you can find `content` that has `div` in\n`<article><content><div>Playwright</div></content></article>`. However, looking for `content` that has `article\ndiv` will fail, because the inner locator must be relative and should not use any elements outside the `content`.\n\nNote that outer and inner locators must belong to the same frame. Inner locator must not contain `FrameLocator`s.","async":false,"alias":"has","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.33","name":"hasNot","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"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>`."},{"type":"text","text":"Note that outer and inner locators must belong to the same frame. Inner locator must not contain `FrameLocator`s."}],"required":false,"comment":"Matches elements that do not contain an element that matches an inner locator. Inner locator is queried against the\nouter one. For example, `article` that does not have `div` matches `<article><span>Playwright</span></article>`.\n\nNote that outer and inner locators must belong to the same frame. Inner locator must not contain `FrameLocator`s.","async":false,"alias":"hasNot","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.33","name":"hasNotText","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Matches elements that do not contain specified text somewhere inside, possibly in a child or a descendant element.\nWhen passed a [string], matching is case-insensitive and searches for a substring.","async":false,"alias":"hasNotText","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.22","name":"hasText","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"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>`."}],"required":false,"comment":"Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When\npassed a [string], matching is case-insensitive and searches for a substring. For example, `\"Playwright\"` matches\n`<article><div>Playwright</div></article>`.","async":false,"alias":"hasText","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"first","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Returns locator to the first matching element."}],"required":true,"comment":"Returns locator to the first matching element.","async":false,"alias":"first","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.14","name":"focus","type":{"name":"void"},"spec":[{"type":"text","text":"Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the matching element."}],"required":true,"comment":"Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the matching element.","async":true,"alias":"focus","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.17","name":"frameLocator","type":{"name":"FrameLocator","expression":"[FrameLocator]"},"spec":[{"type":"text","text":"When working with iframes, you can create a frame locator that will enter the iframe and allow locating elements↵in that iframe:"},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const locator = page.frameLocator('iframe').getByText('Submit');","await locator.click();"],"codeLang":"js"},{"type":"code","lines":["Locator locator = page.frameLocator(\"iframe\").getByText(\"Submit\");","locator.click();"],"codeLang":"java"},{"type":"code","lines":["locator = page.frame_locator(\"iframe\").get_by_text(\"Submit\")","await locator.click()"],"codeLang":"python async"},{"type":"code","lines":["locator = page.frame_locator(\"iframe\").get_by_text(\"Submit\")","locator.click()"],"codeLang":"python sync"},{"type":"code","lines":["var locator = page.FrameLocator(\"iframe\").GetByText(\"Submit\");","await locator.ClickAsync();"],"codeLang":"csharp"}],"required":true,"comment":"When working with iframes, you can create a frame locator that will enter the iframe and allow locating elements in\nthat iframe:\n\n**Usage**\n\n```js\nconst locator = page.frameLocator('iframe').getByText('Submit');\nawait locator.click();\n```\n\n```java\nLocator locator = page.frameLocator(\"iframe\").getByText(\"Submit\");\nlocator.click();\n```\n\n```py\nlocator = page.frame_locator(\"iframe\").get_by_text(\"Submit\")\nawait locator.click()\n```\n\n```py\nlocator = page.frame_locator(\"iframe\").get_by_text(\"Submit\")\nlocator.click()\n```\n\n```csharp\nvar locator = page.FrameLocator(\"iframe\").GetByText(\"Submit\");\nawait locator.ClickAsync();\n```\n","async":false,"alias":"frameLocator","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.17","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to use when resolving DOM element."}],"required":true,"comment":"A selector to use when resolving DOM element.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"getAttribute","type":{"name":"","union":[{"name":"null"},{"name":"string"}],"expression":"[null]|[string]"},"spec":[{"type":"text","text":"Returns the matching element's attribute value."},{"type":"note","noteType":"warning[Asserting attributes]","text":"If you need to assert an element's attribute, prefer [`method: LocatorAssertions.toHaveAttribute`] to avoid flakiness. See [assertions guide](../test-assertions.md) for more details."}],"required":true,"comment":"Returns the matching element's attribute value.\n\n**NOTE** If you need to assert an element's attribute, prefer [`method: LocatorAssertions.toHaveAttribute`] to\navoid flakiness. See [assertions guide](../test-assertions.md) for more details.","async":true,"alias":"getAttribute","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.14","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Attribute name to get the value for."}],"required":true,"comment":"Attribute name to get the value for.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByAltText","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Allows locating elements by their alt text."},{"type":"text","text":"**Usage**"},{"type":"text","text":"For example, this method will find the image by alt text \"Playwright logo\":"},{"type":"code","lines":["<img alt='Playwright logo'>"],"codeLang":"html"},{"type":"code","lines":["await page.getByAltText('Playwright logo').click();"],"codeLang":"js"},{"type":"code","lines":["page.getByAltText(\"Playwright logo\").click();"],"codeLang":"java"},{"type":"code","lines":["await page.get_by_alt_text(\"Playwright logo\").click()"],"codeLang":"python async"},{"type":"code","lines":["page.get_by_alt_text(\"Playwright logo\").click()"],"codeLang":"python sync"},{"type":"code","lines":["await page.GetByAltText(\"Playwright logo\").ClickAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Allows locating elements by their alt text.\n\n**Usage**\n\nFor example, this method will find the image by alt text \"Playwright logo\":\n\n```html\n<img alt='Playwright logo'>\n```\n\n```js\nawait page.getByAltText('Playwright logo').click();\n```\n\n```java\npage.getByAltText(\"Playwright logo\").click();\n```\n\n```py\nawait page.get_by_alt_text(\"Playwright logo\").click()\n```\n\n```py\npage.get_by_alt_text(\"Playwright logo\").click()\n```\n\n```csharp\nawait page.GetByAltText(\"Playwright logo\").ClickAsync();\n```\n","async":false,"alias":"getByAltText","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"text","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Text to locate the element for."}],"required":true,"comment":"Text to locate the element for.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.27","name":"exact","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a\nregular expression. Note that exact match still trims whitespace.","async":false,"alias":"exact","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByLabel","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Allows locating input elements by the text of the associated `<label>` or `aria-labelledby` element, or by the `aria-label` attribute."},{"type":"text","text":"**Usage**"},{"type":"text","text":"For example, this method will find inputs by label \"Username\" and \"Password\" in the following DOM:"},{"type":"code","lines":["<input aria-label=\"Username\">","<label for=\"password-input\">Password:</label>","<input id=\"password-input\">"],"codeLang":"html"},{"type":"code","lines":["await page.getByLabel('Username').fill('john');","await page.getByLabel('Password').fill('secret');"],"codeLang":"js"},{"type":"code","lines":["page.getByLabel(\"Username\").fill(\"john\");","page.getByLabel(\"Password\").fill(\"secret\");"],"codeLang":"java"},{"type":"code","lines":["await page.get_by_label(\"Username\").fill(\"john\")","await page.get_by_label(\"Password\").fill(\"secret\")"],"codeLang":"python async"},{"type":"code","lines":["page.get_by_label(\"Username\").fill(\"john\")","page.get_by_label(\"Password\").fill(\"secret\")"],"codeLang":"python sync"},{"type":"code","lines":["await page.GetByLabel(\"Username\").FillAsync(\"john\");","await page.GetByLabel(\"Password\").FillAsync(\"secret\");"],"codeLang":"csharp"}],"required":true,"comment":"Allows locating input elements by the text of the associated `<label>` or `aria-labelledby` element, or by the\n`aria-label` attribute.\n\n**Usage**\n\nFor example, this method will find inputs by label \"Username\" and \"Password\" in the following DOM:\n\n```html\n<input aria-label=\"Username\">\n<label for=\"password-input\">Password:</label>\n<input id=\"password-input\">\n```\n\n```js\nawait page.getByLabel('Username').fill('john');\nawait page.getByLabel('Password').fill('secret');\n```\n\n```java\npage.getByLabel(\"Username\").fill(\"john\");\npage.getByLabel(\"Password\").fill(\"secret\");\n```\n\n```py\nawait page.get_by_label(\"Username\").fill(\"john\")\nawait page.get_by_label(\"Password\").fill(\"secret\")\n```\n\n```py\npage.get_by_label(\"Username\").fill(\"john\")\npage.get_by_label(\"Password\").fill(\"secret\")\n```\n\n```csharp\nawait page.GetByLabel(\"Username\").FillAsync(\"john\");\nawait page.GetByLabel(\"Password\").FillAsync(\"secret\");\n```\n","async":false,"alias":"getByLabel","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"text","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Text to locate the element for."}],"required":true,"comment":"Text to locate the element for.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.27","name":"exact","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a\nregular expression. Note that exact match still trims whitespace.","async":false,"alias":"exact","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByPlaceholder","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Allows locating input elements by the placeholder text."},{"type":"text","text":"**Usage**"},{"type":"text","text":"For example, consider the following DOM structure."},{"type":"code","lines":["<input type=\"email\" placeholder=\"name@example.com\" />"],"codeLang":"html"},{"type":"text","text":"You can fill the input after locating it by the placeholder text:"},{"type":"code","lines":["await page"," .getByPlaceholder('name@example.com')"," .fill('playwright@microsoft.com');"],"codeLang":"js"},{"type":"code","lines":["page.getByPlaceholder(\"name@example.com\").fill(\"playwright@microsoft.com\");"],"codeLang":"java"},{"type":"code","lines":["await page.get_by_placeholder(\"name@example.com\").fill(\"playwright@microsoft.com\")"],"codeLang":"python async"},{"type":"code","lines":["page.get_by_placeholder(\"name@example.com\").fill(\"playwright@microsoft.com\")"],"codeLang":"python sync"},{"type":"code","lines":["await page"," .GetByPlaceholder(\"name@example.com\")"," .FillAsync(\"playwright@microsoft.com\");"],"codeLang":"csharp"}],"required":true,"comment":"Allows locating input elements by the placeholder text.\n\n**Usage**\n\nFor example, consider the following DOM structure.\n\n```html\n<input type=\"email\" placeholder=\"name@example.com\" />\n```\n\nYou can fill the input after locating it by the placeholder text:\n\n```js\nawait page\n .getByPlaceholder('name@example.com')\n .fill('playwright@microsoft.com');\n```\n\n```java\npage.getByPlaceholder(\"name@example.com\").fill(\"playwright@microsoft.com\");\n```\n\n```py\nawait page.get_by_placeholder(\"name@example.com\").fill(\"playwright@microsoft.com\")\n```\n\n```py\npage.get_by_placeholder(\"name@example.com\").fill(\"playwright@microsoft.com\")\n```\n\n```csharp\nawait page\n .GetByPlaceholder(\"name@example.com\")\n .FillAsync(\"playwright@microsoft.com\");\n```\n","async":false,"alias":"getByPlaceholder","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"text","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Text to locate the element for."}],"required":true,"comment":"Text to locate the element for.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.27","name":"exact","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a\nregular expression. Note that exact match still trims whitespace.","async":false,"alias":"exact","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByRole","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"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)."},{"type":"text","text":"**Usage**"},{"type":"text","text":"Consider the following DOM structure."},{"type":"code","lines":["<h3>Sign up</h3>","<label>"," <input type=\"checkbox\" /> Subscribe","</label>","<br/>","<button>Submit</button>"],"codeLang":"html"},{"type":"text","text":"You can locate each element by it's implicit role:"},{"type":"code","lines":["await expect(page.getByRole('heading', { name: 'Sign up' })).toBeVisible();","","await page.getByRole('checkbox', { name: 'Subscribe' }).check();","","await page.getByRole('button', { name: /submit/i }).click();"],"codeLang":"js"},{"type":"code","lines":["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()"],"codeLang":"python async"},{"type":"code","lines":["expect(page.get_by_role(\"heading\", name=\"Sign up\")).to_be_visible()","","page.get_by_role(\"checkbox\", name=\"Subscribe\").check()","","page.get_by_role(\"button\", name=re.compile(\"submit\", re.IGNORECASE)).click()"],"codeLang":"python sync"},{"type":"code","lines":["assertThat(page"," .getByRole(AriaRole.HEADING,"," new Page.GetByRoleOptions().setName(\"Sign up\")))"," .isVisible();","","page.getByRole(AriaRole.CHECKBOX,"," new Page.GetByRoleOptions().setName(\"Subscribe\"))"," .check();","","page.getByRole(AriaRole.BUTTON,"," new Page.GetByRoleOptions().setName("," Pattern.compile(\"submit\", Pattern.CASE_INSENSITIVE)))"," .click();"],"codeLang":"java"},{"type":"code","lines":["await Expect(Page"," .GetByRole(AriaRole.Heading, new() { Name = \"Sign up\" }))"," .ToBeVisibleAsync();","","await page"," .GetByRole(AriaRole.Checkbox, new() { Name = \"Subscribe\" })"," .CheckAsync();","","await page"," .GetByRole(AriaRole.Button, new() {"," NameRegex = new Regex(\"submit\", RegexOptions.IgnoreCase)"," })"," .ClickAsync();"],"codeLang":"csharp"},{"type":"text","text":"**Details**"},{"type":"text","text":"Role selector **does not replace** accessibility audits and conformance tests, but rather gives early feedback about the ARIA guidelines."},{"type":"text","text":"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."}],"required":true,"comment":"Allows locating elements by their [ARIA role](https://www.w3.org/TR/wai-aria-1.2/#roles),\n[ARIA attributes](https://www.w3.org/TR/wai-aria-1.2/#aria-attributes) and\n[accessible name](https://w3c.github.io/accname/#dfn-accessible-name).\n\n**Usage**\n\nConsider the following DOM structure.\n\n```html\n<h3>Sign up</h3>\n<label>\n <input type=\"checkbox\" /> Subscribe\n</label>\n<br/>\n<button>Submit</button>\n```\n\nYou can locate each element by it's implicit role:\n\n```js\nawait expect(page.getByRole('heading', { name: 'Sign up' })).toBeVisible();\n\nawait page.getByRole('checkbox', { name: 'Subscribe' }).check();\n\nawait page.getByRole('button', { name: /submit/i }).click();\n```\n\n```py\nawait expect(page.get_by_role(\"heading\", name=\"Sign up\")).to_be_visible()\n\nawait page.get_by_role(\"checkbox\", name=\"Subscribe\").check()\n\nawait page.get_by_role(\"button\", name=re.compile(\"submit\", re.IGNORECASE)).click()\n```\n\n```py\nexpect(page.get_by_role(\"heading\", name=\"Sign up\")).to_be_visible()\n\npage.get_by_role(\"checkbox\", name=\"Subscribe\").check()\n\npage.get_by_role(\"button\", name=re.compile(\"submit\", re.IGNORECASE)).click()\n```\n\n```java\nassertThat(page\n .getByRole(AriaRole.HEADING,\n new Page.GetByRoleOptions().setName(\"Sign up\")))\n .isVisible();\n\npage.getByRole(AriaRole.CHECKBOX,\n new Page.GetByRoleOptions().setName(\"Subscribe\"))\n .check();\n\npage.getByRole(AriaRole.BUTTON,\n new Page.GetByRoleOptions().setName(\n Pattern.compile(\"submit\", Pattern.CASE_INSENSITIVE)))\n .click();\n```\n\n```csharp\nawait Expect(Page\n .GetByRole(AriaRole.Heading, new() { Name = \"Sign up\" }))\n .ToBeVisibleAsync();\n\nawait page\n .GetByRole(AriaRole.Checkbox, new() { Name = \"Subscribe\" })\n .CheckAsync();\n\nawait page\n .GetByRole(AriaRole.Button, new() {\n NameRegex = new Regex(\"submit\", RegexOptions.IgnoreCase)\n })\n .ClickAsync();\n```\n\n**Details**\n\nRole selector **does not replace** accessibility audits and conformance tests, but rather gives early feedback\nabout the ARIA guidelines.\n\nMany html elements have an implicitly [defined role](https://w3c.github.io/html-aam/#html-element-role-mappings)\nthat is recognized by the role selector. You can find all the\n[supported roles here](https://www.w3.org/TR/wai-aria-1.2/#role_definitions). ARIA guidelines **do not recommend**\nduplicating implicit roles and attributes by setting `role` and/or `aria-*` attributes to default values.","async":false,"alias":"getByRole","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"role","type":{"name":"AriaRole","union":[{"name":"\"alert\""},{"name":"\"alertdialog\""},{"name":"\"application\""},{"name":"\"article\""},{"name":"\"banner\""},{"name":"\"blockquote\""},{"name":"\"button\""},{"name":"\"caption\""},{"name":"\"cell\""},{"name":"\"checkbox\""},{"name":"\"code\""},{"name":"\"columnheader\""},{"name":"\"combobox\""},{"name":"\"complementary\""},{"name":"\"contentinfo\""},{"name":"\"definition\""},{"name":"\"deletion\""},{"name":"\"dialog\""},{"name":"\"directory\""},{"name":"\"document\""},{"name":"\"emphasis\""},{"name":"\"feed\""},{"name":"\"figure\""},{"name":"\"form\""},{"name":"\"generic\""},{"name":"\"grid\""},{"name":"\"gridcell\""},{"name":"\"group\""},{"name":"\"heading\""},{"name":"\"img\""},{"name":"\"insertion\""},{"name":"\"link\""},{"name":"\"list\""},{"name":"\"listbox\""},{"name":"\"listitem\""},{"name":"\"log\""},{"name":"\"main\""},{"name":"\"marquee\""},{"name":"\"math\""},{"name":"\"meter\""},{"name":"\"menu\""},{"name":"\"menubar\""},{"name":"\"menuitem\""},{"name":"\"menuitemcheckbox\""},{"name":"\"menuitemradio\""},{"name":"\"navigation\""},{"name":"\"none\""},{"name":"\"note\""},{"name":"\"option\""},{"name":"\"paragraph\""},{"name":"\"presentation\""},{"name":"\"progressbar\""},{"name":"\"radio\""},{"name":"\"radiogroup\""},{"name":"\"region\""},{"name":"\"row\""},{"name":"\"rowgroup\""},{"name":"\"rowheader\""},{"name":"\"scrollbar\""},{"name":"\"search\""},{"name":"\"searchbox\""},{"name":"\"separator\""},{"name":"\"slider\""},{"name":"\"spinbutton\""},{"name":"\"status\""},{"name":"\"strong\""},{"name":"\"subscript\""},{"name":"\"superscript\""},{"name":"\"switch\""},{"name":"\"tab\""},{"name":"\"table\""},{"name":"\"tablist\""},{"name":"\"tabpanel\""},{"name":"\"term\""},{"name":"\"textbox\""},{"name":"\"time\""},{"name":"\"timer\""},{"name":"\"toolbar\""},{"name":"\"tooltip\""},{"name":"\"tree\""},{"name":"\"treegrid\""},{"name":"\"treeitem\""}],"expression":"[AriaRole]<\"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\"|\"meter\"|\"menu\"|\"menubar\"|\"menuitem\"|\"menuitemcheckbox\"|\"menuitemradio\"|\"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\">"},"spec":[{"type":"text","text":"Required aria role."}],"required":true,"comment":"Required aria role.","async":false,"alias":"role","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.27","name":"checked","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"An attribute that is usually set by `aria-checked` or native `<input type=checkbox>` controls."},{"type":"text","text":"Learn more about [`aria-checked`](https://www.w3.org/TR/wai-aria-1.2/#aria-checked)."}],"required":false,"comment":"An attribute that is usually set by `aria-checked` or native `<input type=checkbox>` controls.\n\nLearn more about [`aria-checked`](https://www.w3.org/TR/wai-aria-1.2/#aria-checked).","async":false,"alias":"checked","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"disabled","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"An attribute that is usually set by `aria-disabled` or `disabled`."},{"type":"note","noteType":"note","text":"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)."}],"required":false,"comment":"An attribute that is usually set by `aria-disabled` or `disabled`.\n\n**NOTE** Unlike most other attributes, `disabled` is inherited through the DOM hierarchy. Learn more about\n[`aria-disabled`](https://www.w3.org/TR/wai-aria-1.2/#aria-disabled).","async":false,"alias":"disabled","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.28","name":"exact","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Whether `name` is matched exactly: case-sensitive and whole-string. Defaults to false. Ignored when `name` is a\nregular expression. Note that exact match still trims whitespace.","async":false,"alias":"exact","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"expanded","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"An attribute that is usually set by `aria-expanded`."},{"type":"text","text":"Learn more about [`aria-expanded`](https://www.w3.org/TR/wai-aria-1.2/#aria-expanded)."}],"required":false,"comment":"An attribute that is usually set by `aria-expanded`.\n\nLearn more about [`aria-expanded`](https://www.w3.org/TR/wai-aria-1.2/#aria-expanded).","async":false,"alias":"expanded","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"includeHidden","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."},{"type":"text","text":"Learn more about [`aria-hidden`](https://www.w3.org/TR/wai-aria-1.2/#aria-hidden)."}],"required":false,"comment":"Option that controls whether hidden elements are matched. By default, only non-hidden elements, as\n[defined by ARIA](https://www.w3.org/TR/wai-aria-1.2/#tree_exclusion), are matched by role selector.\n\nLearn more about [`aria-hidden`](https://www.w3.org/TR/wai-aria-1.2/#aria-hidden).","async":false,"alias":"includeHidden","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"level","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"A number attribute that is usually present for roles `heading`, `listitem`, `row`, `treeitem`, with default values for `<h1>-<h6>` elements."},{"type":"text","text":"Learn more about [`aria-level`](https://www.w3.org/TR/wai-aria-1.2/#aria-level)."}],"required":false,"comment":"A number attribute that is usually present for roles `heading`, `listitem`, `row`, `treeitem`, with default values\nfor `<h1>-<h6>` elements.\n\nLearn more about [`aria-level`](https://www.w3.org/TR/wai-aria-1.2/#aria-level).","async":false,"alias":"level","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"name","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"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."},{"type":"text","text":"Learn more about [accessible name](https://w3c.github.io/accname/#dfn-accessible-name)."}],"required":false,"comment":"Option to match the [accessible name](https://w3c.github.io/accname/#dfn-accessible-name). By default, matching is\ncase-insensitive and searches for a substring, use `exact` to control this behavior.\n\nLearn more about [accessible name](https://w3c.github.io/accname/#dfn-accessible-name).","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"pressed","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"An attribute that is usually set by `aria-pressed`."},{"type":"text","text":"Learn more about [`aria-pressed`](https://www.w3.org/TR/wai-aria-1.2/#aria-pressed)."}],"required":false,"comment":"An attribute that is usually set by `aria-pressed`.\n\nLearn more about [`aria-pressed`](https://www.w3.org/TR/wai-aria-1.2/#aria-pressed).","async":false,"alias":"pressed","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"selected","type":{"name":"boolean","expression":"boolean"},"spec":[{"type":"text","text":"An attribute that is usually set by `aria-selected`."},{"type":"text","text":"Learn more about [`aria-selected`](https://www.w3.org/TR/wai-aria-1.2/#aria-selected)."}],"required":false,"comment":"An attribute that is usually set by `aria-selected`.\n\nLearn more about [`aria-selected`](https://www.w3.org/TR/wai-aria-1.2/#aria-selected).","async":false,"alias":"selected","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByTestId","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Locate element by the test id."},{"type":"text","text":"**Usage**"},{"type":"text","text":"Consider the following DOM structure."},{"type":"code","lines":["<button data-testid=\"directions\">Itinéraire</button>"],"codeLang":"html"},{"type":"text","text":"You can locate the element by it's test id:"},{"type":"code","lines":["await page.getByTestId('directions').click();"],"codeLang":"js"},{"type":"code","lines":["page.getByTestId(\"directions\").click();"],"codeLang":"java"},{"type":"code","lines":["await page.get_by_test_id(\"directions\").click()"],"codeLang":"python async"},{"type":"code","lines":["page.get_by_test_id(\"directions\").click()"],"codeLang":"python sync"},{"type":"code","lines":["await page.GetByTestId(\"directions\").ClickAsync();"],"codeLang":"csharp"},{"type":"text","text":"**Details**"},{"type":"text","text":"By default, the `data-testid` attribute is used as a test id. Use [`method: Selectors.setTestIdAttribute`] to configure a different test id attribute if necessary."},{"type":"code","lines":["// Set custom test id attribute from @playwright/test config:","import { defineConfig } from '@playwright/test';","","export default defineConfig({"," use: {"," testIdAttribute: 'data-pw'"," },","});"],"codeLang":"js"}],"required":true,"comment":"Locate element by the test id.\n\n**Usage**\n\nConsider the following DOM structure.\n\n```html\n<button data-testid=\"directions\">Itinéraire</button>\n```\n\nYou can locate the element by it's test id:\n\n```js\nawait page.getByTestId('directions').click();\n```\n\n```java\npage.getByTestId(\"directions\").click();\n```\n\n```py\nawait page.get_by_test_id(\"directions\").click()\n```\n\n```py\npage.get_by_test_id(\"directions\").click()\n```\n\n```csharp\nawait page.GetByTestId(\"directions\").ClickAsync();\n```\n\n**Details**\n\nBy default, the `data-testid` attribute is used as a test id. Use [`method: Selectors.setTestIdAttribute`] to\nconfigure a different test id attribute if necessary.\n\n```js\n// Set custom test id attribute from @playwright/test config:\nimport { defineConfig } from '@playwright/test';\n\nexport default defineConfig({\n use: {\n testIdAttribute: 'data-pw'\n },\n});\n```\n","async":false,"alias":"getByTestId","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"testId","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Id to locate the element by."}],"required":true,"comment":"Id to locate the element by.","async":false,"alias":"testId","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByText","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Allows locating elements that contain given text."},{"type":"text","text":"See also [`method: Locator.filter`] that allows to match by another criteria, like an accessible role, and then filter by the text content."},{"type":"text","text":"**Usage**"},{"type":"text","text":"Consider the following DOM structure:"},{"type":"code","lines":["<div>Hello <span>world</span></div>","<div>Hello</div>"],"codeLang":"html"},{"type":"text","text":"You can locate by text substring, exact string, or a regular expression:"},{"type":"code","lines":["// Matches <span>","page.getByText('world');","","// Matches first <div>","page.getByText('Hello world');","","// Matches second <div>","page.getByText('Hello', { exact: true });","","// Matches both <div>s","page.getByText(/Hello/);","","// Matches second <div>","page.getByText(/^hello$/i);"],"codeLang":"js"},{"type":"code","lines":["# 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))"],"codeLang":"python async"},{"type":"code","lines":["# 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))"],"codeLang":"python sync"},{"type":"code","lines":["// Matches <span>","page.getByText(\"world\")","","// Matches first <div>","page.getByText(\"Hello world\")","","// Matches second <div>","page.getByText(\"Hello\", new Page.GetByTextOptions().setExact(true))","","// Matches both <div>s","page.getByText(Pattern.compile(\"Hello\"))","","// Matches second <div>","page.getByText(Pattern.compile(\"^hello$\", Pattern.CASE_INSENSITIVE))"],"codeLang":"java"},{"type":"code","lines":["// Matches <span>","page.GetByText(\"world\");","","// Matches first <div>","page.GetByText(\"Hello world\");","","// Matches second <div>","page.GetByText(\"Hello\", new() { Exact = true });","","// Matches both <div>s","page.GetByText(new Regex(\"Hello\"));","","// Matches second <div>","page.GetByText(new Regex(\"^hello$\", RegexOptions.IgnoreCase));"],"codeLang":"csharp"},{"type":"text","text":"**Details**"},{"type":"text","text":"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."},{"type":"text","text":"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\">`."}],"required":true,"comment":"Allows locating elements that contain given text.\n\nSee also [`method: Locator.filter`] that allows to match by another criteria, like an accessible role, and then\nfilter by the text content.\n\n**Usage**\n\nConsider the following DOM structure:\n\n```html\n<div>Hello <span>world</span></div>\n<div>Hello</div>\n```\n\nYou can locate by text substring, exact string, or a regular expression:\n\n```js\n// Matches <span>\npage.getByText('world');\n\n// Matches first <div>\npage.getByText('Hello world');\n\n// Matches second <div>\npage.getByText('Hello', { exact: true });\n\n// Matches both <div>s\npage.getByText(/Hello/);\n\n// Matches second <div>\npage.getByText(/^hello$/i);\n```\n\n```py\n# Matches <span>\npage.get_by_text(\"world\")\n\n# Matches first <div>\npage.get_by_text(\"Hello world\")\n\n# Matches second <div>\npage.get_by_text(\"Hello\", exact=True)\n\n# Matches both <div>s\npage.get_by_text(re.compile(\"Hello\"))\n\n# Matches second <div>\npage.get_by_text(re.compile(\"^hello$\", re.IGNORECASE))\n```\n\n```py\n# Matches <span>\npage.get_by_text(\"world\")\n\n# Matches first <div>\npage.get_by_text(\"Hello world\")\n\n# Matches second <div>\npage.get_by_text(\"Hello\", exact=True)\n\n# Matches both <div>s\npage.get_by_text(re.compile(\"Hello\"))\n\n# Matches second <div>\npage.get_by_text(re.compile(\"^hello$\", re.IGNORECASE))\n```\n\n```java\n// Matches <span>\npage.getByText(\"world\")\n\n// Matches first <div>\npage.getByText(\"Hello world\")\n\n// Matches second <div>\npage.getByText(\"Hello\", new Page.GetByTextOptions().setExact(true))\n\n// Matches both <div>s\npage.getByText(Pattern.compile(\"Hello\"))\n\n// Matches second <div>\npage.getByText(Pattern.compile(\"^hello$\", Pattern.CASE_INSENSITIVE))\n```\n\n```csharp\n// Matches <span>\npage.GetByText(\"world\");\n\n// Matches first <div>\npage.GetByText(\"Hello world\");\n\n// Matches second <div>\npage.GetByText(\"Hello\", new() { Exact = true });\n\n// Matches both <div>s\npage.GetByText(new Regex(\"Hello\"));\n\n// Matches second <div>\npage.GetByText(new Regex(\"^hello$\", RegexOptions.IgnoreCase));\n```\n\n**Details**\n\nMatching by text always normalizes whitespace, even with exact match. For example, it turns multiple spaces into\none, turns line breaks into spaces and ignores leading and trailing whitespace.\n\nInput elements of the type `button` and `submit` are matched by their `value` instead of the text content. For\nexample, locating by text `\"Log in\"` matches `<input type=button value=\"Log in\">`.","async":false,"alias":"getByText","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"text","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Text to locate the element for."}],"required":true,"comment":"Text to locate the element for.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.27","name":"exact","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a\nregular expression. Note that exact match still trims whitespace.","async":false,"alias":"exact","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByTitle","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Allows locating elements by their title attribute."},{"type":"text","text":"**Usage**"},{"type":"text","text":"Consider the following DOM structure."},{"type":"code","lines":["<span title='Issues count'>25 issues</span>"],"codeLang":"html"},{"type":"text","text":"You can check the issues count after locating it by the title text:"},{"type":"code","lines":["await expect(page.getByTitle('Issues count')).toHaveText('25 issues');"],"codeLang":"js"},{"type":"code","lines":["assertThat(page.getByTitle(\"Issues count\")).hasText(\"25 issues\");"],"codeLang":"java"},{"type":"code","lines":["await expect(page.get_by_title(\"Issues count\")).to_have_text(\"25 issues\")"],"codeLang":"python async"},{"type":"code","lines":["expect(page.get_by_title(\"Issues count\")).to_have_text(\"25 issues\")"],"codeLang":"python sync"},{"type":"code","lines":["await Expect(Page.GetByTitle(\"Issues count\")).toHaveText(\"25 issues\");"],"codeLang":"csharp"}],"required":true,"comment":"Allows locating elements by their title attribute.\n\n**Usage**\n\nConsider the following DOM structure.\n\n```html\n<span title='Issues count'>25 issues</span>\n```\n\nYou can check the issues count after locating it by the title text:\n\n```js\nawait expect(page.getByTitle('Issues count')).toHaveText('25 issues');\n```\n\n```java\nassertThat(page.getByTitle(\"Issues count\")).hasText(\"25 issues\");\n```\n\n```py\nawait expect(page.get_by_title(\"Issues count\")).to_have_text(\"25 issues\")\n```\n\n```py\nexpect(page.get_by_title(\"Issues count\")).to_have_text(\"25 issues\")\n```\n\n```csharp\nawait Expect(Page.GetByTitle(\"Issues count\")).toHaveText(\"25 issues\");\n```\n","async":false,"alias":"getByTitle","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"text","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Text to locate the element for."}],"required":true,"comment":"Text to locate the element for.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.27","name":"exact","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a\nregular expression. Note that exact match still trims whitespace.","async":false,"alias":"exact","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.20","name":"highlight","type":{"name":"void"},"spec":[{"type":"text","text":"Highlight the corresponding element(s) on the screen. Useful for debugging, don't commit the code that uses [`method: Locator.highlight`]."}],"required":true,"comment":"Highlight the corresponding element(s) on the screen. Useful for debugging, don't commit the code that uses\n[`method: Locator.highlight`].","async":true,"alias":"highlight","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.14","name":"hover","type":{"name":"void"},"spec":[{"type":"text","text":"Hover over the matching element."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.getByRole('link').hover();"],"codeLang":"js"},{"type":"code","lines":["await page.get_by_role(\"link\").hover()"],"codeLang":"python async"},{"type":"code","lines":["page.get_by_role(\"link\").hover()"],"codeLang":"python sync"},{"type":"code","lines":["page.getByRole(AriaRole.LINK).hover();"],"codeLang":"java"},{"type":"code","lines":["await page.GetByRole(AriaRole.Link).HoverAsync();"],"codeLang":"csharp"},{"type":"text","text":"**Details**"},{"type":"text","text":"This method hovers over the element by performing the following steps:"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.mouse`] to hover over the center of the element, or the specified `position`.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.","liType":"ordinal"},{"type":"text","text":"If the element is detached from the DOM at any moment during the action, this method throws."},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."}],"required":true,"comment":"Hover over the matching element.\n\n**Usage**\n\n```js\nawait page.getByRole('link').hover();\n```\n\n```py\nawait page.get_by_role(\"link\").hover()\n```\n\n```py\npage.get_by_role(\"link\").hover()\n```\n\n```java\npage.getByRole(AriaRole.LINK).hover();\n```\n\n```csharp\nawait page.GetByRole(AriaRole.Link).HoverAsync();\n```\n\n**Details**\n\nThis method hovers over the element by performing the following steps:\n1. Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.mouse`] to hover over the center of the element, or the specified `position`.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n\nIf the element is detached from the DOM at any moment during the action, this method throws.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.","async":true,"alias":"hover","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"modifiers","type":{"name":"Array","templates":[{"name":"KeyboardModifier","union":[{"name":"\"Alt\""},{"name":"\"Control\""},{"name":"\"ControlOrMeta\""},{"name":"\"Meta\""},{"name":"\"Shift\""}]}],"expression":"[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"ControlOrMeta\"|\"Meta\"|\"Shift\">>"},"spec":[{"type":"text","text":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current↵modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to \"Control\" on Windows↵and Linux and to \"Meta\" on macOS."}],"required":false,"comment":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores\ncurrent modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to\n\"Control\" on Windows and Linux and to \"Meta\" on macOS.","async":false,"alias":"modifiers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.28","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"innerHTML","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Returns the [`element.innerHTML`](https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML)."}],"required":true,"comment":"Returns the [`element.innerHTML`](https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML).","async":true,"alias":"innerHTML","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"innerText","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Returns the [`element.innerText`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/innerText)."},{"type":"note","noteType":"warning[Asserting text]","text":"If you need to assert text on the page, prefer [`method: LocatorAssertions.toHaveText`] with `useInnerText` option to avoid flakiness. See [assertions guide](../test-assertions.md) for more details."}],"required":true,"comment":"Returns the [`element.innerText`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/innerText).\n\n**NOTE** If you need to assert text on the page, prefer [`method: LocatorAssertions.toHaveText`] with\n`useInnerText` option to avoid flakiness. See [assertions guide](../test-assertions.md) for more details.","async":true,"alias":"innerText","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"inputValue","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Returns the value for the matching `<input>` or `<textarea>` or `<select>` element."},{"type":"note","noteType":"warning[Asserting value]","text":"If you need to assert input value, prefer [`method: LocatorAssertions.toHaveValue`] to avoid flakiness. See [assertions guide](../test-assertions.md) for more details."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const value = await page.getByRole('textbox').inputValue();"],"codeLang":"js"},{"type":"code","lines":["value = await page.get_by_role(\"textbox\").input_value()"],"codeLang":"python async"},{"type":"code","lines":["value = page.get_by_role(\"textbox\").input_value()"],"codeLang":"python sync"},{"type":"code","lines":["String value = page.getByRole(AriaRole.TEXTBOX).inputValue();"],"codeLang":"java"},{"type":"code","lines":["String value = await page.GetByRole(AriaRole.Textbox).InputValueAsync();"],"codeLang":"csharp"},{"type":"text","text":"**Details**"},{"type":"text","text":"Throws elements that are not an input, textarea or a select. However, if the element is inside the `<label>` element that has an associated [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), returns the value of the control."}],"required":true,"comment":"Returns the value for the matching `<input>` or `<textarea>` or `<select>` element.\n\n**NOTE** If you need to assert input value, prefer [`method: LocatorAssertions.toHaveValue`] to avoid flakiness.\nSee [assertions guide](../test-assertions.md) for more details.\n\n**Usage**\n\n```js\nconst value = await page.getByRole('textbox').inputValue();\n```\n\n```py\nvalue = await page.get_by_role(\"textbox\").input_value()\n```\n\n```py\nvalue = page.get_by_role(\"textbox\").input_value()\n```\n\n```java\nString value = page.getByRole(AriaRole.TEXTBOX).inputValue();\n```\n\n```csharp\nString value = await page.GetByRole(AriaRole.Textbox).InputValueAsync();\n```\n\n**Details**\n\nThrows elements that are not an input, textarea or a select. However, if the element is inside the `<label>`\nelement that has an associated\n[control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), returns the value of the\ncontrol.","async":true,"alias":"inputValue","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"isChecked","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Returns whether the element is checked. Throws if the element is not a checkbox or radio input."},{"type":"note","noteType":"warning[Asserting checked state]","text":"If you need to assert that checkbox is checked, prefer [`method: LocatorAssertions.toBeChecked`] to avoid flakiness. See [assertions guide](../test-assertions.md) for more details."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const checked = await page.getByRole('checkbox').isChecked();"],"codeLang":"js"},{"type":"code","lines":["boolean checked = page.getByRole(AriaRole.CHECKBOX).isChecked();"],"codeLang":"java"},{"type":"code","lines":["checked = await page.get_by_role(\"checkbox\").is_checked()"],"codeLang":"python async"},{"type":"code","lines":["checked = page.get_by_role(\"checkbox\").is_checked()"],"codeLang":"python sync"},{"type":"code","lines":["var isChecked = await page.GetByRole(AriaRole.Checkbox).IsCheckedAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Returns whether the element is checked. Throws if the element is not a checkbox or radio input.\n\n**NOTE** If you need to assert that checkbox is checked, prefer [`method: LocatorAssertions.toBeChecked`] to avoid\nflakiness. See [assertions guide](../test-assertions.md) for more details.\n\n**Usage**\n\n```js\nconst checked = await page.getByRole('checkbox').isChecked();\n```\n\n```java\nboolean checked = page.getByRole(AriaRole.CHECKBOX).isChecked();\n```\n\n```py\nchecked = await page.get_by_role(\"checkbox\").is_checked()\n```\n\n```py\nchecked = page.get_by_role(\"checkbox\").is_checked()\n```\n\n```csharp\nvar isChecked = await page.GetByRole(AriaRole.Checkbox).IsCheckedAsync();\n```\n","async":true,"alias":"isChecked","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"isDisabled","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Returns whether the element is disabled, the opposite of [enabled](../actionability.md#enabled)."},{"type":"note","noteType":"warning[Asserting disabled state]","text":"If you need to assert that an element is disabled, prefer [`method: LocatorAssertions.toBeDisabled`] to avoid flakiness. See [assertions guide](../test-assertions.md) for more details."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const disabled = await page.getByRole('button').isDisabled();"],"codeLang":"js"},{"type":"code","lines":["boolean disabled = page.getByRole(AriaRole.BUTTON).isDisabled();"],"codeLang":"java"},{"type":"code","lines":["disabled = await page.get_by_role(\"button\").is_disabled()"],"codeLang":"python async"},{"type":"code","lines":["disabled = page.get_by_role(\"button\").is_disabled()"],"codeLang":"python sync"},{"type":"code","lines":["Boolean disabled = await page.GetByRole(AriaRole.Button).IsDisabledAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Returns whether the element is disabled, the opposite of [enabled](../actionability.md#enabled).\n\n**NOTE** If you need to assert that an element is disabled, prefer [`method: LocatorAssertions.toBeDisabled`] to\navoid flakiness. See [assertions guide](../test-assertions.md) for more details.\n\n**Usage**\n\n```js\nconst disabled = await page.getByRole('button').isDisabled();\n```\n\n```java\nboolean disabled = page.getByRole(AriaRole.BUTTON).isDisabled();\n```\n\n```py\ndisabled = await page.get_by_role(\"button\").is_disabled()\n```\n\n```py\ndisabled = page.get_by_role(\"button\").is_disabled()\n```\n\n```csharp\nBoolean disabled = await page.GetByRole(AriaRole.Button).IsDisabledAsync();\n```\n","async":true,"alias":"isDisabled","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"isEditable","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Returns whether the element is [editable](../actionability.md#editable)."},{"type":"note","noteType":"warning[Asserting editable state]","text":"If you need to assert that an element is editable, prefer [`method: LocatorAssertions.toBeEditable`] to avoid flakiness. See [assertions guide](../test-assertions.md) for more details."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const editable = await page.getByRole('textbox').isEditable();"],"codeLang":"js"},{"type":"code","lines":["boolean editable = page.getByRole(AriaRole.TEXTBOX).isEditable();"],"codeLang":"java"},{"type":"code","lines":["editable = await page.get_by_role(\"textbox\").is_editable()"],"codeLang":"python async"},{"type":"code","lines":["editable = page.get_by_role(\"textbox\").is_editable()"],"codeLang":"python sync"},{"type":"code","lines":["Boolean editable = await page.GetByRole(AriaRole.Textbox).IsEditableAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Returns whether the element is [editable](../actionability.md#editable).\n\n**NOTE** If you need to assert that an element is editable, prefer [`method: LocatorAssertions.toBeEditable`] to\navoid flakiness. See [assertions guide](../test-assertions.md) for more details.\n\n**Usage**\n\n```js\nconst editable = await page.getByRole('textbox').isEditable();\n```\n\n```java\nboolean editable = page.getByRole(AriaRole.TEXTBOX).isEditable();\n```\n\n```py\neditable = await page.get_by_role(\"textbox\").is_editable()\n```\n\n```py\neditable = page.get_by_role(\"textbox\").is_editable()\n```\n\n```csharp\nBoolean editable = await page.GetByRole(AriaRole.Textbox).IsEditableAsync();\n```\n","async":true,"alias":"isEditable","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"isEnabled","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Returns whether the element is [enabled](../actionability.md#enabled)."},{"type":"note","noteType":"warning[Asserting enabled state]","text":"If you need to assert that an element is enabled, prefer [`method: LocatorAssertions.toBeEnabled`] to avoid flakiness. See [assertions guide](../test-assertions.md) for more details."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const enabled = await page.getByRole('button').isEnabled();"],"codeLang":"js"},{"type":"code","lines":["boolean enabled = page.getByRole(AriaRole.BUTTON).isEnabled();"],"codeLang":"java"},{"type":"code","lines":["enabled = await page.get_by_role(\"button\").is_enabled()"],"codeLang":"python async"},{"type":"code","lines":["enabled = page.get_by_role(\"button\").is_enabled()"],"codeLang":"python sync"},{"type":"code","lines":["Boolean enabled = await page.GetByRole(AriaRole.Button).IsEnabledAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Returns whether the element is [enabled](../actionability.md#enabled).\n\n**NOTE** If you need to assert that an element is enabled, prefer [`method: LocatorAssertions.toBeEnabled`] to\navoid flakiness. See [assertions guide](../test-assertions.md) for more details.\n\n**Usage**\n\n```js\nconst enabled = await page.getByRole('button').isEnabled();\n```\n\n```java\nboolean enabled = page.getByRole(AriaRole.BUTTON).isEnabled();\n```\n\n```py\nenabled = await page.get_by_role(\"button\").is_enabled()\n```\n\n```py\nenabled = page.get_by_role(\"button\").is_enabled()\n```\n\n```csharp\nBoolean enabled = await page.GetByRole(AriaRole.Button).IsEnabledAsync();\n```\n","async":true,"alias":"isEnabled","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"isHidden","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Returns whether the element is hidden, the opposite of [visible](../actionability.md#visible)."},{"type":"note","noteType":"warning[Asserting visibility]","text":"If you need to assert that element is hidden, prefer [`method: LocatorAssertions.toBeHidden`] to avoid flakiness. See [assertions guide](../test-assertions.md) for more details."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const hidden = await page.getByRole('button').isHidden();"],"codeLang":"js"},{"type":"code","lines":["boolean hidden = page.getByRole(AriaRole.BUTTON).isHidden();"],"codeLang":"java"},{"type":"code","lines":["hidden = await page.get_by_role(\"button\").is_hidden()"],"codeLang":"python async"},{"type":"code","lines":["hidden = page.get_by_role(\"button\").is_hidden()"],"codeLang":"python sync"},{"type":"code","lines":["Boolean hidden = await page.GetByRole(AriaRole.Button).IsHiddenAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Returns whether the element is hidden, the opposite of [visible](../actionability.md#visible).\n\n**NOTE** If you need to assert that element is hidden, prefer [`method: LocatorAssertions.toBeHidden`] to avoid\nflakiness. See [assertions guide](../test-assertions.md) for more details.\n\n**Usage**\n\n```js\nconst hidden = await page.getByRole('button').isHidden();\n```\n\n```java\nboolean hidden = page.getByRole(AriaRole.BUTTON).isHidden();\n```\n\n```py\nhidden = await page.get_by_role(\"button\").is_hidden()\n```\n\n```py\nhidden = page.get_by_role(\"button\").is_hidden()\n```\n\n```csharp\nBoolean hidden = await page.GetByRole(AriaRole.Button).IsHiddenAsync();\n```\n","async":true,"alias":"isHidden","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","deprecated":"This option is ignored. [`method: Locator.isHidden`] does not wait for the element to become hidden and returns immediately.","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[],"required":false,"comment":"","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"isVisible","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Returns whether the element is [visible](../actionability.md#visible)."},{"type":"note","noteType":"warning[Asserting visibility]","text":"If you need to assert that element is visible, prefer [`method: LocatorAssertions.toBeVisible`] to avoid flakiness. See [assertions guide](../test-assertions.md) for more details."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const visible = await page.getByRole('button').isVisible();"],"codeLang":"js"},{"type":"code","lines":["boolean visible = page.getByRole(AriaRole.BUTTON).isVisible();"],"codeLang":"java"},{"type":"code","lines":["visible = await page.get_by_role(\"button\").is_visible()"],"codeLang":"python async"},{"type":"code","lines":["visible = page.get_by_role(\"button\").is_visible()"],"codeLang":"python sync"},{"type":"code","lines":["Boolean visible = await page.GetByRole(AriaRole.Button).IsVisibleAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Returns whether the element is [visible](../actionability.md#visible).\n\n**NOTE** If you need to assert that element is visible, prefer [`method: LocatorAssertions.toBeVisible`] to avoid\nflakiness. See [assertions guide](../test-assertions.md) for more details.\n\n**Usage**\n\n```js\nconst visible = await page.getByRole('button').isVisible();\n```\n\n```java\nboolean visible = page.getByRole(AriaRole.BUTTON).isVisible();\n```\n\n```py\nvisible = await page.get_by_role(\"button\").is_visible()\n```\n\n```py\nvisible = page.get_by_role(\"button\").is_visible()\n```\n\n```csharp\nBoolean visible = await page.GetByRole(AriaRole.Button).IsVisibleAsync();\n```\n","async":true,"alias":"isVisible","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","deprecated":"This option is ignored. [`method: Locator.isVisible`] does not wait for the element to become visible and returns immediately.","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[],"required":false,"comment":"","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"last","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Returns locator to the last matching element."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const banana = await page.getByRole('listitem').last();"],"codeLang":"js"},{"type":"code","lines":["banana = await page.get_by_role(\"listitem\").last"],"codeLang":"python async"},{"type":"code","lines":["banana = page.get_by_role(\"listitem\").last"],"codeLang":"python sync"},{"type":"code","lines":["Locator banana = page.getByRole(AriaRole.LISTITEM).last();"],"codeLang":"java"},{"type":"code","lines":["var banana = await page.GetByRole(AriaRole.Listitem).Last(1);"],"codeLang":"csharp"}],"required":true,"comment":"Returns locator to the last matching element.\n\n**Usage**\n\n```js\nconst banana = await page.getByRole('listitem').last();\n```\n\n```py\nbanana = await page.get_by_role(\"listitem\").last\n```\n\n```py\nbanana = page.get_by_role(\"listitem\").last\n```\n\n```java\nLocator banana = page.getByRole(AriaRole.LISTITEM).last();\n```\n\n```csharp\nvar banana = await page.GetByRole(AriaRole.Listitem).Last(1);\n```\n","async":false,"alias":"last","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.14","name":"locator","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"The method finds an element matching the specified selector in the locator's subtree. It also accepts filter options, similar to [`method: Locator.filter`] method."},{"type":"text","text":"[Learn more about locators](../locators.md)."}],"required":true,"comment":"The method finds an element matching the specified selector in the locator's subtree. It also accepts filter\noptions, similar to [`method: Locator.filter`] method.\n\n[Learn more about locators](../locators.md).","async":false,"alias":"locator","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.14","name":"selectorOrLocator","type":{"name":"","union":[{"name":"string"},{"name":"Locator"}],"expression":"[string]|[Locator]"},"spec":[{"type":"text","text":"A selector or locator to use when resolving DOM element."}],"required":true,"comment":"A selector or locator to use when resolving DOM element.","async":false,"alias":"selectorOrLocator","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"has","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"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>`."},{"type":"text","text":"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`."},{"type":"text","text":"Note that outer and inner locators must belong to the same frame. Inner locator must not contain `FrameLocator`s."}],"required":false,"comment":"Narrows down the results of the method to those which contain elements matching this relative locator. For example,\n`article` that has `text=Playwright` matches `<article><div>Playwright</div></article>`.\n\nInner locator **must be relative** to the outer locator and is queried starting with the outer locator match, not\nthe document root. For example, you can find `content` that has `div` in\n`<article><content><div>Playwright</div></content></article>`. However, looking for `content` that has `article\ndiv` will fail, because the inner locator must be relative and should not use any elements outside the `content`.\n\nNote that outer and inner locators must belong to the same frame. Inner locator must not contain `FrameLocator`s.","async":false,"alias":"has","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.33","name":"hasNot","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"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>`."},{"type":"text","text":"Note that outer and inner locators must belong to the same frame. Inner locator must not contain `FrameLocator`s."}],"required":false,"comment":"Matches elements that do not contain an element that matches an inner locator. Inner locator is queried against the\nouter one. For example, `article` that does not have `div` matches `<article><span>Playwright</span></article>`.\n\nNote that outer and inner locators must belong to the same frame. Inner locator must not contain `FrameLocator`s.","async":false,"alias":"hasNot","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.33","name":"hasNotText","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Matches elements that do not contain specified text somewhere inside, possibly in a child or a descendant element.\nWhen passed a [string], matching is case-insensitive and searches for a substring.","async":false,"alias":"hasNotText","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"hasText","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"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>`."}],"required":false,"comment":"Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When\npassed a [string], matching is case-insensitive and searches for a substring. For example, `\"Playwright\"` matches\n`<article><div>Playwright</div></article>`.","async":false,"alias":"hasText","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"nth","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Returns locator to the n-th matching element. It's zero based, `nth(0)` selects the first element."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const banana = await page.getByRole('listitem').nth(2);"],"codeLang":"js"},{"type":"code","lines":["banana = await page.get_by_role(\"listitem\").nth(2)"],"codeLang":"python async"},{"type":"code","lines":["banana = page.get_by_role(\"listitem\").nth(2)"],"codeLang":"python sync"},{"type":"code","lines":["Locator banana = page.getByRole(AriaRole.LISTITEM).nth(2);"],"codeLang":"java"},{"type":"code","lines":["var banana = await page.GetByRole(AriaRole.Listitem).Nth(2);"],"codeLang":"csharp"}],"required":true,"comment":"Returns locator to the n-th matching element. It's zero based, `nth(0)` selects the first element.\n\n**Usage**\n\n```js\nconst banana = await page.getByRole('listitem').nth(2);\n```\n\n```py\nbanana = await page.get_by_role(\"listitem\").nth(2)\n```\n\n```py\nbanana = page.get_by_role(\"listitem\").nth(2)\n```\n\n```java\nLocator banana = page.getByRole(AriaRole.LISTITEM).nth(2);\n```\n\n```csharp\nvar banana = await page.GetByRole(AriaRole.Listitem).Nth(2);\n```\n","async":false,"alias":"nth","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.14","name":"index","type":{"name":"int","expression":"[int]"},"spec":[],"required":true,"comment":"","async":false,"alias":"index","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"python":"or_"},"types":{},"overrides":{}},"since":"v1.33","name":"or","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Creates a locator that matches either of the two locators."},{"type":"text","text":"**Usage**"},{"type":"text","text":"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."},{"type":"code","lines":["const newEmail = page.getByRole('button', { name: 'New' });","const dialog = page.getByText('Confirm security settings');","await expect(newEmail.or(dialog)).toBeVisible();","if (await dialog.isVisible())"," await page.getByRole('button', { name: 'Dismiss' }).click();","await newEmail.click();"],"codeLang":"js"},{"type":"code","lines":["Locator newEmail = page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName(\"New\"));","Locator dialog = page.getByText(\"Confirm security settings\");","assertThat(newEmail.or(dialog)).isVisible();","if (dialog.isVisible())"," page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName(\"Dismiss\")).click();","newEmail.click();"],"codeLang":"java"},{"type":"code","lines":["new_email = page.get_by_role(\"button\", name=\"New\")","dialog = page.get_by_text(\"Confirm security settings\")","await expect(new_email.or_(dialog)).to_be_visible()","if (await dialog.is_visible()):"," await page.get_by_role(\"button\", name=\"Dismiss\").click()","await new_email.click()"],"codeLang":"python async"},{"type":"code","lines":["new_email = page.get_by_role(\"button\", name=\"New\")","dialog = page.get_by_text(\"Confirm security settings\")","expect(new_email.or_(dialog)).to_be_visible()","if (dialog.is_visible()):"," page.get_by_role(\"button\", name=\"Dismiss\").click()","new_email.click()"],"codeLang":"python sync"},{"type":"code","lines":["var newEmail = page.GetByRole(AriaRole.Button, new() { Name = \"New\" });","var dialog = page.GetByText(\"Confirm security settings\");","await Expect(newEmail.Or(dialog)).ToBeVisibleAsync();","if (await dialog.IsVisibleAsync())"," await page.GetByRole(AriaRole.Button, new() { Name = \"Dismiss\" }).ClickAsync();","await newEmail.ClickAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Creates a locator that matches either of the two locators.\n\n**Usage**\n\nConsider a scenario where you'd like to click on a \"New email\" button, but sometimes a security settings dialog\nshows up instead. In this case, you can wait for either a \"New email\" button, or a dialog and act accordingly.\n\n```js\nconst newEmail = page.getByRole('button', { name: 'New' });\nconst dialog = page.getByText('Confirm security settings');\nawait expect(newEmail.or(dialog)).toBeVisible();\nif (await dialog.isVisible())\n await page.getByRole('button', { name: 'Dismiss' }).click();\nawait newEmail.click();\n```\n\n```java\nLocator newEmail = page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName(\"New\"));\nLocator dialog = page.getByText(\"Confirm security settings\");\nassertThat(newEmail.or(dialog)).isVisible();\nif (dialog.isVisible())\n page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName(\"Dismiss\")).click();\nnewEmail.click();\n```\n\n```py\nnew_email = page.get_by_role(\"button\", name=\"New\")\ndialog = page.get_by_text(\"Confirm security settings\")\nawait expect(new_email.or_(dialog)).to_be_visible()\nif (await dialog.is_visible()):\n await page.get_by_role(\"button\", name=\"Dismiss\").click()\nawait new_email.click()\n```\n\n```py\nnew_email = page.get_by_role(\"button\", name=\"New\")\ndialog = page.get_by_text(\"Confirm security settings\")\nexpect(new_email.or_(dialog)).to_be_visible()\nif (dialog.is_visible()):\n page.get_by_role(\"button\", name=\"Dismiss\").click()\nnew_email.click()\n```\n\n```csharp\nvar newEmail = page.GetByRole(AriaRole.Button, new() { Name = \"New\" });\nvar dialog = page.GetByText(\"Confirm security settings\");\nawait Expect(newEmail.Or(dialog)).ToBeVisibleAsync();\nif (await dialog.IsVisibleAsync())\n await page.GetByRole(AriaRole.Button, new() { Name = \"Dismiss\" }).ClickAsync();\nawait newEmail.ClickAsync();\n```\n","async":false,"alias":"or","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.33","name":"locator","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Alternative locator to match."}],"required":true,"comment":"Alternative locator to match.","async":false,"alias":"locator","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.19","name":"page","type":{"name":"Page","expression":"[Page]"},"spec":[{"type":"text","text":"A page this locator belongs to."}],"required":true,"comment":"A page this locator belongs to.","async":false,"alias":"page","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.14","name":"press","type":{"name":"void"},"spec":[{"type":"text","text":"Focuses the matching element and presses a combination of the keys."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.getByRole('textbox').press('Backspace');"],"codeLang":"js"},{"type":"code","lines":["page.getByRole(AriaRole.TEXTBOX).press(\"Backspace\");"],"codeLang":"java"},{"type":"code","lines":["await page.get_by_role(\"textbox\").press(\"Backspace\")"],"codeLang":"python async"},{"type":"code","lines":["page.get_by_role(\"textbox\").press(\"Backspace\")"],"codeLang":"python sync"},{"type":"code","lines":["await page.GetByRole(AriaRole.Textbox).PressAsync(\"Backspace\");"],"codeLang":"csharp"},{"type":"text","text":"**Details**"},{"type":"text","text":"Focuses the element, and then uses [`method: Keyboard.down`] and [`method: Keyboard.up`]."},{"type":"text","text":"`key` can specify the intended↵[keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) value or a single character to↵generate the text for. A superset of the `key` values can be found↵[here](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values). Examples of the keys are:"},{"type":"text","text":"`F1` - `F12`, `Digit0`- `Digit9`, `KeyA`- `KeyZ`, `Backquote`, `Minus`, `Equal`, `Backslash`, `Backspace`, `Tab`,↵`Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`, etc."},{"type":"text","text":"Following modification shortcuts are also supported: `Shift`, `Control`, `Alt`, `Meta`, `ShiftLeft`, `ControlOrMeta`.↵`ControlOrMeta` resolves to `Control` on Windows and Linux and to `Meta` on macOS."},{"type":"text","text":"Holding down `Shift` will type the text that corresponds to the `key` in the upper case."},{"type":"text","text":"If `key` is a single character, it is case-sensitive, so the values `a` and `A` will generate different↵respective texts."},{"type":"text","text":"Shortcuts such as `key: \"Control+o\"`, `key: \"Control++` or `key: \"Control+Shift+T\"` are supported as well. When specified with the↵modifier, modifier is pressed and being held while the subsequent key is being pressed."}],"required":true,"comment":"Focuses the matching element and presses a combination of the keys.\n\n**Usage**\n\n```js\nawait page.getByRole('textbox').press('Backspace');\n```\n\n```java\npage.getByRole(AriaRole.TEXTBOX).press(\"Backspace\");\n```\n\n```py\nawait page.get_by_role(\"textbox\").press(\"Backspace\")\n```\n\n```py\npage.get_by_role(\"textbox\").press(\"Backspace\")\n```\n\n```csharp\nawait page.GetByRole(AriaRole.Textbox).PressAsync(\"Backspace\");\n```\n\n**Details**\n\nFocuses the element, and then uses [`method: Keyboard.down`] and [`method: Keyboard.up`].\n\n`key` can specify the intended\n[keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) value or a single character\nto generate the text for. A superset of the `key` values can be found\n[here](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values). Examples of the keys are:\n\n`F1` - `F12`, `Digit0`- `Digit9`, `KeyA`- `KeyZ`, `Backquote`, `Minus`, `Equal`, `Backslash`, `Backspace`, `Tab`,\n`Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`,\netc.\n\nFollowing modification shortcuts are also supported: `Shift`, `Control`, `Alt`, `Meta`, `ShiftLeft`,\n`ControlOrMeta`. `ControlOrMeta` resolves to `Control` on Windows and Linux and to `Meta` on macOS.\n\nHolding down `Shift` will type the text that corresponds to the `key` in the upper case.\n\nIf `key` is a single character, it is case-sensitive, so the values `a` and `A` will generate different respective\ntexts.\n\nShortcuts such as `key: \"Control+o\"`, `key: \"Control++` or `key: \"Control+Shift+T\"` are supported as well. When\nspecified with the modifier, modifier is pressed and being held while the subsequent key is being pressed.","async":true,"alias":"press","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.14","name":"key","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Name of the key to press or a character to generate, such as `ArrowLeft` or `a`."}],"required":true,"comment":"Name of the key to press or a character to generate, such as `ArrowLeft` or `a`.","async":false,"alias":"key","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"delay","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0."}],"required":false,"comment":"Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.","async":false,"alias":"delay","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.38","name":"pressSequentially","type":{"name":"void"},"spec":[{"type":"note","noteType":"tip","text":"In most cases, you should use [`method: Locator.fill`] instead. You only need to press keys one by one if there is special keyboard handling on the page."},{"type":"text","text":"Focuses the element, and then sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text."},{"type":"text","text":"To press a special key, like `Control` or `ArrowDown`, use [`method: Locator.press`]."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await locator.pressSequentially('Hello'); // Types instantly","await locator.pressSequentially('World', { delay: 100 }); // Types slower, like a user"],"codeLang":"js"},{"type":"code","lines":["locator.pressSequentially(\"Hello\"); // Types instantly","locator.pressSequentially(\"World\", new Locator.pressSequentiallyOptions().setDelay(100)); // Types slower, like a user"],"codeLang":"java"},{"type":"code","lines":["await locator.press_sequentially(\"hello\") # types instantly","await locator.press_sequentially(\"world\", delay=100) # types slower, like a user"],"codeLang":"python async"},{"type":"code","lines":["locator.press_sequentially(\"hello\") # types instantly","locator.press_sequentially(\"world\", delay=100) # types slower, like a user"],"codeLang":"python sync"},{"type":"code","lines":["await locator.PressSequentiallyAsync(\"Hello\"); // Types instantly","await locator.PressSequentiallyAsync(\"World\", new() { Delay = 100 }); // Types slower, like a user"],"codeLang":"csharp"},{"type":"text","text":"An example of typing into a text field and then submitting the form:"},{"type":"code","lines":["const locator = page.getByLabel('Password');","await locator.pressSequentially('my password');","await locator.press('Enter');"],"codeLang":"js"},{"type":"code","lines":["Locator locator = page.getByLabel(\"Password\");","locator.pressSequentially(\"my password\");","locator.press(\"Enter\");"],"codeLang":"java"},{"type":"code","lines":["locator = page.get_by_label(\"Password\")","await locator.press_sequentially(\"my password\")","await locator.press(\"Enter\")"],"codeLang":"python async"},{"type":"code","lines":["locator = page.get_by_label(\"Password\")","locator.press_sequentially(\"my password\")","locator.press(\"Enter\")"],"codeLang":"python sync"},{"type":"code","lines":["var locator = page.GetByLabel(\"Password\");","await locator.PressSequentiallyAsync(\"my password\");","await locator.PressAsync(\"Enter\");"],"codeLang":"csharp"}],"required":true,"comment":"**NOTE** In most cases, you should use [`method: Locator.fill`] instead. You only need to press keys one by one if\nthere is special keyboard handling on the page.\n\nFocuses the element, and then sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the\ntext.\n\nTo press a special key, like `Control` or `ArrowDown`, use [`method: Locator.press`].\n\n**Usage**\n\n```js\nawait locator.pressSequentially('Hello'); // Types instantly\nawait locator.pressSequentially('World', { delay: 100 }); // Types slower, like a user\n```\n\n```java\nlocator.pressSequentially(\"Hello\"); // Types instantly\nlocator.pressSequentially(\"World\", new Locator.pressSequentiallyOptions().setDelay(100)); // Types slower, like a user\n```\n\n```py\nawait locator.press_sequentially(\"hello\") # types instantly\nawait locator.press_sequentially(\"world\", delay=100) # types slower, like a user\n```\n\n```py\nlocator.press_sequentially(\"hello\") # types instantly\nlocator.press_sequentially(\"world\", delay=100) # types slower, like a user\n```\n\n```csharp\nawait locator.PressSequentiallyAsync(\"Hello\"); // Types instantly\nawait locator.PressSequentiallyAsync(\"World\", new() { Delay = 100 }); // Types slower, like a user\n```\n\nAn example of typing into a text field and then submitting the form:\n\n```js\nconst locator = page.getByLabel('Password');\nawait locator.pressSequentially('my password');\nawait locator.press('Enter');\n```\n\n```java\nLocator locator = page.getByLabel(\"Password\");\nlocator.pressSequentially(\"my password\");\nlocator.press(\"Enter\");\n```\n\n```py\nlocator = page.get_by_label(\"Password\")\nawait locator.press_sequentially(\"my password\")\nawait locator.press(\"Enter\")\n```\n\n```py\nlocator = page.get_by_label(\"Password\")\nlocator.press_sequentially(\"my password\")\nlocator.press(\"Enter\")\n```\n\n```csharp\nvar locator = page.GetByLabel(\"Password\");\nawait locator.PressSequentiallyAsync(\"my password\");\nawait locator.PressAsync(\"Enter\");\n```\n","async":true,"alias":"pressSequentially","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.38","name":"text","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"String of characters to sequentially press into a focused element."}],"required":true,"comment":"String of characters to sequentially press into a focused element.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.38","name":"delay","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to wait between key presses in milliseconds. Defaults to 0."}],"required":false,"comment":"Time to wait between key presses in milliseconds. Defaults to 0.","async":false,"alias":"delay","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.38","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.38","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.38","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"screenshot","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"Take a screenshot of the element matching the locator."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.getByRole('link').screenshot();"],"codeLang":"js"},{"type":"code","lines":["page.getByRole(AriaRole.LINK).screenshot();"],"codeLang":"java"},{"type":"code","lines":["await page.get_by_role(\"link\").screenshot()"],"codeLang":"python async"},{"type":"code","lines":["page.get_by_role(\"link\").screenshot()"],"codeLang":"python sync"},{"type":"code","lines":["await page.GetByRole(AriaRole.Link).ScreenshotAsync();"],"codeLang":"csharp"},{"type":"text","text":"Disable animations and save screenshot to a file:"},{"type":"code","lines":["await page.getByRole('link').screenshot({ animations: 'disabled', path: 'link.png' });"],"codeLang":"js"},{"type":"code","lines":["page.getByRole(AriaRole.LINK).screenshot(new Locator.ScreenshotOptions()"," .setAnimations(ScreenshotAnimations.DISABLED)"," .setPath(Paths.get(\"example.png\")));"],"codeLang":"java"},{"type":"code","lines":["await page.get_by_role(\"link\").screenshot(animations=\"disabled\", path=\"link.png\")"],"codeLang":"python async"},{"type":"code","lines":["page.get_by_role(\"link\").screenshot(animations=\"disabled\", path=\"link.png\")"],"codeLang":"python sync"},{"type":"code","lines":["await page.GetByRole(AriaRole.Link).ScreenshotAsync(new() {"," Animations = ScreenshotAnimations.Disabled,"," Path = \"link.png\"","});"],"codeLang":"csharp"},{"type":"text","text":"**Details**"},{"type":"text","text":"This method captures a screenshot of the page, clipped to the size and position of a particular element matching the locator. If the element is covered by other elements, it will not be actually visible on the screenshot. If the element is a scrollable container, only the currently scrolled content will be visible on the screenshot."},{"type":"text","text":"This method waits for the [actionability](../actionability.md) checks, then scrolls element into view before taking a↵screenshot. If the element is detached from DOM, the method throws an error."},{"type":"text","text":"Returns the buffer with the captured screenshot."}],"required":true,"comment":"Take a screenshot of the element matching the locator.\n\n**Usage**\n\n```js\nawait page.getByRole('link').screenshot();\n```\n\n```java\npage.getByRole(AriaRole.LINK).screenshot();\n```\n\n```py\nawait page.get_by_role(\"link\").screenshot()\n```\n\n```py\npage.get_by_role(\"link\").screenshot()\n```\n\n```csharp\nawait page.GetByRole(AriaRole.Link).ScreenshotAsync();\n```\n\nDisable animations and save screenshot to a file:\n\n```js\nawait page.getByRole('link').screenshot({ animations: 'disabled', path: 'link.png' });\n```\n\n```java\npage.getByRole(AriaRole.LINK).screenshot(new Locator.ScreenshotOptions()\n .setAnimations(ScreenshotAnimations.DISABLED)\n .setPath(Paths.get(\"example.png\")));\n```\n\n```py\nawait page.get_by_role(\"link\").screenshot(animations=\"disabled\", path=\"link.png\")\n```\n\n```py\npage.get_by_role(\"link\").screenshot(animations=\"disabled\", path=\"link.png\")\n```\n\n```csharp\nawait page.GetByRole(AriaRole.Link).ScreenshotAsync(new() {\n Animations = ScreenshotAnimations.Disabled,\n Path = \"link.png\"\n});\n```\n\n**Details**\n\nThis method captures a screenshot of the page, clipped to the size and position of a particular element matching\nthe locator. If the element is covered by other elements, it will not be actually visible on the screenshot. If the\nelement is a scrollable container, only the currently scrolled content will be visible on the screenshot.\n\nThis method waits for the [actionability](../actionability.md) checks, then scrolls element into view before taking\na screenshot. If the element is detached from DOM, the method throws an error.\n\nReturns the buffer with the captured screenshot.","async":true,"alias":"screenshot","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"animations","type":{"name":"ScreenshotAnimations","union":[{"name":"\"disabled\""},{"name":"\"allow\""}],"expression":"[ScreenshotAnimations]<\"disabled\"|\"allow\">"},"spec":[{"type":"text","text":"When set to `\"disabled\"`, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment depending on their duration:"},{"type":"li","text":"finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.","liType":"bullet"},{"type":"li","text":"infinite animations are canceled to initial state, and then played over after the screenshot.","liType":"bullet"},{"type":"text","text":"Defaults to `\"allow\"` that leaves animations untouched."}],"required":false,"comment":"When set to `\"disabled\"`, stops CSS animations, CSS transitions and Web Animations. Animations get different\ntreatment depending on their duration:\n- finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.\n- infinite animations are canceled to initial state, and then played over after the screenshot.\n\nDefaults to `\"allow\"` that leaves animations untouched.","async":false,"alias":"animations","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"caret","type":{"name":"ScreenshotCaret","union":[{"name":"\"hide\""},{"name":"\"initial\""}],"expression":"[ScreenshotCaret]<\"hide\"|\"initial\">"},"spec":[{"type":"text","text":"When set to `\"hide\"`, screenshot will hide text caret. When set to `\"initial\"`, text caret behavior will not be changed. Defaults to `\"hide\"`."}],"required":false,"comment":"When set to `\"hide\"`, screenshot will hide text caret. When set to `\"initial\"`, text caret behavior will not be\nchanged. Defaults to `\"hide\"`.","async":false,"alias":"caret","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"mask","type":{"name":"Array","templates":[{"name":"Locator"}],"expression":"[Array]<[Locator]>"},"spec":[{"type":"text","text":"Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with↵a pink box `#FF00FF` (customized by `maskColor`) that completely covers its bounding box."}],"required":false,"comment":"Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink\nbox `#FF00FF` (customized by `maskColor`) that completely covers its bounding box.","async":false,"alias":"mask","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.35","name":"maskColor","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Specify the color of the overlay box for masked elements, in [CSS color format](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value). Default color is pink `#FF00FF`."}],"required":false,"comment":"Specify the color of the overlay box for masked elements, in\n[CSS color format](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value). Default color is pink `#FF00FF`.","async":false,"alias":"maskColor","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"omitBackground","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images.↵Defaults to `false`."}],"required":false,"comment":"Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images.\nDefaults to `false`.","async":false,"alias":"omitBackground","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a↵relative path, then it is resolved relative to the current working directory. If no path is provided, the image won't be↵saved to the disk."}],"required":false,"comment":"The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a\nrelative path, then it is resolved relative to the current working directory. If no path is provided, the image\nwon't be saved to the disk.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"quality","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"The quality of the image, between 0-100. Not applicable to `png` images."}],"required":false,"comment":"The quality of the image, between 0-100. Not applicable to `png` images.","async":false,"alias":"quality","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"scale","type":{"name":"ScreenshotScale","union":[{"name":"\"css\""},{"name":"\"device\""}],"expression":"[ScreenshotScale]<\"css\"|\"device\">"},"spec":[{"type":"text","text":"When set to `\"css\"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this will keep screenshots small. Using `\"device\"` option will produce a single pixel per each device pixel, so screenshots of high-dpi devices will be twice as large or even larger."},{"type":"text","text":"Defaults to `\"device\"`."}],"required":false,"comment":"When set to `\"css\"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this\nwill keep screenshots small. Using `\"device\"` option will produce a single pixel per each device pixel, so\nscreenshots of high-dpi devices will be twice as large or even larger.\n\nDefaults to `\"device\"`.","async":false,"alias":"scale","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.41","name":"style","type":{"name":"string","expression":"string"},"spec":[{"type":"text","text":"Text of the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make elements invisible↵or change their properties to help you creating repeatable screenshots. This stylesheet pierces the Shadow DOM and applies↵to the inner frames."}],"required":false,"comment":"Text of the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make\nelements invisible or change their properties to help you creating repeatable screenshots. This stylesheet pierces\nthe Shadow DOM and applies to the inner frames.","async":false,"alias":"style","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"type","type":{"name":"ScreenshotType","union":[{"name":"\"png\""},{"name":"\"jpeg\""}],"expression":"[ScreenshotType]<\"png\"|\"jpeg\">"},"spec":[{"type":"text","text":"Specify screenshot type, defaults to `png`."}],"required":false,"comment":"Specify screenshot type, defaults to `png`.","async":false,"alias":"type","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"scrollIntoViewIfNeeded","type":{"name":"void"},"spec":[{"type":"text","text":"This method waits for [actionability](../actionability.md) checks, then tries to scroll element into view, unless it is↵completely visible as defined by↵[IntersectionObserver](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API)'s `ratio`."},{"type":"text","text":"See [scrolling](../input.md#scrolling) for alternative ways to scroll."}],"required":true,"comment":"This method waits for [actionability](../actionability.md) checks, then tries to scroll element into view, unless\nit is completely visible as defined by\n[IntersectionObserver](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API)'s `ratio`.\n\nSee [scrolling](../input.md#scrolling) for alternative ways to scroll.","async":true,"alias":"scrollIntoViewIfNeeded","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"selectOption","type":{"name":"Array","templates":[{"name":"string"}],"expression":"[Array]<[string]>"},"spec":[{"type":"text","text":"Selects option or options in `<select>`."},{"type":"text","text":"**Details**"},{"type":"text","text":"This method waits for [actionability](../actionability.md) checks, waits until all specified options are present in the `<select>` element and selects these options."},{"type":"text","text":"If the target element is not a `<select>` element, this method throws an error. However, if the element is inside the `<label>` element that has an associated [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be used instead."},{"type":"text","text":"Returns the array of option values that have been successfully selected."},{"type":"text","text":"Triggers a `change` and `input` event once all the provided options have been selected."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["<select multiple>"," <option value=\"red\">Red</div>"," <option value=\"green\">Green</div>"," <option value=\"blue\">Blue</div>","</select>"],"codeLang":"html"},{"type":"code","lines":["// single selection matching the value or label","element.selectOption('blue');","","// single selection matching the label","element.selectOption({ label: 'Blue' });","","// multiple selection for red, green and blue options","element.selectOption(['red', 'green', 'blue']);"],"codeLang":"js"},{"type":"code","lines":["// single selection matching the value or label","element.selectOption(\"blue\");","// single selection matching the label","element.selectOption(new SelectOption().setLabel(\"Blue\"));","// multiple selection for blue, red and second option","element.selectOption(new String[] {\"red\", \"green\", \"blue\"});"],"codeLang":"java"},{"type":"code","lines":["# single selection matching the value or label","await element.select_option(\"blue\")","# single selection matching the label","await element.select_option(label=\"blue\")","# multiple selection for blue, red and second option","await element.select_option(value=[\"red\", \"green\", \"blue\"])"],"codeLang":"python async"},{"type":"code","lines":["# single selection matching the value or label","element.select_option(\"blue\")","# single selection matching the label","element.select_option(label=\"blue\")","# multiple selection for blue, red and second option","element.select_option(value=[\"red\", \"green\", \"blue\"])"],"codeLang":"python sync"},{"type":"code","lines":["// single selection matching the value or label","await element.SelectOptionAsync(new[] { \"blue\" });","// single selection matching the label","await element.SelectOptionAsync(new[] { new SelectOptionValue() { Label = \"blue\" } });","// multiple selection for blue, red and second option","await element.SelectOptionAsync(new[] { \"red\", \"green\", \"blue\" });"],"codeLang":"csharp"}],"required":true,"comment":"Selects option or options in `<select>`.\n\n**Details**\n\nThis method waits for [actionability](../actionability.md) checks, waits until all specified options are present in\nthe `<select>` element and selects these options.\n\nIf the target element is not a `<select>` element, this method throws an error. However, if the element is inside\nthe `<label>` element that has an associated\n[control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be used\ninstead.\n\nReturns the array of option values that have been successfully selected.\n\nTriggers a `change` and `input` event once all the provided options have been selected.\n\n**Usage**\n\n```html\n<select multiple>\n <option value=\"red\">Red</div>\n <option value=\"green\">Green</div>\n <option value=\"blue\">Blue</div>\n</select>\n```\n\n```js\n// single selection matching the value or label\nelement.selectOption('blue');\n\n// single selection matching the label\nelement.selectOption({ label: 'Blue' });\n\n// multiple selection for red, green and blue options\nelement.selectOption(['red', 'green', 'blue']);\n```\n\n```java\n// single selection matching the value or label\nelement.selectOption(\"blue\");\n// single selection matching the label\nelement.selectOption(new SelectOption().setLabel(\"Blue\"));\n// multiple selection for blue, red and second option\nelement.selectOption(new String[] {\"red\", \"green\", \"blue\"});\n```\n\n```py\n# single selection matching the value or label\nawait element.select_option(\"blue\")\n# single selection matching the label\nawait element.select_option(label=\"blue\")\n# multiple selection for blue, red and second option\nawait element.select_option(value=[\"red\", \"green\", \"blue\"])\n```\n\n```py\n# single selection matching the value or label\nelement.select_option(\"blue\")\n# single selection matching the label\nelement.select_option(label=\"blue\")\n# multiple selection for blue, red and second option\nelement.select_option(value=[\"red\", \"green\", \"blue\"])\n```\n\n```csharp\n// single selection matching the value or label\nawait element.SelectOptionAsync(new[] { \"blue\" });\n// single selection matching the label\nawait element.SelectOptionAsync(new[] { new SelectOptionValue() { Label = \"blue\" } });\n// multiple selection for blue, red and second option\nawait element.SelectOptionAsync(new[] { \"red\", \"green\", \"blue\" });\n```\n","async":true,"alias":"selectOption","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["java","js","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"values","type":{"name":"","union":[{"name":"null"},{"name":"string"},{"name":"ElementHandle"},{"name":"Array","templates":[{"name":"string"}]},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Matches by `option.value`. Optional."}],"required":false,"comment":"Matches by `option.value`. Optional.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"label","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Matches by `option.label`. Optional."}],"required":false,"comment":"Matches by `option.label`. Optional.","async":false,"alias":"label","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"index","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Matches by the index. Optional."}],"required":false,"comment":"Matches by the index. Optional.","async":false,"alias":"index","overloadIndex":0,"paramOrOption":null}]},{"name":"Array","templates":[{"name":"ElementHandle"}]},{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Matches by `option.value`. Optional."}],"required":false,"comment":"Matches by `option.value`. Optional.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"label","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Matches by `option.label`. Optional."}],"required":false,"comment":"Matches by `option.label`. Optional.","async":false,"alias":"label","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"index","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Matches by the index. Optional."}],"required":false,"comment":"Matches by the index. Optional.","async":false,"alias":"index","overloadIndex":0,"paramOrOption":null}]}]}],"expression":"[null]|[string]|[ElementHandle]|[Array]<[string]>|[Object]|[Array]<[ElementHandle]>|[Array]<[Object]>"},"spec":[{"type":"text","text":"Options to select. If the `<select>` has the `multiple` attribute, all matching options are selected, otherwise only the↵first option matching one of the passed options is selected. String values are matching both values and labels. Option↵is considered matching if all specified properties match."}],"required":true,"comment":"Options to select. If the `<select>` has the `multiple` attribute, all matching options are selected, otherwise\nonly the first option matching one of the passed options is selected. String values are matching both values and\nlabels. Option is considered matching if all specified properties match.","async":false,"alias":"values","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"element","type":{"name":"","union":[{"name":"ElementHandle"},{"name":"Array","templates":[{"name":"ElementHandle"}]}],"expression":"[ElementHandle]|[Array]<[ElementHandle]>"},"spec":[{"type":"text","text":"Option elements to select. Optional."}],"required":false,"comment":"Option elements to select. Optional.","async":false,"alias":"element","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"index","type":{"name":"","union":[{"name":"int"},{"name":"Array","templates":[{"name":"int"}]}],"expression":"[int]|[Array]<[int]>"},"spec":[{"type":"text","text":"Options to select by index. Optional."}],"required":false,"comment":"Options to select by index. Optional.","async":false,"alias":"index","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"value","type":{"name":"","union":[{"name":"string"},{"name":"Array","templates":[{"name":"string"}]}],"expression":"[string]|[Array]<[string]>"},"spec":[{"type":"text","text":"Options to select by value. If the `<select>` has the `multiple` attribute, all given options are selected, otherwise↵only the first option matching one of the passed options is selected. Optional."}],"required":false,"comment":"Options to select by value. If the `<select>` has the `multiple` attribute, all given options are selected,\notherwise only the first option matching one of the passed options is selected. Optional.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"label","type":{"name":"","union":[{"name":"string"},{"name":"Array","templates":[{"name":"string"}]}],"expression":"[string]|[Array]<[string]>"},"spec":[{"type":"text","text":"Options to select by label. If the `<select>` has the `multiple` attribute, all given options are selected, otherwise↵only the first option matching one of the passed options is selected. Optional."}],"required":false,"comment":"Options to select by label. If the `<select>` has the `multiple` attribute, all given options are selected,\notherwise only the first option matching one of the passed options is selected. Optional.","async":false,"alias":"label","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"selectText","type":{"name":"void"},"spec":[{"type":"text","text":"This method waits for [actionability](../actionability.md) checks, then focuses the element and selects all its text↵content."},{"type":"text","text":"If the element is inside the `<label>` element that has an associated [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), focuses and selects text in the control instead."}],"required":true,"comment":"This method waits for [actionability](../actionability.md) checks, then focuses the element and selects all its\ntext content.\n\nIf the element is inside the `<label>` element that has an associated\n[control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), focuses and selects text in\nthe control instead.","async":true,"alias":"selectText","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.15","name":"setChecked","type":{"name":"void"},"spec":[{"type":"text","text":"Set the state of a checkbox or a radio element."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.getByRole('checkbox').setChecked(true);"],"codeLang":"js"},{"type":"code","lines":["page.getByRole(AriaRole.CHECKBOX).setChecked(true);"],"codeLang":"java"},{"type":"code","lines":["await page.get_by_role(\"checkbox\").set_checked(True)"],"codeLang":"python async"},{"type":"code","lines":["page.get_by_role(\"checkbox\").set_checked(True)"],"codeLang":"python sync"},{"type":"code","lines":["await page.GetByRole(AriaRole.Checkbox).SetCheckedAsync(true);"],"codeLang":"csharp"},{"type":"text","text":"**Details**"},{"type":"text","text":"This method checks or unchecks an element by performing the following steps:"},{"type":"li","text":"Ensure that matched element is a checkbox or a radio input. If not, this method throws.","liType":"ordinal"},{"type":"li","text":"If the element already has the right checked state, this method returns immediately.","liType":"ordinal"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is↵set. If the element is detached during the checks, the whole action is retried.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.mouse`] to click in the center of the element.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.","liType":"ordinal"},{"type":"li","text":"Ensure that the element is now checked or unchecked. If not, this method throws.","liType":"ordinal"},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."}],"required":true,"comment":"Set the state of a checkbox or a radio element.\n\n**Usage**\n\n```js\nawait page.getByRole('checkbox').setChecked(true);\n```\n\n```java\npage.getByRole(AriaRole.CHECKBOX).setChecked(true);\n```\n\n```py\nawait page.get_by_role(\"checkbox\").set_checked(True)\n```\n\n```py\npage.get_by_role(\"checkbox\").set_checked(True)\n```\n\n```csharp\nawait page.GetByRole(AriaRole.Checkbox).SetCheckedAsync(true);\n```\n\n**Details**\n\nThis method checks or unchecks an element by performing the following steps:\n1. Ensure that matched element is a checkbox or a radio input. If not, this method throws.\n1. If the element already has the right checked state, this method returns immediately.\n1. Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is set. If\n the element is detached during the checks, the whole action is retried.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.mouse`] to click in the center of the element.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n1. Ensure that the element is now checked or unchecked. If not, this method throws.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.","async":true,"alias":"setChecked","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"aliases":{"csharp":"checkedState"},"types":{},"overrides":{}},"since":"v1.15","name":"checked","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to check or uncheck the checkbox."}],"required":true,"comment":"Whether to check or uncheck the checkbox.","async":false,"alias":"checked","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.15","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.15","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.15","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.15","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.15","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.15","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"setInputFiles","type":{"name":"void"},"spec":[{"type":"text","text":"Upload file or multiple files into `<input type=file>`.↵For inputs with a `[webkitdirectory]` attribute, only a single directory path is supported."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["// Select one file","await page.getByLabel('Upload file').setInputFiles(path.join(__dirname, 'myfile.pdf'));","","// Select multiple files","await page.getByLabel('Upload files').setInputFiles(["," path.join(__dirname, 'file1.txt'),"," path.join(__dirname, 'file2.txt'),","]);","","// Select a directory","await page.getByLabel('Upload directory').setInputFiles(path.join(__dirname, 'mydir'));","","// Remove all the selected files","await page.getByLabel('Upload file').setInputFiles([]);","","// Upload buffer from memory","await page.getByLabel('Upload file').setInputFiles({"," name: 'file.txt',"," mimeType: 'text/plain',"," buffer: Buffer.from('this is test')","});"],"codeLang":"js"},{"type":"code","lines":["// Select one file","page.getByLabel(\"Upload file\").setInputFiles(Paths.get(\"myfile.pdf\"));","","// Select multiple files","page.getByLabel(\"Upload files\").setInputFiles(new Path[] {Paths.get(\"file1.txt\"), Paths.get(\"file2.txt\")});","","// Select a directory","page.getByLabel(\"Upload directory\").setInputFiles(Paths.get(\"mydir\"));","","// Remove all the selected files","page.getByLabel(\"Upload file\").setInputFiles(new Path[0]);","","// Upload buffer from memory","page.getByLabel(\"Upload file\").setInputFiles(new FilePayload("," \"file.txt\", \"text/plain\", \"this is test\".getBytes(StandardCharsets.UTF_8)));"],"codeLang":"java"},{"type":"code","lines":["# Select one file","await page.get_by_label(\"Upload file\").set_input_files('myfile.pdf')","","# Select multiple files","await page.get_by_label(\"Upload files\").set_input_files(['file1.txt', 'file2.txt'])","","# Select a directory","await page.get_by_label(\"Upload directory\").set_input_files('mydir')","","# Remove all the selected files","await page.get_by_label(\"Upload file\").set_input_files([])","","# Upload buffer from memory","await page.get_by_label(\"Upload file\").set_input_files("," files=["," {\"name\": \"test.txt\", \"mimeType\": \"text/plain\", \"buffer\": b\"this is a test\"}"," ],",")"],"codeLang":"python async"},{"type":"code","lines":["# Select one file","page.get_by_label(\"Upload file\").set_input_files('myfile.pdf')","","# Select multiple files","page.get_by_label(\"Upload files\").set_input_files(['file1.txt', 'file2.txt'])","","# Select a directory","page.get_by_label(\"Upload directory\").set_input_files('mydir')","","# Remove all the selected files","page.get_by_label(\"Upload file\").set_input_files([])","","# Upload buffer from memory","page.get_by_label(\"Upload file\").set_input_files("," files=["," {\"name\": \"test.txt\", \"mimeType\": \"text/plain\", \"buffer\": b\"this is a test\"}"," ],",")"],"codeLang":"python sync"},{"type":"code","lines":["// Select one file","await page.GetByLabel(\"Upload file\").SetInputFilesAsync(\"myfile.pdf\");","","// Select multiple files","await page.GetByLabel(\"Upload files\").SetInputFilesAsync(new[] { \"file1.txt\", \"file12.txt\" });","","// Select a directory","await page.GetByLabel(\"Upload directory\").SetInputFilesAsync(\"mydir\");","","// Remove all the selected files","await page.GetByLabel(\"Upload file\").SetInputFilesAsync(new[] {});","","// Upload buffer from memory","await page.GetByLabel(\"Upload file\").SetInputFilesAsync(new FilePayload","{"," Name = \"file.txt\","," MimeType = \"text/plain\","," Buffer = System.Text.Encoding.UTF8.GetBytes(\"this is a test\"),","});"],"codeLang":"csharp"},{"type":"text","text":"**Details**"},{"type":"text","text":"Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then they↵are resolved relative to the current working directory. For empty array, clears the selected files."},{"type":"text","text":"This method expects `Locator` to point to an↵[input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input). However, if the element is inside the `<label>` element that has an associated [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), targets the control instead."}],"required":true,"comment":"Upload file or multiple files into `<input type=file>`. For inputs with a `[webkitdirectory]` attribute, only a\nsingle directory path is supported.\n\n**Usage**\n\n```js\n// Select one file\nawait page.getByLabel('Upload file').setInputFiles(path.join(__dirname, 'myfile.pdf'));\n\n// Select multiple files\nawait page.getByLabel('Upload files').setInputFiles([\n path.join(__dirname, 'file1.txt'),\n path.join(__dirname, 'file2.txt'),\n]);\n\n// Select a directory\nawait page.getByLabel('Upload directory').setInputFiles(path.join(__dirname, 'mydir'));\n\n// Remove all the selected files\nawait page.getByLabel('Upload file').setInputFiles([]);\n\n// Upload buffer from memory\nawait page.getByLabel('Upload file').setInputFiles({\n name: 'file.txt',\n mimeType: 'text/plain',\n buffer: Buffer.from('this is test')\n});\n```\n\n```java\n// Select one file\npage.getByLabel(\"Upload file\").setInputFiles(Paths.get(\"myfile.pdf\"));\n\n// Select multiple files\npage.getByLabel(\"Upload files\").setInputFiles(new Path[] {Paths.get(\"file1.txt\"), Paths.get(\"file2.txt\")});\n\n// Select a directory\npage.getByLabel(\"Upload directory\").setInputFiles(Paths.get(\"mydir\"));\n\n// Remove all the selected files\npage.getByLabel(\"Upload file\").setInputFiles(new Path[0]);\n\n// Upload buffer from memory\npage.getByLabel(\"Upload file\").setInputFiles(new FilePayload(\n \"file.txt\", \"text/plain\", \"this is test\".getBytes(StandardCharsets.UTF_8)));\n```\n\n```py\n# Select one file\nawait page.get_by_label(\"Upload file\").set_input_files('myfile.pdf')\n\n# Select multiple files\nawait page.get_by_label(\"Upload files\").set_input_files(['file1.txt', 'file2.txt'])\n\n# Select a directory\nawait page.get_by_label(\"Upload directory\").set_input_files('mydir')\n\n# Remove all the selected files\nawait page.get_by_label(\"Upload file\").set_input_files([])\n\n# Upload buffer from memory\nawait page.get_by_label(\"Upload file\").set_input_files(\n files=[\n {\"name\": \"test.txt\", \"mimeType\": \"text/plain\", \"buffer\": b\"this is a test\"}\n ],\n)\n```\n\n```py\n# Select one file\npage.get_by_label(\"Upload file\").set_input_files('myfile.pdf')\n\n# Select multiple files\npage.get_by_label(\"Upload files\").set_input_files(['file1.txt', 'file2.txt'])\n\n# Select a directory\npage.get_by_label(\"Upload directory\").set_input_files('mydir')\n\n# Remove all the selected files\npage.get_by_label(\"Upload file\").set_input_files([])\n\n# Upload buffer from memory\npage.get_by_label(\"Upload file\").set_input_files(\n files=[\n {\"name\": \"test.txt\", \"mimeType\": \"text/plain\", \"buffer\": b\"this is a test\"}\n ],\n)\n```\n\n```csharp\n// Select one file\nawait page.GetByLabel(\"Upload file\").SetInputFilesAsync(\"myfile.pdf\");\n\n// Select multiple files\nawait page.GetByLabel(\"Upload files\").SetInputFilesAsync(new[] { \"file1.txt\", \"file12.txt\" });\n\n// Select a directory\nawait page.GetByLabel(\"Upload directory\").SetInputFilesAsync(\"mydir\");\n\n// Remove all the selected files\nawait page.GetByLabel(\"Upload file\").SetInputFilesAsync(new[] {});\n\n// Upload buffer from memory\nawait page.GetByLabel(\"Upload file\").SetInputFilesAsync(new FilePayload\n{\n Name = \"file.txt\",\n MimeType = \"text/plain\",\n Buffer = System.Text.Encoding.UTF8.GetBytes(\"this is a test\"),\n});\n```\n\n**Details**\n\nSets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then\nthey are resolved relative to the current working directory. For empty array, clears the selected files.\n\nThis method expects `Locator` to point to an\n[input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input). However, if the element is inside\nthe `<label>` element that has an associated\n[control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), targets the control instead.","async":true,"alias":"setInputFiles","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.14","name":"files","type":{"name":"","union":[{"name":"path"},{"name":"Array","templates":[{"name":"path"}]},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]},{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]}]}],"expression":"[path]|[Array]<[path]>|[Object]|[Array]<[Object]>"},"spec":[],"required":true,"comment":"","async":false,"alias":"files","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"tap","type":{"name":"void"},"spec":[{"type":"text","text":"Perform a tap gesture on the element matching the locator."},{"type":"text","text":"**Details**"},{"type":"text","text":"This method taps the element by performing the following steps:"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.touchscreen`] to tap the center of the element, or the specified `position`.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.","liType":"ordinal"},{"type":"text","text":"If the element is detached from the DOM at any moment during the action, this method throws."},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."},{"type":"note","noteType":"note","text":"`element.tap()` requires that the `hasTouch` option of the browser context be set to true."}],"required":true,"comment":"Perform a tap gesture on the element matching the locator.\n\n**Details**\n\nThis method taps the element by performing the following steps:\n1. Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.touchscreen`] to tap the center of the element, or the specified `position`.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n\nIf the element is detached from the DOM at any moment during the action, this method throws.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.\n\n**NOTE** `element.tap()` requires that the `hasTouch` option of the browser context be set to true.","async":true,"alias":"tap","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"modifiers","type":{"name":"Array","templates":[{"name":"KeyboardModifier","union":[{"name":"\"Alt\""},{"name":"\"Control\""},{"name":"\"ControlOrMeta\""},{"name":"\"Meta\""},{"name":"\"Shift\""}]}],"expression":"[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"ControlOrMeta\"|\"Meta\"|\"Shift\">>"},"spec":[{"type":"text","text":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current↵modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to \"Control\" on Windows↵and Linux and to \"Meta\" on macOS."}],"required":false,"comment":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores\ncurrent modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to\n\"Control\" on Windows and Linux and to \"Meta\" on macOS.","async":false,"alias":"modifiers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"textContent","type":{"name":"","union":[{"name":"null"},{"name":"string"}],"expression":"[null]|[string]"},"spec":[{"type":"text","text":"Returns the [`node.textContent`](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent)."},{"type":"note","noteType":"warning[Asserting text]","text":"If you need to assert text on the page, prefer [`method: LocatorAssertions.toHaveText`] to avoid flakiness. See [assertions guide](../test-assertions.md) for more details."}],"required":true,"comment":"Returns the [`node.textContent`](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent).\n\n**NOTE** If you need to assert text on the page, prefer [`method: LocatorAssertions.toHaveText`] to avoid\nflakiness. See [assertions guide](../test-assertions.md) for more details.","async":true,"alias":"textContent","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","deprecated":"In most cases, you should use [`method: Locator.fill`] instead. You only need to press keys one by one if there is special keyboard handling on the page - in this case use [`method: Locator.pressSequentially`].","name":"type","type":{"name":"void"},"spec":[{"type":"text","text":"Focuses the element, and then sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text."},{"type":"text","text":"To press a special key, like `Control` or `ArrowDown`, use [`method: Locator.press`]."},{"type":"text","text":"**Usage**"}],"required":true,"comment":"Focuses the element, and then sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the\ntext.\n\nTo press a special key, like `Control` or `ArrowDown`, use [`method: Locator.press`].\n\n**Usage**","async":true,"alias":"type","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.14","name":"text","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A text to type into a focused element."}],"required":true,"comment":"A text to type into a focused element.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"delay","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to wait between key presses in milliseconds. Defaults to 0."}],"required":false,"comment":"Time to wait between key presses in milliseconds. Defaults to 0.","async":false,"alias":"delay","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.14","name":"uncheck","type":{"name":"void"},"spec":[{"type":"text","text":"Ensure that checkbox or radio element is unchecked."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.getByRole('checkbox').uncheck();"],"codeLang":"js"},{"type":"code","lines":["page.getByRole(AriaRole.CHECKBOX).uncheck();"],"codeLang":"java"},{"type":"code","lines":["await page.get_by_role(\"checkbox\").uncheck()"],"codeLang":"python async"},{"type":"code","lines":["page.get_by_role(\"checkbox\").uncheck()"],"codeLang":"python sync"},{"type":"code","lines":["await page.GetByRole(AriaRole.Checkbox).UncheckAsync();"],"codeLang":"csharp"},{"type":"text","text":"**Details**"},{"type":"text","text":"This method unchecks the element by performing the following steps:"},{"type":"li","text":"Ensure that element is a checkbox or a radio input. If not, this method throws. If the element is already↵unchecked, this method returns immediately.","liType":"ordinal"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.mouse`] to click in the center of the element.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.","liType":"ordinal"},{"type":"li","text":"Ensure that the element is now unchecked. If not, this method throws.","liType":"ordinal"},{"type":"text","text":"If the element is detached from the DOM at any moment during the action, this method throws."},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."}],"required":true,"comment":"Ensure that checkbox or radio element is unchecked.\n\n**Usage**\n\n```js\nawait page.getByRole('checkbox').uncheck();\n```\n\n```java\npage.getByRole(AriaRole.CHECKBOX).uncheck();\n```\n\n```py\nawait page.get_by_role(\"checkbox\").uncheck()\n```\n\n```py\npage.get_by_role(\"checkbox\").uncheck()\n```\n\n```csharp\nawait page.GetByRole(AriaRole.Checkbox).UncheckAsync();\n```\n\n**Details**\n\nThis method unchecks the element by performing the following steps:\n1. Ensure that element is a checkbox or a radio input. If not, this method throws. If the element is already\n unchecked, this method returns immediately.\n1. Wait for [actionability](../actionability.md) checks on the element, unless `force` option is set.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.mouse`] to click in the center of the element.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n1. Ensure that the element is now unchecked. If not, this method throws.\n\nIf the element is detached from the DOM at any moment during the action, this method throws.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.","async":true,"alias":"uncheck","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.14","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.16","name":"waitFor","type":{"name":"void"},"spec":[{"type":"text","text":"Returns when element specified by locator satisfies the `state` option."},{"type":"text","text":"If target element already satisfies the condition, the method returns immediately. Otherwise, waits for up to↵`timeout` milliseconds until the condition is met."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const orderSent = page.locator('#order-sent');","await orderSent.waitFor();"],"codeLang":"js"},{"type":"code","lines":["Locator orderSent = page.locator(\"#order-sent\");","orderSent.waitFor();"],"codeLang":"java"},{"type":"code","lines":["order_sent = page.locator(\"#order-sent\")","await order_sent.wait_for()"],"codeLang":"python async"},{"type":"code","lines":["order_sent = page.locator(\"#order-sent\")","order_sent.wait_for()"],"codeLang":"python sync"},{"type":"code","lines":["var orderSent = page.Locator(\"#order-sent\");","orderSent.WaitForAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Returns when element specified by locator satisfies the `state` option.\n\nIf target element already satisfies the condition, the method returns immediately. Otherwise, waits for up to\n`timeout` milliseconds until the condition is met.\n\n**Usage**\n\n```js\nconst orderSent = page.locator('#order-sent');\nawait orderSent.waitFor();\n```\n\n```java\nLocator orderSent = page.locator(\"#order-sent\");\norderSent.waitFor();\n```\n\n```py\norder_sent = page.locator(\"#order-sent\")\nawait order_sent.wait_for()\n```\n\n```py\norder_sent = page.locator(\"#order-sent\")\norder_sent.wait_for()\n```\n\n```csharp\nvar orderSent = page.Locator(\"#order-sent\");\norderSent.WaitForAsync();\n```\n","async":true,"alias":"waitFor","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.16","name":"state","type":{"name":"WaitForSelectorState","union":[{"name":"\"attached\""},{"name":"\"detached\""},{"name":"\"visible\""},{"name":"\"hidden\""}],"expression":"[WaitForSelectorState]<\"attached\"|\"detached\"|\"visible\"|\"hidden\">"},"spec":[{"type":"text","text":"Defaults to `'visible'`. Can be either:"},{"type":"li","text":"`'attached'` - wait for element to be present in DOM.","liType":"bullet"},{"type":"li","text":"`'detached'` - wait for element to not be present in DOM.","liType":"bullet"},{"type":"li","text":"`'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element without↵any content or with `display:none` has an empty bounding box and is not considered visible.","liType":"bullet"},{"type":"li","text":"`'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or `visibility:hidden`.↵This is opposite to the `'visible'` option.","liType":"bullet"}],"required":false,"comment":"Defaults to `'visible'`. Can be either:\n- `'attached'` - wait for element to be present in DOM.\n- `'detached'` - wait for element to not be present in DOM.\n- `'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element\n without any content or with `display:none` has an empty bounding box and is not considered visible.\n- `'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or\n `visibility:hidden`. This is opposite to the `'visible'` option.","async":false,"alias":"state","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.16","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]}]},{"name":"LocatorAssertions","spec":[{"type":"text","text":"The `LocatorAssertions` class provides assertion methods that can be used to make assertions about the `Locator` state in the tests."},{"type":"code","lines":["import { test, expect } from '@playwright/test';","","test('status becomes submitted', async ({ page }) => {"," // ..."," await page.getByRole('button').click();"," await expect(page.locator('.status')).toHaveText('Submitted');","});"],"codeLang":"js"},{"type":"code","lines":["...","import static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;","","public class TestLocator {"," ..."," @Test"," void statusBecomesSubmitted() {"," ..."," page.getByRole(AriaRole.BUTTON).click();"," assertThat(page.locator(\".status\")).hasText(\"Submitted\");"," }","}"],"codeLang":"java"},{"type":"code","lines":["from playwright.async_api import Page, expect","","async def test_status_becomes_submitted(page: Page) -> None:"," # .."," await page.get_by_role(\"button\").click()"," await expect(page.locator(\".status\")).to_have_text(\"Submitted\")"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import Page, expect","","def test_status_becomes_submitted(page: Page) -> None:"," # .."," page.get_by_role(\"button\").click()"," expect(page.locator(\".status\")).to_have_text(\"Submitted\")"],"codeLang":"python sync"},{"type":"code","lines":["using Microsoft.Playwright;","using Microsoft.Playwright.MSTest;","","namespace PlaywrightTests;","","[TestClass]","public class ExampleTests : PageTest","{"," [TestMethod]"," public async Task StatusBecomesSubmitted()"," {"," // ..."," await Page.GetByRole(AriaRole.Button, new() { Name = \"Sign In\" }).ClickAsync();"," await Expect(Page.Locator(\".status\")).ToHaveTextAsync(\"Submitted\");"," }","}"],"codeLang":"csharp"}],"langs":{},"comment":"The `LocatorAssertions` class provides assertion methods that can be used to make assertions about the `Locator`\nstate in the tests.\n\n```js\nimport { test, expect } from '@playwright/test';\n\ntest('status becomes submitted', async ({ page }) => {\n // ...\n await page.getByRole('button').click();\n await expect(page.locator('.status')).toHaveText('Submitted');\n});\n```\n\n```java\n...\nimport static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;\n\npublic class TestLocator {\n ...\n @Test\n void statusBecomesSubmitted() {\n ...\n page.getByRole(AriaRole.BUTTON).click();\n assertThat(page.locator(\".status\")).hasText(\"Submitted\");\n }\n}\n```\n\n```py\nfrom playwright.async_api import Page, expect\n\nasync def test_status_becomes_submitted(page: Page) -> None:\n # ..\n await page.get_by_role(\"button\").click()\n await expect(page.locator(\".status\")).to_have_text(\"Submitted\")\n```\n\n```py\nfrom playwright.sync_api import Page, expect\n\ndef test_status_becomes_submitted(page: Page) -> None:\n # ..\n page.get_by_role(\"button\").click()\n expect(page.locator(\".status\")).to_have_text(\"Submitted\")\n```\n\n```csharp\nusing Microsoft.Playwright;\nusing Microsoft.Playwright.MSTest;\n\nnamespace PlaywrightTests;\n\n[TestClass]\npublic class ExampleTests : PageTest\n{\n [TestMethod]\n public async Task StatusBecomesSubmitted()\n {\n // ...\n await Page.GetByRole(AriaRole.Button, new() { Name = \"Sign In\" }).ClickAsync();\n await Expect(Page.Locator(\".status\")).ToHaveTextAsync(\"Submitted\");\n }\n}\n```\n","since":"v1.17","members":[{"kind":"property","langs":{"only":["java","js","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.20","name":"not","type":{"name":"LocatorAssertions","expression":"[LocatorAssertions]"},"spec":[{"type":"text","text":"Makes the assertion check for the opposite condition. For example, this code tests that the Locator doesn't contain text `\"error\"`:"},{"type":"code","lines":["await expect(locator).not.toContainText('error');"],"codeLang":"js"},{"type":"code","lines":["assertThat(locator).not().containsText(\"error\");"],"codeLang":"java"},{"type":"code","lines":["await Expect(locator).Not.ToContainTextAsync(\"error\");"],"codeLang":"csharp"}],"required":true,"comment":"Makes the assertion check for the opposite condition. For example, this code tests that the Locator doesn't contain\ntext `\"error\"`:\n\n```js\nawait expect(locator).not.toContainText('error');\n```\n\n```java\nassertThat(locator).not().containsText(\"error\");\n```\n\n```csharp\nawait Expect(locator).Not.ToContainTextAsync(\"error\");\n```\n","async":false,"alias":"not","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.33","name":"NotToBeAttached","type":{"name":"void"},"spec":[{"type":"text","text":"The opposite of [`method: LocatorAssertions.toBeAttached`]."}],"required":true,"comment":"The opposite of [`method: LocatorAssertions.toBeAttached`].","async":true,"alias":"NotToBeAttached","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.33","name":"attached","type":{"name":"boolean","expression":"[boolean]"},"spec":[],"required":false,"comment":"","async":false,"alias":"attached","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.33","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.20","name":"NotToBeChecked","type":{"name":"void"},"spec":[{"type":"text","text":"The opposite of [`method: LocatorAssertions.toBeChecked`]."}],"required":true,"comment":"The opposite of [`method: LocatorAssertions.toBeChecked`].","async":true,"alias":"NotToBeChecked","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.20","name":"NotToBeDisabled","type":{"name":"void"},"spec":[{"type":"text","text":"The opposite of [`method: LocatorAssertions.toBeDisabled`]."}],"required":true,"comment":"The opposite of [`method: LocatorAssertions.toBeDisabled`].","async":true,"alias":"NotToBeDisabled","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.20","name":"NotToBeEditable","type":{"name":"void"},"spec":[{"type":"text","text":"The opposite of [`method: LocatorAssertions.toBeEditable`]."}],"required":true,"comment":"The opposite of [`method: LocatorAssertions.toBeEditable`].","async":true,"alias":"NotToBeEditable","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.26","name":"editable","type":{"name":"boolean","expression":"[boolean]"},"spec":[],"required":false,"comment":"","async":false,"alias":"editable","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.20","name":"NotToBeEmpty","type":{"name":"void"},"spec":[{"type":"text","text":"The opposite of [`method: LocatorAssertions.toBeEmpty`]."}],"required":true,"comment":"The opposite of [`method: LocatorAssertions.toBeEmpty`].","async":true,"alias":"NotToBeEmpty","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.20","name":"NotToBeEnabled","type":{"name":"void"},"spec":[{"type":"text","text":"The opposite of [`method: LocatorAssertions.toBeEnabled`]."}],"required":true,"comment":"The opposite of [`method: LocatorAssertions.toBeEnabled`].","async":true,"alias":"NotToBeEnabled","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.26","name":"enabled","type":{"name":"boolean","expression":"[boolean]"},"spec":[],"required":false,"comment":"","async":false,"alias":"enabled","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.20","name":"NotToBeFocused","type":{"name":"void"},"spec":[{"type":"text","text":"The opposite of [`method: LocatorAssertions.toBeFocused`]."}],"required":true,"comment":"The opposite of [`method: LocatorAssertions.toBeFocused`].","async":true,"alias":"NotToBeFocused","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.20","name":"NotToBeHidden","type":{"name":"void"},"spec":[{"type":"text","text":"The opposite of [`method: LocatorAssertions.toBeHidden`]."}],"required":true,"comment":"The opposite of [`method: LocatorAssertions.toBeHidden`].","async":true,"alias":"NotToBeHidden","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.31","name":"NotToBeInViewport","type":{"name":"void"},"spec":[{"type":"text","text":"The opposite of [`method: LocatorAssertions.toBeInViewport`]."}],"required":true,"comment":"The opposite of [`method: LocatorAssertions.toBeInViewport`].","async":true,"alias":"NotToBeInViewport","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.31","name":"ratio","type":{"name":"float","expression":"[float]"},"spec":[],"required":false,"comment":"","async":false,"alias":"ratio","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.31","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.20","name":"NotToBeVisible","type":{"name":"void"},"spec":[{"type":"text","text":"The opposite of [`method: LocatorAssertions.toBeVisible`]."}],"required":true,"comment":"The opposite of [`method: LocatorAssertions.toBeVisible`].","async":true,"alias":"NotToBeVisible","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.26","name":"visible","type":{"name":"boolean","expression":"[boolean]"},"spec":[],"required":false,"comment":"","async":false,"alias":"visible","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.20","name":"NotToContainText","type":{"name":"void"},"spec":[{"type":"text","text":"The opposite of [`method: LocatorAssertions.toContainText`]."}],"required":true,"comment":"The opposite of [`method: LocatorAssertions.toContainText`].","async":true,"alias":"NotToContainText","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"expected","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"},{"name":"Array","templates":[{"name":"string"}]},{"name":"Array","templates":[{"name":"RegExp"}]},{"name":"Array","templates":[{"name":"","union":[{"name":"string"},{"name":"RegExp"}]}]}],"expression":"[string]|[RegExp]|[Array]<[string]>|[Array]<[RegExp]>|[Array]<[string]|[RegExp]>"},"spec":[{"type":"text","text":"Expected substring or RegExp or a list of those."}],"required":true,"comment":"Expected substring or RegExp or a list of those.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.23","name":"ignoreCase","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular expression flag if specified."}],"required":false,"comment":"Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular\nexpression flag if specified.","async":false,"alias":"ignoreCase","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.18","name":"useInnerText","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to use `element.innerText` instead of `element.textContent` when retrieving DOM node text."}],"required":false,"comment":"Whether to use `element.innerText` instead of `element.textContent` when retrieving DOM node text.","async":false,"alias":"useInnerText","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.44","name":"NotToHaveAccessibleDescription","type":{"name":"void"},"spec":[{"type":"text","text":"The opposite of [`method: LocatorAssertions.toHaveAccessibleDescription`]."}],"required":true,"comment":"The opposite of [`method: LocatorAssertions.toHaveAccessibleDescription`].","async":true,"alias":"NotToHaveAccessibleDescription","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.44","name":"name","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Expected accessible description."}],"required":true,"comment":"Expected accessible description.","async":false,"alias":"description","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.44","name":"ignoreCase","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular expression flag if specified."}],"required":false,"comment":"Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular\nexpression flag if specified.","async":false,"alias":"ignoreCase","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.44","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.44","name":"NotToHaveAccessibleName","type":{"name":"void"},"spec":[{"type":"text","text":"The opposite of [`method: LocatorAssertions.toHaveAccessibleName`]."}],"required":true,"comment":"The opposite of [`method: LocatorAssertions.toHaveAccessibleName`].","async":true,"alias":"NotToHaveAccessibleName","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.44","name":"name","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Expected accessible name."}],"required":true,"comment":"Expected accessible name.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.44","name":"ignoreCase","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular expression flag if specified."}],"required":false,"comment":"Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular\nexpression flag if specified.","async":false,"alias":"ignoreCase","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.44","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.20","name":"NotToHaveAttribute","type":{"name":"void"},"spec":[{"type":"text","text":"The opposite of [`method: LocatorAssertions.toHaveAttribute`]."}],"required":true,"comment":"The opposite of [`method: LocatorAssertions.toHaveAttribute`].","async":true,"alias":"NotToHaveAttribute","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Attribute name."}],"required":true,"comment":"Attribute name.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.18","name":"value","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Expected attribute value."}],"required":true,"comment":"Expected attribute value.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.40","name":"ignoreCase","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular expression flag if specified."}],"required":false,"comment":"Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular\nexpression flag if specified.","async":false,"alias":"ignoreCase","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.20","name":"NotToHaveClass","type":{"name":"void"},"spec":[{"type":"text","text":"The opposite of [`method: LocatorAssertions.toHaveClass`]."}],"required":true,"comment":"The opposite of [`method: LocatorAssertions.toHaveClass`].","async":true,"alias":"NotToHaveClass","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"expected","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"},{"name":"Array","templates":[{"name":"string"}]},{"name":"Array","templates":[{"name":"RegExp"}]},{"name":"Array","templates":[{"name":"","union":[{"name":"string"},{"name":"RegExp"}]}]}],"expression":"[string]|[RegExp]|[Array]<[string]>|[Array]<[RegExp]>|[Array]<[string]|[RegExp]>"},"spec":[{"type":"text","text":"Expected class or RegExp or a list of those."}],"required":true,"comment":"Expected class or RegExp or a list of those.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.20","name":"NotToHaveCount","type":{"name":"void"},"spec":[{"type":"text","text":"The opposite of [`method: LocatorAssertions.toHaveCount`]."}],"required":true,"comment":"The opposite of [`method: LocatorAssertions.toHaveCount`].","async":true,"alias":"NotToHaveCount","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"count","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Expected count."}],"required":true,"comment":"Expected count.","async":false,"alias":"count","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.20","name":"NotToHaveCSS","type":{"name":"void"},"spec":[{"type":"text","text":"The opposite of [`method: LocatorAssertions.toHaveCSS`]."}],"required":true,"comment":"The opposite of [`method: LocatorAssertions.toHaveCSS`].","async":true,"alias":"NotToHaveCSS","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"CSS property name."}],"required":true,"comment":"CSS property name.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.18","name":"value","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"CSS property value."}],"required":true,"comment":"CSS property value.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.20","name":"NotToHaveId","type":{"name":"void"},"spec":[{"type":"text","text":"The opposite of [`method: LocatorAssertions.toHaveId`]."}],"required":true,"comment":"The opposite of [`method: LocatorAssertions.toHaveId`].","async":true,"alias":"NotToHaveId","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"id","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Element id."}],"required":true,"comment":"Element id.","async":false,"alias":"id","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.20","name":"NotToHaveJSProperty","type":{"name":"void"},"spec":[{"type":"text","text":"The opposite of [`method: LocatorAssertions.toHaveJSProperty`]."}],"required":true,"comment":"The opposite of [`method: LocatorAssertions.toHaveJSProperty`].","async":true,"alias":"NotToHaveJSProperty","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Property name."}],"required":true,"comment":"Property name.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.18","name":"value","type":{"name":"any","expression":"[any]"},"spec":[{"type":"text","text":"Property value."}],"required":true,"comment":"Property value.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.44","name":"NotToHaveRole","type":{"name":"void"},"spec":[{"type":"text","text":"The opposite of [`method: LocatorAssertions.toHaveRole`]."}],"required":true,"comment":"The opposite of [`method: LocatorAssertions.toHaveRole`].","async":true,"alias":"NotToHaveRole","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.44","name":"role","type":{"name":"AriaRole","union":[{"name":"\"alert\""},{"name":"\"alertdialog\""},{"name":"\"application\""},{"name":"\"article\""},{"name":"\"banner\""},{"name":"\"blockquote\""},{"name":"\"button\""},{"name":"\"caption\""},{"name":"\"cell\""},{"name":"\"checkbox\""},{"name":"\"code\""},{"name":"\"columnheader\""},{"name":"\"combobox\""},{"name":"\"complementary\""},{"name":"\"contentinfo\""},{"name":"\"definition\""},{"name":"\"deletion\""},{"name":"\"dialog\""},{"name":"\"directory\""},{"name":"\"document\""},{"name":"\"emphasis\""},{"name":"\"feed\""},{"name":"\"figure\""},{"name":"\"form\""},{"name":"\"generic\""},{"name":"\"grid\""},{"name":"\"gridcell\""},{"name":"\"group\""},{"name":"\"heading\""},{"name":"\"img\""},{"name":"\"insertion\""},{"name":"\"link\""},{"name":"\"list\""},{"name":"\"listbox\""},{"name":"\"listitem\""},{"name":"\"log\""},{"name":"\"main\""},{"name":"\"marquee\""},{"name":"\"math\""},{"name":"\"meter\""},{"name":"\"menu\""},{"name":"\"menubar\""},{"name":"\"menuitem\""},{"name":"\"menuitemcheckbox\""},{"name":"\"menuitemradio\""},{"name":"\"navigation\""},{"name":"\"none\""},{"name":"\"note\""},{"name":"\"option\""},{"name":"\"paragraph\""},{"name":"\"presentation\""},{"name":"\"progressbar\""},{"name":"\"radio\""},{"name":"\"radiogroup\""},{"name":"\"region\""},{"name":"\"row\""},{"name":"\"rowgroup\""},{"name":"\"rowheader\""},{"name":"\"scrollbar\""},{"name":"\"search\""},{"name":"\"searchbox\""},{"name":"\"separator\""},{"name":"\"slider\""},{"name":"\"spinbutton\""},{"name":"\"status\""},{"name":"\"strong\""},{"name":"\"subscript\""},{"name":"\"superscript\""},{"name":"\"switch\""},{"name":"\"tab\""},{"name":"\"table\""},{"name":"\"tablist\""},{"name":"\"tabpanel\""},{"name":"\"term\""},{"name":"\"textbox\""},{"name":"\"time\""},{"name":"\"timer\""},{"name":"\"toolbar\""},{"name":"\"tooltip\""},{"name":"\"tree\""},{"name":"\"treegrid\""},{"name":"\"treeitem\""}],"expression":"[AriaRole]<\"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\"|\"meter\"|\"menu\"|\"menubar\"|\"menuitem\"|\"menuitemcheckbox\"|\"menuitemradio\"|\"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\">"},"spec":[{"type":"text","text":"Required aria role."}],"required":true,"comment":"Required aria role.","async":false,"alias":"role","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.44","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.44","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.20","name":"NotToHaveText","type":{"name":"void"},"spec":[{"type":"text","text":"The opposite of [`method: LocatorAssertions.toHaveText`]."}],"required":true,"comment":"The opposite of [`method: LocatorAssertions.toHaveText`].","async":true,"alias":"NotToHaveText","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"expected","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"},{"name":"Array","templates":[{"name":"string"}]},{"name":"Array","templates":[{"name":"RegExp"}]},{"name":"Array","templates":[{"name":"","union":[{"name":"string"},{"name":"RegExp"}]}]}],"expression":"[string]|[RegExp]|[Array]<[string]>|[Array]<[RegExp]>|[Array]<[string]|[RegExp]>"},"spec":[{"type":"text","text":"Expected string or RegExp or a list of those."}],"required":true,"comment":"Expected string or RegExp or a list of those.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.23","name":"ignoreCase","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular expression flag if specified."}],"required":false,"comment":"Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular\nexpression flag if specified.","async":false,"alias":"ignoreCase","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.18","name":"useInnerText","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to use `element.innerText` instead of `element.textContent` when retrieving DOM node text."}],"required":false,"comment":"Whether to use `element.innerText` instead of `element.textContent` when retrieving DOM node text.","async":false,"alias":"useInnerText","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.20","name":"NotToHaveValue","type":{"name":"void"},"spec":[{"type":"text","text":"The opposite of [`method: LocatorAssertions.toHaveValue`]."}],"required":true,"comment":"The opposite of [`method: LocatorAssertions.toHaveValue`].","async":true,"alias":"NotToHaveValue","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"value","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Expected value."}],"required":true,"comment":"Expected value.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"NotToHaveValues","type":{"name":"void"},"spec":[{"type":"text","text":"The opposite of [`method: LocatorAssertions.toHaveValues`]."}],"required":true,"comment":"The opposite of [`method: LocatorAssertions.toHaveValues`].","async":true,"alias":"NotToHaveValues","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.23","name":"values","type":{"name":"","union":[{"name":"Array","templates":[{"name":"string"}]},{"name":"Array","templates":[{"name":"RegExp"}]},{"name":"Array","templates":[{"name":"","union":[{"name":"string"},{"name":"RegExp"}]}]}],"expression":"[Array]<[string]>|[Array]<[RegExp]>|[Array]<[string]|[RegExp]>"},"spec":[{"type":"text","text":"Expected options currently selected."}],"required":true,"comment":"Expected options currently selected.","async":false,"alias":"values","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"isAttached"},"types":{},"overrides":{}},"since":"v1.33","name":"toBeAttached","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures that `Locator` points to an element that is [connected](https://developer.mozilla.org/en-US/docs/Web/API/Node/isConnected) to a Document or a ShadowRoot."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await expect(page.getByText('Hidden text')).toBeAttached();"],"codeLang":"js"},{"type":"code","lines":["assertThat(page.getByText(\"Hidden text\")).isAttached();"],"codeLang":"java"},{"type":"code","lines":["await expect(page.get_by_text(\"Hidden text\")).to_be_attached()"],"codeLang":"python async"},{"type":"code","lines":["expect(page.get_by_text(\"Hidden text\")).to_be_attached()"],"codeLang":"python sync"},{"type":"code","lines":["await Expect(Page.GetByText(\"Hidden text\")).ToBeAttachedAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Ensures that `Locator` points to an element that is\n[connected](https://developer.mozilla.org/en-US/docs/Web/API/Node/isConnected) to a Document or a ShadowRoot.\n\n**Usage**\n\n```js\nawait expect(page.getByText('Hidden text')).toBeAttached();\n```\n\n```java\nassertThat(page.getByText(\"Hidden text\")).isAttached();\n```\n\n```py\nawait expect(page.get_by_text(\"Hidden text\")).to_be_attached()\n```\n\n```py\nexpect(page.get_by_text(\"Hidden text\")).to_be_attached()\n```\n\n```csharp\nawait Expect(Page.GetByText(\"Hidden text\")).ToBeAttachedAsync();\n```\n","async":true,"alias":"toBeAttached","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.33","name":"attached","type":{"name":"boolean","expression":"[boolean]"},"spec":[],"required":false,"comment":"","async":false,"alias":"attached","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.33","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.33","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"isChecked"},"types":{},"overrides":{}},"since":"v1.20","name":"toBeChecked","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures the `Locator` points to a checked input."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const locator = page.getByLabel('Subscribe to newsletter');","await expect(locator).toBeChecked();"],"codeLang":"js"},{"type":"code","lines":["assertThat(page.getByLabel(\"Subscribe to newsletter\")).isChecked();"],"codeLang":"java"},{"type":"code","lines":["from playwright.async_api import expect","","locator = page.get_by_label(\"Subscribe to newsletter\")","await expect(locator).to_be_checked()"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import expect","","locator = page.get_by_label(\"Subscribe to newsletter\")","expect(locator).to_be_checked()"],"codeLang":"python sync"},{"type":"code","lines":["var locator = Page.GetByLabel(\"Subscribe to newsletter\");","await Expect(locator).ToBeCheckedAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Ensures the `Locator` points to a checked input.\n\n**Usage**\n\n```js\nconst locator = page.getByLabel('Subscribe to newsletter');\nawait expect(locator).toBeChecked();\n```\n\n```java\nassertThat(page.getByLabel(\"Subscribe to newsletter\")).isChecked();\n```\n\n```py\nfrom playwright.async_api import expect\n\nlocator = page.get_by_label(\"Subscribe to newsletter\")\nawait expect(locator).to_be_checked()\n```\n\n```py\nfrom playwright.sync_api import expect\n\nlocator = page.get_by_label(\"Subscribe to newsletter\")\nexpect(locator).to_be_checked()\n```\n\n```csharp\nvar locator = Page.GetByLabel(\"Subscribe to newsletter\");\nawait Expect(locator).ToBeCheckedAsync();\n```\n","async":true,"alias":"toBeChecked","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.18","name":"checked","type":{"name":"boolean","expression":"[boolean]"},"spec":[],"required":false,"comment":"","async":false,"alias":"checked","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"isDisabled"},"types":{},"overrides":{}},"since":"v1.20","name":"toBeDisabled","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures the `Locator` points to a disabled element. Element is disabled if it has \"disabled\" attribute↵or is disabled via ['aria-disabled'](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-disabled).↵Note that only native control elements such as HTML `button`, `input`, `select`, `textarea`, `option`, `optgroup`↵can be disabled by setting \"disabled\" attribute. \"disabled\" attribute on other elements is ignored↵by the browser."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const locator = page.locator('button.submit');","await expect(locator).toBeDisabled();"],"codeLang":"js"},{"type":"code","lines":["assertThat(page.locator(\"button.submit\")).isDisabled();"],"codeLang":"java"},{"type":"code","lines":["from playwright.async_api import expect","","locator = page.locator(\"button.submit\")","await expect(locator).to_be_disabled()"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import expect","","locator = page.locator(\"button.submit\")","expect(locator).to_be_disabled()"],"codeLang":"python sync"},{"type":"code","lines":["var locator = Page.Locator(\"button.submit\");","await Expect(locator).ToBeDisabledAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Ensures the `Locator` points to a disabled element. Element is disabled if it has \"disabled\" attribute or is\ndisabled via\n['aria-disabled'](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-disabled). Note\nthat only native control elements such as HTML `button`, `input`, `select`, `textarea`, `option`, `optgroup` can be\ndisabled by setting \"disabled\" attribute. \"disabled\" attribute on other elements is ignored by the browser.\n\n**Usage**\n\n```js\nconst locator = page.locator('button.submit');\nawait expect(locator).toBeDisabled();\n```\n\n```java\nassertThat(page.locator(\"button.submit\")).isDisabled();\n```\n\n```py\nfrom playwright.async_api import expect\n\nlocator = page.locator(\"button.submit\")\nawait expect(locator).to_be_disabled()\n```\n\n```py\nfrom playwright.sync_api import expect\n\nlocator = page.locator(\"button.submit\")\nexpect(locator).to_be_disabled()\n```\n\n```csharp\nvar locator = Page.Locator(\"button.submit\");\nawait Expect(locator).ToBeDisabledAsync();\n```\n","async":true,"alias":"toBeDisabled","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"isEditable"},"types":{},"overrides":{}},"since":"v1.20","name":"toBeEditable","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures the `Locator` points to an editable element."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const locator = page.getByRole('textbox');","await expect(locator).toBeEditable();"],"codeLang":"js"},{"type":"code","lines":["assertThat(page.getByRole(AriaRole.TEXTBOX)).isEditable();"],"codeLang":"java"},{"type":"code","lines":["from playwright.async_api import expect","","locator = page.get_by_role(\"textbox\")","await expect(locator).to_be_editable()"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import expect","","locator = page.get_by_role(\"textbox\")","expect(locator).to_be_editable()"],"codeLang":"python sync"},{"type":"code","lines":["var locator = Page.GetByRole(AriaRole.Textbox);","await Expect(locator).ToBeEditableAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Ensures the `Locator` points to an editable element.\n\n**Usage**\n\n```js\nconst locator = page.getByRole('textbox');\nawait expect(locator).toBeEditable();\n```\n\n```java\nassertThat(page.getByRole(AriaRole.TEXTBOX)).isEditable();\n```\n\n```py\nfrom playwright.async_api import expect\n\nlocator = page.get_by_role(\"textbox\")\nawait expect(locator).to_be_editable()\n```\n\n```py\nfrom playwright.sync_api import expect\n\nlocator = page.get_by_role(\"textbox\")\nexpect(locator).to_be_editable()\n```\n\n```csharp\nvar locator = Page.GetByRole(AriaRole.Textbox);\nawait Expect(locator).ToBeEditableAsync();\n```\n","async":true,"alias":"toBeEditable","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.26","name":"editable","type":{"name":"boolean","expression":"[boolean]"},"spec":[],"required":false,"comment":"","async":false,"alias":"editable","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"isEmpty"},"types":{},"overrides":{}},"since":"v1.20","name":"toBeEmpty","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures the `Locator` points to an empty editable element or to a DOM node that has no text."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const locator = page.locator('div.warning');","await expect(locator).toBeEmpty();"],"codeLang":"js"},{"type":"code","lines":["assertThat(page.locator(\"div.warning\")).isEmpty();"],"codeLang":"java"},{"type":"code","lines":["from playwright.async_api import expect","","locator = page.locator(\"div.warning\")","await expect(locator).to_be_empty()"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import expect","","locator = page.locator(\"div.warning\")","expect(locator).to_be_empty()"],"codeLang":"python sync"},{"type":"code","lines":["var locator = Page.Locator(\"div.warning\");","await Expect(locator).ToBeEmptyAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Ensures the `Locator` points to an empty editable element or to a DOM node that has no text.\n\n**Usage**\n\n```js\nconst locator = page.locator('div.warning');\nawait expect(locator).toBeEmpty();\n```\n\n```java\nassertThat(page.locator(\"div.warning\")).isEmpty();\n```\n\n```py\nfrom playwright.async_api import expect\n\nlocator = page.locator(\"div.warning\")\nawait expect(locator).to_be_empty()\n```\n\n```py\nfrom playwright.sync_api import expect\n\nlocator = page.locator(\"div.warning\")\nexpect(locator).to_be_empty()\n```\n\n```csharp\nvar locator = Page.Locator(\"div.warning\");\nawait Expect(locator).ToBeEmptyAsync();\n```\n","async":true,"alias":"toBeEmpty","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"isEnabled"},"types":{},"overrides":{}},"since":"v1.20","name":"toBeEnabled","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures the `Locator` points to an enabled element."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const locator = page.locator('button.submit');","await expect(locator).toBeEnabled();"],"codeLang":"js"},{"type":"code","lines":["assertThat(page.locator(\"button.submit\")).isEnabled();"],"codeLang":"java"},{"type":"code","lines":["from playwright.async_api import expect","","locator = page.locator(\"button.submit\")","await expect(locator).to_be_enabled()"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import expect","","locator = page.locator(\"button.submit\")","expect(locator).to_be_enabled()"],"codeLang":"python sync"},{"type":"code","lines":["var locator = Page.Locator(\"button.submit\");","await Expect(locator).toBeEnabledAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Ensures the `Locator` points to an enabled element.\n\n**Usage**\n\n```js\nconst locator = page.locator('button.submit');\nawait expect(locator).toBeEnabled();\n```\n\n```java\nassertThat(page.locator(\"button.submit\")).isEnabled();\n```\n\n```py\nfrom playwright.async_api import expect\n\nlocator = page.locator(\"button.submit\")\nawait expect(locator).to_be_enabled()\n```\n\n```py\nfrom playwright.sync_api import expect\n\nlocator = page.locator(\"button.submit\")\nexpect(locator).to_be_enabled()\n```\n\n```csharp\nvar locator = Page.Locator(\"button.submit\");\nawait Expect(locator).toBeEnabledAsync();\n```\n","async":true,"alias":"toBeEnabled","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.26","name":"enabled","type":{"name":"boolean","expression":"[boolean]"},"spec":[],"required":false,"comment":"","async":false,"alias":"enabled","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"isFocused"},"types":{},"overrides":{}},"since":"v1.20","name":"toBeFocused","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures the `Locator` points to a focused DOM node."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const locator = page.getByRole('textbox');","await expect(locator).toBeFocused();"],"codeLang":"js"},{"type":"code","lines":["assertThat(page.getByRole(AriaRole.TEXTBOX)).isFocused();"],"codeLang":"java"},{"type":"code","lines":["from playwright.async_api import expect","","locator = page.get_by_role(\"textbox\")","await expect(locator).to_be_focused()"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import expect","","locator = page.get_by_role(\"textbox\")","expect(locator).to_be_focused()"],"codeLang":"python sync"},{"type":"code","lines":["var locator = Page.GetByRole(AriaRole.Textbox);","await Expect(locator).ToBeFocusedAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Ensures the `Locator` points to a focused DOM node.\n\n**Usage**\n\n```js\nconst locator = page.getByRole('textbox');\nawait expect(locator).toBeFocused();\n```\n\n```java\nassertThat(page.getByRole(AriaRole.TEXTBOX)).isFocused();\n```\n\n```py\nfrom playwright.async_api import expect\n\nlocator = page.get_by_role(\"textbox\")\nawait expect(locator).to_be_focused()\n```\n\n```py\nfrom playwright.sync_api import expect\n\nlocator = page.get_by_role(\"textbox\")\nexpect(locator).to_be_focused()\n```\n\n```csharp\nvar locator = Page.GetByRole(AriaRole.Textbox);\nawait Expect(locator).ToBeFocusedAsync();\n```\n","async":true,"alias":"toBeFocused","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"isHidden"},"types":{},"overrides":{}},"since":"v1.20","name":"toBeHidden","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures that `Locator` either does not resolve to any DOM node, or resolves to a [non-visible](../actionability.md#visible) one."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const locator = page.locator('.my-element');","await expect(locator).toBeHidden();"],"codeLang":"js"},{"type":"code","lines":["assertThat(page.locator(\".my-element\")).isHidden();"],"codeLang":"java"},{"type":"code","lines":["from playwright.async_api import expect","","locator = page.locator('.my-element')","await expect(locator).to_be_hidden()"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import expect","","locator = page.locator('.my-element')","expect(locator).to_be_hidden()"],"codeLang":"python sync"},{"type":"code","lines":["var locator = Page.Locator(\".my-element\");","await Expect(locator).ToBeHiddenAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Ensures that `Locator` either does not resolve to any DOM node, or resolves to a\n[non-visible](../actionability.md#visible) one.\n\n**Usage**\n\n```js\nconst locator = page.locator('.my-element');\nawait expect(locator).toBeHidden();\n```\n\n```java\nassertThat(page.locator(\".my-element\")).isHidden();\n```\n\n```py\nfrom playwright.async_api import expect\n\nlocator = page.locator('.my-element')\nawait expect(locator).to_be_hidden()\n```\n\n```py\nfrom playwright.sync_api import expect\n\nlocator = page.locator('.my-element')\nexpect(locator).to_be_hidden()\n```\n\n```csharp\nvar locator = Page.Locator(\".my-element\");\nawait Expect(locator).ToBeHiddenAsync();\n```\n","async":true,"alias":"toBeHidden","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"isInViewport"},"types":{},"overrides":{}},"since":"v1.31","name":"toBeInViewport","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures the `Locator` points to an element that intersects viewport, according to the [intersection observer API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API)."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const locator = page.getByRole('button');","// Make sure at least some part of element intersects viewport.","await expect(locator).toBeInViewport();","// Make sure element is fully outside of viewport.","await expect(locator).not.toBeInViewport();","// Make sure that at least half of the element intersects viewport.","await expect(locator).toBeInViewport({ ratio: 0.5 });"],"codeLang":"js"},{"type":"code","lines":["Locator locator = page.getByRole(AriaRole.BUTTON);","// Make sure at least some part of element intersects viewport.","assertThat(locator).isInViewport();","// Make sure element is fully outside of viewport.","assertThat(locator).not().isInViewport();","// Make sure that at least half of the element intersects viewport.","assertThat(locator).isInViewport(new LocatorAssertions.IsInViewportOptions().setRatio(0.5));"],"codeLang":"java"},{"type":"code","lines":["var locator = Page.GetByRole(AriaRole.Button);","// Make sure at least some part of element intersects viewport.","await Expect(locator).ToBeInViewportAsync();","// Make sure element is fully outside of viewport.","await Expect(locator).Not.ToBeInViewportAsync();","// Make sure that at least half of the element intersects viewport.","await Expect(locator).ToBeInViewportAsync(new() { Ratio = 0.5 });"],"codeLang":"csharp"},{"type":"code","lines":["from playwright.async_api import expect","","locator = page.get_by_role(\"button\")","# Make sure at least some part of element intersects viewport.","await expect(locator).to_be_in_viewport()","# Make sure element is fully outside of viewport.","await expect(locator).not_to_be_in_viewport()","# Make sure that at least half of the element intersects viewport.","await expect(locator).to_be_in_viewport(ratio=0.5)"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import expect","","locator = page.get_by_role(\"button\")","# Make sure at least some part of element intersects viewport.","expect(locator).to_be_in_viewport()","# Make sure element is fully outside of viewport.","expect(locator).not_to_be_in_viewport()","# Make sure that at least half of the element intersects viewport.","expect(locator).to_be_in_viewport(ratio=0.5)"],"codeLang":"python sync"}],"required":true,"comment":"Ensures the `Locator` points to an element that intersects viewport, according to the\n[intersection observer API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API).\n\n**Usage**\n\n```js\nconst locator = page.getByRole('button');\n// Make sure at least some part of element intersects viewport.\nawait expect(locator).toBeInViewport();\n// Make sure element is fully outside of viewport.\nawait expect(locator).not.toBeInViewport();\n// Make sure that at least half of the element intersects viewport.\nawait expect(locator).toBeInViewport({ ratio: 0.5 });\n```\n\n```java\nLocator locator = page.getByRole(AriaRole.BUTTON);\n// Make sure at least some part of element intersects viewport.\nassertThat(locator).isInViewport();\n// Make sure element is fully outside of viewport.\nassertThat(locator).not().isInViewport();\n// Make sure that at least half of the element intersects viewport.\nassertThat(locator).isInViewport(new LocatorAssertions.IsInViewportOptions().setRatio(0.5));\n```\n\n```csharp\nvar locator = Page.GetByRole(AriaRole.Button);\n// Make sure at least some part of element intersects viewport.\nawait Expect(locator).ToBeInViewportAsync();\n// Make sure element is fully outside of viewport.\nawait Expect(locator).Not.ToBeInViewportAsync();\n// Make sure that at least half of the element intersects viewport.\nawait Expect(locator).ToBeInViewportAsync(new() { Ratio = 0.5 });\n```\n\n```py\nfrom playwright.async_api import expect\n\nlocator = page.get_by_role(\"button\")\n# Make sure at least some part of element intersects viewport.\nawait expect(locator).to_be_in_viewport()\n# Make sure element is fully outside of viewport.\nawait expect(locator).not_to_be_in_viewport()\n# Make sure that at least half of the element intersects viewport.\nawait expect(locator).to_be_in_viewport(ratio=0.5)\n```\n\n```py\nfrom playwright.sync_api import expect\n\nlocator = page.get_by_role(\"button\")\n# Make sure at least some part of element intersects viewport.\nexpect(locator).to_be_in_viewport()\n# Make sure element is fully outside of viewport.\nexpect(locator).not_to_be_in_viewport()\n# Make sure that at least half of the element intersects viewport.\nexpect(locator).to_be_in_viewport(ratio=0.5)\n```\n","async":true,"alias":"toBeInViewport","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.31","name":"ratio","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"The minimal ratio of the element to intersect viewport. If equals to `0`, then↵element should intersect viewport at any positive ratio. Defaults to `0`."}],"required":false,"comment":"The minimal ratio of the element to intersect viewport. If equals to `0`, then element should intersect viewport at\nany positive ratio. Defaults to `0`.","async":false,"alias":"ratio","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.31","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.31","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"isVisible"},"types":{},"overrides":{}},"since":"v1.20","name":"toBeVisible","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures that `Locator` points to an attached and [visible](../actionability.md#visible) DOM node."},{"type":"text","text":"To check that at least one element from the list is visible, use [`method: Locator.first`]."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["// A specific element is visible.","await expect(page.getByText('Welcome')).toBeVisible();","","// At least one item in the list is visible.","await expect(page.getByTestId('todo-item').first()).toBeVisible();","","// At least one of the two elements is visible, possibly both.","await expect("," page.getByRole('button', { name: 'Sign in' })"," .or(page.getByRole('button', { name: 'Sign up' }))"," .first()",").toBeVisible();"],"codeLang":"js"},{"type":"code","lines":["// A specific element is visible.","assertThat(page.getByText(\"Welcome\")).isVisible();","","// At least one item in the list is visible.","assertThat(page.getByTestId(\"todo-item\").first()).isVisible();","","// At least one of the two elements is visible, possibly both.","assertThat("," page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName(\"Sign in\"))"," .or(page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName(\"Sign up\")))"," .first()",").isVisible();"],"codeLang":"java"},{"type":"code","lines":["# A specific element is visible.","await expect(page.get_by_text(\"Welcome\")).to_be_visible()","","# At least one item in the list is visible.","await expect(page.get_by_test_id(\"todo-item\").first).to_be_visible()","","# At least one of the two elements is visible, possibly both.","await expect("," page.get_by_role(\"button\", name=\"Sign in\")"," .or_(page.get_by_role(\"button\", name=\"Sign up\"))"," .first",").to_be_visible()"],"codeLang":"python async"},{"type":"code","lines":["# A specific element is visible.","expect(page.get_by_text(\"Welcome\")).to_be_visible()","","# At least one item in the list is visible.","expect(page.get_by_test_id(\"todo-item\").first).to_be_visible()","","# At least one of the two elements is visible, possibly both.","expect("," page.get_by_role(\"button\", name=\"Sign in\")"," .or_(page.get_by_role(\"button\", name=\"Sign up\"))"," .first",").to_be_visible()"],"codeLang":"python sync"},{"type":"code","lines":["// A specific element is visible.","await Expect(Page.GetByText(\"Welcome\")).ToBeVisibleAsync();","","// At least one item in the list is visible.","await Expect(Page.GetByTestId(\"todo-item\").First).ToBeVisibleAsync();","","// At least one of the two elements is visible, possibly both.","await Expect("," Page.GetByRole(AriaRole.Button, new() { Name = \"Sign in\" })"," .Or(Page.GetByRole(AriaRole.Button, new() { Name = \"Sign up\" }))"," .First",").ToBeVisibleAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Ensures that `Locator` points to an attached and [visible](../actionability.md#visible) DOM node.\n\nTo check that at least one element from the list is visible, use [`method: Locator.first`].\n\n**Usage**\n\n```js\n// A specific element is visible.\nawait expect(page.getByText('Welcome')).toBeVisible();\n\n// At least one item in the list is visible.\nawait expect(page.getByTestId('todo-item').first()).toBeVisible();\n\n// At least one of the two elements is visible, possibly both.\nawait expect(\n page.getByRole('button', { name: 'Sign in' })\n .or(page.getByRole('button', { name: 'Sign up' }))\n .first()\n).toBeVisible();\n```\n\n```java\n// A specific element is visible.\nassertThat(page.getByText(\"Welcome\")).isVisible();\n\n// At least one item in the list is visible.\nassertThat(page.getByTestId(\"todo-item\").first()).isVisible();\n\n// At least one of the two elements is visible, possibly both.\nassertThat(\n page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName(\"Sign in\"))\n .or(page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName(\"Sign up\")))\n .first()\n).isVisible();\n```\n\n```py\n# A specific element is visible.\nawait expect(page.get_by_text(\"Welcome\")).to_be_visible()\n\n# At least one item in the list is visible.\nawait expect(page.get_by_test_id(\"todo-item\").first).to_be_visible()\n\n# At least one of the two elements is visible, possibly both.\nawait expect(\n page.get_by_role(\"button\", name=\"Sign in\")\n .or_(page.get_by_role(\"button\", name=\"Sign up\"))\n .first\n).to_be_visible()\n```\n\n```py\n# A specific element is visible.\nexpect(page.get_by_text(\"Welcome\")).to_be_visible()\n\n# At least one item in the list is visible.\nexpect(page.get_by_test_id(\"todo-item\").first).to_be_visible()\n\n# At least one of the two elements is visible, possibly both.\nexpect(\n page.get_by_role(\"button\", name=\"Sign in\")\n .or_(page.get_by_role(\"button\", name=\"Sign up\"))\n .first\n).to_be_visible()\n```\n\n```csharp\n// A specific element is visible.\nawait Expect(Page.GetByText(\"Welcome\")).ToBeVisibleAsync();\n\n// At least one item in the list is visible.\nawait Expect(Page.GetByTestId(\"todo-item\").First).ToBeVisibleAsync();\n\n// At least one of the two elements is visible, possibly both.\nawait Expect(\n Page.GetByRole(AriaRole.Button, new() { Name = \"Sign in\" })\n .Or(Page.GetByRole(AriaRole.Button, new() { Name = \"Sign up\" }))\n .First\n).ToBeVisibleAsync();\n```\n","async":true,"alias":"toBeVisible","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.26","name":"visible","type":{"name":"boolean","expression":"[boolean]"},"spec":[],"required":false,"comment":"","async":false,"alias":"visible","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"containsText"},"types":{},"overrides":{}},"since":"v1.20","name":"toContainText","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures the `Locator` points to an element that contains the given text. All nested elements will be considered when computing the text content of the element. You can use regular expressions for the value as well."},{"type":"text","text":"**Details**"},{"type":"text","text":"When `expected` parameter is a string, Playwright will normalize whitespaces and line breaks both in the actual text and↵in the expected string before matching. When regular expression is used, the actual text is matched as is."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const locator = page.locator('.title');","await expect(locator).toContainText('substring');","await expect(locator).toContainText(/\\d messages/);"],"codeLang":"js"},{"type":"code","lines":["assertThat(page.locator(\".title\")).containsText(\"substring\");"],"codeLang":"java"},{"type":"code","lines":["import re","from playwright.async_api import expect","","locator = page.locator('.title')","await expect(locator).to_contain_text(\"substring\")","await expect(locator).to_contain_text(re.compile(r\"\\d messages\"))"],"codeLang":"python async"},{"type":"code","lines":["import re","from playwright.sync_api import expect","","locator = page.locator('.title')","expect(locator).to_contain_text(\"substring\")","expect(locator).to_contain_text(re.compile(r\"\\d messages\"))"],"codeLang":"python sync"},{"type":"code","lines":["var locator = Page.Locator(\".title\");","await Expect(locator).ToContainTextAsync(\"substring\");","await Expect(locator).ToContainTextAsync(new Regex(\"\\\\d messages\"));"],"codeLang":"csharp"},{"type":"text","text":"If you pass an array as an expected value, the expectations are:"},{"type":"li","text":"Locator resolves to a list of elements.","liType":"ordinal"},{"type":"li","text":"Elements from a **subset** of this list contain text from the expected array, respectively.","liType":"ordinal"},{"type":"li","text":"The matching subset of elements has the same order as the expected array.","liType":"ordinal"},{"type":"li","text":"Each text value from the expected array is matched by some element from the list.","liType":"ordinal"},{"type":"text","text":"For example, consider the following list:"},{"type":"code","lines":["<ul>"," <li>Item Text 1</li>"," <li>Item Text 2</li>"," <li>Item Text 3</li>","</ul>"],"codeLang":"html"},{"type":"text","text":"Let's see how we can use the assertion:"},{"type":"code","lines":["// ✓ Contains the right items in the right order","await expect(page.locator('ul > li')).toContainText(['Text 1', 'Text 3']);","","// ✖ Wrong order","await expect(page.locator('ul > li')).toContainText(['Text 3', 'Text 2']);","","// ✖ No item contains this text","await expect(page.locator('ul > li')).toContainText(['Some 33']);","","// ✖ Locator points to the outer list element, not to the list items","await expect(page.locator('ul')).toContainText(['Text 3']);"],"codeLang":"js"},{"type":"code","lines":["// ✓ Contains the right items in the right order","assertThat(page.locator(\"ul > li\")).containsText(new String[] {\"Text 1\", \"Text 3\", \"Text 4\"});","","// ✖ Wrong order","assertThat(page.locator(\"ul > li\")).containsText(new String[] {\"Text 3\", \"Text 2\"});","","// ✖ No item contains this text","assertThat(page.locator(\"ul > li\")).containsText(new String[] {\"Some 33\"});","","// ✖ Locator points to the outer list element, not to the list items","assertThat(page.locator(\"ul\")).containsText(new String[] {\"Text 3\"});"],"codeLang":"java"},{"type":"code","lines":["from playwright.async_api import expect","","# ✓ Contains the right items in the right order","await expect(page.locator(\"ul > li\")).to_contain_text([\"Text 1\", \"Text 3\", \"Text 4\"])","","# ✖ Wrong order","await expect(page.locator(\"ul > li\")).to_contain_text([\"Text 3\", \"Text 2\"])","","# ✖ No item contains this text","await expect(page.locator(\"ul > li\")).to_contain_text([\"Some 33\"])","","# ✖ Locator points to the outer list element, not to the list items","await expect(page.locator(\"ul\")).to_contain_text([\"Text 3\"])"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import expect","","# ✓ Contains the right items in the right order","expect(page.locator(\"ul > li\")).to_contain_text([\"Text 1\", \"Text 3\", \"Text 4\"])","","# ✖ Wrong order","expect(page.locator(\"ul > li\")).to_contain_text([\"Text 3\", \"Text 2\"])","","# ✖ No item contains this text","expect(page.locator(\"ul > li\")).to_contain_text([\"Some 33\"])","","# ✖ Locator points to the outer list element, not to the list items","expect(page.locator(\"ul\")).to_contain_text([\"Text 3\"])"],"codeLang":"python sync"},{"type":"code","lines":["// ✓ Contains the right items in the right order","await Expect(Page.Locator(\"ul > li\")).ToContainTextAsync(new string[] {\"Text 1\", \"Text 3\", \"Text 4\"});","","// ✖ Wrong order","await Expect(Page.Locator(\"ul > li\")).ToContainTextAsync(new string[] {\"Text 3\", \"Text 2\"});","","// ✖ No item contains this text","await Expect(Page.Locator(\"ul > li\")).ToContainTextAsync(new string[] {\"Some 33\"});","","// ✖ Locator points to the outer list element, not to the list items","await Expect(Page.Locator(\"ul\")).ToContainTextAsync(new string[] {\"Text 3\"});"],"codeLang":"csharp"}],"required":true,"comment":"Ensures the `Locator` points to an element that contains the given text. All nested elements will be considered\nwhen computing the text content of the element. You can use regular expressions for the value as well.\n\n**Details**\n\nWhen `expected` parameter is a string, Playwright will normalize whitespaces and line breaks both in the actual\ntext and in the expected string before matching. When regular expression is used, the actual text is matched as is.\n\n**Usage**\n\n```js\nconst locator = page.locator('.title');\nawait expect(locator).toContainText('substring');\nawait expect(locator).toContainText(/\\d messages/);\n```\n\n```java\nassertThat(page.locator(\".title\")).containsText(\"substring\");\n```\n\n```py\nimport re\nfrom playwright.async_api import expect\n\nlocator = page.locator('.title')\nawait expect(locator).to_contain_text(\"substring\")\nawait expect(locator).to_contain_text(re.compile(r\"\\d messages\"))\n```\n\n```py\nimport re\nfrom playwright.sync_api import expect\n\nlocator = page.locator('.title')\nexpect(locator).to_contain_text(\"substring\")\nexpect(locator).to_contain_text(re.compile(r\"\\d messages\"))\n```\n\n```csharp\nvar locator = Page.Locator(\".title\");\nawait Expect(locator).ToContainTextAsync(\"substring\");\nawait Expect(locator).ToContainTextAsync(new Regex(\"\\\\d messages\"));\n```\n\nIf you pass an array as an expected value, the expectations are:\n1. Locator resolves to a list of elements.\n1. Elements from a **subset** of this list contain text from the expected array, respectively.\n1. The matching subset of elements has the same order as the expected array.\n1. Each text value from the expected array is matched by some element from the list.\n\nFor example, consider the following list:\n\n```html\n<ul>\n <li>Item Text 1</li>\n <li>Item Text 2</li>\n <li>Item Text 3</li>\n</ul>\n```\n\nLet's see how we can use the assertion:\n\n```js\n// ✓ Contains the right items in the right order\nawait expect(page.locator('ul > li')).toContainText(['Text 1', 'Text 3']);\n\n// ✖ Wrong order\nawait expect(page.locator('ul > li')).toContainText(['Text 3', 'Text 2']);\n\n// ✖ No item contains this text\nawait expect(page.locator('ul > li')).toContainText(['Some 33']);\n\n// ✖ Locator points to the outer list element, not to the list items\nawait expect(page.locator('ul')).toContainText(['Text 3']);\n```\n\n```java\n// ✓ Contains the right items in the right order\nassertThat(page.locator(\"ul > li\")).containsText(new String[] {\"Text 1\", \"Text 3\", \"Text 4\"});\n\n// ✖ Wrong order\nassertThat(page.locator(\"ul > li\")).containsText(new String[] {\"Text 3\", \"Text 2\"});\n\n// ✖ No item contains this text\nassertThat(page.locator(\"ul > li\")).containsText(new String[] {\"Some 33\"});\n\n// ✖ Locator points to the outer list element, not to the list items\nassertThat(page.locator(\"ul\")).containsText(new String[] {\"Text 3\"});\n```\n\n```py\nfrom playwright.async_api import expect\n\n# ✓ Contains the right items in the right order\nawait expect(page.locator(\"ul > li\")).to_contain_text([\"Text 1\", \"Text 3\", \"Text 4\"])\n\n# ✖ Wrong order\nawait expect(page.locator(\"ul > li\")).to_contain_text([\"Text 3\", \"Text 2\"])\n\n# ✖ No item contains this text\nawait expect(page.locator(\"ul > li\")).to_contain_text([\"Some 33\"])\n\n# ✖ Locator points to the outer list element, not to the list items\nawait expect(page.locator(\"ul\")).to_contain_text([\"Text 3\"])\n```\n\n```py\nfrom playwright.sync_api import expect\n\n# ✓ Contains the right items in the right order\nexpect(page.locator(\"ul > li\")).to_contain_text([\"Text 1\", \"Text 3\", \"Text 4\"])\n\n# ✖ Wrong order\nexpect(page.locator(\"ul > li\")).to_contain_text([\"Text 3\", \"Text 2\"])\n\n# ✖ No item contains this text\nexpect(page.locator(\"ul > li\")).to_contain_text([\"Some 33\"])\n\n# ✖ Locator points to the outer list element, not to the list items\nexpect(page.locator(\"ul\")).to_contain_text([\"Text 3\"])\n```\n\n```csharp\n// ✓ Contains the right items in the right order\nawait Expect(Page.Locator(\"ul > li\")).ToContainTextAsync(new string[] {\"Text 1\", \"Text 3\", \"Text 4\"});\n\n// ✖ Wrong order\nawait Expect(Page.Locator(\"ul > li\")).ToContainTextAsync(new string[] {\"Text 3\", \"Text 2\"});\n\n// ✖ No item contains this text\nawait Expect(Page.Locator(\"ul > li\")).ToContainTextAsync(new string[] {\"Some 33\"});\n\n// ✖ Locator points to the outer list element, not to the list items\nawait Expect(Page.Locator(\"ul\")).ToContainTextAsync(new string[] {\"Text 3\"});\n```\n","async":true,"alias":"toContainText","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"expected","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"},{"name":"Array","templates":[{"name":"","union":[{"name":"string"},{"name":"RegExp"}]}]}],"expression":"[string]|[RegExp]|[Array]<[string]|[RegExp]>"},"spec":[{"type":"text","text":"Expected substring or RegExp or a list of those."}],"required":true,"comment":"Expected substring or RegExp or a list of those.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"expected","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"},{"name":"Array","templates":[{"name":"string"}]},{"name":"Array","templates":[{"name":"RegExp"}]},{"name":"Array","templates":[{"name":"","union":[{"name":"string"},{"name":"RegExp"}]}]}],"expression":"[string]|[RegExp]|[Array]<[string]>|[Array]<[RegExp]>|[Array]<[string]|[RegExp]>"},"spec":[{"type":"text","text":"Expected substring or RegExp or a list of those."}],"required":true,"comment":"Expected substring or RegExp or a list of those.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"expected","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"},{"name":"Array","templates":[{"name":"string"}]},{"name":"Array","templates":[{"name":"RegExp"}]}],"expression":"[string]|[RegExp]|[Array]<[string]>|[Array]<[RegExp]>"},"spec":[{"type":"text","text":"Expected substring or RegExp or a list of those."}],"required":true,"comment":"Expected substring or RegExp or a list of those.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.23","name":"ignoreCase","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular expression flag if specified."}],"required":false,"comment":"Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular\nexpression flag if specified.","async":false,"alias":"ignoreCase","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.18","name":"useInnerText","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to use `element.innerText` instead of `element.textContent` when retrieving DOM node text."}],"required":false,"comment":"Whether to use `element.innerText` instead of `element.textContent` when retrieving DOM node text.","async":false,"alias":"useInnerText","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"hasAccessibleDescription"},"types":{},"overrides":{}},"since":"v1.44","name":"toHaveAccessibleDescription","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures the `Locator` points to an element with a given [accessible description](https://w3c.github.io/accname/#dfn-accessible-description)."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const locator = page.getByTestId('save-button');","await expect(locator).toHaveAccessibleDescription('Save results to disk');"],"codeLang":"js"},{"type":"code","lines":["Locator locator = page.getByTestId(\"save-button\");","assertThat(locator).hasAccessibleDescription(\"Save results to disk\");"],"codeLang":"java"},{"type":"code","lines":["locator = page.get_by_test_id(\"save-button\")","await expect(locator).to_have_accessible_description(\"Save results to disk\")"],"codeLang":"python async"},{"type":"code","lines":["locator = page.get_by_test_id(\"save-button\")","expect(locator).to_have_accessible_description(\"Save results to disk\")"],"codeLang":"python sync"},{"type":"code","lines":["var locator = Page.GetByTestId(\"save-button\");","await Expect(locator).toHaveAccessibleDescriptionAsync(\"Save results to disk\");"],"codeLang":"csharp"}],"required":true,"comment":"Ensures the `Locator` points to an element with a given\n[accessible description](https://w3c.github.io/accname/#dfn-accessible-description).\n\n**Usage**\n\n```js\nconst locator = page.getByTestId('save-button');\nawait expect(locator).toHaveAccessibleDescription('Save results to disk');\n```\n\n```java\nLocator locator = page.getByTestId(\"save-button\");\nassertThat(locator).hasAccessibleDescription(\"Save results to disk\");\n```\n\n```py\nlocator = page.get_by_test_id(\"save-button\")\nawait expect(locator).to_have_accessible_description(\"Save results to disk\")\n```\n\n```py\nlocator = page.get_by_test_id(\"save-button\")\nexpect(locator).to_have_accessible_description(\"Save results to disk\")\n```\n\n```csharp\nvar locator = Page.GetByTestId(\"save-button\");\nawait Expect(locator).toHaveAccessibleDescriptionAsync(\"Save results to disk\");\n```\n","async":true,"alias":"toHaveAccessibleDescription","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.44","name":"description","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Expected accessible description."}],"required":true,"comment":"Expected accessible description.","async":false,"alias":"description","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.44","name":"ignoreCase","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular expression flag if specified."}],"required":false,"comment":"Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular\nexpression flag if specified.","async":false,"alias":"ignoreCase","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.44","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.44","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"hasAccessibleName"},"types":{},"overrides":{}},"since":"v1.44","name":"toHaveAccessibleName","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures the `Locator` points to an element with a given [accessible name](https://w3c.github.io/accname/#dfn-accessible-name)."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const locator = page.getByTestId('save-button');","await expect(locator).toHaveAccessibleName('Save to disk');"],"codeLang":"js"},{"type":"code","lines":["Locator locator = page.getByTestId(\"save-button\");","assertThat(locator).hasAccessibleName(\"Save to disk\");"],"codeLang":"java"},{"type":"code","lines":["locator = page.get_by_test_id(\"save-button\")","await expect(locator).to_have_accessible_name(\"Save to disk\")"],"codeLang":"python async"},{"type":"code","lines":["locator = page.get_by_test_id(\"save-button\")","expect(locator).to_have_accessible_name(\"Save to disk\")"],"codeLang":"python sync"},{"type":"code","lines":["var locator = Page.GetByTestId(\"save-button\");","await Expect(locator).toHaveAccessibleNameAsync(\"Save to disk\");"],"codeLang":"csharp"}],"required":true,"comment":"Ensures the `Locator` points to an element with a given\n[accessible name](https://w3c.github.io/accname/#dfn-accessible-name).\n\n**Usage**\n\n```js\nconst locator = page.getByTestId('save-button');\nawait expect(locator).toHaveAccessibleName('Save to disk');\n```\n\n```java\nLocator locator = page.getByTestId(\"save-button\");\nassertThat(locator).hasAccessibleName(\"Save to disk\");\n```\n\n```py\nlocator = page.get_by_test_id(\"save-button\")\nawait expect(locator).to_have_accessible_name(\"Save to disk\")\n```\n\n```py\nlocator = page.get_by_test_id(\"save-button\")\nexpect(locator).to_have_accessible_name(\"Save to disk\")\n```\n\n```csharp\nvar locator = Page.GetByTestId(\"save-button\");\nawait Expect(locator).toHaveAccessibleNameAsync(\"Save to disk\");\n```\n","async":true,"alias":"toHaveAccessibleName","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.44","name":"name","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Expected accessible name."}],"required":true,"comment":"Expected accessible name.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.44","name":"ignoreCase","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular expression flag if specified."}],"required":false,"comment":"Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular\nexpression flag if specified.","async":false,"alias":"ignoreCase","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.44","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.44","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"hasAttribute"},"types":{},"overrides":{}},"since":"v1.20","name":"toHaveAttribute","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures the `Locator` points to an element with given attribute."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const locator = page.locator('input');","await expect(locator).toHaveAttribute('type', 'text');"],"codeLang":"js"},{"type":"code","lines":["assertThat(page.locator(\"input\")).hasAttribute(\"type\", \"text\");"],"codeLang":"java"},{"type":"code","lines":["from playwright.async_api import expect","","locator = page.locator(\"input\")","await expect(locator).to_have_attribute(\"type\", \"text\")"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import expect","","locator = page.locator(\"input\")","expect(locator).to_have_attribute(\"type\", \"text\")"],"codeLang":"python sync"},{"type":"code","lines":["var locator = Page.Locator(\"input\");","await Expect(locator).ToHaveAttributeAsync(\"type\", \"text\");"],"codeLang":"csharp"}],"required":true,"comment":"Ensures the `Locator` points to an element with given attribute.\n\n**Usage**\n\n```js\nconst locator = page.locator('input');\nawait expect(locator).toHaveAttribute('type', 'text');\n```\n\n```java\nassertThat(page.locator(\"input\")).hasAttribute(\"type\", \"text\");\n```\n\n```py\nfrom playwright.async_api import expect\n\nlocator = page.locator(\"input\")\nawait expect(locator).to_have_attribute(\"type\", \"text\")\n```\n\n```py\nfrom playwright.sync_api import expect\n\nlocator = page.locator(\"input\")\nexpect(locator).to_have_attribute(\"type\", \"text\")\n```\n\n```csharp\nvar locator = Page.Locator(\"input\");\nawait Expect(locator).ToHaveAttributeAsync(\"type\", \"text\");\n```\n","async":true,"alias":"toHaveAttribute","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Attribute name."}],"required":true,"comment":"Attribute name.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.18","name":"value","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Expected attribute value."}],"required":true,"comment":"Expected attribute value.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.40","name":"ignoreCase","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular expression flag if specified."}],"required":false,"comment":"Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular\nexpression flag if specified.","async":false,"alias":"ignoreCase","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.39","name":"toHaveAttribute#2","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures the `Locator` points to an element with given attribute. The method will assert attribute↵presence."},{"type":"code","lines":["const locator = page.locator('input');","// Assert attribute existence.","await expect(locator).toHaveAttribute('disabled');","await expect(locator).not.toHaveAttribute('open');"],"codeLang":"js"}],"required":true,"comment":"Ensures the `Locator` points to an element with given attribute. The method will assert attribute presence.\n\n```js\nconst locator = page.locator('input');\n// Assert attribute existence.\nawait expect(locator).toHaveAttribute('disabled');\nawait expect(locator).not.toHaveAttribute('open');\n```\n","async":true,"alias":"toHaveAttribute","overloadIndex":1,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.39","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Attribute name."}],"required":true,"comment":"Attribute name.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.39","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"hasClass"},"types":{},"overrides":{}},"since":"v1.20","name":"toHaveClass","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures the `Locator` points to an element with given CSS classes. This needs to be a full match↵or using a relaxed regular expression."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["<div class='selected row' id='component'></div>"],"codeLang":"html"},{"type":"code","lines":["const locator = page.locator('#component');","await expect(locator).toHaveClass(/selected/);","await expect(locator).toHaveClass('selected row');"],"codeLang":"js"},{"type":"code","lines":["assertThat(page.locator(\"#component\")).hasClass(Pattern.compile(\"selected\"));","assertThat(page.locator(\"#component\")).hasClass(\"selected row\");"],"codeLang":"java"},{"type":"code","lines":["from playwright.async_api import expect","","locator = page.locator(\"#component\")","await expect(locator).to_have_class(re.compile(r\"selected\"))","await expect(locator).to_have_class(\"selected row\")"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import expect","","locator = page.locator(\"#component\")","expect(locator).to_have_class(re.compile(r\"selected\"))","expect(locator).to_have_class(\"selected row\")"],"codeLang":"python sync"},{"type":"code","lines":["var locator = Page.Locator(\"#component\");","await Expect(locator).ToHaveClassAsync(new Regex(\"selected\"));","await Expect(locator).ToHaveClassAsync(\"selected row\");"],"codeLang":"csharp"},{"type":"text","text":"Note that if array is passed as an expected value, entire lists of elements can be asserted:"},{"type":"code","lines":["const locator = page.locator('list > .component');","await expect(locator).toHaveClass(['component', 'component selected', 'component']);"],"codeLang":"js"},{"type":"code","lines":["assertThat(page.locator(\"list > .component\")).hasClass(new String[] {\"component\", \"component selected\", \"component\"});"],"codeLang":"java"},{"type":"code","lines":["from playwright.async_api import expect","","locator = page.locator(\"list > .component\")","await expect(locator).to_have_class([\"component\", \"component selected\", \"component\"])"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import expect","","locator = page.locator(\"list > .component\")","expect(locator).to_have_class([\"component\", \"component selected\", \"component\"])"],"codeLang":"python sync"},{"type":"code","lines":["var locator = Page.Locator(\"list > .component\");","await Expect(locator).ToHaveClassAsync(new string[]{\"component\", \"component selected\", \"component\"});"],"codeLang":"csharp"}],"required":true,"comment":"Ensures the `Locator` points to an element with given CSS classes. This needs to be a full match or using a relaxed\nregular expression.\n\n**Usage**\n\n```html\n<div class='selected row' id='component'></div>\n```\n\n```js\nconst locator = page.locator('#component');\nawait expect(locator).toHaveClass(/selected/);\nawait expect(locator).toHaveClass('selected row');\n```\n\n```java\nassertThat(page.locator(\"#component\")).hasClass(Pattern.compile(\"selected\"));\nassertThat(page.locator(\"#component\")).hasClass(\"selected row\");\n```\n\n```py\nfrom playwright.async_api import expect\n\nlocator = page.locator(\"#component\")\nawait expect(locator).to_have_class(re.compile(r\"selected\"))\nawait expect(locator).to_have_class(\"selected row\")\n```\n\n```py\nfrom playwright.sync_api import expect\n\nlocator = page.locator(\"#component\")\nexpect(locator).to_have_class(re.compile(r\"selected\"))\nexpect(locator).to_have_class(\"selected row\")\n```\n\n```csharp\nvar locator = Page.Locator(\"#component\");\nawait Expect(locator).ToHaveClassAsync(new Regex(\"selected\"));\nawait Expect(locator).ToHaveClassAsync(\"selected row\");\n```\n\nNote that if array is passed as an expected value, entire lists of elements can be asserted:\n\n```js\nconst locator = page.locator('list > .component');\nawait expect(locator).toHaveClass(['component', 'component selected', 'component']);\n```\n\n```java\nassertThat(page.locator(\"list > .component\")).hasClass(new String[] {\"component\", \"component selected\", \"component\"});\n```\n\n```py\nfrom playwright.async_api import expect\n\nlocator = page.locator(\"list > .component\")\nawait expect(locator).to_have_class([\"component\", \"component selected\", \"component\"])\n```\n\n```py\nfrom playwright.sync_api import expect\n\nlocator = page.locator(\"list > .component\")\nexpect(locator).to_have_class([\"component\", \"component selected\", \"component\"])\n```\n\n```csharp\nvar locator = Page.Locator(\"list > .component\");\nawait Expect(locator).ToHaveClassAsync(new string[]{\"component\", \"component selected\", \"component\"});\n```\n","async":true,"alias":"toHaveClass","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"expected","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"},{"name":"Array","templates":[{"name":"","union":[{"name":"string"},{"name":"RegExp"}]}]}],"expression":"[string]|[RegExp]|[Array]<[string]|[RegExp]>"},"spec":[{"type":"text","text":"Expected class or RegExp or a list of those."}],"required":true,"comment":"Expected class or RegExp or a list of those.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"expected","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"},{"name":"Array","templates":[{"name":"string"}]},{"name":"Array","templates":[{"name":"RegExp"}]},{"name":"Array","templates":[{"name":"","union":[{"name":"string"},{"name":"RegExp"}]}]}],"expression":"[string]|[RegExp]|[Array]<[string]>|[Array]<[RegExp]>|[Array]<[string]|[RegExp]>"},"spec":[{"type":"text","text":"Expected class or RegExp or a list of those."}],"required":true,"comment":"Expected class or RegExp or a list of those.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"expected","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"},{"name":"Array","templates":[{"name":"string"}]},{"name":"Array","templates":[{"name":"RegExp"}]}],"expression":"[string]|[RegExp]|[Array]<[string]>|[Array]<[RegExp]>"},"spec":[{"type":"text","text":"Expected class or RegExp or a list of those."}],"required":true,"comment":"Expected class or RegExp or a list of those.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"hasCount"},"types":{},"overrides":{}},"since":"v1.20","name":"toHaveCount","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures the `Locator` resolves to an exact number of DOM nodes."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const list = page.locator('list > .component');","await expect(list).toHaveCount(3);"],"codeLang":"js"},{"type":"code","lines":["assertThat(page.locator(\"list > .component\")).hasCount(3);"],"codeLang":"java"},{"type":"code","lines":["from playwright.async_api import expect","","locator = page.locator(\"list > .component\")","await expect(locator).to_have_count(3)"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import expect","","locator = page.locator(\"list > .component\")","expect(locator).to_have_count(3)"],"codeLang":"python sync"},{"type":"code","lines":["var locator = Page.Locator(\"list > .component\");","await Expect(locator).ToHaveCountAsync(3);"],"codeLang":"csharp"}],"required":true,"comment":"Ensures the `Locator` resolves to an exact number of DOM nodes.\n\n**Usage**\n\n```js\nconst list = page.locator('list > .component');\nawait expect(list).toHaveCount(3);\n```\n\n```java\nassertThat(page.locator(\"list > .component\")).hasCount(3);\n```\n\n```py\nfrom playwright.async_api import expect\n\nlocator = page.locator(\"list > .component\")\nawait expect(locator).to_have_count(3)\n```\n\n```py\nfrom playwright.sync_api import expect\n\nlocator = page.locator(\"list > .component\")\nexpect(locator).to_have_count(3)\n```\n\n```csharp\nvar locator = Page.Locator(\"list > .component\");\nawait Expect(locator).ToHaveCountAsync(3);\n```\n","async":true,"alias":"toHaveCount","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"count","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Expected count."}],"required":true,"comment":"Expected count.","async":false,"alias":"count","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"hasCSS"},"types":{},"overrides":{}},"since":"v1.20","name":"toHaveCSS","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures the `Locator` resolves to an element with the given computed CSS style."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const locator = page.getByRole('button');","await expect(locator).toHaveCSS('display', 'flex');"],"codeLang":"js"},{"type":"code","lines":["assertThat(page.getByRole(AriaRole.BUTTON)).hasCSS(\"display\", \"flex\");"],"codeLang":"java"},{"type":"code","lines":["from playwright.async_api import expect","","locator = page.get_by_role(\"button\")","await expect(locator).to_have_css(\"display\", \"flex\")"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import expect","","locator = page.get_by_role(\"button\")","expect(locator).to_have_css(\"display\", \"flex\")"],"codeLang":"python sync"},{"type":"code","lines":["var locator = Page.GetByRole(AriaRole.Button);","await Expect(locator).ToHaveCSSAsync(\"display\", \"flex\");"],"codeLang":"csharp"}],"required":true,"comment":"Ensures the `Locator` resolves to an element with the given computed CSS style.\n\n**Usage**\n\n```js\nconst locator = page.getByRole('button');\nawait expect(locator).toHaveCSS('display', 'flex');\n```\n\n```java\nassertThat(page.getByRole(AriaRole.BUTTON)).hasCSS(\"display\", \"flex\");\n```\n\n```py\nfrom playwright.async_api import expect\n\nlocator = page.get_by_role(\"button\")\nawait expect(locator).to_have_css(\"display\", \"flex\")\n```\n\n```py\nfrom playwright.sync_api import expect\n\nlocator = page.get_by_role(\"button\")\nexpect(locator).to_have_css(\"display\", \"flex\")\n```\n\n```csharp\nvar locator = Page.GetByRole(AriaRole.Button);\nawait Expect(locator).ToHaveCSSAsync(\"display\", \"flex\");\n```\n","async":true,"alias":"toHaveCSS","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"CSS property name."}],"required":true,"comment":"CSS property name.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.18","name":"value","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"CSS property value."}],"required":true,"comment":"CSS property value.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"hasId"},"types":{},"overrides":{}},"since":"v1.20","name":"toHaveId","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures the `Locator` points to an element with the given DOM Node ID."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const locator = page.getByRole('textbox');","await expect(locator).toHaveId('lastname');"],"codeLang":"js"},{"type":"code","lines":["assertThat(page.getByRole(AriaRole.TEXTBOX)).hasId(\"lastname\");"],"codeLang":"java"},{"type":"code","lines":["from playwright.async_api import expect","","locator = page.get_by_role(\"textbox\")","await expect(locator).to_have_id(\"lastname\")"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import expect","","locator = page.get_by_role(\"textbox\")","expect(locator).to_have_id(\"lastname\")"],"codeLang":"python sync"},{"type":"code","lines":["var locator = Page.GetByRole(AriaRole.Textbox);","await Expect(locator).ToHaveIdAsync(\"lastname\");"],"codeLang":"csharp"}],"required":true,"comment":"Ensures the `Locator` points to an element with the given DOM Node ID.\n\n**Usage**\n\n```js\nconst locator = page.getByRole('textbox');\nawait expect(locator).toHaveId('lastname');\n```\n\n```java\nassertThat(page.getByRole(AriaRole.TEXTBOX)).hasId(\"lastname\");\n```\n\n```py\nfrom playwright.async_api import expect\n\nlocator = page.get_by_role(\"textbox\")\nawait expect(locator).to_have_id(\"lastname\")\n```\n\n```py\nfrom playwright.sync_api import expect\n\nlocator = page.get_by_role(\"textbox\")\nexpect(locator).to_have_id(\"lastname\")\n```\n\n```csharp\nvar locator = Page.GetByRole(AriaRole.Textbox);\nawait Expect(locator).ToHaveIdAsync(\"lastname\");\n```\n","async":true,"alias":"toHaveId","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"id","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Element id."}],"required":true,"comment":"Element id.","async":false,"alias":"id","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"hasJSProperty"},"types":{},"overrides":{}},"since":"v1.20","name":"toHaveJSProperty","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures the `Locator` points to an element with given JavaScript property. Note that this property can be↵of a primitive type as well as a plain serializable JavaScript object."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const locator = page.locator('.component');","await expect(locator).toHaveJSProperty('loaded', true);"],"codeLang":"js"},{"type":"code","lines":["assertThat(page.locator(\"input\")).hasJSProperty(\"loaded\", true);"],"codeLang":"java"},{"type":"code","lines":["from playwright.async_api import expect","","locator = page.locator(\".component\")","await expect(locator).to_have_js_property(\"loaded\", True)"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import expect","","locator = page.locator(\".component\")","expect(locator).to_have_js_property(\"loaded\", True)"],"codeLang":"python sync"},{"type":"code","lines":["var locator = Page.Locator(\".component\");","await Expect(locator).ToHaveJSPropertyAsync(\"loaded\", true);"],"codeLang":"csharp"}],"required":true,"comment":"Ensures the `Locator` points to an element with given JavaScript property. Note that this property can be of a\nprimitive type as well as a plain serializable JavaScript object.\n\n**Usage**\n\n```js\nconst locator = page.locator('.component');\nawait expect(locator).toHaveJSProperty('loaded', true);\n```\n\n```java\nassertThat(page.locator(\"input\")).hasJSProperty(\"loaded\", true);\n```\n\n```py\nfrom playwright.async_api import expect\n\nlocator = page.locator(\".component\")\nawait expect(locator).to_have_js_property(\"loaded\", True)\n```\n\n```py\nfrom playwright.sync_api import expect\n\nlocator = page.locator(\".component\")\nexpect(locator).to_have_js_property(\"loaded\", True)\n```\n\n```csharp\nvar locator = Page.Locator(\".component\");\nawait Expect(locator).ToHaveJSPropertyAsync(\"loaded\", true);\n```\n","async":true,"alias":"toHaveJSProperty","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Property name."}],"required":true,"comment":"Property name.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.18","name":"value","type":{"name":"any","expression":"[any]"},"spec":[{"type":"text","text":"Property value."}],"required":true,"comment":"Property value.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"hasRole"},"types":{},"overrides":{}},"since":"v1.44","name":"toHaveRole","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures the `Locator` points to an element with a given [ARIA role](https://www.w3.org/TR/wai-aria-1.2/#roles)."},{"type":"text","text":"Note that role is matched as a string, disregarding the ARIA role hierarchy. For example, asserting a superclass role `\"checkbox\"` on an element with a subclass role `\"switch\"` will fail."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const locator = page.getByTestId('save-button');","await expect(locator).toHaveRole('button');"],"codeLang":"js"},{"type":"code","lines":["Locator locator = page.getByTestId(\"save-button\");","assertThat(locator).hasRole(AriaRole.BUTTON);"],"codeLang":"java"},{"type":"code","lines":["locator = page.get_by_test_id(\"save-button\")","await expect(locator).to_have_role(\"button\")"],"codeLang":"python async"},{"type":"code","lines":["locator = page.get_by_test_id(\"save-button\")","expect(locator).to_have_role(\"button\")"],"codeLang":"python sync"},{"type":"code","lines":["var locator = Page.GetByTestId(\"save-button\");","await Expect(locator).ToHaveRoleAsync(AriaRole.Button);"],"codeLang":"csharp"}],"required":true,"comment":"Ensures the `Locator` points to an element with a given [ARIA role](https://www.w3.org/TR/wai-aria-1.2/#roles).\n\nNote that role is matched as a string, disregarding the ARIA role hierarchy. For example, asserting a superclass\nrole `\"checkbox\"` on an element with a subclass role `\"switch\"` will fail.\n\n**Usage**\n\n```js\nconst locator = page.getByTestId('save-button');\nawait expect(locator).toHaveRole('button');\n```\n\n```java\nLocator locator = page.getByTestId(\"save-button\");\nassertThat(locator).hasRole(AriaRole.BUTTON);\n```\n\n```py\nlocator = page.get_by_test_id(\"save-button\")\nawait expect(locator).to_have_role(\"button\")\n```\n\n```py\nlocator = page.get_by_test_id(\"save-button\")\nexpect(locator).to_have_role(\"button\")\n```\n\n```csharp\nvar locator = Page.GetByTestId(\"save-button\");\nawait Expect(locator).ToHaveRoleAsync(AriaRole.Button);\n```\n","async":true,"alias":"toHaveRole","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.44","name":"role","type":{"name":"AriaRole","union":[{"name":"\"alert\""},{"name":"\"alertdialog\""},{"name":"\"application\""},{"name":"\"article\""},{"name":"\"banner\""},{"name":"\"blockquote\""},{"name":"\"button\""},{"name":"\"caption\""},{"name":"\"cell\""},{"name":"\"checkbox\""},{"name":"\"code\""},{"name":"\"columnheader\""},{"name":"\"combobox\""},{"name":"\"complementary\""},{"name":"\"contentinfo\""},{"name":"\"definition\""},{"name":"\"deletion\""},{"name":"\"dialog\""},{"name":"\"directory\""},{"name":"\"document\""},{"name":"\"emphasis\""},{"name":"\"feed\""},{"name":"\"figure\""},{"name":"\"form\""},{"name":"\"generic\""},{"name":"\"grid\""},{"name":"\"gridcell\""},{"name":"\"group\""},{"name":"\"heading\""},{"name":"\"img\""},{"name":"\"insertion\""},{"name":"\"link\""},{"name":"\"list\""},{"name":"\"listbox\""},{"name":"\"listitem\""},{"name":"\"log\""},{"name":"\"main\""},{"name":"\"marquee\""},{"name":"\"math\""},{"name":"\"meter\""},{"name":"\"menu\""},{"name":"\"menubar\""},{"name":"\"menuitem\""},{"name":"\"menuitemcheckbox\""},{"name":"\"menuitemradio\""},{"name":"\"navigation\""},{"name":"\"none\""},{"name":"\"note\""},{"name":"\"option\""},{"name":"\"paragraph\""},{"name":"\"presentation\""},{"name":"\"progressbar\""},{"name":"\"radio\""},{"name":"\"radiogroup\""},{"name":"\"region\""},{"name":"\"row\""},{"name":"\"rowgroup\""},{"name":"\"rowheader\""},{"name":"\"scrollbar\""},{"name":"\"search\""},{"name":"\"searchbox\""},{"name":"\"separator\""},{"name":"\"slider\""},{"name":"\"spinbutton\""},{"name":"\"status\""},{"name":"\"strong\""},{"name":"\"subscript\""},{"name":"\"superscript\""},{"name":"\"switch\""},{"name":"\"tab\""},{"name":"\"table\""},{"name":"\"tablist\""},{"name":"\"tabpanel\""},{"name":"\"term\""},{"name":"\"textbox\""},{"name":"\"time\""},{"name":"\"timer\""},{"name":"\"toolbar\""},{"name":"\"tooltip\""},{"name":"\"tree\""},{"name":"\"treegrid\""},{"name":"\"treeitem\""}],"expression":"[AriaRole]<\"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\"|\"meter\"|\"menu\"|\"menubar\"|\"menuitem\"|\"menuitemcheckbox\"|\"menuitemradio\"|\"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\">"},"spec":[{"type":"text","text":"Required aria role."}],"required":true,"comment":"Required aria role.","async":false,"alias":"role","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.44","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.44","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"toHaveScreenshot#1","type":{"name":"void"},"spec":[{"type":"text","text":"This function will wait until two consecutive locator screenshots↵yield the same result, and then compare the last screenshot with the expectation."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const locator = page.getByRole('button');","await expect(locator).toHaveScreenshot('image.png');"],"codeLang":"js"},{"type":"text","text":"Note that screenshot assertions only work with Playwright test runner."}],"required":true,"comment":"This function will wait until two consecutive locator screenshots yield the same result, and then compare the last\nscreenshot with the expectation.\n\n**Usage**\n\n```js\nconst locator = page.getByRole('button');\nawait expect(locator).toHaveScreenshot('image.png');\n```\n\nNote that screenshot assertions only work with Playwright test runner.","async":true,"alias":"toHaveScreenshot","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.23","name":"name","type":{"name":"","union":[{"name":"string"},{"name":"Array","templates":[{"name":"string"}]}],"expression":"[string]|[Array]<[string]>"},"spec":[{"type":"text","text":"Snapshot name."}],"required":true,"comment":"Snapshot name.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.23","name":"animations","type":{"name":"ScreenshotAnimations","union":[{"name":"\"disabled\""},{"name":"\"allow\""}],"expression":"[ScreenshotAnimations]<\"disabled\"|\"allow\">"},"spec":[{"type":"text","text":"When set to `\"disabled\"`, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment depending on their duration:"},{"type":"li","text":"finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.","liType":"bullet"},{"type":"li","text":"infinite animations are canceled to initial state, and then played over after the screenshot.","liType":"bullet"},{"type":"text","text":"Defaults to `\"disabled\"` that disables animations."}],"required":false,"comment":"When set to `\"disabled\"`, stops CSS animations, CSS transitions and Web Animations. Animations get different\ntreatment depending on their duration:\n- finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.\n- infinite animations are canceled to initial state, and then played over after the screenshot.\n\nDefaults to `\"disabled\"` that disables animations.","async":false,"alias":"animations","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.23","name":"caret","type":{"name":"ScreenshotCaret","union":[{"name":"\"hide\""},{"name":"\"initial\""}],"expression":"[ScreenshotCaret]<\"hide\"|\"initial\">"},"spec":[{"type":"text","text":"When set to `\"hide\"`, screenshot will hide text caret. When set to `\"initial\"`, text caret behavior will not be changed. Defaults to `\"hide\"`."}],"required":false,"comment":"When set to `\"hide\"`, screenshot will hide text caret. When set to `\"initial\"`, text caret behavior will not be\nchanged. Defaults to `\"hide\"`.","async":false,"alias":"caret","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.23","name":"mask","type":{"name":"Array","templates":[{"name":"Locator"}],"expression":"[Array]<[Locator]>"},"spec":[{"type":"text","text":"Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with↵a pink box `#FF00FF` (customized by `maskColor`) that completely covers its bounding box."}],"required":false,"comment":"Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink\nbox `#FF00FF` (customized by `maskColor`) that completely covers its bounding box.","async":false,"alias":"mask","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.35","name":"maskColor","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Specify the color of the overlay box for masked elements, in [CSS color format](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value). Default color is pink `#FF00FF`."}],"required":false,"comment":"Specify the color of the overlay box for masked elements, in\n[CSS color format](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value). Default color is pink `#FF00FF`.","async":false,"alias":"maskColor","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"maxDiffPixelRatio","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"An acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1`. Default is configurable with `TestConfig.expect`. Unset by default."}],"required":false,"comment":"An acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1`. Default is\nconfigurable with `TestConfig.expect`. Unset by default.","async":false,"alias":"maxDiffPixelRatio","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"maxDiffPixels","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"An acceptable amount of pixels that could be different. Default is configurable with `TestConfig.expect`. Unset by default."}],"required":false,"comment":"An acceptable amount of pixels that could be different. Default is configurable with `TestConfig.expect`. Unset by\ndefault.","async":false,"alias":"maxDiffPixels","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.23","name":"omitBackground","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images.↵Defaults to `false`."}],"required":false,"comment":"Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images.\nDefaults to `false`.","async":false,"alias":"omitBackground","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.23","name":"scale","type":{"name":"ScreenshotScale","union":[{"name":"\"css\""},{"name":"\"device\""}],"expression":"[ScreenshotScale]<\"css\"|\"device\">"},"spec":[{"type":"text","text":"When set to `\"css\"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this will keep screenshots small. Using `\"device\"` option will produce a single pixel per each device pixel, so screenshots of high-dpi devices will be twice as large or even larger."},{"type":"text","text":"Defaults to `\"css\"`."}],"required":false,"comment":"When set to `\"css\"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this\nwill keep screenshots small. Using `\"device\"` option will produce a single pixel per each device pixel, so\nscreenshots of high-dpi devices will be twice as large or even larger.\n\nDefaults to `\"css\"`.","async":false,"alias":"scale","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.41","name":"stylePath","type":{"name":"","union":[{"name":"string"},{"name":"Array","templates":[{"name":"string"}]}],"expression":"[string]|[Array]<[string]>"},"spec":[{"type":"text","text":"File name containing the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make elements invisible or change their properties to help you creating repeatable screenshots. This stylesheet pierces the Shadow DOM and applies to the inner frames."}],"required":false,"comment":"File name containing the stylesheet to apply while making the screenshot. This is where you can hide dynamic\nelements, make elements invisible or change their properties to help you creating repeatable screenshots. This\nstylesheet pierces the Shadow DOM and applies to the inner frames.","async":false,"alias":"stylePath","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"threshold","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ)↵between the same pixel in compared images, between zero (strict) and one (lax), default is configurable with↵`TestConfig.expect`. Defaults to `0.2`."}],"required":false,"comment":"An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the\nsame pixel in compared images, between zero (strict) and one (lax), default is configurable with\n`TestConfig.expect`. Defaults to `0.2`.","async":false,"alias":"threshold","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"toHaveScreenshot#2","type":{"name":"void"},"spec":[{"type":"text","text":"This function will wait until two consecutive locator screenshots↵yield the same result, and then compare the last screenshot with the expectation."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const locator = page.getByRole('button');","await expect(locator).toHaveScreenshot();"],"codeLang":"js"},{"type":"text","text":"Note that screenshot assertions only work with Playwright test runner."}],"required":true,"comment":"This function will wait until two consecutive locator screenshots yield the same result, and then compare the last\nscreenshot with the expectation.\n\n**Usage**\n\n```js\nconst locator = page.getByRole('button');\nawait expect(locator).toHaveScreenshot();\n```\n\nNote that screenshot assertions only work with Playwright test runner.","async":true,"alias":"toHaveScreenshot","overloadIndex":1,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.23","name":"animations","type":{"name":"ScreenshotAnimations","union":[{"name":"\"disabled\""},{"name":"\"allow\""}],"expression":"[ScreenshotAnimations]<\"disabled\"|\"allow\">"},"spec":[{"type":"text","text":"When set to `\"disabled\"`, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment depending on their duration:"},{"type":"li","text":"finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.","liType":"bullet"},{"type":"li","text":"infinite animations are canceled to initial state, and then played over after the screenshot.","liType":"bullet"},{"type":"text","text":"Defaults to `\"disabled\"` that disables animations."}],"required":false,"comment":"When set to `\"disabled\"`, stops CSS animations, CSS transitions and Web Animations. Animations get different\ntreatment depending on their duration:\n- finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.\n- infinite animations are canceled to initial state, and then played over after the screenshot.\n\nDefaults to `\"disabled\"` that disables animations.","async":false,"alias":"animations","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.23","name":"caret","type":{"name":"ScreenshotCaret","union":[{"name":"\"hide\""},{"name":"\"initial\""}],"expression":"[ScreenshotCaret]<\"hide\"|\"initial\">"},"spec":[{"type":"text","text":"When set to `\"hide\"`, screenshot will hide text caret. When set to `\"initial\"`, text caret behavior will not be changed. Defaults to `\"hide\"`."}],"required":false,"comment":"When set to `\"hide\"`, screenshot will hide text caret. When set to `\"initial\"`, text caret behavior will not be\nchanged. Defaults to `\"hide\"`.","async":false,"alias":"caret","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.23","name":"mask","type":{"name":"Array","templates":[{"name":"Locator"}],"expression":"[Array]<[Locator]>"},"spec":[{"type":"text","text":"Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with↵a pink box `#FF00FF` (customized by `maskColor`) that completely covers its bounding box."}],"required":false,"comment":"Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink\nbox `#FF00FF` (customized by `maskColor`) that completely covers its bounding box.","async":false,"alias":"mask","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.35","name":"maskColor","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Specify the color of the overlay box for masked elements, in [CSS color format](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value). Default color is pink `#FF00FF`."}],"required":false,"comment":"Specify the color of the overlay box for masked elements, in\n[CSS color format](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value). Default color is pink `#FF00FF`.","async":false,"alias":"maskColor","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"maxDiffPixelRatio","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"An acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1`. Default is configurable with `TestConfig.expect`. Unset by default."}],"required":false,"comment":"An acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1`. Default is\nconfigurable with `TestConfig.expect`. Unset by default.","async":false,"alias":"maxDiffPixelRatio","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"maxDiffPixels","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"An acceptable amount of pixels that could be different. Default is configurable with `TestConfig.expect`. Unset by default."}],"required":false,"comment":"An acceptable amount of pixels that could be different. Default is configurable with `TestConfig.expect`. Unset by\ndefault.","async":false,"alias":"maxDiffPixels","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.23","name":"omitBackground","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images.↵Defaults to `false`."}],"required":false,"comment":"Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images.\nDefaults to `false`.","async":false,"alias":"omitBackground","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.23","name":"scale","type":{"name":"ScreenshotScale","union":[{"name":"\"css\""},{"name":"\"device\""}],"expression":"[ScreenshotScale]<\"css\"|\"device\">"},"spec":[{"type":"text","text":"When set to `\"css\"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this will keep screenshots small. Using `\"device\"` option will produce a single pixel per each device pixel, so screenshots of high-dpi devices will be twice as large or even larger."},{"type":"text","text":"Defaults to `\"css\"`."}],"required":false,"comment":"When set to `\"css\"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this\nwill keep screenshots small. Using `\"device\"` option will produce a single pixel per each device pixel, so\nscreenshots of high-dpi devices will be twice as large or even larger.\n\nDefaults to `\"css\"`.","async":false,"alias":"scale","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.41","name":"stylePath","type":{"name":"","union":[{"name":"string"},{"name":"Array","templates":[{"name":"string"}]}],"expression":"[string]|[Array]<[string]>"},"spec":[{"type":"text","text":"File name containing the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make elements invisible or change their properties to help you creating repeatable screenshots. This stylesheet pierces the Shadow DOM and applies to the inner frames."}],"required":false,"comment":"File name containing the stylesheet to apply while making the screenshot. This is where you can hide dynamic\nelements, make elements invisible or change their properties to help you creating repeatable screenshots. This\nstylesheet pierces the Shadow DOM and applies to the inner frames.","async":false,"alias":"stylePath","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"threshold","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ)↵between the same pixel in compared images, between zero (strict) and one (lax), default is configurable with↵`TestConfig.expect`. Defaults to `0.2`."}],"required":false,"comment":"An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the\nsame pixel in compared images, between zero (strict) and one (lax), default is configurable with\n`TestConfig.expect`. Defaults to `0.2`.","async":false,"alias":"threshold","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"hasText"},"types":{},"overrides":{}},"since":"v1.20","name":"toHaveText","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures the `Locator` points to an element with the given text. All nested elements will be considered when computing the text content of the element. You can use regular expressions for the value as well."},{"type":"text","text":"**Details**"},{"type":"text","text":"When `expected` parameter is a string, Playwright will normalize whitespaces and line breaks both in the actual text and↵in the expected string before matching. When regular expression is used, the actual text is matched as is."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const locator = page.locator('.title');","await expect(locator).toHaveText(/Welcome, Test User/);","await expect(locator).toHaveText(/Welcome, .*/);"],"codeLang":"js"},{"type":"code","lines":["assertThat(page.locator(\".title\")).hasText(\"Welcome, Test User\");","assertThat(page.locator(\".title\")).hasText(Pattern.compile(\"Welcome, .*\"));"],"codeLang":"java"},{"type":"code","lines":["import re","from playwright.async_api import expect","","locator = page.locator(\".title\")","await expect(locator).to_have_text(re.compile(r\"Welcome, Test User\"))","await expect(locator).to_have_text(re.compile(r\"Welcome, .*\"))"],"codeLang":"python async"},{"type":"code","lines":["import re","from playwright.sync_api import expect","","locator = page.locator(\".title\")","expect(locator).to_have_text(re.compile(r\"Welcome, Test User\"))","expect(locator).to_have_text(re.compile(r\"Welcome, .*\"))"],"codeLang":"python sync"},{"type":"code","lines":["var locator = Page.Locator(\".title\");","await Expect(locator).ToHaveTextAsync(new Regex(\"Welcome, Test User\"));","await Expect(locator).ToHaveTextAsync(new Regex(\"Welcome, .*\"));"],"codeLang":"csharp"},{"type":"text","text":"If you pass an array as an expected value, the expectations are:"},{"type":"li","text":"Locator resolves to a list of elements.","liType":"ordinal"},{"type":"li","text":"The number of elements equals the number of expected values in the array.","liType":"ordinal"},{"type":"li","text":"Elements from the list have text matching expected array values, one by one, in order.","liType":"ordinal"},{"type":"text","text":"For example, consider the following list:"},{"type":"code","lines":["<ul>"," <li>Text 1</li>"," <li>Text 2</li>"," <li>Text 3</li>","</ul>"],"codeLang":"html"},{"type":"text","text":"Let's see how we can use the assertion:"},{"type":"code","lines":["// ✓ Has the right items in the right order","await expect(page.locator('ul > li')).toHaveText(['Text 1', 'Text 2', 'Text 3']);","","// ✖ Wrong order","await expect(page.locator('ul > li')).toHaveText(['Text 3', 'Text 2', 'Text 1']);","","// ✖ Last item does not match","await expect(page.locator('ul > li')).toHaveText(['Text 1', 'Text 2', 'Text']);","","// ✖ Locator points to the outer list element, not to the list items","await expect(page.locator('ul')).toHaveText(['Text 1', 'Text 2', 'Text 3']);"],"codeLang":"js"},{"type":"code","lines":["// ✓ Has the right items in the right order","assertThat(page.locator(\"ul > li\")).hasText(new String[] {\"Text 1\", \"Text 2\", \"Text 3\"});","","// ✖ Wrong order","assertThat(page.locator(\"ul > li\")).hasText(new String[] {\"Text 3\", \"Text 2\", \"Text 1\"});","","// ✖ Last item does not match","assertThat(page.locator(\"ul > li\")).hasText(new String[] {\"Text 1\", \"Text 2\", \"Text\"});","","// ✖ Locator points to the outer list element, not to the list items","assertThat(page.locator(\"ul\")).hasText(new String[] {\"Text 1\", \"Text 2\", \"Text 3\"});"],"codeLang":"java"},{"type":"code","lines":["from playwright.async_api import expect","","# ✓ Has the right items in the right order","await expect(page.locator(\"ul > li\")).to_have_text([\"Text 1\", \"Text 2\", \"Text 3\"])","","# ✖ Wrong order","await expect(page.locator(\"ul > li\")).to_have_text([\"Text 3\", \"Text 2\", \"Text 1\"])","","# ✖ Last item does not match","await expect(page.locator(\"ul > li\")).to_have_text([\"Text 1\", \"Text 2\", \"Text\"])","","# ✖ Locator points to the outer list element, not to the list items","await expect(page.locator(\"ul\")).to_have_text([\"Text 1\", \"Text 2\", \"Text 3\"])"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import expect","","# ✓ Has the right items in the right order","expect(page.locator(\"ul > li\")).to_have_text([\"Text 1\", \"Text 2\", \"Text 3\"])","","# ✖ Wrong order","expect(page.locator(\"ul > li\")).to_have_text([\"Text 3\", \"Text 2\", \"Text 1\"])","","# ✖ Last item does not match","expect(page.locator(\"ul > li\")).to_have_text([\"Text 1\", \"Text 2\", \"Text\"])","","# ✖ Locator points to the outer list element, not to the list items","expect(page.locator(\"ul\")).to_have_text([\"Text 1\", \"Text 2\", \"Text 3\"])"],"codeLang":"python sync"},{"type":"code","lines":["// ✓ Has the right items in the right order","await Expect(Page.Locator(\"ul > li\")).ToHaveTextAsync(new string[] {\"Text 1\", \"Text 2\", \"Text 3\"});","","// ✖ Wrong order","await Expect(Page.Locator(\"ul > li\")).ToHaveTextAsync(new string[] {\"Text 3\", \"Text 2\", \"Text 1\"});","","// ✖ Last item does not match","await Expect(Page.Locator(\"ul > li\")).ToHaveTextAsync(new string[] {\"Text 1\", \"Text 2\", \"Text\"});","","// ✖ Locator points to the outer list element, not to the list items","await Expect(Page.Locator(\"ul\")).ToHaveTextAsync(new string[] {\"Text 1\", \"Text 2\", \"Text 3\"});"],"codeLang":"csharp"}],"required":true,"comment":"Ensures the `Locator` points to an element with the given text. All nested elements will be considered when\ncomputing the text content of the element. You can use regular expressions for the value as well.\n\n**Details**\n\nWhen `expected` parameter is a string, Playwright will normalize whitespaces and line breaks both in the actual\ntext and in the expected string before matching. When regular expression is used, the actual text is matched as is.\n\n**Usage**\n\n```js\nconst locator = page.locator('.title');\nawait expect(locator).toHaveText(/Welcome, Test User/);\nawait expect(locator).toHaveText(/Welcome, .*/);\n```\n\n```java\nassertThat(page.locator(\".title\")).hasText(\"Welcome, Test User\");\nassertThat(page.locator(\".title\")).hasText(Pattern.compile(\"Welcome, .*\"));\n```\n\n```py\nimport re\nfrom playwright.async_api import expect\n\nlocator = page.locator(\".title\")\nawait expect(locator).to_have_text(re.compile(r\"Welcome, Test User\"))\nawait expect(locator).to_have_text(re.compile(r\"Welcome, .*\"))\n```\n\n```py\nimport re\nfrom playwright.sync_api import expect\n\nlocator = page.locator(\".title\")\nexpect(locator).to_have_text(re.compile(r\"Welcome, Test User\"))\nexpect(locator).to_have_text(re.compile(r\"Welcome, .*\"))\n```\n\n```csharp\nvar locator = Page.Locator(\".title\");\nawait Expect(locator).ToHaveTextAsync(new Regex(\"Welcome, Test User\"));\nawait Expect(locator).ToHaveTextAsync(new Regex(\"Welcome, .*\"));\n```\n\nIf you pass an array as an expected value, the expectations are:\n1. Locator resolves to a list of elements.\n1. The number of elements equals the number of expected values in the array.\n1. Elements from the list have text matching expected array values, one by one, in order.\n\nFor example, consider the following list:\n\n```html\n<ul>\n <li>Text 1</li>\n <li>Text 2</li>\n <li>Text 3</li>\n</ul>\n```\n\nLet's see how we can use the assertion:\n\n```js\n// ✓ Has the right items in the right order\nawait expect(page.locator('ul > li')).toHaveText(['Text 1', 'Text 2', 'Text 3']);\n\n// ✖ Wrong order\nawait expect(page.locator('ul > li')).toHaveText(['Text 3', 'Text 2', 'Text 1']);\n\n// ✖ Last item does not match\nawait expect(page.locator('ul > li')).toHaveText(['Text 1', 'Text 2', 'Text']);\n\n// ✖ Locator points to the outer list element, not to the list items\nawait expect(page.locator('ul')).toHaveText(['Text 1', 'Text 2', 'Text 3']);\n```\n\n```java\n// ✓ Has the right items in the right order\nassertThat(page.locator(\"ul > li\")).hasText(new String[] {\"Text 1\", \"Text 2\", \"Text 3\"});\n\n// ✖ Wrong order\nassertThat(page.locator(\"ul > li\")).hasText(new String[] {\"Text 3\", \"Text 2\", \"Text 1\"});\n\n// ✖ Last item does not match\nassertThat(page.locator(\"ul > li\")).hasText(new String[] {\"Text 1\", \"Text 2\", \"Text\"});\n\n// ✖ Locator points to the outer list element, not to the list items\nassertThat(page.locator(\"ul\")).hasText(new String[] {\"Text 1\", \"Text 2\", \"Text 3\"});\n```\n\n```py\nfrom playwright.async_api import expect\n\n# ✓ Has the right items in the right order\nawait expect(page.locator(\"ul > li\")).to_have_text([\"Text 1\", \"Text 2\", \"Text 3\"])\n\n# ✖ Wrong order\nawait expect(page.locator(\"ul > li\")).to_have_text([\"Text 3\", \"Text 2\", \"Text 1\"])\n\n# ✖ Last item does not match\nawait expect(page.locator(\"ul > li\")).to_have_text([\"Text 1\", \"Text 2\", \"Text\"])\n\n# ✖ Locator points to the outer list element, not to the list items\nawait expect(page.locator(\"ul\")).to_have_text([\"Text 1\", \"Text 2\", \"Text 3\"])\n```\n\n```py\nfrom playwright.sync_api import expect\n\n# ✓ Has the right items in the right order\nexpect(page.locator(\"ul > li\")).to_have_text([\"Text 1\", \"Text 2\", \"Text 3\"])\n\n# ✖ Wrong order\nexpect(page.locator(\"ul > li\")).to_have_text([\"Text 3\", \"Text 2\", \"Text 1\"])\n\n# ✖ Last item does not match\nexpect(page.locator(\"ul > li\")).to_have_text([\"Text 1\", \"Text 2\", \"Text\"])\n\n# ✖ Locator points to the outer list element, not to the list items\nexpect(page.locator(\"ul\")).to_have_text([\"Text 1\", \"Text 2\", \"Text 3\"])\n```\n\n```csharp\n// ✓ Has the right items in the right order\nawait Expect(Page.Locator(\"ul > li\")).ToHaveTextAsync(new string[] {\"Text 1\", \"Text 2\", \"Text 3\"});\n\n// ✖ Wrong order\nawait Expect(Page.Locator(\"ul > li\")).ToHaveTextAsync(new string[] {\"Text 3\", \"Text 2\", \"Text 1\"});\n\n// ✖ Last item does not match\nawait Expect(Page.Locator(\"ul > li\")).ToHaveTextAsync(new string[] {\"Text 1\", \"Text 2\", \"Text\"});\n\n// ✖ Locator points to the outer list element, not to the list items\nawait Expect(Page.Locator(\"ul\")).ToHaveTextAsync(new string[] {\"Text 1\", \"Text 2\", \"Text 3\"});\n```\n","async":true,"alias":"toHaveText","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"expected","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"},{"name":"Array","templates":[{"name":"","union":[{"name":"string"},{"name":"RegExp"}]}]}],"expression":"[string]|[RegExp]|[Array]<[string]|[RegExp]>"},"spec":[{"type":"text","text":"Expected string or RegExp or a list of those."}],"required":true,"comment":"Expected string or RegExp or a list of those.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"expected","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"},{"name":"Array","templates":[{"name":"string"}]},{"name":"Array","templates":[{"name":"RegExp"}]},{"name":"Array","templates":[{"name":"","union":[{"name":"string"},{"name":"RegExp"}]}]}],"expression":"[string]|[RegExp]|[Array]<[string]>|[Array]<[RegExp]>|[Array]<[string]|[RegExp]>"},"spec":[{"type":"text","text":"Expected string or RegExp or a list of those."}],"required":true,"comment":"Expected string or RegExp or a list of those.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"expected","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"},{"name":"Array","templates":[{"name":"string"}]},{"name":"Array","templates":[{"name":"RegExp"}]}],"expression":"[string]|[RegExp]|[Array]<[string]>|[Array]<[RegExp]>"},"spec":[{"type":"text","text":"Expected string or RegExp or a list of those."}],"required":true,"comment":"Expected string or RegExp or a list of those.","async":false,"alias":"expected","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.23","name":"ignoreCase","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular expression flag if specified."}],"required":false,"comment":"Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular\nexpression flag if specified.","async":false,"alias":"ignoreCase","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.18","name":"useInnerText","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to use `element.innerText` instead of `element.textContent` when retrieving DOM node text."}],"required":false,"comment":"Whether to use `element.innerText` instead of `element.textContent` when retrieving DOM node text.","async":false,"alias":"useInnerText","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"hasValue"},"types":{},"overrides":{}},"since":"v1.20","name":"toHaveValue","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures the `Locator` points to an element with the given input value. You can use regular expressions for the value as well."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const locator = page.locator('input[type=number]');","await expect(locator).toHaveValue(/[0-9]/);"],"codeLang":"js"},{"type":"code","lines":["assertThat(page.locator(\"input[type=number]\")).hasValue(Pattern.compile(\"[0-9]\"));"],"codeLang":"java"},{"type":"code","lines":["import re","from playwright.async_api import expect","","locator = page.locator(\"input[type=number]\")","await expect(locator).to_have_value(re.compile(r\"[0-9]\"))"],"codeLang":"python async"},{"type":"code","lines":["import re","from playwright.sync_api import expect","","locator = page.locator(\"input[type=number]\")","expect(locator).to_have_value(re.compile(r\"[0-9]\"))"],"codeLang":"python sync"},{"type":"code","lines":["var locator = Page.Locator(\"input[type=number]\");","await Expect(locator).ToHaveValueAsync(new Regex(\"[0-9]\"));"],"codeLang":"csharp"}],"required":true,"comment":"Ensures the `Locator` points to an element with the given input value. You can use regular expressions for the\nvalue as well.\n\n**Usage**\n\n```js\nconst locator = page.locator('input[type=number]');\nawait expect(locator).toHaveValue(/[0-9]/);\n```\n\n```java\nassertThat(page.locator(\"input[type=number]\")).hasValue(Pattern.compile(\"[0-9]\"));\n```\n\n```py\nimport re\nfrom playwright.async_api import expect\n\nlocator = page.locator(\"input[type=number]\")\nawait expect(locator).to_have_value(re.compile(r\"[0-9]\"))\n```\n\n```py\nimport re\nfrom playwright.sync_api import expect\n\nlocator = page.locator(\"input[type=number]\")\nexpect(locator).to_have_value(re.compile(r\"[0-9]\"))\n```\n\n```csharp\nvar locator = Page.Locator(\"input[type=number]\");\nawait Expect(locator).ToHaveValueAsync(new Regex(\"[0-9]\"));\n```\n","async":true,"alias":"toHaveValue","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"value","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Expected value."}],"required":true,"comment":"Expected value.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"hasValues"},"types":{},"overrides":{}},"since":"v1.23","name":"toHaveValues","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures the `Locator` points to multi-select/combobox (i.e. a `select` with the `multiple` attribute) and the specified values are selected."},{"type":"text","text":"**Usage**"},{"type":"text","text":"For example, given the following element:"},{"type":"code","lines":["<select id=\"favorite-colors\" multiple>"," <option value=\"R\">Red</option>"," <option value=\"G\">Green</option>"," <option value=\"B\">Blue</option>","</select>"],"codeLang":"html"},{"type":"code","lines":["const locator = page.locator('id=favorite-colors');","await locator.selectOption(['R', 'G']);","await expect(locator).toHaveValues([/R/, /G/]);"],"codeLang":"js"},{"type":"code","lines":["page.locator(\"id=favorite-colors\").selectOption([\"R\", \"G\"]);","assertThat(page.locator(\"id=favorite-colors\")).hasValues(new Pattern[] { Pattern.compile(\"R\"), Pattern.compile(\"G\") });"],"codeLang":"java"},{"type":"code","lines":["import re","from playwright.async_api import expect","","locator = page.locator(\"id=favorite-colors\")","await locator.select_option([\"R\", \"G\"])","await expect(locator).to_have_values([re.compile(r\"R\"), re.compile(r\"G\")])"],"codeLang":"python async"},{"type":"code","lines":["import re","from playwright.sync_api import expect","","locator = page.locator(\"id=favorite-colors\")","locator.select_option([\"R\", \"G\"])","expect(locator).to_have_values([re.compile(r\"R\"), re.compile(r\"G\")])"],"codeLang":"python sync"},{"type":"code","lines":["var locator = Page.Locator(\"id=favorite-colors\");","await locator.SelectOptionAsync(new string[] { \"R\", \"G\" });","await Expect(locator).ToHaveValuesAsync(new Regex[] { new Regex(\"R\"), new Regex(\"G\") });"],"codeLang":"csharp"}],"required":true,"comment":"Ensures the `Locator` points to multi-select/combobox (i.e. a `select` with the `multiple` attribute) and the\nspecified values are selected.\n\n**Usage**\n\nFor example, given the following element:\n\n```html\n<select id=\"favorite-colors\" multiple>\n <option value=\"R\">Red</option>\n <option value=\"G\">Green</option>\n <option value=\"B\">Blue</option>\n</select>\n```\n\n```js\nconst locator = page.locator('id=favorite-colors');\nawait locator.selectOption(['R', 'G']);\nawait expect(locator).toHaveValues([/R/, /G/]);\n```\n\n```java\npage.locator(\"id=favorite-colors\").selectOption([\"R\", \"G\"]);\nassertThat(page.locator(\"id=favorite-colors\")).hasValues(new Pattern[] { Pattern.compile(\"R\"), Pattern.compile(\"G\") });\n```\n\n```py\nimport re\nfrom playwright.async_api import expect\n\nlocator = page.locator(\"id=favorite-colors\")\nawait locator.select_option([\"R\", \"G\"])\nawait expect(locator).to_have_values([re.compile(r\"R\"), re.compile(r\"G\")])\n```\n\n```py\nimport re\nfrom playwright.sync_api import expect\n\nlocator = page.locator(\"id=favorite-colors\")\nlocator.select_option([\"R\", \"G\"])\nexpect(locator).to_have_values([re.compile(r\"R\"), re.compile(r\"G\")])\n```\n\n```csharp\nvar locator = Page.Locator(\"id=favorite-colors\");\nawait locator.SelectOptionAsync(new string[] { \"R\", \"G\" });\nawait Expect(locator).ToHaveValuesAsync(new Regex[] { new Regex(\"R\"), new Regex(\"G\") });\n```\n","async":true,"alias":"toHaveValues","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"values","type":{"name":"Array","templates":[{"name":"","union":[{"name":"string"},{"name":"RegExp"}]}],"expression":"[Array]<[string]|[RegExp]>"},"spec":[{"type":"text","text":"Expected options currently selected."}],"required":true,"comment":"Expected options currently selected.","async":false,"alias":"values","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"values","type":{"name":"","union":[{"name":"Array","templates":[{"name":"string"}]},{"name":"Array","templates":[{"name":"RegExp"}]},{"name":"Array","templates":[{"name":"","union":[{"name":"string"},{"name":"RegExp"}]}]}],"expression":"[Array]<[string]>|[Array]<[RegExp]>|[Array]<[string]|[RegExp]>"},"spec":[{"type":"text","text":"Expected options currently selected."}],"required":true,"comment":"Expected options currently selected.","async":false,"alias":"values","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"values","type":{"name":"","union":[{"name":"Array","templates":[{"name":"string"}]},{"name":"Array","templates":[{"name":"RegExp"}]}],"expression":"[Array]<[string]>|[Array]<[RegExp]>"},"spec":[{"type":"text","text":"Expected options currently selected."}],"required":true,"comment":"Expected options currently selected.","async":false,"alias":"values","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]}]},{"name":"Logger","spec":[{"type":"text","text":"Playwright generates a lot of logs and they are accessible via the pluggable logger sink."},{"type":"code","lines":["const { chromium } = require('playwright'); // Or 'firefox' or 'webkit'.","","(async () => {"," const browser = await chromium.launch({"," logger: {"," isEnabled: (name, severity) => name === 'api',"," log: (name, severity, message, args) => console.log(`${name} ${message}`)"," }"," });"," // ...","})();"],"codeLang":"js"}],"langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"comment":"Playwright generates a lot of logs and they are accessible via the pluggable logger sink.\n\n```js\nconst { chromium } = require('playwright'); // Or 'firefox' or 'webkit'.\n\n(async () => {\n const browser = await chromium.launch({\n logger: {\n isEnabled: (name, severity) => name === 'api',\n log: (name, severity, message, args) => console.log(`${name} ${message}`)\n }\n });\n // ...\n})();\n```\n","since":"v1.8","members":[{"kind":"method","langs":{},"since":"v1.8","name":"isEnabled","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Determines whether sink is interested in the logger with the given name and severity."}],"required":true,"comment":"Determines whether sink is interested in the logger with the given name and severity.","async":false,"alias":"isEnabled","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"logger name"}],"required":true,"comment":"logger name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"severity","type":{"name":"LogSeverity","union":[{"name":"\"verbose\""},{"name":"\"info\""},{"name":"\"warning\""},{"name":"\"error\""}],"expression":"[LogSeverity]<\"verbose\"|\"info\"|\"warning\"|\"error\">"},"spec":[],"required":true,"comment":"","async":false,"alias":"severity","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"log","type":{"name":"void"},"spec":[],"required":true,"comment":"","async":false,"alias":"log","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"logger name"}],"required":true,"comment":"logger name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"severity","type":{"name":"LogSeverity","union":[{"name":"\"verbose\""},{"name":"\"info\""},{"name":"\"warning\""},{"name":"\"error\""}],"expression":"[LogSeverity]<\"verbose\"|\"info\"|\"warning\"|\"error\">"},"spec":[],"required":true,"comment":"","async":false,"alias":"severity","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"message","type":{"name":"","union":[{"name":"string"},{"name":"Error"}],"expression":"[string]|[Error]"},"spec":[{"type":"text","text":"log message format"}],"required":true,"comment":"log message format","async":false,"alias":"message","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"args","type":{"name":"Array","templates":[{"name":"Object"}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":"message arguments"}],"required":true,"comment":"message arguments","async":false,"alias":"args","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"hints","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"color","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional preferred logger color."}],"required":false,"comment":"Optional preferred logger color.","async":false,"alias":"color","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"optional formatting hints"}],"required":true,"comment":"optional formatting hints","async":false,"alias":"hints","overloadIndex":0,"paramOrOption":null}]}]},{"name":"Mouse","spec":[{"type":"text","text":"The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport."},{"type":"text","text":"Every `page` object has its own Mouse, accessible with [`property: Page.mouse`]."},{"type":"code","lines":["// Using ‘page.mouse’ to trace a 100x100 square.","await page.mouse.move(0, 0);","await page.mouse.down();","await page.mouse.move(0, 100);","await page.mouse.move(100, 100);","await page.mouse.move(100, 0);","await page.mouse.move(0, 0);","await page.mouse.up();"],"codeLang":"js"},{"type":"code","lines":["// Using ‘page.mouse’ to trace a 100x100 square.","page.mouse().move(0, 0);","page.mouse().down();","page.mouse().move(0, 100);","page.mouse().move(100, 100);","page.mouse().move(100, 0);","page.mouse().move(0, 0);","page.mouse().up();"],"codeLang":"java"},{"type":"code","lines":["# using ‘page.mouse’ to trace a 100x100 square.","await page.mouse.move(0, 0)","await page.mouse.down()","await page.mouse.move(0, 100)","await page.mouse.move(100, 100)","await page.mouse.move(100, 0)","await page.mouse.move(0, 0)","await page.mouse.up()"],"codeLang":"python async"},{"type":"code","lines":["# using ‘page.mouse’ to trace a 100x100 square.","page.mouse.move(0, 0)","page.mouse.down()","page.mouse.move(0, 100)","page.mouse.move(100, 100)","page.mouse.move(100, 0)","page.mouse.move(0, 0)","page.mouse.up()"],"codeLang":"python sync"},{"type":"code","lines":["await Page.Mouse.MoveAsync(0, 0);","await Page.Mouse.DownAsync();","await Page.Mouse.MoveAsync(0, 100);","await Page.Mouse.MoveAsync(100, 100);","await Page.Mouse.MoveAsync(100, 0);","await Page.Mouse.MoveAsync(0, 0);","await Page.Mouse.UpAsync();"],"codeLang":"csharp"}],"langs":{},"comment":"The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport.\n\nEvery `page` object has its own Mouse, accessible with [`property: Page.mouse`].\n\n```js\n// Using ‘page.mouse’ to trace a 100x100 square.\nawait page.mouse.move(0, 0);\nawait page.mouse.down();\nawait page.mouse.move(0, 100);\nawait page.mouse.move(100, 100);\nawait page.mouse.move(100, 0);\nawait page.mouse.move(0, 0);\nawait page.mouse.up();\n```\n\n```java\n// Using ‘page.mouse’ to trace a 100x100 square.\npage.mouse().move(0, 0);\npage.mouse().down();\npage.mouse().move(0, 100);\npage.mouse().move(100, 100);\npage.mouse().move(100, 0);\npage.mouse().move(0, 0);\npage.mouse().up();\n```\n\n```py\n# using ‘page.mouse’ to trace a 100x100 square.\nawait page.mouse.move(0, 0)\nawait page.mouse.down()\nawait page.mouse.move(0, 100)\nawait page.mouse.move(100, 100)\nawait page.mouse.move(100, 0)\nawait page.mouse.move(0, 0)\nawait page.mouse.up()\n```\n\n```py\n# using ‘page.mouse’ to trace a 100x100 square.\npage.mouse.move(0, 0)\npage.mouse.down()\npage.mouse.move(0, 100)\npage.mouse.move(100, 100)\npage.mouse.move(100, 0)\npage.mouse.move(0, 0)\npage.mouse.up()\n```\n\n```csharp\nawait Page.Mouse.MoveAsync(0, 0);\nawait Page.Mouse.DownAsync();\nawait Page.Mouse.MoveAsync(0, 100);\nawait Page.Mouse.MoveAsync(100, 100);\nawait Page.Mouse.MoveAsync(100, 0);\nawait Page.Mouse.MoveAsync(0, 0);\nawait Page.Mouse.UpAsync();\n```\n","since":"v1.8","members":[{"kind":"method","langs":{},"since":"v1.8","name":"click","type":{"name":"void"},"spec":[{"type":"text","text":"Shortcut for [`method: Mouse.move`], [`method: Mouse.down`], [`method: Mouse.up`]."}],"required":true,"comment":"Shortcut for [`method: Mouse.move`], [`method: Mouse.down`], [`method: Mouse.up`].","async":true,"alias":"click","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"x","type":{"name":"float","expression":"[float]"},"spec":[],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"y","type":{"name":"float","expression":"[float]"},"spec":[],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"button","type":{"name":"MouseButton","union":[{"name":"\"left\""},{"name":"\"right\""},{"name":"\"middle\""}],"expression":"[MouseButton]<\"left\"|\"right\"|\"middle\">"},"spec":[{"type":"text","text":"Defaults to `left`."}],"required":false,"comment":"Defaults to `left`.","async":false,"alias":"button","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"clickCount","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"defaults to 1. See [UIEvent.detail]."}],"required":false,"comment":"defaults to 1. See [UIEvent.detail].","async":false,"alias":"clickCount","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"delay","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0."}],"required":false,"comment":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.","async":false,"alias":"delay","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"csharp":"DblClickAsync"},"types":{},"overrides":{}},"since":"v1.8","name":"dblclick","type":{"name":"void"},"spec":[{"type":"text","text":"Shortcut for [`method: Mouse.move`], [`method: Mouse.down`], [`method: Mouse.up`], [`method: Mouse.down`] and↵[`method: Mouse.up`]."}],"required":true,"comment":"Shortcut for [`method: Mouse.move`], [`method: Mouse.down`], [`method: Mouse.up`], [`method: Mouse.down`] and\n[`method: Mouse.up`].","async":true,"alias":"dblclick","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"x","type":{"name":"float","expression":"[float]"},"spec":[],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"y","type":{"name":"float","expression":"[float]"},"spec":[],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"button","type":{"name":"MouseButton","union":[{"name":"\"left\""},{"name":"\"right\""},{"name":"\"middle\""}],"expression":"[MouseButton]<\"left\"|\"right\"|\"middle\">"},"spec":[{"type":"text","text":"Defaults to `left`."}],"required":false,"comment":"Defaults to `left`.","async":false,"alias":"button","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"delay","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0."}],"required":false,"comment":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.","async":false,"alias":"delay","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"down","type":{"name":"void"},"spec":[{"type":"text","text":"Dispatches a `mousedown` event."}],"required":true,"comment":"Dispatches a `mousedown` event.","async":true,"alias":"down","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"button","type":{"name":"MouseButton","union":[{"name":"\"left\""},{"name":"\"right\""},{"name":"\"middle\""}],"expression":"[MouseButton]<\"left\"|\"right\"|\"middle\">"},"spec":[{"type":"text","text":"Defaults to `left`."}],"required":false,"comment":"Defaults to `left`.","async":false,"alias":"button","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"clickCount","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"defaults to 1. See [UIEvent.detail]."}],"required":false,"comment":"defaults to 1. See [UIEvent.detail].","async":false,"alias":"clickCount","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"move","type":{"name":"void"},"spec":[{"type":"text","text":"Dispatches a `mousemove` event."}],"required":true,"comment":"Dispatches a `mousemove` event.","async":true,"alias":"move","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"x","type":{"name":"float","expression":"[float]"},"spec":[],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"y","type":{"name":"float","expression":"[float]"},"spec":[],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"steps","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Defaults to 1. Sends intermediate `mousemove` events."}],"required":false,"comment":"Defaults to 1. Sends intermediate `mousemove` events.","async":false,"alias":"steps","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"up","type":{"name":"void"},"spec":[{"type":"text","text":"Dispatches a `mouseup` event."}],"required":true,"comment":"Dispatches a `mouseup` event.","async":true,"alias":"up","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"button","type":{"name":"MouseButton","union":[{"name":"\"left\""},{"name":"\"right\""},{"name":"\"middle\""}],"expression":"[MouseButton]<\"left\"|\"right\"|\"middle\">"},"spec":[{"type":"text","text":"Defaults to `left`."}],"required":false,"comment":"Defaults to `left`.","async":false,"alias":"button","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"clickCount","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"defaults to 1. See [UIEvent.detail]."}],"required":false,"comment":"defaults to 1. See [UIEvent.detail].","async":false,"alias":"clickCount","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.15","name":"wheel","type":{"name":"void"},"spec":[{"type":"text","text":"Dispatches a `wheel` event. This method is usually used to manually scroll the page. See [scrolling](../input.md#scrolling) for alternative ways to scroll."},{"type":"note","noteType":"note","text":"Wheel events may cause scrolling if they are not handled, and this method does not↵wait for the scrolling to finish before returning."}],"required":true,"comment":"Dispatches a `wheel` event. This method is usually used to manually scroll the page. See\n[scrolling](../input.md#scrolling) for alternative ways to scroll.\n\n**NOTE** Wheel events may cause scrolling if they are not handled, and this method does not wait for the scrolling\nto finish before returning.","async":true,"alias":"wheel","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.15","name":"deltaX","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Pixels to scroll horizontally."}],"required":true,"comment":"Pixels to scroll horizontally.","async":false,"alias":"deltaX","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.15","name":"deltaY","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Pixels to scroll vertically."}],"required":true,"comment":"Pixels to scroll vertically.","async":false,"alias":"deltaY","overloadIndex":0,"paramOrOption":null}]}]},{"name":"Page","spec":[{"type":"li","text":"extends: [EventEmitter]","liType":"bullet"},{"type":"text","text":"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."},{"type":"text","text":"This example creates a page, navigates it to a URL, and then saves a screenshot:"},{"type":"code","lines":["const { webkit } = require('playwright'); // Or 'chromium' or 'firefox'.","","(async () => {"," const browser = await webkit.launch();"," const context = await browser.newContext();"," const page = await context.newPage();"," await page.goto('https://example.com');"," await page.screenshot({ path: 'screenshot.png' });"," await browser.close();","})();"],"codeLang":"js"},{"type":"code","lines":["import com.microsoft.playwright.*;","","public class Example {"," public static void main(String[] args) {"," try (Playwright playwright = Playwright.create()) {"," BrowserType webkit = playwright.webkit();"," Browser browser = webkit.launch();"," BrowserContext context = browser.newContext();"," Page page = context.newPage();"," page.navigate(\"https://example.com\");"," page.screenshot(new Page.ScreenshotOptions().setPath(Paths.get(\"screenshot.png\")));"," browser.close();"," }"," }","}"],"codeLang":"java"},{"type":"code","lines":["import asyncio","from playwright.async_api import async_playwright, Playwright","","async def run(playwright: Playwright):"," webkit = playwright.webkit"," browser = await webkit.launch()"," context = await browser.new_context()"," page = await context.new_page()"," await page.goto(\"https://example.com\")"," await page.screenshot(path=\"screenshot.png\")"," await browser.close()","","async def main():"," async with async_playwright() as playwright:"," await run(playwright)","asyncio.run(main())"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import sync_playwright, Playwright","","def run(playwright: Playwright):"," webkit = playwright.webkit"," browser = webkit.launch()"," context = browser.new_context()"," page = context.new_page()"," page.goto(\"https://example.com\")"," page.screenshot(path=\"screenshot.png\")"," browser.close()","","with sync_playwright() as playwright:"," run(playwright)"],"codeLang":"python sync"},{"type":"code","lines":["using Microsoft.Playwright;","using System.Threading.Tasks;","","class PageExamples","{"," public static async Task Run()"," {"," using var playwright = await Playwright.CreateAsync();"," await using var browser = await playwright.Webkit.LaunchAsync();"," var page = await browser.NewPageAsync();"," await page.GotoAsync(\"https://www.theverge.com\");"," await page.ScreenshotAsync(new() { Path = \"theverge.png\" });"," }","}"],"codeLang":"csharp"},{"type":"text","text":"The Page class emits various events (described below) which can be handled using any of Node's native↵[`EventEmitter`](https://nodejs.org/api/events.html#events_class_eventemitter) methods, such as `on`, `once` or↵`removeListener`."},{"type":"text","text":"This example logs a message for a single page `load` event:"},{"type":"code","lines":["page.once('load', () => console.log('Page loaded!'));"],"codeLang":"js"},{"type":"code","lines":["page.onLoad(p -> System.out.println(\"Page loaded!\"));"],"codeLang":"java"},{"type":"code","lines":["page.once(\"load\", lambda: print(\"page loaded!\"))"],"codeLang":"py"},{"type":"code","lines":["page.Load += (_, _) => Console.WriteLine(\"Page loaded!\");"],"codeLang":"csharp"},{"type":"text","text":"To unsubscribe from events use the `removeListener` method:"},{"type":"code","lines":["function logRequest(interceptedRequest) {"," console.log('A request was made:', interceptedRequest.url());","}","page.on('request', logRequest);","// Sometime later...","page.removeListener('request', logRequest);"],"codeLang":"js"},{"type":"code","lines":["Consumer<Request> logRequest = interceptedRequest -> {"," System.out.println(\"A request was made: \" + interceptedRequest.url());","};","page.onRequest(logRequest);","// Sometime later...","page.offRequest(logRequest);"],"codeLang":"java"},{"type":"code","lines":["def log_request(intercepted_request):"," print(\"a request was made:\", intercepted_request.url)","page.on(\"request\", log_request)","# sometime later...","page.remove_listener(\"request\", log_request)"],"codeLang":"py"},{"type":"code","lines":["void PageLoadHandler(object _, IPage p) {"," Console.WriteLine(\"Page loaded!\");","};","","page.Load += PageLoadHandler;","// Do some work...","page.Load -= PageLoadHandler;"],"codeLang":"csharp"}],"extends":"EventEmitter","langs":{},"comment":"- extends: [EventEmitter]\n\nPage provides methods to interact with a single tab in a `Browser`, or an\n[extension background page](https://developer.chrome.com/extensions/background_pages) in Chromium. One `Browser`\ninstance might have multiple `Page` instances.\n\nThis example creates a page, navigates it to a URL, and then saves a screenshot:\n\n```js\nconst { webkit } = require('playwright'); // Or 'chromium' or 'firefox'.\n\n(async () => {\n const browser = await webkit.launch();\n const context = await browser.newContext();\n const page = await context.newPage();\n await page.goto('https://example.com');\n await page.screenshot({ path: 'screenshot.png' });\n await browser.close();\n})();\n```\n\n```java\nimport com.microsoft.playwright.*;\n\npublic class Example {\n public static void main(String[] args) {\n try (Playwright playwright = Playwright.create()) {\n BrowserType webkit = playwright.webkit();\n Browser browser = webkit.launch();\n BrowserContext context = browser.newContext();\n Page page = context.newPage();\n page.navigate(\"https://example.com\");\n page.screenshot(new Page.ScreenshotOptions().setPath(Paths.get(\"screenshot.png\")));\n browser.close();\n }\n }\n}\n```\n\n```py\nimport asyncio\nfrom playwright.async_api import async_playwright, Playwright\n\nasync def run(playwright: Playwright):\n webkit = playwright.webkit\n browser = await webkit.launch()\n context = await browser.new_context()\n page = await context.new_page()\n await page.goto(\"https://example.com\")\n await page.screenshot(path=\"screenshot.png\")\n await browser.close()\n\nasync def main():\n async with async_playwright() as playwright:\n await run(playwright)\nasyncio.run(main())\n```\n\n```py\nfrom playwright.sync_api import sync_playwright, Playwright\n\ndef run(playwright: Playwright):\n webkit = playwright.webkit\n browser = webkit.launch()\n context = browser.new_context()\n page = context.new_page()\n page.goto(\"https://example.com\")\n page.screenshot(path=\"screenshot.png\")\n browser.close()\n\nwith sync_playwright() as playwright:\n run(playwright)\n```\n\n```csharp\nusing Microsoft.Playwright;\nusing System.Threading.Tasks;\n\nclass PageExamples\n{\n public static async Task Run()\n {\n using var playwright = await Playwright.CreateAsync();\n await using var browser = await playwright.Webkit.LaunchAsync();\n var page = await browser.NewPageAsync();\n await page.GotoAsync(\"https://www.theverge.com\");\n await page.ScreenshotAsync(new() { Path = \"theverge.png\" });\n }\n}\n```\n\nThe Page class emits various events (described below) which can be handled using any of Node's native\n[`EventEmitter`](https://nodejs.org/api/events.html#events_class_eventemitter) methods, such as `on`, `once` or\n`removeListener`.\n\nThis example logs a message for a single page `load` event:\n\n```js\npage.once('load', () => console.log('Page loaded!'));\n```\n\n```java\npage.onLoad(p -> System.out.println(\"Page loaded!\"));\n```\n\n```py\npage.once(\"load\", lambda: print(\"page loaded!\"))\n```\n\n```csharp\npage.Load += (_, _) => Console.WriteLine(\"Page loaded!\");\n```\n\nTo unsubscribe from events use the `removeListener` method:\n\n```js\nfunction logRequest(interceptedRequest) {\n console.log('A request was made:', interceptedRequest.url());\n}\npage.on('request', logRequest);\n// Sometime later...\npage.removeListener('request', logRequest);\n```\n\n```java\nConsumer<Request> logRequest = interceptedRequest -> {\n System.out.println(\"A request was made: \" + interceptedRequest.url());\n};\npage.onRequest(logRequest);\n// Sometime later...\npage.offRequest(logRequest);\n```\n\n```py\ndef log_request(intercepted_request):\n print(\"a request was made:\", intercepted_request.url)\npage.on(\"request\", log_request)\n# sometime later...\npage.remove_listener(\"request\", log_request)\n```\n\n```csharp\nvoid PageLoadHandler(object _, IPage p) {\n Console.WriteLine(\"Page loaded!\");\n};\n\npage.Load += PageLoadHandler;\n// Do some work...\npage.Load -= PageLoadHandler;\n```\n","since":"v1.8","members":[{"kind":"property","langs":{},"since":"v1.45","name":"clock","type":{"name":"Clock","expression":"[Clock]"},"spec":[{"type":"text","text":"Playwright has ability to mock clock and passage of time."}],"required":true,"comment":"Playwright has ability to mock clock and passage of time.","async":false,"alias":"clock","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.8","name":"close","type":{"name":"Page","expression":"[Page]"},"spec":[{"type":"text","text":"Emitted when the page closes."}],"required":true,"comment":"Emitted when the page closes.","async":false,"alias":"close","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{"aliases":{"java":"consoleMessage"},"types":{},"overrides":{}},"since":"v1.8","name":"console","type":{"name":"ConsoleMessage","expression":"[ConsoleMessage]"},"spec":[{"type":"text","text":"Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`."},{"type":"text","text":"The arguments passed into `console.log` are available on the `ConsoleMessage` event handler argument."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["page.on('console', async msg => {"," const values = [];"," for (const arg of msg.args())"," values.push(await arg.jsonValue());"," console.log(...values);","});","await page.evaluate(() => console.log('hello', 5, { foo: 'bar' }));"],"codeLang":"js"},{"type":"code","lines":["page.onConsoleMessage(msg -> {"," for (int i = 0; i < msg.args().size(); ++i)"," System.out.println(i + \": \" + msg.args().get(i).jsonValue());","});","page.evaluate(\"() => console.log('hello', 5, { foo: 'bar' })\");"],"codeLang":"java"},{"type":"code","lines":["async def print_args(msg):"," values = []"," for arg in msg.args:"," values.append(await arg.json_value())"," print(values)","","page.on(\"console\", print_args)","await page.evaluate(\"console.log('hello', 5, { foo: 'bar' })\")"],"codeLang":"python async"},{"type":"code","lines":["def print_args(msg):"," for arg in msg.args:"," print(arg.json_value())","","page.on(\"console\", print_args)","page.evaluate(\"console.log('hello', 5, { foo: 'bar' })\")"],"codeLang":"python sync"},{"type":"code","lines":["page.Console += async (_, msg) =>","{"," foreach (var arg in msg.Args)"," Console.WriteLine(await arg.JsonValueAsync<object>());","};","","await page.EvaluateAsync(\"console.log('hello', 5, { foo: 'bar' })\");"],"codeLang":"csharp"}],"required":true,"comment":"Emitted when JavaScript within the page calls one of console API methods, e.g. `console.log` or `console.dir`.\n\nThe arguments passed into `console.log` are available on the `ConsoleMessage` event handler argument.\n\n**Usage**\n\n```js\npage.on('console', async msg => {\n const values = [];\n for (const arg of msg.args())\n values.push(await arg.jsonValue());\n console.log(...values);\n});\nawait page.evaluate(() => console.log('hello', 5, { foo: 'bar' }));\n```\n\n```java\npage.onConsoleMessage(msg -> {\n for (int i = 0; i < msg.args().size(); ++i)\n System.out.println(i + \": \" + msg.args().get(i).jsonValue());\n});\npage.evaluate(\"() => console.log('hello', 5, { foo: 'bar' })\");\n```\n\n```py\nasync def print_args(msg):\n values = []\n for arg in msg.args:\n values.append(await arg.json_value())\n print(values)\n\npage.on(\"console\", print_args)\nawait page.evaluate(\"console.log('hello', 5, { foo: 'bar' })\")\n```\n\n```py\ndef print_args(msg):\n for arg in msg.args:\n print(arg.json_value())\n\npage.on(\"console\", print_args)\npage.evaluate(\"console.log('hello', 5, { foo: 'bar' })\")\n```\n\n```csharp\npage.Console += async (_, msg) =>\n{\n foreach (var arg in msg.Args)\n Console.WriteLine(await arg.JsonValueAsync<object>());\n};\n\nawait page.EvaluateAsync(\"console.log('hello', 5, { foo: 'bar' })\");\n```\n","async":false,"alias":"console","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.8","name":"crash","type":{"name":"Page","expression":"[Page]"},"spec":[{"type":"text","text":"Emitted when the page crashes. Browser pages might crash if they try to allocate too much memory. When the page crashes,↵ongoing and subsequent operations will throw."},{"type":"text","text":"The most common way to deal with crashes is to catch an exception:"},{"type":"code","lines":["try {"," // Crash might happen during a click."," await page.click('button');"," // Or while waiting for an event."," await page.waitForEvent('popup');","} catch (e) {"," // When the page crashes, exception message contains 'crash'.","}"],"codeLang":"js"},{"type":"code","lines":["try {"," // Crash might happen during a click."," page.click(\"button\");"," // Or while waiting for an event."," page.waitForPopup(() -> {});","} catch (PlaywrightException e) {"," // When the page crashes, exception message contains \"crash\".","}"],"codeLang":"java"},{"type":"code","lines":["try:"," # crash might happen during a click."," await page.click(\"button\")"," # or while waiting for an event."," await page.wait_for_event(\"popup\")","except Error as e:"," pass"," # when the page crashes, exception message contains \"crash\"."],"codeLang":"python async"},{"type":"code","lines":["try:"," # crash might happen during a click."," page.click(\"button\")"," # or while waiting for an event."," page.wait_for_event(\"popup\")","except Error as e:"," pass"," # when the page crashes, exception message contains \"crash\"."],"codeLang":"python sync"},{"type":"code","lines":["try {"," // Crash might happen during a click."," await page.ClickAsync(\"button\");"," // Or while waiting for an event."," await page.WaitForPopup();","} catch (PlaywrightException e) {"," // When the page crashes, exception message contains \"crash\".","}"],"codeLang":"csharp"}],"required":true,"comment":"Emitted when the page crashes. Browser pages might crash if they try to allocate too much memory. When the page\ncrashes, ongoing and subsequent operations will throw.\n\nThe most common way to deal with crashes is to catch an exception:\n\n```js\ntry {\n // Crash might happen during a click.\n await page.click('button');\n // Or while waiting for an event.\n await page.waitForEvent('popup');\n} catch (e) {\n // When the page crashes, exception message contains 'crash'.\n}\n```\n\n```java\ntry {\n // Crash might happen during a click.\n page.click(\"button\");\n // Or while waiting for an event.\n page.waitForPopup(() -> {});\n} catch (PlaywrightException e) {\n // When the page crashes, exception message contains \"crash\".\n}\n```\n\n```py\ntry:\n # crash might happen during a click.\n await page.click(\"button\")\n # or while waiting for an event.\n await page.wait_for_event(\"popup\")\nexcept Error as e:\n pass\n # when the page crashes, exception message contains \"crash\".\n```\n\n```py\ntry:\n # crash might happen during a click.\n page.click(\"button\")\n # or while waiting for an event.\n page.wait_for_event(\"popup\")\nexcept Error as e:\n pass\n # when the page crashes, exception message contains \"crash\".\n```\n\n```csharp\ntry {\n // Crash might happen during a click.\n await page.ClickAsync(\"button\");\n // Or while waiting for an event.\n await page.WaitForPopup();\n} catch (PlaywrightException e) {\n // When the page crashes, exception message contains \"crash\".\n}\n```\n","async":false,"alias":"crash","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.8","name":"dialog","type":{"name":"Dialog","expression":"[Dialog]"},"spec":[{"type":"text","text":"Emitted when a JavaScript dialog appears, such as `alert`, `prompt`, `confirm` or `beforeunload`. Listener **must** either [`method: Dialog.accept`] or [`method: Dialog.dismiss`] the dialog - otherwise the page will [freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#never_blocking) waiting for the dialog, and actions like click will never finish."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["page.on('dialog', dialog => dialog.accept());"],"codeLang":"js"},{"type":"code","lines":["page.onDialog(dialog -> {"," dialog.accept();","});"],"codeLang":"java"},{"type":"code","lines":["page.on(\"dialog\", lambda dialog: dialog.accept())"],"codeLang":"python"},{"type":"code","lines":["page.RequestFailed += (_, request) =>","{"," Console.WriteLine(request.Url + \" \" + request.Failure);","};"],"codeLang":"csharp"},{"type":"note","noteType":"note","text":"When no [`event: Page.dialog`] or [`event: BrowserContext.dialog`] listeners are present, all dialogs are automatically dismissed."}],"required":true,"comment":"Emitted when a JavaScript dialog appears, such as `alert`, `prompt`, `confirm` or `beforeunload`. Listener **must**\neither [`method: Dialog.accept`] or [`method: Dialog.dismiss`] the dialog - otherwise the page will\n[freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#never_blocking) waiting for the dialog,\nand actions like click will never finish.\n\n**Usage**\n\n```js\npage.on('dialog', dialog => dialog.accept());\n```\n\n```java\npage.onDialog(dialog -> {\n dialog.accept();\n});\n```\n\n```python\npage.on(\"dialog\", lambda dialog: dialog.accept())\n```\n\n```csharp\npage.RequestFailed += (_, request) =>\n{\n Console.WriteLine(request.Url + \" \" + request.Failure);\n};\n```\n\n**NOTE** When no [`event: Page.dialog`] or [`event: BrowserContext.dialog`] listeners are present, all dialogs are\nautomatically dismissed.","async":false,"alias":"dialog","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.9","name":"DOMContentLoaded","type":{"name":"Page","expression":"[Page]"},"spec":[{"type":"text","text":"Emitted when the JavaScript [`DOMContentLoaded`](https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded)↵event is dispatched."}],"required":true,"comment":"Emitted when the JavaScript\n[`DOMContentLoaded`](https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded) event is dispatched.","async":false,"alias":"DOMContentLoaded","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.8","name":"download","type":{"name":"Download","expression":"[Download]"},"spec":[{"type":"text","text":"Emitted when attachment download started. User can access basic file operations on downloaded content via the passed↵`Download` instance."}],"required":true,"comment":"Emitted when attachment download started. User can access basic file operations on downloaded content via the\npassed `Download` instance.","async":false,"alias":"download","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.9","name":"fileChooser","type":{"name":"FileChooser","expression":"[FileChooser]"},"spec":[{"type":"text","text":"Emitted when a file chooser is supposed to appear, such as after clicking the `<input type=file>`. Playwright can↵respond to it via setting the input files using [`method: FileChooser.setFiles`] that can be uploaded after that."},{"type":"code","lines":["page.on('filechooser', async fileChooser => {"," await fileChooser.setFiles(path.join(__dirname, '/tmp/myfile.pdf'));","});"],"codeLang":"js"},{"type":"code","lines":["page.onFileChooser(fileChooser -> {"," fileChooser.setFiles(Paths.get(\"/tmp/myfile.pdf\"));","});"],"codeLang":"java"},{"type":"code","lines":["page.on(\"filechooser\", lambda file_chooser: file_chooser.set_files(\"/tmp/myfile.pdf\"))"],"codeLang":"py"},{"type":"code","lines":["page.FileChooser += (_, fileChooser) =>","{"," fileChooser.SetFilesAsync(@\"C:\\temp\\myfile.pdf\");","};"],"codeLang":"csharp"}],"required":true,"comment":"Emitted when a file chooser is supposed to appear, such as after clicking the `<input type=file>`. Playwright can\nrespond to it via setting the input files using [`method: FileChooser.setFiles`] that can be uploaded after that.\n\n```js\npage.on('filechooser', async fileChooser => {\n await fileChooser.setFiles(path.join(__dirname, '/tmp/myfile.pdf'));\n});\n```\n\n```java\npage.onFileChooser(fileChooser -> {\n fileChooser.setFiles(Paths.get(\"/tmp/myfile.pdf\"));\n});\n```\n\n```py\npage.on(\"filechooser\", lambda file_chooser: file_chooser.set_files(\"/tmp/myfile.pdf\"))\n```\n\n```csharp\npage.FileChooser += (_, fileChooser) =>\n{\n fileChooser.SetFilesAsync(@\"C:\\temp\\myfile.pdf\");\n};\n```\n","async":false,"alias":"fileChooser","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.9","name":"frameAttached","type":{"name":"Frame","expression":"[Frame]"},"spec":[{"type":"text","text":"Emitted when a frame is attached."}],"required":true,"comment":"Emitted when a frame is attached.","async":false,"alias":"frameAttached","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.9","name":"frameDetached","type":{"name":"Frame","expression":"[Frame]"},"spec":[{"type":"text","text":"Emitted when a frame is detached."}],"required":true,"comment":"Emitted when a frame is detached.","async":false,"alias":"frameDetached","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.9","name":"frameNavigated","type":{"name":"Frame","expression":"[Frame]"},"spec":[{"type":"text","text":"Emitted when a frame is navigated to a new url."}],"required":true,"comment":"Emitted when a frame is navigated to a new url.","async":false,"alias":"frameNavigated","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.8","name":"load","type":{"name":"Page","expression":"[Page]"},"spec":[{"type":"text","text":"Emitted when the JavaScript [`load`](https://developer.mozilla.org/en-US/docs/Web/Events/load) event is dispatched."}],"required":true,"comment":"Emitted when the JavaScript [`load`](https://developer.mozilla.org/en-US/docs/Web/Events/load) event is dispatched.","async":false,"alias":"load","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{"types":{"csharp":{"name":"string","expression":"[string]"},"java":{"name":"string","expression":"[string]"}}},"since":"v1.9","name":"pageError","type":{"name":"Error","expression":"[Error]"},"spec":[{"type":"text","text":"Emitted when an uncaught exception happens within the page."},{"type":"code","lines":["// Log all uncaught errors to the terminal","page.on('pageerror', exception => {"," console.log(`Uncaught exception: \"${exception}\"`);","});","","// Navigate to a page with an exception.","await page.goto('data:text/html,<script>throw new Error(\"Test\")</script>');"],"codeLang":"js"},{"type":"code","lines":["// Log all uncaught errors to the terminal","page.onPageError(exception -> {"," System.out.println(\"Uncaught exception: \" + exception);","});","","// Navigate to a page with an exception.","page.navigate(\"data:text/html,<script>throw new Error('Test')</script>\");"],"codeLang":"java"},{"type":"code","lines":["# Log all uncaught errors to the terminal","page.on(\"pageerror\", lambda exc: print(f\"uncaught exception: {exc}\"))","","# Navigate to a page with an exception.","await page.goto(\"data:text/html,<script>throw new Error('test')</script>\")"],"codeLang":"python async"},{"type":"code","lines":["# Log all uncaught errors to the terminal","page.on(\"pageerror\", lambda exc: print(f\"uncaught exception: {exc}\"))","","# Navigate to a page with an exception.","page.goto(\"data:text/html,<script>throw new Error('test')</script>\")"],"codeLang":"python sync"},{"type":"code","lines":["// Log all uncaught errors to the terminal","page.PageError += (_, exception) =>","{"," Console.WriteLine(\"Uncaught exception: \" + exception);","};"],"codeLang":"csharp"}],"required":true,"comment":"Emitted when an uncaught exception happens within the page.\n\n```js\n// Log all uncaught errors to the terminal\npage.on('pageerror', exception => {\n console.log(`Uncaught exception: \"${exception}\"`);\n});\n\n// Navigate to a page with an exception.\nawait page.goto('data:text/html,<script>throw new Error(\"Test\")</script>');\n```\n\n```java\n// Log all uncaught errors to the terminal\npage.onPageError(exception -> {\n System.out.println(\"Uncaught exception: \" + exception);\n});\n\n// Navigate to a page with an exception.\npage.navigate(\"data:text/html,<script>throw new Error('Test')</script>\");\n```\n\n```py\n# Log all uncaught errors to the terminal\npage.on(\"pageerror\", lambda exc: print(f\"uncaught exception: {exc}\"))\n\n# Navigate to a page with an exception.\nawait page.goto(\"data:text/html,<script>throw new Error('test')</script>\")\n```\n\n```py\n# Log all uncaught errors to the terminal\npage.on(\"pageerror\", lambda exc: print(f\"uncaught exception: {exc}\"))\n\n# Navigate to a page with an exception.\npage.goto(\"data:text/html,<script>throw new Error('test')</script>\")\n```\n\n```csharp\n// Log all uncaught errors to the terminal\npage.PageError += (_, exception) =>\n{\n Console.WriteLine(\"Uncaught exception: \" + exception);\n};\n```\n","async":false,"alias":"pageError","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.8","name":"popup","type":{"name":"Page","expression":"[Page]"},"spec":[{"type":"text","text":"Emitted when the page opens a new tab or window. This event is emitted in addition to the↵[`event: BrowserContext.page`], but only for popups relevant to this page."},{"type":"text","text":"The earliest moment that page is available is when it has navigated to the initial url. For example, when opening a↵popup with `window.open('http://example.com')`, this event will fire when the network request to \"http://example.com\" is↵done and its response has started loading in the popup. If you would like to route/listen to this network request, use [`method: BrowserContext.route`] and [`event: BrowserContext.request`] respectively instead of similar methods on the `Page`."},{"type":"code","lines":["// Start waiting for popup before clicking. Note no await.","const popupPromise = page.waitForEvent('popup');","await page.getByText('open the popup').click();","const popup = await popupPromise;","console.log(await popup.evaluate('location.href'));"],"codeLang":"js"},{"type":"code","lines":["Page popup = page.waitForPopup(() -> {"," page.getByText(\"open the popup\").click();","});","System.out.println(popup.evaluate(\"location.href\"));"],"codeLang":"java"},{"type":"code","lines":["async with page.expect_event(\"popup\") as page_info:"," await page.get_by_text(\"open the popup\").click()","popup = await page_info.value","print(await popup.evaluate(\"location.href\"))"],"codeLang":"python async"},{"type":"code","lines":["with page.expect_event(\"popup\") as page_info:"," page.get_by_text(\"open the popup\").click()","popup = page_info.value","print(popup.evaluate(\"location.href\"))"],"codeLang":"python sync"},{"type":"code","lines":["var popup = await page.RunAndWaitForPopupAsync(async () =>","{"," await page.GetByText(\"open the popup\").ClickAsync();","});","Console.WriteLine(await popup.EvaluateAsync<string>(\"location.href\"));"],"codeLang":"csharp"},{"type":"note","noteType":"note","text":"Use [`method: Page.waitForLoadState`] to wait until the page gets to a particular state (you should not need it in most↵cases)."}],"required":true,"comment":"Emitted when the page opens a new tab or window. This event is emitted in addition to the\n[`event: BrowserContext.page`], but only for popups relevant to this page.\n\nThe earliest moment that page is available is when it has navigated to the initial url. For example, when opening a\npopup with `window.open('http://example.com')`, this event will fire when the network request to\n\"http://example.com\" is done and its response has started loading in the popup. If you would like to route/listen\nto this network request, use [`method: BrowserContext.route`] and [`event: BrowserContext.request`] respectively\ninstead of similar methods on the `Page`.\n\n```js\n// Start waiting for popup before clicking. Note no await.\nconst popupPromise = page.waitForEvent('popup');\nawait page.getByText('open the popup').click();\nconst popup = await popupPromise;\nconsole.log(await popup.evaluate('location.href'));\n```\n\n```java\nPage popup = page.waitForPopup(() -> {\n page.getByText(\"open the popup\").click();\n});\nSystem.out.println(popup.evaluate(\"location.href\"));\n```\n\n```py\nasync with page.expect_event(\"popup\") as page_info:\n await page.get_by_text(\"open the popup\").click()\npopup = await page_info.value\nprint(await popup.evaluate(\"location.href\"))\n```\n\n```py\nwith page.expect_event(\"popup\") as page_info:\n page.get_by_text(\"open the popup\").click()\npopup = page_info.value\nprint(popup.evaluate(\"location.href\"))\n```\n\n```csharp\nvar popup = await page.RunAndWaitForPopupAsync(async () =>\n{\n await page.GetByText(\"open the popup\").ClickAsync();\n});\nConsole.WriteLine(await popup.EvaluateAsync<string>(\"location.href\"));\n```\n\n**NOTE** Use [`method: Page.waitForLoadState`] to wait until the page gets to a particular state (you should not\nneed it in most cases).","async":false,"alias":"popup","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.8","name":"request","type":{"name":"Request","expression":"[Request]"},"spec":[{"type":"text","text":"Emitted when a page issues a request. The [request] object is read-only. In order to intercept and mutate requests, see↵[`method: Page.route`] or [`method: BrowserContext.route`]."}],"required":true,"comment":"Emitted when a page issues a request. The [request] object is read-only. In order to intercept and mutate requests,\nsee [`method: Page.route`] or [`method: BrowserContext.route`].","async":false,"alias":"request","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.9","name":"requestFailed","type":{"name":"Request","expression":"[Request]"},"spec":[{"type":"text","text":"Emitted when a request fails, for example by timing out."},{"type":"code","lines":["page.on('requestfailed', request => {"," console.log(request.url() + ' ' + request.failure().errorText);","});"],"codeLang":"js"},{"type":"code","lines":["page.onRequestFailed(request -> {"," System.out.println(request.url() + \" \" + request.failure());","});"],"codeLang":"java"},{"type":"code","lines":["page.on(\"requestfailed\", lambda request: print(request.url + \" \" + request.failure.error_text))"],"codeLang":"python"},{"type":"note","noteType":"note","text":"HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request will complete↵with [`event: Page.requestFinished`] event and not with [`event: Page.requestFailed`]. A request will only be considered↵failed when the client cannot get an HTTP response from the server, e.g. due to network error net::ERR_FAILED."}],"required":true,"comment":"Emitted when a request fails, for example by timing out.\n\n```js\npage.on('requestfailed', request => {\n console.log(request.url() + ' ' + request.failure().errorText);\n});\n```\n\n```java\npage.onRequestFailed(request -> {\n System.out.println(request.url() + \" \" + request.failure());\n});\n```\n\n```python\npage.on(\"requestfailed\", lambda request: print(request.url + \" \" + request.failure.error_text))\n```\n\n**NOTE** HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request\nwill complete with [`event: Page.requestFinished`] event and not with [`event: Page.requestFailed`]. A request will\nonly be considered failed when the client cannot get an HTTP response from the server, e.g. due to network error\nnet::ERR_FAILED.","async":false,"alias":"requestFailed","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.9","name":"requestFinished","type":{"name":"Request","expression":"[Request]"},"spec":[{"type":"text","text":"Emitted when a request finishes successfully after downloading the response body. For a successful response, the↵sequence of events is `request`, `response` and `requestfinished`."}],"required":true,"comment":"Emitted when a request finishes successfully after downloading the response body. For a successful response, the\nsequence of events is `request`, `response` and `requestfinished`.","async":false,"alias":"requestFinished","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.8","name":"response","type":{"name":"Response","expression":"[Response]"},"spec":[{"type":"text","text":"Emitted when [response] status and headers are received for a request. For a successful response, the sequence of events↵is `request`, `response` and `requestfinished`."}],"required":true,"comment":"Emitted when [response] status and headers are received for a request. For a successful response, the sequence of\nevents is `request`, `response` and `requestfinished`.","async":false,"alias":"response","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.9","name":"webSocket","type":{"name":"WebSocket","expression":"[WebSocket]"},"spec":[{"type":"text","text":"Emitted when `WebSocket` request is sent."}],"required":true,"comment":"Emitted when `WebSocket` request is sent.","async":false,"alias":"webSocket","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.8","name":"worker","type":{"name":"Worker","expression":"[Worker]"},"spec":[{"type":"text","text":"Emitted when a dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is spawned by the↵page."}],"required":true,"comment":"Emitted when a dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is spawned\nby the page.","async":false,"alias":"worker","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"property","langs":{"only":["csharp","js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","deprecated":"This property is discouraged. Please use other libraries such as↵[Axe](https://www.deque.com/axe/) if you need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for integration with Axe.","name":"accessibility","type":{"name":"Accessibility","expression":"[Accessibility]"},"spec":[],"required":true,"comment":"","async":false,"alias":"accessibility","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"addInitScript","type":{"name":"void"},"spec":[{"type":"text","text":"Adds a script which would be evaluated in one of the following scenarios:"},{"type":"li","text":"Whenever the page is navigated.","liType":"bullet"},{"type":"li","text":"Whenever the child frame is attached or navigated. In this case, the script is evaluated in the context of the newly↵attached frame.","liType":"bullet"},{"type":"text","text":"The script is evaluated after the document was created but before any of its scripts were run. This is useful to amend↵the JavaScript environment, e.g. to seed `Math.random`."},{"type":"text","text":"**Usage**"},{"type":"text","text":"An example of overriding `Math.random` before the page loads:"},{"type":"code","lines":["// preload.js","Math.random = () => 42;"],"codeLang":"js browser"},{"type":"code","lines":["// In your playwright script, assuming the preload.js file is in same directory","await page.addInitScript({ path: './preload.js' });"],"codeLang":"js"},{"type":"code","lines":["await page.addInitScript(mock => {"," window.mock = mock;","}, mock);"],"codeLang":"js"},{"type":"code","lines":["// In your playwright script, assuming the preload.js file is in same directory","page.addInitScript(Paths.get(\"./preload.js\"));"],"codeLang":"java"},{"type":"code","lines":["# in your playwright script, assuming the preload.js file is in same directory","await page.add_init_script(path=\"./preload.js\")"],"codeLang":"python async"},{"type":"code","lines":["# in your playwright script, assuming the preload.js file is in same directory","page.add_init_script(path=\"./preload.js\")"],"codeLang":"python sync"},{"type":"code","lines":["await Page.AddInitScriptAsync(scriptPath: \"./preload.js\");"],"codeLang":"csharp"},{"type":"note","noteType":"note","text":"The order of evaluation of multiple scripts installed via [`method: BrowserContext.addInitScript`] and↵[`method: Page.addInitScript`] is not defined."}],"required":true,"comment":"Adds a script which would be evaluated in one of the following scenarios:\n- Whenever the page is navigated.\n- Whenever the child frame is attached or navigated. In this case, the script is evaluated in the context of the\n newly attached frame.\n\nThe script is evaluated after the document was created but before any of its scripts were run. This is useful to\namend the JavaScript environment, e.g. to seed `Math.random`.\n\n**Usage**\n\nAn example of overriding `Math.random` before the page loads:\n\n```js\n// preload.js\nMath.random = () => 42;\n```\n\n```js\n// In your playwright script, assuming the preload.js file is in same directory\nawait page.addInitScript({ path: './preload.js' });\n```\n\n```js\nawait page.addInitScript(mock => {\n window.mock = mock;\n}, mock);\n```\n\n```java\n// In your playwright script, assuming the preload.js file is in same directory\npage.addInitScript(Paths.get(\"./preload.js\"));\n```\n\n```py\n# in your playwright script, assuming the preload.js file is in same directory\nawait page.add_init_script(path=\"./preload.js\")\n```\n\n```py\n# in your playwright script, assuming the preload.js file is in same directory\npage.add_init_script(path=\"./preload.js\")\n```\n\n```csharp\nawait Page.AddInitScriptAsync(scriptPath: \"./preload.js\");\n```\n\n**NOTE** The order of evaluation of multiple scripts installed via [`method: BrowserContext.addInitScript`] and\n[`method: Page.addInitScript`] is not defined.","async":true,"alias":"addInitScript","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"script","type":{"name":"","union":[{"name":"function"},{"name":"string"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the↵current working directory. Optional."}],"required":false,"comment":"Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working\ndirectory. Optional.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"content","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Raw script content. Optional."}],"required":false,"comment":"Raw script content. Optional.","async":false,"alias":"content","overloadIndex":0,"paramOrOption":null}]}],"expression":"[function]|[string]|[Object]"},"spec":[{"type":"text","text":"Script to be evaluated in the page."}],"required":true,"comment":"Script to be evaluated in the page.","async":false,"alias":"script","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"script","type":{"name":"","union":[{"name":"string"},{"name":"path"}],"expression":"[string]|[path]"},"spec":[{"type":"text","text":"Script to be evaluated in all pages in the browser context."}],"required":true,"comment":"Script to be evaluated in all pages in the browser context.","async":false,"alias":"script","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"arg","type":{"name":"Serializable","expression":"[Serializable]"},"spec":[{"type":"text","text":"Optional argument to pass to `script` (only supported when passing a function)."}],"required":false,"comment":"Optional argument to pass to `script` (only supported when passing a function).","async":false,"alias":"arg","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working directory. Optional."}],"required":false,"comment":"Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working\ndirectory. Optional.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"script","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Script to be evaluated in all pages in the browser context. Optional."}],"required":false,"comment":"Script to be evaluated in all pages in the browser context. Optional.","async":false,"alias":"script","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"addScriptTag","type":{"name":"ElementHandle","expression":"[ElementHandle]"},"spec":[{"type":"text","text":"Adds a `<script>` tag into the page with the desired url or content. Returns the added tag when the script's onload↵fires or when the script content was injected into frame."}],"required":true,"comment":"Adds a `<script>` tag into the page with the desired url or content. Returns the added tag when the script's onload\nfires or when the script content was injected into frame.","async":true,"alias":"addScriptTag","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"content","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Raw JavaScript content to be injected into frame."}],"required":false,"comment":"Raw JavaScript content to be injected into frame.","async":false,"alias":"content","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the JavaScript file to be injected into frame. If `path` is a relative path, then it is resolved relative to the↵current working directory."}],"required":false,"comment":"Path to the JavaScript file to be injected into frame. If `path` is a relative path, then it is resolved relative\nto the current working directory.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"type","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Script type. Use 'module' in order to load a Javascript ES6 module. See↵[script](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script) for more details."}],"required":false,"comment":"Script type. Use 'module' in order to load a Javascript ES6 module. See\n[script](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script) for more details.","async":false,"alias":"type","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"url","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"URL of a script to be added."}],"required":false,"comment":"URL of a script to be added.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"addStyleTag","type":{"name":"ElementHandle","expression":"[ElementHandle]"},"spec":[{"type":"text","text":"Adds a `<link rel=\"stylesheet\">` tag into the page with the desired url or a `<style type=\"text/css\">` tag with the↵content. Returns the added tag when the stylesheet's onload fires or when the CSS content was injected into frame."}],"required":true,"comment":"Adds a `<link rel=\"stylesheet\">` tag into the page with the desired url or a `<style type=\"text/css\">` tag with the\ncontent. Returns the added tag when the stylesheet's onload fires or when the CSS content was injected into frame.","async":true,"alias":"addStyleTag","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"content","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Raw CSS content to be injected into frame."}],"required":false,"comment":"Raw CSS content to be injected into frame.","async":false,"alias":"content","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the CSS file to be injected into frame. If `path` is a relative path, then it is resolved relative to the↵current working directory."}],"required":false,"comment":"Path to the CSS file to be injected into frame. If `path` is a relative path, then it is resolved relative to the\ncurrent working directory.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"url","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"URL of the `<link>` tag."}],"required":false,"comment":"URL of the `<link>` tag.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"bringToFront","type":{"name":"void"},"spec":[{"type":"text","text":"Brings page to front (activates tab)."}],"required":true,"comment":"Brings page to front (activates tab).","async":true,"alias":"bringToFront","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.check`] instead. Read more about [locators](../locators.md).","name":"check","type":{"name":"void"},"spec":[{"type":"text","text":"This method checks an element matching `selector` by performing the following steps:"},{"type":"li","text":"Find an element matching `selector`. If there is none, wait until a matching element is attached to↵the DOM.","liType":"ordinal"},{"type":"li","text":"Ensure that matched element is a checkbox or a radio input. If not, this method throws. If the element is already↵checked, this method returns immediately.","liType":"ordinal"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is↵set. If the element is detached during the checks, the whole action is retried.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.mouse`] to click in the center of the element.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.","liType":"ordinal"},{"type":"li","text":"Ensure that the element is now checked. If not, this method throws.","liType":"ordinal"},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."}],"required":true,"comment":"This method checks an element matching `selector` by performing the following steps:\n1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.\n1. Ensure that matched element is a checkbox or a radio input. If not, this method throws. If the element is\n already checked, this method returns immediately.\n1. Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is set. If\n the element is detached during the checks, the whole action is retried.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.mouse`] to click in the center of the element.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n1. Ensure that the element is now checked. If not, this method throws.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.","async":true,"alias":"check","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.click`] instead. Read more about [locators](../locators.md).","name":"click","type":{"name":"void"},"spec":[{"type":"text","text":"This method clicks an element matching `selector` by performing the following steps:"},{"type":"li","text":"Find an element matching `selector`. If there is none, wait until a matching element is attached to↵the DOM.","liType":"ordinal"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is↵set. If the element is detached during the checks, the whole action is retried.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.mouse`] to click in the center of the element, or the specified `position`.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.","liType":"ordinal"},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."}],"required":true,"comment":"This method clicks an element matching `selector` by performing the following steps:\n1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.\n1. Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is set. If\n the element is detached during the checks, the whole action is retried.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.mouse`] to click in the center of the element, or the specified `position`.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.","async":true,"alias":"click","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"button","type":{"name":"MouseButton","union":[{"name":"\"left\""},{"name":"\"right\""},{"name":"\"middle\""}],"expression":"[MouseButton]<\"left\"|\"right\"|\"middle\">"},"spec":[{"type":"text","text":"Defaults to `left`."}],"required":false,"comment":"Defaults to `left`.","async":false,"alias":"button","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"clickCount","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"defaults to 1. See [UIEvent.detail]."}],"required":false,"comment":"defaults to 1. See [UIEvent.detail].","async":false,"alias":"clickCount","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"delay","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0."}],"required":false,"comment":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.","async":false,"alias":"delay","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"modifiers","type":{"name":"Array","templates":[{"name":"KeyboardModifier","union":[{"name":"\"Alt\""},{"name":"\"Control\""},{"name":"\"ControlOrMeta\""},{"name":"\"Meta\""},{"name":"\"Shift\""}]}],"expression":"[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"ControlOrMeta\"|\"Meta\"|\"Shift\">>"},"spec":[{"type":"text","text":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current↵modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to \"Control\" on Windows↵and Linux and to \"Meta\" on macOS."}],"required":false,"comment":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores\ncurrent modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to\n\"Control\" on Windows and Linux and to \"Meta\" on macOS.","async":false,"alias":"modifiers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"close","type":{"name":"void"},"spec":[{"type":"text","text":"If `runBeforeUnload` is `false`, does not run any unload handlers and waits for the page to be closed. If↵`runBeforeUnload` is `true` the method will run unload handlers, but will **not** wait for the page to close."},{"type":"text","text":"By default, `page.close()` **does not** run `beforeunload` handlers."},{"type":"note","noteType":"note","text":"if `runBeforeUnload` is passed as true, a `beforeunload` dialog might be summoned and should be handled↵manually via [`event: Page.dialog`] event."}],"required":true,"comment":"If `runBeforeUnload` is `false`, does not run any unload handlers and waits for the page to be closed. If\n`runBeforeUnload` is `true` the method will run unload handlers, but will **not** wait for the page to close.\n\nBy default, `page.close()` **does not** run `beforeunload` handlers.\n\n**NOTE** if `runBeforeUnload` is passed as true, a `beforeunload` dialog might be summoned and should be handled\nmanually via [`event: Page.dialog`] event.","async":true,"alias":"close","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.40","name":"reason","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"The reason to be reported to the operations interrupted by the page closure."}],"required":false,"comment":"The reason to be reported to the operations interrupted by the page closure.","async":false,"alias":"reason","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"runBeforeUnload","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Defaults to `false`. Whether to run the↵[before unload](https://developer.mozilla.org/en-US/docs/Web/Events/beforeunload) page handlers."}],"required":false,"comment":"Defaults to `false`. Whether to run the\n[before unload](https://developer.mozilla.org/en-US/docs/Web/Events/beforeunload) page handlers.","async":false,"alias":"runBeforeUnload","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"content","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Gets the full HTML contents of the page, including the doctype."}],"required":true,"comment":"Gets the full HTML contents of the page, including the doctype.","async":true,"alias":"content","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"context","type":{"name":"BrowserContext","expression":"[BrowserContext]"},"spec":[{"type":"text","text":"Get the browser context that the page belongs to."}],"required":true,"comment":"Get the browser context that the page belongs to.","async":false,"alias":"context","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"coverage","type":{"name":"Coverage","expression":"[Coverage]"},"spec":[{"type":"note","noteType":"note","text":"Only available for Chromium atm."},{"type":"text","text":"Browser-specific Coverage implementation. See `Coverage` for more details."}],"required":true,"comment":"**NOTE** Only available for Chromium atm.\n\nBrowser-specific Coverage implementation. See `Coverage` for more details.","async":false,"alias":"coverage","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"aliases":{"csharp":"DblClickAsync"},"types":{},"overrides":{}},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.dblclick`] instead. Read more about [locators](../locators.md).","name":"dblclick","type":{"name":"void"},"spec":[{"type":"text","text":"This method double clicks an element matching `selector` by performing the following steps:"},{"type":"li","text":"Find an element matching `selector`. If there is none, wait until a matching element is attached to↵the DOM.","liType":"ordinal"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is↵set. If the element is detached during the checks, the whole action is retried.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.mouse`] to double click in the center of the element, or the specified `position`.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that↵if the first click of the `dblclick()` triggers a navigation event, this method will throw.","liType":"ordinal"},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."},{"type":"note","noteType":"note","text":"`page.dblclick()` dispatches two `click` events and a single `dblclick` event."}],"required":true,"comment":"This method double clicks an element matching `selector` by performing the following steps:\n1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.\n1. Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is set. If\n the element is detached during the checks, the whole action is retried.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.mouse`] to double click in the center of the element, or the specified `position`.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set. Note that if\n the first click of the `dblclick()` triggers a navigation event, this method will throw.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.\n\n**NOTE** `page.dblclick()` dispatches two `click` events and a single `dblclick` event.","async":true,"alias":"dblclick","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"button","type":{"name":"MouseButton","union":[{"name":"\"left\""},{"name":"\"right\""},{"name":"\"middle\""}],"expression":"[MouseButton]<\"left\"|\"right\"|\"middle\">"},"spec":[{"type":"text","text":"Defaults to `left`."}],"required":false,"comment":"Defaults to `left`.","async":false,"alias":"button","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"delay","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0."}],"required":false,"comment":"Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.","async":false,"alias":"delay","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"modifiers","type":{"name":"Array","templates":[{"name":"KeyboardModifier","union":[{"name":"\"Alt\""},{"name":"\"Control\""},{"name":"\"ControlOrMeta\""},{"name":"\"Meta\""},{"name":"\"Shift\""}]}],"expression":"[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"ControlOrMeta\"|\"Meta\"|\"Shift\">>"},"spec":[{"type":"text","text":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current↵modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to \"Control\" on Windows↵and Linux and to \"Meta\" on macOS."}],"required":false,"comment":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores\ncurrent modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to\n\"Control\" on Windows and Linux and to \"Meta\" on macOS.","async":false,"alias":"modifiers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.dispatchEvent`] instead. Read more about [locators](../locators.md).","name":"dispatchEvent","type":{"name":"void"},"spec":[{"type":"text","text":"The snippet below dispatches the `click` event on the element. Regardless of the visibility state of the element, `click`↵is dispatched. This is equivalent to calling↵[element.click()](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/click)."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.dispatchEvent('button#submit', 'click');"],"codeLang":"js"},{"type":"code","lines":["page.dispatchEvent(\"button#submit\", \"click\");"],"codeLang":"java"},{"type":"code","lines":["await page.dispatch_event(\"button#submit\", \"click\")"],"codeLang":"python async"},{"type":"code","lines":["page.dispatch_event(\"button#submit\", \"click\")"],"codeLang":"python sync"},{"type":"code","lines":["await page.DispatchEventAsync(\"button#submit\", \"click\");"],"codeLang":"csharp"},{"type":"text","text":"Under the hood, it creates an instance of an event based on the given `type`, initializes it with↵`eventInit` properties and dispatches it on the element. Events are `composed`, `cancelable` and bubble by↵default."},{"type":"text","text":"Since `eventInit` is event-specific, please refer to the events documentation for the lists of initial↵properties:"},{"type":"li","text":"[DeviceMotionEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceMotionEvent/DeviceMotionEvent)","liType":"bullet"},{"type":"li","text":"[DeviceOrientationEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceOrientationEvent/DeviceOrientationEvent)","liType":"bullet"},{"type":"li","text":"[DragEvent](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent/DragEvent)","liType":"bullet"},{"type":"li","text":"[Event](https://developer.mozilla.org/en-US/docs/Web/API/Event/Event)","liType":"bullet"},{"type":"li","text":"[FocusEvent](https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent/FocusEvent)","liType":"bullet"},{"type":"li","text":"[KeyboardEvent](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/KeyboardEvent)","liType":"bullet"},{"type":"li","text":"[MouseEvent](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/MouseEvent)","liType":"bullet"},{"type":"li","text":"[PointerEvent](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/PointerEvent)","liType":"bullet"},{"type":"li","text":"[TouchEvent](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/TouchEvent)","liType":"bullet"},{"type":"li","text":"[WheelEvent](https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent/WheelEvent)","liType":"bullet"},{"type":"text","text":"You can also specify `JSHandle` as the property value if you want live objects to be passed into the event:"},{"type":"code","lines":["// Note you can only create DataTransfer in Chromium and Firefox","const dataTransfer = await page.evaluateHandle(() => new DataTransfer());","await page.dispatchEvent('#source', 'dragstart', { dataTransfer });"],"codeLang":"js"},{"type":"code","lines":["// Note you can only create DataTransfer in Chromium and Firefox","JSHandle dataTransfer = page.evaluateHandle(\"() => new DataTransfer()\");","Map<String, Object> arg = new HashMap<>();","arg.put(\"dataTransfer\", dataTransfer);","page.dispatchEvent(\"#source\", \"dragstart\", arg);"],"codeLang":"java"},{"type":"code","lines":["# note you can only create data_transfer in chromium and firefox","data_transfer = await page.evaluate_handle(\"new DataTransfer()\")","await page.dispatch_event(\"#source\", \"dragstart\", { \"dataTransfer\": data_transfer })"],"codeLang":"python async"},{"type":"code","lines":["# note you can only create data_transfer in chromium and firefox","data_transfer = page.evaluate_handle(\"new DataTransfer()\")","page.dispatch_event(\"#source\", \"dragstart\", { \"dataTransfer\": data_transfer })"],"codeLang":"python sync"},{"type":"code","lines":["var dataTransfer = await page.EvaluateHandleAsync(\"() => new DataTransfer()\");","await page.DispatchEventAsync(\"#source\", \"dragstart\", new { dataTransfer });"],"codeLang":"csharp"}],"required":true,"comment":"The snippet below dispatches the `click` event on the element. Regardless of the visibility state of the element,\n`click` is dispatched. This is equivalent to calling\n[element.click()](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/click).\n\n**Usage**\n\n```js\nawait page.dispatchEvent('button#submit', 'click');\n```\n\n```java\npage.dispatchEvent(\"button#submit\", \"click\");\n```\n\n```py\nawait page.dispatch_event(\"button#submit\", \"click\")\n```\n\n```py\npage.dispatch_event(\"button#submit\", \"click\")\n```\n\n```csharp\nawait page.DispatchEventAsync(\"button#submit\", \"click\");\n```\n\nUnder the hood, it creates an instance of an event based on the given `type`, initializes it with `eventInit`\nproperties and dispatches it on the element. Events are `composed`, `cancelable` and bubble by default.\n\nSince `eventInit` is event-specific, please refer to the events documentation for the lists of initial properties:\n- [DeviceMotionEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceMotionEvent/DeviceMotionEvent)\n- [DeviceOrientationEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceOrientationEvent/DeviceOrientationEvent)\n- [DragEvent](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent/DragEvent)\n- [Event](https://developer.mozilla.org/en-US/docs/Web/API/Event/Event)\n- [FocusEvent](https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent/FocusEvent)\n- [KeyboardEvent](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/KeyboardEvent)\n- [MouseEvent](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/MouseEvent)\n- [PointerEvent](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/PointerEvent)\n- [TouchEvent](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/TouchEvent)\n- [WheelEvent](https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent/WheelEvent)\n\nYou can also specify `JSHandle` as the property value if you want live objects to be passed into the event:\n\n```js\n// Note you can only create DataTransfer in Chromium and Firefox\nconst dataTransfer = await page.evaluateHandle(() => new DataTransfer());\nawait page.dispatchEvent('#source', 'dragstart', { dataTransfer });\n```\n\n```java\n// Note you can only create DataTransfer in Chromium and Firefox\nJSHandle dataTransfer = page.evaluateHandle(\"() => new DataTransfer()\");\nMap<String, Object> arg = new HashMap<>();\narg.put(\"dataTransfer\", dataTransfer);\npage.dispatchEvent(\"#source\", \"dragstart\", arg);\n```\n\n```py\n# note you can only create data_transfer in chromium and firefox\ndata_transfer = await page.evaluate_handle(\"new DataTransfer()\")\nawait page.dispatch_event(\"#source\", \"dragstart\", { \"dataTransfer\": data_transfer })\n```\n\n```py\n# note you can only create data_transfer in chromium and firefox\ndata_transfer = page.evaluate_handle(\"new DataTransfer()\")\npage.dispatch_event(\"#source\", \"dragstart\", { \"dataTransfer\": data_transfer })\n```\n\n```csharp\nvar dataTransfer = await page.EvaluateHandleAsync(\"() => new DataTransfer()\");\nawait page.DispatchEventAsync(\"#source\", \"dragstart\", new { dataTransfer });\n```\n","async":true,"alias":"dispatchEvent","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"type","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"DOM event type: `\"click\"`, `\"dragstart\"`, etc."}],"required":true,"comment":"DOM event type: `\"click\"`, `\"dragstart\"`, etc.","async":false,"alias":"type","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"eventInit","type":{"name":"EvaluationArgument","expression":"[EvaluationArgument]"},"spec":[{"type":"text","text":"Optional event-specific initialization properties."}],"required":false,"comment":"Optional event-specific initialization properties.","async":false,"alias":"eventInit","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.13","name":"dragAndDrop","type":{"name":"void"},"spec":[{"type":"text","text":"This method drags the source element to the target element.↵It will first move to the source element, perform a `mousedown`,↵then move to the target element and perform a `mouseup`."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.dragAndDrop('#source', '#target');","// or specify exact positions relative to the top-left corners of the elements:","await page.dragAndDrop('#source', '#target', {"," sourcePosition: { x: 34, y: 7 },"," targetPosition: { x: 10, y: 20 },","});"],"codeLang":"js"},{"type":"code","lines":["page.dragAndDrop(\"#source\", '#target');","// or specify exact positions relative to the top-left corners of the elements:","page.dragAndDrop(\"#source\", '#target', new Page.DragAndDropOptions()"," .setSourcePosition(34, 7).setTargetPosition(10, 20));"],"codeLang":"java"},{"type":"code","lines":["await page.drag_and_drop(\"#source\", \"#target\")","# or specify exact positions relative to the top-left corners of the elements:","await page.drag_and_drop("," \"#source\","," \"#target\","," source_position={\"x\": 34, \"y\": 7},"," target_position={\"x\": 10, \"y\": 20}",")"],"codeLang":"python async"},{"type":"code","lines":["page.drag_and_drop(\"#source\", \"#target\")","# or specify exact positions relative to the top-left corners of the elements:","page.drag_and_drop("," \"#source\","," \"#target\","," source_position={\"x\": 34, \"y\": 7},"," target_position={\"x\": 10, \"y\": 20}",")"],"codeLang":"python sync"},{"type":"code","lines":["await Page.DragAndDropAsync(\"#source\", \"#target\");","// or specify exact positions relative to the top-left corners of the elements:","await Page.DragAndDropAsync(\"#source\", \"#target\", new()","{"," SourcePosition = new() { X = 34, Y = 7 },"," TargetPosition = new() { X = 10, Y = 20 },","});"],"codeLang":"csharp"}],"required":true,"comment":"This method drags the source element to the target element. It will first move to the source element, perform a\n`mousedown`, then move to the target element and perform a `mouseup`.\n\n**Usage**\n\n```js\nawait page.dragAndDrop('#source', '#target');\n// or specify exact positions relative to the top-left corners of the elements:\nawait page.dragAndDrop('#source', '#target', {\n sourcePosition: { x: 34, y: 7 },\n targetPosition: { x: 10, y: 20 },\n});\n```\n\n```java\npage.dragAndDrop(\"#source\", '#target');\n// or specify exact positions relative to the top-left corners of the elements:\npage.dragAndDrop(\"#source\", '#target', new Page.DragAndDropOptions()\n .setSourcePosition(34, 7).setTargetPosition(10, 20));\n```\n\n```py\nawait page.drag_and_drop(\"#source\", \"#target\")\n# or specify exact positions relative to the top-left corners of the elements:\nawait page.drag_and_drop(\n \"#source\",\n \"#target\",\n source_position={\"x\": 34, \"y\": 7},\n target_position={\"x\": 10, \"y\": 20}\n)\n```\n\n```py\npage.drag_and_drop(\"#source\", \"#target\")\n# or specify exact positions relative to the top-left corners of the elements:\npage.drag_and_drop(\n \"#source\",\n \"#target\",\n source_position={\"x\": 34, \"y\": 7},\n target_position={\"x\": 10, \"y\": 20}\n)\n```\n\n```csharp\nawait Page.DragAndDropAsync(\"#source\", \"#target\");\n// or specify exact positions relative to the top-left corners of the elements:\nawait Page.DragAndDropAsync(\"#source\", \"#target\", new()\n{\n SourcePosition = new() { X = 34, Y = 7 },\n TargetPosition = new() { X = 10, Y = 20 },\n});\n```\n","async":true,"alias":"dragAndDrop","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.13","name":"source","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element to drag. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element to drag. If there are multiple elements satisfying the selector, the first will\nbe used.","async":false,"alias":"source","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.13","name":"target","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element to drop onto. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element to drop onto. If there are multiple elements satisfying the selector, the first\nwill be used.","async":false,"alias":"target","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.13","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.13","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"sourcePosition","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Clicks on the source element at this point relative to the top-left corner of the element's padding box. If not specified, some visible point of the element is used."}],"required":false,"comment":"Clicks on the source element at this point relative to the top-left corner of the element's padding box. If not\nspecified, some visible point of the element is used.","async":false,"alias":"sourcePosition","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"targetPosition","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Drops on the target element at this point relative to the top-left corner of the element's padding box. If not specified, some visible point of the element is used."}],"required":false,"comment":"Drops on the target element at this point relative to the top-left corner of the element's padding box. If not\nspecified, some visible point of the element is used.","async":false,"alias":"targetPosition","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.13","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.13","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.13","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"emulateMedia","type":{"name":"void"},"spec":[{"type":"text","text":"This method changes the `CSS media type` through the `media` argument, and/or the `'prefers-colors-scheme'` media feature, using the `colorScheme` argument."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.evaluate(() => matchMedia('screen').matches);","// → true","await page.evaluate(() => matchMedia('print').matches);","// → false","","await page.emulateMedia({ media: 'print' });","await page.evaluate(() => matchMedia('screen').matches);","// → false","await page.evaluate(() => matchMedia('print').matches);","// → true","","await page.emulateMedia({});","await page.evaluate(() => matchMedia('screen').matches);","// → true","await page.evaluate(() => matchMedia('print').matches);","// → false"],"codeLang":"js"},{"type":"code","lines":["page.evaluate(\"() => matchMedia('screen').matches\");","// → true","page.evaluate(\"() => matchMedia('print').matches\");","// → false","","page.emulateMedia(new Page.EmulateMediaOptions().setMedia(Media.PRINT));","page.evaluate(\"() => matchMedia('screen').matches\");","// → false","page.evaluate(\"() => matchMedia('print').matches\");","// → true","","page.emulateMedia(new Page.EmulateMediaOptions());","page.evaluate(\"() => matchMedia('screen').matches\");","// → true","page.evaluate(\"() => matchMedia('print').matches\");","// → false"],"codeLang":"java"},{"type":"code","lines":["await page.evaluate(\"matchMedia('screen').matches\")","# → True","await page.evaluate(\"matchMedia('print').matches\")","# → False","","await page.emulate_media(media=\"print\")","await page.evaluate(\"matchMedia('screen').matches\")","# → False","await page.evaluate(\"matchMedia('print').matches\")","# → True","","await page.emulate_media()","await page.evaluate(\"matchMedia('screen').matches\")","# → True","await page.evaluate(\"matchMedia('print').matches\")","# → False"],"codeLang":"python async"},{"type":"code","lines":["page.evaluate(\"matchMedia('screen').matches\")","# → True","page.evaluate(\"matchMedia('print').matches\")","# → False","","page.emulate_media(media=\"print\")","page.evaluate(\"matchMedia('screen').matches\")","# → False","page.evaluate(\"matchMedia('print').matches\")","# → True","","page.emulate_media()","page.evaluate(\"matchMedia('screen').matches\")","# → True","page.evaluate(\"matchMedia('print').matches\")","# → False"],"codeLang":"python sync"},{"type":"code","lines":["await page.EvaluateAsync(\"() => matchMedia('screen').matches\");","// → true","await page.EvaluateAsync(\"() => matchMedia('print').matches\");","// → false","","await page.EmulateMediaAsync(new() { Media = Media.Print });","await page.EvaluateAsync(\"() => matchMedia('screen').matches\");","// → false","await page.EvaluateAsync(\"() => matchMedia('print').matches\");","// → true","","await page.EmulateMediaAsync(new() { Media = Media.Screen });","await page.EvaluateAsync(\"() => matchMedia('screen').matches\");","// → true","await page.EvaluateAsync(\"() => matchMedia('print').matches\");","// → false"],"codeLang":"csharp"},{"type":"code","lines":["await page.emulateMedia({ colorScheme: 'dark' });","await page.evaluate(() => matchMedia('(prefers-color-scheme: dark)').matches);","// → true","await page.evaluate(() => matchMedia('(prefers-color-scheme: light)').matches);","// → false","await page.evaluate(() => matchMedia('(prefers-color-scheme: no-preference)').matches);","// → false"],"codeLang":"js"},{"type":"code","lines":["page.emulateMedia(new Page.EmulateMediaOptions().setColorScheme(ColorScheme.DARK));","page.evaluate(\"() => matchMedia('(prefers-color-scheme: dark)').matches\");","// → true","page.evaluate(\"() => matchMedia('(prefers-color-scheme: light)').matches\");","// → false","page.evaluate(\"() => matchMedia('(prefers-color-scheme: no-preference)').matches\");","// → false"],"codeLang":"java"},{"type":"code","lines":["await page.emulate_media(color_scheme=\"dark\")","await page.evaluate(\"matchMedia('(prefers-color-scheme: dark)').matches\")","# → True","await page.evaluate(\"matchMedia('(prefers-color-scheme: light)').matches\")","# → False","await page.evaluate(\"matchMedia('(prefers-color-scheme: no-preference)').matches\")","# → False"],"codeLang":"python async"},{"type":"code","lines":["page.emulate_media(color_scheme=\"dark\")","page.evaluate(\"matchMedia('(prefers-color-scheme: dark)').matches\")","# → True","page.evaluate(\"matchMedia('(prefers-color-scheme: light)').matches\")","# → False","page.evaluate(\"matchMedia('(prefers-color-scheme: no-preference)').matches\")"],"codeLang":"python sync"},{"type":"code","lines":["await page.EmulateMediaAsync(new() { ColorScheme = ColorScheme.Dark });","await page.EvaluateAsync(\"matchMedia('(prefers-color-scheme: dark)').matches\");","// → true","await page.EvaluateAsync(\"matchMedia('(prefers-color-scheme: light)').matches\");","// → false","await page.EvaluateAsync(\"matchMedia('(prefers-color-scheme: no-preference)').matches\");","// → false"],"codeLang":"csharp"}],"required":true,"comment":"This method changes the `CSS media type` through the `media` argument, and/or the `'prefers-colors-scheme'` media\nfeature, using the `colorScheme` argument.\n\n**Usage**\n\n```js\nawait page.evaluate(() => matchMedia('screen').matches);\n// → true\nawait page.evaluate(() => matchMedia('print').matches);\n// → false\n\nawait page.emulateMedia({ media: 'print' });\nawait page.evaluate(() => matchMedia('screen').matches);\n// → false\nawait page.evaluate(() => matchMedia('print').matches);\n// → true\n\nawait page.emulateMedia({});\nawait page.evaluate(() => matchMedia('screen').matches);\n// → true\nawait page.evaluate(() => matchMedia('print').matches);\n// → false\n```\n\n```java\npage.evaluate(\"() => matchMedia('screen').matches\");\n// → true\npage.evaluate(\"() => matchMedia('print').matches\");\n// → false\n\npage.emulateMedia(new Page.EmulateMediaOptions().setMedia(Media.PRINT));\npage.evaluate(\"() => matchMedia('screen').matches\");\n// → false\npage.evaluate(\"() => matchMedia('print').matches\");\n// → true\n\npage.emulateMedia(new Page.EmulateMediaOptions());\npage.evaluate(\"() => matchMedia('screen').matches\");\n// → true\npage.evaluate(\"() => matchMedia('print').matches\");\n// → false\n```\n\n```py\nawait page.evaluate(\"matchMedia('screen').matches\")\n# → True\nawait page.evaluate(\"matchMedia('print').matches\")\n# → False\n\nawait page.emulate_media(media=\"print\")\nawait page.evaluate(\"matchMedia('screen').matches\")\n# → False\nawait page.evaluate(\"matchMedia('print').matches\")\n# → True\n\nawait page.emulate_media()\nawait page.evaluate(\"matchMedia('screen').matches\")\n# → True\nawait page.evaluate(\"matchMedia('print').matches\")\n# → False\n```\n\n```py\npage.evaluate(\"matchMedia('screen').matches\")\n# → True\npage.evaluate(\"matchMedia('print').matches\")\n# → False\n\npage.emulate_media(media=\"print\")\npage.evaluate(\"matchMedia('screen').matches\")\n# → False\npage.evaluate(\"matchMedia('print').matches\")\n# → True\n\npage.emulate_media()\npage.evaluate(\"matchMedia('screen').matches\")\n# → True\npage.evaluate(\"matchMedia('print').matches\")\n# → False\n```\n\n```csharp\nawait page.EvaluateAsync(\"() => matchMedia('screen').matches\");\n// → true\nawait page.EvaluateAsync(\"() => matchMedia('print').matches\");\n// → false\n\nawait page.EmulateMediaAsync(new() { Media = Media.Print });\nawait page.EvaluateAsync(\"() => matchMedia('screen').matches\");\n// → false\nawait page.EvaluateAsync(\"() => matchMedia('print').matches\");\n// → true\n\nawait page.EmulateMediaAsync(new() { Media = Media.Screen });\nawait page.EvaluateAsync(\"() => matchMedia('screen').matches\");\n// → true\nawait page.EvaluateAsync(\"() => matchMedia('print').matches\");\n// → false\n```\n\n```js\nawait page.emulateMedia({ colorScheme: 'dark' });\nawait page.evaluate(() => matchMedia('(prefers-color-scheme: dark)').matches);\n// → true\nawait page.evaluate(() => matchMedia('(prefers-color-scheme: light)').matches);\n// → false\nawait page.evaluate(() => matchMedia('(prefers-color-scheme: no-preference)').matches);\n// → false\n```\n\n```java\npage.emulateMedia(new Page.EmulateMediaOptions().setColorScheme(ColorScheme.DARK));\npage.evaluate(\"() => matchMedia('(prefers-color-scheme: dark)').matches\");\n// → true\npage.evaluate(\"() => matchMedia('(prefers-color-scheme: light)').matches\");\n// → false\npage.evaluate(\"() => matchMedia('(prefers-color-scheme: no-preference)').matches\");\n// → false\n```\n\n```py\nawait page.emulate_media(color_scheme=\"dark\")\nawait page.evaluate(\"matchMedia('(prefers-color-scheme: dark)').matches\")\n# → True\nawait page.evaluate(\"matchMedia('(prefers-color-scheme: light)').matches\")\n# → False\nawait page.evaluate(\"matchMedia('(prefers-color-scheme: no-preference)').matches\")\n# → False\n```\n\n```py\npage.emulate_media(color_scheme=\"dark\")\npage.evaluate(\"matchMedia('(prefers-color-scheme: dark)').matches\")\n# → True\npage.evaluate(\"matchMedia('(prefers-color-scheme: light)').matches\")\n# → False\npage.evaluate(\"matchMedia('(prefers-color-scheme: no-preference)').matches\")\n```\n\n```csharp\nawait page.EmulateMediaAsync(new() { ColorScheme = ColorScheme.Dark });\nawait page.EvaluateAsync(\"matchMedia('(prefers-color-scheme: dark)').matches\");\n// → true\nawait page.EvaluateAsync(\"matchMedia('(prefers-color-scheme: light)').matches\");\n// → false\nawait page.EvaluateAsync(\"matchMedia('(prefers-color-scheme: no-preference)').matches\");\n// → false\n```\n","async":true,"alias":"emulateMedia","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"colorScheme","type":{"name":"","union":[{"name":"null"},{"name":"ColorScheme","union":[{"name":"\"light\""},{"name":"\"dark\""},{"name":"\"no-preference\""}]}],"expression":"null|[ColorScheme]<\"light\"|\"dark\"|\"no-preference\">"},"spec":[{"type":"text","text":"Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. Passing↵`null` disables color scheme emulation."}],"required":false,"comment":"Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`.\nPassing `null` disables color scheme emulation.","async":false,"alias":"colorScheme","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"colorScheme","type":{"name":"ColorScheme","union":[{"name":"\"light\""},{"name":"\"dark\""},{"name":"\"no-preference\""},{"name":"\"null\""}],"expression":"[ColorScheme]<\"light\"|\"dark\"|\"no-preference\"|\"null\">"},"spec":[{"type":"text","text":"Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. Passing↵`'Null'` disables color scheme emulation."}],"required":false,"comment":"Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`.\nPassing `'Null'` disables color scheme emulation.","async":false,"alias":"colorScheme","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.15","name":"forcedColors","type":{"name":"","union":[{"name":"null"},{"name":"ForcedColors","union":[{"name":"\"active\""},{"name":"\"none\""}]}],"expression":"null|[ForcedColors]<\"active\"|\"none\">"},"spec":[{"type":"text","text":"Emulates `'forced-colors'` media feature, supported values are `'active'` and `'none'`. Passing `null` disables forced colors emulation."}],"required":false,"comment":"Emulates `'forced-colors'` media feature, supported values are `'active'` and `'none'`. Passing `null` disables\nforced colors emulation.","async":false,"alias":"forcedColors","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.15","name":"forcedColors","type":{"name":"ForcedColors","union":[{"name":"\"active\""},{"name":"\"none\""},{"name":"\"null\""}],"expression":"[ForcedColors]<\"active\"|\"none\"|\"null\">"},"spec":[],"required":false,"comment":"","async":false,"alias":"forcedColors","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"media","type":{"name":"","union":[{"name":"null"},{"name":"Media","union":[{"name":"\"screen\""},{"name":"\"print\""}]}],"expression":"null|[Media]<\"screen\"|\"print\">"},"spec":[{"type":"text","text":"Changes the CSS media type of the page. The only allowed values are `'screen'`, `'print'` and `null`.↵Passing `null` disables CSS media emulation."}],"required":false,"comment":"Changes the CSS media type of the page. The only allowed values are `'screen'`, `'print'` and `null`. Passing\n`null` disables CSS media emulation.","async":false,"alias":"media","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"media","type":{"name":"Media","union":[{"name":"\"screen\""},{"name":"\"print\""},{"name":"\"null\""}],"expression":"[Media]<\"screen\"|\"print\"|\"null\">"},"spec":[{"type":"text","text":"Changes the CSS media type of the page. The only allowed values are `'Screen'`, `'Print'` and `'Null'`.↵Passing `'Null'` disables CSS media emulation."}],"required":false,"comment":"Changes the CSS media type of the page. The only allowed values are `'Screen'`, `'Print'` and `'Null'`. Passing\n`'Null'` disables CSS media emulation.","async":false,"alias":"media","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.12","name":"reducedMotion","type":{"name":"","union":[{"name":"null"},{"name":"ReducedMotion","union":[{"name":"\"reduce\""},{"name":"\"no-preference\""}]}],"expression":"null|[ReducedMotion]<\"reduce\"|\"no-preference\">"},"spec":[{"type":"text","text":"Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. Passing `null` disables reduced motion emulation."}],"required":false,"comment":"Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. Passing\n`null` disables reduced motion emulation.","async":false,"alias":"reducedMotion","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.12","name":"reducedMotion","type":{"name":"ReducedMotion","union":[{"name":"\"reduce\""},{"name":"\"no-preference\""},{"name":"\"null\""}],"expression":"[ReducedMotion]<\"reduce\"|\"no-preference\"|\"null\">"},"spec":[{"type":"text","text":"Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. Passing `null` disables reduced motion emulation."}],"required":false,"comment":"Emulates `'prefers-reduced-motion'` media feature, supported values are `'reduce'`, `'no-preference'`. Passing\n`null` disables reduced motion emulation.","async":false,"alias":"reducedMotion","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"python":"eval_on_selector","js":"$eval"},"types":{},"overrides":{}},"since":"v1.9","discouraged":"This method does not wait for the element to pass actionability↵checks and therefore can lead to the flaky tests. Use [`method: Locator.evaluate`],↵other `Locator` helper methods or web-first assertions instead.","name":"evalOnSelector","type":{"name":"Serializable","expression":"[Serializable]"},"spec":[{"type":"text","text":"The method finds an element matching the specified selector within the page and passes it as a first argument to↵`expression`. If no elements match the selector, the method throws an error. Returns the value of↵`expression`."},{"type":"text","text":"If `expression` returns a [Promise], then [`method: Page.evalOnSelector`] would wait for the promise to resolve and↵return its value."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const searchValue = await page.$eval('#search', el => el.value);","const preloadHref = await page.$eval('link[rel=preload]', el => el.href);","const html = await page.$eval('.main-container', (e, suffix) => e.outerHTML + suffix, 'hello');","// In TypeScript, this example requires an explicit type annotation (HTMLLinkElement) on el:","const preloadHrefTS = await page.$eval('link[rel=preload]', (el: HTMLLinkElement) => el.href);"],"codeLang":"js"},{"type":"code","lines":["String searchValue = (String) page.evalOnSelector(\"#search\", \"el => el.value\");","String preloadHref = (String) page.evalOnSelector(\"link[rel=preload]\", \"el => el.href\");","String html = (String) page.evalOnSelector(\".main-container\", \"(e, suffix) => e.outerHTML + suffix\", \"hello\");"],"codeLang":"java"},{"type":"code","lines":["search_value = await page.eval_on_selector(\"#search\", \"el => el.value\")","preload_href = await page.eval_on_selector(\"link[rel=preload]\", \"el => el.href\")","html = await page.eval_on_selector(\".main-container\", \"(e, suffix) => e.outer_html + suffix\", \"hello\")"],"codeLang":"python async"},{"type":"code","lines":["search_value = page.eval_on_selector(\"#search\", \"el => el.value\")","preload_href = page.eval_on_selector(\"link[rel=preload]\", \"el => el.href\")","html = page.eval_on_selector(\".main-container\", \"(e, suffix) => e.outer_html + suffix\", \"hello\")"],"codeLang":"python sync"},{"type":"code","lines":["var searchValue = await page.EvalOnSelectorAsync<string>(\"#search\", \"el => el.value\");","var preloadHref = await page.EvalOnSelectorAsync<string>(\"link[rel=preload]\", \"el => el.href\");","var html = await page.EvalOnSelectorAsync(\".main-container\", \"(e, suffix) => e.outerHTML + suffix\", \"hello\");"],"codeLang":"csharp"}],"required":true,"comment":"The method finds an element matching the specified selector within the page and passes it as a first argument to\n`expression`. If no elements match the selector, the method throws an error. Returns the value of `expression`.\n\nIf `expression` returns a [Promise], then [`method: Page.evalOnSelector`] would wait for the promise to resolve and\nreturn its value.\n\n**Usage**\n\n```js\nconst searchValue = await page.$eval('#search', el => el.value);\nconst preloadHref = await page.$eval('link[rel=preload]', el => el.href);\nconst html = await page.$eval('.main-container', (e, suffix) => e.outerHTML + suffix, 'hello');\n// In TypeScript, this example requires an explicit type annotation (HTMLLinkElement) on el:\nconst preloadHrefTS = await page.$eval('link[rel=preload]', (el: HTMLLinkElement) => el.href);\n```\n\n```java\nString searchValue = (String) page.evalOnSelector(\"#search\", \"el => el.value\");\nString preloadHref = (String) page.evalOnSelector(\"link[rel=preload]\", \"el => el.href\");\nString html = (String) page.evalOnSelector(\".main-container\", \"(e, suffix) => e.outerHTML + suffix\", \"hello\");\n```\n\n```py\nsearch_value = await page.eval_on_selector(\"#search\", \"el => el.value\")\npreload_href = await page.eval_on_selector(\"link[rel=preload]\", \"el => el.href\")\nhtml = await page.eval_on_selector(\".main-container\", \"(e, suffix) => e.outer_html + suffix\", \"hello\")\n```\n\n```py\nsearch_value = page.eval_on_selector(\"#search\", \"el => el.value\")\npreload_href = page.eval_on_selector(\"link[rel=preload]\", \"el => el.href\")\nhtml = page.eval_on_selector(\".main-container\", \"(e, suffix) => e.outer_html + suffix\", \"hello\")\n```\n\n```csharp\nvar searchValue = await page.EvalOnSelectorAsync<string>(\"#search\", \"el => el.value\");\nvar preloadHref = await page.EvalOnSelectorAsync<string>(\"link[rel=preload]\", \"el => el.href\");\nvar html = await page.EvalOnSelectorAsync(\".main-container\", \"(e, suffix) => e.outerHTML + suffix\", \"hello\");\n```\n","async":true,"alias":"evalOnSelector","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to query for."}],"required":true,"comment":"A selector to query for.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"overrides":{"js":{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"expression","type":{"name":"","union":[{"name":"function","args":[{"name":"Element"}]},{"name":"string"}],"expression":"[function]([Element])|[string]"},"spec":[{"type":"text","text":"Function to be evaluated in the page context."}],"argsArray":[],"required":true,"comment":"Function to be evaluated in the page context.","args":{},"clazz":null,"async":false,"alias":"pageFunction","overloadIndex":0,"paramOrOption":null}}},"since":"v1.9","name":"expression","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"JavaScript expression to be evaluated in the browser context. If the expression evaluates↵to a function, the function is automatically invoked."}],"required":true,"comment":"JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the\nfunction is automatically invoked.","async":false,"alias":"expression","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"arg","type":{"name":"EvaluationArgument","expression":"[EvaluationArgument]"},"spec":[{"type":"text","text":"Optional argument to pass to `expression`."}],"required":false,"comment":"Optional argument to pass to `expression`.","async":false,"alias":"arg","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"python":"eval_on_selector_all","js":"$$eval"},"types":{},"overrides":{}},"since":"v1.9","discouraged":"In most cases, [`method: Locator.evaluateAll`],↵other `Locator` helper methods and web-first assertions do a better job.","name":"evalOnSelectorAll","type":{"name":"Serializable","expression":"[Serializable]"},"spec":[{"type":"text","text":"The method finds all elements matching the specified selector within the page and passes an array of matched elements as↵a first argument to `expression`. Returns the result of `expression` invocation."},{"type":"text","text":"If `expression` returns a [Promise], then [`method: Page.evalOnSelectorAll`] would wait for the promise to resolve and↵return its value."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const divCounts = await page.$$eval('div', (divs, min) => divs.length >= min, 10);"],"codeLang":"js"},{"type":"code","lines":["boolean divCounts = (boolean) page.evalOnSelectorAll(\"div\", \"(divs, min) => divs.length >= min\", 10);"],"codeLang":"java"},{"type":"code","lines":["div_counts = await page.eval_on_selector_all(\"div\", \"(divs, min) => divs.length >= min\", 10)"],"codeLang":"python async"},{"type":"code","lines":["div_counts = page.eval_on_selector_all(\"div\", \"(divs, min) => divs.length >= min\", 10)"],"codeLang":"python sync"},{"type":"code","lines":["var divsCount = await page.EvalOnSelectorAllAsync<bool>(\"div\", \"(divs, min) => divs.length >= min\", 10);"],"codeLang":"csharp"}],"required":true,"comment":"The method finds all elements matching the specified selector within the page and passes an array of matched\nelements as a first argument to `expression`. Returns the result of `expression` invocation.\n\nIf `expression` returns a [Promise], then [`method: Page.evalOnSelectorAll`] would wait for the promise to resolve\nand return its value.\n\n**Usage**\n\n```js\nconst divCounts = await page.$$eval('div', (divs, min) => divs.length >= min, 10);\n```\n\n```java\nboolean divCounts = (boolean) page.evalOnSelectorAll(\"div\", \"(divs, min) => divs.length >= min\", 10);\n```\n\n```py\ndiv_counts = await page.eval_on_selector_all(\"div\", \"(divs, min) => divs.length >= min\", 10)\n```\n\n```py\ndiv_counts = page.eval_on_selector_all(\"div\", \"(divs, min) => divs.length >= min\", 10)\n```\n\n```csharp\nvar divsCount = await page.EvalOnSelectorAllAsync<bool>(\"div\", \"(divs, min) => divs.length >= min\", 10);\n```\n","async":true,"alias":"evalOnSelectorAll","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to query for."}],"required":true,"comment":"A selector to query for.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"overrides":{"js":{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"expression","type":{"name":"","union":[{"name":"function","args":[{"name":"Array","templates":[{"name":"Element"}]}]},{"name":"string"}],"expression":"[function]([Array]<[Element]>)|[string]"},"spec":[{"type":"text","text":"Function to be evaluated in the page context."}],"argsArray":[],"required":true,"comment":"Function to be evaluated in the page context.","args":{},"clazz":null,"async":false,"alias":"pageFunction","overloadIndex":0,"paramOrOption":null}}},"since":"v1.9","name":"expression","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"JavaScript expression to be evaluated in the browser context. If the expression evaluates↵to a function, the function is automatically invoked."}],"required":true,"comment":"JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the\nfunction is automatically invoked.","async":false,"alias":"expression","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.9","name":"arg","type":{"name":"EvaluationArgument","expression":"[EvaluationArgument]"},"spec":[{"type":"text","text":"Optional argument to pass to `expression`."}],"required":false,"comment":"Optional argument to pass to `expression`.","async":false,"alias":"arg","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"evaluate","type":{"name":"Serializable","expression":"[Serializable]"},"spec":[{"type":"text","text":"Returns the value of the `expression` invocation."},{"type":"text","text":"If the function passed to the [`method: Page.evaluate`] returns a [Promise], then [`method: Page.evaluate`] would wait↵for the promise to resolve and return its value."},{"type":"text","text":"If the function passed to the [`method: Page.evaluate`] returns a non-[Serializable] value, then↵[`method: Page.evaluate`] resolves to `undefined`. Playwright also supports transferring some↵additional values that are not serializable by `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`."},{"type":"text","text":"**Usage**"},{"type":"text","text":"Passing argument to `expression`:"},{"type":"code","lines":["const result = await page.evaluate(([x, y]) => {"," return Promise.resolve(x * y);","}, [7, 8]);","console.log(result); // prints \"56\""],"codeLang":"js"},{"type":"code","lines":["Object result = page.evaluate(\"([x, y]) => {\\n\" +"," \" return Promise.resolve(x * y);\\n\" +"," \"}\", Arrays.asList(7, 8));","System.out.println(result); // prints \"56\""],"codeLang":"java"},{"type":"code","lines":["result = await page.evaluate(\"([x, y]) => Promise.resolve(x * y)\", [7, 8])","print(result) # prints \"56\""],"codeLang":"python async"},{"type":"code","lines":["result = page.evaluate(\"([x, y]) => Promise.resolve(x * y)\", [7, 8])","print(result) # prints \"56\""],"codeLang":"python sync"},{"type":"code","lines":["var result = await page.EvaluateAsync<int>(\"([x, y]) => Promise.resolve(x * y)\", new[] { 7, 8 });","Console.WriteLine(result);"],"codeLang":"csharp"},{"type":"text","text":"A string can also be passed in instead of a function:"},{"type":"code","lines":["console.log(await page.evaluate('1 + 2')); // prints \"3\"","const x = 10;","console.log(await page.evaluate(`1 + ${x}`)); // prints \"11\""],"codeLang":"js"},{"type":"code","lines":["System.out.println(page.evaluate(\"1 + 2\")); // prints \"3\""],"codeLang":"java"},{"type":"code","lines":["print(await page.evaluate(\"1 + 2\")) # prints \"3\"","x = 10","print(await page.evaluate(f\"1 + {x}\")) # prints \"11\""],"codeLang":"python async"},{"type":"code","lines":["print(page.evaluate(\"1 + 2\")) # prints \"3\"","x = 10","print(page.evaluate(f\"1 + {x}\")) # prints \"11\""],"codeLang":"python sync"},{"type":"code","lines":["Console.WriteLine(await page.EvaluateAsync<int>(\"1 + 2\")); // prints \"3\""],"codeLang":"csharp"},{"type":"text","text":"`ElementHandle` instances can be passed as an argument to the [`method: Page.evaluate`]:"},{"type":"code","lines":["const bodyHandle = await page.evaluate('document.body');","const html = await page.evaluate<string, HTMLElement>(([body, suffix]) =>"," body.innerHTML + suffix, [bodyHandle, 'hello']",");","await bodyHandle.dispose();"],"codeLang":"js"},{"type":"code","lines":["ElementHandle bodyHandle = page.evaluate(\"document.body\");","String html = (String) page.evaluate(\"([body, suffix]) => body.innerHTML + suffix\", Arrays.asList(bodyHandle, \"hello\"));","bodyHandle.dispose();"],"codeLang":"java"},{"type":"code","lines":["body_handle = await page.evaluate(\"document.body\")","html = await page.evaluate(\"([body, suffix]) => body.innerHTML + suffix\", [body_handle, \"hello\"])","await body_handle.dispose()"],"codeLang":"python async"},{"type":"code","lines":["body_handle = page.evaluate(\"document.body\")","html = page.evaluate(\"([body, suffix]) => body.innerHTML + suffix\", [body_handle, \"hello\"])","body_handle.dispose()"],"codeLang":"python sync"},{"type":"code","lines":["var bodyHandle = await page.EvaluateAsync(\"document.body\");","var html = await page.EvaluateAsync<string>(\"([body, suffix]) => body.innerHTML + suffix\", new object [] { bodyHandle, \"hello\" });","await bodyHandle.DisposeAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Returns the value of the `expression` invocation.\n\nIf the function passed to the [`method: Page.evaluate`] returns a [Promise], then [`method: Page.evaluate`] would\nwait for the promise to resolve and return its value.\n\nIf the function passed to the [`method: Page.evaluate`] returns a non-[Serializable] value, then\n[`method: Page.evaluate`] resolves to `undefined`. Playwright also supports transferring some additional values\nthat are not serializable by `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`.\n\n**Usage**\n\nPassing argument to `expression`:\n\n```js\nconst result = await page.evaluate(([x, y]) => {\n return Promise.resolve(x * y);\n}, [7, 8]);\nconsole.log(result); // prints \"56\"\n```\n\n```java\nObject result = page.evaluate(\"([x, y]) => {\\n\" +\n \" return Promise.resolve(x * y);\\n\" +\n \"}\", Arrays.asList(7, 8));\nSystem.out.println(result); // prints \"56\"\n```\n\n```py\nresult = await page.evaluate(\"([x, y]) => Promise.resolve(x * y)\", [7, 8])\nprint(result) # prints \"56\"\n```\n\n```py\nresult = page.evaluate(\"([x, y]) => Promise.resolve(x * y)\", [7, 8])\nprint(result) # prints \"56\"\n```\n\n```csharp\nvar result = await page.EvaluateAsync<int>(\"([x, y]) => Promise.resolve(x * y)\", new[] { 7, 8 });\nConsole.WriteLine(result);\n```\n\nA string can also be passed in instead of a function:\n\n```js\nconsole.log(await page.evaluate('1 + 2')); // prints \"3\"\nconst x = 10;\nconsole.log(await page.evaluate(`1 + ${x}`)); // prints \"11\"\n```\n\n```java\nSystem.out.println(page.evaluate(\"1 + 2\")); // prints \"3\"\n```\n\n```py\nprint(await page.evaluate(\"1 + 2\")) # prints \"3\"\nx = 10\nprint(await page.evaluate(f\"1 + {x}\")) # prints \"11\"\n```\n\n```py\nprint(page.evaluate(\"1 + 2\")) # prints \"3\"\nx = 10\nprint(page.evaluate(f\"1 + {x}\")) # prints \"11\"\n```\n\n```csharp\nConsole.WriteLine(await page.EvaluateAsync<int>(\"1 + 2\")); // prints \"3\"\n```\n\n`ElementHandle` instances can be passed as an argument to the [`method: Page.evaluate`]:\n\n```js\nconst bodyHandle = await page.evaluate('document.body');\nconst html = await page.evaluate<string, HTMLElement>(([body, suffix]) =>\n body.innerHTML + suffix, [bodyHandle, 'hello']\n);\nawait bodyHandle.dispose();\n```\n\n```java\nElementHandle bodyHandle = page.evaluate(\"document.body\");\nString html = (String) page.evaluate(\"([body, suffix]) => body.innerHTML + suffix\", Arrays.asList(bodyHandle, \"hello\"));\nbodyHandle.dispose();\n```\n\n```py\nbody_handle = await page.evaluate(\"document.body\")\nhtml = await page.evaluate(\"([body, suffix]) => body.innerHTML + suffix\", [body_handle, \"hello\"])\nawait body_handle.dispose()\n```\n\n```py\nbody_handle = page.evaluate(\"document.body\")\nhtml = page.evaluate(\"([body, suffix]) => body.innerHTML + suffix\", [body_handle, \"hello\"])\nbody_handle.dispose()\n```\n\n```csharp\nvar bodyHandle = await page.EvaluateAsync(\"document.body\");\nvar html = await page.EvaluateAsync<string>(\"([body, suffix]) => body.innerHTML + suffix\", new object [] { bodyHandle, \"hello\" });\nawait bodyHandle.DisposeAsync();\n```\n","async":true,"alias":"evaluate","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"overrides":{"js":{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"expression","type":{"name":"","union":[{"name":"function"},{"name":"string"}],"expression":"[function]|[string]"},"spec":[{"type":"text","text":"Function to be evaluated in the page context."}],"argsArray":[],"required":true,"comment":"Function to be evaluated in the page context.","args":{},"clazz":null,"async":false,"alias":"pageFunction","overloadIndex":0,"paramOrOption":null}}},"since":"v1.8","name":"expression","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"JavaScript expression to be evaluated in the browser context. If the expression evaluates↵to a function, the function is automatically invoked."}],"required":true,"comment":"JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the\nfunction is automatically invoked.","async":false,"alias":"expression","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"arg","type":{"name":"EvaluationArgument","expression":"[EvaluationArgument]"},"spec":[{"type":"text","text":"Optional argument to pass to `expression`."}],"required":false,"comment":"Optional argument to pass to `expression`.","async":false,"alias":"arg","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"evaluateHandle","type":{"name":"JSHandle","expression":"[JSHandle]"},"spec":[{"type":"text","text":"Returns the value of the `expression` invocation as a `JSHandle`."},{"type":"text","text":"The only difference between [`method: Page.evaluate`] and [`method: Page.evaluateHandle`] is that [`method: Page.evaluateHandle`] returns `JSHandle`."},{"type":"text","text":"If the function passed to the [`method: Page.evaluateHandle`] returns a [Promise], then [`method: Page.evaluateHandle`] would wait for the↵promise to resolve and return its value."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["// Handle for the window object.","const aWindowHandle = await page.evaluateHandle(() => Promise.resolve(window));"],"codeLang":"js"},{"type":"code","lines":["// Handle for the window object.","JSHandle aWindowHandle = page.evaluateHandle(\"() => Promise.resolve(window)\");"],"codeLang":"java"},{"type":"code","lines":["a_window_handle = await page.evaluate_handle(\"Promise.resolve(window)\")","a_window_handle # handle for the window object."],"codeLang":"python async"},{"type":"code","lines":["a_window_handle = page.evaluate_handle(\"Promise.resolve(window)\")","a_window_handle # handle for the window object."],"codeLang":"python sync"},{"type":"code","lines":["// Handle for the window object.","var aWindowHandle = await page.EvaluateHandleAsync(\"() => Promise.resolve(window)\");"],"codeLang":"csharp"},{"type":"text","text":"A string can also be passed in instead of a function:"},{"type":"code","lines":["const aHandle = await page.evaluateHandle('document'); // Handle for the 'document'"],"codeLang":"js"},{"type":"code","lines":["JSHandle aHandle = page.evaluateHandle(\"document\"); // Handle for the \"document\"."],"codeLang":"java"},{"type":"code","lines":["a_handle = await page.evaluate_handle(\"document\") # handle for the \"document\""],"codeLang":"python async"},{"type":"code","lines":["a_handle = page.evaluate_handle(\"document\") # handle for the \"document\""],"codeLang":"python sync"},{"type":"code","lines":["var docHandle = await page.EvaluateHandleAsync(\"document\"); // Handle for the `document`"],"codeLang":"csharp"},{"type":"text","text":"`JSHandle` instances can be passed as an argument to the [`method: Page.evaluateHandle`]:"},{"type":"code","lines":["const aHandle = await page.evaluateHandle(() => document.body);","const resultHandle = await page.evaluateHandle(body => body.innerHTML, aHandle);","console.log(await resultHandle.jsonValue());","await resultHandle.dispose();"],"codeLang":"js"},{"type":"code","lines":["JSHandle aHandle = page.evaluateHandle(\"() => document.body\");","JSHandle resultHandle = page.evaluateHandle(\"([body, suffix]) => body.innerHTML + suffix\", Arrays.asList(aHandle, \"hello\"));","System.out.println(resultHandle.jsonValue());","resultHandle.dispose();"],"codeLang":"java"},{"type":"code","lines":["a_handle = await page.evaluate_handle(\"document.body\")","result_handle = await page.evaluate_handle(\"body => body.innerHTML\", a_handle)","print(await result_handle.json_value())","await result_handle.dispose()"],"codeLang":"python async"},{"type":"code","lines":["a_handle = page.evaluate_handle(\"document.body\")","result_handle = page.evaluate_handle(\"body => body.innerHTML\", a_handle)","print(result_handle.json_value())","result_handle.dispose()"],"codeLang":"python sync"},{"type":"code","lines":["var handle = await page.EvaluateHandleAsync(\"() => document.body\");","var resultHandle = await page.EvaluateHandleAsync(\"([body, suffix]) => body.innerHTML + suffix\", new object[] { handle, \"hello\" });","Console.WriteLine(await resultHandle.JsonValueAsync<string>());","await resultHandle.DisposeAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Returns the value of the `expression` invocation as a `JSHandle`.\n\nThe only difference between [`method: Page.evaluate`] and [`method: Page.evaluateHandle`] is that\n[`method: Page.evaluateHandle`] returns `JSHandle`.\n\nIf the function passed to the [`method: Page.evaluateHandle`] returns a [Promise], then\n[`method: Page.evaluateHandle`] would wait for the promise to resolve and return its value.\n\n**Usage**\n\n```js\n// Handle for the window object.\nconst aWindowHandle = await page.evaluateHandle(() => Promise.resolve(window));\n```\n\n```java\n// Handle for the window object.\nJSHandle aWindowHandle = page.evaluateHandle(\"() => Promise.resolve(window)\");\n```\n\n```py\na_window_handle = await page.evaluate_handle(\"Promise.resolve(window)\")\na_window_handle # handle for the window object.\n```\n\n```py\na_window_handle = page.evaluate_handle(\"Promise.resolve(window)\")\na_window_handle # handle for the window object.\n```\n\n```csharp\n// Handle for the window object.\nvar aWindowHandle = await page.EvaluateHandleAsync(\"() => Promise.resolve(window)\");\n```\n\nA string can also be passed in instead of a function:\n\n```js\nconst aHandle = await page.evaluateHandle('document'); // Handle for the 'document'\n```\n\n```java\nJSHandle aHandle = page.evaluateHandle(\"document\"); // Handle for the \"document\".\n```\n\n```py\na_handle = await page.evaluate_handle(\"document\") # handle for the \"document\"\n```\n\n```py\na_handle = page.evaluate_handle(\"document\") # handle for the \"document\"\n```\n\n```csharp\nvar docHandle = await page.EvaluateHandleAsync(\"document\"); // Handle for the `document`\n```\n\n`JSHandle` instances can be passed as an argument to the [`method: Page.evaluateHandle`]:\n\n```js\nconst aHandle = await page.evaluateHandle(() => document.body);\nconst resultHandle = await page.evaluateHandle(body => body.innerHTML, aHandle);\nconsole.log(await resultHandle.jsonValue());\nawait resultHandle.dispose();\n```\n\n```java\nJSHandle aHandle = page.evaluateHandle(\"() => document.body\");\nJSHandle resultHandle = page.evaluateHandle(\"([body, suffix]) => body.innerHTML + suffix\", Arrays.asList(aHandle, \"hello\"));\nSystem.out.println(resultHandle.jsonValue());\nresultHandle.dispose();\n```\n\n```py\na_handle = await page.evaluate_handle(\"document.body\")\nresult_handle = await page.evaluate_handle(\"body => body.innerHTML\", a_handle)\nprint(await result_handle.json_value())\nawait result_handle.dispose()\n```\n\n```py\na_handle = page.evaluate_handle(\"document.body\")\nresult_handle = page.evaluate_handle(\"body => body.innerHTML\", a_handle)\nprint(result_handle.json_value())\nresult_handle.dispose()\n```\n\n```csharp\nvar handle = await page.EvaluateHandleAsync(\"() => document.body\");\nvar resultHandle = await page.EvaluateHandleAsync(\"([body, suffix]) => body.innerHTML + suffix\", new object[] { handle, \"hello\" });\nConsole.WriteLine(await resultHandle.JsonValueAsync<string>());\nawait resultHandle.DisposeAsync();\n```\n","async":true,"alias":"evaluateHandle","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"overrides":{"js":{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"expression","type":{"name":"","union":[{"name":"function"},{"name":"string"}],"expression":"[function]|[string]"},"spec":[{"type":"text","text":"Function to be evaluated in the page context."}],"argsArray":[],"required":true,"comment":"Function to be evaluated in the page context.","args":{},"clazz":null,"async":false,"alias":"pageFunction","overloadIndex":0,"paramOrOption":null}}},"since":"v1.8","name":"expression","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"JavaScript expression to be evaluated in the browser context. If the expression evaluates↵to a function, the function is automatically invoked."}],"required":true,"comment":"JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the\nfunction is automatically invoked.","async":false,"alias":"expression","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"arg","type":{"name":"EvaluationArgument","expression":"[EvaluationArgument]"},"spec":[{"type":"text","text":"Optional argument to pass to `expression`."}],"required":false,"comment":"Optional argument to pass to `expression`.","async":false,"alias":"arg","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"exposeBinding","type":{"name":"void"},"spec":[{"type":"text","text":"The method adds a function called `name` on the `window` object of every frame in this page. When called, the↵function executes `callback` and returns a [Promise] which resolves to the return value of `callback`.↵If the `callback` returns a [Promise], it will be awaited."},{"type":"text","text":"The first argument of the `callback` function contains information about the caller: `{ browserContext:↵BrowserContext, page: Page, frame: Frame }`."},{"type":"text","text":"See [`method: BrowserContext.exposeBinding`] for the context-wide version."},{"type":"note","noteType":"note","text":"Functions installed via [`method: Page.exposeBinding`] survive navigations."},{"type":"text","text":"**Usage**"},{"type":"text","text":"An example of exposing page URL to all frames in a page:"},{"type":"code","lines":["const { webkit } = require('playwright'); // Or 'chromium' or 'firefox'.","","(async () => {"," const browser = await webkit.launch({ headless: false });"," const context = await browser.newContext();"," const page = await context.newPage();"," await page.exposeBinding('pageURL', ({ page }) => page.url());"," await page.setContent(`"," <script>"," async function onClick() {"," document.querySelector('div').textContent = await window.pageURL();"," }"," </script>"," <button onclick=\"onClick()\">Click me</button>"," <div></div>"," `);"," await page.click('button');","})();"],"codeLang":"js"},{"type":"code","lines":["import com.microsoft.playwright.*;","","public class Example {"," public static void main(String[] args) {"," try (Playwright playwright = Playwright.create()) {"," BrowserType webkit = playwright.webkit();"," Browser browser = webkit.launch({ headless: false });"," BrowserContext context = browser.newContext();"," Page page = context.newPage();"," page.exposeBinding(\"pageURL\", (source, args) -> source.page().url());"," page.setContent(\"<script>\\n\" +"," \" async function onClick() {\\n\" +"," \" document.querySelector('div').textContent = await window.pageURL();\\n\" +"," \" }\\n\" +"," \"</script>\\n\" +"," \"<button onclick=\\\"onClick()\\\">Click me</button>\\n\" +"," \"<div></div>\");"," page.click(\"button\");"," }"," }","}"],"codeLang":"java"},{"type":"code","lines":["import asyncio","from playwright.async_api import async_playwright, Playwright","","async def run(playwright: Playwright):"," webkit = playwright.webkit"," browser = await webkit.launch(headless=False)"," context = await browser.new_context()"," page = await context.new_page()"," await page.expose_binding(\"pageURL\", lambda source: source[\"page\"].url)"," await page.set_content(\"\"\""," <script>"," async function onClick() {"," document.querySelector('div').textContent = await window.pageURL();"," }"," </script>"," <button onclick=\"onClick()\">Click me</button>"," <div></div>"," \"\"\")"," await page.click(\"button\")","","async def main():"," async with async_playwright() as playwright:"," await run(playwright)","asyncio.run(main())"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import sync_playwright, Playwright","","def run(playwright: Playwright):"," webkit = playwright.webkit"," browser = webkit.launch(headless=False)"," context = browser.new_context()"," page = context.new_page()"," page.expose_binding(\"pageURL\", lambda source: source[\"page\"].url)"," page.set_content(\"\"\""," <script>"," async function onClick() {"," document.querySelector('div').textContent = await window.pageURL();"," }"," </script>"," <button onclick=\"onClick()\">Click me</button>"," <div></div>"," \"\"\")"," page.click(\"button\")","","with sync_playwright() as playwright:"," run(playwright)"],"codeLang":"python sync"},{"type":"code","lines":["using Microsoft.Playwright;","using System.Threading.Tasks;","","class PageExamples","{"," public static async Task Main()"," {"," using var playwright = await Playwright.CreateAsync();"," await using var browser = await playwright.Webkit.LaunchAsync(new()"," {"," Headless = false,"," });"," var page = await browser.NewPageAsync();",""," await page.ExposeBindingAsync(\"pageUrl\", (source) => source.Page.Url);"," await page.SetContentAsync(\"<script>\\n\" +"," \" async function onClick() {\\n\" +"," \" document.querySelector('div').textContent = await window.pageURL();\\n\" +"," \" }\\n\" +"," \"</script>\\n\" +"," \"<button onclick=\\\"onClick()\\\">Click me</button>\\n\" +"," \"<div></div>\");",""," await page.ClickAsync(\"button\");"," }","}"],"codeLang":"csharp"}],"required":true,"comment":"The method adds a function called `name` on the `window` object of every frame in this page. When called, the\nfunction executes `callback` and returns a [Promise] which resolves to the return value of `callback`. If the\n`callback` returns a [Promise], it will be awaited.\n\nThe first argument of the `callback` function contains information about the caller: `{ browserContext:\nBrowserContext, page: Page, frame: Frame }`.\n\nSee [`method: BrowserContext.exposeBinding`] for the context-wide version.\n\n**NOTE** Functions installed via [`method: Page.exposeBinding`] survive navigations.\n\n**Usage**\n\nAn example of exposing page URL to all frames in a page:\n\n```js\nconst { webkit } = require('playwright'); // Or 'chromium' or 'firefox'.\n\n(async () => {\n const browser = await webkit.launch({ headless: false });\n const context = await browser.newContext();\n const page = await context.newPage();\n await page.exposeBinding('pageURL', ({ page }) => page.url());\n await page.setContent(`\n <script>\n async function onClick() {\n document.querySelector('div').textContent = await window.pageURL();\n }\n </script>\n <button onclick=\"onClick()\">Click me</button>\n <div></div>\n `);\n await page.click('button');\n})();\n```\n\n```java\nimport com.microsoft.playwright.*;\n\npublic class Example {\n public static void main(String[] args) {\n try (Playwright playwright = Playwright.create()) {\n BrowserType webkit = playwright.webkit();\n Browser browser = webkit.launch({ headless: false });\n BrowserContext context = browser.newContext();\n Page page = context.newPage();\n page.exposeBinding(\"pageURL\", (source, args) -> source.page().url());\n page.setContent(\"<script>\\n\" +\n \" async function onClick() {\\n\" +\n \" document.querySelector('div').textContent = await window.pageURL();\\n\" +\n \" }\\n\" +\n \"</script>\\n\" +\n \"<button onclick=\\\"onClick()\\\">Click me</button>\\n\" +\n \"<div></div>\");\n page.click(\"button\");\n }\n }\n}\n```\n\n```py\nimport asyncio\nfrom playwright.async_api import async_playwright, Playwright\n\nasync def run(playwright: Playwright):\n webkit = playwright.webkit\n browser = await webkit.launch(headless=False)\n context = await browser.new_context()\n page = await context.new_page()\n await page.expose_binding(\"pageURL\", lambda source: source[\"page\"].url)\n await page.set_content(\"\"\"\n <script>\n async function onClick() {\n document.querySelector('div').textContent = await window.pageURL();\n }\n </script>\n <button onclick=\"onClick()\">Click me</button>\n <div></div>\n \"\"\")\n await page.click(\"button\")\n\nasync def main():\n async with async_playwright() as playwright:\n await run(playwright)\nasyncio.run(main())\n```\n\n```py\nfrom playwright.sync_api import sync_playwright, Playwright\n\ndef run(playwright: Playwright):\n webkit = playwright.webkit\n browser = webkit.launch(headless=False)\n context = browser.new_context()\n page = context.new_page()\n page.expose_binding(\"pageURL\", lambda source: source[\"page\"].url)\n page.set_content(\"\"\"\n <script>\n async function onClick() {\n document.querySelector('div').textContent = await window.pageURL();\n }\n </script>\n <button onclick=\"onClick()\">Click me</button>\n <div></div>\n \"\"\")\n page.click(\"button\")\n\nwith sync_playwright() as playwright:\n run(playwright)\n```\n\n```csharp\nusing Microsoft.Playwright;\nusing System.Threading.Tasks;\n\nclass PageExamples\n{\n public static async Task Main()\n {\n using var playwright = await Playwright.CreateAsync();\n await using var browser = await playwright.Webkit.LaunchAsync(new()\n {\n Headless = false,\n });\n var page = await browser.NewPageAsync();\n\n await page.ExposeBindingAsync(\"pageUrl\", (source) => source.Page.Url);\n await page.SetContentAsync(\"<script>\\n\" +\n \" async function onClick() {\\n\" +\n \" document.querySelector('div').textContent = await window.pageURL();\\n\" +\n \" }\\n\" +\n \"</script>\\n\" +\n \"<button onclick=\\\"onClick()\\\">Click me</button>\\n\" +\n \"<div></div>\");\n\n await page.ClickAsync(\"button\");\n }\n}\n```\n","async":true,"alias":"exposeBinding","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Name of the function on the window object."}],"required":true,"comment":"Name of the function on the window object.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"callback","type":{"name":"function","expression":"[function]"},"spec":[{"type":"text","text":"Callback function that will be called in the Playwright's context."}],"required":true,"comment":"Callback function that will be called in the Playwright's context.","async":false,"alias":"callback","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","deprecated":"This option will be removed in the future.","name":"handle","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to pass the argument as a handle, instead of passing by value. When passing a handle, only one argument is↵supported. When passing by value, multiple arguments are supported."}],"required":false,"comment":"Whether to pass the argument as a handle, instead of passing by value. When passing a handle, only one argument is\nsupported. When passing by value, multiple arguments are supported.","async":false,"alias":"handle","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"exposeFunction","type":{"name":"void"},"spec":[{"type":"text","text":"The method adds a function called `name` on the `window` object of every frame in the page. When called, the↵function executes `callback` and returns a [Promise] which resolves to the return value of `callback`."},{"type":"text","text":"If the `callback` returns a [Promise], it will be awaited."},{"type":"text","text":"See [`method: BrowserContext.exposeFunction`] for context-wide exposed function."},{"type":"note","noteType":"note","text":"Functions installed via [`method: Page.exposeFunction`] survive navigations."},{"type":"text","text":"**Usage**"},{"type":"text","text":"An example of adding a `sha256` function to the page:"},{"type":"code","lines":["const { webkit } = require('playwright'); // Or 'chromium' or 'firefox'.","const crypto = require('crypto');","","(async () => {"," const browser = await webkit.launch({ headless: false });"," const page = await browser.newPage();"," await page.exposeFunction('sha256', text =>"," crypto.createHash('sha256').update(text).digest('hex'),"," );"," await page.setContent(`"," <script>"," async function onClick() {"," document.querySelector('div').textContent = await window.sha256('PLAYWRIGHT');"," }"," </script>"," <button onclick=\"onClick()\">Click me</button>"," <div></div>"," `);"," await page.click('button');","})();"],"codeLang":"js"},{"type":"code","lines":["import com.microsoft.playwright.*;","","import java.nio.charset.StandardCharsets;","import java.security.MessageDigest;","import java.security.NoSuchAlgorithmException;","import java.util.Base64;","","public class Example {"," public static void main(String[] args) {"," try (Playwright playwright = Playwright.create()) {"," BrowserType webkit = playwright.webkit();"," Browser browser = webkit.launch({ headless: false });"," Page page = browser.newPage();"," page.exposeFunction(\"sha256\", args -> {"," String text = (String) args[0];"," MessageDigest crypto;"," try {"," crypto = MessageDigest.getInstance(\"SHA-256\");"," } catch (NoSuchAlgorithmException e) {"," return null;"," }"," byte[] token = crypto.digest(text.getBytes(StandardCharsets.UTF_8));"," return Base64.getEncoder().encodeToString(token);"," });"," page.setContent(\"<script>\\n\" +"," \" async function onClick() {\\n\" +"," \" document.querySelector('div').textContent = await window.sha256('PLAYWRIGHT');\\n\" +"," \" }\\n\" +"," \"</script>\\n\" +"," \"<button onclick=\\\"onClick()\\\">Click me</button>\\n\" +"," \"<div></div>\\n\");"," page.click(\"button\");"," }"," }","}"],"codeLang":"java"},{"type":"code","lines":["import asyncio","import hashlib","from playwright.async_api import async_playwright, Playwright","","def sha256(text):"," m = hashlib.sha256()"," m.update(bytes(text, \"utf8\"))"," return m.hexdigest()","","","async def run(playwright: Playwright):"," webkit = playwright.webkit"," browser = await webkit.launch(headless=False)"," page = await browser.new_page()"," await page.expose_function(\"sha256\", sha256)"," await page.set_content(\"\"\""," <script>"," async function onClick() {"," document.querySelector('div').textContent = await window.sha256('PLAYWRIGHT');"," }"," </script>"," <button onclick=\"onClick()\">Click me</button>"," <div></div>"," \"\"\")"," await page.click(\"button\")","","async def main():"," async with async_playwright() as playwright:"," await run(playwright)","asyncio.run(main())"],"codeLang":"python async"},{"type":"code","lines":["import hashlib","from playwright.sync_api import sync_playwright, Playwright","","def sha256(text):"," m = hashlib.sha256()"," m.update(bytes(text, \"utf8\"))"," return m.hexdigest()","","","def run(playwright: Playwright):"," webkit = playwright.webkit"," browser = webkit.launch(headless=False)"," page = browser.new_page()"," page.expose_function(\"sha256\", sha256)"," page.set_content(\"\"\""," <script>"," async function onClick() {"," document.querySelector('div').textContent = await window.sha256('PLAYWRIGHT');"," }"," </script>"," <button onclick=\"onClick()\">Click me</button>"," <div></div>"," \"\"\")"," page.click(\"button\")","","with sync_playwright() as playwright:"," run(playwright)"],"codeLang":"python sync"},{"type":"code","lines":["using Microsoft.Playwright;","using System;","using System.Security.Cryptography;","using System.Threading.Tasks;","","class PageExamples","{"," public static async Task Main()"," {"," using var playwright = await Playwright.CreateAsync();"," await using var browser = await playwright.Webkit.LaunchAsync(new()"," {"," Headless = false"," });"," var page = await browser.NewPageAsync();",""," await page.ExposeFunctionAsync(\"sha256\", (string input) =>"," {"," return Convert.ToBase64String("," SHA256.Create().ComputeHash(System.Text.Encoding.UTF8.GetBytes(input)));"," });",""," await page.SetContentAsync(\"<script>\\n\" +"," \" async function onClick() {\\n\" +"," \" document.querySelector('div').textContent = await window.sha256('PLAYWRIGHT');\\n\" +"," \" }\\n\" +"," \"</script>\\n\" +"," \"<button onclick=\\\"onClick()\\\">Click me</button>\\n\" +"," \"<div></div>\");",""," await page.ClickAsync(\"button\");"," Console.WriteLine(await page.TextContentAsync(\"div\"));"," }","}"],"codeLang":"csharp"}],"required":true,"comment":"The method adds a function called `name` on the `window` object of every frame in the page. When called, the\nfunction executes `callback` and returns a [Promise] which resolves to the return value of `callback`.\n\nIf the `callback` returns a [Promise], it will be awaited.\n\nSee [`method: BrowserContext.exposeFunction`] for context-wide exposed function.\n\n**NOTE** Functions installed via [`method: Page.exposeFunction`] survive navigations.\n\n**Usage**\n\nAn example of adding a `sha256` function to the page:\n\n```js\nconst { webkit } = require('playwright'); // Or 'chromium' or 'firefox'.\nconst crypto = require('crypto');\n\n(async () => {\n const browser = await webkit.launch({ headless: false });\n const page = await browser.newPage();\n await page.exposeFunction('sha256', text =>\n crypto.createHash('sha256').update(text).digest('hex'),\n );\n await page.setContent(`\n <script>\n async function onClick() {\n document.querySelector('div').textContent = await window.sha256('PLAYWRIGHT');\n }\n </script>\n <button onclick=\"onClick()\">Click me</button>\n <div></div>\n `);\n await page.click('button');\n})();\n```\n\n```java\nimport com.microsoft.playwright.*;\n\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.util.Base64;\n\npublic class Example {\n public static void main(String[] args) {\n try (Playwright playwright = Playwright.create()) {\n BrowserType webkit = playwright.webkit();\n Browser browser = webkit.launch({ headless: false });\n Page page = browser.newPage();\n page.exposeFunction(\"sha256\", args -> {\n String text = (String) args[0];\n MessageDigest crypto;\n try {\n crypto = MessageDigest.getInstance(\"SHA-256\");\n } catch (NoSuchAlgorithmException e) {\n return null;\n }\n byte[] token = crypto.digest(text.getBytes(StandardCharsets.UTF_8));\n return Base64.getEncoder().encodeToString(token);\n });\n page.setContent(\"<script>\\n\" +\n \" async function onClick() {\\n\" +\n \" document.querySelector('div').textContent = await window.sha256('PLAYWRIGHT');\\n\" +\n \" }\\n\" +\n \"</script>\\n\" +\n \"<button onclick=\\\"onClick()\\\">Click me</button>\\n\" +\n \"<div></div>\\n\");\n page.click(\"button\");\n }\n }\n}\n```\n\n```py\nimport asyncio\nimport hashlib\nfrom playwright.async_api import async_playwright, Playwright\n\ndef sha256(text):\n m = hashlib.sha256()\n m.update(bytes(text, \"utf8\"))\n return m.hexdigest()\n\n\nasync def run(playwright: Playwright):\n webkit = playwright.webkit\n browser = await webkit.launch(headless=False)\n page = await browser.new_page()\n await page.expose_function(\"sha256\", sha256)\n await page.set_content(\"\"\"\n <script>\n async function onClick() {\n document.querySelector('div').textContent = await window.sha256('PLAYWRIGHT');\n }\n </script>\n <button onclick=\"onClick()\">Click me</button>\n <div></div>\n \"\"\")\n await page.click(\"button\")\n\nasync def main():\n async with async_playwright() as playwright:\n await run(playwright)\nasyncio.run(main())\n```\n\n```py\nimport hashlib\nfrom playwright.sync_api import sync_playwright, Playwright\n\ndef sha256(text):\n m = hashlib.sha256()\n m.update(bytes(text, \"utf8\"))\n return m.hexdigest()\n\n\ndef run(playwright: Playwright):\n webkit = playwright.webkit\n browser = webkit.launch(headless=False)\n page = browser.new_page()\n page.expose_function(\"sha256\", sha256)\n page.set_content(\"\"\"\n <script>\n async function onClick() {\n document.querySelector('div').textContent = await window.sha256('PLAYWRIGHT');\n }\n </script>\n <button onclick=\"onClick()\">Click me</button>\n <div></div>\n \"\"\")\n page.click(\"button\")\n\nwith sync_playwright() as playwright:\n run(playwright)\n```\n\n```csharp\nusing Microsoft.Playwright;\nusing System;\nusing System.Security.Cryptography;\nusing System.Threading.Tasks;\n\nclass PageExamples\n{\n public static async Task Main()\n {\n using var playwright = await Playwright.CreateAsync();\n await using var browser = await playwright.Webkit.LaunchAsync(new()\n {\n Headless = false\n });\n var page = await browser.NewPageAsync();\n\n await page.ExposeFunctionAsync(\"sha256\", (string input) =>\n {\n return Convert.ToBase64String(\n SHA256.Create().ComputeHash(System.Text.Encoding.UTF8.GetBytes(input)));\n });\n\n await page.SetContentAsync(\"<script>\\n\" +\n \" async function onClick() {\\n\" +\n \" document.querySelector('div').textContent = await window.sha256('PLAYWRIGHT');\\n\" +\n \" }\\n\" +\n \"</script>\\n\" +\n \"<button onclick=\\\"onClick()\\\">Click me</button>\\n\" +\n \"<div></div>\");\n\n await page.ClickAsync(\"button\");\n Console.WriteLine(await page.TextContentAsync(\"div\"));\n }\n}\n```\n","async":true,"alias":"exposeFunction","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Name of the function on the window object"}],"required":true,"comment":"Name of the function on the window object","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"callback","type":{"name":"function","expression":"[function]"},"spec":[{"type":"text","text":"Callback function which will be called in Playwright's context."}],"required":true,"comment":"Callback function which will be called in Playwright's context.","async":false,"alias":"callback","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.fill`] instead. Read more about [locators](../locators.md).","name":"fill","type":{"name":"void"},"spec":[{"type":"text","text":"This method waits for an element matching `selector`, waits for [actionability](../actionability.md) checks, focuses the element, fills it and triggers an `input` event after filling. Note that you can pass an empty string to clear the input field."},{"type":"text","text":"If the target element is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method throws an error. However, if the element is inside the `<label>` element that has an associated [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be filled instead."},{"type":"text","text":"To send fine-grained keyboard events, use [`method: Locator.pressSequentially`]."}],"required":true,"comment":"This method waits for an element matching `selector`, waits for [actionability](../actionability.md) checks,\nfocuses the element, fills it and triggers an `input` event after filling. Note that you can pass an empty string\nto clear the input field.\n\nIf the target element is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method throws an\nerror. However, if the element is inside the `<label>` element that has an associated\n[control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be filled\ninstead.\n\nTo send fine-grained keyboard events, use [`method: Locator.pressSequentially`].","async":true,"alias":"fill","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Value to fill for the `<input>`, `<textarea>` or `[contenteditable]` element."}],"required":true,"comment":"Value to fill for the `<input>`, `<textarea>` or `[contenteditable]` element.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.13","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.focus`] instead. Read more about [locators](../locators.md).","name":"focus","type":{"name":"void"},"spec":[{"type":"text","text":"This method fetches an element with `selector` and focuses it. If there's no element matching↵`selector`, the method waits until a matching element appears in the DOM."}],"required":true,"comment":"This method fetches an element with `selector` and focuses it. If there's no element matching `selector`, the\nmethod waits until a matching element appears in the DOM.","async":true,"alias":"focus","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"frame","type":{"name":"","union":[{"name":"null"},{"name":"Frame"}],"expression":"[null]|[Frame]"},"spec":[{"type":"text","text":"Returns frame matching the specified criteria. Either `name` or `url` must be specified."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const frame = page.frame('frame-name');"],"codeLang":"js"},{"type":"code","lines":["Frame frame = page.frame(\"frame-name\");"],"codeLang":"java"},{"type":"code","lines":["frame = page.frame(name=\"frame-name\")"],"codeLang":"py"},{"type":"code","lines":["var frame = page.Frame(\"frame-name\");"],"codeLang":"csharp"},{"type":"code","lines":["const frame = page.frame({ url: /.*domain.*/ });"],"codeLang":"js"},{"type":"code","lines":["Frame frame = page.frameByUrl(Pattern.compile(\".*domain.*\");"],"codeLang":"java"},{"type":"code","lines":["frame = page.frame(url=r\".*domain.*\")"],"codeLang":"py"},{"type":"code","lines":["var frame = page.FrameByUrl(\".*domain.*\");"],"codeLang":"csharp"}],"required":true,"comment":"Returns frame matching the specified criteria. Either `name` or `url` must be specified.\n\n**Usage**\n\n```js\nconst frame = page.frame('frame-name');\n```\n\n```java\nFrame frame = page.frame(\"frame-name\");\n```\n\n```py\nframe = page.frame(name=\"frame-name\")\n```\n\n```csharp\nvar frame = page.Frame(\"frame-name\");\n```\n\n```js\nconst frame = page.frame({ url: /.*domain.*/ });\n```\n\n```java\nFrame frame = page.frameByUrl(Pattern.compile(\".*domain.*\");\n```\n\n```py\nframe = page.frame(url=r\".*domain.*\")\n```\n\n```csharp\nvar frame = page.FrameByUrl(\".*domain.*\");\n```\n","async":false,"alias":"frame","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"frameSelector","type":{"name":"","union":[{"name":"string"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Frame name specified in the `iframe`'s `name` attribute. Optional."}],"required":false,"comment":"Frame name specified in the `iframe`'s `name` attribute. Optional.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"url","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"},{"name":"function","args":[{"name":"URL"}],"returnType":{"name":"boolean"}}],"expression":"[string]|[RegExp]|[function]([URL]):[boolean]"},"spec":[{"type":"text","text":"A glob pattern, regex pattern or predicate receiving↵frame's `url` as a [URL] object. Optional."}],"required":false,"comment":"A glob pattern, regex pattern or predicate receiving frame's `url` as a [URL] object. Optional.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null}]}],"expression":"[string]|[Object]"},"spec":[{"type":"text","text":"Frame name or other frame lookup options."}],"required":true,"comment":"Frame name or other frame lookup options.","async":false,"alias":"frameSelector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Frame name specified in the `iframe`'s `name` attribute."}],"required":true,"comment":"Frame name specified in the `iframe`'s `name` attribute.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Frame name specified in the `iframe`'s `name` attribute. Optional."}],"required":false,"comment":"Frame name specified in the `iframe`'s `name` attribute. Optional.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"url","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"},{"name":"function","args":[{"name":"URL"}],"returnType":{"name":"boolean"}}],"expression":"[string]|[RegExp]|[function]([URL]):[boolean]"},"spec":[{"type":"text","text":"A glob pattern, regex pattern or predicate receiving frame's `url` as a [URL] object. Optional."}],"required":false,"comment":"A glob pattern, regex pattern or predicate receiving frame's `url` as a [URL] object. Optional.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"frameByUrl","type":{"name":"","union":[{"name":"null"},{"name":"Frame"}],"expression":"[null]|[Frame]"},"spec":[{"type":"text","text":"Returns frame with matching URL."}],"required":true,"comment":"Returns frame with matching URL.","async":false,"alias":"frameByUrl","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"url","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"},{"name":"function","args":[{"name":"URL"}],"returnType":{"name":"boolean"}}],"expression":"[string]|[RegExp]|[function]([URL]):[boolean]"},"spec":[{"type":"text","text":"A glob pattern, regex pattern or predicate receiving frame's `url` as a [URL] object."}],"required":true,"comment":"A glob pattern, regex pattern or predicate receiving frame's `url` as a [URL] object.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.17","name":"frameLocator","type":{"name":"FrameLocator","expression":"[FrameLocator]"},"spec":[{"type":"text","text":"When working with iframes, you can create a frame locator that will enter the iframe and allow selecting elements↵in that iframe."},{"type":"text","text":"**Usage**"},{"type":"text","text":"Following snippet locates element with text \"Submit\" in the iframe with id `my-frame`,↵like `<iframe id=\"my-frame\">`:"},{"type":"code","lines":["const locator = page.frameLocator('#my-iframe').getByText('Submit');","await locator.click();"],"codeLang":"js"},{"type":"code","lines":["Locator locator = page.frameLocator(\"#my-iframe\").getByText(\"Submit\");","locator.click();"],"codeLang":"java"},{"type":"code","lines":["locator = page.frame_locator(\"#my-iframe\").get_by_text(\"Submit\")","await locator.click()"],"codeLang":"python async"},{"type":"code","lines":["locator = page.frame_locator(\"#my-iframe\").get_by_text(\"Submit\")","locator.click()"],"codeLang":"python sync"},{"type":"code","lines":["var locator = page.FrameLocator(\"#my-iframe\").GetByText(\"Submit\");","await locator.ClickAsync();"],"codeLang":"csharp"}],"required":true,"comment":"When working with iframes, you can create a frame locator that will enter the iframe and allow selecting elements\nin that iframe.\n\n**Usage**\n\nFollowing snippet locates element with text \"Submit\" in the iframe with id `my-frame`, like `<iframe\nid=\"my-frame\">`:\n\n```js\nconst locator = page.frameLocator('#my-iframe').getByText('Submit');\nawait locator.click();\n```\n\n```java\nLocator locator = page.frameLocator(\"#my-iframe\").getByText(\"Submit\");\nlocator.click();\n```\n\n```py\nlocator = page.frame_locator(\"#my-iframe\").get_by_text(\"Submit\")\nawait locator.click()\n```\n\n```py\nlocator = page.frame_locator(\"#my-iframe\").get_by_text(\"Submit\")\nlocator.click()\n```\n\n```csharp\nvar locator = page.FrameLocator(\"#my-iframe\").GetByText(\"Submit\");\nawait locator.ClickAsync();\n```\n","async":false,"alias":"frameLocator","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.17","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to use when resolving DOM element."}],"required":true,"comment":"A selector to use when resolving DOM element.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"frames","type":{"name":"Array","templates":[{"name":"Frame"}],"expression":"[Array]<[Frame]>"},"spec":[{"type":"text","text":"An array of all frames attached to the page."}],"required":true,"comment":"An array of all frames attached to the page.","async":false,"alias":"frames","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.getAttribute`] instead. Read more about [locators](../locators.md).","name":"getAttribute","type":{"name":"","union":[{"name":"null"},{"name":"string"}],"expression":"[null]|[string]"},"spec":[{"type":"text","text":"Returns element attribute value."}],"required":true,"comment":"Returns element attribute value.","async":true,"alias":"getAttribute","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Attribute name to get the value for."}],"required":true,"comment":"Attribute name to get the value for.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByAltText","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Allows locating elements by their alt text."},{"type":"text","text":"**Usage**"},{"type":"text","text":"For example, this method will find the image by alt text \"Playwright logo\":"},{"type":"code","lines":["<img alt='Playwright logo'>"],"codeLang":"html"},{"type":"code","lines":["await page.getByAltText('Playwright logo').click();"],"codeLang":"js"},{"type":"code","lines":["page.getByAltText(\"Playwright logo\").click();"],"codeLang":"java"},{"type":"code","lines":["await page.get_by_alt_text(\"Playwright logo\").click()"],"codeLang":"python async"},{"type":"code","lines":["page.get_by_alt_text(\"Playwright logo\").click()"],"codeLang":"python sync"},{"type":"code","lines":["await page.GetByAltText(\"Playwright logo\").ClickAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Allows locating elements by their alt text.\n\n**Usage**\n\nFor example, this method will find the image by alt text \"Playwright logo\":\n\n```html\n<img alt='Playwright logo'>\n```\n\n```js\nawait page.getByAltText('Playwright logo').click();\n```\n\n```java\npage.getByAltText(\"Playwright logo\").click();\n```\n\n```py\nawait page.get_by_alt_text(\"Playwright logo\").click()\n```\n\n```py\npage.get_by_alt_text(\"Playwright logo\").click()\n```\n\n```csharp\nawait page.GetByAltText(\"Playwright logo\").ClickAsync();\n```\n","async":false,"alias":"getByAltText","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"text","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Text to locate the element for."}],"required":true,"comment":"Text to locate the element for.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.27","name":"exact","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a\nregular expression. Note that exact match still trims whitespace.","async":false,"alias":"exact","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByLabel","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Allows locating input elements by the text of the associated `<label>` or `aria-labelledby` element, or by the `aria-label` attribute."},{"type":"text","text":"**Usage**"},{"type":"text","text":"For example, this method will find inputs by label \"Username\" and \"Password\" in the following DOM:"},{"type":"code","lines":["<input aria-label=\"Username\">","<label for=\"password-input\">Password:</label>","<input id=\"password-input\">"],"codeLang":"html"},{"type":"code","lines":["await page.getByLabel('Username').fill('john');","await page.getByLabel('Password').fill('secret');"],"codeLang":"js"},{"type":"code","lines":["page.getByLabel(\"Username\").fill(\"john\");","page.getByLabel(\"Password\").fill(\"secret\");"],"codeLang":"java"},{"type":"code","lines":["await page.get_by_label(\"Username\").fill(\"john\")","await page.get_by_label(\"Password\").fill(\"secret\")"],"codeLang":"python async"},{"type":"code","lines":["page.get_by_label(\"Username\").fill(\"john\")","page.get_by_label(\"Password\").fill(\"secret\")"],"codeLang":"python sync"},{"type":"code","lines":["await page.GetByLabel(\"Username\").FillAsync(\"john\");","await page.GetByLabel(\"Password\").FillAsync(\"secret\");"],"codeLang":"csharp"}],"required":true,"comment":"Allows locating input elements by the text of the associated `<label>` or `aria-labelledby` element, or by the\n`aria-label` attribute.\n\n**Usage**\n\nFor example, this method will find inputs by label \"Username\" and \"Password\" in the following DOM:\n\n```html\n<input aria-label=\"Username\">\n<label for=\"password-input\">Password:</label>\n<input id=\"password-input\">\n```\n\n```js\nawait page.getByLabel('Username').fill('john');\nawait page.getByLabel('Password').fill('secret');\n```\n\n```java\npage.getByLabel(\"Username\").fill(\"john\");\npage.getByLabel(\"Password\").fill(\"secret\");\n```\n\n```py\nawait page.get_by_label(\"Username\").fill(\"john\")\nawait page.get_by_label(\"Password\").fill(\"secret\")\n```\n\n```py\npage.get_by_label(\"Username\").fill(\"john\")\npage.get_by_label(\"Password\").fill(\"secret\")\n```\n\n```csharp\nawait page.GetByLabel(\"Username\").FillAsync(\"john\");\nawait page.GetByLabel(\"Password\").FillAsync(\"secret\");\n```\n","async":false,"alias":"getByLabel","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"text","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Text to locate the element for."}],"required":true,"comment":"Text to locate the element for.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.27","name":"exact","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a\nregular expression. Note that exact match still trims whitespace.","async":false,"alias":"exact","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByPlaceholder","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Allows locating input elements by the placeholder text."},{"type":"text","text":"**Usage**"},{"type":"text","text":"For example, consider the following DOM structure."},{"type":"code","lines":["<input type=\"email\" placeholder=\"name@example.com\" />"],"codeLang":"html"},{"type":"text","text":"You can fill the input after locating it by the placeholder text:"},{"type":"code","lines":["await page"," .getByPlaceholder('name@example.com')"," .fill('playwright@microsoft.com');"],"codeLang":"js"},{"type":"code","lines":["page.getByPlaceholder(\"name@example.com\").fill(\"playwright@microsoft.com\");"],"codeLang":"java"},{"type":"code","lines":["await page.get_by_placeholder(\"name@example.com\").fill(\"playwright@microsoft.com\")"],"codeLang":"python async"},{"type":"code","lines":["page.get_by_placeholder(\"name@example.com\").fill(\"playwright@microsoft.com\")"],"codeLang":"python sync"},{"type":"code","lines":["await page"," .GetByPlaceholder(\"name@example.com\")"," .FillAsync(\"playwright@microsoft.com\");"],"codeLang":"csharp"}],"required":true,"comment":"Allows locating input elements by the placeholder text.\n\n**Usage**\n\nFor example, consider the following DOM structure.\n\n```html\n<input type=\"email\" placeholder=\"name@example.com\" />\n```\n\nYou can fill the input after locating it by the placeholder text:\n\n```js\nawait page\n .getByPlaceholder('name@example.com')\n .fill('playwright@microsoft.com');\n```\n\n```java\npage.getByPlaceholder(\"name@example.com\").fill(\"playwright@microsoft.com\");\n```\n\n```py\nawait page.get_by_placeholder(\"name@example.com\").fill(\"playwright@microsoft.com\")\n```\n\n```py\npage.get_by_placeholder(\"name@example.com\").fill(\"playwright@microsoft.com\")\n```\n\n```csharp\nawait page\n .GetByPlaceholder(\"name@example.com\")\n .FillAsync(\"playwright@microsoft.com\");\n```\n","async":false,"alias":"getByPlaceholder","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"text","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Text to locate the element for."}],"required":true,"comment":"Text to locate the element for.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.27","name":"exact","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a\nregular expression. Note that exact match still trims whitespace.","async":false,"alias":"exact","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByRole","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"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)."},{"type":"text","text":"**Usage**"},{"type":"text","text":"Consider the following DOM structure."},{"type":"code","lines":["<h3>Sign up</h3>","<label>"," <input type=\"checkbox\" /> Subscribe","</label>","<br/>","<button>Submit</button>"],"codeLang":"html"},{"type":"text","text":"You can locate each element by it's implicit role:"},{"type":"code","lines":["await expect(page.getByRole('heading', { name: 'Sign up' })).toBeVisible();","","await page.getByRole('checkbox', { name: 'Subscribe' }).check();","","await page.getByRole('button', { name: /submit/i }).click();"],"codeLang":"js"},{"type":"code","lines":["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()"],"codeLang":"python async"},{"type":"code","lines":["expect(page.get_by_role(\"heading\", name=\"Sign up\")).to_be_visible()","","page.get_by_role(\"checkbox\", name=\"Subscribe\").check()","","page.get_by_role(\"button\", name=re.compile(\"submit\", re.IGNORECASE)).click()"],"codeLang":"python sync"},{"type":"code","lines":["assertThat(page"," .getByRole(AriaRole.HEADING,"," new Page.GetByRoleOptions().setName(\"Sign up\")))"," .isVisible();","","page.getByRole(AriaRole.CHECKBOX,"," new Page.GetByRoleOptions().setName(\"Subscribe\"))"," .check();","","page.getByRole(AriaRole.BUTTON,"," new Page.GetByRoleOptions().setName("," Pattern.compile(\"submit\", Pattern.CASE_INSENSITIVE)))"," .click();"],"codeLang":"java"},{"type":"code","lines":["await Expect(Page"," .GetByRole(AriaRole.Heading, new() { Name = \"Sign up\" }))"," .ToBeVisibleAsync();","","await page"," .GetByRole(AriaRole.Checkbox, new() { Name = \"Subscribe\" })"," .CheckAsync();","","await page"," .GetByRole(AriaRole.Button, new() {"," NameRegex = new Regex(\"submit\", RegexOptions.IgnoreCase)"," })"," .ClickAsync();"],"codeLang":"csharp"},{"type":"text","text":"**Details**"},{"type":"text","text":"Role selector **does not replace** accessibility audits and conformance tests, but rather gives early feedback about the ARIA guidelines."},{"type":"text","text":"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."}],"required":true,"comment":"Allows locating elements by their [ARIA role](https://www.w3.org/TR/wai-aria-1.2/#roles),\n[ARIA attributes](https://www.w3.org/TR/wai-aria-1.2/#aria-attributes) and\n[accessible name](https://w3c.github.io/accname/#dfn-accessible-name).\n\n**Usage**\n\nConsider the following DOM structure.\n\n```html\n<h3>Sign up</h3>\n<label>\n <input type=\"checkbox\" /> Subscribe\n</label>\n<br/>\n<button>Submit</button>\n```\n\nYou can locate each element by it's implicit role:\n\n```js\nawait expect(page.getByRole('heading', { name: 'Sign up' })).toBeVisible();\n\nawait page.getByRole('checkbox', { name: 'Subscribe' }).check();\n\nawait page.getByRole('button', { name: /submit/i }).click();\n```\n\n```py\nawait expect(page.get_by_role(\"heading\", name=\"Sign up\")).to_be_visible()\n\nawait page.get_by_role(\"checkbox\", name=\"Subscribe\").check()\n\nawait page.get_by_role(\"button\", name=re.compile(\"submit\", re.IGNORECASE)).click()\n```\n\n```py\nexpect(page.get_by_role(\"heading\", name=\"Sign up\")).to_be_visible()\n\npage.get_by_role(\"checkbox\", name=\"Subscribe\").check()\n\npage.get_by_role(\"button\", name=re.compile(\"submit\", re.IGNORECASE)).click()\n```\n\n```java\nassertThat(page\n .getByRole(AriaRole.HEADING,\n new Page.GetByRoleOptions().setName(\"Sign up\")))\n .isVisible();\n\npage.getByRole(AriaRole.CHECKBOX,\n new Page.GetByRoleOptions().setName(\"Subscribe\"))\n .check();\n\npage.getByRole(AriaRole.BUTTON,\n new Page.GetByRoleOptions().setName(\n Pattern.compile(\"submit\", Pattern.CASE_INSENSITIVE)))\n .click();\n```\n\n```csharp\nawait Expect(Page\n .GetByRole(AriaRole.Heading, new() { Name = \"Sign up\" }))\n .ToBeVisibleAsync();\n\nawait page\n .GetByRole(AriaRole.Checkbox, new() { Name = \"Subscribe\" })\n .CheckAsync();\n\nawait page\n .GetByRole(AriaRole.Button, new() {\n NameRegex = new Regex(\"submit\", RegexOptions.IgnoreCase)\n })\n .ClickAsync();\n```\n\n**Details**\n\nRole selector **does not replace** accessibility audits and conformance tests, but rather gives early feedback\nabout the ARIA guidelines.\n\nMany html elements have an implicitly [defined role](https://w3c.github.io/html-aam/#html-element-role-mappings)\nthat is recognized by the role selector. You can find all the\n[supported roles here](https://www.w3.org/TR/wai-aria-1.2/#role_definitions). ARIA guidelines **do not recommend**\nduplicating implicit roles and attributes by setting `role` and/or `aria-*` attributes to default values.","async":false,"alias":"getByRole","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"role","type":{"name":"AriaRole","union":[{"name":"\"alert\""},{"name":"\"alertdialog\""},{"name":"\"application\""},{"name":"\"article\""},{"name":"\"banner\""},{"name":"\"blockquote\""},{"name":"\"button\""},{"name":"\"caption\""},{"name":"\"cell\""},{"name":"\"checkbox\""},{"name":"\"code\""},{"name":"\"columnheader\""},{"name":"\"combobox\""},{"name":"\"complementary\""},{"name":"\"contentinfo\""},{"name":"\"definition\""},{"name":"\"deletion\""},{"name":"\"dialog\""},{"name":"\"directory\""},{"name":"\"document\""},{"name":"\"emphasis\""},{"name":"\"feed\""},{"name":"\"figure\""},{"name":"\"form\""},{"name":"\"generic\""},{"name":"\"grid\""},{"name":"\"gridcell\""},{"name":"\"group\""},{"name":"\"heading\""},{"name":"\"img\""},{"name":"\"insertion\""},{"name":"\"link\""},{"name":"\"list\""},{"name":"\"listbox\""},{"name":"\"listitem\""},{"name":"\"log\""},{"name":"\"main\""},{"name":"\"marquee\""},{"name":"\"math\""},{"name":"\"meter\""},{"name":"\"menu\""},{"name":"\"menubar\""},{"name":"\"menuitem\""},{"name":"\"menuitemcheckbox\""},{"name":"\"menuitemradio\""},{"name":"\"navigation\""},{"name":"\"none\""},{"name":"\"note\""},{"name":"\"option\""},{"name":"\"paragraph\""},{"name":"\"presentation\""},{"name":"\"progressbar\""},{"name":"\"radio\""},{"name":"\"radiogroup\""},{"name":"\"region\""},{"name":"\"row\""},{"name":"\"rowgroup\""},{"name":"\"rowheader\""},{"name":"\"scrollbar\""},{"name":"\"search\""},{"name":"\"searchbox\""},{"name":"\"separator\""},{"name":"\"slider\""},{"name":"\"spinbutton\""},{"name":"\"status\""},{"name":"\"strong\""},{"name":"\"subscript\""},{"name":"\"superscript\""},{"name":"\"switch\""},{"name":"\"tab\""},{"name":"\"table\""},{"name":"\"tablist\""},{"name":"\"tabpanel\""},{"name":"\"term\""},{"name":"\"textbox\""},{"name":"\"time\""},{"name":"\"timer\""},{"name":"\"toolbar\""},{"name":"\"tooltip\""},{"name":"\"tree\""},{"name":"\"treegrid\""},{"name":"\"treeitem\""}],"expression":"[AriaRole]<\"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\"|\"meter\"|\"menu\"|\"menubar\"|\"menuitem\"|\"menuitemcheckbox\"|\"menuitemradio\"|\"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\">"},"spec":[{"type":"text","text":"Required aria role."}],"required":true,"comment":"Required aria role.","async":false,"alias":"role","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.27","name":"checked","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"An attribute that is usually set by `aria-checked` or native `<input type=checkbox>` controls."},{"type":"text","text":"Learn more about [`aria-checked`](https://www.w3.org/TR/wai-aria-1.2/#aria-checked)."}],"required":false,"comment":"An attribute that is usually set by `aria-checked` or native `<input type=checkbox>` controls.\n\nLearn more about [`aria-checked`](https://www.w3.org/TR/wai-aria-1.2/#aria-checked).","async":false,"alias":"checked","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"disabled","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"An attribute that is usually set by `aria-disabled` or `disabled`."},{"type":"note","noteType":"note","text":"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)."}],"required":false,"comment":"An attribute that is usually set by `aria-disabled` or `disabled`.\n\n**NOTE** Unlike most other attributes, `disabled` is inherited through the DOM hierarchy. Learn more about\n[`aria-disabled`](https://www.w3.org/TR/wai-aria-1.2/#aria-disabled).","async":false,"alias":"disabled","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.28","name":"exact","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Whether `name` is matched exactly: case-sensitive and whole-string. Defaults to false. Ignored when `name` is a\nregular expression. Note that exact match still trims whitespace.","async":false,"alias":"exact","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"expanded","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"An attribute that is usually set by `aria-expanded`."},{"type":"text","text":"Learn more about [`aria-expanded`](https://www.w3.org/TR/wai-aria-1.2/#aria-expanded)."}],"required":false,"comment":"An attribute that is usually set by `aria-expanded`.\n\nLearn more about [`aria-expanded`](https://www.w3.org/TR/wai-aria-1.2/#aria-expanded).","async":false,"alias":"expanded","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"includeHidden","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."},{"type":"text","text":"Learn more about [`aria-hidden`](https://www.w3.org/TR/wai-aria-1.2/#aria-hidden)."}],"required":false,"comment":"Option that controls whether hidden elements are matched. By default, only non-hidden elements, as\n[defined by ARIA](https://www.w3.org/TR/wai-aria-1.2/#tree_exclusion), are matched by role selector.\n\nLearn more about [`aria-hidden`](https://www.w3.org/TR/wai-aria-1.2/#aria-hidden).","async":false,"alias":"includeHidden","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"level","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"A number attribute that is usually present for roles `heading`, `listitem`, `row`, `treeitem`, with default values for `<h1>-<h6>` elements."},{"type":"text","text":"Learn more about [`aria-level`](https://www.w3.org/TR/wai-aria-1.2/#aria-level)."}],"required":false,"comment":"A number attribute that is usually present for roles `heading`, `listitem`, `row`, `treeitem`, with default values\nfor `<h1>-<h6>` elements.\n\nLearn more about [`aria-level`](https://www.w3.org/TR/wai-aria-1.2/#aria-level).","async":false,"alias":"level","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"name","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"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."},{"type":"text","text":"Learn more about [accessible name](https://w3c.github.io/accname/#dfn-accessible-name)."}],"required":false,"comment":"Option to match the [accessible name](https://w3c.github.io/accname/#dfn-accessible-name). By default, matching is\ncase-insensitive and searches for a substring, use `exact` to control this behavior.\n\nLearn more about [accessible name](https://w3c.github.io/accname/#dfn-accessible-name).","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"pressed","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"An attribute that is usually set by `aria-pressed`."},{"type":"text","text":"Learn more about [`aria-pressed`](https://www.w3.org/TR/wai-aria-1.2/#aria-pressed)."}],"required":false,"comment":"An attribute that is usually set by `aria-pressed`.\n\nLearn more about [`aria-pressed`](https://www.w3.org/TR/wai-aria-1.2/#aria-pressed).","async":false,"alias":"pressed","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.27","name":"selected","type":{"name":"boolean","expression":"boolean"},"spec":[{"type":"text","text":"An attribute that is usually set by `aria-selected`."},{"type":"text","text":"Learn more about [`aria-selected`](https://www.w3.org/TR/wai-aria-1.2/#aria-selected)."}],"required":false,"comment":"An attribute that is usually set by `aria-selected`.\n\nLearn more about [`aria-selected`](https://www.w3.org/TR/wai-aria-1.2/#aria-selected).","async":false,"alias":"selected","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByTestId","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Locate element by the test id."},{"type":"text","text":"**Usage**"},{"type":"text","text":"Consider the following DOM structure."},{"type":"code","lines":["<button data-testid=\"directions\">Itinéraire</button>"],"codeLang":"html"},{"type":"text","text":"You can locate the element by it's test id:"},{"type":"code","lines":["await page.getByTestId('directions').click();"],"codeLang":"js"},{"type":"code","lines":["page.getByTestId(\"directions\").click();"],"codeLang":"java"},{"type":"code","lines":["await page.get_by_test_id(\"directions\").click()"],"codeLang":"python async"},{"type":"code","lines":["page.get_by_test_id(\"directions\").click()"],"codeLang":"python sync"},{"type":"code","lines":["await page.GetByTestId(\"directions\").ClickAsync();"],"codeLang":"csharp"},{"type":"text","text":"**Details**"},{"type":"text","text":"By default, the `data-testid` attribute is used as a test id. Use [`method: Selectors.setTestIdAttribute`] to configure a different test id attribute if necessary."},{"type":"code","lines":["// Set custom test id attribute from @playwright/test config:","import { defineConfig } from '@playwright/test';","","export default defineConfig({"," use: {"," testIdAttribute: 'data-pw'"," },","});"],"codeLang":"js"}],"required":true,"comment":"Locate element by the test id.\n\n**Usage**\n\nConsider the following DOM structure.\n\n```html\n<button data-testid=\"directions\">Itinéraire</button>\n```\n\nYou can locate the element by it's test id:\n\n```js\nawait page.getByTestId('directions').click();\n```\n\n```java\npage.getByTestId(\"directions\").click();\n```\n\n```py\nawait page.get_by_test_id(\"directions\").click()\n```\n\n```py\npage.get_by_test_id(\"directions\").click()\n```\n\n```csharp\nawait page.GetByTestId(\"directions\").ClickAsync();\n```\n\n**Details**\n\nBy default, the `data-testid` attribute is used as a test id. Use [`method: Selectors.setTestIdAttribute`] to\nconfigure a different test id attribute if necessary.\n\n```js\n// Set custom test id attribute from @playwright/test config:\nimport { defineConfig } from '@playwright/test';\n\nexport default defineConfig({\n use: {\n testIdAttribute: 'data-pw'\n },\n});\n```\n","async":false,"alias":"getByTestId","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"testId","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Id to locate the element by."}],"required":true,"comment":"Id to locate the element by.","async":false,"alias":"testId","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByText","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Allows locating elements that contain given text."},{"type":"text","text":"See also [`method: Locator.filter`] that allows to match by another criteria, like an accessible role, and then filter by the text content."},{"type":"text","text":"**Usage**"},{"type":"text","text":"Consider the following DOM structure:"},{"type":"code","lines":["<div>Hello <span>world</span></div>","<div>Hello</div>"],"codeLang":"html"},{"type":"text","text":"You can locate by text substring, exact string, or a regular expression:"},{"type":"code","lines":["// Matches <span>","page.getByText('world');","","// Matches first <div>","page.getByText('Hello world');","","// Matches second <div>","page.getByText('Hello', { exact: true });","","// Matches both <div>s","page.getByText(/Hello/);","","// Matches second <div>","page.getByText(/^hello$/i);"],"codeLang":"js"},{"type":"code","lines":["# 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))"],"codeLang":"python async"},{"type":"code","lines":["# 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))"],"codeLang":"python sync"},{"type":"code","lines":["// Matches <span>","page.getByText(\"world\")","","// Matches first <div>","page.getByText(\"Hello world\")","","// Matches second <div>","page.getByText(\"Hello\", new Page.GetByTextOptions().setExact(true))","","// Matches both <div>s","page.getByText(Pattern.compile(\"Hello\"))","","// Matches second <div>","page.getByText(Pattern.compile(\"^hello$\", Pattern.CASE_INSENSITIVE))"],"codeLang":"java"},{"type":"code","lines":["// Matches <span>","page.GetByText(\"world\");","","// Matches first <div>","page.GetByText(\"Hello world\");","","// Matches second <div>","page.GetByText(\"Hello\", new() { Exact = true });","","// Matches both <div>s","page.GetByText(new Regex(\"Hello\"));","","// Matches second <div>","page.GetByText(new Regex(\"^hello$\", RegexOptions.IgnoreCase));"],"codeLang":"csharp"},{"type":"text","text":"**Details**"},{"type":"text","text":"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."},{"type":"text","text":"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\">`."}],"required":true,"comment":"Allows locating elements that contain given text.\n\nSee also [`method: Locator.filter`] that allows to match by another criteria, like an accessible role, and then\nfilter by the text content.\n\n**Usage**\n\nConsider the following DOM structure:\n\n```html\n<div>Hello <span>world</span></div>\n<div>Hello</div>\n```\n\nYou can locate by text substring, exact string, or a regular expression:\n\n```js\n// Matches <span>\npage.getByText('world');\n\n// Matches first <div>\npage.getByText('Hello world');\n\n// Matches second <div>\npage.getByText('Hello', { exact: true });\n\n// Matches both <div>s\npage.getByText(/Hello/);\n\n// Matches second <div>\npage.getByText(/^hello$/i);\n```\n\n```py\n# Matches <span>\npage.get_by_text(\"world\")\n\n# Matches first <div>\npage.get_by_text(\"Hello world\")\n\n# Matches second <div>\npage.get_by_text(\"Hello\", exact=True)\n\n# Matches both <div>s\npage.get_by_text(re.compile(\"Hello\"))\n\n# Matches second <div>\npage.get_by_text(re.compile(\"^hello$\", re.IGNORECASE))\n```\n\n```py\n# Matches <span>\npage.get_by_text(\"world\")\n\n# Matches first <div>\npage.get_by_text(\"Hello world\")\n\n# Matches second <div>\npage.get_by_text(\"Hello\", exact=True)\n\n# Matches both <div>s\npage.get_by_text(re.compile(\"Hello\"))\n\n# Matches second <div>\npage.get_by_text(re.compile(\"^hello$\", re.IGNORECASE))\n```\n\n```java\n// Matches <span>\npage.getByText(\"world\")\n\n// Matches first <div>\npage.getByText(\"Hello world\")\n\n// Matches second <div>\npage.getByText(\"Hello\", new Page.GetByTextOptions().setExact(true))\n\n// Matches both <div>s\npage.getByText(Pattern.compile(\"Hello\"))\n\n// Matches second <div>\npage.getByText(Pattern.compile(\"^hello$\", Pattern.CASE_INSENSITIVE))\n```\n\n```csharp\n// Matches <span>\npage.GetByText(\"world\");\n\n// Matches first <div>\npage.GetByText(\"Hello world\");\n\n// Matches second <div>\npage.GetByText(\"Hello\", new() { Exact = true });\n\n// Matches both <div>s\npage.GetByText(new Regex(\"Hello\"));\n\n// Matches second <div>\npage.GetByText(new Regex(\"^hello$\", RegexOptions.IgnoreCase));\n```\n\n**Details**\n\nMatching by text always normalizes whitespace, even with exact match. For example, it turns multiple spaces into\none, turns line breaks into spaces and ignores leading and trailing whitespace.\n\nInput elements of the type `button` and `submit` are matched by their `value` instead of the text content. For\nexample, locating by text `\"Log in\"` matches `<input type=button value=\"Log in\">`.","async":false,"alias":"getByText","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"text","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Text to locate the element for."}],"required":true,"comment":"Text to locate the element for.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.27","name":"exact","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a\nregular expression. Note that exact match still trims whitespace.","async":false,"alias":"exact","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"getByTitle","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Allows locating elements by their title attribute."},{"type":"text","text":"**Usage**"},{"type":"text","text":"Consider the following DOM structure."},{"type":"code","lines":["<span title='Issues count'>25 issues</span>"],"codeLang":"html"},{"type":"text","text":"You can check the issues count after locating it by the title text:"},{"type":"code","lines":["await expect(page.getByTitle('Issues count')).toHaveText('25 issues');"],"codeLang":"js"},{"type":"code","lines":["assertThat(page.getByTitle(\"Issues count\")).hasText(\"25 issues\");"],"codeLang":"java"},{"type":"code","lines":["await expect(page.get_by_title(\"Issues count\")).to_have_text(\"25 issues\")"],"codeLang":"python async"},{"type":"code","lines":["expect(page.get_by_title(\"Issues count\")).to_have_text(\"25 issues\")"],"codeLang":"python sync"},{"type":"code","lines":["await Expect(Page.GetByTitle(\"Issues count\")).toHaveText(\"25 issues\");"],"codeLang":"csharp"}],"required":true,"comment":"Allows locating elements by their title attribute.\n\n**Usage**\n\nConsider the following DOM structure.\n\n```html\n<span title='Issues count'>25 issues</span>\n```\n\nYou can check the issues count after locating it by the title text:\n\n```js\nawait expect(page.getByTitle('Issues count')).toHaveText('25 issues');\n```\n\n```java\nassertThat(page.getByTitle(\"Issues count\")).hasText(\"25 issues\");\n```\n\n```py\nawait expect(page.get_by_title(\"Issues count\")).to_have_text(\"25 issues\")\n```\n\n```py\nexpect(page.get_by_title(\"Issues count\")).to_have_text(\"25 issues\")\n```\n\n```csharp\nawait Expect(Page.GetByTitle(\"Issues count\")).toHaveText(\"25 issues\");\n```\n","async":false,"alias":"getByTitle","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"text","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Text to locate the element for."}],"required":true,"comment":"Text to locate the element for.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.27","name":"exact","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a\nregular expression. Note that exact match still trims whitespace.","async":false,"alias":"exact","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"goBack","type":{"name":"","union":[{"name":"null"},{"name":"Response"}],"expression":"[null]|[Response]"},"spec":[{"type":"text","text":"Returns the main resource response. In case of multiple redirects, the navigation will resolve with the response of the↵last redirect. If can not go back, returns `null`."},{"type":"text","text":"Navigate to the previous page in history."}],"required":true,"comment":"Returns the main resource response. In case of multiple redirects, the navigation will resolve with the response of\nthe last redirect. If can not go back, returns `null`.\n\nNavigate to the previous page in history.","async":true,"alias":"goBack","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.↵The default value can be changed by using the↵[`method: BrowserContext.setDefaultNavigationTimeout`],↵[`method: BrowserContext.setDefaultTimeout`],↵[`method: Page.setDefaultNavigationTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `navigationTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultNavigationTimeout`],↵[`method: BrowserContext.setDefaultTimeout`],↵[`method: Page.setDefaultNavigationTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via\n`navigationTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"waitUntil","type":{"name":"WaitUntilState","union":[{"name":"\"load\""},{"name":"\"domcontentloaded\""},{"name":"\"networkidle\""},{"name":"\"commit\""}],"expression":"[WaitUntilState]<\"load\"|\"domcontentloaded\"|\"networkidle\"|\"commit\">"},"spec":[{"type":"text","text":"When to consider operation succeeded, defaults to `load`. Events can be either:"},{"type":"li","text":"`'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.","liType":"bullet"},{"type":"li","text":"`'load'` - consider operation to be finished when the `load` event is fired.","liType":"bullet"},{"type":"li","text":"`'networkidle'` - **DISCOURAGED** consider operation to be finished when there are no network connections for at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.","liType":"bullet"},{"type":"li","text":"`'commit'` - consider operation to be finished when network response is received and the document started loading.","liType":"bullet"}],"required":false,"comment":"When to consider operation succeeded, defaults to `load`. Events can be either:\n- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.\n- `'load'` - consider operation to be finished when the `load` event is fired.\n- `'networkidle'` - **DISCOURAGED** consider operation to be finished when there are no network connections for\n at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.\n- `'commit'` - consider operation to be finished when network response is received and the document started\n loading.","async":false,"alias":"waitUntil","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"goForward","type":{"name":"","union":[{"name":"null"},{"name":"Response"}],"expression":"[null]|[Response]"},"spec":[{"type":"text","text":"Returns the main resource response. In case of multiple redirects, the navigation will resolve with the response of the↵last redirect. If can not go forward, returns `null`."},{"type":"text","text":"Navigate to the next page in history."}],"required":true,"comment":"Returns the main resource response. In case of multiple redirects, the navigation will resolve with the response of\nthe last redirect. If can not go forward, returns `null`.\n\nNavigate to the next page in history.","async":true,"alias":"goForward","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.↵The default value can be changed by using the↵[`method: BrowserContext.setDefaultNavigationTimeout`],↵[`method: BrowserContext.setDefaultTimeout`],↵[`method: Page.setDefaultNavigationTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `navigationTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultNavigationTimeout`],↵[`method: BrowserContext.setDefaultTimeout`],↵[`method: Page.setDefaultNavigationTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via\n`navigationTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"waitUntil","type":{"name":"WaitUntilState","union":[{"name":"\"load\""},{"name":"\"domcontentloaded\""},{"name":"\"networkidle\""},{"name":"\"commit\""}],"expression":"[WaitUntilState]<\"load\"|\"domcontentloaded\"|\"networkidle\"|\"commit\">"},"spec":[{"type":"text","text":"When to consider operation succeeded, defaults to `load`. Events can be either:"},{"type":"li","text":"`'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.","liType":"bullet"},{"type":"li","text":"`'load'` - consider operation to be finished when the `load` event is fired.","liType":"bullet"},{"type":"li","text":"`'networkidle'` - **DISCOURAGED** consider operation to be finished when there are no network connections for at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.","liType":"bullet"},{"type":"li","text":"`'commit'` - consider operation to be finished when network response is received and the document started loading.","liType":"bullet"}],"required":false,"comment":"When to consider operation succeeded, defaults to `load`. Events can be either:\n- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.\n- `'load'` - consider operation to be finished when the `load` event is fired.\n- `'networkidle'` - **DISCOURAGED** consider operation to be finished when there are no network connections for\n at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.\n- `'commit'` - consider operation to be finished when network response is received and the document started\n loading.","async":false,"alias":"waitUntil","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"navigate"},"types":{},"overrides":{}},"since":"v1.8","name":"goto","type":{"name":"","union":[{"name":"null"},{"name":"Response"}],"expression":"[null]|[Response]"},"spec":[{"type":"text","text":"Returns the main resource response. In case of multiple redirects, the navigation will resolve with the first↵non-redirect response."},{"type":"text","text":"The method will throw an error if:"},{"type":"li","text":"there's an SSL error (e.g. in case of self-signed certificates).","liType":"bullet"},{"type":"li","text":"target URL is invalid.","liType":"bullet"},{"type":"li","text":"the `timeout` is exceeded during navigation.","liType":"bullet"},{"type":"li","text":"the remote server does not respond or is unreachable.","liType":"bullet"},{"type":"li","text":"the main resource failed to load.","liType":"bullet"},{"type":"text","text":"The method will not throw an error when any valid HTTP status code is returned by the remote server, including 404 \"Not↵Found\" and 500 \"Internal Server Error\". The status code for such responses can be retrieved by calling↵[`method: Response.status`]."},{"type":"note","noteType":"note","text":"The method either throws an error or returns a main resource response. The only exceptions are navigation to↵`about:blank` or navigation to the same URL with a different hash, which would succeed and return `null`."},{"type":"note","noteType":"note","text":"Headless mode doesn't support navigation to a PDF document. See the↵[upstream issue](https://bugs.chromium.org/p/chromium/issues/detail?id=761295)."}],"required":true,"comment":"Returns the main resource response. In case of multiple redirects, the navigation will resolve with the first\nnon-redirect response.\n\nThe method will throw an error if:\n- there's an SSL error (e.g. in case of self-signed certificates).\n- target URL is invalid.\n- the `timeout` is exceeded during navigation.\n- the remote server does not respond or is unreachable.\n- the main resource failed to load.\n\nThe method will not throw an error when any valid HTTP status code is returned by the remote server, including 404\n\"Not Found\" and 500 \"Internal Server Error\". The status code for such responses can be retrieved by calling\n[`method: Response.status`].\n\n**NOTE** The method either throws an error or returns a main resource response. The only exceptions are navigation\nto `about:blank` or navigation to the same URL with a different hash, which would succeed and return `null`.\n\n**NOTE** Headless mode doesn't support navigation to a PDF document. See the\n[upstream issue](https://bugs.chromium.org/p/chromium/issues/detail?id=761295).","async":true,"alias":"goto","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"url","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"URL to navigate page to. The url should include scheme, e.g. `https://`.↵When a `baseURL` via the context options was provided and the passed URL is a path,↵it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor."}],"required":true,"comment":"URL to navigate page to. The url should include scheme, e.g. `https://`. When a `baseURL` via the context options\nwas provided and the passed URL is a path, it gets merged via the\n[`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"referer","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Referer header value. If provided it will take preference over the referer header value set by↵[`method: Page.setExtraHTTPHeaders`]."}],"required":false,"comment":"Referer header value. If provided it will take preference over the referer header value set by\n[`method: Page.setExtraHTTPHeaders`].","async":false,"alias":"referer","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.↵The default value can be changed by using the↵[`method: BrowserContext.setDefaultNavigationTimeout`],↵[`method: BrowserContext.setDefaultTimeout`],↵[`method: Page.setDefaultNavigationTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `navigationTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultNavigationTimeout`],↵[`method: BrowserContext.setDefaultTimeout`],↵[`method: Page.setDefaultNavigationTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via\n`navigationTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"waitUntil","type":{"name":"WaitUntilState","union":[{"name":"\"load\""},{"name":"\"domcontentloaded\""},{"name":"\"networkidle\""},{"name":"\"commit\""}],"expression":"[WaitUntilState]<\"load\"|\"domcontentloaded\"|\"networkidle\"|\"commit\">"},"spec":[{"type":"text","text":"When to consider operation succeeded, defaults to `load`. Events can be either:"},{"type":"li","text":"`'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.","liType":"bullet"},{"type":"li","text":"`'load'` - consider operation to be finished when the `load` event is fired.","liType":"bullet"},{"type":"li","text":"`'networkidle'` - **DISCOURAGED** consider operation to be finished when there are no network connections for at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.","liType":"bullet"},{"type":"li","text":"`'commit'` - consider operation to be finished when network response is received and the document started loading.","liType":"bullet"}],"required":false,"comment":"When to consider operation succeeded, defaults to `load`. Events can be either:\n- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.\n- `'load'` - consider operation to be finished when the `load` event is fired.\n- `'networkidle'` - **DISCOURAGED** consider operation to be finished when there are no network connections for\n at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.\n- `'commit'` - consider operation to be finished when network response is received and the document started\n loading.","async":false,"alias":"waitUntil","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.hover`] instead. Read more about [locators](../locators.md).","name":"hover","type":{"name":"void"},"spec":[{"type":"text","text":"This method hovers over an element matching `selector` by performing the following steps:"},{"type":"li","text":"Find an element matching `selector`. If there is none, wait until a matching element is attached to↵the DOM.","liType":"ordinal"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is↵set. If the element is detached during the checks, the whole action is retried.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.mouse`] to hover over the center of the element, or the specified `position`.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.","liType":"ordinal"},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."}],"required":true,"comment":"This method hovers over an element matching `selector` by performing the following steps:\n1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.\n1. Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is set. If\n the element is detached during the checks, the whole action is retried.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.mouse`] to hover over the center of the element, or the specified `position`.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.","async":true,"alias":"hover","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"modifiers","type":{"name":"Array","templates":[{"name":"KeyboardModifier","union":[{"name":"\"Alt\""},{"name":"\"Control\""},{"name":"\"ControlOrMeta\""},{"name":"\"Meta\""},{"name":"\"Shift\""}]}],"expression":"[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"ControlOrMeta\"|\"Meta\"|\"Shift\">>"},"spec":[{"type":"text","text":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current↵modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to \"Control\" on Windows↵and Linux and to \"Meta\" on macOS."}],"required":false,"comment":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores\ncurrent modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to\n\"Control\" on Windows and Linux and to \"Meta\" on macOS.","async":false,"alias":"modifiers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.28","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.innerHTML`] instead. Read more about [locators](../locators.md).","name":"innerHTML","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Returns `element.innerHTML`."}],"required":true,"comment":"Returns `element.innerHTML`.","async":true,"alias":"innerHTML","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.innerText`] instead. Read more about [locators](../locators.md).","name":"innerText","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Returns `element.innerText`."}],"required":true,"comment":"Returns `element.innerText`.","async":true,"alias":"innerText","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.13","discouraged":"Use locator-based [`method: Locator.inputValue`] instead. Read more about [locators](../locators.md).","name":"inputValue","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element."},{"type":"text","text":"Throws for non-input elements. However, if the element is inside the `<label>` element that has an associated [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), returns the value of the control."}],"required":true,"comment":"Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element.\n\nThrows for non-input elements. However, if the element is inside the `<label>` element that has an associated\n[control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), returns the value of the\ncontrol.","async":true,"alias":"inputValue","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.13","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.13","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.13","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.isChecked`] instead. Read more about [locators](../locators.md).","name":"isChecked","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Returns whether the element is checked. Throws if the element is not a checkbox or radio input."}],"required":true,"comment":"Returns whether the element is checked. Throws if the element is not a checkbox or radio input.","async":true,"alias":"isChecked","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"isClosed","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Indicates that the page has been closed."}],"required":true,"comment":"Indicates that the page has been closed.","async":false,"alias":"isClosed","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.isDisabled`] instead. Read more about [locators](../locators.md).","name":"isDisabled","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Returns whether the element is disabled, the opposite of [enabled](../actionability.md#enabled)."}],"required":true,"comment":"Returns whether the element is disabled, the opposite of [enabled](../actionability.md#enabled).","async":true,"alias":"isDisabled","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.isEditable`] instead. Read more about [locators](../locators.md).","name":"isEditable","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Returns whether the element is [editable](../actionability.md#editable)."}],"required":true,"comment":"Returns whether the element is [editable](../actionability.md#editable).","async":true,"alias":"isEditable","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.isEnabled`] instead. Read more about [locators](../locators.md).","name":"isEnabled","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Returns whether the element is [enabled](../actionability.md#enabled)."}],"required":true,"comment":"Returns whether the element is [enabled](../actionability.md#enabled).","async":true,"alias":"isEnabled","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.isHidden`] instead. Read more about [locators](../locators.md).","name":"isHidden","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Returns whether the element is hidden, the opposite of [visible](../actionability.md#visible). `selector` that does not match any elements is considered hidden."}],"required":true,"comment":"Returns whether the element is hidden, the opposite of [visible](../actionability.md#visible). `selector` that\ndoes not match any elements is considered hidden.","async":true,"alias":"isHidden","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","deprecated":"This option is ignored. [`method: Page.isHidden`] does not wait for the↵element to become hidden and returns immediately.","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[],"required":false,"comment":"","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.isVisible`] instead. Read more about [locators](../locators.md).","name":"isVisible","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Returns whether the element is [visible](../actionability.md#visible). `selector` that does not match any elements is considered not visible."}],"required":true,"comment":"Returns whether the element is [visible](../actionability.md#visible). `selector` that does not match any elements\nis considered not visible.","async":true,"alias":"isVisible","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","deprecated":"This option is ignored. [`method: Page.isVisible`] does not wait↵for the element to become visible and returns immediately.","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[],"required":false,"comment":"","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"property","langs":{},"since":"v1.8","name":"keyboard","type":{"name":"Keyboard","expression":"[Keyboard]"},"spec":[],"required":true,"comment":"","async":false,"alias":"keyboard","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.14","name":"locator","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"The method returns an element locator that can be used to perform actions on this page / frame.↵Locator is resolved to the element immediately before performing an action, so a series of actions on the same locator can in fact be performed on different DOM elements. That would happen if the DOM structure between those actions has changed."},{"type":"text","text":"[Learn more about locators](../locators.md)."}],"required":true,"comment":"The method returns an element locator that can be used to perform actions on this page / frame. Locator is resolved\nto the element immediately before performing an action, so a series of actions on the same locator can in fact be\nperformed on different DOM elements. That would happen if the DOM structure between those actions has changed.\n\n[Learn more about locators](../locators.md).","async":false,"alias":"locator","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.14","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to use when resolving DOM element."}],"required":true,"comment":"A selector to use when resolving DOM element.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"has","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"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>`."},{"type":"text","text":"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`."},{"type":"text","text":"Note that outer and inner locators must belong to the same frame. Inner locator must not contain `FrameLocator`s."}],"required":false,"comment":"Narrows down the results of the method to those which contain elements matching this relative locator. For example,\n`article` that has `text=Playwright` matches `<article><div>Playwright</div></article>`.\n\nInner locator **must be relative** to the outer locator and is queried starting with the outer locator match, not\nthe document root. For example, you can find `content` that has `div` in\n`<article><content><div>Playwright</div></content></article>`. However, looking for `content` that has `article\ndiv` will fail, because the inner locator must be relative and should not use any elements outside the `content`.\n\nNote that outer and inner locators must belong to the same frame. Inner locator must not contain `FrameLocator`s.","async":false,"alias":"has","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.33","name":"hasNot","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"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>`."},{"type":"text","text":"Note that outer and inner locators must belong to the same frame. Inner locator must not contain `FrameLocator`s."}],"required":false,"comment":"Matches elements that do not contain an element that matches an inner locator. Inner locator is queried against the\nouter one. For example, `article` that does not have `div` matches `<article><span>Playwright</span></article>`.\n\nNote that outer and inner locators must belong to the same frame. Inner locator must not contain `FrameLocator`s.","async":false,"alias":"hasNot","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.33","name":"hasNotText","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"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."}],"required":false,"comment":"Matches elements that do not contain specified text somewhere inside, possibly in a child or a descendant element.\nWhen passed a [string], matching is case-insensitive and searches for a substring.","async":false,"alias":"hasNotText","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"hasText","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"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>`."}],"required":false,"comment":"Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When\npassed a [string], matching is case-insensitive and searches for a substring. For example, `\"Playwright\"` matches\n`<article><div>Playwright</div></article>`.","async":false,"alias":"hasText","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"mainFrame","type":{"name":"Frame","expression":"[Frame]"},"spec":[{"type":"text","text":"The page's main frame. Page is guaranteed to have a main frame which persists during navigations."}],"required":true,"comment":"The page's main frame. Page is guaranteed to have a main frame which persists during navigations.","async":false,"alias":"mainFrame","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"property","langs":{},"since":"v1.8","name":"mouse","type":{"name":"Mouse","expression":"[Mouse]"},"spec":[],"required":true,"comment":"","async":false,"alias":"mouse","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.10","name":"onceDialog","type":{"name":"void"},"spec":[{"type":"text","text":"Adds one-off `Dialog` handler. The handler will be removed immediately after next `Dialog` is created."},{"type":"code","lines":["page.onceDialog(dialog -> {"," dialog.accept(\"foo\");","});","","// prints 'foo'","System.out.println(page.evaluate(\"prompt('Enter string:')\"));","","// prints 'null' as the dialog will be auto-dismissed because there are no handlers.","System.out.println(page.evaluate(\"prompt('Enter string:')\"));"],"codeLang":"java"},{"type":"text","text":"This code above is equivalent to:"},{"type":"code","lines":["Consumer<Dialog> handler = new Consumer<Dialog>() {"," @Override"," public void accept(Dialog dialog) {"," dialog.accept(\"foo\");"," page.offDialog(this);"," }","};","page.onDialog(handler);","","// prints 'foo'","System.out.println(page.evaluate(\"prompt('Enter string:')\"));","","// prints 'null' as the dialog will be auto-dismissed because there are no handlers.","System.out.println(page.evaluate(\"prompt('Enter string:')\"));"],"codeLang":"java"}],"required":true,"comment":"Adds one-off `Dialog` handler. The handler will be removed immediately after next `Dialog` is created.\n\n```java\npage.onceDialog(dialog -> {\n dialog.accept(\"foo\");\n});\n\n// prints 'foo'\nSystem.out.println(page.evaluate(\"prompt('Enter string:')\"));\n\n// prints 'null' as the dialog will be auto-dismissed because there are no handlers.\nSystem.out.println(page.evaluate(\"prompt('Enter string:')\"));\n```\n\nThis code above is equivalent to:\n\n```java\nConsumer<Dialog> handler = new Consumer<Dialog>() {\n @Override\n public void accept(Dialog dialog) {\n dialog.accept(\"foo\");\n page.offDialog(this);\n }\n};\npage.onDialog(handler);\n\n// prints 'foo'\nSystem.out.println(page.evaluate(\"prompt('Enter string:')\"));\n\n// prints 'null' as the dialog will be auto-dismissed because there are no handlers.\nSystem.out.println(page.evaluate(\"prompt('Enter string:')\"));\n```\n","async":false,"alias":"onceDialog","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.10","name":"handler","type":{"name":"function","args":[{"name":"Dialog"}],"expression":"[function]([Dialog])"},"spec":[{"type":"text","text":"Receives the `Dialog` object, it **must** either [`method: Dialog.accept`] or [`method: Dialog.dismiss`] the dialog - otherwise↵the page will [freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#never_blocking) waiting for the dialog,↵and actions like click will never finish."}],"required":true,"comment":"Receives the `Dialog` object, it **must** either [`method: Dialog.accept`] or [`method: Dialog.dismiss`] the dialog\n- otherwise the page will\n[freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#never_blocking) waiting for the dialog,\nand actions like click will never finish.","async":false,"alias":"handler","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"opener","type":{"name":"","union":[{"name":"null"},{"name":"Page"}],"expression":"[null]|[Page]"},"spec":[{"type":"text","text":"Returns the opener for popup pages and `null` for others. If the opener has been closed already the returns `null`."}],"required":true,"comment":"Returns the opener for popup pages and `null` for others. If the opener has been closed already the returns `null`.","async":true,"alias":"opener","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.9","name":"pause","type":{"name":"void"},"spec":[{"type":"text","text":"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."},{"type":"text","text":"User can inspect selectors or perform manual steps while paused. Resume will continue running the original script from↵the place it was paused."},{"type":"note","noteType":"note","text":"This method requires Playwright to be started in a headed mode, with a falsy `headless` value in↵the [`method: BrowserType.launch`]."}],"required":true,"comment":"Pauses script execution. Playwright will stop executing the script and wait for the user to either press 'Resume'\nbutton in the page overlay or to call `playwright.resume()` in the DevTools console.\n\nUser can inspect selectors or perform manual steps while paused. Resume will continue running the original script\nfrom the place it was paused.\n\n**NOTE** This method requires Playwright to be started in a headed mode, with a falsy `headless` value in the\n[`method: BrowserType.launch`].","async":true,"alias":"pause","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"pdf","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"Returns the PDF buffer."},{"type":"note","noteType":"note","text":"Generating a pdf is currently only supported in Chromium headless."},{"type":"text","text":"`page.pdf()` generates a pdf of the page with `print` css media. To generate a pdf with `screen` media, call↵[`method: Page.emulateMedia`] before calling `page.pdf()`:"},{"type":"note","noteType":"note","text":"By default, `page.pdf()` generates a pdf with modified colors for printing. Use the↵[`-webkit-print-color-adjust`](https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-print-color-adjust) property to↵force rendering of exact colors."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["// Generates a PDF with 'screen' media type.","await page.emulateMedia({ media: 'screen' });","await page.pdf({ path: 'page.pdf' });"],"codeLang":"js"},{"type":"code","lines":["// Generates a PDF with \"screen\" media type.","page.emulateMedia(new Page.EmulateMediaOptions().setMedia(Media.SCREEN));","page.pdf(new Page.PdfOptions().setPath(Paths.get(\"page.pdf\")));"],"codeLang":"java"},{"type":"code","lines":["# generates a pdf with \"screen\" media type.","await page.emulate_media(media=\"screen\")","await page.pdf(path=\"page.pdf\")"],"codeLang":"python async"},{"type":"code","lines":["# generates a pdf with \"screen\" media type.","page.emulate_media(media=\"screen\")","page.pdf(path=\"page.pdf\")"],"codeLang":"python sync"},{"type":"code","lines":["// Generates a PDF with 'screen' media type","await page.EmulateMediaAsync(new() { Media = Media.Screen });","await page.PdfAsync(new() { Path = \"page.pdf\" });"],"codeLang":"csharp"},{"type":"text","text":"The `width`, `height`, and `margin` options accept values labeled with units. Unlabeled↵values are treated as pixels."},{"type":"text","text":"A few examples:"},{"type":"li","text":"`page.pdf({width: 100})` - prints with width set to 100 pixels","liType":"bullet"},{"type":"li","text":"`page.pdf({width: '100px'})` - prints with width set to 100 pixels","liType":"bullet"},{"type":"li","text":"`page.pdf({width: '10cm'})` - prints with width set to 10 centimeters.","liType":"bullet"},{"type":"text","text":"All possible units are:"},{"type":"li","text":"`px` - pixel","liType":"bullet"},{"type":"li","text":"`in` - inch","liType":"bullet"},{"type":"li","text":"`cm` - centimeter","liType":"bullet"},{"type":"li","text":"`mm` - millimeter","liType":"bullet"},{"type":"text","text":"The `format` options are:"},{"type":"li","text":"`Letter`: 8.5in x 11in","liType":"bullet"},{"type":"li","text":"`Legal`: 8.5in x 14in","liType":"bullet"},{"type":"li","text":"`Tabloid`: 11in x 17in","liType":"bullet"},{"type":"li","text":"`Ledger`: 17in x 11in","liType":"bullet"},{"type":"li","text":"`A0`: 33.1in x 46.8in","liType":"bullet"},{"type":"li","text":"`A1`: 23.4in x 33.1in","liType":"bullet"},{"type":"li","text":"`A2`: 16.54in x 23.4in","liType":"bullet"},{"type":"li","text":"`A3`: 11.7in x 16.54in","liType":"bullet"},{"type":"li","text":"`A4`: 8.27in x 11.7in","liType":"bullet"},{"type":"li","text":"`A5`: 5.83in x 8.27in","liType":"bullet"},{"type":"li","text":"`A6`: 4.13in x 5.83in","liType":"bullet"},{"type":"note","noteType":"note","text":"`headerTemplate` and `footerTemplate` markup have the following limitations: > 1. Script tags inside↵templates are not evaluated. > 2. Page styles are not visible inside templates."}],"required":true,"comment":"Returns the PDF buffer.\n\n**NOTE** Generating a pdf is currently only supported in Chromium headless.\n\n`page.pdf()` generates a pdf of the page with `print` css media. To generate a pdf with `screen` media, call\n[`method: Page.emulateMedia`] before calling `page.pdf()`:\n\n**NOTE** By default, `page.pdf()` generates a pdf with modified colors for printing. Use the\n[`-webkit-print-color-adjust`](https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-print-color-adjust)\nproperty to force rendering of exact colors.\n\n**Usage**\n\n```js\n// Generates a PDF with 'screen' media type.\nawait page.emulateMedia({ media: 'screen' });\nawait page.pdf({ path: 'page.pdf' });\n```\n\n```java\n// Generates a PDF with \"screen\" media type.\npage.emulateMedia(new Page.EmulateMediaOptions().setMedia(Media.SCREEN));\npage.pdf(new Page.PdfOptions().setPath(Paths.get(\"page.pdf\")));\n```\n\n```py\n# generates a pdf with \"screen\" media type.\nawait page.emulate_media(media=\"screen\")\nawait page.pdf(path=\"page.pdf\")\n```\n\n```py\n# generates a pdf with \"screen\" media type.\npage.emulate_media(media=\"screen\")\npage.pdf(path=\"page.pdf\")\n```\n\n```csharp\n// Generates a PDF with 'screen' media type\nawait page.EmulateMediaAsync(new() { Media = Media.Screen });\nawait page.PdfAsync(new() { Path = \"page.pdf\" });\n```\n\nThe `width`, `height`, and `margin` options accept values labeled with units. Unlabeled values are treated as\npixels.\n\nA few examples:\n- `page.pdf({width: 100})` - prints with width set to 100 pixels\n- `page.pdf({width: '100px'})` - prints with width set to 100 pixels\n- `page.pdf({width: '10cm'})` - prints with width set to 10 centimeters.\n\nAll possible units are:\n- `px` - pixel\n- `in` - inch\n- `cm` - centimeter\n- `mm` - millimeter\n\nThe `format` options are:\n- `Letter`: 8.5in x 11in\n- `Legal`: 8.5in x 14in\n- `Tabloid`: 11in x 17in\n- `Ledger`: 17in x 11in\n- `A0`: 33.1in x 46.8in\n- `A1`: 23.4in x 33.1in\n- `A2`: 16.54in x 23.4in\n- `A3`: 11.7in x 16.54in\n- `A4`: 8.27in x 11.7in\n- `A5`: 5.83in x 8.27in\n- `A6`: 4.13in x 5.83in\n\n**NOTE** `headerTemplate` and `footerTemplate` markup have the following limitations: > 1. Script tags inside\ntemplates are not evaluated. > 2. Page styles are not visible inside templates.","async":true,"alias":"pdf","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"displayHeaderFooter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Display header and footer. Defaults to `false`."}],"required":false,"comment":"Display header and footer. Defaults to `false`.","async":false,"alias":"displayHeaderFooter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"footerTemplate","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"HTML template for the print footer. Should use the same format as the `headerTemplate`."}],"required":false,"comment":"HTML template for the print footer. Should use the same format as the `headerTemplate`.","async":false,"alias":"footerTemplate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"format","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Paper format. If set, takes priority over `width` or `height` options. Defaults to 'Letter'."}],"required":false,"comment":"Paper format. If set, takes priority over `width` or `height` options. Defaults to 'Letter'.","async":false,"alias":"format","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"headerTemplate","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values↵into them:"},{"type":"li","text":"`'date'` formatted print date","liType":"bullet"},{"type":"li","text":"`'title'` document title","liType":"bullet"},{"type":"li","text":"`'url'` document location","liType":"bullet"},{"type":"li","text":"`'pageNumber'` current page number","liType":"bullet"},{"type":"li","text":"`'totalPages'` total pages in the document","liType":"bullet"}],"required":false,"comment":"HTML template for the print header. Should be valid HTML markup with following classes used to inject printing\nvalues into them:\n- `'date'` formatted print date\n- `'title'` document title\n- `'url'` document location\n- `'pageNumber'` current page number\n- `'totalPages'` total pages in the document","async":false,"alias":"headerTemplate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"height","type":{"name":"","union":[{"name":"string"},{"name":"float"}],"expression":"[string]|[float]"},"spec":[{"type":"text","text":"Paper height, accepts values labeled with units."}],"required":false,"comment":"Paper height, accepts values labeled with units.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"height","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Paper height, accepts values labeled with units."}],"required":false,"comment":"Paper height, accepts values labeled with units.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"landscape","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Paper orientation. Defaults to `false`."}],"required":false,"comment":"Paper orientation. Defaults to `false`.","async":false,"alias":"landscape","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"margin","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"top","type":{"name":"","union":[{"name":"string"},{"name":"float"}],"expression":"[string]|[float]"},"spec":[{"type":"text","text":"Top margin, accepts values labeled with units. Defaults to `0`."}],"required":false,"comment":"Top margin, accepts values labeled with units. Defaults to `0`.","async":false,"alias":"top","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"right","type":{"name":"","union":[{"name":"string"},{"name":"float"}],"expression":"[string]|[float]"},"spec":[{"type":"text","text":"Right margin, accepts values labeled with units. Defaults to `0`."}],"required":false,"comment":"Right margin, accepts values labeled with units. Defaults to `0`.","async":false,"alias":"right","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"bottom","type":{"name":"","union":[{"name":"string"},{"name":"float"}],"expression":"[string]|[float]"},"spec":[{"type":"text","text":"Bottom margin, accepts values labeled with units. Defaults to `0`."}],"required":false,"comment":"Bottom margin, accepts values labeled with units. Defaults to `0`.","async":false,"alias":"bottom","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"left","type":{"name":"","union":[{"name":"string"},{"name":"float"}],"expression":"[string]|[float]"},"spec":[{"type":"text","text":"Left margin, accepts values labeled with units. Defaults to `0`."}],"required":false,"comment":"Left margin, accepts values labeled with units. Defaults to `0`.","async":false,"alias":"left","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Paper margins, defaults to none."}],"required":false,"comment":"Paper margins, defaults to none.","async":false,"alias":"margin","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"margin","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"top","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Top margin, accepts values labeled with units. Defaults to `0`."}],"required":false,"comment":"Top margin, accepts values labeled with units. Defaults to `0`.","async":false,"alias":"top","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"right","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Right margin, accepts values labeled with units. Defaults to `0`."}],"required":false,"comment":"Right margin, accepts values labeled with units. Defaults to `0`.","async":false,"alias":"right","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"bottom","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Bottom margin, accepts values labeled with units. Defaults to `0`."}],"required":false,"comment":"Bottom margin, accepts values labeled with units. Defaults to `0`.","async":false,"alias":"bottom","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"left","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Left margin, accepts values labeled with units. Defaults to `0`."}],"required":false,"comment":"Left margin, accepts values labeled with units. Defaults to `0`.","async":false,"alias":"left","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Paper margins, defaults to none."}],"required":false,"comment":"Paper margins, defaults to none.","async":false,"alias":"margin","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.42","name":"outline","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether or not to embed the document outline into the PDF. Defaults to `false`."}],"required":false,"comment":"Whether or not to embed the document outline into the PDF. Defaults to `false`.","async":false,"alias":"outline","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"pageRanges","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages."}],"required":false,"comment":"Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.","async":false,"alias":"pageRanges","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"The file path to save the PDF to. If `path` is a relative path, then it is resolved relative to the current↵working directory. If no path is provided, the PDF won't be saved to the disk."}],"required":false,"comment":"The file path to save the PDF to. If `path` is a relative path, then it is resolved relative to the current working\ndirectory. If no path is provided, the PDF won't be saved to the disk.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"preferCSSPageSize","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Give any CSS `@page` size declared in the page priority over what is declared in `width` and↵`height` or `format` options. Defaults to `false`, which will scale the content to fit the paper↵size."}],"required":false,"comment":"Give any CSS `@page` size declared in the page priority over what is declared in `width` and `height` or `format`\noptions. Defaults to `false`, which will scale the content to fit the paper size.","async":false,"alias":"preferCSSPageSize","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"printBackground","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Print background graphics. Defaults to `false`."}],"required":false,"comment":"Print background graphics. Defaults to `false`.","async":false,"alias":"printBackground","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"scale","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Scale of the webpage rendering. Defaults to `1`. Scale amount must be between 0.1 and 2."}],"required":false,"comment":"Scale of the webpage rendering. Defaults to `1`. Scale amount must be between 0.1 and 2.","async":false,"alias":"scale","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.42","name":"tagged","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether or not to generate tagged (accessible) PDF. Defaults to `false`."}],"required":false,"comment":"Whether or not to generate tagged (accessible) PDF. Defaults to `false`.","async":false,"alias":"tagged","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"width","type":{"name":"","union":[{"name":"string"},{"name":"float"}],"expression":"[string]|[float]"},"spec":[{"type":"text","text":"Paper width, accepts values labeled with units."}],"required":false,"comment":"Paper width, accepts values labeled with units.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"width","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Paper width, accepts values labeled with units."}],"required":false,"comment":"Paper width, accepts values labeled with units.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.press`] instead. Read more about [locators](../locators.md).","name":"press","type":{"name":"void"},"spec":[{"type":"text","text":"Focuses the element, and then uses [`method: Keyboard.down`] and [`method: Keyboard.up`]."},{"type":"text","text":"`key` can specify the intended↵[keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) value or a single character to↵generate the text for. A superset of the `key` values can be found↵[here](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values). Examples of the keys are:"},{"type":"text","text":"`F1` - `F12`, `Digit0`- `Digit9`, `KeyA`- `KeyZ`, `Backquote`, `Minus`, `Equal`, `Backslash`, `Backspace`, `Tab`,↵`Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`, etc."},{"type":"text","text":"Following modification shortcuts are also supported: `Shift`, `Control`, `Alt`, `Meta`, `ShiftLeft`, `ControlOrMeta`.↵`ControlOrMeta` resolves to `Control` on Windows and Linux and to `Meta` on macOS."},{"type":"text","text":"Holding down `Shift` will type the text that corresponds to the `key` in the upper case."},{"type":"text","text":"If `key` is a single character, it is case-sensitive, so the values `a` and `A` will generate different↵respective texts."},{"type":"text","text":"Shortcuts such as `key: \"Control+o\"`, `key: \"Control++` or `key: \"Control+Shift+T\"` are supported as well. When specified with the↵modifier, modifier is pressed and being held while the subsequent key is being pressed."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const page = await browser.newPage();","await page.goto('https://keycode.info');","await page.press('body', 'A');","await page.screenshot({ path: 'A.png' });","await page.press('body', 'ArrowLeft');","await page.screenshot({ path: 'ArrowLeft.png' });","await page.press('body', 'Shift+O');","await page.screenshot({ path: 'O.png' });","await browser.close();"],"codeLang":"js"},{"type":"code","lines":["Page page = browser.newPage();","page.navigate(\"https://keycode.info\");","page.press(\"body\", \"A\");","page.screenshot(new Page.ScreenshotOptions().setPath(Paths.get(\"A.png\")));","page.press(\"body\", \"ArrowLeft\");","page.screenshot(new Page.ScreenshotOptions().setPath(Paths.get(\"ArrowLeft.png\" )));","page.press(\"body\", \"Shift+O\");","page.screenshot(new Page.ScreenshotOptions().setPath(Paths.get(\"O.png\" )));"],"codeLang":"java"},{"type":"code","lines":["page = await browser.new_page()","await page.goto(\"https://keycode.info\")","await page.press(\"body\", \"A\")","await page.screenshot(path=\"a.png\")","await page.press(\"body\", \"ArrowLeft\")","await page.screenshot(path=\"arrow_left.png\")","await page.press(\"body\", \"Shift+O\")","await page.screenshot(path=\"o.png\")","await browser.close()"],"codeLang":"python async"},{"type":"code","lines":["page = browser.new_page()","page.goto(\"https://keycode.info\")","page.press(\"body\", \"A\")","page.screenshot(path=\"a.png\")","page.press(\"body\", \"ArrowLeft\")","page.screenshot(path=\"arrow_left.png\")","page.press(\"body\", \"Shift+O\")","page.screenshot(path=\"o.png\")","browser.close()"],"codeLang":"python sync"},{"type":"code","lines":["var page = await browser.NewPageAsync();","await page.GotoAsync(\"https://keycode.info\");","await page.PressAsync(\"body\", \"A\");","await page.ScreenshotAsync(new() { Path = \"A.png\" });","await page.PressAsync(\"body\", \"ArrowLeft\");","await page.ScreenshotAsync(new() { Path = \"ArrowLeft.png\" });","await page.PressAsync(\"body\", \"Shift+O\");","await page.ScreenshotAsync(new() { Path = \"O.png\" });"],"codeLang":"csharp"}],"required":true,"comment":"Focuses the element, and then uses [`method: Keyboard.down`] and [`method: Keyboard.up`].\n\n`key` can specify the intended\n[keyboardEvent.key](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) value or a single character\nto generate the text for. A superset of the `key` values can be found\n[here](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values). Examples of the keys are:\n\n`F1` - `F12`, `Digit0`- `Digit9`, `KeyA`- `KeyZ`, `Backquote`, `Minus`, `Equal`, `Backslash`, `Backspace`, `Tab`,\n`Delete`, `Escape`, `ArrowDown`, `End`, `Enter`, `Home`, `Insert`, `PageDown`, `PageUp`, `ArrowRight`, `ArrowUp`,\netc.\n\nFollowing modification shortcuts are also supported: `Shift`, `Control`, `Alt`, `Meta`, `ShiftLeft`,\n`ControlOrMeta`. `ControlOrMeta` resolves to `Control` on Windows and Linux and to `Meta` on macOS.\n\nHolding down `Shift` will type the text that corresponds to the `key` in the upper case.\n\nIf `key` is a single character, it is case-sensitive, so the values `a` and `A` will generate different respective\ntexts.\n\nShortcuts such as `key: \"Control+o\"`, `key: \"Control++` or `key: \"Control+Shift+T\"` are supported as well. When\nspecified with the modifier, modifier is pressed and being held while the subsequent key is being pressed.\n\n**Usage**\n\n```js\nconst page = await browser.newPage();\nawait page.goto('https://keycode.info');\nawait page.press('body', 'A');\nawait page.screenshot({ path: 'A.png' });\nawait page.press('body', 'ArrowLeft');\nawait page.screenshot({ path: 'ArrowLeft.png' });\nawait page.press('body', 'Shift+O');\nawait page.screenshot({ path: 'O.png' });\nawait browser.close();\n```\n\n```java\nPage page = browser.newPage();\npage.navigate(\"https://keycode.info\");\npage.press(\"body\", \"A\");\npage.screenshot(new Page.ScreenshotOptions().setPath(Paths.get(\"A.png\")));\npage.press(\"body\", \"ArrowLeft\");\npage.screenshot(new Page.ScreenshotOptions().setPath(Paths.get(\"ArrowLeft.png\" )));\npage.press(\"body\", \"Shift+O\");\npage.screenshot(new Page.ScreenshotOptions().setPath(Paths.get(\"O.png\" )));\n```\n\n```py\npage = await browser.new_page()\nawait page.goto(\"https://keycode.info\")\nawait page.press(\"body\", \"A\")\nawait page.screenshot(path=\"a.png\")\nawait page.press(\"body\", \"ArrowLeft\")\nawait page.screenshot(path=\"arrow_left.png\")\nawait page.press(\"body\", \"Shift+O\")\nawait page.screenshot(path=\"o.png\")\nawait browser.close()\n```\n\n```py\npage = browser.new_page()\npage.goto(\"https://keycode.info\")\npage.press(\"body\", \"A\")\npage.screenshot(path=\"a.png\")\npage.press(\"body\", \"ArrowLeft\")\npage.screenshot(path=\"arrow_left.png\")\npage.press(\"body\", \"Shift+O\")\npage.screenshot(path=\"o.png\")\nbrowser.close()\n```\n\n```csharp\nvar page = await browser.NewPageAsync();\nawait page.GotoAsync(\"https://keycode.info\");\nawait page.PressAsync(\"body\", \"A\");\nawait page.ScreenshotAsync(new() { Path = \"A.png\" });\nawait page.PressAsync(\"body\", \"ArrowLeft\");\nawait page.ScreenshotAsync(new() { Path = \"ArrowLeft.png\" });\nawait page.PressAsync(\"body\", \"Shift+O\");\nawait page.ScreenshotAsync(new() { Path = \"O.png\" });\n```\n","async":true,"alias":"press","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"key","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Name of the key to press or a character to generate, such as `ArrowLeft` or `a`."}],"required":true,"comment":"Name of the key to press or a character to generate, such as `ArrowLeft` or `a`.","async":false,"alias":"key","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"delay","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0."}],"required":false,"comment":"Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.","async":false,"alias":"delay","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"python":"query_selector","js":"$"},"types":{},"overrides":{}},"since":"v1.9","discouraged":"Use locator-based [`method: Page.locator`] instead. Read more about [locators](../locators.md).","name":"querySelector","type":{"name":"","union":[{"name":"null"},{"name":"ElementHandle"}],"expression":"[null]|[ElementHandle]"},"spec":[{"type":"text","text":"The method finds an element matching the specified selector within the page. If no elements match the selector, the↵return value resolves to `null`. To wait for an element on the page, use [`method: Locator.waitFor`]."}],"required":true,"comment":"The method finds an element matching the specified selector within the page. If no elements match the selector, the\nreturn value resolves to `null`. To wait for an element on the page, use [`method: Locator.waitFor`].","async":true,"alias":"querySelector","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to query for."}],"required":true,"comment":"A selector to query for.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"python":"query_selector_all","js":"$$"},"types":{},"overrides":{}},"since":"v1.9","discouraged":"Use locator-based [`method: Page.locator`] instead. Read more about [locators](../locators.md).","name":"querySelectorAll","type":{"name":"Array","templates":[{"name":"ElementHandle"}],"expression":"[Array]<[ElementHandle]>"},"spec":[{"type":"text","text":"The method finds all elements matching the specified selector within the page. If no elements match the selector, the↵return value resolves to `[]`."}],"required":true,"comment":"The method finds all elements matching the specified selector within the page. If no elements match the selector,\nthe return value resolves to `[]`.","async":true,"alias":"querySelectorAll","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.9","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to query for."}],"required":true,"comment":"A selector to query for.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.42","name":"addLocatorHandler","type":{"name":"void"},"spec":[{"type":"text","text":"When testing a web page, sometimes unexpected overlays like a \"Sign up\" dialog appear and block actions you want to automate, e.g. clicking a button. These overlays don't always show up in the same way or at the same time, making them tricky to handle in automated tests."},{"type":"text","text":"This method lets you set up a special function, called a handler, that activates when it detects that overlay is visible. The handler's job is to remove the overlay, allowing your test to continue as if the overlay wasn't there."},{"type":"text","text":"Things to keep in mind:"},{"type":"li","text":"When an overlay is shown predictably, we recommend explicitly waiting for it in your test and dismissing it as a part of your normal test flow, instead of using [`method: Page.addLocatorHandler`].","liType":"bullet"},{"type":"li","text":"Playwright checks for the overlay every time before executing or retrying an action that requires an [actionability check](../actionability.md), or before performing an auto-waiting assertion check. When overlay is visible, Playwright calls the handler first, and then proceeds with the action/assertion. Note that the handler is only called when you perform an action/assertion - if the overlay becomes visible but you don't perform any actions, the handler will not be triggered.","liType":"bullet"},{"type":"li","text":"After executing the handler, Playwright will ensure that overlay that triggered the handler is not visible anymore. You can opt-out of this behavior with `noWaitAfter`.","liType":"bullet"},{"type":"li","text":"The execution time of the handler counts towards the timeout of the action/assertion that executed the handler. If your handler takes too long, it might cause timeouts.","liType":"bullet"},{"type":"li","text":"You can register multiple handlers. However, only a single handler will be running at a time. Make sure the actions within a handler don't depend on another handler.","liType":"bullet"},{"type":"note","noteType":"warning","text":"Running the handler will alter your page state mid-test. For example it will change the currently focused element and move the mouse. Make sure that actions that run after the handler are self-contained and do not rely on the focus and mouse state being unchanged.↵<br />↵<br />↵For example, consider a test that calls [`method: Locator.focus`] followed by [`method: Keyboard.press`]. If your handler clicks a button between these two actions, the focused element most likely will be wrong, and key press will happen on the unexpected element. Use [`method: Locator.press`] instead to avoid this problem.↵<br />↵<br />↵Another example is a series of mouse actions, where [`method: Mouse.move`] is followed by [`method: Mouse.down`]. Again, when the handler runs between these two actions, the mouse position will be wrong during the mouse down. Prefer self-contained actions like [`method: Locator.click`] that do not rely on the state being unchanged by a handler."},{"type":"text","text":"**Usage**"},{"type":"text","text":"An example that closes a \"Sign up to the newsletter\" dialog when it appears:"},{"type":"code","lines":["// Setup the handler.","await page.addLocatorHandler(page.getByText('Sign up to the newsletter'), async () => {"," await page.getByRole('button', { name: 'No thanks' }).click();","});","","// Write the test as usual.","await page.goto('https://example.com');","await page.getByRole('button', { name: 'Start here' }).click();"],"codeLang":"js"},{"type":"code","lines":["// Setup the handler.","page.addLocatorHandler(page.getByText(\"Sign up to the newsletter\"), () => {"," page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName(\"No thanks\")).click();","});","","// Write the test as usual.","page.goto(\"https://example.com\");","page.getByRole(\"button\", Page.GetByRoleOptions().setName(\"Start here\")).click();"],"codeLang":"java"},{"type":"code","lines":["# Setup the handler.","def handler():"," page.get_by_role(\"button\", name=\"No thanks\").click()","page.add_locator_handler(page.get_by_text(\"Sign up to the newsletter\"), handler)","","# Write the test as usual.","page.goto(\"https://example.com\")","page.get_by_role(\"button\", name=\"Start here\").click()"],"codeLang":"python sync"},{"type":"code","lines":["# Setup the handler.","def handler():"," await page.get_by_role(\"button\", name=\"No thanks\").click()","await page.add_locator_handler(page.get_by_text(\"Sign up to the newsletter\"), handler)","","# Write the test as usual.","await page.goto(\"https://example.com\")","await page.get_by_role(\"button\", name=\"Start here\").click()"],"codeLang":"python async"},{"type":"code","lines":["// Setup the handler.","await page.AddLocatorHandlerAsync(page.GetByText(\"Sign up to the newsletter\"), async () => {"," await page.GetByRole(AriaRole.Button, new() { Name = \"No thanks\" }).ClickAsync();","});","","// Write the test as usual.","await page.GotoAsync(\"https://example.com\");","await page.GetByRole(\"button\", new() { Name = \"Start here\" }).ClickAsync();"],"codeLang":"csharp"},{"type":"text","text":"An example that skips the \"Confirm your security details\" page when it is shown:"},{"type":"code","lines":["// Setup the handler.","await page.addLocatorHandler(page.getByText('Confirm your security details'), async () => {"," await page.getByRole('button', { name: 'Remind me later' }).click();","});","","// Write the test as usual.","await page.goto('https://example.com');","await page.getByRole('button', { name: 'Start here' }).click();"],"codeLang":"js"},{"type":"code","lines":["// Setup the handler.","page.addLocatorHandler(page.getByText(\"Confirm your security details\")), () => {"," page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName(\"Remind me later\")).click();","});","","// Write the test as usual.","page.goto(\"https://example.com\");","page.getByRole(\"button\", Page.GetByRoleOptions().setName(\"Start here\")).click();"],"codeLang":"java"},{"type":"code","lines":["# Setup the handler.","def handler():"," page.get_by_role(\"button\", name=\"Remind me later\").click()","page.add_locator_handler(page.get_by_text(\"Confirm your security details\"), handler)","","# Write the test as usual.","page.goto(\"https://example.com\")","page.get_by_role(\"button\", name=\"Start here\").click()"],"codeLang":"python sync"},{"type":"code","lines":["# Setup the handler.","def handler():"," await page.get_by_role(\"button\", name=\"Remind me later\").click()","await page.add_locator_handler(page.get_by_text(\"Confirm your security details\"), handler)","","# Write the test as usual.","await page.goto(\"https://example.com\")","await page.get_by_role(\"button\", name=\"Start here\").click()"],"codeLang":"python async"},{"type":"code","lines":["// Setup the handler.","await page.AddLocatorHandlerAsync(page.GetByText(\"Confirm your security details\"), async () => {"," await page.GetByRole(AriaRole.Button, new() { Name = \"Remind me later\" }).ClickAsync();","});","","// Write the test as usual.","await page.GotoAsync(\"https://example.com\");","await page.GetByRole(\"button\", new() { Name = \"Start here\" }).ClickAsync();"],"codeLang":"csharp"},{"type":"text","text":"An example with a custom callback on every actionability check. It uses a `<body>` locator that is always visible, so the handler is called before every actionability check. It is important to specify `noWaitAfter`, because the handler does not hide the `<body>` element."},{"type":"code","lines":["// Setup the handler.","await page.addLocatorHandler(page.locator('body'), async () => {"," await page.evaluate(() => window.removeObstructionsForTestIfNeeded());","}, { noWaitAfter: true });","","// Write the test as usual.","await page.goto('https://example.com');","await page.getByRole('button', { name: 'Start here' }).click();"],"codeLang":"js"},{"type":"code","lines":["// Setup the handler.","page.addLocatorHandler(page.locator(\"body\")), () => {"," page.evaluate(\"window.removeObstructionsForTestIfNeeded()\");","}, new Page.AddLocatorHandlerOptions.setNoWaitAfter(true));","","// Write the test as usual.","page.goto(\"https://example.com\");","page.getByRole(\"button\", Page.GetByRoleOptions().setName(\"Start here\")).click();"],"codeLang":"java"},{"type":"code","lines":["# Setup the handler.","def handler():"," page.evaluate(\"window.removeObstructionsForTestIfNeeded()\")","page.add_locator_handler(page.locator(\"body\"), handler, no_wait_after=True)","","# Write the test as usual.","page.goto(\"https://example.com\")","page.get_by_role(\"button\", name=\"Start here\").click()"],"codeLang":"python sync"},{"type":"code","lines":["# Setup the handler.","def handler():"," await page.evaluate(\"window.removeObstructionsForTestIfNeeded()\")","await page.add_locator_handler(page.locator(\"body\"), handler, no_wait_after=True)","","# Write the test as usual.","await page.goto(\"https://example.com\")","await page.get_by_role(\"button\", name=\"Start here\").click()"],"codeLang":"python async"},{"type":"code","lines":["// Setup the handler.","await page.AddLocatorHandlerAsync(page.Locator(\"body\"), async () => {"," await page.EvaluateAsync(\"window.removeObstructionsForTestIfNeeded()\");","}, new() { NoWaitAfter = true });","","// Write the test as usual.","await page.GotoAsync(\"https://example.com\");","await page.GetByRole(\"button\", new() { Name = \"Start here\" }).ClickAsync();"],"codeLang":"csharp"},{"type":"text","text":"Handler takes the original locator as an argument. You can also automatically remove the handler after a number of invocations by setting `times`:"},{"type":"code","lines":["await page.addLocatorHandler(page.getByLabel('Close'), async locator => {"," await locator.click();","}, { times: 1 });"],"codeLang":"js"},{"type":"code","lines":["page.addLocatorHandler(page.getByLabel(\"Close\"), locator => {"," locator.click();","}, new Page.AddLocatorHandlerOptions().setTimes(1));"],"codeLang":"java"},{"type":"code","lines":["def handler(locator):"," locator.click()","page.add_locator_handler(page.get_by_label(\"Close\"), handler, times=1)"],"codeLang":"python sync"},{"type":"code","lines":["def handler(locator):"," await locator.click()","await page.add_locator_handler(page.get_by_label(\"Close\"), handler, times=1)"],"codeLang":"python async"},{"type":"code","lines":["await page.AddLocatorHandlerAsync(page.GetByText(\"Sign up to the newsletter\"), async locator => {"," await locator.ClickAsync();","}, new() { Times = 1 });"],"codeLang":"csharp"}],"required":true,"comment":"When testing a web page, sometimes unexpected overlays like a \"Sign up\" dialog appear and block actions you want to\nautomate, e.g. clicking a button. These overlays don't always show up in the same way or at the same time, making\nthem tricky to handle in automated tests.\n\nThis method lets you set up a special function, called a handler, that activates when it detects that overlay is\nvisible. The handler's job is to remove the overlay, allowing your test to continue as if the overlay wasn't there.\n\nThings to keep in mind:\n- When an overlay is shown predictably, we recommend explicitly waiting for it in your test and dismissing it as\n a part of your normal test flow, instead of using [`method: Page.addLocatorHandler`].\n- Playwright checks for the overlay every time before executing or retrying an action that requires an\n [actionability check](../actionability.md), or before performing an auto-waiting assertion check. When overlay\n is visible, Playwright calls the handler first, and then proceeds with the action/assertion. Note that the\n handler is only called when you perform an action/assertion - if the overlay becomes visible but you don't\n perform any actions, the handler will not be triggered.\n- After executing the handler, Playwright will ensure that overlay that triggered the handler is not visible\n anymore. You can opt-out of this behavior with `noWaitAfter`.\n- The execution time of the handler counts towards the timeout of the action/assertion that executed the handler.\n If your handler takes too long, it might cause timeouts.\n- You can register multiple handlers. However, only a single handler will be running at a time. Make sure the\n actions within a handler don't depend on another handler.\n\n**NOTE** Running the handler will alter your page state mid-test. For example it will change the currently focused\nelement and move the mouse. Make sure that actions that run after the handler are self-contained and do not rely on\nthe focus and mouse state being unchanged. <br /> <br /> For example, consider a test that calls\n[`method: Locator.focus`] followed by [`method: Keyboard.press`]. If your handler clicks a button between these two\nactions, the focused element most likely will be wrong, and key press will happen on the unexpected element. Use\n[`method: Locator.press`] instead to avoid this problem. <br /> <br /> Another example is a series of mouse\nactions, where [`method: Mouse.move`] is followed by [`method: Mouse.down`]. Again, when the handler runs between\nthese two actions, the mouse position will be wrong during the mouse down. Prefer self-contained actions like\n[`method: Locator.click`] that do not rely on the state being unchanged by a handler.\n\n**Usage**\n\nAn example that closes a \"Sign up to the newsletter\" dialog when it appears:\n\n```js\n// Setup the handler.\nawait page.addLocatorHandler(page.getByText('Sign up to the newsletter'), async () => {\n await page.getByRole('button', { name: 'No thanks' }).click();\n});\n\n// Write the test as usual.\nawait page.goto('https://example.com');\nawait page.getByRole('button', { name: 'Start here' }).click();\n```\n\n```java\n// Setup the handler.\npage.addLocatorHandler(page.getByText(\"Sign up to the newsletter\"), () => {\n page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName(\"No thanks\")).click();\n});\n\n// Write the test as usual.\npage.goto(\"https://example.com\");\npage.getByRole(\"button\", Page.GetByRoleOptions().setName(\"Start here\")).click();\n```\n\n```py\n# Setup the handler.\ndef handler():\n page.get_by_role(\"button\", name=\"No thanks\").click()\npage.add_locator_handler(page.get_by_text(\"Sign up to the newsletter\"), handler)\n\n# Write the test as usual.\npage.goto(\"https://example.com\")\npage.get_by_role(\"button\", name=\"Start here\").click()\n```\n\n```py\n# Setup the handler.\ndef handler():\n await page.get_by_role(\"button\", name=\"No thanks\").click()\nawait page.add_locator_handler(page.get_by_text(\"Sign up to the newsletter\"), handler)\n\n# Write the test as usual.\nawait page.goto(\"https://example.com\")\nawait page.get_by_role(\"button\", name=\"Start here\").click()\n```\n\n```csharp\n// Setup the handler.\nawait page.AddLocatorHandlerAsync(page.GetByText(\"Sign up to the newsletter\"), async () => {\n await page.GetByRole(AriaRole.Button, new() { Name = \"No thanks\" }).ClickAsync();\n});\n\n// Write the test as usual.\nawait page.GotoAsync(\"https://example.com\");\nawait page.GetByRole(\"button\", new() { Name = \"Start here\" }).ClickAsync();\n```\n\nAn example that skips the \"Confirm your security details\" page when it is shown:\n\n```js\n// Setup the handler.\nawait page.addLocatorHandler(page.getByText('Confirm your security details'), async () => {\n await page.getByRole('button', { name: 'Remind me later' }).click();\n});\n\n// Write the test as usual.\nawait page.goto('https://example.com');\nawait page.getByRole('button', { name: 'Start here' }).click();\n```\n\n```java\n// Setup the handler.\npage.addLocatorHandler(page.getByText(\"Confirm your security details\")), () => {\n page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName(\"Remind me later\")).click();\n});\n\n// Write the test as usual.\npage.goto(\"https://example.com\");\npage.getByRole(\"button\", Page.GetByRoleOptions().setName(\"Start here\")).click();\n```\n\n```py\n# Setup the handler.\ndef handler():\n page.get_by_role(\"button\", name=\"Remind me later\").click()\npage.add_locator_handler(page.get_by_text(\"Confirm your security details\"), handler)\n\n# Write the test as usual.\npage.goto(\"https://example.com\")\npage.get_by_role(\"button\", name=\"Start here\").click()\n```\n\n```py\n# Setup the handler.\ndef handler():\n await page.get_by_role(\"button\", name=\"Remind me later\").click()\nawait page.add_locator_handler(page.get_by_text(\"Confirm your security details\"), handler)\n\n# Write the test as usual.\nawait page.goto(\"https://example.com\")\nawait page.get_by_role(\"button\", name=\"Start here\").click()\n```\n\n```csharp\n// Setup the handler.\nawait page.AddLocatorHandlerAsync(page.GetByText(\"Confirm your security details\"), async () => {\n await page.GetByRole(AriaRole.Button, new() { Name = \"Remind me later\" }).ClickAsync();\n});\n\n// Write the test as usual.\nawait page.GotoAsync(\"https://example.com\");\nawait page.GetByRole(\"button\", new() { Name = \"Start here\" }).ClickAsync();\n```\n\nAn example with a custom callback on every actionability check. It uses a `<body>` locator that is always visible,\nso the handler is called before every actionability check. It is important to specify `noWaitAfter`, because the\nhandler does not hide the `<body>` element.\n\n```js\n// Setup the handler.\nawait page.addLocatorHandler(page.locator('body'), async () => {\n await page.evaluate(() => window.removeObstructionsForTestIfNeeded());\n}, { noWaitAfter: true });\n\n// Write the test as usual.\nawait page.goto('https://example.com');\nawait page.getByRole('button', { name: 'Start here' }).click();\n```\n\n```java\n// Setup the handler.\npage.addLocatorHandler(page.locator(\"body\")), () => {\n page.evaluate(\"window.removeObstructionsForTestIfNeeded()\");\n}, new Page.AddLocatorHandlerOptions.setNoWaitAfter(true));\n\n// Write the test as usual.\npage.goto(\"https://example.com\");\npage.getByRole(\"button\", Page.GetByRoleOptions().setName(\"Start here\")).click();\n```\n\n```py\n# Setup the handler.\ndef handler():\n page.evaluate(\"window.removeObstructionsForTestIfNeeded()\")\npage.add_locator_handler(page.locator(\"body\"), handler, no_wait_after=True)\n\n# Write the test as usual.\npage.goto(\"https://example.com\")\npage.get_by_role(\"button\", name=\"Start here\").click()\n```\n\n```py\n# Setup the handler.\ndef handler():\n await page.evaluate(\"window.removeObstructionsForTestIfNeeded()\")\nawait page.add_locator_handler(page.locator(\"body\"), handler, no_wait_after=True)\n\n# Write the test as usual.\nawait page.goto(\"https://example.com\")\nawait page.get_by_role(\"button\", name=\"Start here\").click()\n```\n\n```csharp\n// Setup the handler.\nawait page.AddLocatorHandlerAsync(page.Locator(\"body\"), async () => {\n await page.EvaluateAsync(\"window.removeObstructionsForTestIfNeeded()\");\n}, new() { NoWaitAfter = true });\n\n// Write the test as usual.\nawait page.GotoAsync(\"https://example.com\");\nawait page.GetByRole(\"button\", new() { Name = \"Start here\" }).ClickAsync();\n```\n\nHandler takes the original locator as an argument. You can also automatically remove the handler after a number of\ninvocations by setting `times`:\n\n```js\nawait page.addLocatorHandler(page.getByLabel('Close'), async locator => {\n await locator.click();\n}, { times: 1 });\n```\n\n```java\npage.addLocatorHandler(page.getByLabel(\"Close\"), locator => {\n locator.click();\n}, new Page.AddLocatorHandlerOptions().setTimes(1));\n```\n\n```py\ndef handler(locator):\n locator.click()\npage.add_locator_handler(page.get_by_label(\"Close\"), handler, times=1)\n```\n\n```py\ndef handler(locator):\n await locator.click()\nawait page.add_locator_handler(page.get_by_label(\"Close\"), handler, times=1)\n```\n\n```csharp\nawait page.AddLocatorHandlerAsync(page.GetByText(\"Sign up to the newsletter\"), async locator => {\n await locator.ClickAsync();\n}, new() { Times = 1 });\n```\n","async":true,"alias":"addLocatorHandler","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.42","name":"locator","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Locator that triggers the handler."}],"required":true,"comment":"Locator that triggers the handler.","async":false,"alias":"locator","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.42","name":"handler","type":{"name":"function","args":[{"name":"Locator"}],"returnType":{"name":"Promise","templates":[{"name":"any"}]},"expression":"[function]([Locator]): [Promise<any>]"},"spec":[{"type":"text","text":"Function that should be run once `locator` appears. This function should get rid of the element that blocks actions like click."}],"required":true,"comment":"Function that should be run once `locator` appears. This function should get rid of the element that blocks actions\nlike click.","async":false,"alias":"handler","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.42","name":"handler","type":{"name":"function","args":[{"name":"Locator"}],"returnType":{"name":"Promise","templates":[{"name":"any"}]},"expression":"[function]([Locator]): [Promise<any>]"},"spec":[{"type":"text","text":"Function that should be run once `locator` appears. This function should get rid of the element that blocks actions like click."}],"required":true,"comment":"Function that should be run once `locator` appears. This function should get rid of the element that blocks actions\nlike click.","async":false,"alias":"handler","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.42","name":"handler","type":{"name":"function","args":[{"name":"Locator"}],"expression":"[function]([Locator])"},"spec":[{"type":"text","text":"Function that should be run once `locator` appears. This function should get rid of the element that blocks actions like click."}],"required":true,"comment":"Function that should be run once `locator` appears. This function should get rid of the element that blocks actions\nlike click.","async":false,"alias":"handler","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.44","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"By default, after calling the handler Playwright will wait until the overlay becomes hidden, and only then Playwright will continue with the action/assertion that triggered the handler. This option allows to opt-out of this behavior, so that overlay can stay visible after the handler has run."}],"required":false,"comment":"By default, after calling the handler Playwright will wait until the overlay becomes hidden, and only then\nPlaywright will continue with the action/assertion that triggered the handler. This option allows to opt-out of\nthis behavior, so that overlay can stay visible after the handler has run.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.44","name":"times","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Specifies the maximum number of times this handler should be called. Unlimited by default."}],"required":false,"comment":"Specifies the maximum number of times this handler should be called. Unlimited by default.","async":false,"alias":"times","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.44","name":"removeLocatorHandler","type":{"name":"void"},"spec":[{"type":"text","text":"Removes all locator handlers added by [`method: Page.addLocatorHandler`] for a specific locator."}],"required":true,"comment":"Removes all locator handlers added by [`method: Page.addLocatorHandler`] for a specific locator.","async":true,"alias":"removeLocatorHandler","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.44","name":"locator","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"Locator passed to [`method: Page.addLocatorHandler`]."}],"required":true,"comment":"Locator passed to [`method: Page.addLocatorHandler`].","async":false,"alias":"locator","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"reload","type":{"name":"","union":[{"name":"null"},{"name":"Response"}],"expression":"[null]|[Response]"},"spec":[{"type":"text","text":"This method reloads the current page, in the same way as if the user had triggered a browser refresh.↵Returns the main resource response. In case of multiple redirects, the navigation will resolve with the response of the↵last redirect."}],"required":true,"comment":"This method reloads the current page, in the same way as if the user had triggered a browser refresh. Returns the\nmain resource response. In case of multiple redirects, the navigation will resolve with the response of the last\nredirect.","async":true,"alias":"reload","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.↵The default value can be changed by using the↵[`method: BrowserContext.setDefaultNavigationTimeout`],↵[`method: BrowserContext.setDefaultTimeout`],↵[`method: Page.setDefaultNavigationTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `navigationTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultNavigationTimeout`],↵[`method: BrowserContext.setDefaultTimeout`],↵[`method: Page.setDefaultNavigationTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via\n`navigationTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"waitUntil","type":{"name":"WaitUntilState","union":[{"name":"\"load\""},{"name":"\"domcontentloaded\""},{"name":"\"networkidle\""},{"name":"\"commit\""}],"expression":"[WaitUntilState]<\"load\"|\"domcontentloaded\"|\"networkidle\"|\"commit\">"},"spec":[{"type":"text","text":"When to consider operation succeeded, defaults to `load`. Events can be either:"},{"type":"li","text":"`'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.","liType":"bullet"},{"type":"li","text":"`'load'` - consider operation to be finished when the `load` event is fired.","liType":"bullet"},{"type":"li","text":"`'networkidle'` - **DISCOURAGED** consider operation to be finished when there are no network connections for at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.","liType":"bullet"},{"type":"li","text":"`'commit'` - consider operation to be finished when network response is received and the document started loading.","liType":"bullet"}],"required":false,"comment":"When to consider operation succeeded, defaults to `load`. Events can be either:\n- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.\n- `'load'` - consider operation to be finished when the `load` event is fired.\n- `'networkidle'` - **DISCOURAGED** consider operation to be finished when there are no network connections for\n at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.\n- `'commit'` - consider operation to be finished when network response is received and the document started\n loading.","async":false,"alias":"waitUntil","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"property","langs":{"aliases":{"csharp":"APIRequest"},"types":{},"overrides":{}},"since":"v1.16","name":"request","type":{"name":"APIRequestContext","expression":"[APIRequestContext]"},"spec":[{"type":"text","text":"API testing helper associated with this page. This method returns the same instance as↵[`property: BrowserContext.request`] on the page's context. See [`property: BrowserContext.request`] for more details."}],"required":true,"comment":"API testing helper associated with this page. This method returns the same instance as\n[`property: BrowserContext.request`] on the page's context. See [`property: BrowserContext.request`] for more\ndetails.","async":false,"alias":"request","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"route","type":{"name":"void"},"spec":[{"type":"text","text":"Routing provides the capability to modify network requests that are made by a page."},{"type":"text","text":"Once routing is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted."},{"type":"note","noteType":"note","text":"The handler will only be called for the first url if the response is a redirect."},{"type":"note","noteType":"note","text":"[`method: Page.route`] will not intercept requests intercepted by Service Worker. See [this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when using request interception by setting `Browser.newContext.serviceWorkers` to `'block'`."},{"type":"note","noteType":"note","text":"[`method: Page.route`] will not intercept the first request of a popup page. Use [`method: BrowserContext.route`] instead."},{"type":"text","text":"**Usage**"},{"type":"text","text":"An example of a naive handler that aborts all image requests:"},{"type":"code","lines":["const page = await browser.newPage();","await page.route('**/*.{png,jpg,jpeg}', route => route.abort());","await page.goto('https://example.com');","await browser.close();"],"codeLang":"js"},{"type":"code","lines":["Page page = browser.newPage();","page.route(\"**/*.{png,jpg,jpeg}\", route -> route.abort());","page.navigate(\"https://example.com\");","browser.close();"],"codeLang":"java"},{"type":"code","lines":["page = await browser.new_page()","await page.route(\"**/*.{png,jpg,jpeg}\", lambda route: route.abort())","await page.goto(\"https://example.com\")","await browser.close()"],"codeLang":"python async"},{"type":"code","lines":["page = browser.new_page()","page.route(\"**/*.{png,jpg,jpeg}\", lambda route: route.abort())","page.goto(\"https://example.com\")","browser.close()"],"codeLang":"python sync"},{"type":"code","lines":["var page = await browser.NewPageAsync();","await page.RouteAsync(\"**/*.{png,jpg,jpeg}\", async r => await r.AbortAsync());","await page.GotoAsync(\"https://www.microsoft.com\");"],"codeLang":"csharp"},{"type":"text","text":"or the same snippet using a regex pattern instead:"},{"type":"code","lines":["const page = await browser.newPage();","await page.route(/(\\.png$)|(\\.jpg$)/, route => route.abort());","await page.goto('https://example.com');","await browser.close();"],"codeLang":"js"},{"type":"code","lines":["Page page = browser.newPage();","page.route(Pattern.compile(\"(\\\\.png$)|(\\\\.jpg$)\"),route -> route.abort());","page.navigate(\"https://example.com\");","browser.close();"],"codeLang":"java"},{"type":"code","lines":["page = await browser.new_page()","await page.route(re.compile(r\"(\\.png$)|(\\.jpg$)\"), lambda route: route.abort())","await page.goto(\"https://example.com\")","await browser.close()"],"codeLang":"python async"},{"type":"code","lines":["page = browser.new_page()","page.route(re.compile(r\"(\\.png$)|(\\.jpg$)\"), lambda route: route.abort())","page.goto(\"https://example.com\")","browser.close()"],"codeLang":"python sync"},{"type":"code","lines":["var page = await browser.NewPageAsync();","await page.RouteAsync(new Regex(\"(\\\\.png$)|(\\\\.jpg$)\"), async r => await r.AbortAsync());","await page.GotoAsync(\"https://www.microsoft.com\");"],"codeLang":"csharp"},{"type":"text","text":"It is possible to examine the request to decide the route action. For example, mocking all requests that contain some post data, and leaving all other requests as is:"},{"type":"code","lines":["await page.route('/api/**', async route => {"," if (route.request().postData().includes('my-string'))"," await route.fulfill({ body: 'mocked-data' });"," else"," await route.continue();","});"],"codeLang":"js"},{"type":"code","lines":["page.route(\"/api/**\", route -> {"," if (route.request().postData().contains(\"my-string\"))"," route.fulfill(new Route.FulfillOptions().setBody(\"mocked-data\"));"," else"," route.resume();","});"],"codeLang":"java"},{"type":"code","lines":["async def handle_route(route: Route):"," if (\"my-string\" in route.request.post_data):"," await route.fulfill(body=\"mocked-data\")"," else:"," await route.continue_()","await page.route(\"/api/**\", handle_route)"],"codeLang":"python async"},{"type":"code","lines":["def handle_route(route: Route):"," if (\"my-string\" in route.request.post_data):"," route.fulfill(body=\"mocked-data\")"," else:"," route.continue_()","page.route(\"/api/**\", handle_route)"],"codeLang":"python sync"},{"type":"code","lines":["await page.RouteAsync(\"/api/**\", async r =>","{"," if (r.Request.PostData.Contains(\"my-string\"))"," await r.FulfillAsync(new() { Body = \"mocked-data\" });"," else"," await r.ContinueAsync();","});"],"codeLang":"csharp"},{"type":"text","text":"Page routes take precedence over browser context routes (set up with [`method: BrowserContext.route`]) when request↵matches both handlers."},{"type":"text","text":"To remove a route with its handler you can use [`method: Page.unroute`]."},{"type":"note","noteType":"note","text":"Enabling routing disables http cache."}],"required":true,"comment":"Routing provides the capability to modify network requests that are made by a page.\n\nOnce routing is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or\naborted.\n\n**NOTE** The handler will only be called for the first url if the response is a redirect.\n\n**NOTE** [`method: Page.route`] will not intercept requests intercepted by Service Worker. See\n[this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when\nusing request interception by setting `Browser.newContext.serviceWorkers` to `'block'`.\n\n**NOTE** [`method: Page.route`] will not intercept the first request of a popup page. Use\n[`method: BrowserContext.route`] instead.\n\n**Usage**\n\nAn example of a naive handler that aborts all image requests:\n\n```js\nconst page = await browser.newPage();\nawait page.route('**/*.{png,jpg,jpeg}', route => route.abort());\nawait page.goto('https://example.com');\nawait browser.close();\n```\n\n```java\nPage page = browser.newPage();\npage.route(\"**/*.{png,jpg,jpeg}\", route -> route.abort());\npage.navigate(\"https://example.com\");\nbrowser.close();\n```\n\n```py\npage = await browser.new_page()\nawait page.route(\"**/*.{png,jpg,jpeg}\", lambda route: route.abort())\nawait page.goto(\"https://example.com\")\nawait browser.close()\n```\n\n```py\npage = browser.new_page()\npage.route(\"**/*.{png,jpg,jpeg}\", lambda route: route.abort())\npage.goto(\"https://example.com\")\nbrowser.close()\n```\n\n```csharp\nvar page = await browser.NewPageAsync();\nawait page.RouteAsync(\"**/*.{png,jpg,jpeg}\", async r => await r.AbortAsync());\nawait page.GotoAsync(\"https://www.microsoft.com\");\n```\n\nor the same snippet using a regex pattern instead:\n\n```js\nconst page = await browser.newPage();\nawait page.route(/(\\.png$)|(\\.jpg$)/, route => route.abort());\nawait page.goto('https://example.com');\nawait browser.close();\n```\n\n```java\nPage page = browser.newPage();\npage.route(Pattern.compile(\"(\\\\.png$)|(\\\\.jpg$)\"),route -> route.abort());\npage.navigate(\"https://example.com\");\nbrowser.close();\n```\n\n```py\npage = await browser.new_page()\nawait page.route(re.compile(r\"(\\.png$)|(\\.jpg$)\"), lambda route: route.abort())\nawait page.goto(\"https://example.com\")\nawait browser.close()\n```\n\n```py\npage = browser.new_page()\npage.route(re.compile(r\"(\\.png$)|(\\.jpg$)\"), lambda route: route.abort())\npage.goto(\"https://example.com\")\nbrowser.close()\n```\n\n```csharp\nvar page = await browser.NewPageAsync();\nawait page.RouteAsync(new Regex(\"(\\\\.png$)|(\\\\.jpg$)\"), async r => await r.AbortAsync());\nawait page.GotoAsync(\"https://www.microsoft.com\");\n```\n\nIt is possible to examine the request to decide the route action. For example, mocking all requests that contain\nsome post data, and leaving all other requests as is:\n\n```js\nawait page.route('/api/**', async route => {\n if (route.request().postData().includes('my-string'))\n await route.fulfill({ body: 'mocked-data' });\n else\n await route.continue();\n});\n```\n\n```java\npage.route(\"/api/**\", route -> {\n if (route.request().postData().contains(\"my-string\"))\n route.fulfill(new Route.FulfillOptions().setBody(\"mocked-data\"));\n else\n route.resume();\n});\n```\n\n```py\nasync def handle_route(route: Route):\n if (\"my-string\" in route.request.post_data):\n await route.fulfill(body=\"mocked-data\")\n else:\n await route.continue_()\nawait page.route(\"/api/**\", handle_route)\n```\n\n```py\ndef handle_route(route: Route):\n if (\"my-string\" in route.request.post_data):\n route.fulfill(body=\"mocked-data\")\n else:\n route.continue_()\npage.route(\"/api/**\", handle_route)\n```\n\n```csharp\nawait page.RouteAsync(\"/api/**\", async r =>\n{\n if (r.Request.PostData.Contains(\"my-string\"))\n await r.FulfillAsync(new() { Body = \"mocked-data\" });\n else\n await r.ContinueAsync();\n});\n```\n\nPage routes take precedence over browser context routes (set up with [`method: BrowserContext.route`]) when request\nmatches both handlers.\n\nTo remove a route with its handler you can use [`method: Page.unroute`].\n\n**NOTE** Enabling routing disables http cache.","async":true,"alias":"route","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"url","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"},{"name":"function","args":[{"name":"URL"}],"returnType":{"name":"boolean"}}],"expression":"[string]|[RegExp]|[function]([URL]):[boolean]"},"spec":[{"type":"text","text":"A glob pattern, regex pattern or predicate receiving [URL] to match while routing.↵When a `baseURL` via the context options was provided and the passed URL is a path,↵it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor."}],"required":true,"comment":"A glob pattern, regex pattern or predicate receiving [URL] to match while routing. When a `baseURL` via the context\noptions was provided and the passed URL is a path, it gets merged via the\n[`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"handler","type":{"name":"function","args":[{"name":"Route"},{"name":"Request"}],"returnType":{"name":"","union":[{"name":"Promise","templates":[{"name":"any"}]},{"name":"any"}]},"expression":"[function]([Route], [Request]): [Promise<any>|any]"},"spec":[{"type":"text","text":"handler function to route the request."}],"required":true,"comment":"handler function to route the request.","async":false,"alias":"handler","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"handler","type":{"name":"function","args":[{"name":"Route"}],"expression":"[function]([Route])"},"spec":[{"type":"text","text":"handler function to route the request."}],"required":true,"comment":"handler function to route the request.","async":false,"alias":"handler","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.15","name":"times","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"How often a route should be used. By default it will be used every time."}],"required":false,"comment":"How often a route should be used. By default it will be used every time.","async":false,"alias":"times","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.23","name":"routeFromHAR","type":{"name":"void"},"spec":[{"type":"text","text":"If specified the network requests that are made in the page will be served from the HAR file. Read more about [Replaying from HAR](../mock.md#replaying-from-har)."},{"type":"text","text":"Playwright will not serve requests intercepted by Service Worker from the HAR file. See [this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when using request interception by setting `Browser.newContext.serviceWorkers` to `'block'`."}],"required":true,"comment":"If specified the network requests that are made in the page will be served from the HAR file. Read more about\n[Replaying from HAR](../mock.md#replaying-from-har).\n\nPlaywright will not serve requests intercepted by Service Worker from the HAR file. See\n[this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when\nusing request interception by setting `Browser.newContext.serviceWorkers` to `'block'`.","async":true,"alias":"routeFromHAR","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.23","name":"har","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to a [HAR](http://www.softwareishard.com/blog/har-12-spec) file with prerecorded network data. If `path` is a relative path, then it is resolved relative to the current working directory."}],"required":true,"comment":"Path to a [HAR](http://www.softwareishard.com/blog/har-12-spec) file with prerecorded network data. If `path` is a\nrelative path, then it is resolved relative to the current working directory.","async":false,"alias":"har","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.23","name":"notFound","type":{"name":"HarNotFound","union":[{"name":"\"abort\""},{"name":"\"fallback\""}],"expression":"[HarNotFound]<\"abort\"|\"fallback\">"},"spec":[{"type":"li","text":"If set to 'abort' any request not found in the HAR file will be aborted.","liType":"bullet"},{"type":"li","text":"If set to 'fallback' missing requests will be sent to the network.","liType":"bullet"},{"type":"text","text":"Defaults to abort."}],"required":false,"comment":"- If set to 'abort' any request not found in the HAR file will be aborted.\n- If set to 'fallback' missing requests will be sent to the network.\n\nDefaults to abort.","async":false,"alias":"notFound","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.23","name":"update","type":{"name":"boolean","expression":"boolean"},"spec":[{"type":"text","text":"If specified, updates the given HAR with the actual network information instead of serving from file. The file is written to disk when [`method: BrowserContext.close`] is called."}],"required":false,"comment":"If specified, updates the given HAR with the actual network information instead of serving from file. The file is\nwritten to disk when [`method: BrowserContext.close`] is called.","async":false,"alias":"update","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.32","name":"updateContent","type":{"name":"RouteFromHarUpdateContentPolicy","union":[{"name":"\"embed\""},{"name":"\"attach\""}],"expression":"[RouteFromHarUpdateContentPolicy]<\"embed\"|\"attach\">"},"spec":[{"type":"text","text":"Optional setting to control resource content management. If `attach` is specified, resources are persisted as separate files or entries in the ZIP archive. If `embed` is specified, content is stored inline the HAR file."}],"required":false,"comment":"Optional setting to control resource content management. If `attach` is specified, resources are persisted as\nseparate files or entries in the ZIP archive. If `embed` is specified, content is stored inline the HAR file.","async":false,"alias":"updateContent","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.32","name":"updateMode","type":{"name":"HarMode","union":[{"name":"\"full\""},{"name":"\"minimal\""}],"expression":"[HarMode]<\"full\"|\"minimal\">"},"spec":[{"type":"text","text":"When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page, cookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`."}],"required":false,"comment":"When set to `minimal`, only record information necessary for routing from HAR. This omits sizes, timing, page,\ncookies, security and other types of HAR information that are not used when replaying from HAR. Defaults to `full`.","async":false,"alias":"updateMode","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.23","name":"url","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"A glob pattern, regular expression or predicate to match the request URL. Only requests with URL matching the pattern will be served from the HAR file. If not specified, all requests are served from the HAR file."}],"required":false,"comment":"A glob pattern, regular expression or predicate to match the request URL. Only requests with URL matching the\npattern will be served from the HAR file. If not specified, all requests are served from the HAR file.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"screenshot","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"Returns the buffer with the captured screenshot."}],"required":true,"comment":"Returns the buffer with the captured screenshot.","async":true,"alias":"screenshot","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"animations","type":{"name":"ScreenshotAnimations","union":[{"name":"\"disabled\""},{"name":"\"allow\""}],"expression":"[ScreenshotAnimations]<\"disabled\"|\"allow\">"},"spec":[{"type":"text","text":"When set to `\"disabled\"`, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment depending on their duration:"},{"type":"li","text":"finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.","liType":"bullet"},{"type":"li","text":"infinite animations are canceled to initial state, and then played over after the screenshot.","liType":"bullet"},{"type":"text","text":"Defaults to `\"allow\"` that leaves animations untouched."}],"required":false,"comment":"When set to `\"disabled\"`, stops CSS animations, CSS transitions and Web Animations. Animations get different\ntreatment depending on their duration:\n- finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.\n- infinite animations are canceled to initial state, and then played over after the screenshot.\n\nDefaults to `\"allow\"` that leaves animations untouched.","async":false,"alias":"animations","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"caret","type":{"name":"ScreenshotCaret","union":[{"name":"\"hide\""},{"name":"\"initial\""}],"expression":"[ScreenshotCaret]<\"hide\"|\"initial\">"},"spec":[{"type":"text","text":"When set to `\"hide\"`, screenshot will hide text caret. When set to `\"initial\"`, text caret behavior will not be changed. Defaults to `\"hide\"`."}],"required":false,"comment":"When set to `\"hide\"`, screenshot will hide text caret. When set to `\"initial\"`, text caret behavior will not be\nchanged. Defaults to `\"hide\"`.","async":false,"alias":"caret","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"clip","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"x-coordinate of top-left corner of clip area"}],"required":true,"comment":"x-coordinate of top-left corner of clip area","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"y-coordinate of top-left corner of clip area"}],"required":true,"comment":"y-coordinate of top-left corner of clip area","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"width of clipping area"}],"required":true,"comment":"width of clipping area","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"height of clipping area"}],"required":true,"comment":"height of clipping area","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"An object which specifies clipping of the resulting image."}],"required":false,"comment":"An object which specifies clipping of the resulting image.","async":false,"alias":"clip","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"fullPage","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Defaults to↵`false`."}],"required":false,"comment":"When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Defaults to\n`false`.","async":false,"alias":"fullPage","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"mask","type":{"name":"Array","templates":[{"name":"Locator"}],"expression":"[Array]<[Locator]>"},"spec":[{"type":"text","text":"Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with↵a pink box `#FF00FF` (customized by `maskColor`) that completely covers its bounding box."}],"required":false,"comment":"Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink\nbox `#FF00FF` (customized by `maskColor`) that completely covers its bounding box.","async":false,"alias":"mask","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.35","name":"maskColor","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Specify the color of the overlay box for masked elements, in [CSS color format](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value). Default color is pink `#FF00FF`."}],"required":false,"comment":"Specify the color of the overlay box for masked elements, in\n[CSS color format](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value). Default color is pink `#FF00FF`.","async":false,"alias":"maskColor","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"omitBackground","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images.↵Defaults to `false`."}],"required":false,"comment":"Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images.\nDefaults to `false`.","async":false,"alias":"omitBackground","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a↵relative path, then it is resolved relative to the current working directory. If no path is provided, the image won't be↵saved to the disk."}],"required":false,"comment":"The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a\nrelative path, then it is resolved relative to the current working directory. If no path is provided, the image\nwon't be saved to the disk.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"quality","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"The quality of the image, between 0-100. Not applicable to `png` images."}],"required":false,"comment":"The quality of the image, between 0-100. Not applicable to `png` images.","async":false,"alias":"quality","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"scale","type":{"name":"ScreenshotScale","union":[{"name":"\"css\""},{"name":"\"device\""}],"expression":"[ScreenshotScale]<\"css\"|\"device\">"},"spec":[{"type":"text","text":"When set to `\"css\"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this will keep screenshots small. Using `\"device\"` option will produce a single pixel per each device pixel, so screenshots of high-dpi devices will be twice as large or even larger."},{"type":"text","text":"Defaults to `\"device\"`."}],"required":false,"comment":"When set to `\"css\"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this\nwill keep screenshots small. Using `\"device\"` option will produce a single pixel per each device pixel, so\nscreenshots of high-dpi devices will be twice as large or even larger.\n\nDefaults to `\"device\"`.","async":false,"alias":"scale","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.41","name":"style","type":{"name":"string","expression":"string"},"spec":[{"type":"text","text":"Text of the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make elements invisible↵or change their properties to help you creating repeatable screenshots. This stylesheet pierces the Shadow DOM and applies↵to the inner frames."}],"required":false,"comment":"Text of the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make\nelements invisible or change their properties to help you creating repeatable screenshots. This stylesheet pierces\nthe Shadow DOM and applies to the inner frames.","async":false,"alias":"style","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"type","type":{"name":"ScreenshotType","union":[{"name":"\"png\""},{"name":"\"jpeg\""}],"expression":"[ScreenshotType]<\"png\"|\"jpeg\">"},"spec":[{"type":"text","text":"Specify screenshot type, defaults to `png`."}],"required":false,"comment":"Specify screenshot type, defaults to `png`.","async":false,"alias":"type","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.selectOption`] instead. Read more about [locators](../locators.md).","name":"selectOption","type":{"name":"Array","templates":[{"name":"string"}],"expression":"[Array]<[string]>"},"spec":[{"type":"text","text":"This method waits for an element matching `selector`, waits for [actionability](../actionability.md) checks, waits until all specified options are present in the `<select>` element and selects these options."},{"type":"text","text":"If the target element is not a `<select>` element, this method throws an error. However, if the element is inside the `<label>` element that has an associated [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be used instead."},{"type":"text","text":"Returns the array of option values that have been successfully selected."},{"type":"text","text":"Triggers a `change` and `input` event once all the provided options have been selected."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["// Single selection matching the value or label","page.selectOption('select#colors', 'blue');","","// single selection matching the label","page.selectOption('select#colors', { label: 'Blue' });","","// multiple selection","page.selectOption('select#colors', ['red', 'green', 'blue']);",""],"codeLang":"js"},{"type":"code","lines":["// Single selection matching the value or label","page.selectOption(\"select#colors\", \"blue\");","// single selection matching both the value and the label","page.selectOption(\"select#colors\", new SelectOption().setLabel(\"Blue\"));","// multiple selection","page.selectOption(\"select#colors\", new String[] {\"red\", \"green\", \"blue\"});"],"codeLang":"java"},{"type":"code","lines":["# Single selection matching the value or label","await page.select_option(\"select#colors\", \"blue\")","# single selection matching the label","await page.select_option(\"select#colors\", label=\"blue\")","# multiple selection","await page.select_option(\"select#colors\", value=[\"red\", \"green\", \"blue\"])"],"codeLang":"python async"},{"type":"code","lines":["# Single selection matching the value or label","page.select_option(\"select#colors\", \"blue\")","# single selection matching both the label","page.select_option(\"select#colors\", label=\"blue\")","# multiple selection","page.select_option(\"select#colors\", value=[\"red\", \"green\", \"blue\"])"],"codeLang":"python sync"},{"type":"code","lines":["// Single selection matching the value or label","await page.SelectOptionAsync(\"select#colors\", new[] { \"blue\" });","// single selection matching both the value and the label","await page.SelectOptionAsync(\"select#colors\", new[] { new SelectOptionValue() { Label = \"blue\" } });","// multiple","await page.SelectOptionAsync(\"select#colors\", new[] { \"red\", \"green\", \"blue\" });"],"codeLang":"csharp"}],"required":true,"comment":"This method waits for an element matching `selector`, waits for [actionability](../actionability.md) checks, waits\nuntil all specified options are present in the `<select>` element and selects these options.\n\nIf the target element is not a `<select>` element, this method throws an error. However, if the element is inside\nthe `<label>` element that has an associated\n[control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be used\ninstead.\n\nReturns the array of option values that have been successfully selected.\n\nTriggers a `change` and `input` event once all the provided options have been selected.\n\n**Usage**\n\n```js\n// Single selection matching the value or label\npage.selectOption('select#colors', 'blue');\n\n// single selection matching the label\npage.selectOption('select#colors', { label: 'Blue' });\n\n// multiple selection\npage.selectOption('select#colors', ['red', 'green', 'blue']);\n\n```\n\n```java\n// Single selection matching the value or label\npage.selectOption(\"select#colors\", \"blue\");\n// single selection matching both the value and the label\npage.selectOption(\"select#colors\", new SelectOption().setLabel(\"Blue\"));\n// multiple selection\npage.selectOption(\"select#colors\", new String[] {\"red\", \"green\", \"blue\"});\n```\n\n```py\n# Single selection matching the value or label\nawait page.select_option(\"select#colors\", \"blue\")\n# single selection matching the label\nawait page.select_option(\"select#colors\", label=\"blue\")\n# multiple selection\nawait page.select_option(\"select#colors\", value=[\"red\", \"green\", \"blue\"])\n```\n\n```py\n# Single selection matching the value or label\npage.select_option(\"select#colors\", \"blue\")\n# single selection matching both the label\npage.select_option(\"select#colors\", label=\"blue\")\n# multiple selection\npage.select_option(\"select#colors\", value=[\"red\", \"green\", \"blue\"])\n```\n\n```csharp\n// Single selection matching the value or label\nawait page.SelectOptionAsync(\"select#colors\", new[] { \"blue\" });\n// single selection matching both the value and the label\nawait page.SelectOptionAsync(\"select#colors\", new[] { new SelectOptionValue() { Label = \"blue\" } });\n// multiple\nawait page.SelectOptionAsync(\"select#colors\", new[] { \"red\", \"green\", \"blue\" });\n```\n","async":true,"alias":"selectOption","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","js","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"values","type":{"name":"","union":[{"name":"null"},{"name":"string"},{"name":"ElementHandle"},{"name":"Array","templates":[{"name":"string"}]},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Matches by `option.value`. Optional."}],"required":false,"comment":"Matches by `option.value`. Optional.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"label","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Matches by `option.label`. Optional."}],"required":false,"comment":"Matches by `option.label`. Optional.","async":false,"alias":"label","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"index","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Matches by the index. Optional."}],"required":false,"comment":"Matches by the index. Optional.","async":false,"alias":"index","overloadIndex":0,"paramOrOption":null}]},{"name":"Array","templates":[{"name":"ElementHandle"}]},{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Matches by `option.value`. Optional."}],"required":false,"comment":"Matches by `option.value`. Optional.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"label","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Matches by `option.label`. Optional."}],"required":false,"comment":"Matches by `option.label`. Optional.","async":false,"alias":"label","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"index","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Matches by the index. Optional."}],"required":false,"comment":"Matches by the index. Optional.","async":false,"alias":"index","overloadIndex":0,"paramOrOption":null}]}]}],"expression":"[null]|[string]|[ElementHandle]|[Array]<[string]>|[Object]|[Array]<[ElementHandle]>|[Array]<[Object]>"},"spec":[{"type":"text","text":"Options to select. If the `<select>` has the `multiple` attribute, all matching options are selected, otherwise only the↵first option matching one of the passed options is selected. String values are matching both values and labels. Option↵is considered matching if all specified properties match."}],"required":true,"comment":"Options to select. If the `<select>` has the `multiple` attribute, all matching options are selected, otherwise\nonly the first option matching one of the passed options is selected. String values are matching both values and\nlabels. Option is considered matching if all specified properties match.","async":false,"alias":"values","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.13","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"element","type":{"name":"","union":[{"name":"ElementHandle"},{"name":"Array","templates":[{"name":"ElementHandle"}]}],"expression":"[ElementHandle]|[Array]<[ElementHandle]>"},"spec":[{"type":"text","text":"Option elements to select. Optional."}],"required":false,"comment":"Option elements to select. Optional.","async":false,"alias":"element","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"index","type":{"name":"","union":[{"name":"int"},{"name":"Array","templates":[{"name":"int"}]}],"expression":"[int]|[Array]<[int]>"},"spec":[{"type":"text","text":"Options to select by index. Optional."}],"required":false,"comment":"Options to select by index. Optional.","async":false,"alias":"index","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"value","type":{"name":"","union":[{"name":"string"},{"name":"Array","templates":[{"name":"string"}]}],"expression":"[string]|[Array]<[string]>"},"spec":[{"type":"text","text":"Options to select by value. If the `<select>` has the `multiple` attribute, all given options are selected, otherwise↵only the first option matching one of the passed options is selected. Optional."}],"required":false,"comment":"Options to select by value. If the `<select>` has the `multiple` attribute, all given options are selected,\notherwise only the first option matching one of the passed options is selected. Optional.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"label","type":{"name":"","union":[{"name":"string"},{"name":"Array","templates":[{"name":"string"}]}],"expression":"[string]|[Array]<[string]>"},"spec":[{"type":"text","text":"Options to select by label. If the `<select>` has the `multiple` attribute, all given options are selected, otherwise↵only the first option matching one of the passed options is selected. Optional."}],"required":false,"comment":"Options to select by label. If the `<select>` has the `multiple` attribute, all given options are selected,\notherwise only the first option matching one of the passed options is selected. Optional.","async":false,"alias":"label","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.15","discouraged":"Use locator-based [`method: Locator.setChecked`] instead. Read more about [locators](../locators.md).","name":"setChecked","type":{"name":"void"},"spec":[{"type":"text","text":"This method checks or unchecks an element matching `selector` by performing the following steps:"},{"type":"li","text":"Find an element matching `selector`. If there is none, wait until a matching element is attached to↵the DOM.","liType":"ordinal"},{"type":"li","text":"Ensure that matched element is a checkbox or a radio input. If not, this method throws.","liType":"ordinal"},{"type":"li","text":"If the element already has the right checked state, this method returns immediately.","liType":"ordinal"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is↵set. If the element is detached during the checks, the whole action is retried.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.mouse`] to click in the center of the element.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.","liType":"ordinal"},{"type":"li","text":"Ensure that the element is now checked or unchecked. If not, this method throws.","liType":"ordinal"},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."}],"required":true,"comment":"This method checks or unchecks an element matching `selector` by performing the following steps:\n1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.\n1. Ensure that matched element is a checkbox or a radio input. If not, this method throws.\n1. If the element already has the right checked state, this method returns immediately.\n1. Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is set. If\n the element is detached during the checks, the whole action is retried.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.mouse`] to click in the center of the element.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n1. Ensure that the element is now checked or unchecked. If not, this method throws.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.","async":true,"alias":"setChecked","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.15","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"aliases":{"csharp":"checkedState"},"types":{},"overrides":{}},"since":"v1.15","name":"checked","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to check or uncheck the checkbox."}],"required":true,"comment":"Whether to check or uncheck the checkbox.","async":false,"alias":"checked","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.15","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.15","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.15","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.15","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.15","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.15","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.15","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"setContent","type":{"name":"void"},"spec":[{"type":"text","text":"This method internally calls [document.write()](https://developer.mozilla.org/en-US/docs/Web/API/Document/write), inheriting all its specific characteristics and behaviors."}],"required":true,"comment":"This method internally calls [document.write()](https://developer.mozilla.org/en-US/docs/Web/API/Document/write),\ninheriting all its specific characteristics and behaviors.","async":true,"alias":"setContent","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"html","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"HTML markup to assign to the page."}],"required":true,"comment":"HTML markup to assign to the page.","async":false,"alias":"html","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.↵The default value can be changed by using the↵[`method: BrowserContext.setDefaultNavigationTimeout`],↵[`method: BrowserContext.setDefaultTimeout`],↵[`method: Page.setDefaultNavigationTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `navigationTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultNavigationTimeout`],↵[`method: BrowserContext.setDefaultTimeout`],↵[`method: Page.setDefaultNavigationTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via\n`navigationTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"waitUntil","type":{"name":"WaitUntilState","union":[{"name":"\"load\""},{"name":"\"domcontentloaded\""},{"name":"\"networkidle\""},{"name":"\"commit\""}],"expression":"[WaitUntilState]<\"load\"|\"domcontentloaded\"|\"networkidle\"|\"commit\">"},"spec":[{"type":"text","text":"When to consider operation succeeded, defaults to `load`. Events can be either:"},{"type":"li","text":"`'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.","liType":"bullet"},{"type":"li","text":"`'load'` - consider operation to be finished when the `load` event is fired.","liType":"bullet"},{"type":"li","text":"`'networkidle'` - **DISCOURAGED** consider operation to be finished when there are no network connections for at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.","liType":"bullet"},{"type":"li","text":"`'commit'` - consider operation to be finished when network response is received and the document started loading.","liType":"bullet"}],"required":false,"comment":"When to consider operation succeeded, defaults to `load`. Events can be either:\n- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.\n- `'load'` - consider operation to be finished when the `load` event is fired.\n- `'networkidle'` - **DISCOURAGED** consider operation to be finished when there are no network connections for\n at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.\n- `'commit'` - consider operation to be finished when network response is received and the document started\n loading.","async":false,"alias":"waitUntil","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"setDefaultNavigationTimeout","type":{"name":"void"},"spec":[{"type":"text","text":"This setting will change the default maximum navigation time for the following methods and related shortcuts:"},{"type":"li","text":"[`method: Page.goBack`]","liType":"bullet"},{"type":"li","text":"[`method: Page.goForward`]","liType":"bullet"},{"type":"li","text":"[`method: Page.goto`]","liType":"bullet"},{"type":"li","text":"[`method: Page.reload`]","liType":"bullet"},{"type":"li","text":"[`method: Page.setContent`]","liType":"bullet"},{"type":"li","text":"[`method: Page.waitForNavigation`]","liType":"bullet"},{"type":"li","text":"[`method: Page.waitForURL`]","liType":"bullet"},{"type":"note","noteType":"note","text":"[`method: Page.setDefaultNavigationTimeout`] takes priority over [`method: Page.setDefaultTimeout`],↵[`method: BrowserContext.setDefaultTimeout`] and [`method: BrowserContext.setDefaultNavigationTimeout`]."}],"required":true,"comment":"This setting will change the default maximum navigation time for the following methods and related shortcuts:\n- [`method: Page.goBack`]\n- [`method: Page.goForward`]\n- [`method: Page.goto`]\n- [`method: Page.reload`]\n- [`method: Page.setContent`]\n- [`method: Page.waitForNavigation`]\n- [`method: Page.waitForURL`]\n\n**NOTE** [`method: Page.setDefaultNavigationTimeout`] takes priority over [`method: Page.setDefaultTimeout`],\n[`method: BrowserContext.setDefaultTimeout`] and [`method: BrowserContext.setDefaultNavigationTimeout`].","async":false,"alias":"setDefaultNavigationTimeout","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum navigation time in milliseconds"}],"required":true,"comment":"Maximum navigation time in milliseconds","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"setDefaultTimeout","type":{"name":"void"},"spec":[{"type":"text","text":"This setting will change the default maximum time for all the methods accepting `timeout` option."},{"type":"note","noteType":"note","text":"[`method: Page.setDefaultNavigationTimeout`] takes priority over [`method: Page.setDefaultTimeout`]."}],"required":true,"comment":"This setting will change the default maximum time for all the methods accepting `timeout` option.\n\n**NOTE** [`method: Page.setDefaultNavigationTimeout`] takes priority over [`method: Page.setDefaultTimeout`].","async":false,"alias":"setDefaultTimeout","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds"}],"required":true,"comment":"Maximum time in milliseconds","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"setExtraHTTPHeaders","type":{"name":"void"},"spec":[{"type":"text","text":"The extra HTTP headers will be sent with every request the page initiates."},{"type":"note","noteType":"note","text":"[`method: Page.setExtraHTTPHeaders`] does not guarantee the order of headers in the outgoing requests."}],"required":true,"comment":"The extra HTTP headers will be sent with every request the page initiates.\n\n**NOTE** [`method: Page.setExtraHTTPHeaders`] does not guarantee the order of headers in the outgoing requests.","async":true,"alias":"setExtraHTTPHeaders","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"headers","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"An object containing additional HTTP headers to be sent with every request. All header values must be strings."}],"required":true,"comment":"An object containing additional HTTP headers to be sent with every request. All header values must be strings.","async":false,"alias":"headers","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.setInputFiles`] instead. Read more about [locators](../locators.md).","name":"setInputFiles","type":{"name":"void"},"spec":[{"type":"text","text":"Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then they↵are resolved relative to the current working directory. For empty array, clears the selected files.↵For inputs with a `[webkitdirectory]` attribute, only a single directory path is supported."},{"type":"text","text":"This method expects `selector` to point to an↵[input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input). However, if the element is inside the `<label>` element that has an associated [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), targets the control instead."}],"required":true,"comment":"Sets the value of the file input to these file paths or files. If some of the `filePaths` are relative paths, then\nthey are resolved relative to the current working directory. For empty array, clears the selected files. For inputs\nwith a `[webkitdirectory]` attribute, only a single directory path is supported.\n\nThis method expects `selector` to point to an\n[input element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input). However, if the element is inside\nthe `<label>` element that has an associated\n[control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), targets the control instead.","async":true,"alias":"setInputFiles","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"files","type":{"name":"","union":[{"name":"path"},{"name":"Array","templates":[{"name":"path"}]},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]},{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File name"}],"required":true,"comment":"File name","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"mimeType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"File type"}],"required":true,"comment":"File type","async":false,"alias":"mimeType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"buffer","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"File content"}],"required":true,"comment":"File content","async":false,"alias":"buffer","overloadIndex":0,"paramOrOption":null}]}]}],"expression":"[path]|[Array]<[path]>|[Object]|[Array]<[Object]>"},"spec":[],"required":true,"comment":"","async":false,"alias":"files","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"setViewportSize","type":{"name":"void"},"spec":[{"type":"text","text":"In the case of multiple pages in a single browser, each page can have its own viewport size. However,↵[`method: Browser.newContext`] allows to set viewport size (and more) for all pages in the context at once."},{"type":"text","text":"[`method: Page.setViewportSize`] will resize the page. A lot of websites don't expect phones to change size, so you should set the↵viewport size before navigating to the page. [`method: Page.setViewportSize`] will also reset `screen` size, use [`method: Browser.newContext`] with `screen` and `viewport` parameters if you need better control of these properties."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const page = await browser.newPage();","await page.setViewportSize({"," width: 640,"," height: 480,","});","await page.goto('https://example.com');"],"codeLang":"js"},{"type":"code","lines":["Page page = browser.newPage();","page.setViewportSize(640, 480);","page.navigate(\"https://example.com\");"],"codeLang":"java"},{"type":"code","lines":["page = await browser.new_page()","await page.set_viewport_size({\"width\": 640, \"height\": 480})","await page.goto(\"https://example.com\")"],"codeLang":"python async"},{"type":"code","lines":["page = browser.new_page()","page.set_viewport_size({\"width\": 640, \"height\": 480})","page.goto(\"https://example.com\")"],"codeLang":"python sync"},{"type":"code","lines":["var page = await browser.NewPageAsync();","await page.SetViewportSizeAsync(640, 480);","await page.GotoAsync(\"https://www.microsoft.com\");"],"codeLang":"csharp"}],"required":true,"comment":"In the case of multiple pages in a single browser, each page can have its own viewport size. However,\n[`method: Browser.newContext`] allows to set viewport size (and more) for all pages in the context at once.\n\n[`method: Page.setViewportSize`] will resize the page. A lot of websites don't expect phones to change size, so you\nshould set the viewport size before navigating to the page. [`method: Page.setViewportSize`] will also reset\n`screen` size, use [`method: Browser.newContext`] with `screen` and `viewport` parameters if you need better\ncontrol of these properties.\n\n**Usage**\n\n```js\nconst page = await browser.newPage();\nawait page.setViewportSize({\n width: 640,\n height: 480,\n});\nawait page.goto('https://example.com');\n```\n\n```java\nPage page = browser.newPage();\npage.setViewportSize(640, 480);\npage.navigate(\"https://example.com\");\n```\n\n```py\npage = await browser.new_page()\nawait page.set_viewport_size({\"width\": 640, \"height\": 480})\nawait page.goto(\"https://example.com\")\n```\n\n```py\npage = browser.new_page()\npage.set_viewport_size({\"width\": 640, \"height\": 480})\npage.goto(\"https://example.com\")\n```\n\n```csharp\nvar page = await browser.NewPageAsync();\nawait page.SetViewportSizeAsync(640, 480);\nawait page.GotoAsync(\"https://www.microsoft.com\");\n```\n","async":true,"alias":"setViewportSize","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"viewportSize","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page width in pixels."}],"required":true,"comment":"page width in pixels.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page height in pixels."}],"required":true,"comment":"page height in pixels.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[],"required":true,"comment":"","async":false,"alias":"viewportSize","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.10","name":"width","type":{"name":"int","expression":"[int]"},"spec":[],"required":true,"comment":"","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.10","name":"height","type":{"name":"int","expression":"[int]"},"spec":[],"required":true,"comment":"","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.tap`] instead. Read more about [locators](../locators.md).","name":"tap","type":{"name":"void"},"spec":[{"type":"text","text":"This method taps an element matching `selector` by performing the following steps:"},{"type":"li","text":"Find an element matching `selector`. If there is none, wait until a matching element is attached to↵the DOM.","liType":"ordinal"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is↵set. If the element is detached during the checks, the whole action is retried.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.touchscreen`] to tap the center of the element, or the specified `position`.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.","liType":"ordinal"},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."},{"type":"note","noteType":"note","text":"[`method: Page.tap`] the method will throw if `hasTouch` option of the browser context is false."}],"required":true,"comment":"This method taps an element matching `selector` by performing the following steps:\n1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.\n1. Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is set. If\n the element is detached during the checks, the whole action is retried.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.touchscreen`] to tap the center of the element, or the specified `position`.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.\n\n**NOTE** [`method: Page.tap`] the method will throw if `hasTouch` option of the browser context is false.","async":true,"alias":"tap","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"modifiers","type":{"name":"Array","templates":[{"name":"KeyboardModifier","union":[{"name":"\"Alt\""},{"name":"\"Control\""},{"name":"\"ControlOrMeta\""},{"name":"\"Meta\""},{"name":"\"Shift\""}]}],"expression":"[Array]<[KeyboardModifier]<\"Alt\"|\"Control\"|\"ControlOrMeta\"|\"Meta\"|\"Shift\">>"},"spec":[{"type":"text","text":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current↵modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to \"Control\" on Windows↵and Linux and to \"Meta\" on macOS."}],"required":false,"comment":"Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores\ncurrent modifiers back. If not specified, currently pressed modifiers are used. \"ControlOrMeta\" resolves to\n\"Control\" on Windows and Linux and to \"Meta\" on macOS.","async":false,"alias":"modifiers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.textContent`] instead. Read more about [locators](../locators.md).","name":"textContent","type":{"name":"","union":[{"name":"null"},{"name":"string"}],"expression":"[null]|[string]"},"spec":[{"type":"text","text":"Returns `element.textContent`."}],"required":true,"comment":"Returns `element.textContent`.","async":true,"alias":"textContent","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"title","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Returns the page's title."}],"required":true,"comment":"Returns the page's title.","async":true,"alias":"title","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"property","langs":{},"since":"v1.8","name":"touchscreen","type":{"name":"Touchscreen","expression":"[Touchscreen]"},"spec":[],"required":true,"comment":"","async":false,"alias":"touchscreen","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","deprecated":"In most cases, you should use [`method: Locator.fill`] instead. You only need to press keys one by one if there is special keyboard handling on the page - in this case use [`method: Locator.pressSequentially`].","name":"type","type":{"name":"void"},"spec":[{"type":"text","text":"Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text. `page.type` can be used to send↵fine-grained keyboard events. To fill values in form fields, use [`method: Page.fill`]."},{"type":"text","text":"To press a special key, like `Control` or `ArrowDown`, use [`method: Keyboard.press`]."},{"type":"text","text":"**Usage**"}],"required":true,"comment":"Sends a `keydown`, `keypress`/`input`, and `keyup` event for each character in the text. `page.type` can be used to\nsend fine-grained keyboard events. To fill values in form fields, use [`method: Page.fill`].\n\nTo press a special key, like `Control` or `ArrowDown`, use [`method: Keyboard.press`].\n\n**Usage**","async":true,"alias":"type","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"text","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A text to type into a focused element."}],"required":true,"comment":"A text to type into a focused element.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"delay","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to wait between key presses in milliseconds. Defaults to 0."}],"required":false,"comment":"Time to wait between key presses in milliseconds. Defaults to 0.","async":false,"alias":"delay","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use locator-based [`method: Locator.uncheck`] instead. Read more about [locators](../locators.md).","name":"uncheck","type":{"name":"void"},"spec":[{"type":"text","text":"This method unchecks an element matching `selector` by performing the following steps:"},{"type":"li","text":"Find an element matching `selector`. If there is none, wait until a matching element is attached to↵the DOM.","liType":"ordinal"},{"type":"li","text":"Ensure that matched element is a checkbox or a radio input. If not, this method throws. If the element is already↵unchecked, this method returns immediately.","liType":"ordinal"},{"type":"li","text":"Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is↵set. If the element is detached during the checks, the whole action is retried.","liType":"ordinal"},{"type":"li","text":"Scroll the element into view if needed.","liType":"ordinal"},{"type":"li","text":"Use [`property: Page.mouse`] to click in the center of the element.","liType":"ordinal"},{"type":"li","text":"Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.","liType":"ordinal"},{"type":"li","text":"Ensure that the element is now unchecked. If not, this method throws.","liType":"ordinal"},{"type":"text","text":"When all steps combined have not finished during the specified `timeout`, this method throws a↵`TimeoutError`. Passing zero timeout disables this."}],"required":true,"comment":"This method unchecks an element matching `selector` by performing the following steps:\n1. Find an element matching `selector`. If there is none, wait until a matching element is attached to the DOM.\n1. Ensure that matched element is a checkbox or a radio input. If not, this method throws. If the element is\n already unchecked, this method returns immediately.\n1. Wait for [actionability](../actionability.md) checks on the matched element, unless `force` option is set. If\n the element is detached during the checks, the whole action is retried.\n1. Scroll the element into view if needed.\n1. Use [`property: Page.mouse`] to click in the center of the element.\n1. Wait for initiated navigations to either succeed or fail, unless `noWaitAfter` option is set.\n1. Ensure that the element is now unchecked. If not, this method throws.\n\nWhen all steps combined have not finished during the specified `timeout`, this method throws a `TimeoutError`.\nPassing zero timeout disables this.","async":true,"alias":"uncheck","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}],"required":true,"comment":"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be\nused.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"force","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`."}],"required":false,"comment":"Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.","async":false,"alias":"force","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"noWaitAfter","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can↵opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating↵to inaccessible pages. Defaults to `false`."}],"required":false,"comment":"Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You\ncan opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as\nnavigating to inaccessible pages. Defaults to `false`.","async":false,"alias":"noWaitAfter","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"position","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the↵element."}],"required":false,"comment":"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\nthe element.","async":false,"alias":"position","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"trial","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults to `false`. Useful to wait until the element is ready for the action without performing it."}],"required":false,"comment":"When set, this method only performs the [actionability](../actionability.md) checks and skips the action. Defaults\nto `false`. Useful to wait until the element is ready for the action without performing it.","async":false,"alias":"trial","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.41","name":"unrouteAll","type":{"name":"void"},"spec":[{"type":"text","text":"Removes all routes created with [`method: Page.route`] and [`method: Page.routeFromHAR`]."}],"required":true,"comment":"Removes all routes created with [`method: Page.route`] and [`method: Page.routeFromHAR`].","async":true,"alias":"unrouteAll","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js","csharp","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.41","name":"behavior","type":{"name":"UnrouteBehavior","union":[{"name":"\"wait\""},{"name":"\"ignoreErrors\""},{"name":"\"default\""}],"expression":"[UnrouteBehavior]<\"wait\"|\"ignoreErrors\"|\"default\">"},"spec":[{"type":"text","text":"Specifies whether to wait for already running handlers and what to do if they throw errors:"},{"type":"li","text":"`'default'` - do not wait for current handler calls (if any) to finish, if unrouted handler throws, it may result in unhandled error","liType":"bullet"},{"type":"li","text":"`'wait'` - wait for current handler calls (if any) to finish","liType":"bullet"},{"type":"li","text":"`'ignoreErrors'` - do not wait for current handler calls (if any) to finish, all errors thrown by the handlers after unrouting are silently caught","liType":"bullet"}],"required":false,"comment":"Specifies whether to wait for already running handlers and what to do if they throw errors:\n- `'default'` - do not wait for current handler calls (if any) to finish, if unrouted handler throws, it may\n result in unhandled error\n- `'wait'` - wait for current handler calls (if any) to finish\n- `'ignoreErrors'` - do not wait for current handler calls (if any) to finish, all errors thrown by the handlers\n after unrouting are silently caught","async":false,"alias":"behavior","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"unroute","type":{"name":"void"},"spec":[{"type":"text","text":"Removes a route created with [`method: Page.route`]. When `handler` is not specified, removes all routes for↵the `url`."}],"required":true,"comment":"Removes a route created with [`method: Page.route`]. When `handler` is not specified, removes all routes for the\n`url`.","async":true,"alias":"unroute","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"url","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"},{"name":"function","args":[{"name":"URL"}],"returnType":{"name":"boolean"}}],"expression":"[string]|[RegExp]|[function]([URL]):[boolean]"},"spec":[{"type":"text","text":"A glob pattern, regex pattern or predicate receiving [URL] to match while routing."}],"required":true,"comment":"A glob pattern, regex pattern or predicate receiving [URL] to match while routing.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"handler","type":{"name":"function","args":[{"name":"Route"},{"name":"Request"}],"returnType":{"name":"","union":[{"name":"Promise","templates":[{"name":"any"}]},{"name":"any"}]},"expression":"[function]([Route], [Request]): [Promise<any>|any]"},"spec":[{"type":"text","text":"Optional handler function to route the request."}],"required":false,"comment":"Optional handler function to route the request.","async":false,"alias":"handler","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"handler","type":{"name":"function","args":[{"name":"Route"}],"expression":"[function]([Route])"},"spec":[{"type":"text","text":"Optional handler function to route the request."}],"required":false,"comment":"Optional handler function to route the request.","async":false,"alias":"handler","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"url","type":{"name":"string","expression":"[string]"},"spec":[],"required":true,"comment":"","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"video","type":{"name":"","union":[{"name":"null"},{"name":"Video"}],"expression":"[null]|[Video]"},"spec":[{"type":"text","text":"Video object associated with this page."}],"required":true,"comment":"Video object associated with this page.","async":false,"alias":"video","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"viewportSize","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page width in pixels."}],"required":true,"comment":"page width in pixels.","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page height in pixels."}],"required":true,"comment":"page height in pixels.","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}]}],"expression":"[null]|[Object]"},"spec":[],"required":true,"comment":"","async":false,"alias":"viewportSize","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.11","name":"waitForClose","type":{"name":"Page","expression":"[Page]"},"spec":[{"type":"text","text":"Performs action and waits for the Page to close."}],"required":true,"comment":"Performs action and waits for the Page to close.","async":true,"alias":"waitForClose","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.↵The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`]."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"callback","type":{"name":"Runnable","expression":"[Runnable]"},"spec":[{"type":"text","text":"Callback that performs the action triggering the event."}],"required":true,"comment":"Callback that performs the action triggering the event.","async":false,"alias":"callback","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["java","python","csharp"],"aliases":{"python":"expect_console_message","csharp":"RunAndWaitForConsoleMessage"},"types":{"python":{"name":"EventContextManager","templates":[{"name":"ConsoleMessage"}],"expression":"[EventContextManager]<[ConsoleMessage]>"}},"overrides":{}},"since":"v1.9","name":"waitForConsoleMessage","type":{"name":"ConsoleMessage","expression":"[ConsoleMessage]"},"spec":[{"type":"text","text":"Performs action and waits for a `ConsoleMessage` to be logged by in the page. If predicate is provided, it passes↵`ConsoleMessage` value into the `predicate` function and waits for `predicate(message)` to return a truthy value.↵Will throw an error if the page is closed before the [`event: Page.console`] event is fired."}],"required":true,"comment":"Performs action and waits for a `ConsoleMessage` to be logged by in the page. If predicate is provided, it passes\n`ConsoleMessage` value into the `predicate` function and waits for `predicate(message)` to return a truthy value.\nWill throw an error if the page is closed before the [`event: Page.console`] event is fired.","async":true,"alias":"waitForConsoleMessage","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.12","name":"action","type":{"name":"Func","templates":[{"name":"Task"}],"expression":"[Func<Task>]"},"spec":[{"type":"text","text":"Action that triggers the event."}],"required":true,"comment":"Action that triggers the event.","async":false,"alias":"action","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"predicate","type":{"name":"function","args":[{"name":"ConsoleMessage"}],"returnType":{"name":"boolean"},"expression":"[function]([ConsoleMessage]):[boolean]"},"spec":[{"type":"text","text":"Receives the `ConsoleMessage` object and resolves to truthy value when the waiting should resolve."}],"required":false,"comment":"Receives the `ConsoleMessage` object and resolves to truthy value when the waiting should resolve.","async":false,"alias":"predicate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.↵The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`]."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"callback","type":{"name":"Runnable","expression":"[Runnable]"},"spec":[{"type":"text","text":"Callback that performs the action triggering the event."}],"required":true,"comment":"Callback that performs the action triggering the event.","async":false,"alias":"callback","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["java","python","csharp"],"aliases":{"python":"expect_download","csharp":"RunAndWaitForDownload"},"types":{"python":{"name":"EventContextManager","templates":[{"name":"Download"}],"expression":"[EventContextManager]<[Download]>"}},"overrides":{}},"since":"v1.9","name":"waitForDownload","type":{"name":"Download","expression":"[Download]"},"spec":[{"type":"text","text":"Performs action and waits for a new `Download`. If predicate is provided, it passes↵`Download` value into the `predicate` function and waits for `predicate(download)` to return a truthy value.↵Will throw an error if the page is closed before the download event is fired."}],"required":true,"comment":"Performs action and waits for a new `Download`. If predicate is provided, it passes `Download` value into the\n`predicate` function and waits for `predicate(download)` to return a truthy value. Will throw an error if the page\nis closed before the download event is fired.","async":true,"alias":"waitForDownload","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.12","name":"action","type":{"name":"Func","templates":[{"name":"Task"}],"expression":"[Func<Task>]"},"spec":[{"type":"text","text":"Action that triggers the event."}],"required":true,"comment":"Action that triggers the event.","async":false,"alias":"action","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"predicate","type":{"name":"function","args":[{"name":"Download"}],"returnType":{"name":"boolean"},"expression":"[function]([Download]):[boolean]"},"spec":[{"type":"text","text":"Receives the `Download` object and resolves to truthy value when the waiting should resolve."}],"required":false,"comment":"Receives the `Download` object and resolves to truthy value when the waiting should resolve.","async":false,"alias":"predicate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.↵The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`]."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"callback","type":{"name":"Runnable","expression":"[Runnable]"},"spec":[{"type":"text","text":"Callback that performs the action triggering the event."}],"required":true,"comment":"Callback that performs the action triggering the event.","async":false,"alias":"callback","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["js","python"],"aliases":{"python":"expect_event"},"types":{"python":{"name":"EventContextManager","expression":"[EventContextManager]"}},"overrides":{}},"since":"v1.8","name":"waitForEvent","type":{"name":"any","expression":"[any]"},"spec":[{"type":"text","text":"Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy↵value. Will throw an error if the page is closed before the event is fired. Returns the event data value."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["// Start waiting for download before clicking. Note no await.","const downloadPromise = page.waitForEvent('download');","await page.getByText('Download file').click();","const download = await downloadPromise;"],"codeLang":"js"},{"type":"code","lines":["async with page.expect_event(\"framenavigated\") as event_info:"," await page.get_by_role(\"button\")","frame = await event_info.value"],"codeLang":"python async"},{"type":"code","lines":["with page.expect_event(\"framenavigated\") as event_info:"," page.get_by_role(\"button\")","frame = event_info.value"],"codeLang":"python sync"}],"required":true,"comment":"Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy\nvalue. Will throw an error if the page is closed before the event is fired. Returns the event data value.\n\n**Usage**\n\n```js\n// Start waiting for download before clicking. Note no await.\nconst downloadPromise = page.waitForEvent('download');\nawait page.getByText('Download file').click();\nconst download = await downloadPromise;\n```\n\n```py\nasync with page.expect_event(\"framenavigated\") as event_info:\n await page.get_by_role(\"button\")\nframe = await event_info.value\n```\n\n```py\nwith page.expect_event(\"framenavigated\") as event_info:\n page.get_by_role(\"button\")\nframe = event_info.value\n```\n","async":true,"alias":"waitForEvent","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["js","python","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"event","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Event name, same one typically passed into `*.on(event)`."}],"required":true,"comment":"Event name, same one typically passed into `*.on(event)`.","async":false,"alias":"event","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"optionsOrPredicate","type":{"name":"","union":[{"name":"function"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"predicate","type":{"name":"function","expression":"[function]"},"spec":[{"type":"text","text":"Receives the event data and resolves to truthy value when the waiting should resolve."}],"required":true,"comment":"Receives the event data and resolves to truthy value when the waiting should resolve.","async":false,"alias":"predicate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `0` - no timeout. The default value can be changed via\n`actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]}],"expression":"[function]|[Object]"},"spec":[{"type":"text","text":"Either a predicate that receives an event or an options object. Optional."}],"required":false,"comment":"Either a predicate that receives an event or an options object. Optional.","async":false,"alias":"optionsOrPredicate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"predicate","type":{"name":"function","expression":"[function]"},"spec":[{"type":"text","text":"Receives the event data and resolves to truthy value when the waiting should resolve."}],"required":false,"comment":"Receives the event data and resolves to truthy value when the waiting should resolve.","async":false,"alias":"predicate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.↵The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`]."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["java","python","csharp"],"aliases":{"python":"expect_file_chooser","csharp":"RunAndWaitForFileChooser"},"types":{"python":{"name":"EventContextManager","templates":[{"name":"FileChooser"}],"expression":"[EventContextManager]<[FileChooser]>"}},"overrides":{}},"since":"v1.9","name":"waitForFileChooser","type":{"name":"FileChooser","expression":"[FileChooser]"},"spec":[{"type":"text","text":"Performs action and waits for a new `FileChooser` to be created. If predicate is provided, it passes↵`FileChooser` value into the `predicate` function and waits for `predicate(fileChooser)` to return a truthy value.↵Will throw an error if the page is closed before the file chooser is opened."}],"required":true,"comment":"Performs action and waits for a new `FileChooser` to be created. If predicate is provided, it passes `FileChooser`\nvalue into the `predicate` function and waits for `predicate(fileChooser)` to return a truthy value. Will throw an\nerror if the page is closed before the file chooser is opened.","async":true,"alias":"waitForFileChooser","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.12","name":"action","type":{"name":"Func","templates":[{"name":"Task"}],"expression":"[Func<Task>]"},"spec":[{"type":"text","text":"Action that triggers the event."}],"required":true,"comment":"Action that triggers the event.","async":false,"alias":"action","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"predicate","type":{"name":"function","args":[{"name":"FileChooser"}],"returnType":{"name":"boolean"},"expression":"[function]([FileChooser]):[boolean]"},"spec":[{"type":"text","text":"Receives the `FileChooser` object and resolves to truthy value when the waiting should resolve."}],"required":false,"comment":"Receives the `FileChooser` object and resolves to truthy value when the waiting should resolve.","async":false,"alias":"predicate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.↵The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`]."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"callback","type":{"name":"Runnable","expression":"[Runnable]"},"spec":[{"type":"text","text":"Callback that performs the action triggering the event."}],"required":true,"comment":"Callback that performs the action triggering the event.","async":false,"alias":"callback","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"waitForFunction","type":{"name":"JSHandle","expression":"[JSHandle]"},"spec":[{"type":"text","text":"Returns when the `expression` returns a truthy value. It resolves to a JSHandle of the truthy value."},{"type":"text","text":"**Usage**"},{"type":"text","text":"The [`method: Page.waitForFunction`] can be used to observe viewport size change:"},{"type":"code","lines":["const { webkit } = require('playwright'); // Or 'chromium' or 'firefox'.","","(async () => {"," const browser = await webkit.launch();"," const page = await browser.newPage();"," const watchDog = page.waitForFunction(() => window.innerWidth < 100);"," await page.setViewportSize({ width: 50, height: 50 });"," await watchDog;"," await browser.close();","})();"],"codeLang":"js"},{"type":"code","lines":["import com.microsoft.playwright.*;","","public class Example {"," public static void main(String[] args) {"," try (Playwright playwright = Playwright.create()) {"," BrowserType webkit = playwright.webkit();"," Browser browser = webkit.launch();"," Page page = browser.newPage();"," page.setViewportSize(50, 50);"," page.waitForFunction(\"() => window.innerWidth < 100\");"," browser.close();"," }"," }","}"],"codeLang":"java"},{"type":"code","lines":["import asyncio","from playwright.async_api import async_playwright, Playwright","","async def run(playwright: Playwright):"," webkit = playwright.webkit"," browser = await webkit.launch()"," page = await browser.new_page()"," await page.evaluate(\"window.x = 0; setTimeout(() => { window.x = 100 }, 1000);\")"," await page.wait_for_function(\"() => window.x > 0\")"," await browser.close()","","async def main():"," async with async_playwright() as playwright:"," await run(playwright)","asyncio.run(main())"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import sync_playwright, Playwright","","def run(playwright: Playwright):"," webkit = playwright.webkit"," browser = webkit.launch()"," page = browser.new_page()"," page.evaluate(\"window.x = 0; setTimeout(() => { window.x = 100 }, 1000);\")"," page.wait_for_function(\"() => window.x > 0\")"," browser.close()","","with sync_playwright() as playwright:"," run(playwright)"],"codeLang":"python sync"},{"type":"code","lines":["using Microsoft.Playwright;","using System.Threading.Tasks;","","class FrameExamples","{"," public static async Task WaitForFunction()"," {"," using var playwright = await Playwright.CreateAsync();"," await using var browser = await playwright.Webkit.LaunchAsync();"," var page = await browser.NewPageAsync();"," await page.SetViewportSizeAsync(50, 50);"," await page.MainFrame.WaitForFunctionAsync(\"window.innerWidth < 100\");"," }","}"],"codeLang":"csharp"},{"type":"text","text":"To pass an argument to the predicate of [`method: Page.waitForFunction`] function:"},{"type":"code","lines":["const selector = '.foo';","await page.waitForFunction(selector => !!document.querySelector(selector), selector);"],"codeLang":"js"},{"type":"code","lines":["String selector = \".foo\";","page.waitForFunction(\"selector => !!document.querySelector(selector)\", selector);"],"codeLang":"java"},{"type":"code","lines":["selector = \".foo\"","await page.wait_for_function(\"selector => !!document.querySelector(selector)\", selector)"],"codeLang":"python async"},{"type":"code","lines":["selector = \".foo\"","page.wait_for_function(\"selector => !!document.querySelector(selector)\", selector)"],"codeLang":"python sync"},{"type":"code","lines":["var selector = \".foo\";","await page.WaitForFunctionAsync(\"selector => !!document.querySelector(selector)\", selector);"],"codeLang":"csharp"}],"required":true,"comment":"Returns when the `expression` returns a truthy value. It resolves to a JSHandle of the truthy value.\n\n**Usage**\n\nThe [`method: Page.waitForFunction`] can be used to observe viewport size change:\n\n```js\nconst { webkit } = require('playwright'); // Or 'chromium' or 'firefox'.\n\n(async () => {\n const browser = await webkit.launch();\n const page = await browser.newPage();\n const watchDog = page.waitForFunction(() => window.innerWidth < 100);\n await page.setViewportSize({ width: 50, height: 50 });\n await watchDog;\n await browser.close();\n})();\n```\n\n```java\nimport com.microsoft.playwright.*;\n\npublic class Example {\n public static void main(String[] args) {\n try (Playwright playwright = Playwright.create()) {\n BrowserType webkit = playwright.webkit();\n Browser browser = webkit.launch();\n Page page = browser.newPage();\n page.setViewportSize(50, 50);\n page.waitForFunction(\"() => window.innerWidth < 100\");\n browser.close();\n }\n }\n}\n```\n\n```py\nimport asyncio\nfrom playwright.async_api import async_playwright, Playwright\n\nasync def run(playwright: Playwright):\n webkit = playwright.webkit\n browser = await webkit.launch()\n page = await browser.new_page()\n await page.evaluate(\"window.x = 0; setTimeout(() => { window.x = 100 }, 1000);\")\n await page.wait_for_function(\"() => window.x > 0\")\n await browser.close()\n\nasync def main():\n async with async_playwright() as playwright:\n await run(playwright)\nasyncio.run(main())\n```\n\n```py\nfrom playwright.sync_api import sync_playwright, Playwright\n\ndef run(playwright: Playwright):\n webkit = playwright.webkit\n browser = webkit.launch()\n page = browser.new_page()\n page.evaluate(\"window.x = 0; setTimeout(() => { window.x = 100 }, 1000);\")\n page.wait_for_function(\"() => window.x > 0\")\n browser.close()\n\nwith sync_playwright() as playwright:\n run(playwright)\n```\n\n```csharp\nusing Microsoft.Playwright;\nusing System.Threading.Tasks;\n\nclass FrameExamples\n{\n public static async Task WaitForFunction()\n {\n using var playwright = await Playwright.CreateAsync();\n await using var browser = await playwright.Webkit.LaunchAsync();\n var page = await browser.NewPageAsync();\n await page.SetViewportSizeAsync(50, 50);\n await page.MainFrame.WaitForFunctionAsync(\"window.innerWidth < 100\");\n }\n}\n```\n\nTo pass an argument to the predicate of [`method: Page.waitForFunction`] function:\n\n```js\nconst selector = '.foo';\nawait page.waitForFunction(selector => !!document.querySelector(selector), selector);\n```\n\n```java\nString selector = \".foo\";\npage.waitForFunction(\"selector => !!document.querySelector(selector)\", selector);\n```\n\n```py\nselector = \".foo\"\nawait page.wait_for_function(\"selector => !!document.querySelector(selector)\", selector)\n```\n\n```py\nselector = \".foo\"\npage.wait_for_function(\"selector => !!document.querySelector(selector)\", selector)\n```\n\n```csharp\nvar selector = \".foo\";\nawait page.WaitForFunctionAsync(\"selector => !!document.querySelector(selector)\", selector);\n```\n","async":true,"alias":"waitForFunction","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"overrides":{"js":{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"expression","type":{"name":"","union":[{"name":"function"},{"name":"string"}],"expression":"[function]|[string]"},"spec":[{"type":"text","text":"Function to be evaluated in the page context."}],"argsArray":[],"required":true,"comment":"Function to be evaluated in the page context.","args":{},"clazz":null,"async":false,"alias":"pageFunction","overloadIndex":0,"paramOrOption":null}}},"since":"v1.8","name":"expression","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"JavaScript expression to be evaluated in the browser context. If the expression evaluates↵to a function, the function is automatically invoked."}],"required":true,"comment":"JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the\nfunction is automatically invoked.","async":false,"alias":"expression","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"arg","type":{"name":"EvaluationArgument","expression":"[EvaluationArgument]"},"spec":[{"type":"text","text":"Optional argument to pass to `expression`."}],"required":false,"comment":"Optional argument to pass to `expression`.","async":false,"alias":"arg","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"polling","type":{"name":"","union":[{"name":"float"},{"name":"\"raf\""}],"expression":"[float]|\"raf\""},"spec":[{"type":"text","text":"If `polling` is `'raf'`, then `expression` is constantly executed in `requestAnimationFrame`↵callback. If `polling` is a number, then it is treated as an interval in milliseconds at which the function↵would be executed. Defaults to `raf`."}],"required":false,"comment":"If `polling` is `'raf'`, then `expression` is constantly executed in `requestAnimationFrame` callback. If `polling`\nis a number, then it is treated as an interval in milliseconds at which the function would be executed. Defaults to\n`raf`.","async":false,"alias":"polling","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"pollingInterval","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"If specified, then it is treated as an interval in milliseconds at which the function would be executed. By default if the option is not specified `expression` is executed in `requestAnimationFrame` callback."}],"required":false,"comment":"If specified, then it is treated as an interval in milliseconds at which the function would be executed. By default\nif the option is not specified `expression` is executed in `requestAnimationFrame` callback.","async":false,"alias":"pollingInterval","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default↵value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `0` - no timeout. The default value can be changed via\n`actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"waitForLoadState","type":{"name":"void"},"spec":[{"type":"text","text":"Returns when the required load state has been reached."},{"type":"text","text":"This resolves when the page reaches a required load state, `load` by default. The navigation must have been committed↵when this method is called. If current document has already reached the required state, resolves immediately."},{"type":"note","noteType":"note","text":"Most of the time, this method is not needed because Playwright [auto-waits before every action](../actionability.md)."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.getByRole('button').click(); // Click triggers navigation.","await page.waitForLoadState(); // The promise resolves after 'load' event."],"codeLang":"js"},{"type":"code","lines":["page.getByRole(AriaRole.BUTTON).click(); // Click triggers navigation.","page.waitForLoadState(); // The promise resolves after \"load\" event."],"codeLang":"java"},{"type":"code","lines":["await page.get_by_role(\"button\").click() # click triggers navigation.","await page.wait_for_load_state() # the promise resolves after \"load\" event."],"codeLang":"python async"},{"type":"code","lines":["page.get_by_role(\"button\").click() # click triggers navigation.","page.wait_for_load_state() # the promise resolves after \"load\" event."],"codeLang":"python sync"},{"type":"code","lines":["await page.GetByRole(AriaRole.Button).ClickAsync(); // Click triggers navigation.","await page.WaitForLoadStateAsync(); // The promise resolves after 'load' event."],"codeLang":"csharp"},{"type":"code","lines":["const popupPromise = page.waitForEvent('popup');","await page.getByRole('button').click(); // Click triggers a popup.","const popup = await popupPromise;","await popup.waitForLoadState('domcontentloaded'); // Wait for the 'DOMContentLoaded' event.","console.log(await popup.title()); // Popup is ready to use."],"codeLang":"js"},{"type":"code","lines":["Page popup = page.waitForPopup(() -> {"," page.getByRole(AriaRole.BUTTON).click(); // Click triggers a popup.","});","// Wait for the \"DOMContentLoaded\" event","popup.waitForLoadState(LoadState.DOMCONTENTLOADED);","System.out.println(popup.title()); // Popup is ready to use."],"codeLang":"java"},{"type":"code","lines":["async with page.expect_popup() as page_info:"," await page.get_by_role(\"button\").click() # click triggers a popup.","popup = await page_info.value","# Wait for the \"DOMContentLoaded\" event.","await popup.wait_for_load_state(\"domcontentloaded\")","print(await popup.title()) # popup is ready to use."],"codeLang":"python async"},{"type":"code","lines":["with page.expect_popup() as page_info:"," page.get_by_role(\"button\").click() # click triggers a popup.","popup = page_info.value","# Wait for the \"DOMContentLoaded\" event.","popup.wait_for_load_state(\"domcontentloaded\")","print(popup.title()) # popup is ready to use."],"codeLang":"python sync"},{"type":"code","lines":["var popup = await page.RunAndWaitForPopupAsync(async () =>","{"," await page.GetByRole(AriaRole.Button).ClickAsync(); // click triggers the popup","});","// Wait for the \"DOMContentLoaded\" event.","await popup.WaitForLoadStateAsync(LoadState.DOMContentLoaded);","Console.WriteLine(await popup.TitleAsync()); // popup is ready to use."],"codeLang":"csharp"}],"required":true,"comment":"Returns when the required load state has been reached.\n\nThis resolves when the page reaches a required load state, `load` by default. The navigation must have been\ncommitted when this method is called. If current document has already reached the required state, resolves\nimmediately.\n\n**NOTE** Most of the time, this method is not needed because Playwright\n[auto-waits before every action](../actionability.md).\n\n**Usage**\n\n```js\nawait page.getByRole('button').click(); // Click triggers navigation.\nawait page.waitForLoadState(); // The promise resolves after 'load' event.\n```\n\n```java\npage.getByRole(AriaRole.BUTTON).click(); // Click triggers navigation.\npage.waitForLoadState(); // The promise resolves after \"load\" event.\n```\n\n```py\nawait page.get_by_role(\"button\").click() # click triggers navigation.\nawait page.wait_for_load_state() # the promise resolves after \"load\" event.\n```\n\n```py\npage.get_by_role(\"button\").click() # click triggers navigation.\npage.wait_for_load_state() # the promise resolves after \"load\" event.\n```\n\n```csharp\nawait page.GetByRole(AriaRole.Button).ClickAsync(); // Click triggers navigation.\nawait page.WaitForLoadStateAsync(); // The promise resolves after 'load' event.\n```\n\n```js\nconst popupPromise = page.waitForEvent('popup');\nawait page.getByRole('button').click(); // Click triggers a popup.\nconst popup = await popupPromise;\nawait popup.waitForLoadState('domcontentloaded'); // Wait for the 'DOMContentLoaded' event.\nconsole.log(await popup.title()); // Popup is ready to use.\n```\n\n```java\nPage popup = page.waitForPopup(() -> {\n page.getByRole(AriaRole.BUTTON).click(); // Click triggers a popup.\n});\n// Wait for the \"DOMContentLoaded\" event\npopup.waitForLoadState(LoadState.DOMCONTENTLOADED);\nSystem.out.println(popup.title()); // Popup is ready to use.\n```\n\n```py\nasync with page.expect_popup() as page_info:\n await page.get_by_role(\"button\").click() # click triggers a popup.\npopup = await page_info.value\n# Wait for the \"DOMContentLoaded\" event.\nawait popup.wait_for_load_state(\"domcontentloaded\")\nprint(await popup.title()) # popup is ready to use.\n```\n\n```py\nwith page.expect_popup() as page_info:\n page.get_by_role(\"button\").click() # click triggers a popup.\npopup = page_info.value\n# Wait for the \"DOMContentLoaded\" event.\npopup.wait_for_load_state(\"domcontentloaded\")\nprint(popup.title()) # popup is ready to use.\n```\n\n```csharp\nvar popup = await page.RunAndWaitForPopupAsync(async () =>\n{\n await page.GetByRole(AriaRole.Button).ClickAsync(); // click triggers the popup\n});\n// Wait for the \"DOMContentLoaded\" event.\nawait popup.WaitForLoadStateAsync(LoadState.DOMContentLoaded);\nConsole.WriteLine(await popup.TitleAsync()); // popup is ready to use.\n```\n","async":true,"alias":"waitForLoadState","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"state","type":{"name":"LoadState","union":[{"name":"\"load\""},{"name":"\"domcontentloaded\""},{"name":"\"networkidle\""}],"expression":"[LoadState]<\"load\"|\"domcontentloaded\"|\"networkidle\">"},"spec":[{"type":"text","text":"Optional load state to wait for, defaults to `load`. If the state has been already reached while loading current document, the↵method resolves immediately. Can be one of:"},{"type":"li","text":"`'load'` - wait for the `load` event to be fired.","liType":"bullet"},{"type":"li","text":"`'domcontentloaded'` - wait for the `DOMContentLoaded` event to be fired.","liType":"bullet"},{"type":"li","text":"`'networkidle'` - **DISCOURAGED** wait until there are no network connections for at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.","liType":"bullet"}],"required":false,"comment":"Optional load state to wait for, defaults to `load`. If the state has been already reached while loading current\ndocument, the method resolves immediately. Can be one of:\n- `'load'` - wait for the `load` event to be fired.\n- `'domcontentloaded'` - wait for the `DOMContentLoaded` event to be fired.\n- `'networkidle'` - **DISCOURAGED** wait until there are no network connections for at least `500` ms. Don't use\n this method for testing, rely on web assertions to assess readiness instead.","async":false,"alias":"state","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.↵The default value can be changed by using the↵[`method: BrowserContext.setDefaultNavigationTimeout`],↵[`method: BrowserContext.setDefaultTimeout`],↵[`method: Page.setDefaultNavigationTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `navigationTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultNavigationTimeout`],↵[`method: BrowserContext.setDefaultTimeout`],↵[`method: Page.setDefaultNavigationTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via\n`navigationTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"python":"expect_navigation","csharp":"RunAndWaitForNavigation"},"types":{"python":{"name":"EventContextManager","templates":[{"name":"Response"}],"expression":"[EventContextManager]<[Response]>"}},"overrides":{}},"since":"v1.8","deprecated":"This method is inherently racy, please use [`method: Page.waitForURL`] instead.","name":"waitForNavigation","type":{"name":"","union":[{"name":"null"},{"name":"Response"}],"expression":"[null]|[Response]"},"spec":[{"type":"text","text":"Waits for the main frame navigation and returns the main resource response. In case of multiple redirects, the navigation↵will resolve with the response of the last redirect. In case of navigation to a different anchor or navigation due to↵History API usage, the navigation will resolve with `null`."},{"type":"text","text":"**Usage**"},{"type":"text","text":"This resolves when the page navigates to a new URL or reloads. It is useful for when you run code which will indirectly↵cause the page to navigate. e.g. The click target has an `onclick` handler that triggers navigation from a `setTimeout`.↵Consider this example:"},{"type":"code","lines":["// Start waiting for navigation before clicking. Note no await.","const navigationPromise = page.waitForNavigation();","await page.getByText('Navigate after timeout').click();","await navigationPromise;"],"codeLang":"js"},{"type":"code","lines":["// The method returns after navigation has finished","Response response = page.waitForNavigation(() -> {"," // This action triggers the navigation after a timeout."," page.getByText(\"Navigate after timeout\").click();","});"],"codeLang":"java"},{"type":"code","lines":["async with page.expect_navigation():"," # This action triggers the navigation after a timeout."," await page.get_by_text(\"Navigate after timeout\").click()","# Resolves after navigation has finished"],"codeLang":"python async"},{"type":"code","lines":["with page.expect_navigation():"," # This action triggers the navigation after a timeout."," page.get_by_text(\"Navigate after timeout\").click()","# Resolves after navigation has finished"],"codeLang":"python sync"},{"type":"code","lines":["await page.RunAndWaitForNavigationAsync(async () =>","{"," // This action triggers the navigation after a timeout."," await page.GetByText(\"Navigate after timeout\").ClickAsync();","});","","// The method continues after navigation has finished"],"codeLang":"csharp"},{"type":"note","noteType":"note","text":"Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API) to change the URL is considered↵a navigation."}],"required":true,"comment":"Waits for the main frame navigation and returns the main resource response. In case of multiple redirects, the\nnavigation will resolve with the response of the last redirect. In case of navigation to a different anchor or\nnavigation due to History API usage, the navigation will resolve with `null`.\n\n**Usage**\n\nThis resolves when the page navigates to a new URL or reloads. It is useful for when you run code which will\nindirectly cause the page to navigate. e.g. The click target has an `onclick` handler that triggers navigation from\na `setTimeout`. Consider this example:\n\n```js\n// Start waiting for navigation before clicking. Note no await.\nconst navigationPromise = page.waitForNavigation();\nawait page.getByText('Navigate after timeout').click();\nawait navigationPromise;\n```\n\n```java\n// The method returns after navigation has finished\nResponse response = page.waitForNavigation(() -> {\n // This action triggers the navigation after a timeout.\n page.getByText(\"Navigate after timeout\").click();\n});\n```\n\n```py\nasync with page.expect_navigation():\n # This action triggers the navigation after a timeout.\n await page.get_by_text(\"Navigate after timeout\").click()\n# Resolves after navigation has finished\n```\n\n```py\nwith page.expect_navigation():\n # This action triggers the navigation after a timeout.\n page.get_by_text(\"Navigate after timeout\").click()\n# Resolves after navigation has finished\n```\n\n```csharp\nawait page.RunAndWaitForNavigationAsync(async () =>\n{\n // This action triggers the navigation after a timeout.\n await page.GetByText(\"Navigate after timeout\").ClickAsync();\n});\n\n// The method continues after navigation has finished\n```\n\n**NOTE** Usage of the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API) to change the URL\nis considered a navigation.","async":true,"alias":"waitForNavigation","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.12","name":"action","type":{"name":"Func","templates":[{"name":"Task"}],"expression":"[Func<Task>]"},"spec":[{"type":"text","text":"Action that triggers the event."}],"required":true,"comment":"Action that triggers the event.","async":false,"alias":"action","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.↵The default value can be changed by using the↵[`method: BrowserContext.setDefaultNavigationTimeout`],↵[`method: BrowserContext.setDefaultTimeout`],↵[`method: Page.setDefaultNavigationTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `navigationTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultNavigationTimeout`],↵[`method: BrowserContext.setDefaultTimeout`],↵[`method: Page.setDefaultNavigationTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via\n`navigationTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"url","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"},{"name":"function","args":[{"name":"URL"}],"returnType":{"name":"boolean"}}],"expression":"[string]|[RegExp]|[function]([URL]):[boolean]"},"spec":[{"type":"text","text":"A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if↵the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly↵equal to the string."}],"required":false,"comment":"A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if\nthe parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly\nequal to the string.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"waitUntil","type":{"name":"WaitUntilState","union":[{"name":"\"load\""},{"name":"\"domcontentloaded\""},{"name":"\"networkidle\""},{"name":"\"commit\""}],"expression":"[WaitUntilState]<\"load\"|\"domcontentloaded\"|\"networkidle\"|\"commit\">"},"spec":[{"type":"text","text":"When to consider operation succeeded, defaults to `load`. Events can be either:"},{"type":"li","text":"`'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.","liType":"bullet"},{"type":"li","text":"`'load'` - consider operation to be finished when the `load` event is fired.","liType":"bullet"},{"type":"li","text":"`'networkidle'` - **DISCOURAGED** consider operation to be finished when there are no network connections for at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.","liType":"bullet"},{"type":"li","text":"`'commit'` - consider operation to be finished when network response is received and the document started loading.","liType":"bullet"}],"required":false,"comment":"When to consider operation succeeded, defaults to `load`. Events can be either:\n- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.\n- `'load'` - consider operation to be finished when the `load` event is fired.\n- `'networkidle'` - **DISCOURAGED** consider operation to be finished when there are no network connections for\n at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.\n- `'commit'` - consider operation to be finished when network response is received and the document started\n loading.","async":false,"alias":"waitUntil","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"callback","type":{"name":"Runnable","expression":"[Runnable]"},"spec":[{"type":"text","text":"Callback that performs the action triggering the event."}],"required":true,"comment":"Callback that performs the action triggering the event.","async":false,"alias":"callback","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["java","python","csharp"],"aliases":{"python":"expect_popup","csharp":"RunAndWaitForPopup"},"types":{"python":{"name":"EventContextManager","templates":[{"name":"Page"}],"expression":"[EventContextManager]<[Page]>"}},"overrides":{}},"since":"v1.9","name":"waitForPopup","type":{"name":"Page","expression":"[Page]"},"spec":[{"type":"text","text":"Performs action and waits for a popup `Page`. If predicate is provided, it passes↵[Popup] value into the `predicate` function and waits for `predicate(page)` to return a truthy value.↵Will throw an error if the page is closed before the popup event is fired."}],"required":true,"comment":"Performs action and waits for a popup `Page`. If predicate is provided, it passes [Popup] value into the\n`predicate` function and waits for `predicate(page)` to return a truthy value. Will throw an error if the page is\nclosed before the popup event is fired.","async":true,"alias":"waitForPopup","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.12","name":"action","type":{"name":"Func","templates":[{"name":"Task"}],"expression":"[Func<Task>]"},"spec":[{"type":"text","text":"Action that triggers the event."}],"required":true,"comment":"Action that triggers the event.","async":false,"alias":"action","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"predicate","type":{"name":"function","args":[{"name":"Page"}],"returnType":{"name":"boolean"},"expression":"[function]([Page]):[boolean]"},"spec":[{"type":"text","text":"Receives the `Page` object and resolves to truthy value when the waiting should resolve."}],"required":false,"comment":"Receives the `Page` object and resolves to truthy value when the waiting should resolve.","async":false,"alias":"predicate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.↵The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`]."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"callback","type":{"name":"Runnable","expression":"[Runnable]"},"spec":[{"type":"text","text":"Callback that performs the action triggering the event."}],"required":true,"comment":"Callback that performs the action triggering the event.","async":false,"alias":"callback","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"python":"expect_request","csharp":"RunAndWaitForRequest"},"types":{"python":{"name":"EventContextManager","templates":[{"name":"Request"}],"expression":"[EventContextManager]<[Request]>"}},"overrides":{}},"since":"v1.8","name":"waitForRequest","type":{"name":"Request","expression":"[Request]"},"spec":[{"type":"text","text":"Waits for the matching request and returns it. See [waiting for event](../events.md#waiting-for-event) for more details about events."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["// Start waiting for request before clicking. Note no await.","const requestPromise = page.waitForRequest('https://example.com/resource');","await page.getByText('trigger request').click();","const request = await requestPromise;","","// Alternative way with a predicate. Note no await.","const requestPromise = page.waitForRequest(request =>"," request.url() === 'https://example.com' && request.method() === 'GET',",");","await page.getByText('trigger request').click();","const request = await requestPromise;"],"codeLang":"js"},{"type":"code","lines":["// Waits for the next request with the specified url","Request request = page.waitForRequest(\"https://example.com/resource\", () -> {"," // Triggers the request"," page.getByText(\"trigger request\").click();","});","","// Waits for the next request matching some conditions","Request request = page.waitForRequest(request -> \"https://example.com\".equals(request.url()) && \"GET\".equals(request.method()), () -> {"," // Triggers the request"," page.getByText(\"trigger request\").click();","});"],"codeLang":"java"},{"type":"code","lines":["async with page.expect_request(\"http://example.com/resource\") as first:"," await page.get_by_text(\"trigger request\").click()","first_request = await first.value","","# or with a lambda","async with page.expect_request(lambda request: request.url == \"http://example.com\" and request.method == \"get\") as second:"," await page.get_by_text(\"trigger request\").click()","second_request = await second.value"],"codeLang":"python async"},{"type":"code","lines":["with page.expect_request(\"http://example.com/resource\") as first:"," page.get_by_text(\"trigger request\").click()","first_request = first.value","","# or with a lambda","with page.expect_request(lambda request: request.url == \"http://example.com\" and request.method == \"get\") as second:"," page.get_by_text(\"trigger request\").click()","second_request = second.value"],"codeLang":"python sync"},{"type":"code","lines":["// Waits for the next request with the specified url.","await page.RunAndWaitForRequestAsync(async () =>","{"," await page.GetByText(\"trigger request\").ClickAsync();","}, \"http://example.com/resource\");","","// Alternative way with a predicate.","await page.RunAndWaitForRequestAsync(async () =>","{"," await page.GetByText(\"trigger request\").ClickAsync();","}, request => request.Url == \"https://example.com\" && request.Method == \"GET\");"],"codeLang":"csharp"}],"required":true,"comment":"Waits for the matching request and returns it. See [waiting for event](../events.md#waiting-for-event) for more\ndetails about events.\n\n**Usage**\n\n```js\n// Start waiting for request before clicking. Note no await.\nconst requestPromise = page.waitForRequest('https://example.com/resource');\nawait page.getByText('trigger request').click();\nconst request = await requestPromise;\n\n// Alternative way with a predicate. Note no await.\nconst requestPromise = page.waitForRequest(request =>\n request.url() === 'https://example.com' && request.method() === 'GET',\n);\nawait page.getByText('trigger request').click();\nconst request = await requestPromise;\n```\n\n```java\n// Waits for the next request with the specified url\nRequest request = page.waitForRequest(\"https://example.com/resource\", () -> {\n // Triggers the request\n page.getByText(\"trigger request\").click();\n});\n\n// Waits for the next request matching some conditions\nRequest request = page.waitForRequest(request -> \"https://example.com\".equals(request.url()) && \"GET\".equals(request.method()), () -> {\n // Triggers the request\n page.getByText(\"trigger request\").click();\n});\n```\n\n```py\nasync with page.expect_request(\"http://example.com/resource\") as first:\n await page.get_by_text(\"trigger request\").click()\nfirst_request = await first.value\n\n# or with a lambda\nasync with page.expect_request(lambda request: request.url == \"http://example.com\" and request.method == \"get\") as second:\n await page.get_by_text(\"trigger request\").click()\nsecond_request = await second.value\n```\n\n```py\nwith page.expect_request(\"http://example.com/resource\") as first:\n page.get_by_text(\"trigger request\").click()\nfirst_request = first.value\n\n# or with a lambda\nwith page.expect_request(lambda request: request.url == \"http://example.com\" and request.method == \"get\") as second:\n page.get_by_text(\"trigger request\").click()\nsecond_request = second.value\n```\n\n```csharp\n// Waits for the next request with the specified url.\nawait page.RunAndWaitForRequestAsync(async () =>\n{\n await page.GetByText(\"trigger request\").ClickAsync();\n}, \"http://example.com/resource\");\n\n// Alternative way with a predicate.\nawait page.RunAndWaitForRequestAsync(async () =>\n{\n await page.GetByText(\"trigger request\").ClickAsync();\n}, request => request.Url == \"https://example.com\" && request.Method == \"GET\");\n```\n","async":true,"alias":"waitForRequest","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.12","name":"action","type":{"name":"Func","templates":[{"name":"Task"}],"expression":"[Func<Task>]"},"spec":[{"type":"text","text":"Action that triggers the event."}],"required":true,"comment":"Action that triggers the event.","async":false,"alias":"action","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"overrides":{"js":{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"urlOrPredicate","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"},{"name":"function","args":[{"name":"Request"}],"returnType":{"name":"","union":[{"name":"boolean"},{"name":"Promise","templates":[{"name":"boolean"}]}]}}],"expression":"[string]|[RegExp]|[function]([Request]):[boolean]|[Promise]<[boolean]>"},"spec":[{"type":"text","text":"Request URL string, regex or predicate receiving `Request` object."}],"argsArray":[],"required":true,"comment":"Request URL string, regex or predicate receiving `Request` object.","args":{},"clazz":null,"async":false,"alias":"urlOrPredicate","overloadIndex":0,"paramOrOption":null}}},"since":"v1.8","name":"urlOrPredicate","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"},{"name":"function","args":[{"name":"Request"}],"returnType":{"name":"boolean"}}],"expression":"[string]|[RegExp]|[function]([Request]):[boolean]"},"spec":[{"type":"text","text":"Request URL string, regex or predicate receiving `Request` object.↵When a `baseURL` via the context options was provided and the passed URL is a path,↵it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor."}],"required":true,"comment":"Request URL string, regex or predicate receiving `Request` object. When a `baseURL` via the context options was\nprovided and the passed URL is a path, it gets merged via the\n[`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor.","async":false,"alias":"urlOrPredicate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum wait time in milliseconds, defaults to 30 seconds, pass `0` to disable the timeout. The default value can be↵changed by using the [`method: Page.setDefaultTimeout`] method."}],"required":false,"comment":"Maximum wait time in milliseconds, defaults to 30 seconds, pass `0` to disable the timeout. The default value can\nbe changed by using the [`method: Page.setDefaultTimeout`] method.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"callback","type":{"name":"Runnable","expression":"[Runnable]"},"spec":[{"type":"text","text":"Callback that performs the action triggering the event."}],"required":true,"comment":"Callback that performs the action triggering the event.","async":false,"alias":"callback","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["java","python","csharp"],"aliases":{"python":"expect_request_finished","csharp":"RunAndWaitForRequestFinished"},"types":{"python":{"name":"EventContextManager","templates":[{"name":"Request"}],"expression":"[EventContextManager]<[Request]>"}},"overrides":{}},"since":"v1.12","name":"waitForRequestFinished","type":{"name":"Request","expression":"[Request]"},"spec":[{"type":"text","text":"Performs action and waits for a `Request` to finish loading. If predicate is provided, it passes↵`Request` value into the `predicate` function and waits for `predicate(request)` to return a truthy value.↵Will throw an error if the page is closed before the [`event: Page.requestFinished`] event is fired."}],"required":true,"comment":"Performs action and waits for a `Request` to finish loading. If predicate is provided, it passes `Request` value\ninto the `predicate` function and waits for `predicate(request)` to return a truthy value. Will throw an error if\nthe page is closed before the [`event: Page.requestFinished`] event is fired.","async":true,"alias":"waitForRequestFinished","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.12","name":"action","type":{"name":"Func","templates":[{"name":"Task"}],"expression":"[Func<Task>]"},"spec":[{"type":"text","text":"Action that triggers the event."}],"required":true,"comment":"Action that triggers the event.","async":false,"alias":"action","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.12","name":"predicate","type":{"name":"function","args":[{"name":"Request"}],"returnType":{"name":"boolean"},"expression":"[function]([Request]):[boolean]"},"spec":[{"type":"text","text":"Receives the `Request` object and resolves to truthy value when the waiting should resolve."}],"required":false,"comment":"Receives the `Request` object and resolves to truthy value when the waiting should resolve.","async":false,"alias":"predicate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.12","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.↵The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`]."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.12","name":"callback","type":{"name":"Runnable","expression":"[Runnable]"},"spec":[{"type":"text","text":"Callback that performs the action triggering the event."}],"required":true,"comment":"Callback that performs the action triggering the event.","async":false,"alias":"callback","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"python":"expect_response","csharp":"RunAndWaitForResponse"},"types":{"python":{"name":"EventContextManager","templates":[{"name":"Response"}],"expression":"[EventContextManager]<[Response]>"}},"overrides":{}},"since":"v1.8","name":"waitForResponse","type":{"name":"Response","expression":"[Response]"},"spec":[{"type":"text","text":"Returns the matched response. See [waiting for event](../events.md#waiting-for-event) for more details about events."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["// Start waiting for response before clicking. Note no await.","const responsePromise = page.waitForResponse('https://example.com/resource');","await page.getByText('trigger response').click();","const response = await responsePromise;","","// Alternative way with a predicate. Note no await.","const responsePromise = page.waitForResponse(response =>"," response.url() === 'https://example.com' && response.status() === 200"," && response.request().method() === 'GET'",");","await page.getByText('trigger response').click();","const response = await responsePromise;"],"codeLang":"js"},{"type":"code","lines":["// Waits for the next response with the specified url","Response response = page.waitForResponse(\"https://example.com/resource\", () -> {"," // Triggers the response"," page.getByText(\"trigger response\").click();","});","","// Waits for the next response matching some conditions","Response response = page.waitForResponse(response -> \"https://example.com\".equals(response.url()) && response.status() == 200 && \"GET\".equals(response.request().method()), () -> {"," // Triggers the response"," page.getByText(\"trigger response\").click();","});"],"codeLang":"java"},{"type":"code","lines":["async with page.expect_response(\"https://example.com/resource\") as response_info:"," await page.get_by_text(\"trigger response\").click()","response = await response_info.value","return response.ok","","# or with a lambda","async with page.expect_response(lambda response: response.url == \"https://example.com\" and response.status == 200 and response.request.method == \"get\") as response_info:"," await page.get_by_text(\"trigger response\").click()","response = await response_info.value","return response.ok"],"codeLang":"python async"},{"type":"code","lines":["with page.expect_response(\"https://example.com/resource\") as response_info:"," page.get_by_text(\"trigger response\").click()","response = response_info.value","return response.ok","","# or with a lambda","with page.expect_response(lambda response: response.url == \"https://example.com\" and response.status == 200 and response.request.method == \"get\") as response_info:"," page.get_by_text(\"trigger response\").click()","response = response_info.value","return response.ok"],"codeLang":"python sync"},{"type":"code","lines":["// Waits for the next response with the specified url.","await page.RunAndWaitForResponseAsync(async () =>","{"," await page.GetByText(\"trigger response\").ClickAsync();","}, \"http://example.com/resource\");","","// Alternative way with a predicate.","await page.RunAndWaitForResponseAsync(async () =>","{"," await page.GetByText(\"trigger response\").ClickAsync();","}, response => response.Url == \"https://example.com\" && response.Status == 200 && response.Request.Method == \"GET\");"],"codeLang":"csharp"}],"required":true,"comment":"Returns the matched response. See [waiting for event](../events.md#waiting-for-event) for more details about\nevents.\n\n**Usage**\n\n```js\n// Start waiting for response before clicking. Note no await.\nconst responsePromise = page.waitForResponse('https://example.com/resource');\nawait page.getByText('trigger response').click();\nconst response = await responsePromise;\n\n// Alternative way with a predicate. Note no await.\nconst responsePromise = page.waitForResponse(response =>\n response.url() === 'https://example.com' && response.status() === 200\n && response.request().method() === 'GET'\n);\nawait page.getByText('trigger response').click();\nconst response = await responsePromise;\n```\n\n```java\n// Waits for the next response with the specified url\nResponse response = page.waitForResponse(\"https://example.com/resource\", () -> {\n // Triggers the response\n page.getByText(\"trigger response\").click();\n});\n\n// Waits for the next response matching some conditions\nResponse response = page.waitForResponse(response -> \"https://example.com\".equals(response.url()) && response.status() == 200 && \"GET\".equals(response.request().method()), () -> {\n // Triggers the response\n page.getByText(\"trigger response\").click();\n});\n```\n\n```py\nasync with page.expect_response(\"https://example.com/resource\") as response_info:\n await page.get_by_text(\"trigger response\").click()\nresponse = await response_info.value\nreturn response.ok\n\n# or with a lambda\nasync with page.expect_response(lambda response: response.url == \"https://example.com\" and response.status == 200 and response.request.method == \"get\") as response_info:\n await page.get_by_text(\"trigger response\").click()\nresponse = await response_info.value\nreturn response.ok\n```\n\n```py\nwith page.expect_response(\"https://example.com/resource\") as response_info:\n page.get_by_text(\"trigger response\").click()\nresponse = response_info.value\nreturn response.ok\n\n# or with a lambda\nwith page.expect_response(lambda response: response.url == \"https://example.com\" and response.status == 200 and response.request.method == \"get\") as response_info:\n page.get_by_text(\"trigger response\").click()\nresponse = response_info.value\nreturn response.ok\n```\n\n```csharp\n// Waits for the next response with the specified url.\nawait page.RunAndWaitForResponseAsync(async () =>\n{\n await page.GetByText(\"trigger response\").ClickAsync();\n}, \"http://example.com/resource\");\n\n// Alternative way with a predicate.\nawait page.RunAndWaitForResponseAsync(async () =>\n{\n await page.GetByText(\"trigger response\").ClickAsync();\n}, response => response.Url == \"https://example.com\" && response.Status == 200 && response.Request.Method == \"GET\");\n```\n","async":true,"alias":"waitForResponse","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.12","name":"action","type":{"name":"Func","templates":[{"name":"Task"}],"expression":"[Func<Task>]"},"spec":[{"type":"text","text":"Action that triggers the event."}],"required":true,"comment":"Action that triggers the event.","async":false,"alias":"action","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"overrides":{"js":{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"urlOrPredicate","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"},{"name":"function","args":[{"name":"Response"}],"returnType":{"name":"","union":[{"name":"boolean"},{"name":"Promise","templates":[{"name":"boolean"}]}]}}],"expression":"[string]|[RegExp]|[function]([Response]):[boolean]|[Promise]<[boolean]>"},"spec":[{"type":"text","text":"Request URL string, regex or predicate receiving `Response` object.↵When a `baseURL` via the context options was provided and the passed URL is a path,↵it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor."}],"argsArray":[],"required":true,"comment":"Request URL string, regex or predicate receiving `Response` object. When a `baseURL` via the context options was\nprovided and the passed URL is a path, it gets merged via the\n[`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor.","args":{},"clazz":null,"async":false,"alias":"urlOrPredicate","overloadIndex":0,"paramOrOption":null}}},"since":"v1.8","name":"urlOrPredicate","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"},{"name":"function","args":[{"name":"Response"}],"returnType":{"name":"boolean"}}],"expression":"[string]|[RegExp]|[function]([Response]):[boolean]"},"spec":[{"type":"text","text":"Request URL string, regex or predicate receiving `Response` object.↵When a `baseURL` via the context options was provided and the passed URL is a path,↵it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor."}],"required":true,"comment":"Request URL string, regex or predicate receiving `Response` object. When a `baseURL` via the context options was\nprovided and the passed URL is a path, it gets merged via the\n[`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor.","async":false,"alias":"urlOrPredicate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum wait time in milliseconds, defaults to 30 seconds, pass `0` to disable the timeout. The default value can be↵changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum wait time in milliseconds, defaults to 30 seconds, pass `0` to disable the timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"callback","type":{"name":"Runnable","expression":"[Runnable]"},"spec":[{"type":"text","text":"Callback that performs the action triggering the event."}],"required":true,"comment":"Callback that performs the action triggering the event.","async":false,"alias":"callback","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Use web assertions that assert visibility or a locator-based [`method: Locator.waitFor`] instead.↵Read more about [locators](../locators.md).","name":"waitForSelector","type":{"name":"","union":[{"name":"null"},{"name":"ElementHandle"}],"expression":"[null]|[ElementHandle]"},"spec":[{"type":"text","text":"Returns when element specified by selector satisfies `state` option. Returns `null` if waiting for `hidden` or↵`detached`."},{"type":"note","noteType":"note","text":"Playwright automatically waits for element to be ready before performing an action. Using↵`Locator` objects and web-first assertions makes the code wait-for-selector-free."},{"type":"text","text":"Wait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become↵visible/hidden). If at the moment of calling the method `selector` already satisfies the condition, the method↵will return immediately. If the selector doesn't satisfy the condition for the `timeout` milliseconds, the↵function will throw."},{"type":"text","text":"**Usage**"},{"type":"text","text":"This method works across navigations:"},{"type":"code","lines":["const { chromium } = require('playwright'); // Or 'firefox' or 'webkit'.","","(async () => {"," const browser = await chromium.launch();"," const page = await browser.newPage();"," for (const currentURL of ['https://google.com', 'https://bbc.com']) {"," await page.goto(currentURL);"," const element = await page.waitForSelector('img');"," console.log('Loaded image: ' + await element.getAttribute('src'));"," }"," await browser.close();","})();"],"codeLang":"js"},{"type":"code","lines":["import com.microsoft.playwright.*;","","public class Example {"," public static void main(String[] args) {"," try (Playwright playwright = Playwright.create()) {"," BrowserType chromium = playwright.chromium();"," Browser browser = chromium.launch();"," Page page = browser.newPage();"," for (String currentURL : Arrays.asList(\"https://google.com\", \"https://bbc.com\")) {"," page.navigate(currentURL);"," ElementHandle element = page.waitForSelector(\"img\");"," System.out.println(\"Loaded image: \" + element.getAttribute(\"src\"));"," }"," browser.close();"," }"," }","}"],"codeLang":"java"},{"type":"code","lines":["import asyncio","from playwright.async_api import async_playwright, Playwright","","async def run(playwright: Playwright):"," chromium = playwright.chromium"," browser = await chromium.launch()"," page = await browser.new_page()"," for current_url in [\"https://google.com\", \"https://bbc.com\"]:"," await page.goto(current_url, wait_until=\"domcontentloaded\")"," element = await page.wait_for_selector(\"img\")"," print(\"Loaded image: \" + str(await element.get_attribute(\"src\")))"," await browser.close()","","async def main():"," async with async_playwright() as playwright:"," await run(playwright)","asyncio.run(main())"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import sync_playwright, Playwright","","def run(playwright: Playwright):"," chromium = playwright.chromium"," browser = chromium.launch()"," page = browser.new_page()"," for current_url in [\"https://google.com\", \"https://bbc.com\"]:"," page.goto(current_url, wait_until=\"domcontentloaded\")"," element = page.wait_for_selector(\"img\")"," print(\"Loaded image: \" + str(element.get_attribute(\"src\")))"," browser.close()","","with sync_playwright() as playwright:"," run(playwright)"],"codeLang":"python sync"},{"type":"code","lines":["using Microsoft.Playwright;","using System;","using System.Threading.Tasks;","","class FrameExamples","{"," public static async Task Images()"," {"," using var playwright = await Playwright.CreateAsync();"," await using var browser = await playwright.Chromium.LaunchAsync();"," var page = await browser.NewPageAsync();",""," foreach (var currentUrl in new[] { \"https://www.google.com\", \"https://bbc.com\" })"," {"," await page.GotoAsync(currentUrl);"," var element = await page.WaitForSelectorAsync(\"img\");"," Console.WriteLine($\"Loaded image: {await element.GetAttributeAsync(\"src\")}\");"," }",""," await browser.CloseAsync();"," }","}"],"codeLang":"csharp"}],"required":true,"comment":"Returns when element specified by selector satisfies `state` option. Returns `null` if waiting for `hidden` or\n`detached`.\n\n**NOTE** Playwright automatically waits for element to be ready before performing an action. Using `Locator`\nobjects and web-first assertions makes the code wait-for-selector-free.\n\nWait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If\nat the moment of calling the method `selector` already satisfies the condition, the method will return immediately.\nIf the selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.\n\n**Usage**\n\nThis method works across navigations:\n\n```js\nconst { chromium } = require('playwright'); // Or 'firefox' or 'webkit'.\n\n(async () => {\n const browser = await chromium.launch();\n const page = await browser.newPage();\n for (const currentURL of ['https://google.com', 'https://bbc.com']) {\n await page.goto(currentURL);\n const element = await page.waitForSelector('img');\n console.log('Loaded image: ' + await element.getAttribute('src'));\n }\n await browser.close();\n})();\n```\n\n```java\nimport com.microsoft.playwright.*;\n\npublic class Example {\n public static void main(String[] args) {\n try (Playwright playwright = Playwright.create()) {\n BrowserType chromium = playwright.chromium();\n Browser browser = chromium.launch();\n Page page = browser.newPage();\n for (String currentURL : Arrays.asList(\"https://google.com\", \"https://bbc.com\")) {\n page.navigate(currentURL);\n ElementHandle element = page.waitForSelector(\"img\");\n System.out.println(\"Loaded image: \" + element.getAttribute(\"src\"));\n }\n browser.close();\n }\n }\n}\n```\n\n```py\nimport asyncio\nfrom playwright.async_api import async_playwright, Playwright\n\nasync def run(playwright: Playwright):\n chromium = playwright.chromium\n browser = await chromium.launch()\n page = await browser.new_page()\n for current_url in [\"https://google.com\", \"https://bbc.com\"]:\n await page.goto(current_url, wait_until=\"domcontentloaded\")\n element = await page.wait_for_selector(\"img\")\n print(\"Loaded image: \" + str(await element.get_attribute(\"src\")))\n await browser.close()\n\nasync def main():\n async with async_playwright() as playwright:\n await run(playwright)\nasyncio.run(main())\n```\n\n```py\nfrom playwright.sync_api import sync_playwright, Playwright\n\ndef run(playwright: Playwright):\n chromium = playwright.chromium\n browser = chromium.launch()\n page = browser.new_page()\n for current_url in [\"https://google.com\", \"https://bbc.com\"]:\n page.goto(current_url, wait_until=\"domcontentloaded\")\n element = page.wait_for_selector(\"img\")\n print(\"Loaded image: \" + str(element.get_attribute(\"src\")))\n browser.close()\n\nwith sync_playwright() as playwright:\n run(playwright)\n```\n\n```csharp\nusing Microsoft.Playwright;\nusing System;\nusing System.Threading.Tasks;\n\nclass FrameExamples\n{\n public static async Task Images()\n {\n using var playwright = await Playwright.CreateAsync();\n await using var browser = await playwright.Chromium.LaunchAsync();\n var page = await browser.NewPageAsync();\n\n foreach (var currentUrl in new[] { \"https://www.google.com\", \"https://bbc.com\" })\n {\n await page.GotoAsync(currentUrl);\n var element = await page.WaitForSelectorAsync(\"img\");\n Console.WriteLine($\"Loaded image: {await element.GetAttributeAsync(\"src\")}\");\n }\n\n await browser.CloseAsync();\n }\n}\n```\n","async":true,"alias":"waitForSelector","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"selector","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A selector to query for."}],"required":true,"comment":"A selector to query for.","async":false,"alias":"selector","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"state","type":{"name":"WaitForSelectorState","union":[{"name":"\"attached\""},{"name":"\"detached\""},{"name":"\"visible\""},{"name":"\"hidden\""}],"expression":"[WaitForSelectorState]<\"attached\"|\"detached\"|\"visible\"|\"hidden\">"},"spec":[{"type":"text","text":"Defaults to `'visible'`. Can be either:"},{"type":"li","text":"`'attached'` - wait for element to be present in DOM.","liType":"bullet"},{"type":"li","text":"`'detached'` - wait for element to not be present in DOM.","liType":"bullet"},{"type":"li","text":"`'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element without↵any content or with `display:none` has an empty bounding box and is not considered visible.","liType":"bullet"},{"type":"li","text":"`'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or `visibility:hidden`.↵This is opposite to the `'visible'` option.","liType":"bullet"}],"required":false,"comment":"Defaults to `'visible'`. Can be either:\n- `'attached'` - wait for element to be present in DOM.\n- `'detached'` - wait for element to not be present in DOM.\n- `'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element\n without any content or with `display:none` has an empty bounding box and is not considered visible.\n- `'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or\n `visibility:hidden`. This is opposite to the `'visible'` option.","async":false,"alias":"state","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.14","name":"strict","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, the call requires selector to resolve to a single element. If given selector resolves to more↵than one element, the call throws an exception."}],"required":false,"comment":"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one\nelement, the call throws an exception.","async":false,"alias":"strict","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by↵using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`\noption in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.32","name":"waitForCondition","type":{"name":"void"},"spec":[{"type":"text","text":"The method will block until the condition returns true. All Playwright events will↵be dispatched while the method is waiting for the condition."},{"type":"text","text":"**Usage**"},{"type":"text","text":"Use the method to wait for a condition that depends on page events:"},{"type":"code","lines":["List<String> messages = new ArrayList<>();","page.onConsoleMessage(m -> messages.add(m.text()));","page.getByText(\"Submit button\").click();","page.waitForCondition(() -> messages.size() > 3);"],"codeLang":"java"}],"required":true,"comment":"The method will block until the condition returns true. All Playwright events will be dispatched while the method\nis waiting for the condition.\n\n**Usage**\n\nUse the method to wait for a condition that depends on page events:\n\n```java\nList<String> messages = new ArrayList<>();\npage.onConsoleMessage(m -> messages.add(m.text()));\npage.getByText(\"Submit button\").click();\npage.waitForCondition(() -> messages.size() > 3);\n```\n","async":true,"alias":"waitForCondition","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.32","name":"condition","type":{"name":"BooleanSupplier","expression":"[BooleanSupplier]"},"spec":[{"type":"text","text":"Condition to wait for."}],"required":true,"comment":"Condition to wait for.","async":false,"alias":"condition","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.32","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default↵value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","discouraged":"Never wait for timeout in production. Tests that wait for time are↵inherently flaky. Use `Locator` actions and web assertions that wait automatically.","name":"waitForTimeout","type":{"name":"void"},"spec":[{"type":"text","text":"Waits for the given `timeout` in milliseconds."},{"type":"text","text":"Note that `page.waitForTimeout()` should only be used for debugging. Tests using the timer in production are going to be↵flaky. Use signals such as network events, selectors becoming visible and others instead."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["// wait for 1 second","await page.waitForTimeout(1000);"],"codeLang":"js"},{"type":"code","lines":["// wait for 1 second","page.waitForTimeout(1000);"],"codeLang":"java"},{"type":"code","lines":["# wait for 1 second","await page.wait_for_timeout(1000)"],"codeLang":"python async"},{"type":"code","lines":["# wait for 1 second","page.wait_for_timeout(1000)"],"codeLang":"python sync"},{"type":"code","lines":["// Wait for 1 second","await page.WaitForTimeoutAsync(1000);"],"codeLang":"csharp"}],"required":true,"comment":"Waits for the given `timeout` in milliseconds.\n\nNote that `page.waitForTimeout()` should only be used for debugging. Tests using the timer in production are going\nto be flaky. Use signals such as network events, selectors becoming visible and others instead.\n\n**Usage**\n\n```js\n// wait for 1 second\nawait page.waitForTimeout(1000);\n```\n\n```java\n// wait for 1 second\npage.waitForTimeout(1000);\n```\n\n```py\n# wait for 1 second\nawait page.wait_for_timeout(1000)\n```\n\n```py\n# wait for 1 second\npage.wait_for_timeout(1000)\n```\n\n```csharp\n// Wait for 1 second\nawait page.WaitForTimeoutAsync(1000);\n```\n","async":true,"alias":"waitForTimeout","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"A timeout to wait for"}],"required":true,"comment":"A timeout to wait for","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.11","name":"waitForURL","type":{"name":"void"},"spec":[{"type":"text","text":"Waits for the main frame to navigate to the given URL."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.click('a.delayed-navigation'); // Clicking the link will indirectly cause a navigation","await page.waitForURL('**/target.html');"],"codeLang":"js"},{"type":"code","lines":["page.click(\"a.delayed-navigation\"); // Clicking the link will indirectly cause a navigation","page.waitForURL(\"**/target.html\");"],"codeLang":"java"},{"type":"code","lines":["await page.click(\"a.delayed-navigation\") # clicking the link will indirectly cause a navigation","await page.wait_for_url(\"**/target.html\")"],"codeLang":"python async"},{"type":"code","lines":["page.click(\"a.delayed-navigation\") # clicking the link will indirectly cause a navigation","page.wait_for_url(\"**/target.html\")"],"codeLang":"python sync"},{"type":"code","lines":["await page.ClickAsync(\"a.delayed-navigation\"); // clicking the link will indirectly cause a navigation","await page.WaitForURLAsync(\"**/target.html\");"],"codeLang":"csharp"}],"required":true,"comment":"Waits for the main frame to navigate to the given URL.\n\n**Usage**\n\n```js\nawait page.click('a.delayed-navigation'); // Clicking the link will indirectly cause a navigation\nawait page.waitForURL('**/target.html');\n```\n\n```java\npage.click(\"a.delayed-navigation\"); // Clicking the link will indirectly cause a navigation\npage.waitForURL(\"**/target.html\");\n```\n\n```py\nawait page.click(\"a.delayed-navigation\") # clicking the link will indirectly cause a navigation\nawait page.wait_for_url(\"**/target.html\")\n```\n\n```py\npage.click(\"a.delayed-navigation\") # clicking the link will indirectly cause a navigation\npage.wait_for_url(\"**/target.html\")\n```\n\n```csharp\nawait page.ClickAsync(\"a.delayed-navigation\"); // clicking the link will indirectly cause a navigation\nawait page.WaitForURLAsync(\"**/target.html\");\n```\n","async":true,"alias":"waitForURL","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.11","name":"url","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"},{"name":"function","args":[{"name":"URL"}],"returnType":{"name":"boolean"}}],"expression":"[string]|[RegExp]|[function]([URL]):[boolean]"},"spec":[{"type":"text","text":"A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if↵the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly↵equal to the string."}],"required":true,"comment":"A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if\nthe parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly\nequal to the string.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["python","java","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.11","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.↵The default value can be changed by using the↵[`method: BrowserContext.setDefaultNavigationTimeout`],↵[`method: BrowserContext.setDefaultTimeout`],↵[`method: Page.setDefaultNavigationTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can\nbe changed by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.11","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `navigationTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultNavigationTimeout`],↵[`method: BrowserContext.setDefaultTimeout`],↵[`method: Page.setDefaultNavigationTimeout`] or↵[`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum operation time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via\n`navigationTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultNavigationTimeout`],\n[`method: BrowserContext.setDefaultTimeout`], [`method: Page.setDefaultNavigationTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.11","name":"waitUntil","type":{"name":"WaitUntilState","union":[{"name":"\"load\""},{"name":"\"domcontentloaded\""},{"name":"\"networkidle\""},{"name":"\"commit\""}],"expression":"[WaitUntilState]<\"load\"|\"domcontentloaded\"|\"networkidle\"|\"commit\">"},"spec":[{"type":"text","text":"When to consider operation succeeded, defaults to `load`. Events can be either:"},{"type":"li","text":"`'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.","liType":"bullet"},{"type":"li","text":"`'load'` - consider operation to be finished when the `load` event is fired.","liType":"bullet"},{"type":"li","text":"`'networkidle'` - **DISCOURAGED** consider operation to be finished when there are no network connections for at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.","liType":"bullet"},{"type":"li","text":"`'commit'` - consider operation to be finished when network response is received and the document started loading.","liType":"bullet"}],"required":false,"comment":"When to consider operation succeeded, defaults to `load`. Events can be either:\n- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.\n- `'load'` - consider operation to be finished when the `load` event is fired.\n- `'networkidle'` - **DISCOURAGED** consider operation to be finished when there are no network connections for\n at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.\n- `'commit'` - consider operation to be finished when network response is received and the document started\n loading.","async":false,"alias":"waitUntil","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["java","python","csharp"],"aliases":{"python":"expect_websocket","csharp":"RunAndWaitForWebSocket"},"types":{"python":{"name":"EventContextManager","templates":[{"name":"WebSocket"}],"expression":"[EventContextManager]<[WebSocket]>"}},"overrides":{}},"since":"v1.9","name":"waitForWebSocket","type":{"name":"WebSocket","expression":"[WebSocket]"},"spec":[{"type":"text","text":"Performs action and waits for a new `WebSocket`. If predicate is provided, it passes↵`WebSocket` value into the `predicate` function and waits for `predicate(webSocket)` to return a truthy value.↵Will throw an error if the page is closed before the WebSocket event is fired."}],"required":true,"comment":"Performs action and waits for a new `WebSocket`. If predicate is provided, it passes `WebSocket` value into the\n`predicate` function and waits for `predicate(webSocket)` to return a truthy value. Will throw an error if the page\nis closed before the WebSocket event is fired.","async":true,"alias":"waitForWebSocket","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.12","name":"action","type":{"name":"Func","templates":[{"name":"Task"}],"expression":"[Func<Task>]"},"spec":[{"type":"text","text":"Action that triggers the event."}],"required":true,"comment":"Action that triggers the event.","async":false,"alias":"action","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"predicate","type":{"name":"function","args":[{"name":"WebSocket"}],"returnType":{"name":"boolean"},"expression":"[function]([WebSocket]):[boolean]"},"spec":[{"type":"text","text":"Receives the `WebSocket` object and resolves to truthy value when the waiting should resolve."}],"required":false,"comment":"Receives the `WebSocket` object and resolves to truthy value when the waiting should resolve.","async":false,"alias":"predicate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.↵The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`]."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"callback","type":{"name":"Runnable","expression":"[Runnable]"},"spec":[{"type":"text","text":"Callback that performs the action triggering the event."}],"required":true,"comment":"Callback that performs the action triggering the event.","async":false,"alias":"callback","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["java","python","csharp"],"aliases":{"python":"expect_worker","csharp":"RunAndWaitForWorker"},"types":{"python":{"name":"EventContextManager","templates":[{"name":"Worker"}],"expression":"[EventContextManager]<[Worker]>"}},"overrides":{}},"since":"v1.9","name":"waitForWorker","type":{"name":"Worker","expression":"[Worker]"},"spec":[{"type":"text","text":"Performs action and waits for a new `Worker`. If predicate is provided, it passes↵`Worker` value into the `predicate` function and waits for `predicate(worker)` to return a truthy value.↵Will throw an error if the page is closed before the worker event is fired."}],"required":true,"comment":"Performs action and waits for a new `Worker`. If predicate is provided, it passes `Worker` value into the\n`predicate` function and waits for `predicate(worker)` to return a truthy value. Will throw an error if the page is\nclosed before the worker event is fired.","async":true,"alias":"waitForWorker","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.12","name":"action","type":{"name":"Func","templates":[{"name":"Task"}],"expression":"[Func<Task>]"},"spec":[{"type":"text","text":"Action that triggers the event."}],"required":true,"comment":"Action that triggers the event.","async":false,"alias":"action","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"predicate","type":{"name":"function","args":[{"name":"Worker"}],"returnType":{"name":"boolean"},"expression":"[function]([Worker]):[boolean]"},"spec":[{"type":"text","text":"Receives the `Worker` object and resolves to truthy value when the waiting should resolve."}],"required":false,"comment":"Receives the `Worker` object and resolves to truthy value when the waiting should resolve.","async":false,"alias":"predicate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.↵The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`]."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"callback","type":{"name":"Runnable","expression":"[Runnable]"},"spec":[{"type":"text","text":"Callback that performs the action triggering the event."}],"required":true,"comment":"Callback that performs the action triggering the event.","async":false,"alias":"callback","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"workers","type":{"name":"Array","templates":[{"name":"Worker"}],"expression":"[Array]<[Worker]>"},"spec":[{"type":"text","text":"This method returns all of the dedicated [WebWorkers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API)↵associated with the page."},{"type":"note","noteType":"note","text":"This does not contain ServiceWorkers"}],"required":true,"comment":"This method returns all of the dedicated\n[WebWorkers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) associated with the page.\n\n**NOTE** This does not contain ServiceWorkers","async":false,"alias":"workers","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"only":["python"],"aliases":{"python":"wait_for_event"},"types":{},"overrides":{}},"since":"v1.8","name":"waitForEvent2","type":{"name":"any","expression":"[any]"},"spec":[{"type":"note","noteType":"note","text":"In most cases, you should use [`method: Page.waitForEvent`]."},{"type":"text","text":"Waits for given `event` to fire. If predicate is provided, it passes↵event's value into the `predicate` function and waits for `predicate(event)` to return a truthy value.↵Will throw an error if the page is closed before the `event` is fired."}],"required":true,"comment":"**NOTE** In most cases, you should use [`method: Page.waitForEvent`].\n\nWaits for given `event` to fire. If predicate is provided, it passes event's value into the `predicate` function\nand waits for `predicate(event)` to return a truthy value. Will throw an error if the page is closed before the\n`event` is fired.","async":true,"alias":"waitForEvent2","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["js","python","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"event","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Event name, same one typically passed into `*.on(event)`."}],"required":true,"comment":"Event name, same one typically passed into `*.on(event)`.","async":false,"alias":"event","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"predicate","type":{"name":"function","expression":"[function]"},"spec":[{"type":"text","text":"Receives the event data and resolves to truthy value when the waiting should resolve."}],"required":false,"comment":"Receives the event data and resolves to truthy value when the waiting should resolve.","async":false,"alias":"predicate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.↵The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`]."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]}]},{"name":"PageAssertions","spec":[{"type":"text","text":"The `PageAssertions` class provides assertion methods that can be used to make assertions about the `Page` state in the tests."},{"type":"code","lines":["import { test, expect } from '@playwright/test';","","test('navigates to login', async ({ page }) => {"," // ..."," await page.getByText('Sign in').click();"," await expect(page).toHaveURL(/.*\\/login/);","});"],"codeLang":"js"},{"type":"code","lines":["...","import static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;","","public class TestPage {"," ..."," @Test"," void navigatesToLoginPage() {"," ..."," page.getByText(\"Sign in\").click();"," assertThat(page).hasURL(Pattern.compile(\".*/login\"));"," }","}"],"codeLang":"java"},{"type":"code","lines":["import re","from playwright.async_api import Page, expect","","async def test_navigates_to_login_page(page: Page) -> None:"," # .."," await page.get_by_text(\"Sign in\").click()"," await expect(page).to_have_url(re.compile(r\".*/login\"))"],"codeLang":"python async"},{"type":"code","lines":["import re","from playwright.sync_api import Page, expect","","def test_navigates_to_login_page(page: Page) -> None:"," # .."," page.get_by_text(\"Sign in\").click()"," expect(page).to_have_url(re.compile(r\".*/login\"))"],"codeLang":"python sync"},{"type":"code","lines":["using System.Text.RegularExpressions;","using Microsoft.Playwright;","using Microsoft.Playwright.MSTest;","","namespace PlaywrightTests;","","[TestClass]","public class ExampleTests : PageTest","{"," [TestMethod]"," public async Task NavigatetoLoginPage()"," {"," await Page.GetByRole(AriaRole.Button, new() { Name = \"Sign In\" }).ClickAsync();"," await Expect(Page).ToHaveURLAsync(new Regex(\".*/login\"));"," }","}"],"codeLang":"csharp"}],"langs":{},"comment":"The `PageAssertions` class provides assertion methods that can be used to make assertions about the `Page` state in\nthe tests.\n\n```js\nimport { test, expect } from '@playwright/test';\n\ntest('navigates to login', async ({ page }) => {\n // ...\n await page.getByText('Sign in').click();\n await expect(page).toHaveURL(/.*\\/login/);\n});\n```\n\n```java\n...\nimport static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;\n\npublic class TestPage {\n ...\n @Test\n void navigatesToLoginPage() {\n ...\n page.getByText(\"Sign in\").click();\n assertThat(page).hasURL(Pattern.compile(\".*/login\"));\n }\n}\n```\n\n```py\nimport re\nfrom playwright.async_api import Page, expect\n\nasync def test_navigates_to_login_page(page: Page) -> None:\n # ..\n await page.get_by_text(\"Sign in\").click()\n await expect(page).to_have_url(re.compile(r\".*/login\"))\n```\n\n```py\nimport re\nfrom playwright.sync_api import Page, expect\n\ndef test_navigates_to_login_page(page: Page) -> None:\n # ..\n page.get_by_text(\"Sign in\").click()\n expect(page).to_have_url(re.compile(r\".*/login\"))\n```\n\n```csharp\nusing System.Text.RegularExpressions;\nusing Microsoft.Playwright;\nusing Microsoft.Playwright.MSTest;\n\nnamespace PlaywrightTests;\n\n[TestClass]\npublic class ExampleTests : PageTest\n{\n [TestMethod]\n public async Task NavigatetoLoginPage()\n {\n await Page.GetByRole(AriaRole.Button, new() { Name = \"Sign In\" }).ClickAsync();\n await Expect(Page).ToHaveURLAsync(new Regex(\".*/login\"));\n }\n}\n```\n","since":"v1.17","members":[{"kind":"property","langs":{"only":["java","js","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.20","name":"not","type":{"name":"PageAssertions","expression":"[PageAssertions]"},"spec":[{"type":"text","text":"Makes the assertion check for the opposite condition. For example, this code tests that the page URL doesn't contain `\"error\"`:"},{"type":"code","lines":["await expect(page).not.toHaveURL('error');"],"codeLang":"js"},{"type":"code","lines":["assertThat(page).not().hasURL(\"error\");"],"codeLang":"java"},{"type":"code","lines":["await Expect(Page).Not.ToHaveURL(\"error\");"],"codeLang":"csharp"}],"required":true,"comment":"Makes the assertion check for the opposite condition. For example, this code tests that the page URL doesn't\ncontain `\"error\"`:\n\n```js\nawait expect(page).not.toHaveURL('error');\n```\n\n```java\nassertThat(page).not().hasURL(\"error\");\n```\n\n```csharp\nawait Expect(Page).Not.ToHaveURL(\"error\");\n```\n","async":false,"alias":"not","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.20","name":"NotToHaveTitle","type":{"name":"void"},"spec":[{"type":"text","text":"The opposite of [`method: PageAssertions.toHaveTitle`]."}],"required":true,"comment":"The opposite of [`method: PageAssertions.toHaveTitle`].","async":true,"alias":"NotToHaveTitle","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"titleOrRegExp","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Expected title or RegExp."}],"required":true,"comment":"Expected title or RegExp.","async":false,"alias":"titleOrRegExp","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["python"],"aliases":{"java":"hasURL"},"types":{},"overrides":{}},"since":"v1.20","name":"NotToHaveURL","type":{"name":"void"},"spec":[{"type":"text","text":"The opposite of [`method: PageAssertions.toHaveURL`]."}],"required":true,"comment":"The opposite of [`method: PageAssertions.toHaveURL`].","async":true,"alias":"NotToHaveURL","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"urlOrRegExp","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Expected URL string or RegExp."}],"required":true,"comment":"Expected URL string or RegExp.","async":false,"alias":"urlOrRegExp","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.44","name":"ignoreCase","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular expression flag if specified."}],"required":false,"comment":"Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular\nexpression flag if specified.","async":false,"alias":"ignoreCase","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"toHaveScreenshot#1","type":{"name":"void"},"spec":[{"type":"text","text":"This function will wait until two consecutive page screenshots↵yield the same result, and then compare the last screenshot with the expectation."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await expect(page).toHaveScreenshot('image.png');"],"codeLang":"js"},{"type":"text","text":"Note that screenshot assertions only work with Playwright test runner."}],"required":true,"comment":"This function will wait until two consecutive page screenshots yield the same result, and then compare the last\nscreenshot with the expectation.\n\n**Usage**\n\n```js\nawait expect(page).toHaveScreenshot('image.png');\n```\n\nNote that screenshot assertions only work with Playwright test runner.","async":true,"alias":"toHaveScreenshot","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.23","name":"name","type":{"name":"","union":[{"name":"string"},{"name":"Array","templates":[{"name":"string"}]}],"expression":"[string]|[Array]<[string]>"},"spec":[{"type":"text","text":"Snapshot name."}],"required":true,"comment":"Snapshot name.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.23","name":"animations","type":{"name":"ScreenshotAnimations","union":[{"name":"\"disabled\""},{"name":"\"allow\""}],"expression":"[ScreenshotAnimations]<\"disabled\"|\"allow\">"},"spec":[{"type":"text","text":"When set to `\"disabled\"`, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment depending on their duration:"},{"type":"li","text":"finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.","liType":"bullet"},{"type":"li","text":"infinite animations are canceled to initial state, and then played over after the screenshot.","liType":"bullet"},{"type":"text","text":"Defaults to `\"disabled\"` that disables animations."}],"required":false,"comment":"When set to `\"disabled\"`, stops CSS animations, CSS transitions and Web Animations. Animations get different\ntreatment depending on their duration:\n- finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.\n- infinite animations are canceled to initial state, and then played over after the screenshot.\n\nDefaults to `\"disabled\"` that disables animations.","async":false,"alias":"animations","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.23","name":"caret","type":{"name":"ScreenshotCaret","union":[{"name":"\"hide\""},{"name":"\"initial\""}],"expression":"[ScreenshotCaret]<\"hide\"|\"initial\">"},"spec":[{"type":"text","text":"When set to `\"hide\"`, screenshot will hide text caret. When set to `\"initial\"`, text caret behavior will not be changed. Defaults to `\"hide\"`."}],"required":false,"comment":"When set to `\"hide\"`, screenshot will hide text caret. When set to `\"initial\"`, text caret behavior will not be\nchanged. Defaults to `\"hide\"`.","async":false,"alias":"caret","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.23","name":"clip","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"x-coordinate of top-left corner of clip area"}],"required":true,"comment":"x-coordinate of top-left corner of clip area","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"y-coordinate of top-left corner of clip area"}],"required":true,"comment":"y-coordinate of top-left corner of clip area","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"width of clipping area"}],"required":true,"comment":"width of clipping area","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"height of clipping area"}],"required":true,"comment":"height of clipping area","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"An object which specifies clipping of the resulting image."}],"required":false,"comment":"An object which specifies clipping of the resulting image.","async":false,"alias":"clip","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.23","name":"fullPage","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Defaults to↵`false`."}],"required":false,"comment":"When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Defaults to\n`false`.","async":false,"alias":"fullPage","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.23","name":"mask","type":{"name":"Array","templates":[{"name":"Locator"}],"expression":"[Array]<[Locator]>"},"spec":[{"type":"text","text":"Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with↵a pink box `#FF00FF` (customized by `maskColor`) that completely covers its bounding box."}],"required":false,"comment":"Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink\nbox `#FF00FF` (customized by `maskColor`) that completely covers its bounding box.","async":false,"alias":"mask","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.35","name":"maskColor","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Specify the color of the overlay box for masked elements, in [CSS color format](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value). Default color is pink `#FF00FF`."}],"required":false,"comment":"Specify the color of the overlay box for masked elements, in\n[CSS color format](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value). Default color is pink `#FF00FF`.","async":false,"alias":"maskColor","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"maxDiffPixelRatio","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"An acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1`. Default is configurable with `TestConfig.expect`. Unset by default."}],"required":false,"comment":"An acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1`. Default is\nconfigurable with `TestConfig.expect`. Unset by default.","async":false,"alias":"maxDiffPixelRatio","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"maxDiffPixels","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"An acceptable amount of pixels that could be different. Default is configurable with `TestConfig.expect`. Unset by default."}],"required":false,"comment":"An acceptable amount of pixels that could be different. Default is configurable with `TestConfig.expect`. Unset by\ndefault.","async":false,"alias":"maxDiffPixels","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.23","name":"omitBackground","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images.↵Defaults to `false`."}],"required":false,"comment":"Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images.\nDefaults to `false`.","async":false,"alias":"omitBackground","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.23","name":"scale","type":{"name":"ScreenshotScale","union":[{"name":"\"css\""},{"name":"\"device\""}],"expression":"[ScreenshotScale]<\"css\"|\"device\">"},"spec":[{"type":"text","text":"When set to `\"css\"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this will keep screenshots small. Using `\"device\"` option will produce a single pixel per each device pixel, so screenshots of high-dpi devices will be twice as large or even larger."},{"type":"text","text":"Defaults to `\"css\"`."}],"required":false,"comment":"When set to `\"css\"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this\nwill keep screenshots small. Using `\"device\"` option will produce a single pixel per each device pixel, so\nscreenshots of high-dpi devices will be twice as large or even larger.\n\nDefaults to `\"css\"`.","async":false,"alias":"scale","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.41","name":"stylePath","type":{"name":"","union":[{"name":"string"},{"name":"Array","templates":[{"name":"string"}]}],"expression":"[string]|[Array]<[string]>"},"spec":[{"type":"text","text":"File name containing the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make elements invisible or change their properties to help you creating repeatable screenshots. This stylesheet pierces the Shadow DOM and applies to the inner frames."}],"required":false,"comment":"File name containing the stylesheet to apply while making the screenshot. This is where you can hide dynamic\nelements, make elements invisible or change their properties to help you creating repeatable screenshots. This\nstylesheet pierces the Shadow DOM and applies to the inner frames.","async":false,"alias":"stylePath","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"threshold","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ)↵between the same pixel in compared images, between zero (strict) and one (lax), default is configurable with↵`TestConfig.expect`. Defaults to `0.2`."}],"required":false,"comment":"An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the\nsame pixel in compared images, between zero (strict) and one (lax), default is configurable with\n`TestConfig.expect`. Defaults to `0.2`.","async":false,"alias":"threshold","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"toHaveScreenshot#2","type":{"name":"void"},"spec":[{"type":"text","text":"This function will wait until two consecutive page screenshots↵yield the same result, and then compare the last screenshot with the expectation."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await expect(page).toHaveScreenshot();"],"codeLang":"js"},{"type":"text","text":"Note that screenshot assertions only work with Playwright test runner."}],"required":true,"comment":"This function will wait until two consecutive page screenshots yield the same result, and then compare the last\nscreenshot with the expectation.\n\n**Usage**\n\n```js\nawait expect(page).toHaveScreenshot();\n```\n\nNote that screenshot assertions only work with Playwright test runner.","async":true,"alias":"toHaveScreenshot","overloadIndex":1,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.23","name":"animations","type":{"name":"ScreenshotAnimations","union":[{"name":"\"disabled\""},{"name":"\"allow\""}],"expression":"[ScreenshotAnimations]<\"disabled\"|\"allow\">"},"spec":[{"type":"text","text":"When set to `\"disabled\"`, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment depending on their duration:"},{"type":"li","text":"finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.","liType":"bullet"},{"type":"li","text":"infinite animations are canceled to initial state, and then played over after the screenshot.","liType":"bullet"},{"type":"text","text":"Defaults to `\"disabled\"` that disables animations."}],"required":false,"comment":"When set to `\"disabled\"`, stops CSS animations, CSS transitions and Web Animations. Animations get different\ntreatment depending on their duration:\n- finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.\n- infinite animations are canceled to initial state, and then played over after the screenshot.\n\nDefaults to `\"disabled\"` that disables animations.","async":false,"alias":"animations","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.23","name":"caret","type":{"name":"ScreenshotCaret","union":[{"name":"\"hide\""},{"name":"\"initial\""}],"expression":"[ScreenshotCaret]<\"hide\"|\"initial\">"},"spec":[{"type":"text","text":"When set to `\"hide\"`, screenshot will hide text caret. When set to `\"initial\"`, text caret behavior will not be changed. Defaults to `\"hide\"`."}],"required":false,"comment":"When set to `\"hide\"`, screenshot will hide text caret. When set to `\"initial\"`, text caret behavior will not be\nchanged. Defaults to `\"hide\"`.","async":false,"alias":"caret","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.23","name":"clip","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"x-coordinate of top-left corner of clip area"}],"required":true,"comment":"x-coordinate of top-left corner of clip area","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"y-coordinate of top-left corner of clip area"}],"required":true,"comment":"y-coordinate of top-left corner of clip area","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"width","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"width of clipping area"}],"required":true,"comment":"width of clipping area","async":false,"alias":"width","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"height","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"height of clipping area"}],"required":true,"comment":"height of clipping area","async":false,"alias":"height","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"An object which specifies clipping of the resulting image."}],"required":false,"comment":"An object which specifies clipping of the resulting image.","async":false,"alias":"clip","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.23","name":"fullPage","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Defaults to↵`false`."}],"required":false,"comment":"When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Defaults to\n`false`.","async":false,"alias":"fullPage","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.23","name":"mask","type":{"name":"Array","templates":[{"name":"Locator"}],"expression":"[Array]<[Locator]>"},"spec":[{"type":"text","text":"Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with↵a pink box `#FF00FF` (customized by `maskColor`) that completely covers its bounding box."}],"required":false,"comment":"Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink\nbox `#FF00FF` (customized by `maskColor`) that completely covers its bounding box.","async":false,"alias":"mask","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.35","name":"maskColor","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Specify the color of the overlay box for masked elements, in [CSS color format](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value). Default color is pink `#FF00FF`."}],"required":false,"comment":"Specify the color of the overlay box for masked elements, in\n[CSS color format](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value). Default color is pink `#FF00FF`.","async":false,"alias":"maskColor","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"maxDiffPixelRatio","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"An acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1`. Default is configurable with `TestConfig.expect`. Unset by default."}],"required":false,"comment":"An acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1`. Default is\nconfigurable with `TestConfig.expect`. Unset by default.","async":false,"alias":"maxDiffPixelRatio","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"maxDiffPixels","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"An acceptable amount of pixels that could be different. Default is configurable with `TestConfig.expect`. Unset by default."}],"required":false,"comment":"An acceptable amount of pixels that could be different. Default is configurable with `TestConfig.expect`. Unset by\ndefault.","async":false,"alias":"maxDiffPixels","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.23","name":"omitBackground","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images.↵Defaults to `false`."}],"required":false,"comment":"Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images.\nDefaults to `false`.","async":false,"alias":"omitBackground","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.23","name":"scale","type":{"name":"ScreenshotScale","union":[{"name":"\"css\""},{"name":"\"device\""}],"expression":"[ScreenshotScale]<\"css\"|\"device\">"},"spec":[{"type":"text","text":"When set to `\"css\"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this will keep screenshots small. Using `\"device\"` option will produce a single pixel per each device pixel, so screenshots of high-dpi devices will be twice as large or even larger."},{"type":"text","text":"Defaults to `\"css\"`."}],"required":false,"comment":"When set to `\"css\"`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this\nwill keep screenshots small. Using `\"device\"` option will produce a single pixel per each device pixel, so\nscreenshots of high-dpi devices will be twice as large or even larger.\n\nDefaults to `\"css\"`.","async":false,"alias":"scale","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.41","name":"stylePath","type":{"name":"","union":[{"name":"string"},{"name":"Array","templates":[{"name":"string"}]}],"expression":"[string]|[Array]<[string]>"},"spec":[{"type":"text","text":"File name containing the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make elements invisible or change their properties to help you creating repeatable screenshots. This stylesheet pierces the Shadow DOM and applies to the inner frames."}],"required":false,"comment":"File name containing the stylesheet to apply while making the screenshot. This is where you can hide dynamic\nelements, make elements invisible or change their properties to help you creating repeatable screenshots. This\nstylesheet pierces the Shadow DOM and applies to the inner frames.","async":false,"alias":"stylePath","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"threshold","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ)↵between the same pixel in compared images, between zero (strict) and one (lax), default is configurable with↵`TestConfig.expect`. Defaults to `0.2`."}],"required":false,"comment":"An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the\nsame pixel in compared images, between zero (strict) and one (lax), default is configurable with\n`TestConfig.expect`. Defaults to `0.2`.","async":false,"alias":"threshold","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"hasTitle"},"types":{},"overrides":{}},"since":"v1.20","name":"toHaveTitle","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures the page has the given title."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await expect(page).toHaveTitle(/.*checkout/);"],"codeLang":"js"},{"type":"code","lines":["assertThat(page).hasTitle(\"Playwright\");"],"codeLang":"java"},{"type":"code","lines":["import re","from playwright.async_api import expect","","# ...","await expect(page).to_have_title(re.compile(r\".*checkout\"))"],"codeLang":"python async"},{"type":"code","lines":["import re","from playwright.sync_api import expect","","# ...","expect(page).to_have_title(re.compile(r\".*checkout\"))"],"codeLang":"python sync"},{"type":"code","lines":["await Expect(Page).ToHaveTitle(\"Playwright\");"],"codeLang":"csharp"}],"required":true,"comment":"Ensures the page has the given title.\n\n**Usage**\n\n```js\nawait expect(page).toHaveTitle(/.*checkout/);\n```\n\n```java\nassertThat(page).hasTitle(\"Playwright\");\n```\n\n```py\nimport re\nfrom playwright.async_api import expect\n\n# ...\nawait expect(page).to_have_title(re.compile(r\".*checkout\"))\n```\n\n```py\nimport re\nfrom playwright.sync_api import expect\n\n# ...\nexpect(page).to_have_title(re.compile(r\".*checkout\"))\n```\n\n```csharp\nawait Expect(Page).ToHaveTitle(\"Playwright\");\n```\n","async":true,"alias":"toHaveTitle","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"titleOrRegExp","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Expected title or RegExp."}],"required":true,"comment":"Expected title or RegExp.","async":false,"alias":"titleOrRegExp","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"hasURL"},"types":{},"overrides":{}},"since":"v1.20","name":"toHaveURL","type":{"name":"void"},"spec":[{"type":"text","text":"Ensures the page is navigated to the given URL."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await expect(page).toHaveURL(/.*checkout/);"],"codeLang":"js"},{"type":"code","lines":["assertThat(page).hasURL(\".com\");"],"codeLang":"java"},{"type":"code","lines":["import re","from playwright.async_api import expect","","# ...","await expect(page).to_have_url(re.compile(\".*checkout\"))"],"codeLang":"python async"},{"type":"code","lines":["import re","from playwright.sync_api import expect","","# ...","expect(page).to_have_url(re.compile(\".*checkout\"))"],"codeLang":"python sync"},{"type":"code","lines":["await Expect(Page).ToHaveURL(new Regex(\".*checkout\"));"],"codeLang":"csharp"}],"required":true,"comment":"Ensures the page is navigated to the given URL.\n\n**Usage**\n\n```js\nawait expect(page).toHaveURL(/.*checkout/);\n```\n\n```java\nassertThat(page).hasURL(\".com\");\n```\n\n```py\nimport re\nfrom playwright.async_api import expect\n\n# ...\nawait expect(page).to_have_url(re.compile(\".*checkout\"))\n```\n\n```py\nimport re\nfrom playwright.sync_api import expect\n\n# ...\nexpect(page).to_have_url(re.compile(\".*checkout\"))\n```\n\n```csharp\nawait Expect(Page).ToHaveURL(new Regex(\".*checkout\"));\n```\n","async":true,"alias":"toHaveURL","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"urlOrRegExp","type":{"name":"","union":[{"name":"string"},{"name":"RegExp"}],"expression":"[string]|[RegExp]"},"spec":[{"type":"text","text":"Expected URL string or RegExp."}],"required":true,"comment":"Expected URL string or RegExp.","async":false,"alias":"urlOrRegExp","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.44","name":"ignoreCase","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular expression flag if specified."}],"required":false,"comment":"Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular\nexpression flag if specified.","async":false,"alias":"ignoreCase","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time to retry the assertion for in milliseconds. Defaults to `5000`."}],"required":false,"comment":"Time to retry the assertion for in milliseconds. Defaults to `5000`.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]}]},{"name":"Playwright","spec":[{"type":"text","text":"Playwright module provides a method to launch a browser instance. The following is a typical example of using Playwright↵to drive automation:"},{"type":"code","lines":["const { chromium, firefox, webkit } = require('playwright');","","(async () => {"," const browser = await chromium.launch(); // Or 'firefox' or 'webkit'."," const page = await browser.newPage();"," await page.goto('http://example.com');"," // other actions..."," await browser.close();","})();"],"codeLang":"js"},{"type":"code","lines":["import com.microsoft.playwright.*;","","public class Example {"," public static void main(String[] args) {"," try (Playwright playwright = Playwright.create()) {"," BrowserType chromium = playwright.chromium();"," Browser browser = chromium.launch();"," Page page = browser.newPage();"," page.navigate(\"http://example.com\");"," // other actions..."," browser.close();"," }"," }","}"],"codeLang":"java"},{"type":"code","lines":["import asyncio","from playwright.async_api import async_playwright, Playwright","","async def run(playwright: Playwright):"," chromium = playwright.chromium # or \"firefox\" or \"webkit\"."," browser = await chromium.launch()"," page = await browser.new_page()"," await page.goto(\"http://example.com\")"," # other actions..."," await browser.close()","","async def main():"," async with async_playwright() as playwright:"," await run(playwright)","asyncio.run(main())"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import sync_playwright, Playwright","","def run(playwright: Playwright):"," chromium = playwright.chromium # or \"firefox\" or \"webkit\"."," browser = chromium.launch()"," page = browser.new_page()"," page.goto(\"http://example.com\")"," # other actions..."," browser.close()","","with sync_playwright() as playwright:"," run(playwright)"],"codeLang":"python sync"},{"type":"code","lines":["using Microsoft.Playwright;","using System.Threading.Tasks;","","class PlaywrightExample","{"," public static async Task Main()"," {"," using var playwright = await Playwright.CreateAsync();"," await using var browser = await playwright.Chromium.LaunchAsync();"," var page = await browser.NewPageAsync();",""," await page.GotoAsync(\"https://www.microsoft.com\");"," // other actions..."," }","}"],"codeLang":"csharp"}],"langs":{},"comment":"Playwright module provides a method to launch a browser instance. The following is a typical example of using\nPlaywright to drive automation:\n\n```js\nconst { chromium, firefox, webkit } = require('playwright');\n\n(async () => {\n const browser = await chromium.launch(); // Or 'firefox' or 'webkit'.\n const page = await browser.newPage();\n await page.goto('http://example.com');\n // other actions...\n await browser.close();\n})();\n```\n\n```java\nimport com.microsoft.playwright.*;\n\npublic class Example {\n public static void main(String[] args) {\n try (Playwright playwright = Playwright.create()) {\n BrowserType chromium = playwright.chromium();\n Browser browser = chromium.launch();\n Page page = browser.newPage();\n page.navigate(\"http://example.com\");\n // other actions...\n browser.close();\n }\n }\n}\n```\n\n```py\nimport asyncio\nfrom playwright.async_api import async_playwright, Playwright\n\nasync def run(playwright: Playwright):\n chromium = playwright.chromium # or \"firefox\" or \"webkit\".\n browser = await chromium.launch()\n page = await browser.new_page()\n await page.goto(\"http://example.com\")\n # other actions...\n await browser.close()\n\nasync def main():\n async with async_playwright() as playwright:\n await run(playwright)\nasyncio.run(main())\n```\n\n```py\nfrom playwright.sync_api import sync_playwright, Playwright\n\ndef run(playwright: Playwright):\n chromium = playwright.chromium # or \"firefox\" or \"webkit\".\n browser = chromium.launch()\n page = browser.new_page()\n page.goto(\"http://example.com\")\n # other actions...\n browser.close()\n\nwith sync_playwright() as playwright:\n run(playwright)\n```\n\n```csharp\nusing Microsoft.Playwright;\nusing System.Threading.Tasks;\n\nclass PlaywrightExample\n{\n public static async Task Main()\n {\n using var playwright = await Playwright.CreateAsync();\n await using var browser = await playwright.Chromium.LaunchAsync();\n var page = await browser.NewPageAsync();\n\n await page.GotoAsync(\"https://www.microsoft.com\");\n // other actions...\n }\n}\n```\n","since":"v1.8","members":[{"kind":"property","langs":{},"since":"v1.8","name":"chromium","type":{"name":"BrowserType","expression":"[BrowserType]"},"spec":[{"type":"text","text":"This object can be used to launch or connect to Chromium, returning instances of `Browser`."}],"required":true,"comment":"This object can be used to launch or connect to Chromium, returning instances of `Browser`.","async":false,"alias":"chromium","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"devices","type":{"name":"Object","expression":"[Object]"},"spec":[{"type":"text","text":"Returns a dictionary of devices to be used with [`method: Browser.newContext`] or [`method: Browser.newPage`]."},{"type":"code","lines":["const { webkit, devices } = require('playwright');","const iPhone = devices['iPhone 6'];","","(async () => {"," const browser = await webkit.launch();"," const context = await browser.newContext({"," ...iPhone"," });"," const page = await context.newPage();"," await page.goto('http://example.com');"," // other actions..."," await browser.close();","})();"],"codeLang":"js"},{"type":"code","lines":["import asyncio","from playwright.async_api import async_playwright, Playwright","","async def run(playwright: Playwright):"," webkit = playwright.webkit"," iphone = playwright.devices[\"iPhone 6\"]"," browser = await webkit.launch()"," context = await browser.new_context(**iphone)"," page = await context.new_page()"," await page.goto(\"http://example.com\")"," # other actions..."," await browser.close()","","async def main():"," async with async_playwright() as playwright:"," await run(playwright)","asyncio.run(main())"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import sync_playwright, Playwright","","def run(playwright: Playwright):"," webkit = playwright.webkit"," iphone = playwright.devices[\"iPhone 6\"]"," browser = webkit.launch()"," context = browser.new_context(**iphone)"," page = context.new_page()"," page.goto(\"http://example.com\")"," # other actions..."," browser.close()","","with sync_playwright() as playwright:"," run(playwright)"],"codeLang":"python sync"}],"required":true,"comment":"Returns a dictionary of devices to be used with [`method: Browser.newContext`] or [`method: Browser.newPage`].\n\n```js\nconst { webkit, devices } = require('playwright');\nconst iPhone = devices['iPhone 6'];\n\n(async () => {\n const browser = await webkit.launch();\n const context = await browser.newContext({\n ...iPhone\n });\n const page = await context.newPage();\n await page.goto('http://example.com');\n // other actions...\n await browser.close();\n})();\n```\n\n```py\nimport asyncio\nfrom playwright.async_api import async_playwright, Playwright\n\nasync def run(playwright: Playwright):\n webkit = playwright.webkit\n iphone = playwright.devices[\"iPhone 6\"]\n browser = await webkit.launch()\n context = await browser.new_context(**iphone)\n page = await context.new_page()\n await page.goto(\"http://example.com\")\n # other actions...\n await browser.close()\n\nasync def main():\n async with async_playwright() as playwright:\n await run(playwright)\nasyncio.run(main())\n```\n\n```py\nfrom playwright.sync_api import sync_playwright, Playwright\n\ndef run(playwright: Playwright):\n webkit = playwright.webkit\n iphone = playwright.devices[\"iPhone 6\"]\n browser = webkit.launch()\n context = browser.new_context(**iphone)\n page = context.new_page()\n page.goto(\"http://example.com\")\n # other actions...\n browser.close()\n\nwith sync_playwright() as playwright:\n run(playwright)\n```\n","async":false,"alias":"devices","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"devices","type":{"name":"IReadOnlyDictionary","templates":[{"name":"string"},{"name":"BrowserNewContextOptions"}],"expression":"[IReadOnlyDictionary<string, BrowserNewContextOptions>]"},"spec":[{"type":"text","text":"Returns a dictionary of devices to be used with [`method: Browser.newContext`] or [`method: Browser.newPage`]."},{"type":"code","lines":["using Microsoft.Playwright;","using System.Threading.Tasks;","","class PlaywrightExample","{"," public static async Task Main()"," {"," using var playwright = await Playwright.CreateAsync();"," await using var browser = await playwright.Webkit.LaunchAsync();"," await using var context = await browser.NewContextAsync(playwright.Devices[\"iPhone 6\"]);",""," var page = await context.NewPageAsync();"," await page.GotoAsync(\"https://www.theverge.com\");"," // other actions..."," }","}"],"codeLang":"csharp"}],"required":true,"comment":"Returns a dictionary of devices to be used with [`method: Browser.newContext`] or [`method: Browser.newPage`].\n\n```csharp\nusing Microsoft.Playwright;\nusing System.Threading.Tasks;\n\nclass PlaywrightExample\n{\n public static async Task Main()\n {\n using var playwright = await Playwright.CreateAsync();\n await using var browser = await playwright.Webkit.LaunchAsync();\n await using var context = await browser.NewContextAsync(playwright.Devices[\"iPhone 6\"]);\n\n var page = await context.NewPageAsync();\n await page.GotoAsync(\"https://www.theverge.com\");\n // other actions...\n }\n}\n```\n","async":false,"alias":"devices","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"errors","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"TimeoutError","type":{"name":"function","expression":"[function]"},"spec":[{"type":"text","text":"A class of `TimeoutError`."}],"required":true,"comment":"A class of `TimeoutError`.","async":false,"alias":"TimeoutError","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Playwright methods might throw errors if they are unable to fulfill a request. For example,↵[`method: Locator.waitFor`] might fail if the selector doesn't match any nodes during the given timeframe."},{"type":"text","text":"For certain types of errors Playwright uses specific error classes. These classes are available via↵[`playwright.errors`](#playwright-errors)."},{"type":"text","text":"An example of handling a timeout error:"},{"type":"code","lines":["try {"," await page.locator('.foo').waitFor();","} catch (e) {"," if (e instanceof playwright.errors.TimeoutError) {"," // Do something if this is a timeout."," }","}"],"codeLang":"js"},{"type":"code","lines":["try:"," await page.wait_for_selector(\".foo\")","except TimeoutError as e:"," pass"," # do something if this is a timeout."],"codeLang":"python async"},{"type":"code","lines":["try:"," page.wait_for_selector(\".foo\")","except TimeoutError as e:"," pass"," # do something if this is a timeout."],"codeLang":"python sync"}],"required":true,"comment":"Playwright methods might throw errors if they are unable to fulfill a request. For example,\n[`method: Locator.waitFor`] might fail if the selector doesn't match any nodes during the given timeframe.\n\nFor certain types of errors Playwright uses specific error classes. These classes are available via\n[`playwright.errors`](#playwright-errors).\n\nAn example of handling a timeout error:\n\n```js\ntry {\n await page.locator('.foo').waitFor();\n} catch (e) {\n if (e instanceof playwright.errors.TimeoutError) {\n // Do something if this is a timeout.\n }\n}\n```\n\n```py\ntry:\n await page.wait_for_selector(\".foo\")\nexcept TimeoutError as e:\n pass\n # do something if this is a timeout.\n```\n\n```py\ntry:\n page.wait_for_selector(\".foo\")\nexcept TimeoutError as e:\n pass\n # do something if this is a timeout.\n```\n","async":false,"alias":"errors","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"property","langs":{},"since":"v1.8","name":"firefox","type":{"name":"BrowserType","expression":"[BrowserType]"},"spec":[{"type":"text","text":"This object can be used to launch or connect to Firefox, returning instances of `Browser`."}],"required":true,"comment":"This object can be used to launch or connect to Firefox, returning instances of `Browser`.","async":false,"alias":"firefox","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"property","langs":{"aliases":{"csharp":"APIRequest"},"types":{},"overrides":{}},"since":"v1.16","name":"request","type":{"name":"APIRequest","expression":"[APIRequest]"},"spec":[{"type":"text","text":"Exposes API that can be used for the Web API testing."}],"required":true,"comment":"Exposes API that can be used for the Web API testing.","async":false,"alias":"request","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"property","langs":{},"since":"v1.8","name":"selectors","type":{"name":"Selectors","expression":"[Selectors]"},"spec":[{"type":"text","text":"Selectors can be used to install custom selector engines. See↵[extensibility](../extensibility.md) for more information."}],"required":true,"comment":"Selectors can be used to install custom selector engines. See [extensibility](../extensibility.md) for more\ninformation.","async":false,"alias":"selectors","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"property","langs":{},"since":"v1.8","name":"webkit","type":{"name":"BrowserType","expression":"[BrowserType]"},"spec":[{"type":"text","text":"This object can be used to launch or connect to WebKit, returning instances of `Browser`."}],"required":true,"comment":"This object can be used to launch or connect to WebKit, returning instances of `Browser`.","async":false,"alias":"webkit","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"close","type":{"name":"void"},"spec":[{"type":"text","text":"Terminates this instance of Playwright, will also close all created browsers if they are still running."}],"required":true,"comment":"Terminates this instance of Playwright, will also close all created browsers if they are still running.","async":false,"alias":"close","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.10","name":"create","type":{"name":"Playwright","expression":"[Playwright]"},"spec":[{"type":"text","text":"Launches new Playwright driver process and connects to it. [`method: Playwright.close`] should be called when the instance is no longer needed."},{"type":"code","lines":["Playwright playwright = Playwright.create();","Browser browser = playwright.webkit().launch();","Page page = browser.newPage();","page.navigate(\"https://www.w3.org/\");","playwright.close();"],"codeLang":"java"}],"required":true,"comment":"Launches new Playwright driver process and connects to it. [`method: Playwright.close`] should be called when the\ninstance is no longer needed.\n\n```java\nPlaywright playwright = Playwright.create();\nBrowser browser = playwright.webkit().launch();\nPage page = browser.newPage();\npage.navigate(\"https://www.w3.org/\");\nplaywright.close();\n```\n","async":false,"alias":"create","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.13","name":"env","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"Additional environment variables that will be passed to the driver process. By default driver↵process inherits environment variables of the Playwright process."}],"required":false,"comment":"Additional environment variables that will be passed to the driver process. By default driver process inherits\nenvironment variables of the Playwright process.","async":false,"alias":"env","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"stop","type":{"name":"void"},"spec":[{"type":"text","text":"Terminates this instance of Playwright in case it was created bypassing the Python context manager. This is useful in REPL applications."},{"type":"code","lines":["from playwright.sync_api import sync_playwright","","playwright = sync_playwright().start()","","browser = playwright.chromium.launch()","page = browser.new_page()","page.goto(\"https://playwright.dev/\")","page.screenshot(path=\"example.png\")","browser.close()","","playwright.stop()"],"codeLang":"py"}],"required":true,"comment":"Terminates this instance of Playwright in case it was created bypassing the Python context manager. This is useful\nin REPL applications.\n\n```py\nfrom playwright.sync_api import sync_playwright\n\nplaywright = sync_playwright().start()\n\nbrowser = playwright.chromium.launch()\npage = browser.new_page()\npage.goto(\"https://playwright.dev/\")\npage.screenshot(path=\"example.png\")\nbrowser.close()\n\nplaywright.stop()\n```\n","async":true,"alias":"stop","overloadIndex":0,"paramOrOption":null,"args":[]}]},{"name":"PlaywrightAssertions","spec":[{"type":"text","text":"Playwright gives you Web-First Assertions with convenience methods for creating assertions that will wait and retry until the expected condition is met."},{"type":"text","text":"Consider the following example:"},{"type":"code","lines":["import { test, expect } from '@playwright/test';","","test('status becomes submitted', async ({ page }) => {"," // ..."," await page.locator('#submit-button').click();"," await expect(page.locator('.status')).toHaveText('Submitted');","});"],"codeLang":"js"},{"type":"code","lines":["from playwright.async_api import Page, expect","","async def test_status_becomes_submitted(page: Page) -> None:"," # .."," await page.locator(\"#submit-button\").click()"," await expect(page.locator(\".status\")).to_have_text(\"Submitted\")"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import Page, expect","","def test_status_becomes_submitted(page: Page) -> None:"," # .."," page.locator(\"#submit-button\").click()"," expect(page.locator(\".status\")).to_have_text(\"Submitted\")"],"codeLang":"python sync"},{"type":"code","lines":["...","import static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;","","public class TestExample {"," ..."," @Test"," void statusBecomesSubmitted() {"," ..."," page.locator(\"#submit-button\").click();"," assertThat(page.locator(\".status\")).hasText(\"Submitted\");"," }","}"],"codeLang":"java"},{"type":"code","lines":["using Microsoft.Playwright;","using Microsoft.Playwright.MSTest;","","namespace PlaywrightTests;","","[TestClass]","public class ExampleTests : PageTest","{"," [TestMethod]"," public async Task StatusBecomesSubmitted()"," {"," await Page.GetByRole(AriaRole.Button, new() { Name = \"Submit\" }).ClickAsync();"," await Expect(Page.Locator(\".status\")).ToHaveTextAsync(\"Submitted\");"," }","}"],"codeLang":"csharp"},{"type":"text","text":"Playwright will be re-testing the node with the selector `.status` until fetched Node has the `\"Submitted\"`↵text. It will be re-fetching the node and checking it over and over, until the condition is met or until the timeout is↵reached. You can pass this timeout as an option."},{"type":"text","text":"By default, the timeout for assertions is set to 5 seconds."}],"langs":{"only":["js","java","csharp"],"aliases":{},"types":{},"overrides":{}},"comment":"Playwright gives you Web-First Assertions with convenience methods for creating assertions that will wait and retry\nuntil the expected condition is met.\n\nConsider the following example:\n\n```js\nimport { test, expect } from '@playwright/test';\n\ntest('status becomes submitted', async ({ page }) => {\n // ...\n await page.locator('#submit-button').click();\n await expect(page.locator('.status')).toHaveText('Submitted');\n});\n```\n\n```py\nfrom playwright.async_api import Page, expect\n\nasync def test_status_becomes_submitted(page: Page) -> None:\n # ..\n await page.locator(\"#submit-button\").click()\n await expect(page.locator(\".status\")).to_have_text(\"Submitted\")\n```\n\n```py\nfrom playwright.sync_api import Page, expect\n\ndef test_status_becomes_submitted(page: Page) -> None:\n # ..\n page.locator(\"#submit-button\").click()\n expect(page.locator(\".status\")).to_have_text(\"Submitted\")\n```\n\n```java\n...\nimport static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;\n\npublic class TestExample {\n ...\n @Test\n void statusBecomesSubmitted() {\n ...\n page.locator(\"#submit-button\").click();\n assertThat(page.locator(\".status\")).hasText(\"Submitted\");\n }\n}\n```\n\n```csharp\nusing Microsoft.Playwright;\nusing Microsoft.Playwright.MSTest;\n\nnamespace PlaywrightTests;\n\n[TestClass]\npublic class ExampleTests : PageTest\n{\n [TestMethod]\n public async Task StatusBecomesSubmitted()\n {\n await Page.GetByRole(AriaRole.Button, new() { Name = \"Submit\" }).ClickAsync();\n await Expect(Page.Locator(\".status\")).ToHaveTextAsync(\"Submitted\");\n }\n}\n```\n\nPlaywright will be re-testing the node with the selector `.status` until fetched Node has the `\"Submitted\"` text.\nIt will be re-fetching the node and checking it over and over, until the condition is met or until the timeout is\nreached. You can pass this timeout as an option.\n\nBy default, the timeout for assertions is set to 5 seconds.","since":"v1.17","members":[{"kind":"method","langs":{"aliases":{"java":"assertThat","python":"expect","js":"expect","csharp":"Expect"},"types":{},"overrides":{}},"since":"v1.18","name":"expectAPIResponse","type":{"name":"APIResponseAssertions","expression":"[APIResponseAssertions]"},"spec":[{"type":"text","text":"Creates a `APIResponseAssertions` object for the given `APIResponse`."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["PlaywrightAssertions.assertThat(response).isOK();"],"codeLang":"java"}],"required":true,"comment":"Creates a `APIResponseAssertions` object for the given `APIResponse`.\n\n**Usage**\n\n```java\nPlaywrightAssertions.assertThat(response).isOK();\n```\n","async":false,"alias":"expectAPIResponse","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"response","type":{"name":"APIResponse","expression":"[APIResponse]"},"spec":[{"type":"text","text":"`APIResponse` object to use for assertions."}],"required":true,"comment":"`APIResponse` object to use for assertions.","async":false,"alias":"response","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["js"],"aliases":{"js":"expect"},"types":{},"overrides":{}},"since":"v1.9","name":"expectGeneric","type":{"name":"GenericAssertions","expression":"[GenericAssertions]"},"spec":[{"type":"text","text":"Creates a `GenericAssertions` object for the given value."}],"required":true,"comment":"Creates a `GenericAssertions` object for the given value.","async":false,"alias":"expectGeneric","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"value","type":{"name":"any","expression":"[any]"},"spec":[{"type":"text","text":"Value that will be asserted."}],"required":true,"comment":"Value that will be asserted.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"assertThat","python":"expect","js":"expect","csharp":"Expect"},"types":{},"overrides":{}},"since":"v1.18","name":"expectLocator","type":{"name":"LocatorAssertions","expression":"[LocatorAssertions]"},"spec":[{"type":"text","text":"Creates a `LocatorAssertions` object for the given `Locator`."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["PlaywrightAssertions.assertThat(locator).isVisible();"],"codeLang":"java"},{"type":"code","lines":["await Expect(locator).ToBeVisibleAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Creates a `LocatorAssertions` object for the given `Locator`.\n\n**Usage**\n\n```java\nPlaywrightAssertions.assertThat(locator).isVisible();\n```\n\n```csharp\nawait Expect(locator).ToBeVisibleAsync();\n```\n","async":false,"alias":"expectLocator","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"locator","type":{"name":"Locator","expression":"[Locator]"},"spec":[{"type":"text","text":"`Locator` object to use for assertions."}],"required":true,"comment":"`Locator` object to use for assertions.","async":false,"alias":"locator","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"assertThat","python":"expect","js":"expect","csharp":"Expect"},"types":{},"overrides":{}},"since":"v1.18","name":"expectPage","type":{"name":"PageAssertions","expression":"[PageAssertions]"},"spec":[{"type":"text","text":"Creates a `PageAssertions` object for the given `Page`."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["PlaywrightAssertions.assertThat(page).hasTitle(\"News\");"],"codeLang":"java"},{"type":"code","lines":["await Expect(Page).ToHaveTitleAsync(\"News\");"],"codeLang":"csharp"}],"required":true,"comment":"Creates a `PageAssertions` object for the given `Page`.\n\n**Usage**\n\n```java\nPlaywrightAssertions.assertThat(page).hasTitle(\"News\");\n```\n\n```csharp\nawait Expect(Page).ToHaveTitleAsync(\"News\");\n```\n","async":false,"alias":"expectPage","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"page","type":{"name":"Page","expression":"[Page]"},"spec":[{"type":"text","text":"`Page` object to use for assertions."}],"required":true,"comment":"`Page` object to use for assertions.","async":false,"alias":"page","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.25","name":"setDefaultAssertionTimeout","type":{"name":"void"},"spec":[{"type":"text","text":"Changes default timeout for Playwright assertions from 5 seconds to the specified value."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["PlaywrightAssertions.setDefaultAssertionTimeout(30_000);"],"codeLang":"java"}],"required":true,"comment":"Changes default timeout for Playwright assertions from 5 seconds to the specified value.\n\n**Usage**\n\n```java\nPlaywrightAssertions.setDefaultAssertionTimeout(30_000);\n```\n","async":false,"alias":"setDefaultAssertionTimeout","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.25","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Timeout in milliseconds."}],"required":true,"comment":"Timeout in milliseconds.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]}]},{"name":"PlaywrightException","spec":[{"type":"li","text":"extends: [RuntimeException]","liType":"bullet"},{"type":"text","text":"PlaywrightException is thrown whenever certain operations are terminated abnormally, e.g.↵browser closes while [`method: Page.evaluate`] is running. All Playwright exceptions↵inherit from this class."}],"extends":"RuntimeException","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"comment":"- extends: [RuntimeException]\n\nPlaywrightException is thrown whenever certain operations are terminated abnormally, e.g. browser closes while\n[`method: Page.evaluate`] is running. All Playwright exceptions inherit from this class.","since":"v1.10","members":[]},{"name":"Request","spec":[{"type":"text","text":"Whenever the page sends a request for a network resource the following sequence of events are emitted by `Page`:"},{"type":"li","text":"[`event: Page.request`] emitted when the request is issued by the page.","liType":"bullet"},{"type":"li","text":"[`event: Page.response`] emitted when/if the response status and headers are received for the request.","liType":"bullet"},{"type":"li","text":"[`event: Page.requestFinished`] emitted when the response body is downloaded and the request is complete.","liType":"bullet"},{"type":"text","text":"If request fails at some point, then instead of `'requestfinished'` event (and possibly instead of 'response' event),↵the [`event: Page.requestFailed`] event is emitted."},{"type":"note","noteType":"note","text":"HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request will complete↵with `'requestfinished'` event."},{"type":"text","text":"If request gets a 'redirect' response, the request is successfully finished with the `requestfinished` event, and a new↵request is issued to a redirected url."}],"langs":{},"comment":"Whenever the page sends a request for a network resource the following sequence of events are emitted by `Page`:\n- [`event: Page.request`] emitted when the request is issued by the page.\n- [`event: Page.response`] emitted when/if the response status and headers are received for the request.\n- [`event: Page.requestFinished`] emitted when the response body is downloaded and the request is complete.\n\nIf request fails at some point, then instead of `'requestfinished'` event (and possibly instead of 'response'\nevent), the [`event: Page.requestFailed`] event is emitted.\n\n**NOTE** HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request\nwill complete with `'requestfinished'` event.\n\nIf request gets a 'redirect' response, the request is successfully finished with the `requestfinished` event, and a\nnew request is issued to a redirected url.","since":"v1.8","members":[{"kind":"method","langs":{},"since":"v1.15","name":"allHeaders","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"An object with all the request HTTP headers associated with this request. The header names are lower-cased."}],"required":true,"comment":"An object with all the request HTTP headers associated with this request. The header names are lower-cased.","async":true,"alias":"allHeaders","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"types":{"js":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"errorText","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Human-readable error message, e.g. `'net::ERR_FAILED'`."}],"argsArray":[],"required":true,"comment":"","args":{},"clazz":null,"async":false,"alias":"errorText","overloadIndex":0,"paramOrOption":null}]}],"expression":"[null]|[Object]"}}},"since":"v1.8","name":"failure","type":{"name":"","union":[{"name":"null"},{"name":"string"}],"expression":"[null]|[string]"},"spec":[{"type":"text","text":"The method returns `null` unless this request has failed, as reported by `requestfailed` event."},{"type":"text","text":"**Usage**"},{"type":"text","text":"Example of logging of all the failed requests:"},{"type":"code","lines":["page.on('requestfailed', request => {"," console.log(request.url() + ' ' + request.failure().errorText);","});"],"codeLang":"js"},{"type":"code","lines":["page.onRequestFailed(request -> {"," System.out.println(request.url() + \" \" + request.failure());","});"],"codeLang":"java"},{"type":"code","lines":["page.on(\"requestfailed\", lambda request: print(request.url + \" \" + request.failure))"],"codeLang":"py"},{"type":"code","lines":["page.RequestFailed += (_, request) =>","{"," Console.WriteLine(request.Failure);","};"],"codeLang":"csharp"}],"required":true,"comment":"The method returns `null` unless this request has failed, as reported by `requestfailed` event.\n\n**Usage**\n\nExample of logging of all the failed requests:\n\n```js\npage.on('requestfailed', request => {\n console.log(request.url() + ' ' + request.failure().errorText);\n});\n```\n\n```java\npage.onRequestFailed(request -> {\n System.out.println(request.url() + \" \" + request.failure());\n});\n```\n\n```py\npage.on(\"requestfailed\", lambda request: print(request.url + \" \" + request.failure))\n```\n\n```csharp\npage.RequestFailed += (_, request) =>\n{\n Console.WriteLine(request.Failure);\n};\n```\n","async":false,"alias":"failure","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"frame","type":{"name":"Frame","expression":"[Frame]"},"spec":[{"type":"text","text":"Returns the `Frame` that initiated this request."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const frameUrl = request.frame().url();"],"codeLang":"js"},{"type":"code","lines":["String frameUrl = request.frame().url();"],"codeLang":"java"},{"type":"code","lines":["frame_url = request.frame.url"],"codeLang":"py"},{"type":"code","lines":["var frameUrl = request.Frame.Url;"],"codeLang":"csharp"},{"type":"text","text":"**Details**"},{"type":"text","text":"Note that in some cases the frame is not available, and this method will throw."},{"type":"li","text":"When request originates in the Service Worker. You can use `request.serviceWorker()` to check that.","liType":"bullet"},{"type":"li","text":"When navigation request is issued before the corresponding frame is created. You can use [`method: Request.isNavigationRequest`] to check that.","liType":"bullet"},{"type":"text","text":"Here is an example that handles all the cases:"},{"type":"code","lines":["if (request.serviceWorker())"," console.log(`request ${request.url()} from a service worker`);","else if (request.isNavigationRequest())"," console.log(`request ${request.url()} is a navigation request`);","else"," console.log(`request ${request.url()} from a frame ${request.frame().url()}`);"],"codeLang":"js"}],"required":true,"comment":"Returns the `Frame` that initiated this request.\n\n**Usage**\n\n```js\nconst frameUrl = request.frame().url();\n```\n\n```java\nString frameUrl = request.frame().url();\n```\n\n```py\nframe_url = request.frame.url\n```\n\n```csharp\nvar frameUrl = request.Frame.Url;\n```\n\n**Details**\n\nNote that in some cases the frame is not available, and this method will throw.\n- When request originates in the Service Worker. You can use `request.serviceWorker()` to check that.\n- When navigation request is issued before the corresponding frame is created. You can use\n [`method: Request.isNavigationRequest`] to check that.\n\nHere is an example that handles all the cases:\n\n```js\nif (request.serviceWorker())\n console.log(`request ${request.url()} from a service worker`);\nelse if (request.isNavigationRequest())\n console.log(`request ${request.url()} is a navigation request`);\nelse\n console.log(`request ${request.url()} from a frame ${request.frame().url()}`);\n```\n","async":false,"alias":"frame","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"headers","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"An object with the request HTTP headers. The header names are lower-cased.↵Note that this method does not return security-related headers, including cookie-related ones.↵You can use [`method: Request.allHeaders`] for complete list of headers that include `cookie` information."}],"required":true,"comment":"An object with the request HTTP headers. The header names are lower-cased. Note that this method does not return\nsecurity-related headers, including cookie-related ones. You can use [`method: Request.allHeaders`] for complete\nlist of headers that include `cookie` information.","async":false,"alias":"headers","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.15","name":"headersArray","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Name of the header."}],"required":true,"comment":"Name of the header.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Value of the header."}],"required":true,"comment":"Value of the header.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":"An array with all the request HTTP headers associated with this request. Unlike [`method: Request.allHeaders`], header names are NOT lower-cased.↵Headers with multiple entries, such as `Set-Cookie`, appear in the array multiple times."}],"required":true,"comment":"An array with all the request HTTP headers associated with this request. Unlike [`method: Request.allHeaders`],\nheader names are NOT lower-cased. Headers with multiple entries, such as `Set-Cookie`, appear in the array multiple\ntimes.","async":true,"alias":"headersArray","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.15","name":"headerValue","type":{"name":"","union":[{"name":"null"},{"name":"string"}],"expression":"[null]|[string]"},"spec":[{"type":"text","text":"Returns the value of the header matching the name. The name is case insensitive."}],"required":true,"comment":"Returns the value of the header matching the name. The name is case insensitive.","async":true,"alias":"headerValue","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.15","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Name of the header."}],"required":true,"comment":"Name of the header.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"isNavigationRequest","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether this request is driving frame's navigation."},{"type":"text","text":"Some navigation requests are issued before the corresponding frame is created, and therefore↵do not have [`method: Request.frame`] available."}],"required":true,"comment":"Whether this request is driving frame's navigation.\n\nSome navigation requests are issued before the corresponding frame is created, and therefore do not have\n[`method: Request.frame`] available.","async":false,"alias":"isNavigationRequest","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"method","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Request's method (GET, POST, etc.)"}],"required":true,"comment":"Request's method (GET, POST, etc.)","async":false,"alias":"method","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"postData","type":{"name":"","union":[{"name":"null"},{"name":"string"}],"expression":"[null]|[string]"},"spec":[{"type":"text","text":"Request's post body, if any."}],"required":true,"comment":"Request's post body, if any.","async":false,"alias":"postData","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"postDataBuffer","type":{"name":"","union":[{"name":"null"},{"name":"Buffer"}],"expression":"[null]|[Buffer]"},"spec":[{"type":"text","text":"Request's post body in a binary form, if any."}],"required":true,"comment":"Request's post body in a binary form, if any.","async":false,"alias":"postDataBuffer","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"postDataJSON","type":{"name":"","union":[{"name":"null"},{"name":"Serializable"}],"expression":"[null]|[Serializable]"},"spec":[{"type":"text","text":"Returns parsed request's body for `form-urlencoded` and JSON as a fallback if any."},{"type":"text","text":"When the response is `application/x-www-form-urlencoded` then a key/value object of the values will be returned.↵Otherwise it will be parsed as JSON."}],"required":true,"comment":"Returns parsed request's body for `form-urlencoded` and JSON as a fallback if any.\n\nWhen the response is `application/x-www-form-urlencoded` then a key/value object of the values will be returned.\nOtherwise it will be parsed as JSON.","async":false,"alias":"postDataJSON","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.12","name":"postDataJSON","type":{"name":"","union":[{"name":"null"},{"name":"JsonElement"}],"expression":"[null]|[JsonElement]"},"spec":[{"type":"text","text":"Returns parsed request's body for `form-urlencoded` and JSON as a fallback if any."},{"type":"text","text":"When the response is `application/x-www-form-urlencoded` then a key/value object of the values will be returned.↵Otherwise it will be parsed as JSON."}],"required":true,"comment":"Returns parsed request's body for `form-urlencoded` and JSON as a fallback if any.\n\nWhen the response is `application/x-www-form-urlencoded` then a key/value object of the values will be returned.\nOtherwise it will be parsed as JSON.","async":false,"alias":"postDataJSON","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"redirectedFrom","type":{"name":"","union":[{"name":"null"},{"name":"Request"}],"expression":"[null]|[Request]"},"spec":[{"type":"text","text":"Request that was redirected by the server to this one, if any."},{"type":"text","text":"When the server responds with a redirect, Playwright creates a new `Request` object. The two requests are connected by↵`redirectedFrom()` and `redirectedTo()` methods. When multiple server redirects has happened, it is possible to↵construct the whole redirect chain by repeatedly calling `redirectedFrom()`."},{"type":"text","text":"**Usage**"},{"type":"text","text":"For example, if the website `http://example.com` redirects to `https://example.com`:"},{"type":"code","lines":["const response = await page.goto('http://example.com');","console.log(response.request().redirectedFrom().url()); // 'http://example.com'"],"codeLang":"js"},{"type":"code","lines":["Response response = page.navigate(\"http://example.com\");","System.out.println(response.request().redirectedFrom().url()); // \"http://example.com\""],"codeLang":"java"},{"type":"code","lines":["response = await page.goto(\"http://example.com\")","print(response.request.redirected_from.url) # \"http://example.com\""],"codeLang":"python async"},{"type":"code","lines":["response = page.goto(\"http://example.com\")","print(response.request.redirected_from.url) # \"http://example.com\""],"codeLang":"python sync"},{"type":"code","lines":["var response = await page.GotoAsync(\"http://www.microsoft.com\");","Console.WriteLine(response.Request.RedirectedFrom?.Url); // http://www.microsoft.com"],"codeLang":"csharp"},{"type":"text","text":"If the website `https://google.com` has no redirects:"},{"type":"code","lines":["const response = await page.goto('https://google.com');","console.log(response.request().redirectedFrom()); // null"],"codeLang":"js"},{"type":"code","lines":["Response response = page.navigate(\"https://google.com\");","System.out.println(response.request().redirectedFrom()); // null"],"codeLang":"java"},{"type":"code","lines":["response = await page.goto(\"https://google.com\")","print(response.request.redirected_from) # None"],"codeLang":"python async"},{"type":"code","lines":["response = page.goto(\"https://google.com\")","print(response.request.redirected_from) # None"],"codeLang":"python sync"},{"type":"code","lines":["var response = await page.GotoAsync(\"https://www.google.com\");","Console.WriteLine(response.Request.RedirectedFrom?.Url); // null"],"codeLang":"csharp"}],"required":true,"comment":"Request that was redirected by the server to this one, if any.\n\nWhen the server responds with a redirect, Playwright creates a new `Request` object. The two requests are connected\nby `redirectedFrom()` and `redirectedTo()` methods. When multiple server redirects has happened, it is possible to\nconstruct the whole redirect chain by repeatedly calling `redirectedFrom()`.\n\n**Usage**\n\nFor example, if the website `http://example.com` redirects to `https://example.com`:\n\n```js\nconst response = await page.goto('http://example.com');\nconsole.log(response.request().redirectedFrom().url()); // 'http://example.com'\n```\n\n```java\nResponse response = page.navigate(\"http://example.com\");\nSystem.out.println(response.request().redirectedFrom().url()); // \"http://example.com\"\n```\n\n```py\nresponse = await page.goto(\"http://example.com\")\nprint(response.request.redirected_from.url) # \"http://example.com\"\n```\n\n```py\nresponse = page.goto(\"http://example.com\")\nprint(response.request.redirected_from.url) # \"http://example.com\"\n```\n\n```csharp\nvar response = await page.GotoAsync(\"http://www.microsoft.com\");\nConsole.WriteLine(response.Request.RedirectedFrom?.Url); // http://www.microsoft.com\n```\n\nIf the website `https://google.com` has no redirects:\n\n```js\nconst response = await page.goto('https://google.com');\nconsole.log(response.request().redirectedFrom()); // null\n```\n\n```java\nResponse response = page.navigate(\"https://google.com\");\nSystem.out.println(response.request().redirectedFrom()); // null\n```\n\n```py\nresponse = await page.goto(\"https://google.com\")\nprint(response.request.redirected_from) # None\n```\n\n```py\nresponse = page.goto(\"https://google.com\")\nprint(response.request.redirected_from) # None\n```\n\n```csharp\nvar response = await page.GotoAsync(\"https://www.google.com\");\nConsole.WriteLine(response.Request.RedirectedFrom?.Url); // null\n```\n","async":false,"alias":"redirectedFrom","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"redirectedTo","type":{"name":"","union":[{"name":"null"},{"name":"Request"}],"expression":"[null]|[Request]"},"spec":[{"type":"text","text":"New request issued by the browser if the server responded with redirect."},{"type":"text","text":"**Usage**"},{"type":"text","text":"This method is the opposite of [`method: Request.redirectedFrom`]:"},{"type":"code","lines":["console.log(request.redirectedFrom().redirectedTo() === request); // true"],"codeLang":"js"},{"type":"code","lines":["System.out.println(request.redirectedFrom().redirectedTo() == request); // true"],"codeLang":"java"},{"type":"code","lines":["assert request.redirected_from.redirected_to == request"],"codeLang":"py"},{"type":"code","lines":["Console.WriteLine(request.RedirectedFrom?.RedirectedTo == request); // True"],"codeLang":"csharp"}],"required":true,"comment":"New request issued by the browser if the server responded with redirect.\n\n**Usage**\n\nThis method is the opposite of [`method: Request.redirectedFrom`]:\n\n```js\nconsole.log(request.redirectedFrom().redirectedTo() === request); // true\n```\n\n```java\nSystem.out.println(request.redirectedFrom().redirectedTo() == request); // true\n```\n\n```py\nassert request.redirected_from.redirected_to == request\n```\n\n```csharp\nConsole.WriteLine(request.RedirectedFrom?.RedirectedTo == request); // True\n```\n","async":false,"alias":"redirectedTo","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"resourceType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Contains the request's resource type as it was perceived by the rendering engine. ResourceType will be one of the↵following: `document`, `stylesheet`, `image`, `media`, `font`, `script`, `texttrack`, `xhr`, `fetch`, `eventsource`,↵`websocket`, `manifest`, `other`."}],"required":true,"comment":"Contains the request's resource type as it was perceived by the rendering engine. ResourceType will be one of the\nfollowing: `document`, `stylesheet`, `image`, `media`, `font`, `script`, `texttrack`, `xhr`, `fetch`,\n`eventsource`, `websocket`, `manifest`, `other`.","async":false,"alias":"resourceType","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"response","type":{"name":"","union":[{"name":"null"},{"name":"Response"}],"expression":"[null]|[Response]"},"spec":[{"type":"text","text":"Returns the matching `Response` object, or `null` if the response was not received due to error."}],"required":true,"comment":"Returns the matching `Response` object, or `null` if the response was not received due to error.","async":true,"alias":"response","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.24","name":"serviceWorker","type":{"name":"","union":[{"name":"null"},{"name":"Worker"}],"expression":"[null]|[Worker]"},"spec":[{"type":"text","text":"The Service `Worker` that is performing the request."},{"type":"text","text":"**Details**"},{"type":"text","text":"This method is Chromium only. It's safe to call when using other browsers, but it will always be `null`."},{"type":"text","text":"Requests originated in a Service Worker do not have a [`method: Request.frame`] available."}],"required":true,"comment":"The Service `Worker` that is performing the request.\n\n**Details**\n\nThis method is Chromium only. It's safe to call when using other browsers, but it will always be `null`.\n\nRequests originated in a Service Worker do not have a [`method: Request.frame`] available.","async":false,"alias":"serviceWorker","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.15","name":"sizes","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"requestBodySize","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Size of the request body (POST data payload) in bytes. Set to 0 if there was no body."}],"required":true,"comment":"Size of the request body (POST data payload) in bytes. Set to 0 if there was no body.","async":false,"alias":"requestBodySize","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"requestHeadersSize","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Total number of bytes from the start of the HTTP request message until (and including) the double CRLF before the body."}],"required":true,"comment":"Total number of bytes from the start of the HTTP request message until (and including) the double CRLF before the\nbody.","async":false,"alias":"requestHeadersSize","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"responseBodySize","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Size of the received response body (encoded) in bytes."}],"required":true,"comment":"Size of the received response body (encoded) in bytes.","async":false,"alias":"responseBodySize","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"responseHeadersSize","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Total number of bytes from the start of the HTTP response message until (and including) the double CRLF before the body."}],"required":true,"comment":"Total number of bytes from the start of the HTTP response message until (and including) the double CRLF before the\nbody.","async":false,"alias":"responseHeadersSize","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Returns resource size information for given request."}],"required":true,"comment":"Returns resource size information for given request.","async":true,"alias":"sizes","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"timing","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"startTime","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Request start time in milliseconds elapsed since January 1, 1970 00:00:00 UTC"}],"required":true,"comment":"Request start time in milliseconds elapsed since January 1, 1970 00:00:00 UTC","async":false,"alias":"startTime","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"domainLookupStart","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time immediately before the browser starts the domain name lookup for the↵resource. The value is given in milliseconds relative to `startTime`, -1 if not available."}],"required":true,"comment":"Time immediately before the browser starts the domain name lookup for the resource. The value is given in\nmilliseconds relative to `startTime`, -1 if not available.","async":false,"alias":"domainLookupStart","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"domainLookupEnd","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time immediately after the browser starts the domain name lookup for the resource.↵The value is given in milliseconds relative to `startTime`, -1 if not available."}],"required":true,"comment":"Time immediately after the browser starts the domain name lookup for the resource. The value is given in\nmilliseconds relative to `startTime`, -1 if not available.","async":false,"alias":"domainLookupEnd","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"connectStart","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time immediately before the user agent starts establishing the connection to the server↵to retrieve the resource. The value is given in milliseconds relative to `startTime`, -1 if not available."}],"required":true,"comment":"Time immediately before the user agent starts establishing the connection to the server to retrieve the resource.\nThe value is given in milliseconds relative to `startTime`, -1 if not available.","async":false,"alias":"connectStart","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"secureConnectionStart","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time immediately before the browser starts the handshake process to secure the↵current connection. The value is given in milliseconds relative to `startTime`, -1 if not available."}],"required":true,"comment":"Time immediately before the browser starts the handshake process to secure the current connection. The value is\ngiven in milliseconds relative to `startTime`, -1 if not available.","async":false,"alias":"secureConnectionStart","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"connectEnd","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time immediately before the user agent starts establishing the connection to the server↵to retrieve the resource. The value is given in milliseconds relative to `startTime`, -1 if not available."}],"required":true,"comment":"Time immediately before the user agent starts establishing the connection to the server to retrieve the resource.\nThe value is given in milliseconds relative to `startTime`, -1 if not available.","async":false,"alias":"connectEnd","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"requestStart","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time immediately before the browser starts requesting the resource from the server,↵cache, or local resource. The value is given in milliseconds relative to `startTime`, -1 if not available."}],"required":true,"comment":"Time immediately before the browser starts requesting the resource from the server, cache, or local resource. The\nvalue is given in milliseconds relative to `startTime`, -1 if not available.","async":false,"alias":"requestStart","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"responseStart","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time immediately after the browser receives the first byte of the response from the server,↵cache, or local resource. The value is given in milliseconds relative to `startTime`, -1 if not available."}],"required":true,"comment":"Time immediately after the browser receives the first byte of the response from the server, cache, or local\nresource. The value is given in milliseconds relative to `startTime`, -1 if not available.","async":false,"alias":"responseStart","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"responseEnd","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Time immediately after the browser receives the last byte of the resource or immediately↵before the transport connection is closed, whichever comes first. The value is given in milliseconds relative to↵`startTime`, -1 if not available."}],"required":true,"comment":"Time immediately after the browser receives the last byte of the resource or immediately before the transport\nconnection is closed, whichever comes first. The value is given in milliseconds relative to `startTime`, -1 if not\navailable.","async":false,"alias":"responseEnd","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Returns resource timing information for given request. Most of the timing values become available upon the response,↵`responseEnd` becomes available when request finishes. Find more information at↵[Resource Timing API](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming)."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["const requestFinishedPromise = page.waitForEvent('requestfinished');","await page.goto('http://example.com');","const request = await requestFinishedPromise;","console.log(request.timing());"],"codeLang":"js"},{"type":"code","lines":["page.onRequestFinished(request -> {"," Timing timing = request.timing();"," System.out.println(timing.responseEnd - timing.startTime);","});","page.navigate(\"http://example.com\");"],"codeLang":"java"},{"type":"code","lines":["async with page.expect_event(\"requestfinished\") as request_info:"," await page.goto(\"http://example.com\")","request = await request_info.value","print(request.timing)"],"codeLang":"python async"},{"type":"code","lines":["with page.expect_event(\"requestfinished\") as request_info:"," page.goto(\"http://example.com\")","request = request_info.value","print(request.timing)"],"codeLang":"python sync"},{"type":"code","lines":["var request = await page.RunAndWaitForRequestFinishedAsync(async () =>","{"," await page.GotoAsync(\"https://www.microsoft.com\");","});","Console.WriteLine(request.Timing.ResponseEnd);"],"codeLang":"csharp"}],"required":true,"comment":"Returns resource timing information for given request. Most of the timing values become available upon the\nresponse, `responseEnd` becomes available when request finishes. Find more information at\n[Resource Timing API](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming).\n\n**Usage**\n\n```js\nconst requestFinishedPromise = page.waitForEvent('requestfinished');\nawait page.goto('http://example.com');\nconst request = await requestFinishedPromise;\nconsole.log(request.timing());\n```\n\n```java\npage.onRequestFinished(request -> {\n Timing timing = request.timing();\n System.out.println(timing.responseEnd - timing.startTime);\n});\npage.navigate(\"http://example.com\");\n```\n\n```py\nasync with page.expect_event(\"requestfinished\") as request_info:\n await page.goto(\"http://example.com\")\nrequest = await request_info.value\nprint(request.timing)\n```\n\n```py\nwith page.expect_event(\"requestfinished\") as request_info:\n page.goto(\"http://example.com\")\nrequest = request_info.value\nprint(request.timing)\n```\n\n```csharp\nvar request = await page.RunAndWaitForRequestFinishedAsync(async () =>\n{\n await page.GotoAsync(\"https://www.microsoft.com\");\n});\nConsole.WriteLine(request.Timing.ResponseEnd);\n```\n","async":false,"alias":"timing","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"url","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"URL of the request."}],"required":true,"comment":"URL of the request.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null,"args":[]}]},{"name":"RequestOptions","spec":[{"type":"text","text":"The `RequestOptions` allows to create form data to be sent via `APIRequestContext`. Playwright will automatically↵determine content type of the request."},{"type":"code","lines":["context.request().post("," \"https://example.com/submit\","," RequestOptions.create()"," .setQueryParam(\"page\", 1)"," .setData(\"My data\"));"],"codeLang":"java"},{"type":"text","text":"**Uploading html form data**"},{"type":"text","text":"`FormData` class can be used to send a form to the server, by default the request will use `application/x-www-form-urlencoded` encoding:"},{"type":"code","lines":["context.request().post(\"https://example.com/signup\", RequestOptions.create().setForm("," FormData.create()"," .set(\"firstName\", \"John\")"," .set(\"lastName\", \"Doe\")));"],"codeLang":"java"},{"type":"text","text":"You can also send files as fields of an html form. The data will be encoded using [`multipart/form-data`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST):"},{"type":"code","lines":["Path path = Paths.get(\"members.csv\");","APIResponse response = context.request().post(\"https://example.com/upload_members\","," RequestOptions.create().setMultipart(FormData.create().set(\"membersList\", path)));"],"codeLang":"java"},{"type":"text","text":"Alternatively, you can build the file payload manually:"},{"type":"code","lines":["FilePayload filePayload = new FilePayload(\"members.csv\", \"text/csv\","," \"Alice, 33\\nJohn, 35\\n\".getBytes(StandardCharsets.UTF_8));","APIResponse response = context.request().post(\"https://example.com/upload_members\","," RequestOptions.create().setMultipart(FormData.create().set(\"membersList\", filePayload)));"],"codeLang":"java"}],"langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"comment":"The `RequestOptions` allows to create form data to be sent via `APIRequestContext`. Playwright will automatically\ndetermine content type of the request.\n\n```java\ncontext.request().post(\n \"https://example.com/submit\",\n RequestOptions.create()\n .setQueryParam(\"page\", 1)\n .setData(\"My data\"));\n```\n\n**Uploading html form data**\n\n`FormData` class can be used to send a form to the server, by default the request will use\n`application/x-www-form-urlencoded` encoding:\n\n```java\ncontext.request().post(\"https://example.com/signup\", RequestOptions.create().setForm(\n FormData.create()\n .set(\"firstName\", \"John\")\n .set(\"lastName\", \"Doe\")));\n```\n\nYou can also send files as fields of an html form. The data will be encoded using\n[`multipart/form-data`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST):\n\n```java\nPath path = Paths.get(\"members.csv\");\nAPIResponse response = context.request().post(\"https://example.com/upload_members\",\n RequestOptions.create().setMultipart(FormData.create().set(\"membersList\", path)));\n```\n\nAlternatively, you can build the file payload manually:\n\n```java\nFilePayload filePayload = new FilePayload(\"members.csv\", \"text/csv\",\n \"Alice, 33\\nJohn, 35\\n\".getBytes(StandardCharsets.UTF_8));\nAPIResponse response = context.request().post(\"https://example.com/upload_members\",\n RequestOptions.create().setMultipart(FormData.create().set(\"membersList\", filePayload)));\n```\n","since":"v1.18","members":[{"kind":"method","langs":{},"since":"v1.18","name":"create","type":{"name":"RequestOptions","expression":"[RequestOptions]"},"spec":[{"type":"text","text":"Creates new instance of `RequestOptions`."}],"required":true,"comment":"Creates new instance of `RequestOptions`.","async":false,"alias":"create","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.18","name":"setData","type":{"name":"RequestOptions","expression":"[RequestOptions]"},"spec":[{"type":"text","text":"Sets the request's post data."}],"required":true,"comment":"Sets the request's post data.","async":false,"alias":"setData","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"data","type":{"name":"","union":[{"name":"string"},{"name":"Buffer"},{"name":"Serializable"}],"expression":"[string]|[Buffer]|[Serializable]"},"spec":[{"type":"text","text":"Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string↵and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will be↵set to `application/octet-stream` if not explicitly set."}],"required":true,"comment":"Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string\nand `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`\nheader will be set to `application/octet-stream` if not explicitly set.","async":false,"alias":"data","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.18","name":"setFailOnStatusCode","type":{"name":"RequestOptions","expression":"[RequestOptions]"},"spec":[],"required":true,"comment":"","async":false,"alias":"setFailOnStatusCode","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"failOnStatusCode","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to throw on response codes other than 2xx and 3xx. By default response object is returned↵for all status codes."}],"required":true,"comment":"Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status\ncodes.","async":false,"alias":"failOnStatusCode","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.18","name":"setForm","type":{"name":"RequestOptions","expression":"[RequestOptions]"},"spec":[{"type":"text","text":"Provides `FormData` object that will be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `application/x-www-form-urlencoded`↵unless explicitly provided."}],"required":true,"comment":"Provides `FormData` object that will be serialized as html form using `application/x-www-form-urlencoded` encoding\nand sent as this request body. If this parameter is specified `content-type` header will be set to\n`application/x-www-form-urlencoded` unless explicitly provided.","async":false,"alias":"setForm","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"form","type":{"name":"FormData","expression":"[FormData]"},"spec":[{"type":"text","text":"Form data to be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as↵this request body."}],"required":true,"comment":"Form data to be serialized as html form using `application/x-www-form-urlencoded` encoding and sent as this request\nbody.","async":false,"alias":"form","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.18","name":"setHeader","type":{"name":"RequestOptions","expression":"[RequestOptions]"},"spec":[{"type":"text","text":"Sets an HTTP header to the request. This header will apply to the fetched request as well as any redirects initiated by it."}],"required":true,"comment":"Sets an HTTP header to the request. This header will apply to the fetched request as well as any redirects\ninitiated by it.","async":false,"alias":"setHeader","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Header name."}],"required":true,"comment":"Header name.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.18","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Header value."}],"required":true,"comment":"Header value.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.18","name":"setIgnoreHTTPSErrors","type":{"name":"RequestOptions","expression":"[RequestOptions]"},"spec":[],"required":true,"comment":"","async":false,"alias":"setIgnoreHTTPSErrors","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"ignoreHTTPSErrors","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to ignore HTTPS errors when sending network requests."}],"required":true,"comment":"Whether to ignore HTTPS errors when sending network requests.","async":false,"alias":"ignoreHTTPSErrors","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.26","name":"setMaxRedirects","type":{"name":"RequestOptions","expression":"[RequestOptions]"},"spec":[],"required":true,"comment":"","async":false,"alias":"setMaxRedirects","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.26","name":"maxRedirects","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is exceeded.↵Defaults to `20`. Pass `0` to not follow redirects."}],"required":true,"comment":"Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is\nexceeded. Defaults to `20`. Pass `0` to not follow redirects.","async":false,"alias":"maxRedirects","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.18","name":"setMethod","type":{"name":"RequestOptions","expression":"[RequestOptions]"},"spec":[{"type":"text","text":"Changes the request method (e.g. [PUT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT) or↵[POST](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST))."}],"required":true,"comment":"Changes the request method (e.g. [PUT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT) or\n[POST](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST)).","async":false,"alias":"setMethod","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"method","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Request method, e.g. [POST](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST)."}],"required":true,"comment":"Request method, e.g. [POST](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST).","async":false,"alias":"method","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.18","name":"setMultipart","type":{"name":"RequestOptions","expression":"[RequestOptions]"},"spec":[{"type":"text","text":"Provides `FormData` object that will be serialized as html form using `multipart/form-data` encoding and sent as↵this request body. If this parameter is specified `content-type` header will be set to `multipart/form-data`↵unless explicitly provided."}],"required":true,"comment":"Provides `FormData` object that will be serialized as html form using `multipart/form-data` encoding and sent as\nthis request body. If this parameter is specified `content-type` header will be set to `multipart/form-data` unless\nexplicitly provided.","async":false,"alias":"setMultipart","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"form","type":{"name":"FormData","expression":"[FormData]"},"spec":[{"type":"text","text":"Form data to be serialized as html form using `multipart/form-data` encoding and sent as↵this request body."}],"required":true,"comment":"Form data to be serialized as html form using `multipart/form-data` encoding and sent as this request body.","async":false,"alias":"form","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.18","name":"setQueryParam","type":{"name":"RequestOptions","expression":"[RequestOptions]"},"spec":[{"type":"text","text":"Adds a query parameter to the request URL."}],"required":true,"comment":"Adds a query parameter to the request URL.","async":false,"alias":"setQueryParam","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Parameter name."}],"required":true,"comment":"Parameter name.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.18","name":"value","type":{"name":"","union":[{"name":"string"},{"name":"boolean"},{"name":"int"}],"expression":"[string]|[boolean]|[int]"},"spec":[{"type":"text","text":"Parameter value."}],"required":true,"comment":"Parameter value.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.18","name":"setTimeout","type":{"name":"RequestOptions","expression":"[RequestOptions]"},"spec":[{"type":"text","text":"Sets request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout."}],"required":true,"comment":"Sets request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.","async":false,"alias":"setTimeout","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.18","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Request timeout in milliseconds."}],"required":true,"comment":"Request timeout in milliseconds.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]}]},{"name":"Response","spec":[{"type":"text","text":"`Response` class represents responses which are received by page."}],"langs":{},"comment":"`Response` class represents responses which are received by page.","since":"v1.8","members":[{"kind":"method","langs":{},"since":"v1.15","name":"allHeaders","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"An object with all the response HTTP headers associated with this response."}],"required":true,"comment":"An object with all the response HTTP headers associated with this response.","async":true,"alias":"allHeaders","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"body","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"Returns the buffer with response body."}],"required":true,"comment":"Returns the buffer with response body.","async":true,"alias":"body","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"types":{"js":{"name":"","union":[{"name":"null"},{"name":"Error"}],"expression":"[null]|[Error]"}}},"since":"v1.8","name":"finished","type":{"name":"","union":[{"name":"null"},{"name":"string"}],"expression":"[null]|[string]"},"spec":[{"type":"text","text":"Waits for this response to finish, returns always `null`."}],"required":true,"comment":"Waits for this response to finish, returns always `null`.","async":true,"alias":"finished","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"frame","type":{"name":"Frame","expression":"[Frame]"},"spec":[{"type":"text","text":"Returns the `Frame` that initiated this response."}],"required":true,"comment":"Returns the `Frame` that initiated this response.","async":false,"alias":"frame","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.23","name":"fromServiceWorker","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Indicates whether this Response was fulfilled by a Service Worker's Fetch Handler (i.e. via [FetchEvent.respondWith](https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent/respondWith))."}],"required":true,"comment":"Indicates whether this Response was fulfilled by a Service Worker's Fetch Handler (i.e. via\n[FetchEvent.respondWith](https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent/respondWith)).","async":false,"alias":"fromServiceWorker","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"headers","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"An object with the response HTTP headers. The header names are lower-cased.↵Note that this method does not return security-related headers, including cookie-related ones.↵You can use [`method: Response.allHeaders`] for complete list of headers that include `cookie` information."}],"required":true,"comment":"An object with the response HTTP headers. The header names are lower-cased. Note that this method does not return\nsecurity-related headers, including cookie-related ones. You can use [`method: Response.allHeaders`] for complete\nlist of headers that include `cookie` information.","async":false,"alias":"headers","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.15","name":"headersArray","type":{"name":"Array","templates":[{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Name of the header."}],"required":true,"comment":"Name of the header.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"value","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Value of the header."}],"required":true,"comment":"Value of the header.","async":false,"alias":"value","overloadIndex":0,"paramOrOption":null}]}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":"An array with all the request HTTP headers associated with this response. Unlike [`method: Response.allHeaders`], header names are NOT lower-cased.↵Headers with multiple entries, such as `Set-Cookie`, appear in the array multiple times."}],"required":true,"comment":"An array with all the request HTTP headers associated with this response. Unlike [`method: Response.allHeaders`],\nheader names are NOT lower-cased. Headers with multiple entries, such as `Set-Cookie`, appear in the array multiple\ntimes.","async":true,"alias":"headersArray","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.15","name":"headerValue","type":{"name":"","union":[{"name":"null"},{"name":"string"}],"expression":"[null]|[string]"},"spec":[{"type":"text","text":"Returns the value of the header matching the name. The name is case insensitive. If multiple headers have↵the same name (except `set-cookie`), they are returned as a list separated by `, `. For `set-cookie`, the `\\n` separator is used. If no headers are found, `null` is returned."}],"required":true,"comment":"Returns the value of the header matching the name. The name is case insensitive. If multiple headers have the same\nname (except `set-cookie`), they are returned as a list separated by `, `. For `set-cookie`, the `\\n` separator is\nused. If no headers are found, `null` is returned.","async":true,"alias":"headerValue","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.15","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Name of the header."}],"required":true,"comment":"Name of the header.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.15","name":"headerValues","type":{"name":"Array","templates":[{"name":"string"}],"expression":"[Array]<[string]>"},"spec":[{"type":"text","text":"Returns all values of the headers matching the name, for example `set-cookie`. The name is case insensitive."}],"required":true,"comment":"Returns all values of the headers matching the name, for example `set-cookie`. The name is case insensitive.","async":true,"alias":"headerValues","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.15","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Name of the header."}],"required":true,"comment":"Name of the header.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"json","type":{"name":"Serializable","expression":"[Serializable]"},"spec":[{"type":"text","text":"Returns the JSON representation of response body."},{"type":"text","text":"This method will throw if the response body is not parsable via `JSON.parse`."}],"required":true,"comment":"Returns the JSON representation of response body.\n\nThis method will throw if the response body is not parsable via `JSON.parse`.","async":true,"alias":"json","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"json","type":{"name":"","union":[{"name":"null"},{"name":"JsonElement"}],"expression":"[null]|[JsonElement]"},"spec":[{"type":"text","text":"Returns the JSON representation of response body."},{"type":"text","text":"This method will throw if the response body is not parsable via `JSON.parse`."}],"required":true,"comment":"Returns the JSON representation of response body.\n\nThis method will throw if the response body is not parsable via `JSON.parse`.","async":true,"alias":"json","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"ok","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Contains a boolean stating whether the response was successful (status in the range 200-299) or not."}],"required":true,"comment":"Contains a boolean stating whether the response was successful (status in the range 200-299) or not.","async":false,"alias":"ok","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"request","type":{"name":"Request","expression":"[Request]"},"spec":[{"type":"text","text":"Returns the matching `Request` object."}],"required":true,"comment":"Returns the matching `Request` object.","async":false,"alias":"request","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.13","name":"securityDetails","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"issuer","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Common Name component of the Issuer field.↵from the certificate. This should only be used for informational purposes. Optional."}],"required":false,"comment":"Common Name component of the Issuer field. from the certificate. This should only be used for informational\npurposes. Optional.","async":false,"alias":"issuer","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"protocol","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"The specific TLS protocol used. (e.g. `TLS 1.3`). Optional."}],"required":false,"comment":"The specific TLS protocol used. (e.g. `TLS 1.3`). Optional.","async":false,"alias":"protocol","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"subjectName","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Common Name component of the Subject↵field from the certificate. This should only be used for informational purposes. Optional."}],"required":false,"comment":"Common Name component of the Subject field from the certificate. This should only be used for informational\npurposes. Optional.","async":false,"alias":"subjectName","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"validFrom","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Unix timestamp (in seconds) specifying↵when this cert becomes valid. Optional."}],"required":false,"comment":"Unix timestamp (in seconds) specifying when this cert becomes valid. Optional.","async":false,"alias":"validFrom","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"validTo","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Unix timestamp (in seconds) specifying↵when this cert becomes invalid. Optional."}],"required":false,"comment":"Unix timestamp (in seconds) specifying when this cert becomes invalid. Optional.","async":false,"alias":"validTo","overloadIndex":0,"paramOrOption":null}]}],"expression":"[null]|[Object]"},"spec":[{"type":"text","text":"Returns SSL and other security information."}],"required":true,"comment":"Returns SSL and other security information.","async":true,"alias":"securityDetails","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.13","name":"serverAddr","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"ipAddress","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"IPv4 or IPV6 address of the server."}],"required":true,"comment":"IPv4 or IPV6 address of the server.","async":false,"alias":"ipAddress","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"port","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","async":false,"alias":"port","overloadIndex":0,"paramOrOption":null}]}],"expression":"[null]|[Object]"},"spec":[{"type":"text","text":"Returns the IP address and port of the server."}],"required":true,"comment":"Returns the IP address and port of the server.","async":true,"alias":"serverAddr","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"status","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Contains the status code of the response (e.g., 200 for a success)."}],"required":true,"comment":"Contains the status code of the response (e.g., 200 for a success).","async":false,"alias":"status","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"statusText","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Contains the status text of the response (e.g. usually an \"OK\" for a success)."}],"required":true,"comment":"Contains the status text of the response (e.g. usually an \"OK\" for a success).","async":false,"alias":"statusText","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"text","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Returns the text representation of response body."}],"required":true,"comment":"Returns the text representation of response body.","async":true,"alias":"text","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"url","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Contains the URL of the response."}],"required":true,"comment":"Contains the URL of the response.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null,"args":[]}]},{"name":"Route","spec":[{"type":"text","text":"Whenever a network route is set up with [`method: Page.route`] or [`method: BrowserContext.route`], the `Route` object↵allows to handle the route."},{"type":"text","text":"Learn more about [networking](../network.md)."}],"langs":{},"comment":"Whenever a network route is set up with [`method: Page.route`] or [`method: BrowserContext.route`], the `Route`\nobject allows to handle the route.\n\nLearn more about [networking](../network.md).","since":"v1.8","members":[{"kind":"method","langs":{},"since":"v1.8","name":"abort","type":{"name":"void"},"spec":[{"type":"text","text":"Aborts the route's request."}],"required":true,"comment":"Aborts the route's request.","async":true,"alias":"abort","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"errorCode","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional error code. Defaults to `failed`, could be one of the following:"},{"type":"li","text":"`'aborted'` - An operation was aborted (due to user action)","liType":"bullet"},{"type":"li","text":"`'accessdenied'` - Permission to access a resource, other than the network, was denied","liType":"bullet"},{"type":"li","text":"`'addressunreachable'` - The IP address is unreachable. This usually means that there is no route to the specified↵host or network.","liType":"bullet"},{"type":"li","text":"`'blockedbyclient'` - The client chose to block the request.","liType":"bullet"},{"type":"li","text":"`'blockedbyresponse'` - The request failed because the response was delivered along with requirements which are not↵met ('X-Frame-Options' and 'Content-Security-Policy' ancestor checks, for instance).","liType":"bullet"},{"type":"li","text":"`'connectionaborted'` - A connection timed out as a result of not receiving an ACK for data sent.","liType":"bullet"},{"type":"li","text":"`'connectionclosed'` - A connection was closed (corresponding to a TCP FIN).","liType":"bullet"},{"type":"li","text":"`'connectionfailed'` - A connection attempt failed.","liType":"bullet"},{"type":"li","text":"`'connectionrefused'` - A connection attempt was refused.","liType":"bullet"},{"type":"li","text":"`'connectionreset'` - A connection was reset (corresponding to a TCP RST).","liType":"bullet"},{"type":"li","text":"`'internetdisconnected'` - The Internet connection has been lost.","liType":"bullet"},{"type":"li","text":"`'namenotresolved'` - The host name could not be resolved.","liType":"bullet"},{"type":"li","text":"`'timedout'` - An operation timed out.","liType":"bullet"},{"type":"li","text":"`'failed'` - A generic failure occurred.","liType":"bullet"}],"required":false,"comment":"Optional error code. Defaults to `failed`, could be one of the following:\n- `'aborted'` - An operation was aborted (due to user action)\n- `'accessdenied'` - Permission to access a resource, other than the network, was denied\n- `'addressunreachable'` - The IP address is unreachable. This usually means that there is no route to the\n specified host or network.\n- `'blockedbyclient'` - The client chose to block the request.\n- `'blockedbyresponse'` - The request failed because the response was delivered along with requirements which are\n not met ('X-Frame-Options' and 'Content-Security-Policy' ancestor checks, for instance).\n- `'connectionaborted'` - A connection timed out as a result of not receiving an ACK for data sent.\n- `'connectionclosed'` - A connection was closed (corresponding to a TCP FIN).\n- `'connectionfailed'` - A connection attempt failed.\n- `'connectionrefused'` - A connection attempt was refused.\n- `'connectionreset'` - A connection was reset (corresponding to a TCP RST).\n- `'internetdisconnected'` - The Internet connection has been lost.\n- `'namenotresolved'` - The host name could not be resolved.\n- `'timedout'` - An operation timed out.\n- `'failed'` - A generic failure occurred.","async":false,"alias":"errorCode","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"aliases":{"java":"resume","python":"continue_"},"types":{},"overrides":{}},"since":"v1.8","name":"continue","type":{"name":"void"},"spec":[{"type":"text","text":"Continues route's request with optional overrides."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.route('**/*', async (route, request) => {"," // Override headers"," const headers = {"," ...request.headers(),"," foo: 'foo-value', // set \"foo\" header"," bar: undefined, // remove \"bar\" header"," };"," await route.continue({ headers });","});"],"codeLang":"js"},{"type":"code","lines":["page.route(\"**/*\", route -> {"," // Override headers"," Map<String, String> headers = new HashMap<>(route.request().headers());"," headers.put(\"foo\", \"foo-value\"); // set \"foo\" header"," headers.remove(\"bar\"); // remove \"bar\" header"," route.resume(new Route.ResumeOptions().setHeaders(headers));","});"],"codeLang":"java"},{"type":"code","lines":["async def handle(route, request):"," # override headers"," headers = {"," **request.headers,"," \"foo\": \"foo-value\", # set \"foo\" header"," \"bar\": None # remove \"bar\" header"," }"," await route.continue_(headers=headers)","","await page.route(\"**/*\", handle)"],"codeLang":"python async"},{"type":"code","lines":["def handle(route, request):"," # override headers"," headers = {"," **request.headers,"," \"foo\": \"foo-value\", # set \"foo\" header"," \"bar\": None # remove \"bar\" header"," }"," route.continue_(headers=headers)","","page.route(\"**/*\", handle)"],"codeLang":"python sync"},{"type":"code","lines":["await page.RouteAsync(\"**/*\", async route =>","{"," var headers = new Dictionary<string, string>(route.Request.Headers) { { \"foo\", \"bar\" } };"," headers.Remove(\"origin\");"," await route.ContinueAsync(new() { Headers = headers });","});"],"codeLang":"csharp"},{"type":"text","text":"**Details**"},{"type":"text","text":"Note that any overrides such as `url` or `headers` only apply to the request being routed. If this request results in a redirect, overrides will not be applied to the new redirected request. If you want to propagate a header through redirects, use the combination of [`method: Route.fetch`] and [`method: Route.fulfill`] instead."}],"required":true,"comment":"Continues route's request with optional overrides.\n\n**Usage**\n\n```js\nawait page.route('**/*', async (route, request) => {\n // Override headers\n const headers = {\n ...request.headers(),\n foo: 'foo-value', // set \"foo\" header\n bar: undefined, // remove \"bar\" header\n };\n await route.continue({ headers });\n});\n```\n\n```java\npage.route(\"**/*\", route -> {\n // Override headers\n Map<String, String> headers = new HashMap<>(route.request().headers());\n headers.put(\"foo\", \"foo-value\"); // set \"foo\" header\n headers.remove(\"bar\"); // remove \"bar\" header\n route.resume(new Route.ResumeOptions().setHeaders(headers));\n});\n```\n\n```py\nasync def handle(route, request):\n # override headers\n headers = {\n **request.headers,\n \"foo\": \"foo-value\", # set \"foo\" header\n \"bar\": None # remove \"bar\" header\n }\n await route.continue_(headers=headers)\n\nawait page.route(\"**/*\", handle)\n```\n\n```py\ndef handle(route, request):\n # override headers\n headers = {\n **request.headers,\n \"foo\": \"foo-value\", # set \"foo\" header\n \"bar\": None # remove \"bar\" header\n }\n route.continue_(headers=headers)\n\npage.route(\"**/*\", handle)\n```\n\n```csharp\nawait page.RouteAsync(\"**/*\", async route =>\n{\n var headers = new Dictionary<string, string>(route.Request.Headers) { { \"foo\", \"bar\" } };\n headers.Remove(\"origin\");\n await route.ContinueAsync(new() { Headers = headers });\n});\n```\n\n**Details**\n\nNote that any overrides such as `url` or `headers` only apply to the request being routed. If this request results\nin a redirect, overrides will not be applied to the new redirected request. If you want to propagate a header\nthrough redirects, use the combination of [`method: Route.fetch`] and [`method: Route.fulfill`] instead.","async":true,"alias":"continue","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"headers","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"If set changes the request HTTP headers. Header values will be converted to a string."}],"required":false,"comment":"If set changes the request HTTP headers. Header values will be converted to a string.","async":false,"alias":"headers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"method","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"If set changes the request method (e.g. GET or POST)."}],"required":false,"comment":"If set changes the request method (e.g. GET or POST).","async":false,"alias":"method","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"postData","type":{"name":"","union":[{"name":"string"},{"name":"Buffer"},{"name":"Serializable"}],"expression":"[string]|[Buffer]|[Serializable]"},"spec":[{"type":"text","text":"If set changes the post data of request."}],"required":false,"comment":"If set changes the post data of request.","async":false,"alias":"postData","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"postData","type":{"name":"","union":[{"name":"string"},{"name":"Buffer"}],"expression":"[string]|[Buffer]"},"spec":[{"type":"text","text":"If set changes the post data of request."}],"required":false,"comment":"If set changes the post data of request.","async":false,"alias":"postData","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"postData","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"If set changes the post data of request."}],"required":false,"comment":"If set changes the post data of request.","async":false,"alias":"postData","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"url","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"If set changes the request URL. New URL must have same protocol as original one."}],"required":false,"comment":"If set changes the request URL. New URL must have same protocol as original one.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.23","name":"fallback","type":{"name":"void"},"spec":[{"type":"text","text":"When several routes match the given pattern, they run in the order opposite to their registration.↵That way the last registered route can always override all the previous ones. In the example below,↵request will be handled by the bottom-most handler first, then it'll fall back to the previous one and↵in the end will be aborted by the first registered route."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.route('**/*', async route => {"," // Runs last."," await route.abort();","});","await page.route('**/*', async route => {"," // Runs second."," await route.fallback();","});","await page.route('**/*', async route => {"," // Runs first."," await route.fallback();","});"],"codeLang":"js"},{"type":"code","lines":["page.route(\"**/*\", route -> {"," // Runs last."," route.abort();","});","","page.route(\"**/*\", route -> {"," // Runs second."," route.fallback();","});","","page.route(\"**/*\", route -> {"," // Runs first."," route.fallback();","});"],"codeLang":"java"},{"type":"code","lines":["await page.route(\"**/*\", lambda route: route.abort()) # Runs last.","await page.route(\"**/*\", lambda route: route.fallback()) # Runs second.","await page.route(\"**/*\", lambda route: route.fallback()) # Runs first."],"codeLang":"python async"},{"type":"code","lines":["page.route(\"**/*\", lambda route: route.abort()) # Runs last.","page.route(\"**/*\", lambda route: route.fallback()) # Runs second.","page.route(\"**/*\", lambda route: route.fallback()) # Runs first."],"codeLang":"python sync"},{"type":"code","lines":["await page.RouteAsync(\"**/*\", route => {"," // Runs last."," await route.AbortAsync();","});","","await page.RouteAsync(\"**/*\", route => {"," // Runs second."," await route.FallbackAsync();","});","","await page.RouteAsync(\"**/*\", route => {"," // Runs first."," await route.FallbackAsync();","});"],"codeLang":"csharp"},{"type":"text","text":"Registering multiple routes is useful when you want separate handlers to↵handle different kinds of requests, for example API calls vs page resources or↵GET requests vs POST requests as in the example below."},{"type":"code","lines":["// Handle GET requests.","await page.route('**/*', async route => {"," if (route.request().method() !== 'GET') {"," await route.fallback();"," return;"," }"," // Handling GET only."," // ...","});","","// Handle POST requests.","await page.route('**/*', async route => {"," if (route.request().method() !== 'POST') {"," await route.fallback();"," return;"," }"," // Handling POST only."," // ...","});"],"codeLang":"js"},{"type":"code","lines":["// Handle GET requests.","page.route(\"**/*\", route -> {"," if (!route.request().method().equals(\"GET\")) {"," route.fallback();"," return;"," }"," // Handling GET only."," // ...","});","","// Handle POST requests.","page.route(\"**/*\", route -> {"," if (!route.request().method().equals(\"POST\")) {"," route.fallback();"," return;"," }"," // Handling POST only."," // ...","});"],"codeLang":"java"},{"type":"code","lines":["# Handle GET requests.","async def handle_get(route):"," if route.request.method != \"GET\":"," await route.fallback()"," return"," # Handling GET only."," # ...","","# Handle POST requests.","async def handle_post(route):"," if route.request.method != \"POST\":"," await route.fallback()"," return"," # Handling POST only."," # ...","","await page.route(\"**/*\", handle_get)","await page.route(\"**/*\", handle_post)"],"codeLang":"python async"},{"type":"code","lines":["# Handle GET requests.","def handle_get(route):"," if route.request.method != \"GET\":"," route.fallback()"," return"," # Handling GET only."," # ...","","# Handle POST requests.","def handle_post(route):"," if route.request.method != \"POST\":"," route.fallback()"," return"," # Handling POST only."," # ...","","page.route(\"**/*\", handle_get)","page.route(\"**/*\", handle_post)"],"codeLang":"python sync"},{"type":"code","lines":["// Handle GET requests.","await page.RouteAsync(\"**/*\", route => {"," if (route.Request.Method != \"GET\") {"," await route.FallbackAsync();"," return;"," }"," // Handling GET only."," // ...","});","","// Handle POST requests.","await page.RouteAsync(\"**/*\", route => {"," if (route.Request.Method != \"POST\") {"," await route.FallbackAsync();"," return;"," }"," // Handling POST only."," // ...","});"],"codeLang":"csharp"},{"type":"text","text":"One can also modify request while falling back to the subsequent handler, that way intermediate↵route handler can modify url, method, headers and postData of the request."},{"type":"code","lines":["await page.route('**/*', async (route, request) => {"," // Override headers"," const headers = {"," ...request.headers(),"," foo: 'foo-value', // set \"foo\" header"," bar: undefined, // remove \"bar\" header"," };"," await route.fallback({ headers });","});"],"codeLang":"js"},{"type":"code","lines":["page.route(\"**/*\", route -> {"," // Override headers"," Map<String, String> headers = new HashMap<>(route.request().headers());"," headers.put(\"foo\", \"foo-value\"); // set \"foo\" header"," headers.remove(\"bar\"); // remove \"bar\" header"," route.fallback(new Route.ResumeOptions().setHeaders(headers));","});"],"codeLang":"java"},{"type":"code","lines":["async def handle(route, request):"," # override headers"," headers = {"," **request.headers,"," \"foo\": \"foo-value\", # set \"foo\" header"," \"bar\": None # remove \"bar\" header"," }"," await route.fallback(headers=headers)","","await page.route(\"**/*\", handle)"],"codeLang":"python async"},{"type":"code","lines":["def handle(route, request):"," # override headers"," headers = {"," **request.headers,"," \"foo\": \"foo-value\", # set \"foo\" header"," \"bar\": None # remove \"bar\" header"," }"," route.fallback(headers=headers)","","page.route(\"**/*\", handle)"],"codeLang":"python sync"},{"type":"code","lines":["await page.RouteAsync(\"**/*\", async route =>","{"," var headers = new Dictionary<string, string>(route.Request.Headers) { { \"foo\", \"foo-value\" } };"," headers.Remove(\"bar\");"," await route.FallbackAsync(new() { Headers = headers });","});"],"codeLang":"csharp"}],"required":true,"comment":"When several routes match the given pattern, they run in the order opposite to their registration. That way the\nlast registered route can always override all the previous ones. In the example below, request will be handled by\nthe bottom-most handler first, then it'll fall back to the previous one and in the end will be aborted by the first\nregistered route.\n\n**Usage**\n\n```js\nawait page.route('**/*', async route => {\n // Runs last.\n await route.abort();\n});\nawait page.route('**/*', async route => {\n // Runs second.\n await route.fallback();\n});\nawait page.route('**/*', async route => {\n // Runs first.\n await route.fallback();\n});\n```\n\n```java\npage.route(\"**/*\", route -> {\n // Runs last.\n route.abort();\n});\n\npage.route(\"**/*\", route -> {\n // Runs second.\n route.fallback();\n});\n\npage.route(\"**/*\", route -> {\n // Runs first.\n route.fallback();\n});\n```\n\n```py\nawait page.route(\"**/*\", lambda route: route.abort()) # Runs last.\nawait page.route(\"**/*\", lambda route: route.fallback()) # Runs second.\nawait page.route(\"**/*\", lambda route: route.fallback()) # Runs first.\n```\n\n```py\npage.route(\"**/*\", lambda route: route.abort()) # Runs last.\npage.route(\"**/*\", lambda route: route.fallback()) # Runs second.\npage.route(\"**/*\", lambda route: route.fallback()) # Runs first.\n```\n\n```csharp\nawait page.RouteAsync(\"**/*\", route => {\n // Runs last.\n await route.AbortAsync();\n});\n\nawait page.RouteAsync(\"**/*\", route => {\n // Runs second.\n await route.FallbackAsync();\n});\n\nawait page.RouteAsync(\"**/*\", route => {\n // Runs first.\n await route.FallbackAsync();\n});\n```\n\nRegistering multiple routes is useful when you want separate handlers to handle different kinds of requests, for\nexample API calls vs page resources or GET requests vs POST requests as in the example below.\n\n```js\n// Handle GET requests.\nawait page.route('**/*', async route => {\n if (route.request().method() !== 'GET') {\n await route.fallback();\n return;\n }\n // Handling GET only.\n // ...\n});\n\n// Handle POST requests.\nawait page.route('**/*', async route => {\n if (route.request().method() !== 'POST') {\n await route.fallback();\n return;\n }\n // Handling POST only.\n // ...\n});\n```\n\n```java\n// Handle GET requests.\npage.route(\"**/*\", route -> {\n if (!route.request().method().equals(\"GET\")) {\n route.fallback();\n return;\n }\n // Handling GET only.\n // ...\n});\n\n// Handle POST requests.\npage.route(\"**/*\", route -> {\n if (!route.request().method().equals(\"POST\")) {\n route.fallback();\n return;\n }\n // Handling POST only.\n // ...\n});\n```\n\n```py\n# Handle GET requests.\nasync def handle_get(route):\n if route.request.method != \"GET\":\n await route.fallback()\n return\n # Handling GET only.\n # ...\n\n# Handle POST requests.\nasync def handle_post(route):\n if route.request.method != \"POST\":\n await route.fallback()\n return\n # Handling POST only.\n # ...\n\nawait page.route(\"**/*\", handle_get)\nawait page.route(\"**/*\", handle_post)\n```\n\n```py\n# Handle GET requests.\ndef handle_get(route):\n if route.request.method != \"GET\":\n route.fallback()\n return\n # Handling GET only.\n # ...\n\n# Handle POST requests.\ndef handle_post(route):\n if route.request.method != \"POST\":\n route.fallback()\n return\n # Handling POST only.\n # ...\n\npage.route(\"**/*\", handle_get)\npage.route(\"**/*\", handle_post)\n```\n\n```csharp\n// Handle GET requests.\nawait page.RouteAsync(\"**/*\", route => {\n if (route.Request.Method != \"GET\") {\n await route.FallbackAsync();\n return;\n }\n // Handling GET only.\n // ...\n});\n\n// Handle POST requests.\nawait page.RouteAsync(\"**/*\", route => {\n if (route.Request.Method != \"POST\") {\n await route.FallbackAsync();\n return;\n }\n // Handling POST only.\n // ...\n});\n```\n\nOne can also modify request while falling back to the subsequent handler, that way intermediate route handler can\nmodify url, method, headers and postData of the request.\n\n```js\nawait page.route('**/*', async (route, request) => {\n // Override headers\n const headers = {\n ...request.headers(),\n foo: 'foo-value', // set \"foo\" header\n bar: undefined, // remove \"bar\" header\n };\n await route.fallback({ headers });\n});\n```\n\n```java\npage.route(\"**/*\", route -> {\n // Override headers\n Map<String, String> headers = new HashMap<>(route.request().headers());\n headers.put(\"foo\", \"foo-value\"); // set \"foo\" header\n headers.remove(\"bar\"); // remove \"bar\" header\n route.fallback(new Route.ResumeOptions().setHeaders(headers));\n});\n```\n\n```py\nasync def handle(route, request):\n # override headers\n headers = {\n **request.headers,\n \"foo\": \"foo-value\", # set \"foo\" header\n \"bar\": None # remove \"bar\" header\n }\n await route.fallback(headers=headers)\n\nawait page.route(\"**/*\", handle)\n```\n\n```py\ndef handle(route, request):\n # override headers\n headers = {\n **request.headers,\n \"foo\": \"foo-value\", # set \"foo\" header\n \"bar\": None # remove \"bar\" header\n }\n route.fallback(headers=headers)\n\npage.route(\"**/*\", handle)\n```\n\n```csharp\nawait page.RouteAsync(\"**/*\", async route =>\n{\n var headers = new Dictionary<string, string>(route.Request.Headers) { { \"foo\", \"foo-value\" } };\n headers.Remove(\"bar\");\n await route.FallbackAsync(new() { Headers = headers });\n});\n```\n","async":true,"alias":"fallback","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.23","name":"headers","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"If set changes the request HTTP headers. Header values will be converted to a string."}],"required":false,"comment":"If set changes the request HTTP headers. Header values will be converted to a string.","async":false,"alias":"headers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.23","name":"method","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"If set changes the request method (e.g. GET or POST)."}],"required":false,"comment":"If set changes the request method (e.g. GET or POST).","async":false,"alias":"method","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"postData","type":{"name":"","union":[{"name":"string"},{"name":"Buffer"},{"name":"Serializable"}],"expression":"[string]|[Buffer]|[Serializable]"},"spec":[{"type":"text","text":"If set changes the post data of request."}],"required":false,"comment":"If set changes the post data of request.","async":false,"alias":"postData","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"postData","type":{"name":"","union":[{"name":"string"},{"name":"Buffer"}],"expression":"[string]|[Buffer]"},"spec":[{"type":"text","text":"If set changes the post data of request."}],"required":false,"comment":"If set changes the post data of request.","async":false,"alias":"postData","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.23","name":"postData","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"If set changes the post data of request."}],"required":false,"comment":"If set changes the post data of request.","async":false,"alias":"postData","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.23","name":"url","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"If set changes the request URL. New URL must have same protocol as original one. Changing the URL won't↵affect the route matching, all the routes are matched using the original request URL."}],"required":false,"comment":"If set changes the request URL. New URL must have same protocol as original one. Changing the URL won't affect the\nroute matching, all the routes are matched using the original request URL.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.29","name":"fetch","type":{"name":"APIResponse","expression":"[APIResponse]"},"spec":[{"type":"text","text":"Performs the request and fetches result without fulfilling it, so that the response↵could be modified and then fulfilled."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await page.route('https://dog.ceo/api/breeds/list/all', async route => {"," const response = await route.fetch();"," const json = await response.json();"," json.message['big_red_dog'] = [];"," await route.fulfill({ response, json });","});"],"codeLang":"js"},{"type":"code","lines":["page.route(\"https://dog.ceo/api/breeds/list/all\", route -> {"," APIResponse response = route.fetch();"," JsonObject json = new Gson().fromJson(response.text(), JsonObject.class);"," JsonObject message = itemObj.get(\"json\").getAsJsonObject();"," message.set(\"big_red_dog\", new JsonArray());"," route.fulfill(new Route.FulfillOptions()"," .setResponse(response)"," .setBody(json.toString()));","});"],"codeLang":"java"},{"type":"code","lines":["async def handle(route):"," response = await route.fetch()"," json = await response.json()"," json[\"message\"][\"big_red_dog\"] = []"," await route.fulfill(response=response, json=json)","","await page.route(\"https://dog.ceo/api/breeds/list/all\", handle)"],"codeLang":"python async"},{"type":"code","lines":["def handle(route):"," response = route.fetch()"," json = response.json()"," json[\"message\"][\"big_red_dog\"] = []"," route.fulfill(response=response, json=json)","","page.route(\"https://dog.ceo/api/breeds/list/all\", handle)"],"codeLang":"python sync"},{"type":"code","lines":["await page.RouteAsync(\"https://dog.ceo/api/breeds/list/all\", async route =>","{"," var response = await route.FetchAsync();"," dynamic json = await response.JsonAsync();"," json.message.big_red_dog = new string[] {};"," await route.FulfillAsync(new() { Response = response, Json = json });","});"],"codeLang":"csharp"},{"type":"text","text":"**Details**"},{"type":"text","text":"Note that `headers` option will apply to the fetched request as well as any redirects initiated by it. If you want to only apply `headers` to the original request, but not to redirects, look into [`method: Route.continue`] instead."}],"required":true,"comment":"Performs the request and fetches result without fulfilling it, so that the response could be modified and then\nfulfilled.\n\n**Usage**\n\n```js\nawait page.route('https://dog.ceo/api/breeds/list/all', async route => {\n const response = await route.fetch();\n const json = await response.json();\n json.message['big_red_dog'] = [];\n await route.fulfill({ response, json });\n});\n```\n\n```java\npage.route(\"https://dog.ceo/api/breeds/list/all\", route -> {\n APIResponse response = route.fetch();\n JsonObject json = new Gson().fromJson(response.text(), JsonObject.class);\n JsonObject message = itemObj.get(\"json\").getAsJsonObject();\n message.set(\"big_red_dog\", new JsonArray());\n route.fulfill(new Route.FulfillOptions()\n .setResponse(response)\n .setBody(json.toString()));\n});\n```\n\n```py\nasync def handle(route):\n response = await route.fetch()\n json = await response.json()\n json[\"message\"][\"big_red_dog\"] = []\n await route.fulfill(response=response, json=json)\n\nawait page.route(\"https://dog.ceo/api/breeds/list/all\", handle)\n```\n\n```py\ndef handle(route):\n response = route.fetch()\n json = response.json()\n json[\"message\"][\"big_red_dog\"] = []\n route.fulfill(response=response, json=json)\n\npage.route(\"https://dog.ceo/api/breeds/list/all\", handle)\n```\n\n```csharp\nawait page.RouteAsync(\"https://dog.ceo/api/breeds/list/all\", async route =>\n{\n var response = await route.FetchAsync();\n dynamic json = await response.JsonAsync();\n json.message.big_red_dog = new string[] {};\n await route.FulfillAsync(new() { Response = response, Json = json });\n});\n```\n\n**Details**\n\nNote that `headers` option will apply to the fetched request as well as any redirects initiated by it. If you want\nto only apply `headers` to the original request, but not to redirects, look into [`method: Route.continue`]\ninstead.","async":true,"alias":"fetch","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.29","name":"headers","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"If set changes the request HTTP headers. Header values will be converted to a string."}],"required":false,"comment":"If set changes the request HTTP headers. Header values will be converted to a string.","async":false,"alias":"headers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.31","name":"maxRedirects","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is exceeded.↵Defaults to `20`. Pass `0` to not follow redirects."}],"required":false,"comment":"Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is\nexceeded. Defaults to `20`. Pass `0` to not follow redirects.","async":false,"alias":"maxRedirects","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.29","name":"method","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"If set changes the request method (e.g. GET or POST)."}],"required":false,"comment":"If set changes the request method (e.g. GET or POST).","async":false,"alias":"method","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.29","name":"postData","type":{"name":"","union":[{"name":"string"},{"name":"Buffer"},{"name":"Serializable"}],"expression":"[string]|[Buffer]|[Serializable]"},"spec":[{"type":"text","text":"Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string↵and `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type` header will be↵set to `application/octet-stream` if not explicitly set."}],"required":false,"comment":"Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string\nand `content-type` header will be set to `application/json` if not explicitly set. Otherwise the `content-type`\nheader will be set to `application/octet-stream` if not explicitly set.","async":false,"alias":"postData","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.29","name":"postData","type":{"name":"","union":[{"name":"string"},{"name":"Buffer"}],"expression":"[string]|[Buffer]"},"spec":[{"type":"text","text":"If set changes the post data of request."}],"required":false,"comment":"If set changes the post data of request.","async":false,"alias":"postData","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.29","name":"postData","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"If set changes the post data of request."}],"required":false,"comment":"If set changes the post data of request.","async":false,"alias":"postData","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.33","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout."}],"required":false,"comment":"Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.29","name":"url","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"If set changes the request URL. New URL must have same protocol as original one."}],"required":false,"comment":"If set changes the request URL. New URL must have same protocol as original one.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"fulfill","type":{"name":"void"},"spec":[{"type":"text","text":"Fulfills route's request with given response."},{"type":"text","text":"**Usage**"},{"type":"text","text":"An example of fulfilling all requests with 404 responses:"},{"type":"code","lines":["await page.route('**/*', async route => {"," await route.fulfill({"," status: 404,"," contentType: 'text/plain',"," body: 'Not Found!'"," });","});"],"codeLang":"js"},{"type":"code","lines":["page.route(\"**/*\", route -> {"," route.fulfill(new Route.FulfillOptions()"," .setStatus(404)"," .setContentType(\"text/plain\")"," .setBody(\"Not Found!\"));","});"],"codeLang":"java"},{"type":"code","lines":["await page.route(\"**/*\", lambda route: route.fulfill("," status=404,"," content_type=\"text/plain\","," body=\"not found!\"))"],"codeLang":"python async"},{"type":"code","lines":["page.route(\"**/*\", lambda route: route.fulfill("," status=404,"," content_type=\"text/plain\","," body=\"not found!\"))"],"codeLang":"python sync"},{"type":"code","lines":["await page.RouteAsync(\"**/*\", route => route.FulfillAsync(new ()","{"," Status = 404,"," ContentType = \"text/plain\","," Body = \"Not Found!\"","}));"],"codeLang":"csharp"},{"type":"text","text":"An example of serving static file:"},{"type":"code","lines":["await page.route('**/xhr_endpoint', route => route.fulfill({ path: 'mock_data.json' }));"],"codeLang":"js"},{"type":"code","lines":["page.route(\"**/xhr_endpoint\", route -> route.fulfill("," new Route.FulfillOptions().setPath(Paths.get(\"mock_data.json\"))));"],"codeLang":"java"},{"type":"code","lines":["await page.route(\"**/xhr_endpoint\", lambda route: route.fulfill(path=\"mock_data.json\"))"],"codeLang":"python async"},{"type":"code","lines":["page.route(\"**/xhr_endpoint\", lambda route: route.fulfill(path=\"mock_data.json\"))"],"codeLang":"python sync"},{"type":"code","lines":["await page.RouteAsync(\"**/xhr_endpoint\", route => route.FulfillAsync(new() { Path = \"mock_data.json\" }));"],"codeLang":"csharp"}],"required":true,"comment":"Fulfills route's request with given response.\n\n**Usage**\n\nAn example of fulfilling all requests with 404 responses:\n\n```js\nawait page.route('**/*', async route => {\n await route.fulfill({\n status: 404,\n contentType: 'text/plain',\n body: 'Not Found!'\n });\n});\n```\n\n```java\npage.route(\"**/*\", route -> {\n route.fulfill(new Route.FulfillOptions()\n .setStatus(404)\n .setContentType(\"text/plain\")\n .setBody(\"Not Found!\"));\n});\n```\n\n```py\nawait page.route(\"**/*\", lambda route: route.fulfill(\n status=404,\n content_type=\"text/plain\",\n body=\"not found!\"))\n```\n\n```py\npage.route(\"**/*\", lambda route: route.fulfill(\n status=404,\n content_type=\"text/plain\",\n body=\"not found!\"))\n```\n\n```csharp\nawait page.RouteAsync(\"**/*\", route => route.FulfillAsync(new ()\n{\n Status = 404,\n ContentType = \"text/plain\",\n Body = \"Not Found!\"\n}));\n```\n\nAn example of serving static file:\n\n```js\nawait page.route('**/xhr_endpoint', route => route.fulfill({ path: 'mock_data.json' }));\n```\n\n```java\npage.route(\"**/xhr_endpoint\", route -> route.fulfill(\n new Route.FulfillOptions().setPath(Paths.get(\"mock_data.json\"))));\n```\n\n```py\nawait page.route(\"**/xhr_endpoint\", lambda route: route.fulfill(path=\"mock_data.json\"))\n```\n\n```py\npage.route(\"**/xhr_endpoint\", lambda route: route.fulfill(path=\"mock_data.json\"))\n```\n\n```csharp\nawait page.RouteAsync(\"**/xhr_endpoint\", route => route.FulfillAsync(new() { Path = \"mock_data.json\" }));\n```\n","async":true,"alias":"fulfill","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"body","type":{"name":"","union":[{"name":"string"},{"name":"Buffer"}],"expression":"[string]|[Buffer]"},"spec":[{"type":"text","text":"Response body."}],"required":false,"comment":"Response body.","async":false,"alias":"body","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"body","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Optional response body as text."}],"required":false,"comment":"Optional response body as text.","async":false,"alias":"body","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"bodyBytes","type":{"name":"Buffer","expression":"[Buffer]"},"spec":[{"type":"text","text":"Optional response body as raw bytes."}],"required":false,"comment":"Optional response body as raw bytes.","async":false,"alias":"bodyBytes","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"contentType","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"If set, equals to setting `Content-Type` response header."}],"required":false,"comment":"If set, equals to setting `Content-Type` response header.","async":false,"alias":"contentType","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"headers","type":{"name":"Object","templates":[{"name":"string"},{"name":"string"}],"expression":"[Object]<[string], [string]>"},"spec":[{"type":"text","text":"Response headers. Header values will be converted to a string."}],"required":false,"comment":"Response headers. Header values will be converted to a string.","async":false,"alias":"headers","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","python","csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.29","name":"json","type":{"name":"Serializable","expression":"[Serializable]"},"spec":[{"type":"text","text":"JSON response. This method will set the content type to `application/json` if not set."}],"required":false,"comment":"JSON response. This method will set the content type to `application/json` if not set.","async":false,"alias":"json","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"File path to respond with. The content type will be inferred from file extension. If `path` is a relative path, then it↵is resolved relative to the current working directory."}],"required":false,"comment":"File path to respond with. The content type will be inferred from file extension. If `path` is a relative path,\nthen it is resolved relative to the current working directory.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.15","name":"response","type":{"name":"APIResponse","expression":"[APIResponse]"},"spec":[{"type":"text","text":"`APIResponse` to fulfill route's request with. Individual fields of the response (such as headers) can be overridden using fulfill options."}],"required":false,"comment":"`APIResponse` to fulfill route's request with. Individual fields of the response (such as headers) can be\noverridden using fulfill options.","async":false,"alias":"response","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"status","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Response status code, defaults to `200`."}],"required":false,"comment":"Response status code, defaults to `200`.","async":false,"alias":"status","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"request","type":{"name":"Request","expression":"[Request]"},"spec":[{"type":"text","text":"A request to be routed."}],"required":true,"comment":"A request to be routed.","async":false,"alias":"request","overloadIndex":0,"paramOrOption":null,"args":[]}]},{"name":"Selectors","spec":[{"type":"text","text":"Selectors can be used to install custom selector engines. See [extensibility](../extensibility.md) for more↵information."}],"langs":{},"comment":"Selectors can be used to install custom selector engines. See [extensibility](../extensibility.md) for more\ninformation.","since":"v1.8","members":[{"kind":"method","langs":{},"since":"v1.8","name":"register","type":{"name":"void"},"spec":[{"type":"text","text":"Selectors must be registered before creating the page."},{"type":"text","text":"**Usage**"},{"type":"text","text":"An example of registering selector engine that queries elements based on a tag name:"},{"type":"code","lines":["const { selectors, firefox } = require('@playwright/test'); // Or 'chromium' or 'webkit'.","","(async () => {"," // Must be a function that evaluates to a selector engine instance."," const createTagNameEngine = () => ({"," // Returns the first element matching given selector in the root's subtree."," query(root, selector) {"," return root.querySelector(selector);"," },",""," // Returns all elements matching given selector in the root's subtree."," queryAll(root, selector) {"," return Array.from(root.querySelectorAll(selector));"," }"," });",""," // Register the engine. Selectors will be prefixed with \"tag=\"."," await selectors.register('tag', createTagNameEngine);",""," const browser = await firefox.launch();"," const page = await browser.newPage();"," await page.setContent(`<div><button>Click me</button></div>`);",""," // Use the selector prefixed with its name."," const button = page.locator('tag=button');"," // We can combine it with built-in locators."," await page.locator('tag=div').getByText('Click me').click();"," // Can use it in any methods supporting selectors."," const buttonCount = await page.locator('tag=button').count();",""," await browser.close();","})();"],"codeLang":"js"},{"type":"code","lines":["// Script that evaluates to a selector engine instance. The script is evaluated in the page context.","String createTagNameEngine = \"{\\n\" +"," \" // Returns the first element matching given selector in the root's subtree.\\n\" +"," \" query(root, selector) {\\n\" +"," \" return root.querySelector(selector);\\n\" +"," \" },\\n\" +"," \" // Returns all elements matching given selector in the root's subtree.\\n\" +"," \" queryAll(root, selector) {\\n\" +"," \" return Array.from(root.querySelectorAll(selector));\\n\" +"," \" }\\n\" +"," \"}\";","// Register the engine. Selectors will be prefixed with \"tag=\".","playwright.selectors().register(\"tag\", createTagNameEngine);","Browser browser = playwright.firefox().launch();","Page page = browser.newPage();","page.setContent(\"<div><button>Click me</button></div>\");","// Use the selector prefixed with its name.","Locator button = page.locator(\"tag=button\");","// Combine it with built-in locators.","page.locator(\"tag=div\").getByText(\"Click me\").click();","// Can use it in any methods supporting selectors.","int buttonCount = (int) page.locator(\"tag=button\").count();","browser.close();"],"codeLang":"java"},{"type":"code","lines":["import asyncio","from playwright.async_api import async_playwright, Playwright","","async def run(playwright: Playwright):"," tag_selector = \"\"\""," {"," // Returns the first element matching given selector in the root's subtree."," query(root, selector) {"," return root.querySelector(selector);"," },"," // Returns all elements matching given selector in the root's subtree."," queryAll(root, selector) {"," return Array.from(root.querySelectorAll(selector));"," }"," }\"\"\"",""," # Register the engine. Selectors will be prefixed with \"tag=\"."," await playwright.selectors.register(\"tag\", tag_selector)"," browser = await playwright.chromium.launch()"," page = await browser.new_page()"," await page.set_content('<div><button>Click me</button></div>')",""," # Use the selector prefixed with its name."," button = await page.query_selector('tag=button')"," # Combine it with built-in locators."," await page.locator('tag=div').get_by_text('Click me').click()"," # Can use it in any methods supporting selectors."," button_count = await page.locator('tag=button').count()"," print(button_count)"," await browser.close()","","async def main():"," async with async_playwright() as playwright:"," await run(playwright)","","asyncio.run(main())"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import sync_playwright, Playwright","","def run(playwright: Playwright):"," tag_selector = \"\"\""," {"," // Returns the first element matching given selector in the root's subtree."," query(root, selector) {"," return root.querySelector(selector);"," },"," // Returns all elements matching given selector in the root's subtree."," queryAll(root, selector) {"," return Array.from(root.querySelectorAll(selector));"," }"," }\"\"\"",""," # Register the engine. Selectors will be prefixed with \"tag=\"."," playwright.selectors.register(\"tag\", tag_selector)"," browser = playwright.chromium.launch()"," page = browser.new_page()"," page.set_content('<div><button>Click me</button></div>')",""," # Use the selector prefixed with its name."," button = page.locator('tag=button')"," # Combine it with built-in locators."," page.locator('tag=div').get_by_text('Click me').click()"," # Can use it in any methods supporting selectors."," button_count = page.locator('tag=button').count()"," print(button_count)"," browser.close()","","with sync_playwright() as playwright:"," run(playwright)"],"codeLang":"python sync"},{"type":"code","lines":["using Microsoft.Playwright;","","using var playwright = await Playwright.CreateAsync();","// Script that evaluates to a selector engine instance. The script is evaluated in the page context.","await playwright.Selectors.RegisterAsync(\"tag\", new()","{"," Script = @\"{"," // Returns the first element matching given selector in the root's subtree."," query(root, selector) {"," return root.querySelector(selector);"," },"," // Returns all elements matching given selector in the root's subtree."," queryAll(root, selector) {"," return Array.from(root.querySelectorAll(selector));"," }"," }\"","});","","await using var browser = await playwright.Chromium.LaunchAsync();","var page = await browser.NewPageAsync();","await page.SetContentAsync(\"<div><button>Click me</button></div>\");","// Use the selector prefixed with its name.","var button = page.Locator(\"tag=button\");","// Combine it with built-in locators.","await page.Locator(\"tag=div\").GetByText(\"Click me\").ClickAsync();","// Can use it in any methods supporting selectors.","int buttonCount = await page.Locator(\"tag=button\").CountAsync();"],"codeLang":"csharp"}],"required":true,"comment":"Selectors must be registered before creating the page.\n\n**Usage**\n\nAn example of registering selector engine that queries elements based on a tag name:\n\n```js\nconst { selectors, firefox } = require('@playwright/test'); // Or 'chromium' or 'webkit'.\n\n(async () => {\n // Must be a function that evaluates to a selector engine instance.\n const createTagNameEngine = () => ({\n // Returns the first element matching given selector in the root's subtree.\n query(root, selector) {\n return root.querySelector(selector);\n },\n\n // Returns all elements matching given selector in the root's subtree.\n queryAll(root, selector) {\n return Array.from(root.querySelectorAll(selector));\n }\n });\n\n // Register the engine. Selectors will be prefixed with \"tag=\".\n await selectors.register('tag', createTagNameEngine);\n\n const browser = await firefox.launch();\n const page = await browser.newPage();\n await page.setContent(`<div><button>Click me</button></div>`);\n\n // Use the selector prefixed with its name.\n const button = page.locator('tag=button');\n // We can combine it with built-in locators.\n await page.locator('tag=div').getByText('Click me').click();\n // Can use it in any methods supporting selectors.\n const buttonCount = await page.locator('tag=button').count();\n\n await browser.close();\n})();\n```\n\n```java\n// Script that evaluates to a selector engine instance. The script is evaluated in the page context.\nString createTagNameEngine = \"{\\n\" +\n \" // Returns the first element matching given selector in the root's subtree.\\n\" +\n \" query(root, selector) {\\n\" +\n \" return root.querySelector(selector);\\n\" +\n \" },\\n\" +\n \" // Returns all elements matching given selector in the root's subtree.\\n\" +\n \" queryAll(root, selector) {\\n\" +\n \" return Array.from(root.querySelectorAll(selector));\\n\" +\n \" }\\n\" +\n \"}\";\n// Register the engine. Selectors will be prefixed with \"tag=\".\nplaywright.selectors().register(\"tag\", createTagNameEngine);\nBrowser browser = playwright.firefox().launch();\nPage page = browser.newPage();\npage.setContent(\"<div><button>Click me</button></div>\");\n// Use the selector prefixed with its name.\nLocator button = page.locator(\"tag=button\");\n// Combine it with built-in locators.\npage.locator(\"tag=div\").getByText(\"Click me\").click();\n// Can use it in any methods supporting selectors.\nint buttonCount = (int) page.locator(\"tag=button\").count();\nbrowser.close();\n```\n\n```py\nimport asyncio\nfrom playwright.async_api import async_playwright, Playwright\n\nasync def run(playwright: Playwright):\n tag_selector = \"\"\"\n {\n // Returns the first element matching given selector in the root's subtree.\n query(root, selector) {\n return root.querySelector(selector);\n },\n // Returns all elements matching given selector in the root's subtree.\n queryAll(root, selector) {\n return Array.from(root.querySelectorAll(selector));\n }\n }\"\"\"\n\n # Register the engine. Selectors will be prefixed with \"tag=\".\n await playwright.selectors.register(\"tag\", tag_selector)\n browser = await playwright.chromium.launch()\n page = await browser.new_page()\n await page.set_content('<div><button>Click me</button></div>')\n\n # Use the selector prefixed with its name.\n button = await page.query_selector('tag=button')\n # Combine it with built-in locators.\n await page.locator('tag=div').get_by_text('Click me').click()\n # Can use it in any methods supporting selectors.\n button_count = await page.locator('tag=button').count()\n print(button_count)\n await browser.close()\n\nasync def main():\n async with async_playwright() as playwright:\n await run(playwright)\n\nasyncio.run(main())\n```\n\n```py\nfrom playwright.sync_api import sync_playwright, Playwright\n\ndef run(playwright: Playwright):\n tag_selector = \"\"\"\n {\n // Returns the first element matching given selector in the root's subtree.\n query(root, selector) {\n return root.querySelector(selector);\n },\n // Returns all elements matching given selector in the root's subtree.\n queryAll(root, selector) {\n return Array.from(root.querySelectorAll(selector));\n }\n }\"\"\"\n\n # Register the engine. Selectors will be prefixed with \"tag=\".\n playwright.selectors.register(\"tag\", tag_selector)\n browser = playwright.chromium.launch()\n page = browser.new_page()\n page.set_content('<div><button>Click me</button></div>')\n\n # Use the selector prefixed with its name.\n button = page.locator('tag=button')\n # Combine it with built-in locators.\n page.locator('tag=div').get_by_text('Click me').click()\n # Can use it in any methods supporting selectors.\n button_count = page.locator('tag=button').count()\n print(button_count)\n browser.close()\n\nwith sync_playwright() as playwright:\n run(playwright)\n```\n\n```csharp\nusing Microsoft.Playwright;\n\nusing var playwright = await Playwright.CreateAsync();\n// Script that evaluates to a selector engine instance. The script is evaluated in the page context.\nawait playwright.Selectors.RegisterAsync(\"tag\", new()\n{\n Script = @\"{\n // Returns the first element matching given selector in the root's subtree.\n query(root, selector) {\n return root.querySelector(selector);\n },\n // Returns all elements matching given selector in the root's subtree.\n queryAll(root, selector) {\n return Array.from(root.querySelectorAll(selector));\n }\n }\"\n});\n\nawait using var browser = await playwright.Chromium.LaunchAsync();\nvar page = await browser.NewPageAsync();\nawait page.SetContentAsync(\"<div><button>Click me</button></div>\");\n// Use the selector prefixed with its name.\nvar button = page.Locator(\"tag=button\");\n// Combine it with built-in locators.\nawait page.Locator(\"tag=div\").GetByText(\"Click me\").ClickAsync();\n// Can use it in any methods supporting selectors.\nint buttonCount = await page.Locator(\"tag=button\").CountAsync();\n```\n","async":true,"alias":"register","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Name that is used in selectors as a prefix, e.g. `{name: 'foo'}` enables `foo=myselectorbody` selectors. May only↵contain `[a-zA-Z0-9_]` characters."}],"required":true,"comment":"Name that is used in selectors as a prefix, e.g. `{name: 'foo'}` enables `foo=myselectorbody` selectors. May only\ncontain `[a-zA-Z0-9_]` characters.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"script","type":{"name":"","union":[{"name":"function"},{"name":"string"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the↵current working directory. Optional."}],"required":false,"comment":"Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working\ndirectory. Optional.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"content","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Raw script content. Optional."}],"required":false,"comment":"Raw script content. Optional.","async":false,"alias":"content","overloadIndex":0,"paramOrOption":null}]}],"expression":"[function]|[string]|[Object]"},"spec":[{"type":"text","text":"Script that evaluates to a selector engine instance. The script is evaluated in the page context."}],"required":true,"comment":"Script that evaluates to a selector engine instance. The script is evaluated in the page context.","async":false,"alias":"script","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"script","type":{"name":"","union":[{"name":"string"},{"name":"path"}],"expression":"[string]|[path]"},"spec":[{"type":"text","text":"Script that evaluates to a selector engine instance. The script is evaluated in the page context."}],"required":true,"comment":"Script that evaluates to a selector engine instance. The script is evaluated in the page context.","async":false,"alias":"script","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"script","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Raw script content."}],"required":false,"comment":"Raw script content.","async":false,"alias":"script","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"contentScript","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to run this selector engine in isolated JavaScript environment. This environment has access to the same DOM, but↵not any JavaScript objects from the frame's scripts. Defaults to `false`. Note that running as a content script is not↵guaranteed when this engine is used together with other registered engines."}],"required":false,"comment":"Whether to run this selector engine in isolated JavaScript environment. This environment has access to the same\nDOM, but not any JavaScript objects from the frame's scripts. Defaults to `false`. Note that running as a content\nscript is not guaranteed when this engine is used together with other registered engines.","async":false,"alias":"contentScript","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working directory."}],"required":false,"comment":"Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working\ndirectory.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Script that evaluates to a selector engine instance. The script is evaluated in the page context."}],"required":false,"comment":"Script that evaluates to a selector engine instance. The script is evaluated in the page context.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"script","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Script that evaluates to a selector engine instance. The script is evaluated in the page context."}],"required":false,"comment":"Script that evaluates to a selector engine instance. The script is evaluated in the page context.","async":false,"alias":"script","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.27","name":"setTestIdAttribute","type":{"name":"void"},"spec":[{"type":"text","text":"Defines custom attribute name to be used in [`method: Page.getByTestId`]. `data-testid` is used by default."}],"required":true,"comment":"Defines custom attribute name to be used in [`method: Page.getByTestId`]. `data-testid` is used by default.","async":false,"alias":"setTestIdAttribute","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.27","name":"attributeName","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Test id attribute name."}],"required":true,"comment":"Test id attribute name.","async":false,"alias":"attributeName","overloadIndex":0,"paramOrOption":null}]}]},{"name":"SnapshotAssertions","spec":[{"type":"text","text":"Playwright provides methods for comparing page and element screenshots with↵expected values stored in files."},{"type":"code","lines":["expect(screenshot).toMatchSnapshot('landing-page.png');"],"codeLang":"js"}],"langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"comment":"Playwright provides methods for comparing page and element screenshots with expected values stored in files.\n\n```js\nexpect(screenshot).toMatchSnapshot('landing-page.png');\n```\n","since":"v1.20","members":[{"kind":"method","langs":{},"since":"v1.22","name":"toMatchSnapshot#1","type":{"name":"void"},"spec":[{"type":"note","noteType":"caution","text":"To compare screenshots, use [`method: PageAssertions.toHaveScreenshot#1`] instead."},{"type":"text","text":"Ensures that passed value, either a [string] or a [Buffer], matches the expected snapshot stored in the test snapshots directory."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["// Basic usage.","expect(await page.screenshot()).toMatchSnapshot('landing-page.png');","","// Pass options to customize the snapshot comparison and have a generated name.","expect(await page.screenshot()).toMatchSnapshot('landing-page.png', {"," maxDiffPixels: 27, // allow no more than 27 different pixels.","});","","// Configure image matching threshold.","expect(await page.screenshot()).toMatchSnapshot('landing-page.png', { threshold: 0.3 });","","// Bring some structure to your snapshot files by passing file path segments.","expect(await page.screenshot()).toMatchSnapshot(['landing', 'step2.png']);","expect(await page.screenshot()).toMatchSnapshot(['landing', 'step3.png']);"],"codeLang":"js"},{"type":"text","text":"Learn more about [visual comparisons](../test-snapshots.md)."},{"type":"text","text":"Note that matching snapshots only work with Playwright test runner."}],"required":true,"comment":"**NOTE** To compare screenshots, use [`method: PageAssertions.toHaveScreenshot#1`] instead.\n\nEnsures that passed value, either a [string] or a [Buffer], matches the expected snapshot stored in the test\nsnapshots directory.\n\n**Usage**\n\n```js\n// Basic usage.\nexpect(await page.screenshot()).toMatchSnapshot('landing-page.png');\n\n// Pass options to customize the snapshot comparison and have a generated name.\nexpect(await page.screenshot()).toMatchSnapshot('landing-page.png', {\n maxDiffPixels: 27, // allow no more than 27 different pixels.\n});\n\n// Configure image matching threshold.\nexpect(await page.screenshot()).toMatchSnapshot('landing-page.png', { threshold: 0.3 });\n\n// Bring some structure to your snapshot files by passing file path segments.\nexpect(await page.screenshot()).toMatchSnapshot(['landing', 'step2.png']);\nexpect(await page.screenshot()).toMatchSnapshot(['landing', 'step3.png']);\n```\n\nLearn more about [visual comparisons](../test-snapshots.md).\n\nNote that matching snapshots only work with Playwright test runner.","async":false,"alias":"toMatchSnapshot","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.22","name":"name","type":{"name":"","union":[{"name":"string"},{"name":"Array","templates":[{"name":"string"}]}],"expression":"[string]|[Array]<[string]>"},"spec":[{"type":"text","text":"Snapshot name."}],"required":true,"comment":"Snapshot name.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.22","name":"maxDiffPixelRatio","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"An acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1`. Default is configurable with `TestConfig.expect`. Unset by default."}],"required":false,"comment":"An acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1`. Default is\nconfigurable with `TestConfig.expect`. Unset by default.","async":false,"alias":"maxDiffPixelRatio","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.22","name":"maxDiffPixels","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"An acceptable amount of pixels that could be different. Default is configurable with `TestConfig.expect`. Unset by default."}],"required":false,"comment":"An acceptable amount of pixels that could be different. Default is configurable with `TestConfig.expect`. Unset by\ndefault.","async":false,"alias":"maxDiffPixels","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.22","name":"threshold","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ)↵between the same pixel in compared images, between zero (strict) and one (lax), default is configurable with↵`TestConfig.expect`. Defaults to `0.2`."}],"required":false,"comment":"An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the\nsame pixel in compared images, between zero (strict) and one (lax), default is configurable with\n`TestConfig.expect`. Defaults to `0.2`.","async":false,"alias":"threshold","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.22","name":"toMatchSnapshot#2","type":{"name":"void"},"spec":[{"type":"note","noteType":"caution","text":"To compare screenshots, use [`method: PageAssertions.toHaveScreenshot#2`] instead."},{"type":"text","text":"Ensures that passed value, either a [string] or a [Buffer], matches the expected snapshot stored in the test snapshots directory."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["// Basic usage and the file name is derived from the test name.","expect(await page.screenshot()).toMatchSnapshot();","","// Pass options to customize the snapshot comparison and have a generated name.","expect(await page.screenshot()).toMatchSnapshot({"," maxDiffPixels: 27, // allow no more than 27 different pixels.","});","","// Configure image matching threshold and snapshot name.","expect(await page.screenshot()).toMatchSnapshot({"," name: 'landing-page.png',"," threshold: 0.3,","});"],"codeLang":"js"},{"type":"text","text":"Learn more about [visual comparisons](../test-snapshots.md)."},{"type":"text","text":"Note that matching snapshots only work with Playwright test runner."}],"required":true,"comment":"**NOTE** To compare screenshots, use [`method: PageAssertions.toHaveScreenshot#2`] instead.\n\nEnsures that passed value, either a [string] or a [Buffer], matches the expected snapshot stored in the test\nsnapshots directory.\n\n**Usage**\n\n```js\n// Basic usage and the file name is derived from the test name.\nexpect(await page.screenshot()).toMatchSnapshot();\n\n// Pass options to customize the snapshot comparison and have a generated name.\nexpect(await page.screenshot()).toMatchSnapshot({\n maxDiffPixels: 27, // allow no more than 27 different pixels.\n});\n\n// Configure image matching threshold and snapshot name.\nexpect(await page.screenshot()).toMatchSnapshot({\n name: 'landing-page.png',\n threshold: 0.3,\n});\n```\n\nLearn more about [visual comparisons](../test-snapshots.md).\n\nNote that matching snapshots only work with Playwright test runner.","async":false,"alias":"toMatchSnapshot","overloadIndex":1,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.22","name":"maxDiffPixelRatio","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"An acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1`. Default is configurable with `TestConfig.expect`. Unset by default."}],"required":false,"comment":"An acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1`. Default is\nconfigurable with `TestConfig.expect`. Unset by default.","async":false,"alias":"maxDiffPixelRatio","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.22","name":"maxDiffPixels","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"An acceptable amount of pixels that could be different. Default is configurable with `TestConfig.expect`. Unset by default."}],"required":false,"comment":"An acceptable amount of pixels that could be different. Default is configurable with `TestConfig.expect`. Unset by\ndefault.","async":false,"alias":"maxDiffPixels","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.22","name":"name","type":{"name":"","union":[{"name":"string"},{"name":"Array","templates":[{"name":"string"}]}],"expression":"[string]|[Array]<[string]>"},"spec":[{"type":"text","text":"Snapshot name. If not passed, the test name and ordinals are used when called multiple times."}],"required":false,"comment":"Snapshot name. If not passed, the test name and ordinals are used when called multiple times.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.22","name":"threshold","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ)↵between the same pixel in compared images, between zero (strict) and one (lax), default is configurable with↵`TestConfig.expect`. Defaults to `0.2`."}],"required":false,"comment":"An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the\nsame pixel in compared images, between zero (strict) and one (lax), default is configurable with\n`TestConfig.expect`. Defaults to `0.2`.","async":false,"alias":"threshold","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]}]},{"name":"TimeoutError","spec":[{"type":"li","text":"extends: `Error`","liType":"bullet"},{"type":"text","text":"TimeoutError is emitted whenever certain operations are terminated due to timeout, e.g. [`method: Locator.waitFor`] or [`method: BrowserType.launch`]."},{"type":"code","lines":["const playwright = require('playwright');","","(async () => {"," const browser = await playwright.chromium.launch();"," const context = await browser.newContext();"," const page = await context.newPage();"," try {"," await page.locator('text=Foo').click({"," timeout: 100,"," });"," } catch (error) {"," if (error instanceof playwright.errors.TimeoutError)"," console.log('Timeout!');"," }"," await browser.close();","})();"],"codeLang":"js"},{"type":"code","lines":["import asyncio","from playwright.async_api import async_playwright, TimeoutError as PlaywrightTimeoutError, Playwright","","async def run(playwright: Playwright):"," browser = await playwright.chromium.launch()"," page = await browser.new_page()"," try:"," await page.locator(\"text=Example\").click(timeout=100)"," except PlaywrightTimeoutError:"," print(\"Timeout!\")"," await browser.close()","","async def main():"," async with async_playwright() as playwright:"," await run(playwright)","","asyncio.run(main())"],"codeLang":"python async"},{"type":"code","lines":["from playwright.sync_api import sync_playwright, TimeoutError as PlaywrightTimeoutError","","with sync_playwright() as p:"," browser = p.chromium.launch()"," page = browser.new_page()"," try:"," page.locator(\"text=Example\").click(timeout=100)"," except PlaywrightTimeoutError:"," print(\"Timeout!\")"," browser.close()"],"codeLang":"python sync"},{"type":"code","lines":["package org.example;","","import com.microsoft.playwright.*;","","public class TimeoutErrorExample {"," public static void main(String[] args) {"," try (Playwright playwright = Playwright.create()) {"," Browser browser = playwright.firefox().launch();"," BrowserContext context = browser.newContext();"," Page page = context.newPage();"," try {"," page.locator(\"text=Example\").click(new Locator.ClickOptions().setTimeout(100));"," } catch (TimeoutError e) {"," System.out.println(\"Timeout!\");"," }"," }"," }","}"],"codeLang":"java"},{"type":"code","lines":["using Microsoft.Playwright;","","using var playwright = await Playwright.CreateAsync();","await using var browser = await playwright.Chromium.LaunchAsync();","var page = await browser.NewPageAsync();","try","{"," await page.ClickAsync(\"text=Example\", new() { Timeout = 100 });","}","catch (TimeoutException)","{"," Console.WriteLine(\"Timeout!\");","}"],"codeLang":"csharp"}],"extends":"Error","langs":{},"comment":"- extends: `Error`\n\nTimeoutError is emitted whenever certain operations are terminated due to timeout, e.g. [`method: Locator.waitFor`]\nor [`method: BrowserType.launch`].\n\n```js\nconst playwright = require('playwright');\n\n(async () => {\n const browser = await playwright.chromium.launch();\n const context = await browser.newContext();\n const page = await context.newPage();\n try {\n await page.locator('text=Foo').click({\n timeout: 100,\n });\n } catch (error) {\n if (error instanceof playwright.errors.TimeoutError)\n console.log('Timeout!');\n }\n await browser.close();\n})();\n```\n\n```py\nimport asyncio\nfrom playwright.async_api import async_playwright, TimeoutError as PlaywrightTimeoutError, Playwright\n\nasync def run(playwright: Playwright):\n browser = await playwright.chromium.launch()\n page = await browser.new_page()\n try:\n await page.locator(\"text=Example\").click(timeout=100)\n except PlaywrightTimeoutError:\n print(\"Timeout!\")\n await browser.close()\n\nasync def main():\n async with async_playwright() as playwright:\n await run(playwright)\n\nasyncio.run(main())\n```\n\n```py\nfrom playwright.sync_api import sync_playwright, TimeoutError as PlaywrightTimeoutError\n\nwith sync_playwright() as p:\n browser = p.chromium.launch()\n page = browser.new_page()\n try:\n page.locator(\"text=Example\").click(timeout=100)\n except PlaywrightTimeoutError:\n print(\"Timeout!\")\n browser.close()\n```\n\n```java\npackage org.example;\n\nimport com.microsoft.playwright.*;\n\npublic class TimeoutErrorExample {\n public static void main(String[] args) {\n try (Playwright playwright = Playwright.create()) {\n Browser browser = playwright.firefox().launch();\n BrowserContext context = browser.newContext();\n Page page = context.newPage();\n try {\n page.locator(\"text=Example\").click(new Locator.ClickOptions().setTimeout(100));\n } catch (TimeoutError e) {\n System.out.println(\"Timeout!\");\n }\n }\n }\n}\n```\n\n```csharp\nusing Microsoft.Playwright;\n\nusing var playwright = await Playwright.CreateAsync();\nawait using var browser = await playwright.Chromium.LaunchAsync();\nvar page = await browser.NewPageAsync();\ntry\n{\n await page.ClickAsync(\"text=Example\", new() { Timeout = 100 });\n}\ncatch (TimeoutException)\n{\n Console.WriteLine(\"Timeout!\");\n}\n```\n","since":"v1.8","members":[]},{"name":"Touchscreen","spec":[{"type":"text","text":"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."}],"langs":{},"comment":"The Touchscreen class operates in main-frame CSS pixels relative to the top-left corner of the viewport. Methods on\nthe touchscreen can only be used in browser contexts that have been initialized with `hasTouch` set to true.","since":"v1.8","members":[{"kind":"method","langs":{},"since":"v1.8","name":"tap","type":{"name":"void"},"spec":[{"type":"text","text":"Dispatches a `touchstart` and `touchend` event with a single touch at the position (`x`,`y`)."},{"type":"note","noteType":"note","text":"[`method: Page.tap`] the method will throw if `hasTouch` option of the browser context is false."}],"required":true,"comment":"Dispatches a `touchstart` and `touchend` event with a single touch at the position (`x`,`y`).\n\n**NOTE** [`method: Page.tap`] the method will throw if `hasTouch` option of the browser context is false.","async":true,"alias":"tap","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"x","type":{"name":"float","expression":"[float]"},"spec":[],"required":true,"comment":"","async":false,"alias":"x","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"y","type":{"name":"float","expression":"[float]"},"spec":[],"required":true,"comment":"","async":false,"alias":"y","overloadIndex":0,"paramOrOption":null}]}]},{"name":"Tracing","spec":[{"type":"text","text":"API for collecting and saving Playwright traces. Playwright traces can be opened in [Trace Viewer](../trace-viewer.md) after Playwright script runs."},{"type":"text","text":"Start recording a trace before performing actions. At the end, stop tracing and save it to a file."},{"type":"code","lines":["const browser = await chromium.launch();","const context = await browser.newContext();","await context.tracing.start({ screenshots: true, snapshots: true });","const page = await context.newPage();","await page.goto('https://playwright.dev');","await context.tracing.stop({ path: 'trace.zip' });"],"codeLang":"js"},{"type":"code","lines":["Browser browser = chromium.launch();","BrowserContext context = browser.newContext();","context.tracing().start(new Tracing.StartOptions()"," .setScreenshots(true)"," .setSnapshots(true));","Page page = context.newPage();","page.navigate(\"https://playwright.dev\");","context.tracing().stop(new Tracing.StopOptions()"," .setPath(Paths.get(\"trace.zip\")));"],"codeLang":"java"},{"type":"code","lines":["browser = await chromium.launch()","context = await browser.new_context()","await context.tracing.start(screenshots=True, snapshots=True)","page = await context.new_page()","await page.goto(\"https://playwright.dev\")","await context.tracing.stop(path = \"trace.zip\")"],"codeLang":"python async"},{"type":"code","lines":["browser = chromium.launch()","context = browser.new_context()","context.tracing.start(screenshots=True, snapshots=True)","page = context.new_page()","page.goto(\"https://playwright.dev\")","context.tracing.stop(path = \"trace.zip\")"],"codeLang":"python sync"},{"type":"code","lines":["using var playwright = await Playwright.CreateAsync();","var browser = await playwright.Chromium.LaunchAsync();","await using var context = await browser.NewContextAsync();","await context.Tracing.StartAsync(new()","{"," Screenshots = true,"," Snapshots = true","});","var page = await context.NewPageAsync();","await page.GotoAsync(\"https://playwright.dev\");","await context.Tracing.StopAsync(new()","{"," Path = \"trace.zip\"","});"],"codeLang":"csharp"}],"langs":{},"comment":"API for collecting and saving Playwright traces. Playwright traces can be opened in\n[Trace Viewer](../trace-viewer.md) after Playwright script runs.\n\nStart recording a trace before performing actions. At the end, stop tracing and save it to a file.\n\n```js\nconst browser = await chromium.launch();\nconst context = await browser.newContext();\nawait context.tracing.start({ screenshots: true, snapshots: true });\nconst page = await context.newPage();\nawait page.goto('https://playwright.dev');\nawait context.tracing.stop({ path: 'trace.zip' });\n```\n\n```java\nBrowser browser = chromium.launch();\nBrowserContext context = browser.newContext();\ncontext.tracing().start(new Tracing.StartOptions()\n .setScreenshots(true)\n .setSnapshots(true));\nPage page = context.newPage();\npage.navigate(\"https://playwright.dev\");\ncontext.tracing().stop(new Tracing.StopOptions()\n .setPath(Paths.get(\"trace.zip\")));\n```\n\n```py\nbrowser = await chromium.launch()\ncontext = await browser.new_context()\nawait context.tracing.start(screenshots=True, snapshots=True)\npage = await context.new_page()\nawait page.goto(\"https://playwright.dev\")\nawait context.tracing.stop(path = \"trace.zip\")\n```\n\n```py\nbrowser = chromium.launch()\ncontext = browser.new_context()\ncontext.tracing.start(screenshots=True, snapshots=True)\npage = context.new_page()\npage.goto(\"https://playwright.dev\")\ncontext.tracing.stop(path = \"trace.zip\")\n```\n\n```csharp\nusing var playwright = await Playwright.CreateAsync();\nvar browser = await playwright.Chromium.LaunchAsync();\nawait using var context = await browser.NewContextAsync();\nawait context.Tracing.StartAsync(new()\n{\n Screenshots = true,\n Snapshots = true\n});\nvar page = await context.NewPageAsync();\nawait page.GotoAsync(\"https://playwright.dev\");\nawait context.Tracing.StopAsync(new()\n{\n Path = \"trace.zip\"\n});\n```\n","since":"v1.12","members":[{"kind":"method","langs":{},"since":"v1.12","name":"start","type":{"name":"void"},"spec":[{"type":"text","text":"Start tracing."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await context.tracing.start({ screenshots: true, snapshots: true });","const page = await context.newPage();","await page.goto('https://playwright.dev');","await context.tracing.stop({ path: 'trace.zip' });"],"codeLang":"js"},{"type":"code","lines":["context.tracing().start(new Tracing.StartOptions()"," .setScreenshots(true)"," .setSnapshots(true));","Page page = context.newPage();","page.navigate(\"https://playwright.dev\");","context.tracing().stop(new Tracing.StopOptions()"," .setPath(Paths.get(\"trace.zip\")));"],"codeLang":"java"},{"type":"code","lines":["await context.tracing.start(screenshots=True, snapshots=True)","page = await context.new_page()","await page.goto(\"https://playwright.dev\")","await context.tracing.stop(path = \"trace.zip\")"],"codeLang":"python async"},{"type":"code","lines":["context.tracing.start(screenshots=True, snapshots=True)","page = context.new_page()","page.goto(\"https://playwright.dev\")","context.tracing.stop(path = \"trace.zip\")"],"codeLang":"python sync"},{"type":"code","lines":["using var playwright = await Playwright.CreateAsync();","var browser = await playwright.Chromium.LaunchAsync();","await using var context = await browser.NewContextAsync();","await context.Tracing.StartAsync(new()","{"," Screenshots = true,"," Snapshots = true","});","var page = await context.NewPageAsync();","await page.GotoAsync(\"https://playwright.dev\");","await context.Tracing.StopAsync(new()","{"," Path = \"trace.zip\"","});"],"codeLang":"csharp"}],"required":true,"comment":"Start tracing.\n\n**Usage**\n\n```js\nawait context.tracing.start({ screenshots: true, snapshots: true });\nconst page = await context.newPage();\nawait page.goto('https://playwright.dev');\nawait context.tracing.stop({ path: 'trace.zip' });\n```\n\n```java\ncontext.tracing().start(new Tracing.StartOptions()\n .setScreenshots(true)\n .setSnapshots(true));\nPage page = context.newPage();\npage.navigate(\"https://playwright.dev\");\ncontext.tracing().stop(new Tracing.StopOptions()\n .setPath(Paths.get(\"trace.zip\")));\n```\n\n```py\nawait context.tracing.start(screenshots=True, snapshots=True)\npage = await context.new_page()\nawait page.goto(\"https://playwright.dev\")\nawait context.tracing.stop(path = \"trace.zip\")\n```\n\n```py\ncontext.tracing.start(screenshots=True, snapshots=True)\npage = context.new_page()\npage.goto(\"https://playwright.dev\")\ncontext.tracing.stop(path = \"trace.zip\")\n```\n\n```csharp\nusing var playwright = await Playwright.CreateAsync();\nvar browser = await playwright.Chromium.LaunchAsync();\nawait using var context = await browser.NewContextAsync();\nawait context.Tracing.StartAsync(new()\n{\n Screenshots = true,\n Snapshots = true\n});\nvar page = await context.NewPageAsync();\nawait page.GotoAsync(\"https://playwright.dev\");\nawait context.Tracing.StopAsync(new()\n{\n Path = \"trace.zip\"\n});\n```\n","async":true,"alias":"start","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.12","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"If specified, intermediate trace files are going to be saved into the files with the↵given name prefix inside the `tracesDir` folder specified in [`method: BrowserType.launch`].↵To specify the final trace zip file name, you need to pass `path` option to↵[`method: Tracing.stop`] instead."}],"required":false,"comment":"If specified, intermediate trace files are going to be saved into the files with the given name prefix inside the\n`tracesDir` folder specified in [`method: BrowserType.launch`]. To specify the final trace zip file name, you need\nto pass `path` option to [`method: Tracing.stop`] instead.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.12","name":"screenshots","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to capture screenshots during tracing. Screenshots are used to build↵a timeline preview."}],"required":false,"comment":"Whether to capture screenshots during tracing. Screenshots are used to build a timeline preview.","async":false,"alias":"screenshots","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.12","name":"snapshots","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"If this option is true tracing will"},{"type":"li","text":"capture DOM snapshot on every action","liType":"bullet"},{"type":"li","text":"record network activity","liType":"bullet"}],"required":false,"comment":"If this option is true tracing will\n- capture DOM snapshot on every action\n- record network activity","async":false,"alias":"snapshots","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js","csharp","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.17","name":"sources","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to include source files for trace actions."}],"required":false,"comment":"Whether to include source files for trace actions.","async":false,"alias":"sources","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.17","name":"sources","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to include source files for trace actions. List of the directories with source code for the application↵must be provided via `PLAYWRIGHT_JAVA_SRC` environment variable (the paths should be separated by ';' on Windows↵and by ':' on other platforms)."}],"required":false,"comment":"Whether to include source files for trace actions. List of the directories with source code for the application\nmust be provided via `PLAYWRIGHT_JAVA_SRC` environment variable (the paths should be separated by ';' on Windows\nand by ':' on other platforms).","async":false,"alias":"sources","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.17","name":"title","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Trace name to be shown in the Trace Viewer."}],"required":false,"comment":"Trace name to be shown in the Trace Viewer.","async":false,"alias":"title","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.15","name":"startChunk","type":{"name":"void"},"spec":[{"type":"text","text":"Start a new trace chunk. If you'd like to record multiple traces on the same `BrowserContext`, use [`method: Tracing.start`] once, and then create multiple trace chunks with [`method: Tracing.startChunk`] and [`method: Tracing.stopChunk`]."},{"type":"text","text":"**Usage**"},{"type":"code","lines":["await context.tracing.start({ screenshots: true, snapshots: true });","const page = await context.newPage();","await page.goto('https://playwright.dev');","","await context.tracing.startChunk();","await page.getByText('Get Started').click();","// Everything between startChunk and stopChunk will be recorded in the trace.","await context.tracing.stopChunk({ path: 'trace1.zip' });","","await context.tracing.startChunk();","await page.goto('http://example.com');","// Save a second trace file with different actions.","await context.tracing.stopChunk({ path: 'trace2.zip' });"],"codeLang":"js"},{"type":"code","lines":["context.tracing().start(new Tracing.StartOptions()"," .setScreenshots(true)"," .setSnapshots(true));","Page page = context.newPage();","page.navigate(\"https://playwright.dev\");","","context.tracing().startChunk();","page.getByText(\"Get Started\").click();","// Everything between startChunk and stopChunk will be recorded in the trace.","context.tracing().stopChunk(new Tracing.StopChunkOptions()"," .setPath(Paths.get(\"trace1.zip\")));","","context.tracing().startChunk();","page.navigate(\"http://example.com\");","// Save a second trace file with different actions.","context.tracing().stopChunk(new Tracing.StopChunkOptions()"," .setPath(Paths.get(\"trace2.zip\")));"],"codeLang":"java"},{"type":"code","lines":["await context.tracing.start(screenshots=True, snapshots=True)","page = await context.new_page()","await page.goto(\"https://playwright.dev\")","","await context.tracing.start_chunk()","await page.get_by_text(\"Get Started\").click()","# Everything between start_chunk and stop_chunk will be recorded in the trace.","await context.tracing.stop_chunk(path = \"trace1.zip\")","","await context.tracing.start_chunk()","await page.goto(\"http://example.com\")","# Save a second trace file with different actions.","await context.tracing.stop_chunk(path = \"trace2.zip\")"],"codeLang":"python async"},{"type":"code","lines":["context.tracing.start(screenshots=True, snapshots=True)","page = context.new_page()","page.goto(\"https://playwright.dev\")","","context.tracing.start_chunk()","page.get_by_text(\"Get Started\").click()","# Everything between start_chunk and stop_chunk will be recorded in the trace.","context.tracing.stop_chunk(path = \"trace1.zip\")","","context.tracing.start_chunk()","page.goto(\"http://example.com\")","# Save a second trace file with different actions.","context.tracing.stop_chunk(path = \"trace2.zip\")"],"codeLang":"python sync"},{"type":"code","lines":["using var playwright = await Playwright.CreateAsync();","var browser = await playwright.Chromium.LaunchAsync();","await using var context = await browser.NewContextAsync();","await context.Tracing.StartAsync(new()","{"," Screenshots = true,"," Snapshots = true","});","var page = await context.NewPageAsync();","await page.GotoAsync(\"https://playwright.dev\");","","await context.Tracing.StartChunkAsync();","await page.GetByText(\"Get Started\").ClickAsync();","// Everything between StartChunkAsync and StopChunkAsync will be recorded in the trace.","await context.Tracing.StopChunkAsync(new()","{"," Path = \"trace1.zip\"","});","","await context.Tracing.StartChunkAsync();","await page.GotoAsync(\"http://example.com\");","// Save a second trace file with different actions.","await context.Tracing.StopChunkAsync(new()","{"," Path = \"trace2.zip\"","});"],"codeLang":"csharp"}],"required":true,"comment":"Start a new trace chunk. If you'd like to record multiple traces on the same `BrowserContext`, use\n[`method: Tracing.start`] once, and then create multiple trace chunks with [`method: Tracing.startChunk`] and\n[`method: Tracing.stopChunk`].\n\n**Usage**\n\n```js\nawait context.tracing.start({ screenshots: true, snapshots: true });\nconst page = await context.newPage();\nawait page.goto('https://playwright.dev');\n\nawait context.tracing.startChunk();\nawait page.getByText('Get Started').click();\n// Everything between startChunk and stopChunk will be recorded in the trace.\nawait context.tracing.stopChunk({ path: 'trace1.zip' });\n\nawait context.tracing.startChunk();\nawait page.goto('http://example.com');\n// Save a second trace file with different actions.\nawait context.tracing.stopChunk({ path: 'trace2.zip' });\n```\n\n```java\ncontext.tracing().start(new Tracing.StartOptions()\n .setScreenshots(true)\n .setSnapshots(true));\nPage page = context.newPage();\npage.navigate(\"https://playwright.dev\");\n\ncontext.tracing().startChunk();\npage.getByText(\"Get Started\").click();\n// Everything between startChunk and stopChunk will be recorded in the trace.\ncontext.tracing().stopChunk(new Tracing.StopChunkOptions()\n .setPath(Paths.get(\"trace1.zip\")));\n\ncontext.tracing().startChunk();\npage.navigate(\"http://example.com\");\n// Save a second trace file with different actions.\ncontext.tracing().stopChunk(new Tracing.StopChunkOptions()\n .setPath(Paths.get(\"trace2.zip\")));\n```\n\n```py\nawait context.tracing.start(screenshots=True, snapshots=True)\npage = await context.new_page()\nawait page.goto(\"https://playwright.dev\")\n\nawait context.tracing.start_chunk()\nawait page.get_by_text(\"Get Started\").click()\n# Everything between start_chunk and stop_chunk will be recorded in the trace.\nawait context.tracing.stop_chunk(path = \"trace1.zip\")\n\nawait context.tracing.start_chunk()\nawait page.goto(\"http://example.com\")\n# Save a second trace file with different actions.\nawait context.tracing.stop_chunk(path = \"trace2.zip\")\n```\n\n```py\ncontext.tracing.start(screenshots=True, snapshots=True)\npage = context.new_page()\npage.goto(\"https://playwright.dev\")\n\ncontext.tracing.start_chunk()\npage.get_by_text(\"Get Started\").click()\n# Everything between start_chunk and stop_chunk will be recorded in the trace.\ncontext.tracing.stop_chunk(path = \"trace1.zip\")\n\ncontext.tracing.start_chunk()\npage.goto(\"http://example.com\")\n# Save a second trace file with different actions.\ncontext.tracing.stop_chunk(path = \"trace2.zip\")\n```\n\n```csharp\nusing var playwright = await Playwright.CreateAsync();\nvar browser = await playwright.Chromium.LaunchAsync();\nawait using var context = await browser.NewContextAsync();\nawait context.Tracing.StartAsync(new()\n{\n Screenshots = true,\n Snapshots = true\n});\nvar page = await context.NewPageAsync();\nawait page.GotoAsync(\"https://playwright.dev\");\n\nawait context.Tracing.StartChunkAsync();\nawait page.GetByText(\"Get Started\").ClickAsync();\n// Everything between StartChunkAsync and StopChunkAsync will be recorded in the trace.\nawait context.Tracing.StopChunkAsync(new()\n{\n Path = \"trace1.zip\"\n});\n\nawait context.Tracing.StartChunkAsync();\nawait page.GotoAsync(\"http://example.com\");\n// Save a second trace file with different actions.\nawait context.Tracing.StopChunkAsync(new()\n{\n Path = \"trace2.zip\"\n});\n```\n","async":true,"alias":"startChunk","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.32","name":"name","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"If specified, intermediate trace files are going to be saved into the files with the↵given name prefix inside the `tracesDir` folder specified in [`method: BrowserType.launch`].↵To specify the final trace zip file name, you need to pass `path` option to↵[`method: Tracing.stopChunk`] instead."}],"required":false,"comment":"If specified, intermediate trace files are going to be saved into the files with the given name prefix inside the\n`tracesDir` folder specified in [`method: BrowserType.launch`]. To specify the final trace zip file name, you need\nto pass `path` option to [`method: Tracing.stopChunk`] instead.","async":false,"alias":"name","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.17","name":"title","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Trace name to be shown in the Trace Viewer."}],"required":false,"comment":"Trace name to be shown in the Trace Viewer.","async":false,"alias":"title","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.12","name":"stop","type":{"name":"void"},"spec":[{"type":"text","text":"Stop tracing."}],"required":true,"comment":"Stop tracing.","async":true,"alias":"stop","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.12","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Export trace into the file with the given path."}],"required":false,"comment":"Export trace into the file with the given path.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.15","name":"stopChunk","type":{"name":"void"},"spec":[{"type":"text","text":"Stop the trace chunk. See [`method: Tracing.startChunk`] for more details about multiple trace chunks."}],"required":true,"comment":"Stop the trace chunk. See [`method: Tracing.startChunk`] for more details about multiple trace chunks.","async":true,"alias":"stopChunk","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.15","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Export trace collected since the last [`method: Tracing.startChunk`] call into the file with the given path."}],"required":false,"comment":"Export trace collected since the last [`method: Tracing.startChunk`] call into the file with the given path.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]}]},{"name":"Video","spec":[{"type":"text","text":"When browser context is created with the `recordVideo` option, each page has a video object associated with it."},{"type":"code","lines":["console.log(await page.video().path());"],"codeLang":"js"},{"type":"code","lines":["System.out.println(page.video().path());"],"codeLang":"java"},{"type":"code","lines":["print(await page.video.path())"],"codeLang":"python async"},{"type":"code","lines":["print(page.video.path())"],"codeLang":"python sync"},{"type":"code","lines":["Console.WriteLine(await page.Video.GetPathAsync());"],"codeLang":"csharp"}],"langs":{},"comment":"When browser context is created with the `recordVideo` option, each page has a video object associated with it.\n\n```js\nconsole.log(await page.video().path());\n```\n\n```java\nSystem.out.println(page.video().path());\n```\n\n```py\nprint(await page.video.path())\n```\n\n```py\nprint(page.video.path())\n```\n\n```csharp\nConsole.WriteLine(await page.Video.GetPathAsync());\n```\n","since":"v1.8","members":[{"kind":"method","langs":{},"since":"v1.11","name":"delete","type":{"name":"void"},"spec":[{"type":"text","text":"Deletes the video file. Will wait for the video to finish if necessary."}],"required":true,"comment":"Deletes the video file. Will wait for the video to finish if necessary.","async":true,"alias":"delete","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Returns the file system path this video will be recorded to. The video is guaranteed to be written to the filesystem↵upon closing the browser context. This method throws when connected remotely."}],"required":true,"comment":"Returns the file system path this video will be recorded to. The video is guaranteed to be written to the\nfilesystem upon closing the browser context. This method throws when connected remotely.","async":true,"alias":"path","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"types":{"java":{"name":"void"},"python":{"name":"void"}}},"since":"v1.11","name":"saveAs","type":{"name":"void"},"spec":[{"type":"text","text":"Saves the video to a user-specified path. It is safe to call this method while the video↵is still in progress, or after the page has closed. This method waits until the page is closed and the video is fully saved."}],"required":true,"comment":"Saves the video to a user-specified path. It is safe to call this method while the video is still in progress, or\nafter the page has closed. This method waits until the page is closed and the video is fully saved.","async":true,"alias":"saveAs","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.11","name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path where the video should be saved."}],"required":true,"comment":"Path where the video should be saved.","async":false,"alias":"path","overloadIndex":0,"paramOrOption":null}]}]},{"name":"WebError","spec":[{"type":"text","text":"`WebError` class represents an unhandled exception thrown in the page. It is dispatched via the [`event: BrowserContext.webError`] event."},{"type":"code","lines":["// Log all uncaught errors to the terminal","context.on('weberror', webError => {"," console.log(`Uncaught exception: \"${webError.error()}\"`);","});","","// Navigate to a page with an exception.","await page.goto('data:text/html,<script>throw new Error(\"Test\")</script>');"],"codeLang":"js"},{"type":"code","lines":["// Log all uncaught errors to the terminal","context.onWebError(webError -> {"," System.out.println(\"Uncaught exception: \" + webError.error());","});","","// Navigate to a page with an exception.","page.navigate(\"data:text/html,<script>throw new Error('Test')</script>\");"],"codeLang":"java"},{"type":"code","lines":["# Log all uncaught errors to the terminal","context.on(\"weberror\", lambda web_error: print(f\"uncaught exception: {web_error.error}\"))","","# Navigate to a page with an exception.","await page.goto(\"data:text/html,<script>throw new Error('test')</script>\")"],"codeLang":"python async"},{"type":"code","lines":["# Log all uncaught errors to the terminal","context.on(\"weberror\", lambda web_error: print(f\"uncaught exception: {web_error.error}\"))","","# Navigate to a page with an exception.","page.goto(\"data:text/html,<script>throw new Error('test')</script>\")"],"codeLang":"python sync"},{"type":"code","lines":["// Log all uncaught errors to the terminal","context.WebError += (_, webError) =>","{"," Console.WriteLine(\"Uncaught exception: \" + webError.Error);","};"],"codeLang":"csharp"}],"langs":{},"comment":"`WebError` class represents an unhandled exception thrown in the page. It is dispatched via the\n[`event: BrowserContext.webError`] event.\n\n```js\n// Log all uncaught errors to the terminal\ncontext.on('weberror', webError => {\n console.log(`Uncaught exception: \"${webError.error()}\"`);\n});\n\n// Navigate to a page with an exception.\nawait page.goto('data:text/html,<script>throw new Error(\"Test\")</script>');\n```\n\n```java\n// Log all uncaught errors to the terminal\ncontext.onWebError(webError -> {\n System.out.println(\"Uncaught exception: \" + webError.error());\n});\n\n// Navigate to a page with an exception.\npage.navigate(\"data:text/html,<script>throw new Error('Test')</script>\");\n```\n\n```py\n# Log all uncaught errors to the terminal\ncontext.on(\"weberror\", lambda web_error: print(f\"uncaught exception: {web_error.error}\"))\n\n# Navigate to a page with an exception.\nawait page.goto(\"data:text/html,<script>throw new Error('test')</script>\")\n```\n\n```py\n# Log all uncaught errors to the terminal\ncontext.on(\"weberror\", lambda web_error: print(f\"uncaught exception: {web_error.error}\"))\n\n# Navigate to a page with an exception.\npage.goto(\"data:text/html,<script>throw new Error('test')</script>\")\n```\n\n```csharp\n// Log all uncaught errors to the terminal\ncontext.WebError += (_, webError) =>\n{\n Console.WriteLine(\"Uncaught exception: \" + webError.Error);\n};\n```\n","since":"v1.38","members":[{"kind":"method","langs":{},"since":"v1.38","name":"page","type":{"name":"","union":[{"name":"null"},{"name":"Page"}],"expression":"[null]|[Page]"},"spec":[{"type":"text","text":"The page that produced this unhandled exception, if any."}],"required":true,"comment":"The page that produced this unhandled exception, if any.","async":false,"alias":"page","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"types":{"java":{"name":"string","expression":"[string]"},"csharp":{"name":"string","expression":"[string]"}}},"since":"v1.38","name":"error","type":{"name":"Error","expression":"[Error]"},"spec":[{"type":"text","text":"Unhandled error that was thrown."}],"required":true,"comment":"Unhandled error that was thrown.","async":false,"alias":"error","overloadIndex":0,"paramOrOption":null,"args":[]}]},{"name":"WebSocket","spec":[{"type":"text","text":"The `WebSocket` class represents websocket connections in the page."}],"langs":{},"comment":"The `WebSocket` class represents websocket connections in the page.","since":"v1.8","members":[{"kind":"event","langs":{},"since":"v1.8","name":"close","type":{"name":"WebSocket","expression":"[WebSocket]"},"spec":[{"type":"text","text":"Fired when the websocket closes."}],"required":true,"comment":"Fired when the websocket closes.","async":false,"alias":"close","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{"types":{"python":{"name":"","union":[{"name":"string"},{"name":"Buffer"}],"expression":"[string]|[Buffer]"},"csharp":{"name":"WebSocketFrame","expression":"[WebSocketFrame]"},"java":{"name":"WebSocketFrame","expression":"[WebSocketFrame]"}}},"since":"v1.9","name":"frameReceived","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"payload","type":{"name":"","union":[{"name":"string"},{"name":"Buffer"}],"expression":"[string]|[Buffer]"},"spec":[{"type":"text","text":"frame payload"}],"required":true,"comment":"frame payload","async":false,"alias":"payload","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Fired when the websocket receives a frame."}],"required":true,"comment":"Fired when the websocket receives a frame.","async":false,"alias":"frameReceived","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{"types":{"python":{"name":"","union":[{"name":"string"},{"name":"Buffer"}],"expression":"[string]|[Buffer]"},"csharp":{"name":"WebSocketFrame","expression":"[WebSocketFrame]"},"java":{"name":"WebSocketFrame","expression":"[WebSocketFrame]"}}},"since":"v1.9","name":"frameSent","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"payload","type":{"name":"","union":[{"name":"string"},{"name":"Buffer"}],"expression":"[string]|[Buffer]"},"spec":[{"type":"text","text":"frame payload"}],"required":true,"comment":"frame payload","async":false,"alias":"payload","overloadIndex":0,"paramOrOption":null}],"expression":"[Object]"},"spec":[{"type":"text","text":"Fired when the websocket sends a frame."}],"required":true,"comment":"Fired when the websocket sends a frame.","async":false,"alias":"frameSent","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"event","langs":{},"since":"v1.9","name":"socketError","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Fired when the websocket has an error."}],"required":true,"comment":"Fired when the websocket has an error.","async":false,"alias":"socketError","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"isClosed","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Indicates that the web socket has been closed."}],"required":true,"comment":"Indicates that the web socket has been closed.","async":false,"alias":"isClosed","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"url","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Contains the URL of the WebSocket."}],"required":true,"comment":"Contains the URL of the WebSocket.","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"only":["js","python"],"aliases":{"python":"expect_event"},"types":{"python":{"name":"EventContextManager","expression":"[EventContextManager]"}},"overrides":{}},"since":"v1.8","name":"waitForEvent","type":{"name":"any","expression":"[any]"},"spec":[{"type":"text","text":"Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy↵value. Will throw an error if the webSocket is closed before the event is fired. Returns the event data value."}],"required":true,"comment":"Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy\nvalue. Will throw an error if the webSocket is closed before the event is fired. Returns the event data value.","async":true,"alias":"waitForEvent","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.8","name":"event","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Event name, same one would pass into `webSocket.on(event)`."}],"required":true,"comment":"Event name, same one would pass into `webSocket.on(event)`.","async":false,"alias":"event","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"optionsOrPredicate","type":{"name":"","union":[{"name":"function"},{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.0","name":"predicate","type":{"name":"function","expression":"[function]"},"spec":[{"type":"text","text":"Receives the event data and resolves to truthy value when the waiting should resolve."}],"required":true,"comment":"Receives the event data and resolves to truthy value when the waiting should resolve.","async":false,"alias":"predicate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `0` - no timeout. The default value can be changed via\n`actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or\n[`method: Page.setDefaultTimeout`] methods.","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]}],"expression":"[function]|[Object]"},"spec":[{"type":"text","text":"Either a predicate that receives an event or an options object. Optional."}],"required":false,"comment":"Either a predicate that receives an event or an options object. Optional.","async":false,"alias":"optionsOrPredicate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"predicate","type":{"name":"function","expression":"[function]"},"spec":[{"type":"text","text":"Receives the event data and resolves to truthy value when the waiting should resolve."}],"required":false,"comment":"Receives the event data and resolves to truthy value when the waiting should resolve.","async":false,"alias":"predicate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.↵The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`]."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.10","name":"waitForFrameReceived","type":{"name":"WebSocketFrame","expression":"[WebSocketFrame]"},"spec":[{"type":"text","text":"Performs action and waits for a frame to be sent. If predicate is provided, it passes↵`WebSocketFrame` value into the `predicate` function and waits for `predicate(webSocketFrame)` to return a truthy value.↵Will throw an error if the WebSocket or Page is closed before the frame is received."}],"required":true,"comment":"Performs action and waits for a frame to be sent. If predicate is provided, it passes `WebSocketFrame` value into\nthe `predicate` function and waits for `predicate(webSocketFrame)` to return a truthy value. Will throw an error if\nthe WebSocket or Page is closed before the frame is received.","async":true,"alias":"waitForFrameReceived","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"predicate","type":{"name":"function","args":[{"name":"WebSocketFrame"}],"returnType":{"name":"boolean"},"expression":"[function]([WebSocketFrame]):[boolean]"},"spec":[{"type":"text","text":"Receives the `WebSocketFrame` object and resolves to truthy value when the waiting should resolve."}],"required":false,"comment":"Receives the `WebSocketFrame` object and resolves to truthy value when the waiting should resolve.","async":false,"alias":"predicate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.↵The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`]."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"callback","type":{"name":"Runnable","expression":"[Runnable]"},"spec":[{"type":"text","text":"Callback that performs the action triggering the event."}],"required":true,"comment":"Callback that performs the action triggering the event.","async":false,"alias":"callback","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.10","name":"waitForFrameSent","type":{"name":"WebSocketFrame","expression":"[WebSocketFrame]"},"spec":[{"type":"text","text":"Performs action and waits for a frame to be sent. If predicate is provided, it passes↵`WebSocketFrame` value into the `predicate` function and waits for `predicate(webSocketFrame)` to return a truthy value.↵Will throw an error if the WebSocket or Page is closed before the frame is sent."}],"required":true,"comment":"Performs action and waits for a frame to be sent. If predicate is provided, it passes `WebSocketFrame` value into\nthe `predicate` function and waits for `predicate(webSocketFrame)` to return a truthy value. Will throw an error if\nthe WebSocket or Page is closed before the frame is sent.","async":true,"alias":"waitForFrameSent","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.9","name":"predicate","type":{"name":"function","args":[{"name":"WebSocketFrame"}],"returnType":{"name":"boolean"},"expression":"[function]([WebSocketFrame]):[boolean]"},"spec":[{"type":"text","text":"Receives the `WebSocketFrame` object and resolves to truthy value when the waiting should resolve."}],"required":false,"comment":"Receives the `WebSocketFrame` object and resolves to truthy value when the waiting should resolve.","async":false,"alias":"predicate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.↵The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`]."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"callback","type":{"name":"Runnable","expression":"[Runnable]"},"spec":[{"type":"text","text":"Callback that performs the action triggering the event."}],"required":true,"comment":"Callback that performs the action triggering the event.","async":false,"alias":"callback","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{"only":["python"],"aliases":{"python":"wait_for_event"},"types":{},"overrides":{}},"since":"v1.8","name":"waitForEvent2","type":{"name":"any","expression":"[any]"},"spec":[{"type":"note","noteType":"note","text":"In most cases, you should use [`method: WebSocket.waitForEvent`]."},{"type":"text","text":"Waits for given `event` to fire. If predicate is provided, it passes↵event's value into the `predicate` function and waits for `predicate(event)` to return a truthy value.↵Will throw an error if the socket is closed before the `event` is fired."}],"required":true,"comment":"**NOTE** In most cases, you should use [`method: WebSocket.waitForEvent`].\n\nWaits for given `event` to fire. If predicate is provided, it passes event's value into the `predicate` function\nand waits for `predicate(event)` to return a truthy value. Will throw an error if the socket is closed before the\n`event` is fired.","async":true,"alias":"waitForEvent2","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"only":["js","python","java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"event","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Event name, same one typically passed into `*.on(event)`."}],"required":true,"comment":"Event name, same one typically passed into `*.on(event)`.","async":false,"alias":"event","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"since":"v1.8","name":"predicate","type":{"name":"function","expression":"[function]"},"spec":[{"type":"text","text":"Receives the event data and resolves to truthy value when the waiting should resolve."}],"required":false,"comment":"Receives the event data and resolves to truthy value when the waiting should resolve.","async":false,"alias":"predicate","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.↵The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`]."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null}]}]},{"name":"WebSocketFrame","spec":[{"type":"text","text":"The `WebSocketFrame` class represents frames sent over `WebSocket` connections in the page. Frame payload is returned by either [`method: WebSocketFrame.text`] or [`method: WebSocketFrame.binary`] method depending on the its type."}],"langs":{"only":["csharp","java"],"aliases":{},"types":{},"overrides":{}},"comment":"The `WebSocketFrame` class represents frames sent over `WebSocket` connections in the page. Frame payload is\nreturned by either [`method: WebSocketFrame.text`] or [`method: WebSocketFrame.binary`] method depending on the its\ntype.","since":"v1.9","members":[{"kind":"method","langs":{},"since":"v1.9","name":"binary","type":{"name":"","union":[{"name":"null"},{"name":"Buffer"}],"expression":"[null]|[Buffer]"},"spec":[{"type":"text","text":"Returns binary payload."}],"required":true,"comment":"Returns binary payload.","async":false,"alias":"binary","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.9","name":"text","type":{"name":"","union":[{"name":"null"},{"name":"string"}],"expression":"[null]|[string]"},"spec":[{"type":"text","text":"Returns text payload."}],"required":true,"comment":"Returns text payload.","async":false,"alias":"text","overloadIndex":0,"paramOrOption":null,"args":[]}]},{"name":"Worker","spec":[{"type":"text","text":"The Worker class represents a [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API). `worker`↵event is emitted on the page object to signal a worker creation. `close` event is emitted on the worker object when the↵worker is gone."},{"type":"code","lines":["page.on('worker', worker => {"," console.log('Worker created: ' + worker.url());"," worker.on('close', worker => console.log('Worker destroyed: ' + worker.url()));","});","","console.log('Current workers:');","for (const worker of page.workers())"," console.log(' ' + worker.url());"],"codeLang":"js"},{"type":"code","lines":["page.onWorker(worker -> {"," System.out.println(\"Worker created: \" + worker.url());"," worker.onClose(worker1 -> System.out.println(\"Worker destroyed: \" + worker1.url()));","});","System.out.println(\"Current workers:\");","for (Worker worker : page.workers())"," System.out.println(\" \" + worker.url());"],"codeLang":"java"},{"type":"code","lines":["def handle_worker(worker):"," print(\"worker created: \" + worker.url)"," worker.on(\"close\", lambda: print(\"worker destroyed: \" + worker.url))","","page.on('worker', handle_worker)","","print(\"current workers:\")","for worker in page.workers:"," print(\" \" + worker.url)"],"codeLang":"py"},{"type":"code","lines":["page.Worker += (_, worker) =>","{"," Console.WriteLine($\"Worker created: {worker.Url}\");"," worker.Close += (_, _) => Console.WriteLine($\"Worker closed {worker.Url}\");","};","","Console.WriteLine(\"Current Workers:\");","foreach(var pageWorker in page.Workers)","{"," Console.WriteLine($\"\\tWorker: {pageWorker.Url}\");","}"],"codeLang":"csharp"}],"langs":{},"comment":"The Worker class represents a [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API).\n`worker` event is emitted on the page object to signal a worker creation. `close` event is emitted on the worker\nobject when the worker is gone.\n\n```js\npage.on('worker', worker => {\n console.log('Worker created: ' + worker.url());\n worker.on('close', worker => console.log('Worker destroyed: ' + worker.url()));\n});\n\nconsole.log('Current workers:');\nfor (const worker of page.workers())\n console.log(' ' + worker.url());\n```\n\n```java\npage.onWorker(worker -> {\n System.out.println(\"Worker created: \" + worker.url());\n worker.onClose(worker1 -> System.out.println(\"Worker destroyed: \" + worker1.url()));\n});\nSystem.out.println(\"Current workers:\");\nfor (Worker worker : page.workers())\n System.out.println(\" \" + worker.url());\n```\n\n```py\ndef handle_worker(worker):\n print(\"worker created: \" + worker.url)\n worker.on(\"close\", lambda: print(\"worker destroyed: \" + worker.url))\n\npage.on('worker', handle_worker)\n\nprint(\"current workers:\")\nfor worker in page.workers:\n print(\" \" + worker.url)\n```\n\n```csharp\npage.Worker += (_, worker) =>\n{\n Console.WriteLine($\"Worker created: {worker.Url}\");\n worker.Close += (_, _) => Console.WriteLine($\"Worker closed {worker.Url}\");\n};\n\nConsole.WriteLine(\"Current Workers:\");\nforeach(var pageWorker in page.Workers)\n{\n Console.WriteLine($\"\\tWorker: {pageWorker.Url}\");\n}\n```\n","since":"v1.8","members":[{"kind":"event","langs":{},"since":"v1.8","name":"close","type":{"name":"Worker","expression":"[Worker]"},"spec":[{"type":"text","text":"Emitted when this dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is terminated."}],"required":true,"comment":"Emitted when this dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is\nterminated.","async":false,"alias":"close","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{},"since":"v1.8","name":"evaluate","type":{"name":"Serializable","expression":"[Serializable]"},"spec":[{"type":"text","text":"Returns the return value of `expression`."},{"type":"text","text":"If the function passed to the [`method: Worker.evaluate`] returns a [Promise], then [`method: Worker.evaluate`] would wait for the promise↵to resolve and return its value."},{"type":"text","text":"If the function passed to the [`method: Worker.evaluate`] returns a non-[Serializable] value, then [`method: Worker.evaluate`] returns `undefined`. Playwright also supports transferring some↵additional values that are not serializable by `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`."}],"required":true,"comment":"Returns the return value of `expression`.\n\nIf the function passed to the [`method: Worker.evaluate`] returns a [Promise], then [`method: Worker.evaluate`]\nwould wait for the promise to resolve and return its value.\n\nIf the function passed to the [`method: Worker.evaluate`] returns a non-[Serializable] value, then\n[`method: Worker.evaluate`] returns `undefined`. Playwright also supports transferring some additional values that\nare not serializable by `JSON`: `-0`, `NaN`, `Infinity`, `-Infinity`.","async":true,"alias":"evaluate","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"overrides":{"js":{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"expression","type":{"name":"","union":[{"name":"function"},{"name":"string"}],"expression":"[function]|[string]"},"spec":[{"type":"text","text":"Function to be evaluated in the worker context."}],"argsArray":[],"required":true,"comment":"Function to be evaluated in the worker context.","args":{},"clazz":null,"async":false,"alias":"pageFunction","overloadIndex":0,"paramOrOption":null}}},"since":"v1.8","name":"expression","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"JavaScript expression to be evaluated in the browser context. If the expression evaluates↵to a function, the function is automatically invoked."}],"required":true,"comment":"JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the\nfunction is automatically invoked.","async":false,"alias":"expression","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"arg","type":{"name":"EvaluationArgument","expression":"[EvaluationArgument]"},"spec":[{"type":"text","text":"Optional argument to pass to `expression`."}],"required":false,"comment":"Optional argument to pass to `expression`.","async":false,"alias":"arg","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"evaluateHandle","type":{"name":"JSHandle","expression":"[JSHandle]"},"spec":[{"type":"text","text":"Returns the return value of `expression` as a `JSHandle`."},{"type":"text","text":"The only difference between [`method: Worker.evaluate`] and↵[`method: Worker.evaluateHandle`] is that [`method: Worker.evaluateHandle`]↵returns `JSHandle`."},{"type":"text","text":"If the function passed to the [`method: Worker.evaluateHandle`] returns a [Promise], then [`method: Worker.evaluateHandle`] would wait for↵the promise to resolve and return its value."}],"required":true,"comment":"Returns the return value of `expression` as a `JSHandle`.\n\nThe only difference between [`method: Worker.evaluate`] and [`method: Worker.evaluateHandle`] is that\n[`method: Worker.evaluateHandle`] returns `JSHandle`.\n\nIf the function passed to the [`method: Worker.evaluateHandle`] returns a [Promise], then\n[`method: Worker.evaluateHandle`] would wait for the promise to resolve and return its value.","async":true,"alias":"evaluateHandle","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{"overrides":{"js":{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"since":"v1.8","name":"expression","type":{"name":"","union":[{"name":"function"},{"name":"string"}],"expression":"[function]|[string]"},"spec":[{"type":"text","text":"Function to be evaluated in the worker context."}],"argsArray":[],"required":true,"comment":"Function to be evaluated in the worker context.","args":{},"clazz":null,"async":false,"alias":"pageFunction","overloadIndex":0,"paramOrOption":null}}},"since":"v1.8","name":"expression","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"JavaScript expression to be evaluated in the browser context. If the expression evaluates↵to a function, the function is automatically invoked."}],"required":true,"comment":"JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the\nfunction is automatically invoked.","async":false,"alias":"expression","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{},"since":"v1.8","name":"arg","type":{"name":"EvaluationArgument","expression":"[EvaluationArgument]"},"spec":[{"type":"text","text":"Optional argument to pass to `expression`."}],"required":false,"comment":"Optional argument to pass to `expression`.","async":false,"alias":"arg","overloadIndex":0,"paramOrOption":null}]},{"kind":"method","langs":{},"since":"v1.8","name":"url","type":{"name":"string","expression":"[string]"},"spec":[],"required":true,"comment":"","async":false,"alias":"url","overloadIndex":0,"paramOrOption":null,"args":[]},{"kind":"method","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.10","name":"waitForClose","type":{"name":"Worker","expression":"[Worker]"},"spec":[{"type":"text","text":"Performs action and waits for the Worker to close."}],"required":true,"comment":"Performs action and waits for the Worker to close.","async":true,"alias":"waitForClose","overloadIndex":0,"paramOrOption":null,"args":[{"kind":"property","langs":{},"since":"v1.0","name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.↵The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`]."}],"required":false,"comment":"Maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The\ndefault value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].","async":false,"alias":"timeout","overloadIndex":0,"paramOrOption":null}]},"required":false,"comment":"","async":false,"alias":"options","overloadIndex":0,"paramOrOption":null},{"kind":"property","langs":{"only":["java"],"aliases":{},"types":{},"overrides":{}},"since":"v1.9","name":"callback","type":{"name":"Runnable","expression":"[Runnable]"},"spec":[{"type":"text","text":"Callback that performs the action triggering the event."}],"required":true,"comment":"Callback that performs the action triggering the event.","async":false,"alias":"callback","overloadIndex":0,"paramOrOption":null}]}]}]