1"use strict";(self.webpackChunkplaywright_dev=self.webpackChunkplaywright_dev||[]).push([["325"],{31669(e,t,n){n.r(t),n.d(t,{metadata:()=>s,default:()=>h,frontMatter:()=>l,contentTitle:()=>a,toc:()=>c,assets:()=>o});var s=JSON.parse('{"id":"api/class-frame","title":"Frame","description":"At every point of time, page exposes its current frame tree via the page.mainFrame() and frame.childFrames() methods.","source":"@site/versioned_docs/version-stable/api/class-frame.mdx","sourceDirName":"api","slug":"/api/class-frame","permalink":"/docs/api/class-frame","draft":false,"unlisted":false,"tags":[],"version":"stable","frontMatter":{"id":"class-frame","title":"Frame"},"sidebar":"api","previous":{"title":"FileChooser","permalink":"/docs/api/class-filechooser"},"next":{"title":"FrameLocator","permalink":"/docs/api/class-framelocator"}}'),i=n(74848),r=n(28453);n(13554),n(41647),n(83137);let l={id:"class-frame",title:"Frame"},a,o={},c=[{value:"Methods",id:"methods",level:2},{value:"addScriptTag",id:"frame-add-script-tag",level:3},{value:"addStyleTag",id:"frame-add-style-tag",level:3},{value:"childFrames",id:"frame-child-frames",level:3},{value:"content",id:"frame-content",level:3},{value:"dragAndDrop",id:"frame-drag-and-drop",level:3},{value:"evaluate",id:"frame-evaluate",level:3},{value:"evaluateHandle",id:"frame-evaluate-handle",level:3},{value:"frameElement",id:"frame-frame-element",level:3},{value:"frameLocator",id:"frame-frame-locator",level:3},{value:"getByAltText",id:"frame-get-by-alt-text",level:3},{value:"getByLabel",id:"frame-get-by-label",level:3},{value:"getByPlaceholder",id:"frame-get-by-placeholder",level:3},{value:"getByRole",id:"frame-get-by-role",level:3},{value:"getByTestId",id:"frame-get-by-test-id",level:3},{value:"getByText",id:"frame-get-by-text",level:3},{value:"getByTitle",id:"frame-get-by-title",level:3},{value:"goto",id:"frame-goto",level:3},{value:"isDetached",id:"frame-is-detached",level:3},{value:"isEnabled",id:"frame-is-enabled",level:3},{value:"locator",id:"frame-locator",level:3},{value:"name",id:"frame-name",level:3},{value:"page",id:"frame-page",level:3},{value:"parentFrame",id:"frame-parent-frame",level:3},{value:"setContent",id:"frame-set-content",level:3},{value:"title",id:"frame-title",level:3},{value:"url",id:"frame-url",level:3},{value:"waitForFunction",id:"frame-wait-for-function",level:3},{value:"waitForLoadState",id:"frame-wait-for-load-state",level:3},{value:"waitForURL",id:"frame-wait-for-url",level:3},{value:"Deprecated",id:"deprecated",level:2},{value:"$",id:"frame-query-selector",level:3},{value:"$$",id:"frame-query-selector-all",level:3},{value:"$eval",id:"frame-eval-on-selector",level:3},{value:"$$eval",id:"frame-eval-on-selector-all",level:3},{value:"check",id:"frame-check",level:3},{value:"click",id:"frame-click",level:3},{value:"dblclick",id:"frame-dblclick",level:3},{value:"dispatchEvent",id:"frame-dispatch-event",level:3},{value:"fill",id:"frame-fill",level:3},{value:"focus",id:"frame-focus",level:3},{value:"getAttribute",id:"frame-get-attribute",level:3},{value:"hover",id:"frame-hover",level:3},{value:"innerHTML",id:"frame-inner-html",level:3},{value:"innerText",id:"frame-inner-text",level:3},{value:"inputValue",id:"frame-input-value",level:3},{value:"isChecked",id:"frame-is-checked",level:3},{value:"isDisabled",id:"frame-is-disabled",level:3},{value:"isEditable",id:"frame-is-editable",level:3},{value:"isHidden",id:"frame-is-hidden",level:3},{value:"isVisible",id:"frame-is-visible",level:3},{value:"press",id:"frame-press",level:3},{value:"selectOption",id:"frame-select-option",level:3},{value:"setChecked",id:"frame-set-checked",level:3},{value:"setInputFiles",id:"frame-set-input-files",level:3},{value:"tap",id:"frame-tap",level:3},{value:"textContent",id:"frame-text-content",level:3},{value:"type",id:"frame-type",level:3},{value:"uncheck",id:"frame-uncheck",level:3},{value:"waitForNavigation",id:"frame-wait-for-navigation",level:3},{value:"waitForSelector",id:"frame-wait-for-selector",level:3},{value:"waitForTimeout",id:"frame-wait-for-timeout",level:3}];function d(e){let t={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",hr:"hr",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(t.p,{children:["At every point of time, page exposes its current frame tree via the ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-main-frame",children:"page.mainFrame()"})," and ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-child-frames",children:"frame.childFrames()"})," methods."]}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.a,{href:"/docs/api/class-frame",title:"Frame",children:"Frame"})," object's lifecycle is controlled by three events, dispatched on the page object:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-event-frame-attached",children:"page.on('frameattached')"})," - fired when the frame gets attached to the page. A Frame can be attached to the page only once."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-event-frame-navigated",children:"page.on('framenavigated')"}
1)," - fired when the frame commits navigation to a different URL."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-event-frame-detached",children:"page.on('framedetached')"})," - fired when the frame gets detached from the page. A Frame can be detached from the page only once."]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"An example of dumping frame tree:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"const { firefox } = require('playwright'); // Or 'chromium' or 'webkit'.\n\n(async () => {\n const browser = await firefox.launch();\n const page = await browser.newPage();\n await page.goto('https://www.google.com/chrome/browser/canary.html');\n dumpFrameTree(page.mainFrame(), '');\n await browser.close();\n\n function dumpFrameTree(frame, indent) {\n console.log(indent + frame.url());\n for (const child of frame.childFrames())\n dumpFrameTree(child, indent + ' ');\n }\n})();\n"})}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h2,{id:"methods",children:"Methods"}),"\n",(0,i.jsx)(t.h3,{id:"frame-add-script-tag",children:"addScriptTag"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.addScriptTag"}),"\n",(0,i.jsx)(t.p,{children:"Returns the added tag when the script's onload fires or when the script content was injected into frame."}),"\n",(0,i.jsxs)(t.p,{children:["Adds a ",(0,i.jsx)(t.code,{children:"<script>"})," tag into the page with the desired url or content."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.addScriptTag();\nawait frame.addScriptTag(options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"content"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-add-script-tag-option-content"}),(0,i.jsx)("a",{href:"#frame-add-script-tag-option-content",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Raw JavaScript content to be injected into frame."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"path"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-add-script-tag-option-path"}),(0,i.jsx)("a",{href:"#frame-add-script-tag-option-path",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Path to the JavaScript file to be injected into frame. If ",(0,i.jsx)(t.code,{children:"path"})," is a relative path, then it is resolved relative to the current working directory."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"type"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-add-script-tag-option-type"}),(0,i.jsx)("a",{href:"#frame-add-script-tag-option-type",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Script type. Use 'module' in order to load a JavaScript ES6 module. See ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script",children:"script"})," for more details."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"url"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-add-script-tag-option-url"}),(0,i.jsx)("a",{href:"#frame-add-script-tag-option-url",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"URL of a script to be added."}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"/docs/api/class-elementhandle",title:"ElementHandle",children:"ElementHandle"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-add-script-tag-return"}),(0,i.jsx)("a",{href:"#frame-add-script-tag-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-add-style-tag",children:"addStyleTag"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.addStyleTag"}),"\n",(0,i.jsx)(t.p,{children:"Returns the added tag when the stylesheet's onload fires or when the CSS content was injected into frame."}),"\n",(0,i.jsxs)(t.p,{children:["Adds a ",(0,i.jsx)(t.code,{children:'<link rel="stylesheet">'})," tag into the page with the desired url or a ",(0,i.jsx)(t.code,{children:'<style type="text/css">'})," tag with the content."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.addStyleTag();\nawait frame.addStyleTag(options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"content"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-add-style-tag-option-content"}),(0,i.jsx)("a",{href:"#frame-add-style-tag-option-content",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Raw CSS content to be injected into frame."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"path"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-add-style-tag-option-path"}),(0,i.jsx)("a",{href:"#frame-add-style-tag-option-path",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Path to the CSS file to be injected into frame. If ",(0,i.jsx)(t.code,{children:"path"})," is a relative path, then it is resolved relative to the current working directory."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"url"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-add-style-tag-option-url"}),(0,i.jsx)("a",{href:"#frame-add-style-tag-option-url",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["URL of the ",(0,i.jsx)(t.code,{children:"<link>"})," tag."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"/docs/api/class-elementhandle",title:"ElementHandle",children:"ElementHandle"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-add-style-tag-return"}),(0,i.jsx)("a",{href:"#frame-add-style-tag-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-child-frames",children:"childFrames"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.childFrames"}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"frame.childFrames();\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",title:"Array",children:"Array"}),"<",(0,i.jsx)(t.a,{href:"/docs/api/class-frame",title:"Frame",children:"Frame"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-child-frames-return"}),(0,i.jsx)("a",{href:"#frame-child-frames-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-content",children:"content"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.content"}),"\n",(0,i.jsx)(t.p,{children:"Gets the full HTML contents of the frame, including the doctype."}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.content();\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-content-return"}),(0,i.jsx)("a",{href:"#frame-content-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-drag-and-drop",children:"dragAndDrop"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.13"}),"\n",(0,i.jsx)("x-search",{children:"frame.dragAndDrop"}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.dragAndDrop(source, target);\nawait frame.dragAndDrop(source, target, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"source"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-drag-and-drop-option-source"}),(0,i.jsx)("a",{href:"#frame-drag-and-drop-option-source",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to search for an element to drag. If there are multiple elements satisfying the selector, the first will be used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"target"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-drag-and-drop-option-target"}),(0,i.jsx)("a",{href:"#frame-drag-and-drop-option-target",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to search for an element to drop onto. If there are multiple elements satisfying the selector, the first will be used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"force"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-drag-and-drop-option-force"}),(0,i.jsx)("a",{href:"#frame-drag-and-drop-option-force",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Whether to bypass the ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"actionability"})," checks. Defaults to ",(0,i.jsx)(t.code,{children:"false"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"noWaitAfter"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-drag-and-drop-option-no-wait-after"}),(0,i.jsx)("a",{href:"#frame-drag-and-drop-option-no-wait-after",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.admonition,{title:"Deprecated",type:"warning",children:(0,i.jsx)(t.p,{children:"This option has no effect."})}),"\n",(0,i.jsx)(t.p,{children:"This option has no effect."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"scroll"}),' "auto" | "none" ',(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-drag-and-drop-option-scroll"}),(0,i.jsx)("a",{href:"#frame-drag-and-drop-option-scroll",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Controls whether Playwright scrolls the element into view before performing the action. Defaults to ",(0,i.jsx)(t.code,{children:'"auto"'}),", which scrolls the element into view when necessary, including scrolling nested scrollable containers. When set to ",(0,i.jsx)(t.code,{children:'"none"'}),", Playwright does not scroll the element and the action fails if the element is not already in the viewport. This is useful to assert that an element is reachable by the user without additional scrolling."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-drag-
1and-drop-option-signal"}),(0,i.jsx)("a",{href:"#frame-drag-and-drop-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"sourcePosition"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-drag-and-drop-option-source-position"}),(0,i.jsx)("a",{href:"#frame-drag-and-drop-option-source-position",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"x"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"y"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"Clicks on the source element at this point relative to the top-left corner of the element's padding box. If not specified, some visible point of the element is used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"steps"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.57"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-drag-and-drop-option-steps"}),(0,i.jsx)("a",{href:"#frame-drag-and-drop-option-steps",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Defaults to 1. Sends ",(0,i.jsx)(t.code,{children:"n"})," interpolated ",(0,i.jsx)(t.code,{children:"mousemove"})," events to represent travel between the ",(0,i.jsx)(t.code,{children:"mousedown"})," and ",(0,i.jsx)(t.code,{children:"mouseup"})," of the drag. When set to 1, emits a single ",(0,i.jsx)(t.code,{children:"mousemove"})," event at the destination location."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-drag-and-drop-option-strict"}),(0,i.jsx)("a",{href:"#frame-drag-and-drop-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"targetPosition"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-drag-and-drop-option-target-position"}),(0,i.jsx)("a",{href:"#frame-drag-and-drop-option-target-position",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"x"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"y"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"Drops on the target element at this point relative to the top-left corner of the element's padding box. If not specified, some visible point of the element is used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-drag-and-drop-option-timeout"}),(0,i.jsx)("a",{href:"#frame-drag-and-drop-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"actionTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"trial"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-drag-and-drop-option-trial"}),(0,i.jsx)("a",{href:"#frame-drag-and-drop-option-trial",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["When set, this method only performs the ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"actionability"})," checks and skips the action. Defaults to ",(0,i.jsx)(t.code,{children:"false"}),". Useful to wait until the element is ready for the action without performing it."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",title:"void",children:"void"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-drag-and-drop-return"}),(0,i.jsx)("a",{href:"#frame-drag-and-drop-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-evaluate",children:"evaluate"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.evaluate"}),"\n",(0,i.jsxs)(t.p,{children:["Returns the return value of ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-evaluate-option-expression",children:"pageFunction"}),"."]}),"\n",(0,i.jsxs)(t.p,{children:["If the function passed to the ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-evaluate",children:"frame.evaluate()"})," returns a ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),", then ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-evaluate",children:"frame.evaluate()"})," would wait for the promise to resolve and return its value."]}),"\n",(0,i.jsxs)(t.p,{children:["If the function passed to the ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-evaluate",children:"frame.evaluate()"})," returns a non-",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Description",title:"Serializable",children:"Serializable"})," value, then ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-evaluate",children:"frame.evaluate()"})," returns ",(0,i.jsx)(t.code,{children:"undefined"}),". Playwright also supports transferring some additional values that are not serializable by ",(0,i.jsx)(t.code,{children:"JSON"}),": ",(0,i.jsx)(t.code,{children:"-0"}),", ",(0,i.jsx)(t.code,{children:"NaN"}),", ",(0,i.jsx)(t.code,{children:"Infinity"}),", ",(0,i.jsx)(t.code,{children:"-Infinity"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:'const result = await frame.evaluate(([x, y]) => {\n return Promise.resolve(x * y);\n}, [7, 8]);\nconsole.log(result); // prints "56"\n'})}),"\n",(0,i.jsx)(t.p,{children:"A string can also be passed in instead of a function."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"console.log(await frame.evaluate('1 + 2')); // prints \"3\"\n"})}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.a,{href:"/docs/api/class-elementhandle",title:"ElementHandle",children:"ElementHandle"})," instances can be passed as an argument to the ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-evaluate",children:"frame.evaluate()"}),":"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"const bodyHandle = await frame.evaluateHandle('document.body');\nconst html = await frame.evaluate(([body, suffix]) =>\n body.innerHTML + suffix, [bodyHandle, 'hello'],\n);\nawait bodyHandle.dispose();\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"pageFunction"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",title:"Function",children:"function"})," | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-evaluate-option-expression"}),(0,i.jsx)("a",{href:"#frame-evaluate-option-expression",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Function to be evaluated in the page context."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"arg"})," ",(0,i.jsx)(t.a,{href:"/docs/evaluating#evaluation-argument",title:"EvaluationArgument",children:"EvaluationArgument"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-evaluate-option-arg"}),(0,i.jsx)("a",{href:"#frame-evaluate-option-arg",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Optional argument to pass to ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-evaluate-option-expression",children:"pageFunction"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"exposeFunctions"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-evaluate-option-expose-functions"}),(0,i.jsx)("a",{href:"#frame-evaluate-option-expose-functions",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["When set to ",(0,i.jsx)(t.code,{children:"true"}),", functions passed inside ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-evaluate-option-arg",children:"arg"})," are exposed in the page and can be called from the page function. Calling one returns a ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"})," of its result. Under the hood, each function is exposed via ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-expose-function",children:"page.exposeFunction()"}),", so it is technically accessible from all frames and worlds of the page. Exposed functions are cleared upon the top-level navigation. Defaults to ",(0,i.jsx)(t.code,{children:"false"}),", in which case functions are not serializable and passing one throws an error."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Description",title:"Serializable",children:"Serializable"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-evaluate-return"}),(0,i.jsx)("a",{href:"#frame-evaluate-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-evaluate-handle",children:"evaluateHandle"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.evaluateHandle"}),"\n",(0,i.jsxs)(t.p,{children:["Returns the return value of ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-evaluate-handle-option-expression",children:"pageFunction"}
1)," as a ",(0,i.jsx)(t.a,{href:"/docs/api/class-jshandle",title:"JSHandle",children:"JSHandle"}),"."]}),"\n",(0,i.jsxs)(t.p,{children:["The only difference between ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-evaluate",children:"frame.evaluate()"})," and ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-evaluate-handle",children:"frame.evaluateHandle()"})," is that ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-evaluate-handle",children:"frame.evaluateHandle()"})," returns ",(0,i.jsx)(t.a,{href:"/docs/api/class-jshandle",title:"JSHandle",children:"JSHandle"}),"."]}),"\n",(0,i.jsxs)(t.p,{children:["If the function, passed to the ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-evaluate-handle",children:"frame.evaluateHandle()"}),", returns a ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),", then ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-evaluate-handle",children:"frame.evaluateHandle()"})," would wait for the promise to resolve and return its value."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"// Handle for the window object\nconst aWindowHandle = await frame.evaluateHandle(() => Promise.resolve(window));\n"})}),"\n",(0,i.jsx)(t.p,{children:"A string can also be passed in instead of a function."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"const aHandle = await frame.evaluateHandle('document'); // Handle for the 'document'.\n"})}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.a,{href:"/docs/api/class-js
1handle",title:"JSHandle",children:"JSHandle"})," instances can be passed as an argument to the ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-evaluate-handle",children:"frame.evaluateHandle()"}),":"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"const aHandle = await frame.evaluateHandle(() => document.body);\nconst resultHandle = await frame.evaluateHandle(([body, suffix]) =>\n body.innerHTML + suffix, [aHandle, 'hello'],\n);\nconsole.log(await resultHandle.jsonValue());\nawait resultHandle.dispose();\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"pageFunction"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",title:"Function",children:"function"})," | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-evaluate-handle-option-expression"}),(0,i.jsx)("a",{href:"#frame-evaluate-handle-option-expression",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Function to be evaluated in the page context."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"arg"})," ",(0,i.jsx)(t.a,{href:"/docs/evaluating#evaluation-argument",title:"EvaluationArgument",children:"EvaluationArgument"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-evaluate-handle-option-arg"}),(0,i.jsx)("a",{href:"#frame-evaluate-handle-option-arg",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Optional argument to pass to ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-evaluate-handle-option-expression",children:"pageFunction"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"exposeFunctions"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-evaluate-handle-option-expose-functions"}),(0,i.jsx)("a",{href:"#frame-evaluate-handle-option-expose-functions",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["When set to ",(0,i.jsx)(t.code,{children:"true"}),", functions passed inside ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-evaluate-handle-option-arg",children:"arg"})," are exposed in the page and can be called from the page function. Calling one returns a ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"})," of its result. Under the hood, each function is exposed via ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-expose-function",children:"page.exposeFunction()"}),", so it is technically accessible from all frames and worlds of the page. Exposed functions are cleared upon the top-level navigation. Defaults to ",(0,i.jsx)(t.code,{children:"false"}),", in which case functions are not serializable and passing one throws an error."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}
1),"<",(0,i.jsx)(t.a,{href:"/docs/api/class-jshandle",title:"JSHandle",children:"JSHandle"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-evaluate-handle-return"}),(0,i.jsx)("a",{href:"#frame-evaluate-handle-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-frame-element",children:"frameElement"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.frameElement"}),"\n",(0,i.jsxs)(t.p,{children:["Returns the ",(0,i.jsx)(t.code,{children:"frame"})," or ",(0,i.jsx)(t.code,{children:"iframe"})," element handle which corresponds to this frame."]}),"\n",(0,i.jsxs)(t.p,{children:["This is an inverse of ",(0,i.jsx)(t.a,{href:"/docs/api/class-elementhandle#element-handle-content-frame",children:"elementHandle.contentFrame()"}),". Note that returned handle actually belongs to the parent frame."]}),"\n",(0,i.jsxs)(t.p,{children:["This method throws an error if the frame has been detached before ",(0,i.jsx)(t.code,{children:"frameElement()"})," returns."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"const frameElement = await frame.frameElement();\nconst contentFrame = await frameElement.contentFrame();\nconsole.log(frame === contentFrame); // -> true\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"/docs/api/class-elementhandle",title:"ElementHandle",children:"ElementHandle"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-frame-element-return"}),(0,i.jsx)("a",{href:"#frame-frame-element-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-frame-locator",children:"frameLocator"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.17"}),"\n",(0,i.jsx)("x-search",{children:"frame.frameLocator"}),"\n",(0,i.jsx)(t.p,{children:"When working with iframes, you can create a frame locator that will enter the iframe and allow selecting elements in that iframe."}),"\n",(0,i.jsxs)(t.p,{children:["When called without ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-frame-locator-option-selector",children:"selector"}),", the search starts in this frame or in any of the iframes inside it, so that you don't need to locate each iframe first. Note that the rest of the locator is resolved
1inside a single frame, just like any other locator. If it matches elements inside multiple frames, an error is thrown."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsxs)(t.p,{children:['Following snippet locates element with text "Submit" in the iframe with id ',(0,i.jsx)(t.code,{children:"my-frame"}),", like ",(0,i.jsx)(t.code,{children:'<iframe id="my-frame">'}),":"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"const locator = frame.frameLocator('#my-iframe').getByText('Submit');\nawait locator.click();\n"})}),"\n",(0,i.jsx)(t.p,{children:"Following snippet locates a button, either in the frame or in one of the iframes inside it:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"const locator = frame.frameLocator().getByRole('button');\nawait locator.click();\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-frame-locator-option-selector"}),(0,i.jsx)("a",{href:"#frame-frame-locator-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector that matches the frame element. When not specified, locator is matched in this frame or in any of the iframes inside it."}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"/docs/api/class-framelocator",title:"FrameLocator",children:"FrameLocator"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-frame-locator-return"}),(0,i.jsx)("a",{href:"#frame-frame-locator-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-get-by-alt-text",children:"getByAltText"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.27"}),"\n",(0,i.jsx)("x-search",{children:"frame.getByAltText"}),"\n",(0,i.jsx)(t.p,{children:"Allows locating elements by their alt text."}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.p,{children:'For example, this method will find the image by alt text "Playwright logo":'}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-html",children:"<img alt='Playwright logo'>\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await page.getByAltText('Playwright logo').click();\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"text"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",title:"RegExp",children:"RegExp"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-alt-text-option-text"}),(0,i.jsx)("a",{href:"#frame-get-by-alt-text-option-text",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Text to locate the element for."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"exact"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-alt-text-option-exact"}),(0,i.jsx)("a",{href:"#frame-get-by-alt-text-option-exact",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular expression. Note that exact match still trims whitespace."}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"/docs/api/class-locator",title:"Locator",children:"Locator"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-alt-text-return"}),(0,i.jsx)("a",{href:"#frame-get-by-alt-text-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-get-by-label",children:"getByLabel"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.27"}),"\n",(0,i.jsx)("x-search",{children:"frame.getByLabel"}),"\n",(0,i.jsxs)(t.p,{children:["Allows locating input elements by the text of the associated ",(0,i.jsx)(t.code,{children:"<label>"})," or ",(0,i.jsx)(t.code,{children:"aria-labelledby"})," element, or by the ",(0,i.jsx)(t.code,{children:"aria-label"})," attribute."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.p,{children:'For example, this method will find inputs by label "Username" and "Password" in the following DOM:'}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-html",children:'<input aria-label="Username">\n<label for="password-input">Password:</label>\n<input id="password-input">\n'})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await page.getByLabel('Username').fill('john');\nawait page.getByLabel('Password').fill('secret');\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"text"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",title:"RegExp",children:"RegExp"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-label-option-text"}),(0,i.jsx)("a",{href:"#frame-get-by-label-option-text",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Text to locate the element for."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"exact"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-label-option-exact"}),(0,i.jsx)("a",{href:"#frame-get-by-label-option-exact",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular expression. Note that exact match still trims whitespace."}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"/docs/api/class-locator",title:"Locator",children:"Locator"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-label-return"}),(0,i.jsx)("a",{href:"#frame-get-by-label-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-get-by-placeholder",children:"getByPlaceholder"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.27"}),"\n",(0,i.jsx)("x-search",{children:"frame.getByPlaceholder"}),"\n",(0,i.jsx)(t.p,{children:"Allows locating input elements by the placeholder text."}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.p,{children:"For example, consider the following DOM structure."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-html",children:'<input type="email" placeholder="[email protected]" />\n'})}),"\n",(0,i.jsx)(t.p,{children:"You can fill the input after locating it by the placeholder text:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await page\n .getByPlaceholder('[email protected]')\n .fill('[email protected]');\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"text"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",title:"RegExp",children:"RegExp"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-placeholder-option-text"}),(0,i.jsx)("a",{href:"#frame-get-by-placeholder-option-text",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Text to locate the element for."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"exact"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-placeholder-option-exact"}),(0,i.jsx)("a",{href:"#frame-get-by-placeholder-option-exact",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular expression. Note that exact match still trims whitespace."}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"/docs/api/class-locator",title:"Locator",children:"Locator"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-placeholder-return"}),(0,i.jsx)("a",{href:"#frame-get-by-placeholder-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-get-by-role",children:"getByRole"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.27"}),"\n",(0,i.jsx)("x-search",{children:"frame.getByRole"}),"\n",(0,i.jsxs)(t.p,{children:["Allows locating elements by their ",(0,i.jsx)(t.a,{href:"https://www.w3.org/TR/wai-aria-1.2/#roles",children:"ARIA role"}),", ",(0,i.jsx)(t.a,{href:"https://www.w3.org/TR/wai-aria-1.2/#aria-attributes",children:"ARIA attributes"})," and ",(0,i.jsx)(t.a,{href:"https://w3c.github.io/accname/#dfn-accessible-name",children:"accessible name"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.p,{children:"Consider the following DOM structure."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-html",children:'<h3>Sign up</h3>\n<label>\n <input type="checkbox" /> Subscribe\n</label>\n<br/>\n<button>Submit</button>\n'})}),"\n",(0,i.jsx)(t.p,{children:"You can locate each element by its implicit role:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await expect(page.getByRole('heading', { name: 'Sign up' })).toBeVisible();\n\nawait page.getByRole('checkbox', { name: 'Subscribe' }).check();\n\nawait page.getByRole('button', { name: /submit/i }).click();\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"role"}),' "alert" | "alertdialog" | "application" | "article" | "banner" | "blockquote" | "button" | "caption" | "cell" | "checkbox" | "code" | "columnheader" | "combobox" | "complementary" | "contentinfo" | "definition" | "deletion" | "dialog" | "directory" | "document" | "emphasis" | "feed" | "figure" | "form" | "generic" | "grid" | "gridcell" | "group" | "heading" | "img" | "insertion" | "link" | "list" | "listbox" | "listitem" | "log" | "main" | "marquee" | "math" | "meter" | "menu" | "menubar" | "menuitem" | "menuitemcheckbox" | "menuitemradio" | "navigation" | "none" | "n
1ote" | "option" | "paragraph" | "presentation" | "progressbar" | "radio" | "radiogroup" | "region" | "row" | "rowgroup" | "rowheader" | "scrollbar" | "search" | "searchbox" | "separator" | "slider" | "spinbutton" | "status" | "strong" | "subscript" | "superscript" | "switch" | "tab" | "table" | "tablist" | "tabpanel" | "term" | "textbox" | "time" | "timer" | "toolbar" | "tooltip" | "tree" | "treegrid" | "treeitem"',(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-role-option-role"}),(0,i.jsx)("a",{href:"#frame-get-by-role-option-role",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Required aria role."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"checked"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-role-option-checked"}),(0,i.jsx)("a",{href:"#frame-get-by-role-option-checked",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["An attribute that is usually set by ",(0,i.jsx)(t.code,{children:"aria-checked"})," or native ",(0,i.jsx)(t.code,{children:"<input type=checkbox>"})," controls."]}),"\n",(0,i.jsxs)(t.p,{children:["Learn more about ",(0,i.jsx)(t.a,{href:"https://www.w3.org/TR/wai-aria-1.2/#aria-checked",children:(0,i.jsx)(t.code,{children:"aria-checked"})}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"description"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",title:"RegExp",children:"RegExp"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.60"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-role-option-description"}),(0,i.jsx)("a",{href:"#frame-get-by-role-option-description",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Option to match the ",(0,i.jsx)(t.a,{href:"https://w3c.github.io/accname/#dfn-accessible-description",children:"accessible description"}),". By default, matching is case-insensitive and searches for a substring, use ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-get-by-role-option-exact",children:"exact"})," to control this behavior."]}),"\n",(0,i.jsxs)(t.p,{children:["Learn more about ",(0,i.jsx)(t.a,{href:"https://w3c.github.io/accname/#dfn-accessible-description",children:"accessible description"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"disabled"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-role-option-disabled"}),(0,i.jsx)("a",{href:"#frame-get-by-role-option-disabled",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["An attribute that is usually set by ",(0,i.jsx)(t.code,{children:"aria-disabled"})," or ",(0,i.jsx)(t.code,{children:"disabled"}),"."]}),"\n",(0,i.jsx)(t.admonition,{type:"note",children:(0,i.jsxs)(t.p,{children:["Unlike most other attributes, ",(0,i.jsx)(t.code,{children:"disabled"})," is inherited through the DOM hierarchy. Learn more about ",(0,i.jsx)(t.a,{href:"https://www.w3.org/TR/wai-aria-1.2/#aria-disabled",children:(0,i.jsx)(t.code,{children:"aria-disabled"})}),"."]})}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"exact"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.28"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-role-option-exact"}),(0,i.jsx)("a",{href:"#frame-get-by-role-option-exact",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Whether ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-get-by-role-option-name",children:"name"})," and ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-get-by-role-option-description",children:"description"})," are matched exactly: case-sensitive and whole-string. Defaults to false. Ignored when the value is a regular expression. Note that exact match still trims whitespace."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"expanded"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-role-option-expanded"}),(0,i.jsx)("a",{href:"#frame-get-by-role-option-expanded",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["An attribute that is usually set by ",(0,i.jsx)(t.code,{children:"aria-expanded"}),"."]}),"\n",(0,i.jsxs)(t.p,{children:["Learn more about ",(0,i.jsx)(t.a,{href:"https://www.w3.org/TR/wai-aria-1.2/#aria-expanded",children:(0,i.jsx)(t.code,{children:"aria-expanded"})}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"includeHidden"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-role-option-include-hidden"}),(0,i.jsx)("a",{href:"#frame-get-by-role-option-include-hidden",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Option that controls whether hidden elements are matched. By default, only non-
1hidden elements, as ",(0,i.jsx)(t.a,{href:"https://www.w3.org/TR/wai-aria-1.2/#tree_exclusion",children:"defined by ARIA"}),", are matched by role selector."]}),"\n",(0,i.jsxs)(t.p,{children:["Learn more about ",(0,i.jsx)(t.a,{href:"https://www.w3.org/TR/wai-aria-1.2/#aria-hidden",children:(0,i.jsx)(t.code,{children:"aria-hidden"})}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"level"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-role-option-level"}),(0,i.jsx)("a",{href:"#frame-get-by-role-option-level",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["A number attribute that is usually present for roles ",(0,i.jsx)(t.code,{children:"heading"}),", ",(0,i.jsx)(t.code,{children:"listitem"}),", ",(0,i.jsx)(t.code,{children:"row"}),", ",(0,i.jsx)(t.code,{children:"treeitem"}),", with default values for ",(0,i.jsx)(t.code,{children:"<h1>-<h6>"})," elements."]}),"\n",(0,i.jsxs)(t.p,{children:["Learn more about ",(0,i.jsx)(t.a,{href:"https://www.w3.org/TR/wai-aria-1.2/#aria-level",children:(0,i.jsx)(t.code,{children:"aria-level"})}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"name"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",title:"RegExp",children:"RegExp"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-role-option-name"}),(0,i.jsx)("a",{href:"#frame-get-by-role-option-name",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Option to match the ",(0,i.jsx)(t.a,{href:"https://w3c.github.io/accname/#dfn-accessible-name",children:"accessible name"}),". By default, matching is case-insensitive and searches for a substring, use ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-get-by-role-option-exact",children:"exact"})," to control this behavior."]}),"\n",(0,i.jsxs)(t.p,{children:["Learn more about ",(0,i.jsx)(t.a,{href:"https://w3c.github.io/accname/#dfn-accessible-name",children:"accessible name"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"pressed"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-role-option-pressed"}),(0,i.jsx)("a",{href:"#frame-get-by-role-option-pressed",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["An attribute that is usually set by ",(0,i.jsx)(t.code,{children:"aria-pressed"}),"."]}),"\n",(0,i.jsxs)(t.p,{children:["Learn more about ",(0,i.jsx)(t.a,{href:"https://www.w3.org/TR/wai-aria-1.2/#aria-pressed",children:(0,i.jsx)(t.code,{children:"aria-pressed"})}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selected"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-role-option-selected"}),(0,i.jsx)("a",{href:"#frame-get-by-role-option-selected",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["An attribute that is usually set by ",(0,i.jsx)(t.code,{children:"aria-selected"}),"."]}),"\n",(0,i.jsxs)(t.p,{children:["Learn more about ",(0,i.jsx)(t.a,{href:"https://www.w3.org/TR/wai-aria-1.2/#aria-selected",children:(0,i.jsx)(t.code,{children:"aria-selected"})}),"."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"/docs/api/class-locator",title:"Locator",children:"Locator"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-role-return"}),(0,i.jsx)("a",{href:"#frame-get-by-role-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Details"})}),"\n",(0,i.jsxs)(t.p,{children:["Role selector ",(0,i.jsx)(t.strong,{children:"does not replace"})," accessibility audits and conformance tests, but rather gives early feedback about the ARIA guidelines."]}),"\n",(0,i.jsxs)(t.p,{children:["Many html elements have an implicitly ",(0,i.jsx)(t.a,{href:"https://w3c.github.io/html-aam/#html-element-role-mappings",children:"defined role"})," that is recognized by the role selector. You can find all the ",(0,i.jsx)(t.a,{href:"https://www.w3.org/TR/wai-aria-1.2/#role_definitions",children:"supported roles here"}),". ARIA guidelines ",(0,i.jsx)(t.strong,{children:"do not recommend"})," duplicating implicit roles and attributes by setting ",(0,i.jsx)(t.code,{children:"role"})," and/or ",(0,i.jsx)(t.code,{children:"aria-*"})," attributes to default values."]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-get-by-test-id",children:"getByTestId"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.27"}),"\n",(0,i.jsx)("x-search",{children:"frame.getByTestId"}),"\n",(0,i.jsx)(t.p,{children:"Locate element by the test id."}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.p,{children:"Consider the following DOM structure."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-html",children:'<button data-testid="directions">Itin\xe9raire</button>\n'})}),"\n",(0,i.jsx)(t.p,{children:"You can locate the element by its test id:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await page.getByTestId('directions').click();\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"testId"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",title:"RegExp",children:"RegExp"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-test-id-option-test-id"}),(0,i.jsx)("a",{href:"#frame-get-by-test-id-option-test-id",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Id to locate the element by."}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"/docs/api/class-locator",title:"Locator",children:"Locator"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-test-id-return"}),(0,i.jsx)("a",{href:"#frame-get-by-test-id-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Details"})}),"\n",(0,i.jsxs)(t.p,{children:["By default, the ",(0,i.jsx)(t.code,{children:"data-testid"})," attribute is used as a test id. Use ",(0,i.jsx)(t.a,{href:"/docs/api/class-selectors#selectors-set-test-id-attribute",children:"selectors.setTestIdAttribute()"})," to configure a different test id attribute if necessary."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"// Set custom test id attribute from @playwright/test config:\nimport { defineConfig } from '@playwright/test';
1\n\nexport default defineConfig({\n use: {\n testIdAttribute: 'data-pw'\n },\n});\n"})}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-get-by-text",children:"getByText"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.27"}),"\n",(0,i.jsx)("x-search",{children:"frame.getByText"}),"\n",(0,i.jsx)(t.p,{children:"Allows locating elements that contain given text."}),"\n",(0,i.jsxs)(t.p,{children:["See also ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-filter",children:"locator.filter()"})," that allows to match by another criteria, like an accessible role, and then filter by the text content."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.p,{children:"Consider the following DOM structure:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-html",children:"<div>Hello <span>world</span></div>\n<div>Hello</div>\n"})}),"\n",(0,i.jsx)(t.p,{children:"You can locate by text substring, exact string, or a regular expression:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"// Matches <span>\npage.getByText('world');\n\n// Matches first <div>\npage.getByText('Hello world');\n\n// Matches second <div>\npage.getByText('Hello', { exact: true });\n\n// Matches both <div>s\npage.getByText(/Hello/);\n\n// Matches second <div>\npage.getByText(/^hello$/i);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"text"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",title:"RegExp",children:"RegExp"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-text-option-text"}),(0,i.jsx)("a",{href:"#frame-get-by-text-option-text",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Text to locate the element for."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"exact"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-text-option-exact"}),(0,i.jsx)("a",{href:"#frame-get-by-text-option-exact",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular expression. Note that exact match still trims whitespace."}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"/docs/api/class-locator",title:"Locator",children:"Locator"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-text-return"}),(0,i.jsx)("a",{href:"#frame-get-by-text-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Details"})}),"\n",(0,i.jsx)(t.p,{children:"Matching by text always normalizes whitespace, even with exact match. For example, it turns multiple spaces into one, turns line breaks into spaces and ignores leading and trailing whitespace."}),"\n",(0,i.jsxs)(t.p,{children:["Input elements of the type ",(0,i.jsx)(t.code,{children:"button"})," and ",(0,i.jsx)(t.code,{children:"submit"})," are matched by their ",(0,i.jsx)(t.code,{children:"value"})," instead of the text content. For example, locating by text ",(0,i.jsx)(t.code,{children:'"L
1og in"'})," matches ",(0,i.jsx)(t.code,{children:'<input type=button value="Log in">'}),"."]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-get-by-title",children:"getByTitle"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.27"}),"\n",(0,i.jsx)("x-search",{children:"frame.getByTitle"}),"\n",(0,i.jsx)(t.p,{children:"Allows locating elements by their title attribute."}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.p,{children:"Consider the following DOM structure."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-html",children:"<span title='Issues count'>25 issues</span>\n"})}),"\n",(0,i.jsx)(t.p,{children:"You can check the issues count after locating it by the title text:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await expect(page.getByTitle('Issues count')).toHaveText('25 issues');\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"text"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",title:"RegExp",children:"RegExp"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-title-option-text"}),(0,i.jsx)("a",{href:"#frame-get-by-title-option-text",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Text to locate the element for."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"exact"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-title-option-exact"}),(0,i.jsx)("a",{href:"#frame-get-by-title-option-exact",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Whether to find an exact match: case-sensitive and whole-string. Default to false. Ignored when locating by a regular expression. Note that exact match still trims whitespace."}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"/docs/api/class-locator",title:"Locator",children:"Locator"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-by-title-return"}),(0,i.jsx)("a",{href:"#frame-get-by-title-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-goto",children:"goto"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.goto"}),"\n",(0,i.jsx)(t.p,{children:"Returns the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect."}),"\n",(0,i.jsx)(t.p,{children:"The method will throw an error if:"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"there's an SSL error (e.g. in case of self-signed certificates)."}),"\n",(0,i.jsx)(t.li,{children:"target URL is invalid."}),"\n",(0,i.jsxs)(t.li,{children:["the ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-goto-option-timeout",children:"timeout"})," is exceeded during navigation."]}),"\n",(0,i.jsx)(t.li,{children:"the remote server does not respond or is unreachable."}),"\n",(0,i.jsx)(t.li,{children:"the main resource failed to load."}),"\n"]}),"\n",(0,i.jsxs)(t.p,{children:['The method will not throw an error when any valid HTTP status code is returned by the remote server, including 404 "Not Found" and 500 "Internal Server Error". The status code for such responses can be retrieved by calling ',(0,i.jsx)(t.a,{href:"/docs/api/class-response#response-status",children:"response.status()"}),"."]}),"\n",(0,i.jsx)(t.admonition,{type:"note",children:(0,i.jsxs)(t.p,{children:["The method either throws an error or returns a main resource response. The only exceptions are navigation to ",(0,i.jsx)(t.code,{children:"about:blank"})," or navigation to the same URL with a different hash, which would succeed and return ",(0,i.jsx)(t.code,{children:"null"}),"."]})}),"\n",(0,i.jsx)(t.admonition,{type:"note",children:(0,i.jsxs)(t.p,{children:["Headless mode doesn't support navigation to a PDF document. See the ",(0,i.jsx)(t.a,{href:"https://bugs.chromium.org/p/chromium/issues/detail?id=761295",children:"upstream issue"}),"."]})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.goto(url);\nawait frame.goto(url, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"url"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-goto-option-url"}),(0,i.jsx)("a",{href:"#frame-goto-option-url",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["URL to navigate frame to. The url should include scheme, e.g. ",(0,i.jsx)(t.code,{children:"https://"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"referer"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-goto-option-referer"}),(0,i.jsx)("a",{href:"#frame-goto-option-referer",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Referer header value. If provided it will take preference over the referer header value set by ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-extra-http-headers",children:"page.setExtraHTTPHeaders()"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-goto-option-signal"}),(0,i.jsx)("a",{href:"#frame-goto-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-goto-option-timeout"}),(0,i.jsx)("a",{href:"#frame-goto-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum operation time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"navigationTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-navigation-timeout",children:"browserContext.setDefaultNavigationTimeout()"}),", ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"}),", ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-navigation-timeout",children:"page.setDefaultNavigationTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"waitUntil"}),' "load" | "domcontentloaded" | "networkidle" | "commit" ',(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-goto-option-wait-until"}),(0,i.jsx)("a",{href:"#frame-goto-option-wait-until",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["When to consider operation succeeded, defaults to ",(0,i.jsx)(t.code,{children:"load"}),". Events can be either:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"'domcontentloaded'"})," - consider operation to be finished when the ",(0,i.jsx)(t.code,{children:"DOMContentLoaded"})," event is fired."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"'load'"})," - consider operation to be finished when the ",(0,i.jsx)(t.code,{children:"load"})," event is fired."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"'networkidle'"})," - ",(0,i.jsx)(t.strong,{children:"DISCOURAGED"})," consider operation to be finished when there are no network connections for at least ",(0,i.jsx)(t.code,{children:"500"})," ms. Don't use this method for testing, rely on web assertions to assess readiness instead."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"'commit'"})," - consider operation to be finished when network response is received and the document started loading."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null",title:"null",children:"null"})," | ",(0,i.jsx)(t.a,{href:"/docs/api/class-response",title:"Response",children:"Response"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-goto-return"}),(0,i.jsx)("a",{href:"#frame-goto-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-is-detached",children:"isDetached"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.isDetached"}),"\n",(0,i.jsxs)(t.p,{children:["Returns ",(0,i.jsx)(t.code,{children:"true"})," if the frame has been detached, or ",(0,i.jsx)(t.code,{children:"false"})," otherwise."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"frame.isDetached();\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-detached-return"}),(0,i.jsx)("a",{href:"#frame-is-detached-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-is-enabled",children:"isEnabled"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.isEnabled"}),"\n",(0,i.jsxs)(t.p,{children:["Returns whether the element is ",(0,i.jsx)(t.a,{href:"/docs/actionability#enabled",children:"enabled"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.isEnabled(selector);\nawait frame.isEnabled(selector, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-enabled-option-selector"}),(0,i.jsx)("a",{href:"#frame-is-enabled-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-enabled-option-signal"}),(0,i.jsx)("a",{href:"#frame-is-enabled-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",
1children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-enabled-option-strict"}),(0,i.jsx)("a",{href:"#frame-is-enabled-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-enabled-option-timeout"}),(0,i.jsx)("a",{href:"#frame-is-enabled-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"actionTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-enabled-return"}),(0,i.jsx)("a",{href:"#frame-is-enabled-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-locator",children:"locator"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.14"}),"\n",(0,i.jsx)("x-search",{children:"frame.locator"}),"\n",(0,i.jsx)(t.p,{children:"The method returns an element locator that can be used to perform actions on this page / frame. Locator is resolved to the element immediately before performing an action, so a series of actions on the same locator can in fact be performed on different DOM elements. That would happen if the DOM structure between those actions has changed."}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.a,{href:"/docs/locators",children:"Learn more about locators"}),"."]}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.a,{href:"/docs/locators",children:"Learn more about locators"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"frame.locator(selector);\nframe.locator(selector, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-locator-option-selector"}),(0,i.jsx)("a",{href:"#frame-locator-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to use when resolving DOM element."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"has"})," ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator",title:"Locator",children:"Locator"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-locator-option-has"}),(0,i.jsx)("a",{href:"#frame-locator-option-has",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Narrows down the results of the method to those which contain elements matching this relative locator. For example, ",(0,i.jsx)(t.code,{children:"article"})," that has ",(0,i.jsx)(t.code,{children:"text=Playwright"})," matches ",(0,i.jsx)(t.code,{children:"<article><div>Playwright</div></article>"}),"."]}),"\n",(0,i.jsxs)(t.p,{children:["Inner locator ",(0,i.jsx)(t.strong,{children:"must be relative"})," to the outer locator and is queried starting with the outer locator match, not the document root. For example, you can find ",(0,i.jsx)(t.code,{children:"content"})," that has ",(0,i.jsx)(t.code,{children:"div"})," in ",(0,i.jsx)(t.code,{children:"<article><content><div>Playwright</div></content></article>"}),". However, looking for ",(0,i.jsx)(t.code,{children:"content"})," that has ",(0,i.jsx)(t.code,{children:"article div"})," will fail, because the inner locator must be relative and should not use any elements outside the ",(0,i.jsx)(t.code,{children:"content"}),"."]}),"\n",(0,i.jsxs)(t.p,{children:["Note that outer and inner locators must belong to the same frame. Inner locator must not contain ",(0,i.jsx)(t.a,{href:"/docs/api/class-framelocator",title:"FrameLocator",children:"FrameLocator"}),"s."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"hasNot"})," ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator",title:"Locator",children:"Locator"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.33"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-locator-option-has-not"}),(0,i.jsx)("a",{href:"#frame-locator-option-has-not",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Matches elements that do not contain an element that matches an inner locator. Inner locator is queried against the outer one. For example, ",(0,i.jsx)(t.code,{children:"article"})," that does not have ",(0,i.jsx)(t.code,{children:"div"})," matches ",(0,i.jsx)(t.code,{children:"<article><span>Playwright</span></article>"}),"."]}),"\n",(0,i.jsxs)(t.p,{children:["Note that outer and inner locators must belong to the same frame. Inner locator must not contain ",(0,i.jsx)(t.a,{href:"/docs/api/class-framelocator",title:"FrameLocator",children:"FrameLocator"}),"s."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"hasNotText"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",title:"RegExp",children:"RegExp"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.33"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-locator-option-has-not-text"}),(0,i.jsx)("a",{href:"#frame-locator-option-has-not-text",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Matches elements that do not contain specified text somewhere inside, possibly in a child or a descendant element. When passed a ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),", matching is case-insensitive and searches for a substring."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"hasText"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",title:"RegExp",children:"RegExp"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-locator-option-has-text"}),(0,i.jsx)("a",{href:"#frame-locator-option-has-text",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When passed a ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),", matching is case-insensitive and searches for a substring. For example, ",(0,i.jsx)(t.code,{children:'"Playwright"'})," matches ",(0,i.jsx)(t.code,{children:"<article><div>Playwright</div></article>"}),"."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"/docs/api/class-locator",title:"Locator",children:"Locator"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-locator-return"}),(0,i.jsx)("a",{href:"#frame-locator-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-name",children:"name"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.name"}),"\n",(0,i.jsx)(t.p,{children:"Returns frame's name attribute as specified in the tag."}),"\n",(0,i.jsx)(t.p,{children:"If the name is empty, returns the id attribute instead."}),"\n",(0,i.jsx)(t.admonition,{type:"note",children:(0,i.jsx)(t.p,{children:"This value is calculated once when the frame is created, and will not update if the attribute is changed later."})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"frame.name();\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-name-return"}),(0,i.jsx)("a",{href:"#frame-name-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-page",children:"page"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.page"}),"\n",(0,i.jsx)(t.p,{children:"Returns the page containing this frame."}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"frame.page();\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"/docs/api/class-page",title:"Page",children:"Page"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-page-return"}),(0,i.jsx)("a",{href:"#frame-page-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-parent-frame",children:"parentFrame"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.parentFrame"}),"\n",(0,i.jsxs)(t.p,{children:["Parent frame, if any. Detached frames and main frames return ",(0,i.jsx)(t.code,{children:"null"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"frame.parentFrame();\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null",title:"null",children:"null"})," | ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame",title:"Frame",children:"Frame"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-parent-frame-return"}),(0,i.jsx)("a",{href:"#frame-parent-frame-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-set-content",children:"setContent"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.setContent"}),"\n",(0,i.jsxs)(t.p,{children:["This method internally calls ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Document/write",children:"document.write()"}),", inheriting all its specific characteristics and behaviors."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.setContent(html);\nawait frame.setContent(html, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"html"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-set-content-option-html"}),(0,i.jsx)("a",{href:"#frame-set-content-option-html",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"HTML markup to assign to the page."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-set-content-option-signal"}),(0,i.jsx)("a",{href:"#frame-set-content-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-set-content-option-timeout"}),(0,i.jsx)("a",{href:"#frame-set-content-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum op
1eration time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"navigationTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-navigation-timeout",children:"browserContext.setDefaultNavigationTimeout()"}),", ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"}),", ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-navigation-timeout",children:"page.setDefaultNavigationTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"waitUntil"}),' "load" | "domcontentloaded" | "networkidle" | "commit" ',(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-set-content-option-wait-until"}),(0,i.jsx)("a",{href:"#frame-set-content-option-wait-until",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["When to consider operation succeeded, defaults to ",(0,i.jsx)(t.code,{children:"load"}),". Events can be either:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"'domcontentloaded'"})," - consider operation to be finished when the ",(0,i.jsx)(t.code,{children:"DOMContentLoaded"})," event is fired."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"'load'"})," - consider operation to be finished when the ",(0,i.jsx)(t.code,{children:"load"})," event is fired."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"'networkidle'"})," - ",(0,i.jsx)(t.strong,{children:"DISCOURAGED"})," consider operation to be finished when there are no network connections for at least ",(0,i.jsx)(t.code,{children:"500"})," ms. Don't use this method for testing, rely on web assertions to assess readiness instead."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"'commit'"})," - consider operation to be finished when network response is received and the document started loading."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",title:"void",children:"void"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-set-content-return"}),(0,i.jsx)("a",{href:"#frame-set-content-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-title",children:"title"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.title"}),"\n",(0,i.jsx)(t.p,{children:"Returns the page title."}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.title();\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-title-return"}),(0,i.jsx)("a",{href:"#frame-title-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-url",children:"url"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.url"}),"\n",(0,i.jsx)(t.p,{children:"Returns frame's url."}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"frame.url();\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-url-return"}),(0,i.jsx)("a",{href:"#frame-url-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-wait-for-function",children:"waitForFunction"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.waitForFunction"}),"\n",(0,i.jsxs)(t.p,{children:["Returns when the ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-wait-for-function-option-expression",children:"pageFunction"})," returns a truthy value, returns that value."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsxs)(t.p,{children:["The ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-wait-for-function",children:"frame.waitForFunction()"})," can be used to observe viewport size change:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"const { firefox } = require('playwright'); // Or 'chromium' or 'webkit'.\n\n(async () => {\n const browser = await firefox.launch();\n const page = await browser.newPage();\n const watchDog = page.mainFrame().waitForFunction('window.innerWidth < 100');\n await page.setViewportSize({ width: 50, height: 50 });\n await watchDog;\n await browser.close();\n})();\n"})}),"\n",(0,i.jsxs)(t.p,{children:["To pass an argument to the predicate of ",(0,i.jsx)(t.code,{children:"frame.waitForFunction"})," function:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"const selector = '.foo';\nawait frame.waitForFunction(selector => !!document.querySelector(selector), selector);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"pageFunction"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",title:"Function",children:"function"})," | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-function-option-expression"}),(0,i.jsx)("a",{href:"#frame-wait-for-function-option-expression",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Function to be evaluated in the page context."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"arg"})," ",(0,i.jsx)(t.a,{href:"/docs/evaluating#evaluation-argument",title:"EvaluationArgument",children:"EvaluationArgument"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-function-option-arg"}),(0,i.jsx)("a",{href:"#frame-wait-for-function-option-arg",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Optional argument to pass to ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-wait-for-function-option-expression",children:"pageFunction"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"polling"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"}),' | "raf" ',(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-function-option-polling"}),(0,i.jsx)("a",{href:"#frame-wait-for-function-option-polling",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["If ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-wait-for-function-option-polling",children:"polling"})," is ",(0,i.jsx)(t.code,{children:"'raf'"}),", then ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-wait-for-function-option-expression",children:"pageFunction"})," is constantly executed in ",(0,i.jsx)(t.code,{children:"requestAnimationFrame"})," callback. If ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-wait-for-function-option-polling",children:"polling"}
1)," is a number, then it is treated as an interval in milliseconds at which the function would be executed. Defaults to ",(0,i.jsx)(t.code,{children:"raf"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-function-option-signal"}),(0,i.jsx)("a",{href:"#frame-wait-for-function-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-function-option-timeout"}),(0,i.jsx)("a",{href:"#frame-wait-for-function-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum time to wait for in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"actionTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}
1),"<",(0,i.jsx)(t.a,{href:"/docs/api/class-jshandle",title:"JSHandle",children:"JSHandle"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-function-return"}),(0,i.jsx)("a",{href:"#frame-wait-for-function-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-wait-for-load-state",children:"waitForLoadState"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.waitForLoadState"}),"\n",(0,i.jsx)(t.p,{children:"Waits for the required load state to be reached."}),"\n",(0,i.jsxs)(t.p,{children:["This returns when the frame reaches a required load state, ",(0,i.jsx)(t.code,{children:"load"})," by default. The navigation must have been committed when this method is called. If current document has already reached the required state, resolves immediately."]}),"\n",(0,i.jsx)(t.admonition,{type:"note",children:(0,i.jsxs)(t.p,{children:["Most of the time, this method is not needed because Playwright ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"auto-waits before every action"}),"."]})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.click('button'); // Click triggers navigation.\nawait frame.waitForLoadState(); // Waits for 'load' state by default.\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"state"}),' "load" | "domcontentloaded" | "networkidle" ',(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-load-state-option-state"}),(0,i.jsx)("a",{href:"#frame-wait-for-load-state-option-state",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Optional load state to wait for, defaults to ",(0,i.jsx)(t.code,{children:"load"}),". If the state has been already reached while loading current document, the method resolves immediately. Can be one of:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"'load'"})," - wait for the ",(0,i.jsx)(t.code,{children:"load"})," event to be fired."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"'domcontentloaded'"})," - wait for the ",(0,i.jsx)(t.code,{children:"DOMContentLoaded"})," event to be fired."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"'networkidle'"})," - ",(0,i.jsx)(t.strong,{children:"DISCOURAGED"})," wait until there are no network connections for at least ",(0,i.jsx)(t.code,{children:"500"})," ms. Don't use this method for testing, rely on web assertions to assess readiness instead."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-load-state-option-signal"}),(0,i.jsx)("a",{href:"#frame-wait-for-load-state-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the waiting using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-load-state-option-timeout"}),(0,i.jsx)("a",{href:"#frame-wait-for-load-state-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum operation time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"navigationTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-navigation-timeout",children:"browserContext.setDefaultNavigationTimeout()"}),", ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"}),", ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-navigation-timeout",children:"page.setDefaultNavigationTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",title:"void",children:"void"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-load-state-return"}),(0,i.jsx)("a",{href:"#frame-wait-for-load-state-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-wait-for-url",children:"waitForURL"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.11"}),"\n",(0,i.jsx)("x-search",{children:"frame.waitForURL"}),"\n",(0,i.jsx)(t.p,{children:"Waits for the frame to navigate to the given URL."}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.click('a.delayed-navigation'); // Clicking the link will indirectly cause a navigation\nawait frame.waitForURL('**/target.html');\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"url"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",title:"RegExp",children:"RegExp"})," | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/URLPattern",title:"URLPattern",children:"URLPattern"})," | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",title:"Function",children:"function"}),"(",(0,i.jsx)(t.a,{href:"https://nodejs.org/api/url.html",title:"URL",children:"URL"}),"):",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-url-option-url"}),(0,i.jsx)("a",{href:"#frame-wait-for-url-option-url",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["A glob pattern, regex pattern, URL pattern, or predicate receiving ",(0,i.jsx)(t.a,{href:"https://nodejs.org/api/url.html",title:"URL",children:"URL"})," to match while waiting for the navigation. Note that if the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to the string."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-url-option-signal"}),(0,i.jsx)("a",{href:"#frame-wait-for-url-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the waiting using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-url-option-timeout"}),(0,i.jsx)("a",{href:"#frame-wait-for-url-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum operation time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"navigationTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-navigation-timeout",children:"browserContext.setDefaultNavigationTimeout()"}),", ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"}),", ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-navigation-timeout",children:"page.setDefaultNavigationTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"waitUntil"}),' "load" | "domcontentloaded" | "networkidle" | "commit" ',(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-url-option-wait-until"}),(0,i.jsx)("a",{href:"#frame-wait-for-url-option-wait-until",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["When to consider operation succeeded, defaults to ",(0,i.jsx)(t.code,{children:"load"}),". Events can be either:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"'domcontentloaded'"})," - consider operation to be finished when the ",(0,i.jsx)(t.code,{children:"DOMContentLoaded"})," event is fired."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"'load'"})," - consider operation to be finished when the ",(0,i.jsx)(t.code,{children:"load"})," event is fired."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"'networkidle'"})," - ",(0,i.jsx)(t.strong,{children:"DISCOURAGED"})," consider operation to be finished when there are no network connections for at least ",(0,i.jsx)(t.code,{children:"500"})," ms. Don't use this method for testing, rely on web assertions to assess readiness instead."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"'commit'"})," - consider operation to be finished when network response is received and the document started loading."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",title:"void",children:"void"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-url-return"}),(0,i.jsx)("a",{href:"#frame-wait-for-url-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h2,{id:"deprecated",children:"Deprecated"}),"\n",(0,i.jsx)(t.h3,{id:"frame-query-selector",children:"$"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.$"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["Use locator-based ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-locator",children:"frame.locator()"})," instead. Read more about ",(0,i.jsx)(t.a,{href:"/docs/locators",children:"locators"}),"."]})}),"\n",(0,i.jsx)(t.p,{children:"Returns the ElementHandle pointing to the frame element."}),"\n",(0,i.jsx)(t.admonition,{type:"caution",children:(0,i.jsxs)(t.p,{children:["The use of ",(0,i.jsx)(t.a,{href:"/docs/api/class-elementhandle",title:"ElementHandle",children:"ElementHandle"})," is discouraged, use ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator",title:"Locator",children:"Locator"})," objects and web-first assertions instead."]})}),"\n",(0,i.jsxs)(t.p,{children:["The method finds an element matching the specified selector within the frame. If no elements match the selector, returns ",(0,i.jsx)(t.code,{children:"null"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.$(selector);\nawait frame.$(selector, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-query-selector-option-selector"}),(0,i.jsx)("a",{href:"#frame-query-selector-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to query for."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/
1Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-query-selector-option-strict"}),(0,i.jsx)("a",{href:"#frame-query-selector-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null",title:"null",children:"null"})," | ",(0,i.jsx)(t.a,{href:"/docs/api/class-elementhandle",title:"ElementHandle",children:"ElementHandle"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-query-selector-return"}),(0,i.jsx)("a",{href:"#frame-query-selector-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-query-selector-all",children:"$$"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.$$"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["Use locator-based ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-locator",children:"frame.locator()"})," instead. Read more about ",(0,i.jsx)(t.a,{href:"/docs/locators",children:"locators"}),"."]})}),"\n",(0,i.jsx)(t.p,{children:"Returns the ElementHandles pointing to the frame elements."}),"\n",(0,i.jsx)(t.admonition,{type:"caution",children:(0,i.jsxs)(t.p,{children:["The use of ",(0,i.jsx)(t.a,{href:"/docs/api/class-elementhandle",title:"ElementHandle",children:"ElementHandle"})," is discouraged, use ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator",title:"Locator",children:"Locator"})," objects instead."]})}),"\n",(0,i.jsx)(t.p,{children:"The method finds all elements matching the specified selector within the frame. If no elements match the selector, returns empty array."}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.$$(selector);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-query-selector-all-option-selector"}),(0,i.jsx)("a",{href:"#frame-query-selector-all-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to query for."}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",title:"Array",children:"Array"}),"<",(0,i.jsx)(t.a,{href:"/docs/api/class-elementhandle",title:"ElementHandle",children:"ElementHandle"}),">>",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-query-selector-all-return"}),(0,i.jsx)("a",{href:"#frame-query-selector-all-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-eval-on-selector",children:"$eval"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.$eval"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["This method does not wait for the element to pass the actionability checks and therefore can lead to the flaky tests. Use ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-evaluate",children:"locator.evaluate()"}),", other ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator",title:"Locator",children:"Locator"})," helper methods or web-first assertions instead."]})}),"\n",(0,i.jsxs)(t.p,{children:["Returns the return value of ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-eval-on-selector-option-expression",children:"pageFunction"}),"."]}),"\n",(0,i.jsxs)(t.p,{children:["The method finds an element matching the specified selector within the frame and passes it as a first argument to ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-eval-on-selector-option-expression",children:"pageFunction"}),". If no elements match the selector, the method throws an error."]}),"\n",(0,i.jsxs)(t.p,{children:["If ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-eval-on-selector-option-expression",children:"pageFunction"})," returns a ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),", then ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-eval-on-selector",children:"frame.$eval()"})," would wait for the promise to resolve and return its value."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"const searchValue = await frame.$eval('#search', el => el.value);\nconst preloadHref = await frame.$eval('link[rel=preload]', el => el.href);
1\nconst html = await frame.$eval('.main-container', (e, suffix) => e.outerHTML + suffix, 'hello');\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-eval-on-selector-option-selector"}),(0,i.jsx)("a",{href:"#frame-eval-on-selector-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to query for."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"pageFunction"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",title:"Function",children:"function"}),"(",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/element",title:"Element",children:"Element"}),") | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-eval-on-selector-option-expression"}),(0,i.jsx)("a",{href:"#frame-eval-on-selector-option-expression",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Function to be evaluated in the page context."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"arg"})," ",(0,i.jsx)(t.a,{href:"/docs/evaluating#evaluation-argument",title:"EvaluationArgument",children:"EvaluationArgument"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-eval-on-selector-option-arg"}),(0,i.jsx)("a",{href:"#frame-eval-on-selector-option-arg",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Optional argument to pass to ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-eval-on-selector-option-expression",children:"pageFunction"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-eval-on-selector-option-strict"}),(0,i.jsx)("a",{href:"#frame-eval-on-selector-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Description",title:"Serializable",children:"Serializable"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-eval-on-selector-return"}),(0,i.jsx)("a",{href:"#frame-eval-on-selector-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-eval-on-selector-all",children:"$$eval"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.$$eval"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["In most cases, ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-evaluate-all",children:"locator.evaluateAll()"}),", other ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator",title:"Locator",children:"Locator"})," helper methods and web-first assertions do a better job."]})}),"\n",(0,i.jsxs)(t.p,{children:["Returns the return value of ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-eval-on-selector-all-option-expression",children:"pageFunction"}),"."]}),"\n",(0,i.jsxs)(t.p,{children:["The method finds all elements matching the specified selector within the frame and passes an array of matched elements as a first argument to ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-eval-on-selector-all-option-expression",children:"pageFunction"}),"."]}),"\n",(0,i.jsxs)(t.p,{children:["If ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-eval-on-selector-all-option-expression",children:"pageFunction"})," returns a ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),", then ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-eval-on-selector-all",children:"frame.$$eval()"})," would wait for the promise to resolve and return its value."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"const divsCounts = await frame.$$eval('div', (divs, min) => divs.length >= min, 10);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-eval-on-selector-all-option-selector"}),(0,i.jsx)("a",{href:"#frame-eval-on-selector-all-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to query for."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"pageFunction"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",title:"Function",children:"function"}),"(",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",title:"Array",children:"Array"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/element",title:"Element",children:"Element"}),">) | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-eval-on-selector-all-option-expression"}),(0,i.jsx)("a",{href:"#frame-eval-on-selector-all-option-expression",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Function to be evaluated in the page context."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"arg"})," ",(0,i.jsx)(t.a,{href:"/docs/evaluating#evaluation-argument",title:"EvaluationArgument",children:"EvaluationArgument"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-eval-on-selector-all-option-arg"}),(0,i.jsx)("a",{href:"#frame-eval-on-selector-all-option-arg",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Optional argument to pass to ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-eval-on-selector-all-option-expression",children:"pageFunction"}),"."]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Description",title:"Serializable",children:"Serializable"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-eval-on-selector-all-return"}),(0,i.jsx)("a",{href:"#frame-eval-on-selector-all-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-check",children:"check"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.check"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["Use locator-based ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-check",children:"locator.check()"})," instead. Read more about ",(0,i.jsx)(t.a,{href:"/docs/locators",children:"locators"}),"."]})}),"\n",(0,i.jsxs)(t.p,{children:["This method checks an element matching ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-check-option-selector",children:"selector"})," by performing the following steps:"]}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:["Find an element matching ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-check-option-selector",children:"selector"}),". If there is none, wait until a matching element is attached to the DOM."]}),"\n",(0,i.jsx)(t.li,{children:"Ensure that matched element is a checkbox or a radio input. If not, this method throws. If the element is already checked, this method returns immediately."}),"\n",(0,i.jsxs)(t.li,{children:["Wait for ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"actionability"})," checks on the matched element, unless ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-check-option-force",children:"force"})," option is set. If the element is detached during the checks, the whole action is retried."]}),"\n",(0,i.jsx)(t.li,{children:"Scroll the element into view if needed."}),"\n",(0,i.jsxs)(t.li,{children:["Use ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-mouse",children:"page.mouse"})," to click in the center of the element."]}),"\n",(0,i.jsx)(t.li,{children:"Ensure that the element is now checked. If not, this method throws."}),"\n"]}),"\n",(0,i.jsxs)(t.p,{children:["When all steps combined have not finished during the specified ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-check-option-timeout",children:"timeout"}),", this method throws a ",(0,i.jsx)(t.a,{href:"/docs/api/class-timeouterror",title:"TimeoutError",children:"TimeoutError"}),". Passing zero timeout disables this."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.check(selector);\nawait frame.check(selector, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-check-option-selector"}),(0,i.jsx)("a",{href:"#frame-check-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"force"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-check-option-force"}),(0,i.jsx)("a",{href:"#frame-check-option-force",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Whether to bypass the ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"actionability"})," checks. Defaults to ",(0,i.jsx)(t.code,{children:"false"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"noWaitAfter"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-check-option-no-wait-after"}),(0,i.jsx)("a",{href:"#frame-check-option-no-wait-after",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.admonition,{title:"Deprecated",type:"warning",children:(0,i.jsx)(t.p,{children:"This option has no effect."})}),"\n",(0,i.jsx)(t.p,{children:"This option has no effect."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"position"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.11"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-check-option-position"}),(0,i.jsx)("a",{href:"#frame-check-option-position",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"x"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"y"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"scroll"}),' "auto" | "none" ',(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-check-option-scroll"}),(0,i.jsx)("a",{href:"#frame-check-option-scroll",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Controls whether Playwright scrolls the element into view before performing the action. Defaults to ",(0,i.jsx)(t.code,{children:'"auto"'}),", which scrolls the element into view when necessary, including scrolling nested scrollable containers. When set to ",(0,i.jsx)(t.code,{children:'"none"'}),", Playwright does not scroll the element and the action fails if the element is not already in the viewport. This is useful to assert that an element is reachable by the user without additional scrolling."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"
1}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-check-option-signal"}),(0,i.jsx)("a",{href:"#frame-check-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-check-option-strict"}),(0,i.jsx)("a",{href:"#frame-check-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-check-option-timeout"}),(0,i.jsx)("a",{href:"#frame-check-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"actionTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"trial"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.11"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-check-option-trial"}),(0,i.jsx)("a",{href:"#frame-check-option-trial",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["When set, this method only performs the ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"actionability"})," checks and skips the action. Defaults to ",(0,i.jsx)(t.code,{children:"false"}),". Useful to wait until the element is ready for the action without performing it."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",title:"void",children:"void"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-check-return"}),(0,i.jsx)("a",{href:"#frame-check-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-click",children:"click"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.click"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["Use locator-based ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-click",children:"locator.click()"})," instead. Read more about ",(0,i.jsx)(t.a,{href:"/docs/locators",children:"locators"}),"."]})}),"\n",(0,i.jsxs)(t.p,{children:["This method clicks an element matching ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-click-option-selector",children:"selector"})," by performing the following steps:"]}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:["Find an element matching ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-click-option-selector",children:"selector"}),". If there is none, wait until a matching element is attached to the DOM."]}),"\n",(0,i.jsxs)(t.li,{children:["Wait for ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"actionability"})," checks on the matched element, unless ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-click-option-force",children:"force"})," option is set. If the element is detached during the checks, the whole action is retried."]}),"\n",(0,i.jsx)(t.li,{children:"Scroll the element into view if needed."}),"\n",(0,i.jsxs)(t.li,{children:["Use ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-mouse",children:"page.mouse"})," to click in the center of the element, or the specified ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-click-option-position",children:"position"}),"."]}),"\n",(0,i.jsxs)(t.li,{children:["Wait for initiated navigations to either succeed or fail, unless ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-click-option-no-wait-after",children:"noWaitAfter"})," option is set."]}),"\n"]}),"\n",(0,i.jsxs)(t.p,{children:["When all steps combined have not finished during the specified ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-click-option-timeout",children:"timeout"}),", this method throws a ",(0,i.jsx)(t.a,{href:"/docs/api/class-timeouterror",title:"TimeoutError",children:"TimeoutError"}),". Passing zero timeout disables this."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.click(selector);\nawait frame.click(selector, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-click-option-selector"}),(0,i.jsx)("a",{href:"#frame-click-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"button"}),' "left" | "right" | "middle" ',(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-click-option-button"}),(0,i.jsx)("a",{href:"#frame-click-option-button",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Defaults to ",(0,i.jsx)(t.code,{children:"left"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"clickCount"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-click-option-click-count"}),(0,i.jsx)("a",{href:"#frame-click-option-click-count",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["defaults to 1. See ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail",title:"UIEvent.detail",children:"UIEvent.detail"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"delay"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-click-option-delay"}),(0,i.jsx)("a",{href:"#frame-click-option-delay",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Time to wait between ",(0,i.jsx)(t.code,{children:"mousedown"})," and ",(0,i.jsx)(t.code,{children:"mouseup"})," in milliseconds. Defaults to 0."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"force"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-click-option-force"}),(0,i.jsx)("a",{href:"#frame-click-option-force",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Whether to bypass the ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"actionability"})," checks. Defaults to ",(0,i.jsx)(t.code,{children:"false"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"modifiers"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",title:"Array",children:"Array"}),'<"Alt" | "Control" | "ControlOrMeta" | "Meta" | "Shift"> ',(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-click-option-modifiers"}),(0,i.jsx)("a",{href:"#frame-click-option-modifiers",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:'Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current modifiers back. If not specified, currently pressed modifiers are used. "ControlOrMeta" resolves to "Control" on Windows and Linux and to "Meta" on macOS.'}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"noWaitAfter"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-click-option-no-wait-after"}),(0,i.jsx)("a",{href:"#frame-click-option-no-wait-after",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.admonition,{title:"Deprecated",type:"warning",children:(0,i.jsxs)(t.p,{children:["This option will default to ",(0,i.jsx)(t.code,{children:"true"})," in the future."]})}),"\n",(0,i.jsxs)(t.p,{children:["Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to ",(0,i.jsx)(t.code,{children:"false"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"position"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-click-option-position"}),(0,i.jsx)("a",{href:"#frame-click-option-position",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"x"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"y"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"scroll"}),' "auto" | "none" ',(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-click-option-scroll"}),(0,i.jsx)("a",{href:"#frame-click-option-scroll",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Controls whether Playwright scrolls the element into view before performing the action. Defaults to ",(0,i.jsx)(t.code,{children:'"auto"'}),", which scrolls the element into view when necessary, including scrolling nested scrollable containers. When set to ",(0,i.jsx)(t.code,{children:'"none"'}),", Playwright does not scroll the element and the action fails if the element is not already in the viewport. This is useful to assert that an element is reachable by the user without additional scrolling."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-click-option-signal"}),(0,i.jsx)("a",{href:"#frame-click-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-click-option-strict"}),(0,i.jsx)("a",{href:"#frame-click-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]
1}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-click-option-timeout"}),(0,i.jsx)("a",{href:"#frame-click-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"actionTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"trial"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.11"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-click-option-trial"}),(0,i.jsx)("a",{href:"#frame-click-option-trial",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["When set, this method only performs the ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"actionability"})," checks and skips the action. Defaults to ",(0,i.jsx)(t.code,{children:"false"}),". Useful to wait until the element is ready for the action without performing it. Note that keyboard ",(0,i.jsx)(t.code,{children:"modifiers"})," will be pressed regardless of ",(0,i.jsx)(t.code,{children:"trial"})," to allow testing elements which are only visible when those keys are pressed."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",title:"void",children:"void"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-click-return"}),(0,i.jsx)("a",{href:"#frame-click-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-dblclick",children:"dblclick"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.dblclick"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["Use locator-based ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-dblclick",children:"locator.dblclick()"})," instead. Read more about ",(0,i.jsx)(t.a,{href:"/docs/locators",children:"locators"}),"."]})}),"\n",(0,i.jsxs)(t.p,{children:["This method double clicks an element matching ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-dblclick-option-selector",children:"selector"})," by performing the following steps:"]}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:["Find an element matching ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-dblclick-option-selector",children:"selector"}),". If there is none, wait until a matching element is attached to the DOM."]}),"\n",(0,i.jsxs)(t.li,{children:["Wait for ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"actionability"})," checks on the matched element, unless ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-dblclick-option-force",children:"force"})," option is set. If the element is detached during the checks, the whole action is retried."]}),"\n",(0,i.jsx)(t.li,{children:"Scroll the element into view if needed."}),"\n",(0,i.jsxs)(t.li,{children:["Use ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-mouse",children:"page.mouse"})," to double click in the center of the element, or the specified ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-dblclick-option-position",children:"position"}),". if the first click of the ",(0,i.jsx)(t.code,{children:"dblclick()"})," triggers a navigation event, this method will throw."]}),"\n"]}),"\n",(0,i.jsxs)(t.p,{children:["When all steps combined have not finished during the specified ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-dblclick-option-timeout",children:"timeout"}),", this method throws a ",(0,i.jsx)(t.a,{href:"/docs/api/class-timeouterror",title:"TimeoutError",children:"TimeoutError"}),". Passing zero timeout disables this."]}),"\n",(0,i.jsx)(t.admonition,{type:"note",children:(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"frame.dblclick()"})," dispatches two ",(0,i.jsx)(t.code,{children:"click"})," events and a single ",(0,i.jsx)(t.code,{children:"dblclick"})," event."]})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.dblclick(selector);\nawait frame.dblclick(selector, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-dblclick-option-selector"}),(0,i.jsx)("a",{href:"#frame-dblclick-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"button"}),' "left" | "right" | "middle" ',(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-dblclick-option-button"}),(0,i.jsx)("a",{href:"#frame-dblclick-option-button",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Defaults to ",(0,i.jsx)(t.code,{children:"left"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"delay"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-dblclick-option-delay"}),(0,i.jsx)("a",{href:"#frame-dblclick-option-delay",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Time to wait between ",(0,i.jsx)(t.code,{children:"mousedown"})," and ",(0,i.jsx)(t.code,{children:"mouseup"})," in milliseconds. Defaults to 0."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"force"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-dblclick-option-force"}),(0,i.jsx)("a",{href:"#frame-dblclick-option-force",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Whether to bypass the ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"actionability"})," checks. Defaults to ",(0,i.jsx)(t.code,{children:"false"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"modifiers"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",title:"Array",children:"Array"}),'<"Alt" | "Control" | "ControlOrMeta" | "Meta" | "Shift"> ',(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-dblclick-option-modifiers"}),(0,i.jsx)("a",{href:"#frame-dblclick-option-modifiers",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:'Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current modifiers back. If not specified, currently pressed modifiers are used. "ControlOrMeta" resolves to "Control" on Windows and Linux and to "Meta" on macOS.'}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"noWaitAfter"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-dblclick-option-no-wait-after"}),(0,i.jsx)("a",{href:"#frame-dblclick-option-no-wait-after",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.admonition,{title:"Deprecated",type:"warning",children:(0,i.jsx)(t.p,{children:"This option has no effect."})}),"\n",(0,i.jsx)(t.p,{children:"This option has no effect."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"position"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-dblclick-option-position"}),(0,i.jsx)("a",{href:"#frame-dblclick-option-position",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"x"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"y"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"scroll"}),' "auto" | "none" ',(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-dblclick-option-scroll"}),(0,i.jsx)("a",{href:"#frame-dblclick-option-scroll",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Controls whether Playwright scrolls the element into view before performing the action. Defaults to ",(0,i.jsx)(t.code,{children:'"auto"'}),", which scrolls the element into view when necessary, including scrolling nested scrollable containers. When set to ",(0,i.jsx)(t.code,{children:'"none"'}),", Playwright does not scroll the element and the action fails if the element is not already in the viewport. This is useful to assert that an element is reachable by the user without additional scrolling."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-dblclick-option-signal"}),(0,i.jsx)("a",{href:"#frame-dblclick-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-dblclick-option-strict"}),(0,i.jsx)("a",{href:"#frame-dblclick-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-dblclick-option-timeout"}),(0,i.jsx)("a",{href:"#frame-dblclick-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"actionTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"trial"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.11"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-dblclick-option-trial"}),(0,i.jsx)("a",{href:"#frame-dblclick-option-trial",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["When set, this method only performs the ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"actionability"})," checks and skips the action. Defaults to ",(0,i.jsx)(t.code,{children:"false"}),". Useful to wait until the element is ready for the action without performing it. Note that keyboard ",(0,i.jsx)(t.code,{children:"modifiers"})," will be pressed regardless of ",(0,i.jsx)(t.code,{children:"trial"})," to allow testing elements which are only visible when those keys are pressed."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0
1,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",title:"void",children:"void"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-dblclick-return"}),(0,i.jsx)("a",{href:"#frame-dblclick-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-dispatch-event",children:"dispatchEvent"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.dispatchEvent"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["Use locator-based ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-dispatch-event",children:"locator.dispatchEvent()"})," instead. Read more about ",(0,i.jsx)(t.a,{href:"/docs/locators",children:"locators"}),"."]})}),"\n",(0,i.jsxs)(t.p,{children:["The snippet below dispatches the ",(0,i.jsx)(t.code,{children:"click"})," event on the element. Regardless of the visibility state of the element, ",(0,i.jsx)(t.code,{children:"click"})," is dispatched. This is equivalent to calling ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/click",children:"element.click()"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.dispatchEvent('button#submit', 'click');\n"})}),"\n",(0,i.jsxs)(t.p,{children:["Under the hood, it creates an instance of an event based on the given ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-dispatch-event-option-type",children:"type"}),", initializes it with ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-dispatch-event-option-event-init",children:"eventInit"})," properties and dispatches it on the element. Events are ",(0,i.jsx)(t.code,{children:"composed"}),", ",(0,i.jsx)(t.code,{children:"cancelable"})," and bubble by default."]}),"\n",(0,i.jsxs)(t.p,{children:["Since ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-dispatch-event-option-event-init",children:"eventInit"})," is event-specific, please refer to the events documentation for the lists of initial properties:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/DeviceMotionEvent/DeviceMotionEvent",children:"DeviceMotionEvent"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/DeviceOrientationEvent/DeviceOrientationEvent",children:"DeviceOrientationEvent"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/DragEvent/DragEvent",children:"DragEvent"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Event/Event",children:"Event"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent/FocusEvent",children:"FocusEvent"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/KeyboardEvent",children:"KeyboardEvent"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/MouseEvent",children:"MouseEvent"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/PointerEvent",children:"PointerEvent"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/TouchEvent",children:"TouchEvent"})}),"\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent/WheelEvent",children:"WheelEvent"})}),"\n"]}),"\n",(0,i.jsxs)(t.p,{children:["You can also specify ",(0,i.jsx)(t.code,{children:"JSHandle"})," as the property value if you want live objects to be passed into the event:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"// Note you can only create DataTransfer in Chromium and Firefox\nconst dataTransfer = await frame.evaluateHandle(() =>
1 new DataTransfer());\nawait frame.dispatchEvent('#source', 'dragstart', { dataTransfer });\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-dispatch-event-option-selector"}),(0,i.jsx)("a",{href:"#frame-dispatch-event-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"type"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-dispatch-event-option-type"}),(0,i.jsx)("a",{href:"#frame-dispatch-event-option-type",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["DOM event type: ",(0,i.jsx)(t.code,{children:'"click"'}),", ",(0,i.jsx)(t.code,{children:'"dragstart"'}),", etc."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"eventInit"})," ",(0,i.jsx)(t.a,{href:"/docs/evaluating#evaluation-argument",title:"EvaluationArgument",children:"EvaluationArgument"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-dispatch-event-option-event-init"}),(0,i.jsx)("a",{href:"#frame-dispatch-event-option-event-init",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Optional event-specific initialization properties."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-dispatch-event-option-signal"}),(0,i.jsx)("a",{href:"#frame-dispatch-event-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-dispatch-event-option-strict"}),(0,i.jsx)("a",{href:"#frame-dispatch-event-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-dispatch-event-option-timeout"}),(0,i.jsx)("a",{href:"#frame-dispatch-event-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"actionTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",title:"void",children:"void"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-dispatch-event-return"}),(0,i.jsx)("a",{href:"#frame-dispatch-event-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-fill",children:"fill"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.fill"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["Use locator-based ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-fill",children:"locator.fill()"})," instead. Read more about ",(0,i.jsx)(t.a,{href:"/docs/locators",children:"locators"}),"."]})}),"\n",(0,i.jsxs)(t.p,{children:["This method waits for an element matching ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-fill-option-selector",children:"selector"}),", waits for ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"actionability"})," checks, focuses the element, fills it and triggers an ",(0,i.jsx)(t.code,{children:"input"})," event after filling. Note that you can pass an empty string to clear the input field."]}),"\n",(0,i.jsxs)(t.p,{children:["If the target element is not an ",(0,i.jsx)(t.code,{children:"<input>"}),", ",(0,i.jsx)(t.code,{children:"<textarea>"})," or ",(0,i.jsx)(t.code,{children:"[contenteditable]"})," element, this method throws an error. However, if the element is inside the ",(0,i.jsx)(t.code,{children:"<label>"})," element that has an associated ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control",children:"control"}
1),", the control will be filled instead."]}),"\n",(0,i.jsxs)(t.p,{children:["To send fine-grained keyboard events, use ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-press-sequentially",children:"locator.pressSequentially()"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.fill(selector, value);\nawait frame.fill(selector, value, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-fill-option-selector"}),(0,i.jsx)("a",{href:"#frame-fill-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"value"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-fill-option-value"}),(0,i.jsx)("a",{href:"#frame-fill-option-value",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Value to fill for the ",(0,i.jsx)(t.code,{children:"<input>"}),", ",(0,i.jsx)(t.code,{children:"<textarea>"})," or ",(0,i.jsx)(t.code,{children:"[contenteditable]"})," element."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"force"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.13"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-fill-option-force"}),(0,i.jsx)("a",{href:"#frame-fill-option-force",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Whether to bypass the ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"actionability"})," checks. Defaults to ",(0,i.jsx)(t.code,{children:"false"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"noWaitAfter"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-fill-option-no-wait-after"}),(0,i.jsx)("a",{href:"#frame-fill-option-no-wait-after",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.admonition,{title:"Deprecated",type:"warning",children:(0,i.jsx)(t.p,{children:"This option has no effect."})}),"\n",(0,i.jsx)(t.p,{children:"This option has no effect."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-fill-option-signal"}),(0,i.jsx)("a",{href:"#frame-fill-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-fill-option-strict"}),(0,i.jsx)("a",{href:"#frame-fill-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-fill-option-timeout"}),(0,i.jsx)("a",{href:"#frame-fill-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"actionTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",title:"void",children:"void"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-fill-return"}),(0,i.jsx)("a",{href:"#frame-fill-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-focus",children:"focus"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.focus"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["Use locator-based ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-focus",children:"locator.focus()"})," instead. Read more about ",(0,i.jsx)(t.a,{href:"/docs/locators",children:"locators"}),"."]})}),"\n",(0,i.jsxs)(t.p,{children:["This method fetches an element with ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-focus-option-selector",children:"selector"})," and focuses it. If there's no element matching ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-focus-option-selector",children:"selector"}),", the method waits until a matching element appears in the DOM."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.focus(selector);\nawait frame.focus(selector, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-focus-option-selector"}),(0,i.jsx)("a",{href:"#frame-focus-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-focus-option-signal"}),(0,i.jsx)("a",{href:"#frame-focus-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-focus-option-strict"}),(0,i.jsx)("a",{href:"#frame-focus-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-focus-option-timeout"}),(0,i.jsx)("a",{href:"#frame-focus-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"actionTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",title:"void",children:"void"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-focus-return"}),(0,i.jsx)("a",{href:"#frame-focus-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-get-attribute",children:"getAttribute"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.getAttribute"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["Use locator-based ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-get-attribute",children:"locator.getAttribute()"})," instead. Read more about ",(0,i.jsx)(t.a,{href:"/docs/locators",children:"locators"}),"."]})}),"\n",(0,i.jsx)(t.p,{children:"Returns element attribute value."}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.getAttribute(selector, name);\nawait frame.getAttribute(selector, name, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-attribute-option-selector"}),(0,i.jsx)("a",{href:"#frame-get-attribute-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"name"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-attribute-option-name"}),(0,i.jsx)("a",{href:"#frame-get-attribute-option-name",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Attribute name to get the value for."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-attribute-option-signal"}),(0,i.jsx)("a",{href:"#frame-get-attribute-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"
1})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-attribute-option-strict"}),(0,i.jsx)("a",{href:"#frame-get-attribute-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-attribute-option-timeout"}),(0,i.jsx)("a",{href:"#frame-get-attribute-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"actionTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null",title:"null",children:"null"})," | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-get-attribute-return"}),(0,i.jsx)("a",{href:"#frame-get-attribute-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-hover",children:"hover"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.hover"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["Use locator-based ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-hover",children:"locator.hover()"})," instead. Read more about ",(0,i.jsx)(t.a,{href:"/docs/locators",children:"locators"}),"."]})}),"\n",(0,i.jsxs)(t.p,{children:["This method hovers over an element matching ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-hover-option-selector",children:"selector"})," by performing the following steps:"]}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:["Find an element matching ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-hover-option-selector",children:"selector"}),". If there is none, wait until a matching element is attached to the DOM."]}),"\n",(0,i.jsxs)(t.li,{children:["Wait for ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"actionability"})," checks on the matched element, unless ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-hover-option-force",children:"force"})," option is set. If the element is detached during the checks, the whole action is retried."]}),"\n",(0,i.jsx)(t.li,{children:"Scroll the element into view if needed."}),"\n",(0,i.jsxs)(t.li,{children:["Use ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-mouse",children:"page.mouse"})," to hover over the center of the element, or the specified ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-hover-option-position",children:"position"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.p,{children:["When all steps combined have not finished during the specified ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-hover-option-timeout",children:"timeout"}),", this method throws a ",(0,i.jsx)(t.a,{href:"/docs/api/class-timeouterror",title:"TimeoutError",children:"TimeoutError"}),". Passing zero timeout disables this."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.hover(selector);\nawait frame.hover(selector, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-hover-option-selector"}),(0,i.jsx)("a",{href:"#frame-hover-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"force"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-hover-option-force"}),(0,i.jsx)("a",{href:"#frame-hover-option-force",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Whether to bypass the ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"actionability"})," checks. Defaults to ",(0,i.jsx)(t.code,{children:"false"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"modifiers"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",title:"Array",children:"Array"}),'<"Alt" | "Control" | "ControlOrMeta" | "Meta" | "Shift"> ',(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-hover-option-modifiers"}),(0,i.jsx)("a",{href:"#frame-hover-option-modifiers",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:'Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current modifiers back. If not specified, currently pressed modifiers are used. "ControlOrMeta" resolves to "Control" on Windows and Linux and to "Meta" on macOS.'}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"noWaitAfter"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.28"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-hover-option-no-wait-after"}),(0,i.jsx)("a",{href:"#frame-hover-option-no-wait-after",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.admonition,{title:"Deprecated",type:"warning",children:(0,i.jsx)(t.p,{children:"This option has no effect."})}),"\n",(0,i.jsx)(t.p,{children:"This option has no effect."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"position"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-hover-option-position"}),(0,i.jsx)("a",{href:"#frame-hover-option-position",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"x"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"y"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"scroll"}),' "auto" | "none" ',(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-hover-option-scroll"}),(0,i.jsx)("a",{href:"#frame-hover-option-scroll",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Controls whether Playwright scrolls the element into view before performing the action. Defaults to ",(0,i.jsx)(t.code,{children:'"auto"'}),", which scrolls the element into view when necessary, including scrolling nested scrollable containers. When set to ",(0,i.jsx)(t.code,{children:'"none"'}),", Playwright does not scroll the element and the action fails if the element is not already in the viewport. This is useful to assert that an element is reachable by the user without additional scrolling."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-hover-option-signal"}),(0,i.jsx)("a",{href:"#frame-hover-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-hover-option-strict"}),(0,i.jsx)("a",{href:"#frame-hover-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-hover-option-timeout"}),(0,i.jsx)("a",{href:"#frame-hover-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"actionTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"trial"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.11"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-hover-option-trial"}),(0,i.jsx)("a",{href:"#frame-hover-option-trial",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["When set, this method only performs the ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"actionability"})," checks and skips the action. Defaults to ",(0,i.jsx)(t.code,{children:"false"}),". Useful to wait until the element is ready for the action without performing it. Note that keyboard ",(0,i.jsx)(t.code,{children:"modifiers"})," will be pressed regardless of ",(0,i.jsx)(t.code,{children:"trial"})," to allow testing elements which are only visible when those keys are pressed."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",title:"void",children:"void"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-hover-return"}),(0,i.jsx)("a",{href:"#frame-hover-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-inner-html",children:"innerHTML"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.innerHTML"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["Use locator-based ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-inner-html",children:"locator.innerHTML()"})," instead. Read more about ",(0,i.jsx)(t.a,{href:"/docs/locators",children:"locators"}),"."]})}),"\n",(0,i.jsxs)(t.p,{children:["Returns ",(0,i.jsx)(t.code,{children:"element.innerHTML"}),"."]}),"\n",(0,i.jsx)(t.p,
1{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.innerHTML(selector);\nawait frame.innerHTML(selector, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-inner-html-option-selector"}),(0,i.jsx)("a",{href:"#frame-inner-html-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-inner-html-option-signal"}),(0,i.jsx)("a",{href:"#frame-inner-html-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-inner-html-option-strict"}),(0,i.jsx)("a",{href:"#frame-inner-html-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-inner-html-option-timeout"}),(0,i.jsx)("a",{href:"#frame-inner-html-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"actionTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-inner-html-return"}),(0,i.jsx)("a",{href:"#frame-inner-html-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-inner-text",children:"innerText"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.innerText"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["Use locator-based ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-inner-text",children:"locator.innerText()"})," instead. Read more about ",(0,i.jsx)(t.a,{href:"/docs/locators",children:"locators"}),"."]})}),"\n",(0,i.jsxs)(t.p,{children:["Returns ",(0,i.jsx)(t.code,{children:"element.innerText"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.innerText(selector);\nawait frame.innerText(selector, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-inner-text-option-selector"}),(0,i.jsx)("a",{href:"#frame-inner-text-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-inner-text-option-signal"}),(0,i.jsx)("a",{href:"#frame-inner-text-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-inner-text-option-strict"}),(0,i.jsx)("a",{href:"#frame-inner-text-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-inner-text-option-timeout"}),(0,i.jsx)("a",{href:"#frame-inner-text-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"actionTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-inner-text-return"}),(0,i.jsx)("a",{href:"#frame-inner-text-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-input-value",children:"inputValue"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.13"}),"\n",(0,i.jsx)("x-search",{children:"frame.inputValue"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["Use locator-based ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-input-value",children:"locator.inputValue()"})," instead. Read more about ",(0,i.jsx)(t.a,{href:"/docs/locators",children:"locators"}),"."]})}),"\n",(0,i.jsxs)(t.p,{children:["Returns ",(0,i.jsx)(t.code,{children:"input.value"})," for the selected ",(0,i.jsx)(t.code,{children:"<input>"})," or ",(0,i.jsx)(t.code,{children:"<textarea>"})," or ",(0,i.jsx)(t.code,{children:"<select>"})," element."]}),"\n",(0,i.jsxs)(t.p,{children:["Throws for non-input elements. However, if the element is inside the ",(0,i.jsx)(t.code,{children:"<label>"})," element that has an associated ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control",children:"control"}),", returns the value of the control."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.inputValue(selector);\nawait frame.inputValue(selector, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-input-value-option-selector"}),(0,i.jsx)("a",{href:"#frame-input-value-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-input-value-option-signal"}),(0,i.jsx)("a",{href:"#frame-input-value-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-input-value-option-strict"}),(0,i.jsx)("a",{href:"#frame-input-value-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-input-value-option-timeout"}),(0,i.jsx)("a",{href:"#frame-input-value-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"actionTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/
1Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-input-value-return"}),(0,i.jsx)("a",{href:"#frame-input-value-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-is-checked",children:"isChecked"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.isChecked"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["Use locator-based ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-is-checked",children:"locator.isChecked()"})," instead. Read more about ",(0,i.jsx)(t.a,{href:"/docs/locators",children:"locators"}),"."]})}),"\n",(0,i.jsx)(t.p,{children:"Returns whether the element is checked. Throws if the element is not a checkbox or radio input."}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.isChecked(selector);\nawait frame.isChecked(selector, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-checked-option-selector"}),(0,i.jsx)("a",{href:"#frame-is-checked-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-checked-option-signal"}),(0,i.jsx)("a",{href:"#frame-is-checked-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-checked-option-strict"}),(0,i.jsx)("a",{href:"#frame-is-checked-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-checked-option-timeout"}),(0,i.jsx)("a",{href:"#frame-is-checked-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"actionTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-checked-return"}),(0,i.jsx)("a",{href:"#frame-is-checked-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-is-disabled",children:"isDisabled"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.isDisabled"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["Use locator-based ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-is-disabled",children:"locator.isDisabled()"})," instead. Read more about ",(0,i.jsx)(t.a,{href:"/docs/locators",children:"locators"}),"."]})}),"\n",(0,i.jsxs)(t.p,{children:["Returns whether the element is disabled, the opposite of ",(0,i.jsx)(t.a,{href:"/docs/actionability#enabled",children:"enabled"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.isDisabled(selector);\nawait frame.isDisabled(selector, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-disabled-option-selector"}),(0,i.jsx)("a",{href:"#frame-is-disabled-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-disabled-option-signal"}),(0,i.jsx)("a",{href:"#frame-is-disabled-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-disabled-option-strict"}),(0,i.jsx)("a",{href:"#frame-is-disabled-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-disabled-option-timeout"}),(0,i.jsx)("a",{href:"#frame-is-disabled-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"actionTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-disabled-return"}),(0,i.jsx)("a",{href:"#frame-is-disabled-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-is-editable",children:"isEditable"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.isEditable"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["Use locator-based ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-is-editable",children:"locator.isEditable()"})," instead. Read more about ",(0,i.jsx)(t.a,{href:"/docs/locators",children:"locators"}),"."]})}),"\n",(0,i.jsxs)(t.p,{children:["Returns whether the element is ",(0,i.jsx)(t.a,{href:"/docs/actionability#editable",children:"editable"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.isEditable(selector);\nawait frame.isEditable(selector, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-editable-option-selector"}),(0,i.jsx)("a",{href:"#frame-is-editable-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-editable-option-signal"}),(0,i.jsx)("a",{href:"#frame-is-editable-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-editable-option-strict"}),(0,i.jsx)("a",{href:"#frame-is-editable-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-editable-option-timeout"}),(0,i.jsx)("a",{href:"#frame-is-editable-option-timeout",class:"list-anchor",children:"#"})]}
1),"\n",(0,i.jsxs)(t.p,{children:["Maximum time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"actionTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-editable-return"}),(0,i.jsx)("a",{href:"#frame-is-editable-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-is-hidden",children:"isHidden"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.isHidden"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["Use locator-based ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-is-hidden",children:"locator.isHidden()"})," instead. Read more about ",(0,i.jsx)(t.a,{href:"/docs/locators",children:"locators"}),"."]})}),"\n",(0,i.jsxs)(t.p,{children:["Returns whether the element is hidden, the opposite of ",(0,i.jsx)(t.a,{href:"/docs/actionability#visible",children:"visible"}),". ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-is-hidden-option-selector",children:"selector"})," that does not match any elements is considered hidden."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.isHidden(selector);\nawait frame.isHidden(selector, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-hidden-option-selector"}),(0,i.jsx)("a",{href:"#frame-is-hidden-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-hidden-option-strict"}),(0,i.jsx)("a",{href:"#frame-is-hidden-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-hidden-option-timeout"}),(0,i.jsx)("a",{href:"#frame-is-hidden-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.admonition,{title:"Deprecated",type:"warning",children:(0,i.jsxs)(t.p,{children:["This option is ignored. ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-is-hidden",children:"frame.isHidden()"})," does not wait for the element to become hidden and returns immediately."]})}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-hidden-return"}),(0,i.jsx)("a",{href:"#frame-is-hidden-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-is-visible",children:"isVisible"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.isVisible"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["Use locator-based ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-is-visible",children:"locator.isVisible()"})," instead. Read more about ",(0,i.jsx)(t.a,{href:"/docs/locators",children:"locators"}),"."]})}),"\n",(0,i.jsxs)(t.p,{children:["Returns whether the element is ",(0,i.jsx)(t.a,{href:"/docs/actionability#visible",children:"visible"}),". ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-is-visible-option-selector",children:"selector"})," that does not match any elements is considered not visible."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.isVisible(selector);\nawait frame.isVisible(selector, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-visible-option-selector"}),(0,i.jsx)("a",{href:"#frame-is-visible-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-visible-option-strict"}),(0,i.jsx)("a",{href:"#frame-is-visible-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-visible-option-timeout"}),(0,i.jsx)("a",{href:"#frame-is-visible-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.admonition,{title:"Deprecated",type:"warning",children:(0,i.jsxs)(t.p,{children:["This option is ignored. ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-is-visible",children:"frame.isVisible()"})," does not wait for the element to become visible and returns immediately."]})}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-is-visible-return"}),(0,i.jsx)("a",{href:"#frame-is-visible-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-press",children:"press"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.press"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["Use locator-based ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-press",children:"locator.press()"})," instead. Read more about ",(0,i.jsx)(t.a,{href:"/docs/locators",children:"locators"}),"."]})}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-press-option-key",children:"key"})," can specify the intended ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key",children:"keyboardEvent.key"})," value or a single character to generate the text for. A superset of the ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-press-option-key",children:"key"})," values can be found ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values",children:"here"}),". Examples of the keys are:"]}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"F1"})," - ",(0,i.jsx)(t.code,{children:"F12"}),", ",(0,i.jsx)(t.code,{children:"Digit0"}),"- ",(0,i.jsx)(t.code,{children:"Digit9"}),", ",(0,i.jsx)(t.code,{children:"KeyA"}),"- ",(0,i.jsx)(t.code,{children:"KeyZ"}),", ",(0,i.jsx)(t.code,{children:"Backquote"}),", ",(0,i.jsx)(t.code,{children:"Minus"}),", ",(0,i.jsx)(t.code,{children:"Equal"}),", ",(0,i.jsx)(t.code,{children:"Backslash"}),", ",(0,i.jsx)(t.code,{children:"Backspace"}),", ",(0,i.jsx)(t.code,{children:"Tab"}),", ",(0,i.jsx)(t.code,{children:"Delete"}),", ",(0,i.jsx)(t.code,{children:"Escape"}),", ",(0,i.jsx)(t.code,{children:"ArrowDown"}),", ",(0,i.jsx)(t.code,{children:"End"}),", ",(0,i.jsx)(t.code,{children:"Enter"}),", ",(0,i.jsx)(t.code,{children:"Home"}),", ",(0,i.jsx)(t.code,{children:"Insert"}),", ",(0,i.jsx)(t.code,{children:"PageDown"}),", ",(0,i.jsx)(t.code,{children:"PageUp"}),", ",(0,i.jsx)(t.code,{children:"ArrowRight"}),", ",(0,i.jsx)(t.code,{children:"ArrowUp"}),", etc."]}),"\n",(0,i.jsxs)(t.p,{children:["Following modification shortcuts are also supported: ",(0,i.jsx)(t.code,{children:"Shift"}),", ",(0,i.jsx)(t.code,{children:"Control"}),", ",(0,i.jsx)(t.code,{children:"Alt"}),", ",(0,i.jsx)(t.code,{children:"Meta"}),", ",(0,i.jsx)(t.code,{children:"ShiftLeft"}),", ",(0,i.jsx)(t.code,{children:"ControlOrMeta"}),". ",(0,i.jsx)(t.code,{children:"ControlOrMeta"})," resolves to ",(0,i.jsx)(t.code,{children:"Control"})," on Windows and Linux and to ",(0,i.jsx)(t.code,{children:"Meta"})," on macOS."]}),"\n",(0,i.jsxs)(t.p,{children:["Holding down ",(0,i.jsx)(t.code,{children:"Shift"})," will type the text that corresponds to the ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-press-option-key",children:"key"})," in the upper case."]}),"\n",(0,i.jsxs)(t.p,{children:["If ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-press-option-key",children:"key"})," is a single character, it is case-sensitive, so the values ",(0,i.jsx)(t.code,{children:"a"})," and ",(0,i.jsx)(t.code,{children:"A"})," will generate different respective texts."]}),"\n",(0,i.jsxs)(t.p,{children:["Shortcuts such as ",(0,i.jsx)(t.code,{children:'key: "Control+o"'}),", ",(0,i.jsx)(t.code,{children:'key: "Control++'})," or ",(0,i.jsx)(t.code,{children:'key: "Control+Shift+T"'})," are supported as well. When specified with the modifier, modifier is pressed and being held while the subsequent key is being pressed."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.press(selector, key);\nawait frame.press(selector, key, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-press-option-selector"}),(0,i.jsx)("a",{href:"#frame-press-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"key"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-press-option-key"}),(0,i.jsx)("a",{href:"#frame-press-option-key",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Name of the key to press or a character to generate, such as ",(0,i.jsx)(t.code,{children:"ArrowLeft"})," or ",(0,i.jsx)(t.code,{children:"a"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"delay"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-press-option-delay"}),(0,i.jsx)("a",{href:"#frame-press-option-delay",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Time to wait between ",(0,i.jsx)(t.code,{children:"key
1down"})," and ",(0,i.jsx)(t.code,{children:"keyup"})," in milliseconds. Defaults to 0."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"noWaitAfter"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-press-option-no-wait-after"}),(0,i.jsx)("a",{href:"#frame-press-option-no-wait-after",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.admonition,{title:"Deprecated",type:"warning",children:(0,i.jsxs)(t.p,{children:["This option will default to ",(0,i.jsx)(t.code,{children:"true"})," in the future."]})}),"\n",(0,i.jsxs)(t.p,{children:["Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to ",(0,i.jsx)(t.code,{children:"false"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-press-option-signal"}),(0,i.jsx)("a",{href:"#frame-press-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-press-option-strict"}),(0,i.jsx)("a",{href:"#frame-press-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-press-option-timeout"}),(0,i.jsx)("a",{href:"#frame-press-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"actionTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",title:"void",children:"void"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-press-return"}),(0,i.jsx)("a",{href:"#frame-press-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-select-option",children:"selectOption"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.selectOption"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["Use locator-based ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-select-option",children:"locator.selectOption()"})," instead. Read more about ",(0,i.jsx)(t.a,{href:"/docs/locators",children:"locators"}),"."]})}),"\n",(0,i.jsxs)(t.p,{children:["This method waits for an element matching ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-select-option-option-selector",children:"selector"}),", waits for ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"actionability"})," checks, waits until all specified options are present in the ",(0,i.jsx)(t.code,{children:"<select>"})," element and selects these options."]}),"\n",(0,i.jsxs)(t.p,{children:["If the target element is not a ",(0,i.jsx)(t.code,{children:"<select>"})," element, this method throws an error. However, if the element is inside the ",(0,i.jsx)(t.code,{children:"<label>"})," element that has an associated ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control",children:"control"}),", the control will be used instead."]}),"\n",(0,i.jsx)(t.p,{children:"Returns the array of option values that have been successfully selected."}),"\n",(0,i.jsxs)(t.p,{children:["Triggers a ",(0,i.jsx)(t.code,{children:"change"})," and ",(0,i.jsx)(t.code,{children:"input"})," event once all the provided options have been selected."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"// Single selection matching the value or label\nframe.
1selectOption('select#colors', 'blue');\n\n// single selection matching both the value and the label\nframe.selectOption('select#colors', { label: 'Blue' });\n\n// multiple selection\nframe.selectOption('select#colors', 'red', 'green', 'blue');\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-select-option-option-selector"}),(0,i.jsx)("a",{href:"#frame-select-option-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to query for."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"values"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null",title:"null",children:"null"})," | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," | ",(0,i.jsx)(t.a,{href:"/docs/api/class-elementhandle",title:"ElementHandle",children:"ElementHandle"})," | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",title:"Array",children:"Array"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),"> | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",title:"Array",children:"Array"}),"<",(0,i.jsx)(t.a,{href:"/docs/api/class-elementhandle",title:"ElementHandle",children:"ElementHandle"}),"> | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",title:"Array",children:"Array"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-select-option-option-values"}),(0,i.jsx)("a",{href:"#frame-select-option-option-values",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"value"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.p,{children:["Matches by ",(0,i.jsx)(t.code,{children:"option.value"}),". Optional."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"label"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.p,{children:["Matches by ",(0,i.jsx)(t.code,{children:"option.label"}),". Optional."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"index"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsx)(t.p,{children:"Matches by the index. Optional."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(t.p,{children:["Options to select. If the ",(0,i.jsx)(t.code,{children:"<select>"})," has the ",(0,i.jsx)(t.code,{children:"multiple"})," attribute, all matching options are selected, otherwise only the first option matching one of the passed options is selected. String values are matching both values and labels. Option is considered matching if all specified properties match."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"force"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.13"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-select-option-option-force"}),(0,i.jsx)("a",{href:"#frame-select-option-option-force",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Whether to bypass the ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"actionability"})," checks. Defaults to ",(0,i.jsx)(t.code,{children:"false"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"noWaitAfter"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-select-option-option-no-wait-after"}),(0,i.jsx)("a",{href:"#frame-select-option-option-no-wait-after",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.admonition,{title:"Deprecated",type:"warning",children:(0,i.jsx)(t.p,{children:"This option has no effect."})}),"\n",(0,i.jsx)(t.p,{children:"This option has no effect."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-select-option-option-signal"}),(0,i.jsx)("a",{href:"#frame-select-option-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-select-option-option-strict"}),(0,i.jsx)("a",{href:"#frame-select-option-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-select-option-option-timeout"}),(0,i.jsx)("a",{href:"#frame-select-option-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"actionTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",title:"Array",children:"Array"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),">>",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-select-option-return"}),(0,i.jsx)("a",{href:"#frame-select-option-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-set-checked",children:"setChecked"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.15"}),"\n",(0,i.jsx)("x-search",{children:"frame.setChecked"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["Use locator-based ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-set-checked",children:"locator.setChecked()"})," instead. Read more about ",(0,i.jsx)(t.a,{href:"/docs/locators",children:"locators"}),"."]})}),"\n",(0,i.jsxs)(t.p,{children:["This method checks or unchecks an element matching ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-set-checked-option-selector",children:"selector"})," by performing the following steps:"]}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:["Find an element matching ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-set-checked-option-selector",children:"selector"}),". If there is none, wait until a matching element is attached to the DOM."]}),"\n",(0,i.jsx)(t.li,{children:"Ensure that matched element is a checkbox or a radio input. If not, this method throws."}),"\n",(0,i.jsx)(t.li,{children:"If the element already has the right checked state, this method returns immediately."}),"\n",(0,i.jsxs)(t.li,{children:["Wait for ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"actionability"})," checks on the matched element, unless ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-set-checked-option-force",children:"force"})," option is set. If the element is detached during the checks, the whole action is retried."]}),"\n",(0,i.jsx)(t.li,{children:"Scroll the element into view if needed."}),"\n",(0,i.jsxs)(t.li,{children:["Use ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-mouse",children:"page.mouse"})," to click in the center of the element."]}),"\n",(0,i.jsx)(t.li,{children:"Ensure that the element is now checked or unchecked. If not, this method throws."}),"\n"]}),"\n",(0,i.jsxs)(t.p,{children:["When all steps combined have not finished during the specified ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-set-checked-option-timeout",children:"timeout"}),", this method throws a ",(0,i.jsx)(t.a,{href:"/docs/api/class-timeouterror",title:"TimeoutError",children:"TimeoutError"}),". Passing zero timeout disables this."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.setChecked(selector, checked);\nawait frame.setChecked(selector, checked, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-set-checked-option-selector"}),(0,i.jsx)("a",{href:"#frame-set-checked-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"checked"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-set-checked-option-checked"}),(0,i.jsx)("a",{href:"#frame-set-checked-option-checked",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Whether to check or uncheck the checkbox."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"force"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-set-checked-option-force"}),(0,i.jsx)("a",{href:"#frame-set-checked-option-force",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Whether to bypass the ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"actionability"})," checks. Defaults to ",(0,i.jsx)(t.code,{children:"false"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"noWaitAfter"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-set-checked-option-no-wait-after"}),(0,i.jsx)("a",{href:"#frame-set-checked-option-no-wait-after",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.admonition,{title:"Deprecated",type:"warning",children:(0,i.jsx)(t.p,{children:"This option has no effect."})}),"\n",(0,i.jsx)(t.p,{children:"This option has no effect."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"position"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-set-checked-option-position"}),(0,i.jsx)("a",{href:"#frame-set-checked-option-position",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"x"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)
1(t.p,{children:[(0,i.jsx)(t.code,{children:"y"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"scroll"}),' "auto" | "none" ',(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-set-checked-option-scroll"}),(0,i.jsx)("a",{href:"#frame-set-checked-option-scroll",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Controls whether Playwright scrolls the element into view before performing the action. Defaults to ",(0,i.jsx)(t.code,{children:'"auto"'}),", which scrolls the element into view when necessary, including scrolling nested scrollable containers. When set to ",(0,i.jsx)(t.code,{children:'"none"'}),", Playwright does not scroll the element and the action fails if the element is not already in the viewport. This is useful to assert that an element is reachable by the user without additional scrolling."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-set-checked-option-signal"}),(0,i.jsx)("a",{href:"#frame-set-checked-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-set-checked-option-strict"}),(0,i.jsx)("a",{href:"#frame-set-checked-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-set-checked-option-timeout"}),(0,i.jsx)("a",{href:"#frame-set-checked-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"actionTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"trial"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-set-checked-option-trial"}),(0,i.jsx)("a",{href:"#frame-set-checked-option-trial",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["When set, this method only performs the ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"actionability"})," checks and skips the action. Defaults to ",(0,i.jsx)(t.code,{children:"false"}),". Useful to wait until the element is ready for the action without performing it."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",title:"void",children:"void"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-set-checked-return"}),(0,i.jsx)("a",{href:"#frame-set-checked-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-set-input-files",children:"setInputFiles"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.setInputFiles"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["Use locator-based ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-set-input-files",children:"locator.setInputFiles()"})," instead. Read more about ",(0,i.jsx)(t.a,{href:"/docs/locators",children:"locators"}),"."]})}),"\n",(0,i.jsxs)(t.p,{children:["Sets the value of the file input to these file paths or files. If some of the ",(0,i.jsx)(t.code,{children:"filePaths"})," are relative paths, then they are resolved relative to the current working directory. For empty array, clears the selected files."]}),"\n",(0,i.jsxs)(t.p,{children:["This method expects ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-set-input-files-option-selector",children:"selector"})," to point to an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input",children:"input element"}),". However, if the element is inside the ",(0,i.jsx)(t.code,{children:"<label>"})," element that has an associated ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control",children:"control"}),", targets the control instead."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.setInputFiles(selector, files);\nawait frame.setInputFiles(selector, files, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-set-input-files-option-selector"}),(0,i.jsx)("a",{href:"#frame-set-input-files-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"files"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",title:"Array",children:"Array"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),"> | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",title:"Array",children:"Array"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-set-input-files-option-files"}),(0,i.jsx)("a",{href:"#frame-set-input-files-option-files",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"name"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})]}),"\n",(0,i.jsx)(t.p,{children:"File name"}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"mimeType"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})]}),"\n",(0,i.jsx)(t.p,{children:"File type"}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"buffer"})," ",(0,i.jsx)(t.a,{href:"https://nodejs.org/api/buffer.html#buffer_class_buffer",title:"Buffer",children:"Buffer"})]}),"\n",(0,i.jsx)(t.p,{children:"File content"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"noWaitAfter"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-set-input-files-option-no-wait-after"}),(0,i.jsx)("a",{href:"#frame-set-input-files-option-no-wait-after",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.admonition,{title:"Deprecated",type:"warning",children:(0,i.jsx)(t.p,{children:"This option has no effect."})}),"\n",(0,i.jsx)(t.p,{children:"This option has no effect."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-set-input-files-option-signal"}),(0,i.jsx)("a",{href:"#frame-set-input-files-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-set-input-files-option-strict"}),(0,i.jsx)("a",{href:"#frame-set-input-files-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-set-input-files-option-timeout"}),(0,i.jsx)("a",{href:"#frame-set-input-files-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"actionTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",title:"void",children:"void"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-set-input-files-return"}),(0,i.jsx)("a",{href:"#frame-set-input-files-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-tap",children:"tap"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}
1),"\n",(0,i.jsx)("x-search",{children:"frame.tap"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["Use locator-based ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-tap",children:"locator.tap()"})," instead. Read more about ",(0,i.jsx)(t.a,{href:"/docs/locators",children:"locators"}),"."]})}),"\n",(0,i.jsxs)(t.p,{children:["This method taps an element matching ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-tap-option-selector",children:"selector"})," by performing the following steps:"]}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:["Find an element matching ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-tap-option-selector",children:"selector"}),". If there is none, wait until a matching element is attached to the DOM."]}),"\n",(0,i.jsxs)(t.li,{children:["Wait for ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"actionability"})," checks on the matched element, unless ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-tap-option-force",children:"force"})," option is set. If the element is detached during the checks, the whole action is retried."]}),"\n",(0,i.jsx)(t.li,{children:"Scroll the element into view if needed."}),"\n",(0,i.jsxs)(t.li,{children:["Use ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-touchscreen",children:"page.touchscreen"})," to tap the center of the element, or the specified ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-tap-option-position",children:"position"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.p,{children:["When all steps combined have not finished during the specified ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-tap-option-timeout",children:"timeout"}),", this method throws a ",(0,i.jsx)(t.a,{href:"/docs/api/class-timeouterror",title:"TimeoutError",children:"TimeoutError"}),". Passing zero timeout disables this."]}),"\n",(0,i.jsx)(t.admonition,{type:"note",children:(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"frame.tap()"})," requires that the ",(0,i.jsx)(t.code,{children:"hasTouch"})," option of the browser context be set to true."]})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.tap(selector);\nawait frame.tap(selector, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-tap-option-selector"}),(0,i.jsx)("a",{href:"#frame-tap-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"force"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-tap-option-force"}),(0,i.jsx)("a",{href:"#frame-tap-option-force",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Whether to bypass the ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"actionability"})," checks. Defaults to ",(0,i.jsx)(t.code,{children:"false"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"modifiers"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",title:"Array",children:"Array"}),'<"Alt" | "Control" | "ControlOrMeta" | "Meta" | "Shift"> ',(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-tap-option-modifiers"}),(0,i.jsx)("a",{href:"#frame-tap-option-modifiers",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:'Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current modifiers back. If not specified, currently pressed modifiers are used. "ControlOrMeta" resolves to "Control" on Windows and Linux and to "Meta" on macOS.'}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"noWaitAfter"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-tap-option-no-wait-after"}),(0,i.jsx)("a",{href:"#frame-tap-option-no-wait-after",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.admonition,{title:"Deprecated",type:"warning",children:(0,i.jsx)(t.p,{children:"This option has no effect."})}),"\n",(0,i.jsx)(t.p,{children:"This option has no effect."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"position"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-tap-option-position"}),(0,i.jsx)("a",{href:"#frame-tap-option-position",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"x"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"y"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"scroll"}),' "auto" | "none" ',(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-tap-option-scroll"}),(0,i.jsx)("a",{href:"#frame-tap-option-scroll",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Controls whether Playwright scrolls the element into view before performing the action. Defaults to ",(0,i.jsx)(t.code,{children:'"auto"'}),", which scrolls the element into view when necessary, including scrolling nested scrollable containers. When set to ",(0,i.jsx)(t.code,{children:'"none"'}),", Playwright does not scroll the element and the action fails if the element is not already in the viewport. This is useful to assert that an element is reachable by the user without additional scrolling."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-tap-option-signal"}),(0,i.jsx)("a",{href:"#frame-tap-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-tap-option-strict"}),(0,i.jsx)("a",{href:"#frame-tap-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-tap-option-timeout"}),(0,i.jsx)("a",{href:"#frame-tap-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"actionTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"trial"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.11"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-tap-option-trial"}),(0,i.jsx)("a",{href:"#frame-tap-option-trial",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["When set, this method only performs the ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"actionability"})," checks and skips the action. Defaults to ",(0,i.jsx)(t.code,{children:"false"}),". Useful to wait until the element is ready for the action without performing it. Note that keyboard ",(0,i.jsx)(t.code,{children:"modifiers"})," will be pressed regardless of ",(0,i.jsx)(t.code,{children:"trial"})," to allow testing elements which are only visible when those keys are pressed."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",title:"void",children:"void"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-tap-return"}),(0,i.jsx)("a",{href:"#frame-tap-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-text-content",children:"textContent"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.textContent"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["Use locator-based ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-text-content",children:"locator.textContent()"})," instead. Read more about ",(0,i.jsx)(t.a,{href:"/docs/locators",children:"locators"}),"."]})}),"\n",(0,i.jsxs)(t.p,{children:["Returns ",(0,i.jsx)(t.code,{children:"element.textContent"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.textContent(selector);\nawait frame.textContent(selector, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-text-content-option-selector"}),(0,i.jsx)("a",{href:"#frame-text-content-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-text-content-option-signal"}),(0,i.jsx)("a",{href:"#frame-text-content-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-text-content-option-strict"}),(0,i.jsx)("a",{href:"#frame-text-content-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selec
1tor to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-text-content-option-timeout"}),(0,i.jsx)("a",{href:"#frame-text-content-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"actionTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null",title:"null",children:"null"})," | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-text-content-return"}),(0,i.jsx)("a",{href:"#frame-text-content-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-type",children:"type"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.type"}),"\n",(0,i.jsx)(t.admonition,{title:"Deprecated",type:"warning",children:(0,i.jsxs)(t.p,{children:["In most cases, you should use ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-fill",children:"locator.fill()"})," instead. You only need to press keys one by one if there is special keyboard handling on the page - in this case use ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-press-sequentially",children:"locator.pressSequentially()"}),"."]})}),"\n",(0,i.jsxs)(t.p,{children:["Sends a ",(0,i.jsx)(t.code,{children:"keydown"}),", ",(0,i.jsx)(t.code,{children:"keypress"}),"/",(0,i.jsx)(t.code,{children:"input"}),", and ",(0,i.jsx)(t.code,{children:"keyup"})," event for each character in the text. ",(0,i.jsx)(t.code,{children:"frame.type"})," can be used to send fine-grained keyboard events. To fill values in form fields, use ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-fill",children:"frame.fill()"}),"."]}),"\n",(0,i.jsxs)(t.p,{children:["To press a special key, like ",(0,i.jsx)(t.code,{children:"Control"})," or ",(0,i.jsx)(t.code,{children:"ArrowDown"}),", use ",(0,i.jsx)(t.a,{href:"/docs/api/class-keyboard#keyboard-press",children:"keyboard.press()"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-type-option-selector"}),(0,i.jsx)("a",{href:"#frame-type-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"text"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-type-option-text"}),(0,i.jsx)("a",{href:"#frame-type-option-text",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A text to type into a focused element."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"delay"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-type-option-delay"}),(0,i.jsx)("a",{href:"#frame-type-option-delay",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"Time to wait between key presses in milliseconds. Defaults to 0."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"noWaitAfter"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-type-option-no-wait-after"}),(0,i.jsx)("a",{href:"#frame-type-option-no-wait-after",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.admonition,{title:"Deprecated",type:"warning",children:(0,i.jsx)(t.p,{children:"This option has no effect."})}),"\n",(0,i.jsx)(t.p,{children:"This option has no effect."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-type-option-signal"}),(0,i.jsx)("a",{href:"#frame-type-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-type-option-strict"}),(0,i.jsx)("a",{href:"#frame-type-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-type-option-timeout"}),(0,i.jsx)("a",{href:"#frame-type-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"actionTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",title:"void",children:"void"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-type-return"}),(0,i.jsx)("a",{href:"#frame-type-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-uncheck",children:"uncheck"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.uncheck"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["Use locator-based ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-uncheck",children:"locator.uncheck()"})," instead. Read more about ",(0,i.jsx)(t.a,{href:"/docs/locators",children:"locators"}),"."]})}),"\n",(0,i.jsxs)(t.p,{children:["This method checks an element matching ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-uncheck-option-selector",children:"selector"})," by performing the following steps:"]}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:["Find an element matching ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-uncheck-option-selector",children:"selector"}),". If there is none, wait until a matching element is attached to the DOM."]}),"\n",(0,i.jsx)(t.li,{children:"Ensure that matched element is a checkbox or a radio input. If not, this method throws. If the element is already unchecked, this method returns immediately."}),"\n",(0,i.jsxs)(t.li,{children:["Wait for ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"actionability"})," checks on the matched element, unless ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-uncheck-option-force",children:"force"})," option is set. If the element is detached during the checks, the whole action is retried."]}),"\n",(0,i.jsx)(t.li,{children:"Scroll the element into view if needed."}),"\n",(0,i.jsxs)(t.li,{children:["Use ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-mouse",children:"page.mouse"})," to click in the center of the element."]}),"\n",(0,i.jsx)(t.li,{children:"Ensure that the element is now unchecked. If not, this method throws."}),"\n"]}),"\n",(0,i.jsxs)(t.p,{children:["When all steps combined have not finished during the specified ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-uncheck-option-timeout",children:"timeout"}),", this method throws a ",(0,i.jsx)(t.a,{href:"/docs/api/class-timeouterror",title:"TimeoutError",children:"TimeoutError"}),". Passing zero timeout disables this."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.uncheck(selector);\nawait frame.uncheck(selector, options);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-uncheck-option-selector"}),(0,i.jsx)("a",{href:"#frame-uncheck-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"force"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-uncheck-option-force"}),(0,i.jsx)("a",{href:"#frame-uncheck-option-force",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Whether to bypass the ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"actionability"})," checks. Defaults to ",(0,i.jsx)(t.code,{children:"false"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"noWaitAfter"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-uncheck-option-no-wait-after"}),(0,i.jsx)("a",{href:"#frame-uncheck-option-no-wait-after",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.admonition,{title:"Deprecated",type:"warning",children:(0,i.jsx)(t.p,{children:"This option has no effect."})}),"\n",(0,i.jsx)(t.p,{children:"This option has no effect."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"position"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.11"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-uncheck-option-position"}),(0,i.jsx)("a",{href:"#frame-uncheck-option-position",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"x"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"y"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"scroll"}),' "auto" | "none" ',(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added
1in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-uncheck-option-scroll"}),(0,i.jsx)("a",{href:"#frame-uncheck-option-scroll",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Controls whether Playwright scrolls the element into view before performing the action. Defaults to ",(0,i.jsx)(t.code,{children:'"auto"'}),", which scrolls the element into view when necessary, including scrolling nested scrollable containers. When set to ",(0,i.jsx)(t.code,{children:'"none"'}),", Playwright does not scroll the element and the action fails if the element is not already in the viewport. This is useful to assert that an element is reachable by the user without additional scrolling."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-uncheck-option-signal"}),(0,i.jsx)("a",{href:"#frame-uncheck-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-uncheck-option-strict"}),(0,i.jsx)("a",{href:"#frame-uncheck-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-uncheck-option-timeout"}),(0,i.jsx)("a",{href:"#frame-uncheck-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"actionTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"trial"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.11"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-uncheck-option-trial"}),(0,i.jsx)("a",{href:"#frame-uncheck-option-trial",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["When set, this method only performs the ",(0,i.jsx)(t.a,{href:"/docs/actionability",children:"actionability"})," checks and skips the action. Defaults to ",(0,i.jsx)(t.code,{children:"false"}),". Useful to wait until the element is ready for the action without performing it."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",title:"void",children:"void"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-uncheck-return"}),(0,i.jsx)("a",{href:"#frame-uncheck-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-wait-for-navigation",children:"waitForNavigation"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.waitForNavigation"}),"\n",(0,i.jsx)(t.admonition,{title:"Deprecated",type:"warning",children:(0,i.jsxs)(t.p,{children:["This method is inherently racy, please use ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-wait-for-url",children:"frame.waitForURL()"})," instead."]})}),"\n",(0,i.jsxs)(t.p,{children:["Waits for the frame navigation and returns the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect. In case of navigation to a different anchor or navigation due to History API usage, the navigation will resolve with ",(0,i.jsx)(t.code,{children:"null"}),"."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.p,{children:"This method waits for the frame to navigate to a new URL. It is useful for when you run code which will indirectly cause the frame to navigate. Consider this example:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"// Start waiting for navigation before clicking. Note no await.\nconst navigationPromise = page.waitForNavigation();\nawait page.getByText('Navigate after timeout').click();\nawait navigationPromise;\n"})}),"\n",(0,i.jsx)(t.admonition,{type:"note",children:(0,i.jsxs)(t.p,{children:["Usage of the ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/History_API",children:"History API"})," to change the URL is considered a navigation."]})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-navigation-option-signal"}),(0,i.jsx)("a",{href:"#frame-wait-for-navigation-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the waiting using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the waiting will be aborted and the operation will throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-navigation-option-timeout"}),(0,i.jsx)("a",{href:"#frame-wait-for-navigation-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum operation time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"navigationTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-navigation-timeout",children:"browserContext.setDefaultNavigationTimeout()"}),", ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"}),", ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-navigation-timeout",children:"page.setDefaultNavigationTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"url"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})," | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",title:"RegExp",children:"RegExp"})," | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/URLPattern",title:"URLPattern",children:"URLPattern"})," | ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",title:"Function",children:"function"}),"(",(0,i.jsx)(t.a,{href:"https://nodejs.org/api/url.html",title:"URL",children:"URL"}),"):",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-navigation-option-url"}),(0,i.jsx)("a",{href:"#frame-wait-for-navigation-option-url",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["A glob pattern, regex pattern, URL pattern, or predicate receiving ",(0,i.jsx)(t.a,{href:"https://nodejs.org/api/url.html",title:"URL",children:"URL"})," to match while waiting for the navigation. Note that if the parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to the string."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"waitUntil"}),' "load" | "domcontentloaded" | "networkidle" | "commit" ',(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-navigation-option-wait-until"}),(0,i.jsx)("a",{href:"#frame-wait-for-navigation-option-wait-until",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["When to consider operation succeeded, defaults to ",(0,i.jsx)(t.code,{children:"load"}),". Events can be either:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"'domcontentloaded'"})," - consider operation to be finished when the ",(0,i.jsx)(t.code,{children:"DOMContentLoaded"})," event is fired."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"'load'"})," - consider operation to be finished when the ",(0,i.jsx)(t.code,{children:"load"})," event is fired."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"'networkidle'"})," - ",(0,i.jsx)(t.strong,{children:"DISCOURAGED"})," consider operation to be finished when there are no network connections for at least ",(0,i.jsx)(t.code,{children:"500"})," ms. Don't use this method for testing, rely on web assertions to assess readiness instead."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"'commit'"})," - consider operation to be finished when network response is received and the document started loading."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null",title:"null",children:"null"})," | ",(0,i.jsx)(t.a,{href:"/docs/api/class-response",title:"Response",children:"Response"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-navigation-return"}),(0,i.jsx)("a",{href:"#frame-wait-for-navigation-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-wait-for-selector",children:"waitForSelector"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.waitForSelector"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["Use web assertions that assert visibility or a locator-based ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator#locator-wait-for",children:"locator.waitFor()"})," instead. Read more about ",(0,i.jsx)(t.a,{href:"/docs/locators",children:"locators"}),"."]})}),"\n",(0,i.jsxs)(t.p,{children:["Returns when element specified by selector satisfies ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-wait-for-selector-option-state",children:"state"})," option. Returns ",(0,i.jsx)(t.code,{children:"null"})," if waiting for ",(0,i.jsx)(t.code,{children:"hidden"})," or ",(0,i.jsx)(t.code,{children:"detached"}),"."]}),"\n",(0,i.jsx)(t.admonition,{type:"note",children:(0,i.jsxs)(t.p,{children:["Playwright automatically waits for element to be ready before performing an action. Using ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator",title:"Locator",children:"Locator"})," objects and web-first assertions make the code wait-for-selector-free."]})}),"\n",(0,i.jsxs)(t.p,{children:["Wait for the ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-wait-for-selector-option-selector",children:"selector"})," to satisfy ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-wait-for-selector-option-state",children:"state"})," option (either appear/disappear from dom, or become visible/hidden). If at the moment of calling the method ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-wait-for-selector-option-selector",children:"selector"})," already satisfies the condition, the method will return immediately. If the selector doesn't satisfy the condition for the ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-wait-for-selector-option-timeout",children:"timeout"})," milliseconds, the function will throw."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.p,{children:"This method works across navigations:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"const { chromium } = require('playwright'); // Or 'firefox' or 'webkit'.\n\n(async () => {\n const browser = await chromium.launch();\n const page = await browser.newPage();\n for (const currentURL of ['https://google.com', 'https://bbc.com']) {
1\n await page.goto(currentURL);\n const element = await page.mainFrame().waitForSelector('img');\n console.log('Loaded image: ' + await element.getAttribute('src'));\n }\n await browser.close();\n})();\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"selector"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-selector-option-selector"}),(0,i.jsx)("a",{href:"#frame-wait-for-selector-option-selector",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A selector to query for."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"options"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",title:"Object",children:"Object"})," ",(0,i.jsx)(t.em,{children:"(optional)"})]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"signal"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",title:"AbortSignal",children:"AbortSignal"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.62"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-selector-option-signal"}),(0,i.jsx)("a",{href:"#frame-wait-for-selector-option-signal",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Allows to cancel the operation using an ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",children:(0,i.jsx)(t.code,{children:"AbortSignal"})}),". If the signal is aborted, the operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, which can be changed using ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"}),"; pass ",(0,i.jsx)(t.code,{children:"timeout: 0"})," to disable the timeout entirely."]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"state"}),' "attached" | "detached" | "visible" | "hidden" ',(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-selector-option-state"}),(0,i.jsx)("a",{href:"#frame-wait-for-selector-option-state",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Defaults to ",(0,i.jsx)(t.code,{children:"'visible'"}),". Can be either:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"'attached'"})," - wait for element to be present in DOM."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"'detached'"})," - wait for element to not be present in DOM."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"'visible'"})," - wait for element to have non-empty bounding box and no ",(0,i.jsx)(t.code,{children:"visibility:hidden"}),". Note that element without any content or with ",(0,i.jsx)(t.code,{children:"display:none"})," has an empty bounding box and is not considered visible."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"'hidden'"})," - wait for element to be either detached from DOM, or have an empty bounding box or ",(0,i.jsx)(t.code,{children:"visibility:hidden"}),". This is opposite to the ",(0,i.jsx)(t.code,{children:"'visible'"})," option."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"strict"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type",title:"Boolean",children:"boolean"})," ",(0,i.jsx)(t.em,{children:"(optional)"})," ",(0,i.jsx)("font",{size:"2",children:"Added in: v1.14"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-selector-option-strict"}),(0,i.jsx)("a",{href:"#frame-wait-for-selector-option-strict",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"When true, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception."}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"})," ",(0,i.jsx)(t.em,{children:"(optional)"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-selector-option-timeout"}),(0,i.jsx)("a",{href:"#frame-wait-for-selector-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsxs)(t.p,{children:["Maximum time in milliseconds. Defaults to ",(0,i.jsx)(t.code,{children:"0"})," - no timeout. The default value can be changed via ",(0,i.jsx)(t.code,{children:"actionTimeout"})," option in the config, or by using the ",(0,i.jsx)(t.a,{href:"/docs/api/class-browsercontext#browser-context-set-default-timeout",children:"browserContext.setDefaultTimeout()"})," or ",(0,i.jsx)(t.a,{href:"/docs/api/class-page#page-set-default-timeout",children:"page.setDefaultTimeout()"})," methods."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null",title:"null",children:"null"})," | ",(0,i.jsx)(t.a,{href:"/docs/api/class-elementhandle",title:"ElementHandle",children:"ElementHandle"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-selector-return"}),(0,i.jsx)("a",{href:"#frame-wait-for-selector-return",class:"list-anchor",children:"#"})]}),"\n"]}),"\n",(0,i.jsx)(t.hr,{}),"\n",(0,i.jsx)(t.h3,{id:"frame-wait-for-timeout",children:"waitForTimeout"}),"\n",(0,i.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added before v1.9"}),"\n",(0,i.jsx)("x-search",{children:"frame.waitForTimeout"}),"\n",(0,i.jsx)(t.admonition,{title:"Discouraged",type:"warning",children:(0,i.jsxs)(t.p,{children:["Never wait for timeout in production. Tests that wait for time are inherently flaky. Use ",(0,i.jsx)(t.a,{href:"/docs/api/class-locator",title:"Locator",children:"Locator"})," actions and web assertions that wait automatically."]})}),"\n",(0,i.jsxs)(t.p,{children:["Waits for the given ",(0,i.jsx)(t.a,{href:"/docs/api/class-frame#frame-wait-for-timeout-option-timeout",children:"timeout"})," in milliseconds."]}),"\n",(0,i.jsxs)(t.p,{children:["Note that ",(0,i.jsx)(t.code,{children:"frame.waitForTimeout()"})," should only be used for debugging. Tests using the timer in production are going to be flaky. Use signals such as network events, selectors becoming visible and others instead."]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Usage"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-js",children:"await frame.waitForTimeout(timeout);\n"})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Arguments"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"timeout"})," ",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type",title:"Number",children:"number"}),(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-timeout-option-timeout"}),(0,i.jsx)("a",{href:"#frame-wait-for-timeout-option-timeout",class:"list-anchor",children:"#"})]}),"\n",(0,i.jsx)(t.p,{children:"A timeout to wait for"}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.strong,{children:"Returns"})}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",title:"Promise",children:"Promise"}),"<",(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",title:"void",children:"void"}),">",(0,i.jsx)("a",{"aria-hidden":"true",tabIndex:"-1",class:"list-anchor-link",id:"frame-wait-for-timeout-return"}),(0,i.jsx)("a",{href:"#frame-wait-for-timeout-return",class:"list-anchor",children:"#"})]}),"\n"]})]})}function h(e={}){let{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}}}]);
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.