[{"data":1,"prerenderedAt":302},["ShallowReactive",2],{"SiteFooter_cLEacilcm59lTjFJjLY6mXNWLL0ETtzOIiZwIHgDpy0":3,"why-vs-seleniumlibrary":17,"nav-compare":288,"editor-zu7s6w":298,"editor-13yq412":300},["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,"comparedAgainst":277,"description":26,"extension":278,"meta":279,"navigation":280,"order":281,"path":282,"seo":283,"slug":284,"stem":285,"tagline":286,"tool":113,"__hash__":287},"why\u002Fwhy\u002Fseleniumlibrary.md","Browser vs SeleniumLibrary",{"type":21,"value":22,"toc":265},"minimark",[23,27,30,45,50,56,59,63,68,76,80,83,109,131,135,142,146,150,166,173,177,180,183,187,190,193,196,200,203,235,238,242,246,249],[24,25,26],"p",{},"Some of us maintained SeleniumLibrary for years before starting Browser, and its\ncurrent maintainers are our friends. It is a good library, it is actively\nmaintained, and for a great many projects it is the right answer.",[24,28,29],{},"So this page is facts, not persuasion. Two libraries, two underlying\ntechnologies, and what actually differs.",[31,32,33],"doc-note",{},[24,34,35,36,40,41,44],{},"Both are Robot Framework libraries, so this really is like for like. The\ndifferences below come mostly from the layer underneath: ",[37,38,39],"strong",{},"WebDriver"," for\nSeleniumLibrary, ",[37,42,43],{},"Playwright"," for Browser.",[46,47,49],"h2",{"id":48},"the-same-test-both-ways","The same test, both ways",[51,52],"comparison",{":notes":53,"left":54,"right":55},"[\"Selenium's own \\\"eight components\\\" example, written with each library.\",\"Browser's getters assert, so Get Text does in one line what Wait Until Element Is Visible plus Element Text Should Be does in two.\",\"Neither file is unreadable. This is not the interesting difference.\"]","comparison\u002Fseleniumlibrary\u002Fbrowser.robot","comparison\u002Fseleniumlibrary\u002Fseleniumlibrary.robot",[24,57,58],{},"The code is not where the gap is. The gap is underneath.",[46,60,62],{"id":61},"how-the-two-talk-to-the-browser","How the two talk to the browser",[64,65],"doc-table",{":head":66,":rows":67},"[\"\",\"Browser (Playwright)\",\"SeleniumLibrary (WebDriver)\"]","[[\"Protocol\",\"One persistent WebSocket connection to the browser\",\"W3C WebDriver, an HTTP request per command\"],[\"What it launches\",\"Browser builds Playwright downloads and pins\",\"The browser installed on the machine, through a driver\"],[\"Extra binaries\",\"`rfbrowser init` downloads browsers; no per-browser driver\",\"A driver per browser, resolved by Selenium Manager since 4.6\"],[\"Version coupling\",\"Browsers are pinned to the Playwright version, so they match by construction\",\"Driver and browser must stay in step as the browser auto-updates\"]]",[24,69,70,71,75],{},"The protocol difference is the origin of most of the rest. A command per HTTP\nround trip means every element lookup, every check and every retry is another\nrequest; it also means the browser can change between two of them, which is\nwhere ",[72,73,74],"code",{},"StaleElementReferenceException"," comes from.",[46,77,79],{"id":78},"waiting","Waiting",[24,81,82],{},"This is the single largest practical difference.",[24,84,85,88,89,92,93,96,97,100,101,104,105,108],{},[37,86,87],{},"Browser"," performs Playwright's actionability checks before every action. For a\nclick, all five must pass: the element is ",[37,90,91],{},"visible",", ",[37,94,95],{},"stable"," (unmoved for\ntwo animation frames), ",[37,98,99],{},"receives events"," (nothing is on top of it), ",[37,102,103],{},"enabled",",\nand for typing also ",[37,106,107],{},"editable",". It retries until they do or the timeout\nexpires, and the failure names the check that never passed.",[24,110,111,114,115,118,119,122,123,130],{},[37,112,113],{},"SeleniumLibrary"," offers an implicit wait — a global timeout applied to element\nlookup, and lookup only — plus explicit ",[72,116,117],{},"Wait Until ..."," keywords you place\nyourself. Selenium waits for ",[72,120,121],{},"document.readyState"," on navigation, which, as\n",[124,125,129],"a",{"href":126,"rel":127},"https:\u002F\u002Fwww.selenium.dev\u002Fdocumentation\u002Fwebdriver\u002Fwaits\u002F",[128],"nofollow","its own documentation notes",",\n\"only concerns itself with loading assets defined in the HTML\" — a\nJavaScript-rendered page is not covered.",[64,132],{":head":133,":rows":134},"[\"\",\"Browser\",\"SeleniumLibrary\"]","[[\"Before an action\",\"Five actionability checks, automatically\",\"Nothing beyond the implicit lookup wait\"],[\"Element under an overlay\",\"Waits for the overlay to go, then clicks\",\"Clicks, and the overlay receives it\"],[\"Element still animating\",\"Waits for it to stop\",\"Clicks mid-animation\"],[\"DOM re-render between lookup and use\",\"Locator re-resolves\",\"`StaleElementReferenceException`\"],[\"Explicit waits in a normal test\",\"Rare\",\"Common\"]]",[24,136,137,138,141],{},"That last row is the one you feel. ",[72,139,140],{},"Wait Until Element Is Visible"," before a\nclick is a line SeleniumLibrary suites are full of, and Browser suites do not\nhave.",[46,143,145],{"id":144},"selectors","Selectors",[64,147],{":head":148,":rows":149},"[\"Strategy\",\"Browser\",\"SeleniumLibrary\"]","[[\"CSS, XPath, id, name, class, tag\",\"Yes\",\"Yes\"],[\"Link text\",\"Via `text=`\",\"`link:` and `partial link:`\"],[\"By accessible role and name (`role=`)\",\"Yes\",\"No equivalent\"],[\"Visible text as a first-class engine (`text=`)\",\"Yes, substring or exact\",\"Anchors only\"],[\"Chaining several strategies\",\"`>>`\",\"`>>`\"],[\"Open shadow DOM\",\"Pierced automatically\",\"Not a locator strategy; needs the shadow root through JavaScript\"],[\"Crossing into an iframe\",\"`>>>` inside the same selector\",\"`Select Frame`, then `Unselect Frame`\"],[\"More than one match\",\"Strict mode by default — an error\",\"First match wins\"]]",[24,151,152,153,156,157,161,162,165],{},"Role selectors are the substantive addition. ",[72,154,155],{},"role=button[name=\"Save\"]"," matches\nwhat the element ",[158,159,160],"em",{},"is"," and what it is ",[158,163,164],{},"called"," — the two things a screen-reader\nuser navigates by — so it survives a redesign that moves the button and rewrites\nthe markup around it. There is no WebDriver equivalent; you approximate it with\nXPath over ARIA attributes.",[24,167,168,169,172],{},"Shadow DOM is the other. Selenium 4 can reach a shadow root via ",[72,170,171],{},"getShadowRoot()","\nper host, so it is possible; it is not a selector, so it does not compose with\nthe rest of a locator, and it does not nest without work.",[46,174,176],{"id":175},"diagnosing-a-failure","Diagnosing a failure",[64,178],{":head":133,":rows":179},"[[\"Screenshot on failure\",\"Yes, in the Robot Framework log\",\"Yes, in the Robot Framework log\"],[\"Video of the run\",\"`New Context` with `recordVideo=…`\",\"Not built in\"],[\"Trace\",\"`New Context` with `tracing=True` — DOM snapshots per action, network, console, timeline\",\"No equivalent\"],[\"Network inspection\",\"Built in, including request interception\",\"Via CDP, Chromium only\"]]",[24,181,182],{},"The trace is the part with no counterpart. A Playwright trace is a recording you\nopen afterwards and step through: for every action, the DOM as it was, with\nDevTools over it, plus the network and console at that moment. It is the\ndifference between \"the click failed\" and seeing the element you meant to click\nsitting behind a cookie banner.",[46,184,186],{"id":185},"browsers-and-platforms","Browsers and platforms",[24,188,189],{},"Where SeleniumLibrary is genuinely ahead — and it is worth being straight about\nthis, because it decides real projects:",[64,191],{":head":133,":rows":192},"[[\"Engines\",\"Chromium, Firefox, WebKit\",\"Chrome, Edge, Firefox, Safari, and more via WebDriver\"],[\"The actual shipped browser\",\"Playwright's builds; real Chrome or Edge via `channel`\",\"Always the real installed browser\"],[\"Safari proper\",\"No — WebKit is the same engine, not the same browser\",\"Yes, safaridriver\"],[\"Internet Explorer, legacy browsers\",\"No\",\"Yes\"],[\"Remote execution\",\"Playwright browser server, or `Connect To Browser`\",\"Selenium Grid, which is mature and widely deployed\"],[\"Mobile\",\"Device emulation\",\"Emulation, and real devices through the Appium ecosystem\"]]",[24,194,195],{},"If you must certify against Safari itself rather than WebKit, or you have an\nestablished Selenium Grid, or a stakeholder requires the vendor's own browser\nunder test, SeleniumLibrary is not the compromise — it is the correct tool.",[46,197,199],{"id":198},"performance","Performance",[24,201,202],{},"We are not going to publish a benchmark, because a benchmark of two tools on one\nsuite mostly measures the suite. The structural reasons Browser tends to be\nfaster are stateable without one:",[204,205,206,213,219,229],"ul",{},[207,208,209,212],"li",{},[37,210,211],{},"One connection instead of many requests."," Every WebDriver command is an\nHTTP round trip; Playwright multiplexes over a single WebSocket.",[207,214,215,218],{},[37,216,217],{},"No per-element round trips for waiting."," Actionability is evaluated in the\nbrowser rather than polled from outside.",[207,220,221,224,225,228],{},[37,222,223],{},"Contexts instead of browsers for isolation."," ",[72,226,227],{},"New Context"," gives a clean,\nisolated profile in a few milliseconds; a fresh Selenium session starts a browser.",[207,230,231,234],{},[37,232,233],{},"One Node process for all three engines",", rather than a driver process per\nbrowser.",[24,236,237],{},"Flakiness follows the same logic. Most of it comes from acting on an element\nthat was not ready, and the actionability checks remove that category rather\nthan mitigating it.",[46,239,241],{"id":240},"choosing","Choosing",[64,243],{":head":244,":rows":245},"[\"Choose\",\"When\"]","[[\"SeleniumLibrary\",\"You need Safari, IE or another WebDriver-only browser; you have a Selenium Grid; you have a large suite that works, and rewriting it buys nothing; your organisation standardises on WebDriver.\"],[\"Browser\",\"You are starting fresh; your app is a JavaScript-heavy SPA; you keep writing explicit waits; you need shadow DOM, iframes or role selectors; you want traces and video; suite runtime matters.\"]]",[24,247,248],{},"There is no obligation to migrate. Both libraries are maintained, both are\nRobot Framework libraries, and they can live in the same project — one suite on\neach, sharing everything else. Starting Browser has never required abandoning\nSeleniumLibrary.",[31,250,251],{},[24,252,253,254,258,259,264],{},"Checked against SeleniumLibrary 6.7 on Selenium 4 and Browser ",[255,256],"ver",{"name":257},"browser",". If\nanything here is wrong or has aged badly,\n",[124,260,263],{"href":261,"rel":262},"https:\u002F\u002Fgithub.com\u002FMarketSquare\u002Frobotframework-browser\u002Fissues",[128],"tell us"," —\nwe would rather fix it than let an unfair comparison stand.",{"title":266,"searchDepth":267,"depth":267,"links":268},"",2,[269,270,271,272,273,274,275,276],{"id":48,"depth":267,"text":49},{"id":61,"depth":267,"text":62},{"id":78,"depth":267,"text":79},{"id":144,"depth":267,"text":145},{"id":175,"depth":267,"text":176},{"id":185,"depth":267,"text":186},{"id":198,"depth":267,"text":199},{"id":240,"depth":267,"text":241},"SeleniumLibrary 6.7 on Selenium 4, Browser %%browser%%","md",{},true,3,"\u002Fwhy\u002Fseleniumlibrary",{"title":19,"description":26},"vs-seleniumlibrary","why\u002Fseleniumlibrary","The long-standing Robot Framework web library, built on Selenium WebDriver.","fC6L_8XvYwwdbjkuNy-FUYVe2EoeEobiwGk2JkqRQsg",[289,292,295],{"to":290,"label":291},"\u002Fwhy\u002Fvs-cypress","vs Cypress",{"to":293,"label":294},"\u002Fwhy\u002Fvs-playwright","vs Playwright Test",{"to":296,"label":297},"\u002Fwhy\u002Fvs-seleniumlibrary","vs SeleniumLibrary",[299],"\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>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003C\u002Fspan>\u003Cspan class=\"line\">\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan style=\"color:#FF6B5E;font-weight:bold\">*** Test Cases ***\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan style=\"color:#2BD9CC\">Test Eight Components\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan style=\"color:#2BD9CC\">    New Browser\u003C\u002Fspan>\u003Cspan style=\"color:#E0D3A3\">    chromium\u003C\u002Fspan>\u003Cspan style=\"color:#E0D3A3\">    headless=No\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan style=\"color:#2BD9CC\">    New Page\u003C\u002Fspan>\u003Cspan style=\"color:#E0D3A3\">    https:\u002F\u002Fwww.selenium.dev\u002Fselenium\u002Fweb\u002Fweb-form.html\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan style=\"color:#2BD9CC\">    Get Title\u003C\u002Fspan>\u003Cspan style=\"color:#E0D3A3\">    ==\u003C\u002Fspan>\u003Cspan style=\"color:#E0D3A3\">    Web form\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan style=\"color:#2BD9CC\">    Type Text\u003C\u002Fspan>\u003Cspan style=\"color:#E0D3A3\">    [name=\"my-text\"]\u003C\u002Fspan>\u003Cspan style=\"color:#E0D3A3\">    Selenium\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan style=\"color:#2BD9CC\">    Click\u003C\u002Fspan>\u003Cspan style=\"color:#E0D3A3\">    button\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan style=\"color:#2BD9CC\">    Get Text\u003C\u002Fspan>\u003Cspan style=\"color:#E0D3A3\">    id=message\u003C\u002Fspan>\u003Cspan style=\"color:#E0D3A3\">    ==\u003C\u002Fspan>\u003Cspan style=\"color:#E0D3A3\">    Received!\u003C\u002Fspan>\u003C\u002Fspan>",[301],"\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\">     SeleniumLibrary\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003C\u002Fspan>\u003Cspan class=\"line\">\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan style=\"color:#FF6B5E;font-weight:bold\">*** Test Cases ***\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan style=\"color:#2BD9CC\">Test Eight Components\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan style=\"color:#2BD9CC\">    Open Browser\u003C\u002Fspan>\u003Cspan style=\"color:#E0D3A3\">    https:\u002F\u002Fwww.selenium.dev\u002Fselenium\u002Fweb\u002Fweb-form.html\u003C\u002Fspan>\u003Cspan style=\"color:#E0D3A3\">    chrome\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan style=\"color:#2BD9CC\">    Title Should Be\u003C\u002Fspan>\u003Cspan style=\"color:#E0D3A3\">    Web form\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan style=\"color:#2BD9CC\">    Input Text\u003C\u002Fspan>\u003Cspan style=\"color:#E0D3A3\">    name:my-text\u003C\u002Fspan>\u003Cspan style=\"color:#E0D3A3\">    Selenium\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan style=\"color:#2BD9CC\">    Click Button\u003C\u002Fspan>\u003Cspan style=\"color:#E0D3A3\">    css:button\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan style=\"color:#2BD9CC\">    Wait Until Element Is Visible\u003C\u002Fspan>\u003Cspan style=\"color:#E0D3A3\">    id:message\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan style=\"color:#2BD9CC\">    Element Text Should Be\u003C\u002Fspan>\u003Cspan style=\"color:#E0D3A3\">    id:message\u003C\u002Fspan>\u003Cspan style=\"color:#E0D3A3\">    Received!\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"line\">\u003Cspan style=\"color:#C9A6E9\">    [Teardown]\u003C\u002Fspan>\u003Cspan style=\"color:#E0D3A3\">    Close Browser\u003C\u002Fspan>\u003C\u002Fspan>",1786734137661]