PageSourceSearch

https://webdriver.io/assets/js/f1ed8d80.77b690ff.js

js webdriver.io collected 2026-09-24 08:32:50 UTC 47,673 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6287],{20221:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>l,contentTitle:()=>t,default:()=>h,frontMatter:()=>o,metadata:()=>r,toc:()=>c});const r=JSON.parse('{"id":"api/chromium","title":"Chromium","description":"isAlertOpen","source":"@site/docs/api/_chromium.md","sourceDirName":"api","slug":"/api/chromium","permalink":"/docs/api/chromium","draft":false,"unlisted":false,"editUrl":"https://github.com/webdriverio/webdriverio/edit/main/packages/wdio-protocols/src/protocols/chromium.ts","tags":[],"version":"current","frontMatter":{"id":"chromium","title":"Chromium","custom_edit_url":"https://github.com/webdriverio/webdriverio/edit/main/packages/wdio-protocols/src/protocols/chromium.ts"},"sidebar":"api","previous":{"title":"Appium","permalink":"/docs/api/appium"},"next":{"title":"Firefox","permalink":"/docs/api/gecko"}}');var i=s(86106),d=s(22002);const o={id:"chromium",title:"Chromium",custom_edit_url:"https://github.com/webdriverio/webdriverio/edit/main/packages/wdio-protocols/src/protocols/chromium.ts"},t=void 0,l={},c=[{value:"isAlertOpen",id:"isalertopen",level:2},{value:"Usage",id:"usage",level:3},{value:"Example",id:"example",level:3},{value:"Returns",id:"returns",level:3},{value:"isAutoReporting",id:"isautoreporting",level:2},{value:"Usage",id:"usage-1",level:3},{value:"Returns",id:"returns-1",level:3},{value:"setAutoReporting",id:"setautoreporting",level:2},{value:"Usage",id:"usage-2",level:3},{value:"Parameters",id:"parameters",level:3},{value:"Examples",id:"examples",level:3},{value:"Returns",id:"returns-2",level:3},{value:"isLoading",id:"isloading",level:2},{value:"Usage",id:"usage-3",level:3},{value:"Example",id:"example-1",level:3},{value:"Returns",id:"returns-3",level:3}
1,{value:"takeHeapSnapshot",id:"takeheapsnapshot",level:2},{value:"Usage",id:"usage-4",level:3},{value:"Returns",id:"returns-4",level:3},{value:"getNetworkConnection",id:"getnetworkconnection",level:2},{value:"Usage",id:"usage-5",level:3},{value:"Example",id:"example-2",level:3},{value:"Returns",id:"returns-5",level:3},{value:"setNetworkConnection",id:"setnetworkconnection",level:2},{value:"Usage",id:"usage-6",level:3},{value:"Parameters",id:"parameters-1",level:3},{value:"Example",id:"example-3",level:3},{value:"Returns",id:"returns-6",level:3},{value:"getNetworkConditions",id:"getnetworkconditions",level:2},{value:"Usage",id:"usage-7",level:3},{value:"Returns",id:"returns-7",level:3},{value:"setNetworkConditions",id:"setnetworkconditions",level:2},{value:"Usage",id:"usage-8",level:3},{value:"Parameters",id:"parameters-2",level:3},{value:"Examples",id:"examples-1",level:3},{value:"deleteNetworkConditions",id:"deletenetworkconditions",level:2},{value:"Usage",id:"usage-9",level:3},{value:"sendCommand",id:"sendcommand",level:2},{value:"Usage",id:"usage-10",level:3},{value:"Parameters",id:"parameters-3",level:3},{value:"sendCommandAndGetResult",id:"sendcommandandgetresult",level:2},{value:"Usage",id:"usage-11",level:3},{value:"Parameters",id:"parameters-4",level:3},{value:"Returns",id:"returns-8",level:3},{value:"file",id:"file",level:2},{value:"Usage",id:"usage-12",level:3},{value:"Parameters",id:"parameters-5",level:3},{value:"Returns",id:"returns-9",level:3},{value:"launchChromeApp",id:"launchchromeapp",level:2},{value:"Usage",id:"usage-13",level:3},{value:"Parameters",id:"parameters-6",level:3},{value:"Example",id:"example-4",level:3},{value:"getElementValue",id:"getelementvalue",level:2},{value:"Usage",id:"usage-14",level:3},{value:"Parameters",id:"parameters-7",level:3},{value:"Returns",id:"returns-10",level:3},{value:"elementHover",id:"elementhover",level:2},{value:"Usage",id:"usage-15",level:3},{value:"Parameters",id:"parameters-8",level:3},{value:"touchPinch",id:"touchpinch",level:2},{value:"Usage",id:"usage-16",level:3},{value:"Parameters",id:"parameters-9",level:3},{value:"freeze",id:"freeze",level:2},{value:"Usage",id:"usage-17",level:3},{value:"resume",id:"resume",level:2},{value:"Usage",id:"usage-18",level:3},{value:"getCastSinks",id:"getcastsinks",level:2},{value:"Usage",id:"usage-19",level:3},{value:"Returns",id:"returns-11",level:3},{value:"selectCastSink",id:"selectcastsink",level:2},{value:"Usage",id:"usage-20",level:3},{value:"Parameters",id:"parameters-10",level:3},{value:"startCastTabMirroring",id:"startcasttabmirroring",level:2},{value:"Usage",id:"usage-21",level:3},{value:"Parameters",id:"parameters-11",level:3},{value:"getCastIssueMessage",id:"getcastissuemessage",level:2},{value:"Usage",id:"usage-22",level:3},{value:"Returns",id:"returns-12",level:3},{value:"stopCasting",id:"stopcasting",level:2},{value:"Usage",id:"usage-23",level:3},{value:"Parameters",id:"parameters-12",level:3},{value:"shutdown",id:"shutdown",level:2},{value:"Usage",id:"usage-24",level:3},{value:"takeElementScreenshot",id:"takeelementscreenshot",level:2},{value:"Usage",id:"usage-25",level:3},{value:"Parameters",id:"parameters-13",level:3},{value:"Returns",id:"returns-13",level:3},{value:"getLogTypes",id:"getlogtypes",level:2},{value:"Usage",id:"usage-26",level:3},{value:"Returns",id:"returns-14",level:3},{value:"getLogs",id:"getlogs",level:2},{value:"Usage",id:"usage-27",level:3},{value:"Parameters",id:"parameters-14",level:3},{value:"Returns",id:"returns-15",level:3}];function a(e){const n={a:"a",code:"code",em:"em",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,d.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h2,{id:"isalertopen",children:"isAlertOpen"}),"\n",(0,i.jsxs)(n.p,{children:["Whether a simple dialog is currently open.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://github.com/bayandin/chromedriver/blob/v2.45/alert_commands.cc#L42-L49",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.isAlertOpen()\n"})}),"\n",(0,i.jsx)(n.h3,{id:"example",children:"Example"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"console.log(browser.isAlertOpen()); // outputs: false\nbrowser.execute('window.alert()');\nconsole.log(browser.isAlertOpen()); // outputs: true\n"})}),"\n",(0,i.jsx)(n.h3,{id:"returns",children:"Returns"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"<Boolean>"}),"\n",(0,i.jsxs)(n.strong,{children:[(0,i.jsx)("code",{children:(0,i.jsx)("var",{children:"isAlertOpen"})}),":"]})," ",(0,i.jsx)(n.code,{children:"true"})," or ",(0,i.jsx)(n.code,{children:"false"})," based on whether simple dialog is present or not."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"isautoreporting",children:"isAutoReporting"}),"\n",(0,i.jsxs)(n.p,{children:["Whether it should automatically raises errors on browser logs.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://codereview.chromium.org/101203012",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage-1",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.isAutoReporting()\n"})}),"\n",(0,i.jsx)(n.h3,{id:"returns-1",children:"Returns"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"<Boolean>"}),"\n",(0,i.jsxs)(n.strong,{children:[(0,i.jsx)("code",{children:(0,i.jsx)("var",{children:"isAutoReporting"})}),":"]})," ",(0,i.jsx)(n.code,{children:"true"})," or ",(0,i.jsx)(n.code,{children:"false"})," based on whether auto reporting is enabled."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"setautoreporting",children:"setAutoReporting"}),"\n",(0,i.jsxs)(n.p,{children:["Toggle whether to return response with unknown error with first browser error (e.g. failed to load resource due to 403/4
104 response) for all subsequent commands (once enabled).",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://codereview.chromium.org/101203012",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage-2",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.setAutoReporting(enabled)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"parameters",children:"Parameters"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Name"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Details"})]})}),(0,i.jsx)(n.tbody,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"enabled"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"boolean"})}),(0,i.jsxs)(n.td,{children:[(0,i.jsx)(n.code,{children:"true"})," if auto reporting should be enabled, use ",(0,i.jsx)(n.code,{children:"false"})," to disable previously enabled auto reporting."]})]})})]}),"\n",(0,i.jsx)(n.h3,{id:"examples",children:"Examples"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"// Enable auto reporting first thing after session was initiated with empty browser logs\nconsole.log(browser.setAutoReporting(true)); // outputs: null\n// Upon requesting an non-existing resource it will abort execution due to thrown unknown error\nbrowser.url('https://webdriver.io/img/404-does-not-exist.png');\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"// During the session do some operations which populate the browser logs\nbrowser.url('https://webdriver.io/img/404-does-not-exist.png');\nbrowser.url('https://webdriver.io/403/no-access');\n// Enable auto reporting which throws an unknown error for first browser log (404 response)\nbrowser.setAutoReporting(true);\n"})}),"\n",(0,i.jsx)(n.h3,{id:"returns-2",children:"Returns"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"<Object|Null>"}),"\n",(0,i.jsxs)(n.strong,{children:[(0,i.jsx)("code",{children:(0,i.jsx)("var",{children:"firstBrowserError"})}),":"]})," In case first browser error already occured prior to executing this command it will throw unknown error as response, which is an object with 'message' key describing first browser error. Otherwise it returns ",(0,i.jsx)(n.code,{children:"null"})," on success."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"isloading",children:"isLoading"}),"\n",(0,i.jsxs)(n.p,{children:["Determines load status for active window handle.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://github.com/bayandin/chromedriver/blob/v2.45/session_commands.cc#L783-L802",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage-3",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.isLoading()\n"})}),"\n",(0,i.jsx)(n.h3,{id:"example-1",children:"Example"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"console.log(browser.isLoading()); // outputs: false\nbrowser.newWindow('https://webdriver.io');\nconsole.log(browser.isLoading()); // outputs: true\n"})}),"\n",(0,i.jsx)(n.h3,{id:"returns-3",children:"Returns"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"<Boolean>"}),"\n",(0,i.jsxs)(n.strong,{children:[(0,i.jsx)("code",{children:(0,i.jsx)("var",{children:"isLoading"})}),":"]})," ",(0,i.jsx)(n.code,{children:"true"})," or ",(0,i.jsx)(n.code,{children:"false"})," based on whether active window handle is loading or not."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"takeheapsnapshot",children:"takeHeapSnapsh
1ot"}),"\n",(0,i.jsxs)(n.p,{children:["Takes a heap snapshot of the current execution context.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://github.com/bayandin/chromedriver/blob/v2.45/chrome/web_view.h#L198-L202",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage-4",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.takeHeapSnapshot()\n"})}),"\n",(0,i.jsx)(n.h3,{id:"returns-4",children:"Returns"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"<Object>"}),"\n",(0,i.jsxs)(n.strong,{children:[(0,i.jsx)("code",{children:(0,i.jsx)("var",{children:"heapSnapshot"})}),":"]})," A JSON representation of the heap snapshot. Which can be inspected by loading as file into Chrome DevTools."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"getnetworkconnection",children:"getNetworkConnection"}),"\n",(0,i.jsxs)(n.p,{children:["Get the connection type for network emulation. This command is only applicable when remote end replies with ",(0,i.jsx)(n.code,{children:"networkConnectionEnabled"})," capability set to ",(0,i.jsx)(n.code,{children:"true"}),".",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#device-modes",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage-5",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.getNetworkConnection()\n"})}),"\n",(0,i.jsx)(n.h3,{id:"example-2",children:"Example"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"const browser = remote({\n    capabilities: {\n        browserName: 'chrome',\n        'goog:chromeOptions': {\n            // Network emulation requires device mode, which is only enabled when mobile emulation is on\n            mobileEmulation: { deviceName: 'iPad' },\n        },\n    }\n});\nconsole.log(browser.getNetworkConnection()); // outputs: 6 (Both Wi-Fi and data)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"returns-5",children:"Returns"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"<Number>"}),"\n",(0,i.jsxs)(n.strong,{children:[(0,i.jsx)("code",{children:(0,i.jsx)("var",{children:"connectionType"})}),":"]})," A bitmask to represent the network connection type. Airplane Mode (",(0,i.jsx)(n.code,{children:"1"}),"), Wi-Fi only (",(0,i.jsx)(n.code,{children:"2"}),"), Wi-Fi and data (",(0,i.jsx)(n.code,{children:"6"}),"), 4G (",(0,i.jsx)(n.code,{children:"8"}),"), 3G (",(0,i.jsx)(n.code,{children:"10"}),"), 2G (",(0,i.jsx)(n.code,{children:"20"}),"). By default ",(0,i.jsx)(n.a,{href:"https://github.com/bayandin/chromedriver/blob/v2.45/chrome/chrome_desktop_impl.cc#L36-L37",children:"Wi-Fi and data are enabled"}),"."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"setnetworkconnection",children:"setNetworkConnection"}),"\n",(0,i.jsxs)(n.p,{children:["Change connection type for network connection. This command is only applicable when remote end replies with ",(0,i.jsx)(n.code,{children:"networkConnectionEnabled"})," capability set to ",(0,i.jsx)(n.code,{children:"true"}),".",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#device-modes",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage-6",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.setNetworkConnection(parameters)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"parameters-1",children:"Parameters"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Name"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Details"})]})}),(0,i.jsx)(n.tbody,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"parameters"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"object"})}),(0,i.jsxs)(n.td,{children:["Object containing ConnectionType, set bitmask as value for ",(0,i.jsx)(n.code,{children:"type"})," key in object. Airplane Mode (",(0,i.jsx)(n.code,{children:"1"}),"), Wi-Fi only (",(0,i.jsx)(n.code,{children:"2"}),"), Wi-Fi and data (",(0,i.jsx)(n.code,{children:"6"}),"), 4G (",(0,i.jsx)(n.code,{children:"8"}),"), 3G (",(0,i.jsx)(n.code,{children:"10"}),"), 2G (",(0,i.jsx)(n.code,{children:"20"}),")."]})]})})]}),"\n",(0,i.jsx)(n.h3,{id:"example-3",children:"Example"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"const browser = remote({\n    capabilities: {\n        browserName: 'chrome',\n        'goog:chromeOptions': {\n            // Network emulation requires device mode, which is only enabled when mobile emulation is on\n            mobileEmulation: { deviceName: 'iPad' },\n        },\n    }\n});\nconsole.log(browser.setNetworkConnection({ type: 1 })); // outputs: 1 (Airplane Mode)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"returns-6",children:"Returns"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"<Number>"}),"\n",(0,i.jsxs)(n.strong,{children:[(0,i.jsx)("code",{children:(0,i.jsx)("var",{children:"connectionType"})}),":"]})," A bitmask to represent the network connection type. Value should match specified ",(0,i.jsx)(n.code,{children:"type"})," in object, however device might not be capable of the network connection type requested."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"getnetworkconditions",children:"getNetworkConditions"}),"\n",(0,i.jsxs)(n.p,{children:["Get current network conditions used for emulation.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://github.com/bayandin/chromedriver/blob/v2.45/session_commands.cc#L839-L859",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage-7",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.getNetworkConditions()\n"})}),"\n",(0,i.jsx)(n.h3,{id:"returns-7",children:"Returns"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"<Object>"}),"\n",(0,i.jsxs)(n.strong,{children:[(0,i.jsx)("code",{children:(0,i.jsx)("var",{children:"networkConditions"})}),":"]})," Object containing network conditions for ",(0,i.jsx)(n.code,{children:"offline"}),", ",(0,i.jsx)(n.code,{children:"latency"}),", ",(0,i.jsx)(n.code,{children:"download_throughput"})," and ",(0,i.jsx)(n.code,{children:"upload_throughput"}),". Network conditions must be set before it can be retrieved."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"setnetworkconditions",children:"setNetworkConditions"}),"\n",(0,i.jsxs)(n.p,{children:["Set network conditions used for emulation by throttling connection.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L1663-L1722",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage-8",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.setNetworkConditions(network_conditions, network_name)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"parameters-2",children:"Parameters"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Name"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Details"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"network_conditions"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"object"})}),(0,i.jsxs)(n.td,{children:["Object containing network conditions which are ",(0,i.jsx)(n.code,{children:"latency"}),", ",(0,i.jsx)(n.code,{children:"throughput"})," (or ",(0,i.jsx)(n.code,{children:"download_throughput"}),"/",(0,i.jsx)(n.code,{children:"upload_throughput"}),") and ",(0,i.jsx)(n.code,{children:"offline"})," (optional)."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:[(0,i.jsx)(n.code,{children:"network_name"}),(0,i.jsx)("br",{}),(0,i.jsx)(n.em,{children:"optional"})]}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"string"})}),(0,i.jsxs)(n.td,{children:["Name of ",(0,i.jsx)(n.a,{href:"https://github.com/bayandin/chromedriver/blob/v2.45/chrome/network_list.cc#L12-L25",children:"network throttling preset"}),". ",(0,i.jsx)(n.code,{children:"GPRS"}),", ",(0,i.jsx)(n.code,{children:"Regular 2G"}),", ",(0,i.jsx)(n.code,{children:"Good 2G"}),", ",(0,i.jsx)(n.code,{children:"Regular 3G"}),", ",(0,i.jsx)(n.code,{children:"Good 3G"}),", ",(0,i.jsx)(n.code,{children:"Regular 4G"}),", ",(0,i.jsx)(n.code,{children:"DSL"}),", ",(0,i.jsx)(n.code,{children:"WiFi"})," or ",(0,i.jsx)(n.code,{children:"No throttling"})," to disable. When preset is specified values passed in first argument are not respected."]})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"examples-1",children:"Examples"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"// Use different download (25kb/s) and upload (50kb/s) throughput values for throttling with a latency of 1000ms\nbrowser.setNetworkConditions({ latency: 1000, download_throughput: 25600, upload_throughput: 51200 });\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"// Force disconnected from network by setting 'offline' to true\nbrowser.setNetworkConditions({ latency: 0, throughput: 0, offline: true });\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"// When preset name (e.g. 'DSL') is specified it does not respect values in object (e.g. 'offline')\nbrowser.setNetworkConditions({ latency: 0, throughput: 0, offline: true }, 'DSL');\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"// Best practice for specifying network throttling preset is to use an empty object\nbrowser.setNetworkConditions({}, 'Good 3G');\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"deletenetworkconditions",children:"deleteNetworkConditions"}),"\n",(0,i.jsxs)(n.p,{children:["Disable any network throttling which might have been set. Equivalent of setting the ",(0,i.jsx)(n.code,{children:"No throttling"})," preset.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L1724-L1745",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage-9",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.deleteNetworkConditions()\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"sendcommand",children:"sendCommand"}),"\n",(0,i.jsxs)(n.p,{children:["Send a command to the DevTools debugger.",(0,i.jsx)("br",{}),"For a list of available commands and their parameters refer to the ",(0,i.jsx)(n.a,{href:"https://chromedevtools.github.io/devtools-protocol/",children:"Chrome DevTools Protocol Viewer"}),".",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L1290-L1304",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage-10",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.sendCommand(cmd, params)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"parameters-3",children:"Parameters"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Name"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Details"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"cmd"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"string"})}),(0,i.jsxs)(n.td,{children:["Name of the command (e.g. ",(0,i.jsx)(n.a,{href:"https://chromedevtools.github.io/devtools-protocol/1-3/Browser#method-close",children:(0,i.jsx)(n.code,{children:"Browser.close"})}),")."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"params"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"object"})}),(0,i.jsx)(n.td,{children:"Parameters to the command. In case no parameters for command, specify an empty object."})]})]})]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"sendcommandandgetresult",children:"sendCommandAndGetResult"}),"\n",(0,i.jsxs)(n.p,{children:["Send a command to the DevTools debugger and wait for the result.",(0,i.jsx)("br",{}),"For a list of available commands and their parameters refer to the ",(0,i.jsx)(n.a,{href:"https://chromedevtools.github.io/devtools-protocol/",children:"Chrome DevTools Protocol Viewer"}),".",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L1306-L1320",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage-11",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.sendCommandAndGetResult(cmd, params)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"parameters-4",children:"Parameters"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Name"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Details"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"cmd"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"string"})}),(0,i.jsxs)(n.td,{children:["Name of the command which returns a result (e.g. ",(0,i.jsx)(n.a,{href:"https://chromedevtools.github.io/devtools-protocol/1-3/Network#method-getAllCookies",children:(0,i.jsx)(n.code,{children:"Network.getAllCookies"})}),")."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"params"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"object"})}),(0,i.jsx)(n.td,{children:"Parameters to the command. In case no parameters for command, specify an empty object."})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"returns-8",children:"Returns"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"<*>"}),"\n",(0,i.jsxs)(n.strong,{children:[(0,i.jsx)("code",{children:(0,i.jsx)("var",{children:"result"})}),":"]})," Either the return value of your command, or the error which was the reason for your command's failure."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"file",children:"file"}),"\n",(0,i.jsxs)(n.p,{children:["Upload a file to remote machine on which the browser is running.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://github.com/bayandin/chromedriver/blob/v2.45/session_commands.cc#L1037-L1065",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage-12",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.file(file)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"parameters-5",children:"Parameters"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Name"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Details"})]})}),(0,i.jsx)(n.tbody,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"file"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"string"})}),(0,i.jsxs)(n.td,{children:["Base64-encoded zip archive containing ",(0,i.jsx)(n.strong,{children:"single"})," file 
1which to upload. In case base64-encoded data does not represent a zip archive or archive contains more than one file it will throw an unknown error."]})]})})]}),"\n",(0,i.jsx)(n.h3,{id:"returns-9",children:"Returns"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"<String>"}),"\n",(0,i.jsxs)(n.strong,{children:[(0,i.jsx)("code",{children:(0,i.jsx)("var",{children:"path"})}),":"]})," Absolute path of uploaded file on remote machine."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"launchchromeapp",children:"launchChromeApp"}),"\n",(0,i.jsxs)(n.p,{children:["Launches a Chrome app by specified id.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://github.com/bayandin/chromedriver/blob/v2.45/session_commands.cc#L521-L539",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage-13",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.launchChromeApp(id)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"parameters-6",children:"Parameters"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Name"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Details"})]})}),(0,i.jsx)(n.tbody,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"id"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"string"})}),(0,i.jsx)(n.td,{children:"Extension id of app to be launched, as defined in chrome://extensions."})]})})]}),"\n",(0,i.jsx)(n.h3,{id:"example-4",children:"Example"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"import fs from 'fs'\nconst browser = remote({\n    capabilities: {\n        browserName: 'chrome',\n        'goog:chromeOptions': {\n            // Install upon starting browser in order to launch it\n            extensions: [\n              // Entry should be a base64-encoded packed Chrome app (.crx)\n              fs.readFileSync('/absolute/path/app.crx').toString('base64')\n            ]\n        }\n    }\n});\nbrowser.launchChromeApp('aohghmighlieiainnegkcijnfilokake')); // Google Docs (https://chrome.google.com/webstore/detail/docs/aohghmighlieiainnegkcijnfilokake)\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"getelementvalue",children:"getElementValue"}),"\n",(0,i.jsxs)(n.p,{children:["Retrieves the value of a given form control element.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://github.com/bayandin/chromedriver/blob/v2.45/element_commands.cc#L431-L443",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage-14",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.getElementValue(elementId)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"parameters-7",children:"Parameters"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Name"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Details"})]})}),(0,i.jsx)(n.tbody,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"elementId"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"String"})}),(0,i.jsx)(n.td,{children:"id of element to get value from"})]})})]}),"\n",(0,i.jsx)(n.h3,{id:"returns-10",children:"Returns"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"<String|Null>"}),"\n",(0,i.jsxs)(n.strong,{children:[(0,i.jsx)("code",{children:(0,i.jsx)("var",{children:"value"})}),":"]})," Current value of the element. In case specified element is not a form control element, it will return ",(0,i.jsx)(n.code,{children:"null"}),"."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"elementhover",children:"elementHover"}),"\n",(0,i.jsxs)(n.p,{children:["Enable hover state for an element, which is reset upon next interaction.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://github.com/bayandin/chromedriver/blob/v2.45/element_c
1ommands.cc#L126-L146",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage-15",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.elementHover(elementId)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"parameters-8",children:"Parameters"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Name"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Details"})]})}),(0,i.jsx)(n.tbody,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"elementId"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"String"})}),(0,i.jsx)(n.td,{children:"id of element to hover over to"})]})})]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"touchpinch",children:"touchPinch"}),"\n",(0,i.jsxs)(n.p,{children:["Trigger a pinch zoom effect.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L813-L827",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage-16",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.touchPinch(x, y, scale)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"parameters-9",children:"Parameters"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Name"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Details"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"x"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"number"})}),(0,i.jsx)(n.td,{children:"x position to pinch on"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"y"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"number"})}),(0,i.jsx)(n.td,{children:"y position to pinch on"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"scale"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"number"})}),(0,i.jsx)(n.td,{children:"pinch zoom scale"})]})]})]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"freeze",children:"freeze"}),"\n",(0,i.jsxs)(n.p,{children:["Freeze the current page. Extension for ",(0,i.jsx)(n.a,{href:"https://developers.google.com/web/updates/2018/07/page-lifecycle-api",children:"Page Lifecycle API"}),".",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L625-L633",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage-17",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.freeze()\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"resume",children:"resume"}),"\n",(0,i.jsxs)(n.p,{children:["Resume the current page. Extension for ",(0,i.jsx)(n.a,{href:"https://developers.google.com/web/updates/2018/07/page-lifecycle-api",children:"Page Lifecycle API"}),".",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L635-L645",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage-18",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.resume()\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"getcastsinks",children:"getCastSinks"}),"\n",(0,i.jsxs)(n.p,{children:["Returns the list of cast sinks (Cast devices) available to the Chrome media router.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://chromium.googlesource.com/chromium/src/+/refs/tags/73.0.3683.121/chrome/test/chromedriver/server/http_handler.cc#748",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage-19",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.getCastSinks()\n"})}),"\n",(0,i.jsx)(n.h3,{id:"returns-11",children:"Returns"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"<string[]>"}),"\n",(0,i.jsxs)(n.strong,{children:[(0,i.jsx)("code",{children:(0,i.jsx)("var",{children:"sinks"})}),":"]})," List of available sinks."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"selectcastsink",children:"selectCastSink"}),"\n",(0,i.jsxs)(n.p,{children:["Selects a cast sink (Cast device) as the recipient of media router intents (connect or play).",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://chromium.googlesource.com/chromium/src/+/refs/tags/73.0.3683.121/chrome/test/chromedriver/server/http_handler.cc#737",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage-20",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.selectCastSink(sinkName)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"parameters-10",children:"Parameters"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Name"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Details"})]})}),(0,i.jsx)(n.tbody,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"sinkName"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"string"})}),(0,i.jsx)(n.td,{children:"The name of the target device."})]})})]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"startcasttabmirroring",children:"startCastTabMirroring"}),"\n",(0,i.jsxs)(n.p,{children:["Initiates tab mirroring for the current browser tab on the specified device.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://chromium.googlesource.com/chromium/src/+/refs/tags/73.0.3683.121/chrome/test/chromedriver/server/http_handler.cc#741",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage-21",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.startCastTabMirroring(sinkName)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"parameters-11",children:"Parameters"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Name"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Details"})]})}),(0,i.jsx)(n.tbody,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"sinkName"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"string"})}),(0,i.jsx)(n.td,{children:"The name of the target device."})]})})]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"getcastissuemessage",children:"getCastIssueMessage"}),"\n",(0,i.jsxs)(n.p,{children:["Returns error message if there is any issue in a Cast session.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://chromium.googlesource.com/chromium/src/+/refs/tags/73.0.3683.121/chrome/test/chromedriver/server/http_handler.cc#751",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage-22",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.getCastIssueMessage()\n"})}),"\n",(0,i.jsx)(n.h3,{id:"returns-12",children:"Returns"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"<String>"}),"\n",(0,i.jsxs)(n.strong,{children:[(0,i.jsx)("code",{children:(0,i.jsx)("var",{children:"message"})}),":"]})," Error message, if any."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"stopcasting",children:"stopCasting"}),"\n",(0,i.jsxs)(n.p,{children:["Stops casting from media router to the specified device, if connected.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://chromium.googlesource.com/chromium/src/+/refs/tags/73.0.3683.121/chrome/test/chromedriver/server/http_handler.cc#744",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage-23",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.stopCasting(sinkName)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"parameters-12",children:"Parameters"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Name"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Details"})]})}),(0,i.jsx)(n.tbody,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"sinkName"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"string"})}),(0,i.jsx)(n.td,{children:"The name of the target device."})]})})]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"shutdown",children:"shutdown"}),"\n",(0,i.jsxs)(n.p,{children:["Shutdown ChromeDriver process and consequently terminating all active sessions.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://github.com/bayandin/chromedriver/blob/v2.45/session_commands.cc#L489-L498",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage-24",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.shutdown()\n"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"takeelementscreenshot",children:"takeElementScreenshot"}),"\n",(0,i.jsxs)(n.p,{children:["The Take Element Screenshot command takes a screenshot of the visible region encompassed by the bounding rectangle of an element.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://w3c.github.io/webdriver/#dfn-take-element-screenshot",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage-25",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.take
1ElementScreenshot(elementId)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"parameters-13",children:"Parameters"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Name"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Details"})]})}),(0,i.jsx)(n.tbody,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"elementId"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"String"})}),(0,i.jsx)(n.td,{children:"the id of an element returned in a previous call to Find Element(s)"})]})})]}),"\n",(0,i.jsx)(n.h3,{id:"returns-13",children:"Returns"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"<String>"}),"\n",(0,i.jsxs)(n.strong,{children:[(0,i.jsx)("code",{children:(0,i.jsx)("var",{children:"screenshot"})}),":"]})," The base64-encoded PNG image data comprising the screenshot of the visible region of an element\u2019s bounding rectangle after it has been scrolled into view."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"getlogtypes",children:"getLogTypes"}),"\n",(0,i.jsxs)(n.p,{children:["Get available log types.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Appium command. More details can be found in the ",(0,i.jsx)(n.a,{href:"https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidlogtypes",children:"official protocol docs"}),".",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidlogtypes",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage-26",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.getLogTypes()\n"})}),"\n",(0,i.jsx)(n.h3,{id:"returns-14",children:"Returns"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"<String[]>"}),"\n",(0,i.jsxs)(n.strong,{children:[(0,i.jsx)("code",{children:(0,i.jsx)("var",{children:"logTypes"})}),":"]})," The list of available log types, example: browser, driver."]}),"\n"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"getlogs",children:"getLogs"}),"\n",(0,i.jsxs)(n.p,{children:["Get the log for a given log type. Log buffer is reset after each request.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Appium command. More details can be found in the ",(0,i.jsx)(n.a,{href:"https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidlog",children:"official protocol docs"}),".",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Non official and undocumented Chromium command. More about this command can be found ",(0,i.jsx)(n.a,{href:"https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidlog",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"usage-27",children:"Usage"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-js",children:"await browser.getLogs(type)\n"})}),"\n",(0,i.jsx)(n.h3,{id:"parameters-14",children:"Parameters"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Name"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Details"})]})}),(0,i.jsx)(n.tbody,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"type"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"string"})}),(0,i.jsx)(n.td,{children:"the log type"})]})})]}),"\n",(0,i.jsx)(n.h3,{id:"returns-15",children:"Returns"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"<Object[]>"}),"\n",(0,i.jsxs)(n.strong,{children:[(0,i.jsx)("code",{children:(0,i.jsx)("var",{children:"logs"})}),":"]})," The list of log entries."]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,d.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},22002:(e,n,s)=>{s.d(n,{R:()=>o,x:()=>t});var r=s(7378);const i={},d=r.createContext(i);function o(e){const n=r.useContext(d);return r.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function t(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),r.createElement(d.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.