UNPKG

playwright-chromium

Version:

A high-level API to automate Chromium

1 lines • 1.13 MB
[{"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 used by\nassistive 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 might\nhave wildly different output.\n\nRendering engines of Chromium, Firefox and Webkit have a concept of \"accessibility tree\", which is then translated into\ndifferent 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, exposing\nonly the \"interesting\" nodes of the tree.","members":[{"kind":"method","langs":{"types":{"csharp":{"name":"","union":[{"name":"null"},{"name":"string"}],"expression":"[null]|[string]"},"java":{"name":"","union":[{"name":"null"},{"name":"string"}],"expression":"[null]|[string]"}}},"name":"snapshot","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"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).","deprecated":false,"async":false,"alias":"role"},{"kind":"property","langs":{},"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.","deprecated":false,"async":false,"alias":"name"},{"kind":"property","langs":{},"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":false,"comment":"The current value of the node, if applicable.","deprecated":false,"async":false,"alias":"value"},{"kind":"property","langs":{},"name":"description","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"An additional human readable description of the node, if applicable."}],"required":false,"comment":"An additional human readable description of the node, if applicable.","deprecated":false,"async":false,"alias":"description"},{"kind":"property","langs":{},"name":"keyshortcuts","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Keyboard shortcuts associated with this node, if applicable."}],"required":false,"comment":"Keyboard shortcuts associated with this node, if applicable.","deprecated":false,"async":false,"alias":"keyshortcuts"},{"kind":"property","langs":{},"name":"roledescription","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A human readable alternative to the role, if applicable."}],"required":false,"comment":"A human readable alternative to the role, if applicable.","deprecated":false,"async":false,"alias":"roledescription"},{"kind":"property","langs":{},"name":"valuetext","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"A description of the current value, if applicable."}],"required":false,"comment":"A description of the current value, if applicable.","deprecated":false,"async":false,"alias":"valuetext"},{"kind":"property","langs":{},"name":"disabled","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether the node is disabled, if applicable."}],"required":false,"comment":"Whether the node is disabled, if applicable.","deprecated":false,"async":false,"alias":"disabled"},{"kind":"property","langs":{},"name":"expanded","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether the node is expanded or collapsed, if applicable."}],"required":false,"comment":"Whether the node is expanded or collapsed, if applicable.","deprecated":false,"async":false,"alias":"expanded"},{"kind":"property","langs":{},"name":"focused","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether the node is focused, if applicable."}],"required":false,"comment":"Whether the node is focused, if applicable.","deprecated":false,"async":false,"alias":"focused"},{"kind":"property","langs":{},"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":false,"comment":"Whether the node is [modal](https://en.wikipedia.org/wiki/Modal_window), if applicable.","deprecated":false,"async":false,"alias":"modal"},{"kind":"property","langs":{},"name":"multiline","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether the node text input supports multiline, if applicable."}],"required":false,"comment":"Whether the node text input supports multiline, if applicable.","deprecated":false,"async":false,"alias":"multiline"},{"kind":"property","langs":{},"name":"multiselectable","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether more than one child can be selected, if applicable."}],"required":false,"comment":"Whether more than one child can be selected, if applicable.","deprecated":false,"async":false,"alias":"multiselectable"},{"kind":"property","langs":{},"name":"readonly","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether the node is read only, if applicable."}],"required":false,"comment":"Whether the node is read only, if applicable.","deprecated":false,"async":false,"alias":"readonly"},{"kind":"property","langs":{},"name":"required","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether the node is required, if applicable."}],"required":false,"comment":"Whether the node is required, if applicable.","deprecated":false,"async":false,"alias":"required"},{"kind":"property","langs":{},"name":"selected","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether the node is selected in its parent node, if applicable."}],"required":false,"comment":"Whether the node is selected in its parent node, if applicable.","deprecated":false,"async":false,"alias":"selected"},{"kind":"property","langs":{},"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":false,"comment":"Whether the checkbox is checked, or \"mixed\", if applicable.","deprecated":false,"async":false,"alias":"checked"},{"kind":"property","langs":{},"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":false,"comment":"Whether the toggle button is checked, or \"mixed\", if applicable.","deprecated":false,"async":false,"alias":"pressed"},{"kind":"property","langs":{},"name":"level","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"The level of a heading, if applicable."}],"required":false,"comment":"The level of a heading, if applicable.","deprecated":false,"async":false,"alias":"level"},{"kind":"property","langs":{},"name":"valuemin","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"The minimum value in a node, if applicable."}],"required":false,"comment":"The minimum value in a node, if applicable.","deprecated":false,"async":false,"alias":"valuemin"},{"kind":"property","langs":{},"name":"valuemax","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"The maximum value in a node, if applicable."}],"required":false,"comment":"The maximum value in a node, if applicable.","deprecated":false,"async":false,"alias":"valuemax"},{"kind":"property","langs":{},"name":"autocomplete","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"What kind of autocomplete is supported by a control, if applicable."}],"required":false,"comment":"What kind of autocomplete is supported by a control, if applicable.","deprecated":false,"async":false,"alias":"autocomplete"},{"kind":"property","langs":{},"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":false,"comment":"What kind of popup is currently being shown for a node, if applicable.","deprecated":false,"async":false,"alias":"haspopup"},{"kind":"property","langs":{},"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":false,"comment":"Whether and in what way this node's value is invalid, if applicable.","deprecated":false,"async":false,"alias":"invalid"},{"kind":"property","langs":{},"name":"orientation","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":"Whether the node is oriented horizontally or vertically, if applicable."}],"required":false,"comment":"Whether the node is oriented horizontally or vertically, if applicable.","deprecated":false,"async":false,"alias":"orientation"},{"kind":"property","langs":{},"name":"children","type":{"name":"Array","templates":[{"name":"Object"}],"expression":"[Array]<[Object]>"},"spec":[{"type":"text","text":"Child nodes, if any, if applicable."}],"required":false,"comment":"Child nodes, if any, if applicable.","deprecated":false,"async":false,"alias":"children"}]}],"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":"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":"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);"," return foundNode;"," }"," return null;","}"],"codeLang":"js"},{"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)"," 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)"," 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 the\npage.\n\n> NOTE: The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen readers.\nPlaywright will discard them as well for an easier to process tree, unless `interestingOnly` is set to `false`.\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```python async\nsnapshot = await page.accessibility.snapshot()\nprint(snapshot)\n```\n\n```python sync\nsnapshot = page.accessibility.snapshot()\nprint(snapshot)\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 return foundNode;\n }\n return null;\n}\n```\n\n```java\n// FIXME\nString snapshot = page.accessibility().snapshot();\n```\n\n```python async\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 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```python sync\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 return found_node\n return None\n\nsnapshot = page.accessibility.snapshot()\nnode = find_focused_node(snapshot)\nif node:\n print(node[\"name\"])\n```\n","deprecated":false,"async":true,"alias":"snapshot","args":[{"kind":"property","langs":{},"name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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`.","deprecated":false,"async":false,"alias":"interestingOnly"},{"kind":"property","langs":{},"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.","deprecated":false,"async":false,"alias":"root"}]},"required":false,"comment":"","deprecated":false,"async":false,"alias":"options"}]}]},{"name":"Android","spec":[{"type":"text","text":"Playwright has **experimental** support for Android automation. You can access android namespace via:"},{"type":"code","lines":["const { _android } = require('playwright');"],"codeLang":"js"},{"type":"text","text":"An example of the Android automation script would be:"},{"type":"code","lines":["const { _android } = require('playwright');","","(async () => {"," // Connect to the device."," const [device] = await playwright._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.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"},{"type":"text","text":"Note that since you don't need Playwright to install web browsers when testing Android, you can omit browser download via setting the following environment variable when installing Playwright:"},{"type":"code","lines":["$ PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm i -D playwright"],"codeLang":"sh js"}],"langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"comment":"Playwright has **experimental** support for Android automation. You can access android namespace via:\n\n```js\nconst { _android } = require('playwright');\n```\n\nAn example of the Android automation script would be:\n\n```js\nconst { _android } = require('playwright');\n\n(async () => {\n // Connect to the device.\n const [device] = await playwright._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({ res: 'org.chromium.webview_shell:id/url_field' }, 'github.com/microsoft/playwright');\n await device.press({ res: 'org.chromium.webview_shell:id/url_field' }, 'Enter');\n\n // Work with WebView's page as usual.\n const page = await webview.page();\n await page.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\nNote that since you don't need Playwright to install web browsers when testing Android, you can omit browser download\nvia setting the following environment variable when installing Playwright:\n\n```sh js\n$ PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm i -D playwright\n```\n","members":[{"kind":"method","langs":{},"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.","deprecated":false,"async":true,"alias":"devices","args":[]},{"kind":"method","langs":{},"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.","deprecated":false,"async":false,"alias":"setDefaultTimeout","args":[{"kind":"property","langs":{},"name":"timeout","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Maximum time in milliseconds"}],"required":true,"comment":"Maximum time in milliseconds","deprecated":false,"async":false,"alias":"timeout"}]}]},{"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`].","members":[{"kind":"event","langs":{},"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.","deprecated":false,"async":false,"alias":"webView","args":[]},{"kind":"method","langs":{},"name":"close","type":{"name":"void"},"spec":[{"type":"text","text":"Disconnects from the device."}],"required":true,"comment":"Disconnects from the device.","deprecated":false,"async":true,"alias":"close","args":[]},{"kind":"method","langs":{},"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.","deprecated":false,"async":true,"alias":"drag","args":[{"kind":"property","langs":{},"name":"selector","type":{"name":"AndroidSelector","expression":"[AndroidSelector]"},"spec":[{"type":"text","text":"Selector to drag."}],"required":true,"comment":"Selector to drag.","deprecated":false,"async":false,"alias":"selector"},{"kind":"property","langs":{},"name":"dest","type":{"name":"Object","properties":[{"kind":"property","langs":{},"name":"x","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","deprecated":false,"async":false,"alias":"x"},{"kind":"property","langs":{},"name":"y","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","deprecated":false,"async":false,"alias":"y"}],"expression":"[Object]"},"spec":[{"type":"text","text":"Point to drag to."}],"required":true,"comment":"Point to drag to.","deprecated":false,"async":false,"alias":"dest"},{"kind":"property","langs":{},"name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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.","deprecated":false,"async":false,"alias":"speed"},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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 by\nusing the [`method: AndroidDevice.setDefaultTimeout`] method.","deprecated":false,"async":false,"alias":"timeout"}]},"required":false,"comment":"","deprecated":false,"async":false,"alias":"options"}]},{"kind":"method","langs":{},"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`.","deprecated":false,"async":true,"alias":"fill","args":[{"kind":"property","langs":{},"name":"selector","type":{"name":"AndroidSelector","expression":"[AndroidSelector]"},"spec":[{"type":"text","text":"Selector to fill."}],"required":true,"comment":"Selector to fill.","deprecated":false,"async":false,"alias":"selector"},{"kind":"property","langs":{},"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.","deprecated":false,"async":false,"alias":"text"},{"kind":"property","langs":{},"name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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 by\nusing the [`method: AndroidDevice.setDefaultTimeout`] method.","deprecated":false,"async":false,"alias":"timeout"}]},"required":false,"comment":"","deprecated":false,"async":false,"alias":"options"}]},{"kind":"method","langs":{},"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`.","deprecated":false,"async":true,"alias":"fling","args":[{"kind":"property","langs":{},"name":"selector","type":{"name":"AndroidSelector","expression":"[AndroidSelector]"},"spec":[{"type":"text","text":"Selector to fling."}],"required":true,"comment":"Selector to fling.","deprecated":false,"async":false,"alias":"selector"},{"kind":"property","langs":{},"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.","deprecated":false,"async":false,"alias":"direction"},{"kind":"property","langs":{},"name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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.","deprecated":false,"async":false,"alias":"speed"},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"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 by\nusing the [`method: AndroidDevice.setDefaultTimeout`] method.","deprecated":false,"async":false,"alias":"timeout"}]},"required":false,"comment":"","deprecated":false,"async":false,"alias":"options"}]},{"kind":"method","langs":{},"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`.","deprecated":false,"async":true,"alias":"info","args":[{"kind":"property","langs":{},"name":"selector","type":{"name":"AndroidSelector","expression":"[AndroidSelector]"},"spec":[{"type":"text","text":"Selector to return information about."}],"required":true,"comment":"Selector to return information about.","deprecated":false,"async":false,"alias":"selector"}]},{"kind":"property","langs":{},"name":"input","type":{"name":"AndroidInput","expression":"[AndroidInput]"},"spec":[],"required":true,"comment":"","deprecated":false,"async":false,"alias":"input","args":[]},{"kind":"method","langs":{},"name":"installApk","type":{"name":"void"},"spec":[{"type":"text","text":"Installs an apk on the device."}],"required":true,"comment":"Installs an apk on the device.","deprecated":false,"async":true,"alias":"installApk","args":[{"kind":"property","langs":{},"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.","deprecated":false,"async":false,"alias":"file"},{"kind":"property","langs":{},"name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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`.","deprecated":false,"async":false,"alias":"args"}]},"required":false,"comment":"","deprecated":false,"async":false,"alias":"options"}]},{"kind":"method","langs":{},"name":"launchBrowser","type":{"name":"ChromiumBrowserContext","expression":"[ChromiumBrowserContext]"},"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.","deprecated":false,"async":true,"alias":"launchBrowser","args":[{"kind":"property","langs":{},"name":"options","type":{"name":"Object","properties":[{"kind":"property","langs":{},"name":"acceptDownloads","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to automatically download all the attachments. Defaults to `false` where all the downloads are canceled."}],"required":false,"comment":"Whether to automatically download all the attachments. Defaults to `false` where all the downloads are canceled.","deprecated":false,"async":false,"alias":"acceptDownloads"},{"kind":"property","langs":{},"name":"bypassCSP","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Toggles bypassing page's Content-Security-Policy."}],"required":false,"comment":"Toggles bypassing page's Content-Security-Policy.","deprecated":false,"async":false,"alias":"bypassCSP"},{"kind":"property","langs":{},"name":"colorScheme","type":{"name":"ColorScheme","union":[{"name":"\"light\""},{"name":"\"dark\""},{"name":"\"no-preference\""}],"expression":"[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. 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. Defaults to '`light`'.","deprecated":false,"async":false,"alias":"colorScheme"},{"kind":"property","langs":{},"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.","deprecated":false,"async":false,"alias":"command"},{"kind":"property","langs":{},"name":"deviceScaleFactor","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Specify device scale factor (can be thought of as dpr). Defaults to `1`."}],"required":false,"comment":"Specify device scale factor (can be thought of as dpr). Defaults to `1`.","deprecated":false,"async":false,"alias":"deviceScaleFactor"},{"kind":"property","langs":{},"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. All header values must be strings."}],"required":false,"comment":"An object containing additional HTTP headers to be sent with every request. All header values must be strings.","deprecated":false,"async":false,"alias":"extraHTTPHeaders"},{"kind":"property","langs":{},"name":"geolocation","type":{"name":"Object","properties":[{"kind":"property","langs":{},"name":"latitude","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Latitude between -90 and 90."}],"required":true,"comment":"Latitude between -90 and 90.","deprecated":false,"async":false,"alias":"latitude"},{"kind":"property","langs":{},"name":"longitude","type":{"name":"float","expression":"[float]"},"spec":[{"type":"text","text":"Longitude between -180 and 180."}],"required":true,"comment":"Longitude between -180 and 180.","deprecated":false,"async":false,"alias":"longitude"},{"kind":"property","langs":{},"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`.","deprecated":false,"async":false,"alias":"accuracy"}],"expression":"[Object]"},"spec":[],"required":false,"comment":"","deprecated":false,"async":false,"alias":"geolocation"},{"kind":"property","langs":{},"name":"hasTouch","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Specifies if viewport supports touch events. Defaults to false."}],"required":false,"comment":"Specifies if viewport supports touch events. Defaults to false.","deprecated":false,"async":false,"alias":"hasTouch"},{"kind":"property","langs":{},"name":"httpCredentials","type":{"name":"Object","properties":[{"kind":"property","langs":{},"name":"username","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","deprecated":false,"async":false,"alias":"username"},{"kind":"property","langs":{},"name":"password","type":{"name":"string","expression":"[string]"},"spec":[{"type":"text","text":""}],"required":true,"comment":"","deprecated":false,"async":false,"alias":"password"}],"expression":"[Object]"},"spec":[{"type":"text","text":"Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication)."}],"required":false,"comment":"Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).","deprecated":false,"async":false,"alias":"httpCredentials"},{"kind":"property","langs":{},"name":"ignoreHTTPSErrors","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to ignore HTTPS errors during navigation. Defaults to `false`."}],"required":false,"comment":"Whether to ignore HTTPS errors during navigation. Defaults to `false`.","deprecated":false,"async":false,"alias":"ignoreHTTPSErrors"},{"kind":"property","langs":{},"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. Defaults to `false`. Not supported in Firefox."}],"required":false,"comment":"Whether the `meta viewport` tag is taken into account and touch events are enabled. Defaults to `false`. Not supported\nin Firefox.","deprecated":false,"async":false,"alias":"isMobile"},{"kind":"property","langs":{},"name":"javaScriptEnabled","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether or not to enable JavaScript in the context. Defaults to `true`."}],"required":false,"comment":"Whether or not to enable JavaScript in the context. Defaults to `true`.","deprecated":false,"async":false,"alias":"javaScriptEnabled"},{"kind":"property","langs":{},"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."}],"required":false,"comment":"Specify user locale, for example `en-GB`, `de-DE`, etc. Locale will affect `navigator.language` value, `Accept-Language`\nrequest header value as well as number and date formatting rules.","deprecated":false,"async":false,"alias":"locale"},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"name":"logger","type":{"name":"Logger","expression":"[Logger]"},"spec":[{"type":"text","text":"Logger sink for Playwright logging."}],"required":false,"comment":"Logger sink for Playwright logging.","deprecated":false,"async":false,"alias":"logger"},{"kind":"property","langs":{"only":["python"],"aliases":{},"types":{},"overrides":{}},"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.","deprecated":false,"async":false,"alias":"noViewport"},{"kind":"property","langs":{},"name":"offline","type":{"name":"boolean","expression":"[boolean]"},"spec":[{"type":"text","text":"Whether to emulate network being offline. Defaults to `false`."}],"required":false,"comment":"Whether to emulate network being offline. Defaults to `false`.","deprecated":false,"async":false,"alias":"offline"},{"kind":"property","langs":{},"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."}],"required":false,"comment":"A list of permissions to grant to all pages in this context. See [`method: BrowserContext.grantPermissions`] for more\ndetails.","deprecated":false,"async":false,"alias":"permissions"},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"name":"recordHar","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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`."}],"required":false,"comment":"Optional setting to control whether to omit request content from the HAR. Defaults to `false`.","deprecated":false,"async":false,"alias":"omitContent"},{"kind":"property","langs":{},"name":"path","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path on the filesystem to write the HAR file to."}],"required":true,"comment":"Path on the filesystem to write the HAR file to.","deprecated":false,"async":false,"alias":"path"}],"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. If not\nspecified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be saved.","deprecated":false,"async":false,"alias":"recordHar"},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_omit_content"},"types":{},"overrides":{}},"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`.","deprecated":false,"async":false,"alias":"recordHarOmitContent"},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_har_path"},"types":{},"overrides":{}},"name":"recordHarPath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path on the filesystem to write the HAR file to."}],"required":false,"comment":"Path on the filesystem to write the HAR file to.","deprecated":false,"async":false,"alias":"recordHarPath"},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"name":"recordVideo","type":{"name":"Object","properties":[{"kind":"property","langs":{},"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.","deprecated":false,"async":false,"alias":"dir"},{"kind":"property","langs":{},"name":"size","type":{"name":"Object","properties":[{"kind":"property","langs":{},"name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame width."}],"required":true,"comment":"Video frame width.","deprecated":false,"async":false,"alias":"width"},{"kind":"property","langs":{},"name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame height."}],"required":true,"comment":"Video frame height.","deprecated":false,"async":false,"alias":"height"}],"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 fit\ninto 800x800. 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.","deprecated":false,"async":false,"alias":"size"}],"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. Make\nsure to await [`method: BrowserContext.close`] for videos to be saved.","deprecated":false,"async":false,"alias":"recordVideo"},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_video_dir"},"types":{},"overrides":{}},"name":"recordVideoDir","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"Path to the directory to put videos into."}],"required":false,"comment":"Path to the directory to put videos into.","deprecated":false,"async":false,"alias":"recordVideoDir"},{"kind":"property","langs":{"only":["csharp","java","python"],"aliases":{"python":"record_video_size"},"types":{},"overrides":{}},"name":"recordVideoSize","type":{"name":"Object","properties":[{"kind":"property","langs":{},"name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame width."}],"required":true,"comment":"Video frame width.","deprecated":false,"async":false,"alias":"width"},{"kind":"property","langs":{},"name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame height."}],"required":true,"comment":"Video frame height.","deprecated":false,"async":false,"alias":"height"}],"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 will\nbe scaled down if necessary to fit the specified size.","deprecated":false,"async":false,"alias":"recordVideoSize"},{"kind":"property","langs":{},"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."}],"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.","deprecated":false,"async":false,"alias":"timezoneId"},{"kind":"property","langs":{},"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.","deprecated":false,"async":false,"alias":"userAgent"},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"name":"videoSize","type":{"name":"Object","properties":[{"kind":"property","langs":{},"name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame width."}],"required":true,"comment":"Video frame width.","deprecated":false,"async":false,"alias":"width"},{"kind":"property","langs":{},"name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"Video frame height."}],"required":true,"comment":"Video frame height.","deprecated":false,"async":false,"alias":"height"}],"expression":"[Object]"},"spec":[{"type":"text","text":"**DEPRECATED** Use `recordVideo` instead."}],"required":false,"comment":"**DEPRECATED** Use `recordVideo` instead.","deprecated":true,"async":false,"alias":"videoSize"},{"kind":"property","langs":{"only":["js"],"aliases":{},"types":{},"overrides":{}},"name":"videosPath","type":{"name":"path","expression":"[path]"},"spec":[{"type":"text","text":"**DEPRECATED** Use `recordVideo` instead."}],"required":false,"comment":"**DEPRECATED** Use `recordVideo` instead.","deprecated":true,"async":false,"alias":"videosPath"},{"kind":"property","langs":{"only":["js","java"],"aliases":{"java":"viewportSize","csharp":"viewportSize"},"types":{},"overrides":{}},"name":"viewport","type":{"name":"","union":[{"name":"null"},{"name":"Object","properties":[{"kind":"property","langs":{},"name":"width","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page width in pixels."}],"required":true,"comment":"page width in pixels.","deprecated":false,"async":false,"alias":"width"},{"kind":"property","langs":{},"name":"height","type":{"name":"int","expression":"[int]"},"spec":[{"type":"text","text":"page height in pixels."}],"required":true,"comment":"page height in pixels.","deprecated":false,"async":false,"alias":"height"}]}],"expression":"[null]|[Object]"},"spec":[{"type":"text","text":"Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport."}],"required":false,"comment":"Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport.","deprecated":false,"async":false