[{"data":1,"prerenderedAt":469},["ShallowReactive",2],{"SiteFooter_cLEacilcm59lTjFJjLY6mXNWLL0ETtzOIiZwIHgDpy0":3,"doc-\u002Fdocs\u002Fhttp\u002Fwaiting":17,"docs-nav":317,"nav-compare":455,"editor-zftxkl":465,"editor-45mkrd":467},["Island",4],{"key":5,"result":6},"SiteFooter_cLEacilcm59lTjFJjLY6mXNWLL0ETtzOIiZwIHgDpy0",{"head":7},{"style":8},[9,11,13,15],{"innerHTML":10},".site-footer[data-v-8bb1d4ae]{border-top:1px solid var(--line);background:var(--chrome);padding:var(--sp-8) var(--gutter) var(--sp-10);gap:var(--sp-6);flex-direction:column;display:flex}.links[data-v-8bb1d4ae]{gap:var(--sp-4);grid-template-columns:repeat(auto-fit,minmax(15rem,1fr));max-width:62rem;display:grid}.links a[data-v-8bb1d4ae]{align-items:flex-start;gap:var(--sp-3);padding:var(--sp-3);border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--panel);color:var(--ink);border-bottom:1px solid var(--line);display:flex}.links a[data-v-8bb1d4ae]:focus-visible,.links a[data-v-8bb1d4ae]:hover{border-color:var(--line-strong)}.links[data-v-8bb1d4ae] .mark,.links[data-v-8bb1d4ae] .rf-mark{width:1.35rem;height:1.35rem;color:var(--dim);flex:none;margin-top:.1rem}.links a[data-v-8bb1d4ae]:hover .mark,.links a[data-v-8bb1d4ae]:hover .rf-mark{color:var(--red)}.links span[data-v-8bb1d4ae]{flex-direction:column;gap:2px;min-width:0;display:flex}.links b[data-v-8bb1d4ae]{font-family:var(--font-display);font-size:.85rem;font-weight:400}.links small[data-v-8bb1d4ae]{color:var(--faint);font-size:.78rem}.colophon[data-v-8bb1d4ae]{color:var(--faint);margin:0;font-size:.75rem}@supports (corner-shape:bevel){.links a[data-v-8bb1d4ae]{corner-shape:bevel}}",{"innerHTML":12},".mark[data-v-cc0d96a5]{vertical-align:-.125em;flex:none;width:1em;height:1em}",{"innerHTML":14},".mark[data-v-26f5673d]{vertical-align:-.125em;flex:none;width:1em;height:1em}",{"innerHTML":16},".rf-mark[data-v-26317b3e]{fill:currentColor;stroke:none;flex:none}",{"id":18,"title":19,"body":20,"description":308,"extension":309,"meta":310,"navigation":311,"order":87,"path":312,"section":313,"seo":314,"stem":315,"__hash__":316},"docs\u002Fdocs\u002Fhttp\u002Fwaiting.md","Waiting for traffic",{"type":21,"value":22,"toc":302},"minimark",[23,50,55,62,97,105,109,115,135,166,170,277,281,298],[24,25,26,34,35,41,42,45,46,49],"p",{},[27,28,30],"a",{"href":29},"\u002Fkeywords#wait-for-request",[31,32,33],"code",{},"Wait For Request"," returns the first request of the\npage that matches, ",[27,36,38],{"href":37},"\u002Fkeywords#wait-for-response",[31,39,40],{},"Wait For Response"," the first\nresponse. Both see page traffic, ",[31,43,44],{},"HTTP"," included, but not ",[31,47,48],{},"Send API Request",".",[51,52,54],"h2",{"id":53},"start-the-wait-first","Start the wait first",[24,56,57,58,61],{},"A wait sees only what happens after it starts, and the request usually fires during\nthe action. Start the wait with ",[31,59,60],{},"Promise To",", act, then collect the result:",[63,64,69],"pre",{"className":65,"code":66,"language":67,"meta":68,"style":68},"language-robot shiki shiki-themes github-light github-dark","${promise} =    Promise To    Wait For Response    **\u002Fapi\u002Flogin\nClick    id=login-button\n${response} =    Wait For    ${promise}\nShould Be Equal    ${response.json.user}    demo\n","robot","",[31,70,71,79,85,91],{"__ignoreMap":68},[72,73,76],"span",{"class":74,"line":75},"line",1,[72,77,78],{},"${promise} =    Promise To    Wait For Response    **\u002Fapi\u002Flogin\n",[72,80,82],{"class":74,"line":81},2,[72,83,84],{},"Click    id=login-button\n",[72,86,88],{"class":74,"line":87},3,[72,89,90],{},"${response} =    Wait For    ${promise}\n",[72,92,94],{"class":74,"line":93},4,[72,95,96],{},"Should Be Equal    ${response.json.user}    demo\n",[24,98,99,100,104],{},"See ",[27,101,103],{"href":102},"\u002Fdocs\u002Fconcepts\u002Fwaiting#promises","Promises"," for how they work.",[51,106,108],{"id":107},"what-they-return","What they return",[110,111],"doc-table",{":head":112,":nowrap":113,":rows":114},"[\"Keyword\",\"Returns\",\"Main keys\"]","[0,1]","[[\"`Wait For Request`\",\"[`CapturedRequest`](\u002Fkeywords#type--capturedrequest)\",\"`url`, `method`, `headers`, `allHeaders` with `cookie`, `postDataBuffer` (raw body), `postDataJSON`, `resourceType`\"],[\"`Wait For Response`\",\"[`CapturedResponse`](\u002Fkeywords#type--capturedresponse)\",\"`status`, `headers`, `allHeaders` with `set-cookie`, `bytes`, `text`, `json`, `request`\"]]",[24,116,117,118,121,122,125,126,129,130,134],{},"The body is raw ",[31,119,120],{},"bytes"," with the views ",[31,123,124],{},"text"," and ",[31,127,128],{},"json",", as for the\n",[27,131,133],{"href":132},"\u002Fdocs\u002Fhttp\u002Foverview#responses","other responses",". To save it or to mock with it:",[63,136,138],{"className":65,"code":137,"language":67,"meta":68,"style":68},"${logo} =    Promise To    Wait For Response    **\u002Flogo.png\nGo To    ${APP_URL}\n${response} =    Wait For    ${logo}\nCreate Binary File    ${OUTPUT_DIR}\u002Flogo.png    ${response.bytes}\nMock Responses    **\u002Flogo.png    body=${response.bytes}\n",[31,139,140,145,150,155,160],{"__ignoreMap":68},[72,141,142],{"class":74,"line":75},[72,143,144],{},"${logo} =    Promise To    Wait For Response    **\u002Flogo.png\n",[72,146,147],{"class":74,"line":81},[72,148,149],{},"Go To    ${APP_URL}\n",[72,151,152],{"class":74,"line":87},[72,153,154],{},"${response} =    Wait For    ${logo}\n",[72,156,157],{"class":74,"line":93},[72,158,159],{},"Create Binary File    ${OUTPUT_DIR}\u002Flogo.png    ${response.bytes}\n",[72,161,163],{"class":74,"line":162},5,[72,164,165],{},"Mock Responses    **\u002Flogo.png    body=${response.bytes}\n",[51,167,169],{"id":168},"arguments","Arguments",[171,172,173,204,215,241],"ul",{},[174,175,176,182,183,187,188,194,195,200,201,49],"li",{},[177,178,179],"strong",{},[31,180,181],{},"matcher"," follows the ",[27,184,186],{"href":185},"\u002Fdocs\u002Fhttp\u002Foverview#matchers","shared rules",". Empty\nmatches the first request or response. A function gets Playwright's\n",[27,189,193],{"href":190,"rel":191},"https:\u002F\u002Fplaywright.dev\u002Fdocs\u002Fapi\u002Fclass-request",[192],"nofollow","Request"," or\n",[27,196,199],{"href":197,"rel":198},"https:\u002F\u002Fplaywright.dev\u002Fdocs\u002Fapi\u002Fclass-response",[192],"Response",":\n",[31,202,203],{},"response => response.status() === 500",[174,205,206,211,212,214],{},[177,207,208],{},[31,209,210],{},"timeout"," defaults to the library timeout. For ",[31,213,40],{}," it also\ncovers reading the body.",[174,216,217,222,223,227,228,230,231,125,234,237,238,49],{},[177,218,219],{},[31,220,221],{},"wait_for_all_fields=True"," ",[224,225],"since",{"version":226},"21.1.0"," (",[31,229,33],{},")\nalso waits for ",[31,232,233],{},"allHeaders",[31,235,236],{},"headersArray",". Chromium and WebKit report them\nonly when the response headers arrive, so by default they are ",[31,239,240],{},"None",[174,242,243,222,248,227,250,252,253,256,257,256,259,125,261,263,264,266,267,256,270,125,273,276],{},[177,244,245],{},[31,246,247],{},"include_body=False",[224,249],{"version":226},[31,251,40],{},") does not\nread the body, for a large or endless one. ",[31,254,255],{},"body",", ",[31,258,120],{},[31,260,124],{},[31,262,128],{}," are\nthen ",[31,265,240],{},", and so are ",[31,268,269],{},"httpVersion",[31,271,272],{},"serverAddr",[31,274,275],{},"securityDetails",", which\nsome browsers report only after the body.",[51,278,280],{"id":279},"logging","Logging",[24,282,283,284,286,287,289,290,293,294,297],{},"Requests and responses are logged without their body. ",[31,285,233],{}," and\n",[31,288,236],{}," are logged at ",[31,291,292],{},"DEBUG"," level, because they can hold cookies. The body\nis logged at ",[31,295,296],{},"TRACE"," level: as JSON, as text, or as base64.",[299,300,301],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":68,"searchDepth":81,"depth":81,"links":303},[304,305,306,307],{"id":53,"depth":81,"text":54},{"id":107,"depth":81,"text":108},{"id":168,"depth":81,"text":169},{"id":279,"depth":81,"text":280},"Wait For Request and Wait For Response wait for a request or response of the page and return what was sent and received. Start the wait before the action, with Promise To.","md",{},true,"\u002Fdocs\u002Fhttp\u002Fwaiting","http",{"title":19,"description":308},"docs\u002Fhttp\u002Fwaiting","Qq6CS1EOsWbj2RXariSGusLqS1v7ZAlaSLS-kgSwc-8",[318,323,327,331,336,340,344,349,353,357,361,365,369,373,377,381,382,387,391,395,399,404,408,412,416,421,425,430,434,438,442,446,451],{"path":319,"title":320,"description":321,"section":322,"order":162},"\u002Fdocs\u002Fconcepts\u002Farchitecture","How Browser works","Python, a Node process and Playwright — what runs where, and where the files land.","concepts",{"path":324,"title":325,"description":326,"section":322,"order":87},"\u002Fdocs\u002Fconcepts\u002Fassertions","Assertions","Almost every getter can assert, every assertion retries, and each return type allows different operators. The complete AssertionEngine reference.",{"path":328,"title":329,"description":330,"section":322,"order":75},"\u002Fdocs\u002Fconcepts\u002Fbrowser-context-page","Browser, context and page","The three layers Playwright is built on — and why a new context is the cheapest clean slate you will ever get.",{"path":332,"title":333,"description":334,"section":322,"order":335},"\u002Fdocs\u002Fconcepts\u002Flogging","Logging and debugging","Four places Browser tells you what happened — log.html, the Playwright log, traces and coverage.",6,{"path":337,"title":338,"description":339,"section":322,"order":81},"\u002Fdocs\u002Fconcepts\u002Fselectors","Finding elements","Which selector strategy to reach for, why the order matters, and how to chain across iframes and shadow DOM.",{"path":341,"title":342,"description":343,"section":322,"order":93},"\u002Fdocs\u002Fconcepts\u002Fwaiting","Waiting and promises","Most waiting is already done for you. This is the rest of it — Wait For Condition, and how to run keywords in parallel with Promise To.",{"path":345,"title":346,"description":347,"section":348,"order":162},"\u002Fdocs\u002Fextending\u002Fbrowser-as-a-base","Browser as a base","Own the Browser instance in your own library — what you get free, what one line restores, and what you build yourself.","extending",{"path":350,"title":351,"description":352,"section":348,"order":81},"\u002Fdocs\u002Fextending\u002Fjavascript-basics","Just enough JavaScript","The JavaScript you need to write extensions and Evaluate JavaScript, for people who write Python.",{"path":354,"title":355,"description":356,"section":348,"order":87},"\u002Fdocs\u002Fextending\u002Fjavascript-extensions","JavaScript extensions","Add keywords that run on the Node side with full Playwright access — and attach a debugger to them.",{"path":358,"title":359,"description":360,"section":348,"order":93},"\u002Fdocs\u002Fextending\u002Fpython-libraries","Your own Python library","Move business logic out of Robot Framework and keep Browser exactly as it is.",{"path":362,"title":363,"description":364,"section":348,"order":75},"\u002Fdocs\u002Fextending\u002Fpython-plugins","Python plugins","Add or replace keywords from Python, with access to the library's own API and to the Node side.",{"path":366,"title":367,"description":368,"section":348,"order":335},"\u002Fdocs\u002Fextending\u002Ftranslations","Translating keywords","Using a translation package to get keyword names and documentation in your language, and writing one for a language nobody has covered yet.",{"path":370,"title":371,"description":372,"section":313,"order":75},"\u002Fdocs\u002Fhttp\u002Foverview","HTTP traffic","Send requests, wait for them, and fail, mock or change them. Which keyword sees which request, and the rules they share for matchers, bodies and headers.",{"path":374,"title":375,"description":376,"section":313,"order":93},"\u002Fdocs\u002Fhttp\u002Froute-rules","Route rules","Make requests of the page fail, answer them with a mock response, or change the real request and response. Where a rule lives, when it ends, and which one wins.",{"path":378,"title":379,"description":380,"section":313,"order":81},"\u002Fdocs\u002Fhttp\u002Fsending-requests","Sending requests","HTTP sends a request from the page, Send API Request from the context. Which one to use, and how each sends bodies, forms and files.",{"path":312,"title":19,"description":308,"section":313,"order":87},{"path":383,"title":384,"description":385,"section":386,"order":93},"\u002Fdocs\u002Fmobile\u002Fdevice-list","Every device descriptor","The full list of names Get Device accepts, with the viewport, pixel ratio, touch and engine each one sets — filterable and sortable.","mobile",{"path":388,"title":389,"description":390,"section":386,"order":81},"\u002Fdocs\u002Fmobile\u002Fdevices","Emulating a device","Device descriptors, what the six or seven properties they set actually change, and the one that emulation cannot give you.",{"path":392,"title":393,"description":394,"section":386,"order":75},"\u002Fdocs\u002Fmobile\u002Fresponsive","Testing responsive pages","Why a browser at a phone-sized viewport tests responsiveness properly, what emulation cannot tell you, and where real devices actually belong.",{"path":396,"title":397,"description":398,"section":386,"order":87},"\u002Fdocs\u002Fmobile\u002Ftouch","Touch, permissions and location","Tap and why it needs hasTouch, granting camera or notifications without a dialog, faking where the user is, and the gestures Browser has no keyword for.",{"path":400,"title":401,"description":402,"section":403,"order":87},"\u002Fdocs\u002Foperations\u002Fdocker","Running in Docker","The published Browser image, the four docker run flags that matter, and why running as root breaks Chromium.","operations",{"path":405,"title":406,"description":407,"section":403,"order":93},"\u002Fdocs\u002Foperations\u002Fdocker-images","Building your own image","Extending the published image with your dependencies, the version lock between Browser and Playwright, and using it as a CI job container.",{"path":409,"title":410,"description":411,"section":403,"order":81},"\u002Fdocs\u002Foperations\u002Fenvironment-variables","Environment variables","The variables that change how Browser behaves, which of them are safe in production, and the import parameters that should usually be preferred.",{"path":413,"title":414,"description":415,"section":403,"order":75},"\u002Fdocs\u002Foperations\u002Fnode-process","The Node process","Browser starts a Node process to talk to Playwright. What that costs, how to share one across parallel runs, and how to pass it Node flags.",{"path":417,"title":418,"description":419,"section":420,"order":87},"\u002Fdocs\u002Frecording\u002Farguments","Keyword arguments","Turn a recorded value, part of it or part of a selector into an argument while you record — with or without a default, and everywhere it occurs.","recording",{"path":422,"title":423,"description":424,"section":420,"order":162},"\u002Fdocs\u002Frecording\u002Ffiles","Where recorded keywords go","The suite file, a resource file or only the log; written live after every action; what the recorder changes in a file and what it never touches.",{"path":426,"title":427,"description":428,"section":420,"order":429},"\u002Fdocs\u002Frecording\u002Fpractice","Good practice and limits","How to record keywords worth keeping, what to check before you commit one, what the recorder cannot do, and what to do when it goes wrong.",7,{"path":431,"title":432,"description":433,"section":420,"order":75},"\u002Fdocs\u002Frecording\u002Frecord-keywords","Recording keywords","Click through the page and get a reusable user keyword, written into your suite while you work. Record Keyword and Record Keywords in five minutes.",{"path":435,"title":436,"description":437,"section":420,"order":335},"\u002Fdocs\u002Frecording\u002Fselectors","Recording selectors","Pick an element in the live browser and get a selector for it — Playwright's or a CSS one, checked against the page while you edit it.",{"path":439,"title":440,"description":441,"section":420,"order":81},"\u002Fdocs\u002Frecording\u002Ftoolbar","The recorder toolbar","Name and start keywords, save, undo and discard them, end the session, and keep the toolbar out of the page's way.",{"path":443,"title":444,"description":445,"section":420,"order":93},"\u002Fdocs\u002Frecording\u002Fwhat-gets-recorded","What gets recorded","Which Browser keyword each action becomes, how popups, dialogs, downloads and uploads are handled, recording assertions, and the selectors the recorder writes.",{"path":447,"title":448,"description":449,"section":450,"order":81},"\u002Fdocs\u002Fstart\u002Fgetting-started","Getting started","Install Browser, write a first test, and run it.","start",{"path":452,"title":453,"description":454,"section":450,"order":75},"\u002Fdocs\u002Fstart\u002Finstallation","Installation","The two ways to install Browser — with a bundled Node.js runtime, or with one you provide yourself — and how to upgrade and remove each.",[456,459,462],{"to":457,"label":458},"\u002Fwhy\u002Fvs-cypress","vs Cypress",{"to":460,"label":461},"\u002Fwhy\u002Fvs-playwright","vs Playwright Test",{"to":463,"label":464},"\u002Fwhy\u002Fvs-seleniumlibrary","vs SeleniumLibrary",[466],"\u003Cspan class=\"line\">\u003Cspan style=\"color:#96A2A8;font-style:italic\">${promise} =    Promise To    Wait For Response    **\u002Fapi\u002Flogin\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan style=\"color:#96A2A8;font-style:italic\">Click    id=login-button\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan style=\"color:#96A2A8;font-style:italic\">${response} =    Wait For    ${promise}\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan style=\"color:#96A2A8;font-style:italic\">Should Be Equal    ${response.json.user}    demo\u003C\u002Fspan>\u003C\u002Fspan>",[468],"\u003Cspan class=\"line\">\u003Cspan style=\"color:#96A2A8;font-style:italic\">${logo} =    Promise To    Wait For Response    **\u002Flogo.png\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan style=\"color:#96A2A8;font-style:italic\">Go To    ${APP_URL}\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan style=\"color:#96A2A8;font-style:italic\">${response} =    Wait For    ${logo}\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan style=\"color:#96A2A8;font-style:italic\">Create Binary File    ${OUTPUT_DIR}\u002Flogo.png    ${response.bytes}\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan style=\"color:#96A2A8;font-style:italic\">Mock Responses    **\u002Flogo.png    body=${response.bytes}\u003C\u002Fspan>\u003C\u002Fspan>",1795470908275]