[{"data":1,"prerenderedAt":306},["ShallowReactive",2],{"SiteFooter_cLEacilcm59lTjFJjLY6mXNWLL0ETtzOIiZwIHgDpy0":3,"doc-\u002Fdocs\u002Foperations\u002Fenvironment-variables":17,"docs-nav":216,"nav-compare":294,"editor-89u7zy":304},["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-bottom:1px solid var(--line);border-radius:var(--radius-sm);background:var(--panel);color:var(--ink);border: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":207,"extension":208,"meta":209,"navigation":210,"order":102,"path":211,"section":212,"seo":213,"stem":214,"__hash__":215},"docs\u002Fdocs\u002Foperations\u002Fenvironment-variables.md","Environment variables",{"type":21,"value":22,"toc":202},"minimark",[23,32,37,64,75,80,83,106,109,117,128,132,142,148,158,162,183,198],[24,25,26,27,31],"p",{},"Four environment variables change how Browser's Node process behaves. They are\ndocumented here mainly so that nobody discovers them by accident and uses them\nwithout knowing what they cost — ",[28,29,30],"strong",{},"two of them must not be set in production",".",[33,34],"doc-table",{":head":35,":rows":36},"[\"Variable\",\"Safe in production\",\"What it does\"]","[[\"`ROBOT_FRAMEWORK_BROWSER_NODE_PORT`\",\"Yes\",\"Connect to an existing Node process on this port instead of starting one. The import parameter `playwright_process_port` does the same thing, more precisely.\"],[\"`ROBOT_FRAMEWORK_BROWSER_NODE_COVERAGE`\",\"**No**\",\"Set to exactly the string `1` to collect code coverage for the Node process — `true` and `yes` do nothing. For developing Browser itself. Not supported on Windows.\"],[\"`ROBOT_FRAMEWORK_BROWSER_NODE_DEBUG_OPTIONS`\",\"**No**\",\"Comma-separated Node command-line arguments, for example `--inspect`. A debugging tool; see [The Node process](\u002Fdocs\u002Foperations\u002Fnode-process).\"],[\"`ROBOT_FRAMEWORK_BROWSER_PINO_LOG_LEVEL`\",\"Yes\",\"Log level of the Node process's own logger, default `info`. Set it to `debug` for more in `playwright-log.txt`. The `rfbrowser` subcommands that start a browser themselves — `show-trace`, `launch-browser-server` — force it to `error` so their console output stays clean, overriding whatever you set.\"]]",[24,38,39,40,44,45,48,49,48,52,55,56,59,60,63],{},"One more is read by the Python side rather than by Node:\n",[41,42,43],"code",{},"ROBOT_FRAMEWORK_BROWSER_TRACING",". Any truthy value — ",[41,46,47],{},"true",", ",[41,50,51],{},"1",[41,53,54],{},"yes"," — is\nequivalent to passing ",[41,57,58],{},"tracing=True"," to ",[41,61,62],{},"New Context",", which is the way to record\ntraces for a whole run without editing the tests. A Robot Framework variable of\nthe same name works too, and is checked first.",[24,65,66,67,70,71,74],{},"It only reaches contexts you create yourself. ",[41,68,69],{},"New Page"," and ",[41,72,73],{},"Open Browser","\nagainst no open browser create their context on the Node side, which never\nconsults the variable — so those contexts are not traced. If you want a trace,\nopen the context explicitly.",[76,77,79],"h2",{"id":78},"prefer-the-import-parameter","Prefer the import parameter",[24,81,82],{},"Where a variable and an import parameter do the same job, reach for the\nparameter:",[84,85,90],"pre",{"className":86,"code":87,"language":88,"meta":89,"style":89},"language-robot shiki shiki-themes github-light github-dark","*** Settings ***\nLibrary    Browser    playwright_process_port=12345\n","robot","",[41,91,92,100],{"__ignoreMap":89},[93,94,97],"span",{"class":95,"line":96},"line",1,[93,98,99],{},"*** Settings ***\n",[93,101,103],{"class":95,"line":102},2,[93,104,105],{},"Library    Browser    playwright_process_port=12345\n",[24,107,108],{},"An environment variable applies to every Robot Framework process in that shell,\nincluding the suites you did not mean to change, and it lives outside the files\nyou version. An import parameter is scoped to the suite that declares it, and it\nis visible in the same file as the rest of that suite's configuration.",[24,110,111,112,116],{},"The variable is still the right tool when the setting belongs to the ",[113,114,115],"em",{},"machine","\nrather than the suite — a CI runner that must always talk to a shared process,\nfor instance.",[24,118,119,120,123,124,127],{},"Note the precedence, because it runs the other way from what the wording\nsuggests: an explicit ",[41,121,122],{},"playwright_process_port"," import parameter is checked\nfirst and ",[28,125,126],{},"wins",", so the variable only reaches suites that do not set the\nparameter themselves.",[76,129,131],{"id":130},"browserbatteries","BrowserBatteries",[24,133,134,135,31],{},"These variables behave identically whether the Node process comes from a Node.js\nyou installed yourself or from the one bundled in\n",[136,137,141],"a",{"href":138,"rel":139},"https:\u002F\u002Fpypi.org\u002Fproject\u002Frobotframework-browser-batteries\u002F",[140],"nofollow","robotframework-browser-batteries",[143,144,145],"doc-note",{},[24,146,147],{},"That was not always true. In older releases these two were silently ignored when\nBrowserBatteries was installed, because its bundled Node.js was a packaged binary\nthat could not accept Node arguments. If a debug flag appears to do nothing,\ncheck whether you are on a current release before looking anywhere else.",[24,149,150,151,59,154,157],{},"One difference is still real. Where the plain library defaults\n",[41,152,153],{},"PLAYWRIGHT_BROWSERS_PATH",[41,155,156],{},"0",", BrowserBatteries defaults it to the resolved\npath of its own browser directory. Both put the binaries somewhere Browser owns,\nand setting the variable yourself wins in either case — but the value you see if\nyou print it differs.",[76,159,161],{"id":160},"what-is-not-here","What is not here",[24,163,164,165,168,169,172,173,175,176,178,179,182],{},"Playwright reads environment variables of its own, and they mostly reach it\nunchanged because Browser runs Playwright. Two exceptions, both set by Browser\nbefore it starts Node: ",[41,166,167],{},"DEBUG"," is forced to ",[41,170,171],{},"pw:api"," when Playwright debug\nlogging is enabled, and ",[41,174,153],{}," defaults to ",[41,177,156],{}," when you have\nnot set it — which puts the binaries inside the library's own ",[41,180,181],{},"node_modules","\nrather than in Playwright's shared cache. Setting it yourself is honoured\neverywhere.",[24,184,185,187,188,191,192,197],{},[41,186,153],{}," is the one you are most likely to want — it decides where ",[41,189,190],{},"rfbrowser init"," puts the browser\nbinaries, and it is how you share one download between users or bake browsers\ninto a container image. Those are documented by\n",[136,193,196],{"href":194,"rel":195},"https:\u002F\u002Fplaywright.dev\u002Fdocs\u002Fbrowsers",[140],"Playwright",", not by us, and we deliberately\ndo not copy the list here: a copy would be wrong the day Playwright changes it.",[199,200,201],"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":89,"searchDepth":102,"depth":102,"links":203},[204,205,206],{"id":78,"depth":102,"text":79},{"id":130,"depth":102,"text":131},{"id":160,"depth":102,"text":161},"The variables that change how Browser behaves, which of them are safe in production, and the import parameters that should usually be preferred.","md",{},true,"\u002Fdocs\u002Foperations\u002Fenvironment-variables","operations",{"title":19,"description":207},"docs\u002Foperations\u002Fenvironment-variables","dZXccaVqw82HR2LM315UT08U7hxSzhduwRFwgWuC20Q",[217,223,228,232,237,241,246,251,255,259,263,268,272,276,280,284,285,289],{"path":218,"title":219,"description":220,"section":221,"order":222},"\u002Fdocs\u002Fconcepts\u002Farchitecture","How Browser works","Python, a Node process and Playwright — what runs where, and which installation to choose.","concepts",5,{"path":224,"title":225,"description":226,"section":221,"order":227},"\u002Fdocs\u002Fconcepts\u002Fassertions","Assertions","Almost every getter can assert, every assertion retries, and each return type allows different operators. The complete AssertionEngine reference.",3,{"path":229,"title":230,"description":231,"section":221,"order":96},"\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":233,"title":234,"description":235,"section":221,"order":236},"\u002Fdocs\u002Fconcepts\u002Flogging","Logging and debugging","Four places Browser tells you what happened — log.html, the Playwright log, traces and coverage.",6,{"path":238,"title":239,"description":240,"section":221,"order":102},"\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":242,"title":243,"description":244,"section":221,"order":245},"\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.",4,{"path":247,"title":248,"description":249,"section":250,"order":102},"\u002Fdocs\u002Fextending\u002Fjavascript-basics","Just enough JavaScript","The JavaScript you need to write extensions and Evaluate JavaScript, for people who write Python.","extending",{"path":252,"title":253,"description":254,"section":250,"order":227},"\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":256,"title":257,"description":258,"section":250,"order":96},"\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":260,"title":261,"description":262,"section":250,"order":245},"\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":264,"title":265,"description":266,"section":267,"order":102},"\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.","mobile",{"path":269,"title":270,"description":271,"section":267,"order":96},"\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":273,"title":274,"description":275,"section":267,"order":227},"\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":277,"title":278,"description":279,"section":212,"order":227},"\u002Fdocs\u002Foperations\u002Fdocker","Running in Docker","The published Browser image, the four docker run flags that matter, and why running as root breaks Chromium.",{"path":281,"title":282,"description":283,"section":212,"order":245},"\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":211,"title":19,"description":207,"section":212,"order":102},{"path":286,"title":287,"description":288,"section":212,"order":96},"\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":290,"title":291,"description":292,"section":293,"order":96},"\u002Fdocs\u002Fstart\u002Fgetting-started","Getting started","Install Browser, write a first test, and run it.","start",[295,298,301],{"to":296,"label":297},"\u002Fwhy\u002Fvs-cypress","vs Cypress",{"to":299,"label":300},"\u002Fwhy\u002Fvs-playwright","vs Playwright Test",{"to":302,"label":303},"\u002Fwhy\u002Fvs-seleniumlibrary","vs SeleniumLibrary",[305],"\u003Cspan class=\"line\">\u003Cspan style=\"color:#FF6B5E;font-weight:bold\">*** Settings ***\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan style=\"color:#C9A6E9\">Library\u003C\u002Fspan>\u003Cspan style=\"color:#E0D3A3\">    Browser\u003C\u002Fspan>\u003Cspan style=\"color:#E0D3A3\">    playwright_process_port=12345\u003C\u002Fspan>\u003C\u002Fspan>",1786734140534]