Datasets:
Download web/detox.github.io/reference/site/docs/api/webviews/index.html from Qwen/RecreationBench: direct link, hf CLI and curl.
- Browser
- Download file 172 kB
-
https://huggingface.co/datasets/Qwen/RecreationBench/resolve/main/web/detox.github.io/reference/site/docs/api/webviews/index.html
- Command line
-
hf download hf://datasets/Qwen/RecreationBench/web/detox.github.io/reference/site/docs/api/webviews/index.html
-
curl -L -o index.html https://huggingface.co/datasets/Qwen/RecreationBench/resolve/main/web/detox.github.io/reference/site/docs/api/webviews/index.html
172 kB
| <html class="docs-wrapper docs-doc-page docs-version-20.x plugin-docs plugin-id-default docs-doc-id-api/webviews show--consent" data-has-hydrated="true" data-rh="lang,dir,class,data-has-hydrated" data-theme="dark" dir="ltr" lang="en"><head> | |
| <meta charset="utf-8"/> | |
| <meta content="Docusaurus v2.4.3" name="generator"/> | |
| <title>Web Views | Detox</title><meta content="summary_large_image" data-rh="true" name="twitter:card"/><meta content="en" data-rh="true" name="docusaurus_locale"/><meta content="en" data-rh="true" name="docsearch:language"/><meta content="20.x" data-rh="true" name="docusaurus_version"/><meta content="docs-default-20.x" data-rh="true" name="docusaurus_tag"/><meta content="20.x" data-rh="true" name="docsearch:version"/><meta content="docs-default-20.x" data-rh="true" name="docsearch:docusaurus_tag"/><meta content="Web Views | Detox" data-rh="true" property="og:title"/><meta content="Web views are native components that render content not natively supported by the platform, like web pages or PDF documents." data-rh="true" name="description"/><meta content="Web views are native components that render content not natively supported by the platform, like web pages or PDF documents." data-rh="true" property="og:description"/><link data-rh="true" href="/img/favicon.ico" rel="icon"/><link crossorigin="anonymous" data-rh="true" href="/_404.html" rel="preconnect"/><link href="/blog/rss.xml" rel="alternate" title="Detox RSS Feed" type="application/rss+xml"/> | |
| <link href="/blog/atom.xml" rel="alternate" title="Detox Atom Feed" type="application/atom+xml"/> | |
| <link href="/_404.html" rel="preconnect"/> | |
| <link href="/_404.html" rel="preconnect"/> | |
| <link href="/_404.html" rel="preconnect"/> | |
| <script>window.dataLayer=window.dataLayer||[]</script> | |
| <link href="/opensearch.xml" rel="search" title="Detox" type="application/opensearchdescription+xml"/> | |
| <script async="" src="/_cdn/platform.twitter.com/widgets.js"></script><link href="/assets/css/styles.2561cce4.css" rel="stylesheet"/> | |
| <link as="script" href="/assets/js/runtime~main.12cb17c3.js" rel="preload"/> | |
| <link as="script" href="/assets/js/main.899efd46.js" rel="preload"/> | |
| <link data-rh="true" href="/docs/api/webviews/" rel="canonical"/><link data-rh="true" href="/docs/api/webviews/" hreflang="en" rel="alternate"/><link data-rh="true" href="/docs/api/webviews/" hreflang="x-default" rel="alternate"/><meta content="width=device-width, initial-scale=1.0" data-rh="true" name="viewport"/><meta content="/docs/api/webviews/" data-rh="true" property="og:url"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/329947da.92af671e.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/85addd09.f2a5fda6.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/7accbb75.e3d53ef1.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/d9894068.9ef62e7b.js" rel="prefetch"/><link href="/assets/js/c4f5d8e4.1d727c7d.js" rel="prefetch"/><link href="/assets/js/0ef19a76.b6a3804a.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/935f2afb.d4cfcd14.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/0f6ee85b.691825e0.js" rel="prefetch"/><link href="/assets/js/5fc994c2.0a3b56b5.js" rel="prefetch"/><link href="/assets/js/0ef19a76.b6a3804a.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/9a34b858.98ca0ede.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/373c35af.5d2e051c.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/bab8a798.39e6da23.js" rel="prefetch"/><link href="/assets/js/a6aa9e1f.f7d63002.js" rel="prefetch"/><link href="/assets/js/181d712d.f728104a.js" rel="prefetch"/><link href="/assets/js/814f3328.368bc5eb.js" rel="prefetch"/><link href="/assets/js/83eb08f7.4d5ec241.js" rel="prefetch"/><link href="/assets/js/9292650b.f26ac725.js" rel="prefetch"/><link href="/assets/js/933bed1e.d56d75f0.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/96997528.38ed49ad.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/5b12c1a9.ead7646c.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/20110cf9.78831dd9.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/1ee22d16.fe2b756b.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/a622d695.ad67fb36.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/71949878.06587ec8.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/7358fe14.7552c7a7.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/f14c3b1d.750d68cc.js" rel="prefetch"/><link href="/assets/js/17896441.b40a6528.js" rel="prefetch"/><link href="/assets/js/79ac7843.08fb5e78.js" rel="prefetch"/><link href="/_cdn/unpkg.com/@68publishers/cookie-consent/dist/cookie-consent.css" rel="stylesheet"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/><link href="/assets/js/a8a1de49.bab92bdd.js" rel="prefetch"/><link href="/assets/js/3fb5a56d.b5c89c21.js" rel="prefetch"/><link href="/assets/js/d350cff3.43602b60.js" rel="prefetch"/></head> | |
| <body class="navigation-with-keyboard" data-rh="class" style="overflow: visible;"> | |
| <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"><div class="banner_SLir"><a class="link_SNdm" href="/_404.html" rel="noopener noreferrer" target="_blank"><span class="uaFlag_wtbk"></span> This project is created with substantial contributions from our Ukrainian colleagues.<!-- --> <span class="hashtag_KSDo">#StandWithUkraine</span></a></div><div aria-label="Skip to main content" role="region"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-expanded="false" aria-label="Toggle navigation bar" class="navbar__toggle clean-btn" type="button"><svg aria-hidden="true" fill="currentColor" height="12" viewbox="0 0 19 12" width="19"><rect height="1" rx="0.5" stroke="currentColor" stroke-linecap="round" width="18" x="0.5" y="5.5"></rect><rect height="1" rx="0.5" stroke="currentColor" stroke-linecap="round" width="18" x="0.5" y="10.5"></rect><rect height="1" rx="0.5" stroke="currentColor" stroke-linecap="round" width="18" x="0.5" y="0.5"></rect></svg></button><a class="navbar__brand" href="/"><div class="navbar__logo"><img alt="Detox Logo" class="themedImage_ToTc themedImage--dark_i4oU" src="/img/logo.png"/></div><b class="navbar__title text--truncate">Detox</b></a><a class="navbar__item navbar__link" href="/docs/introduction/getting-started">Docs</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/config/overview">API</a><a class="navbar__item navbar__link" href="/docs/contributing">Contribute</a><a class="navbar__item navbar__link" href="/blog">Blog</a><a class="navbar__item navbar__link header-showcase-link" href="/showcase">Showcase</a></div><div class="navbar__items navbar__items--right"><div class="navbar__item dropdown dropdown--hoverable dropdown--right"><a aria-expanded="false" aria-haspopup="true" class="navbar__link" href="/docs/introduction/getting-started" role="button">20.x</a><ul class="dropdown__menu"><li><a class="dropdown__link" href="/docs/next/api/webviews">Next</a></li><li><a aria-current="page" class="dropdown__link dropdown__link--active" href="/docs/api/webviews">20.x</a></li><li><a class="dropdown__link" href="/docs/19.x/">19.x</a></li></ul></div><a aria-label="GitHub repository" class="navbar__item navbar__link header-github-link" href="/_404.html" rel="noopener noreferrer" target="_blank"></a><div class="toggle_vylO colorModeToggle_DEke"><button aria-label="Switch between dark and light mode (currently dark mode)" aria-live="polite" class="clean-btn toggleButton_gllP" title="Switch between dark and light mode (currently dark mode)" type="button"><svg class="lightToggleIcon_pyhR" height="24" viewbox="0 0 24 24" width="24"><path d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z" fill="currentColor"></path></svg><svg class="darkToggleIcon_wfgR" height="24" viewbox="0 0 24 24" width="24"><path d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z" fill="currentColor"></path></svg></button></div><div class="searchWrapper_jYdA searchBox_ZlJk"><button aria-label="Search (Ctrl+K)" class="DocSearch DocSearch-Button" type="button"><span class="DocSearch-Button-Container"><svg aria-hidden="true" class="DocSearch-Search-Icon" height="20" viewbox="0 0 20 20" width="20"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" fill="none" fill-rule="evenodd" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"><kbd class="DocSearch-Button-Key"><svg class="DocSearch-Control-Key-Icon" height="15" width="15"><path d="M4.505 4.496h2M5.505 5.496v5M8.216 4.496l.055 5.993M10 7.5c.333.333.5.667.5 1v2M12.326 4.5v5.996M8.384 4.496c1.674 0 2.116 0 2.116 1.5s-.442 1.5-2.116 1.5M3.205 9.303c-.09.448-.277 1.21-1.241 1.203C1 10.5.5 9.513.5 8V7c0-1.57.5-2.5 1.464-2.494.964.006 1.134.598 1.24 1.342M12.553 10.5h1.953" fill="none" stroke="currentColor" stroke-linecap="square" stroke-width="1.2"></path></svg></kbd><kbd class="DocSearch-Button-Key">K</kbd></span></button></div></div></div><div class="navbar-sidebar__backdrop" role="presentation"></div></nav><div class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX" id="__docusaurus_skipToContent_fallback"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a aria-expanded="false" class="menu__link menu__link--sublist menu__link--sublist-caret" href="#">Config file</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a aria-expanded="false" class="menu__link menu__link--sublist menu__link--sublist-caret" href="#">Command Line Interface</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a aria-expanded="true" class="menu__link menu__link--sublist menu__link--sublist-caret menu__link--active" href="#">Client API</a></div><ul class="menu__list" style="display:block;overflow:visible;height:auto"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" href="/docs/api/device" tabindex="0">Device</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" href="/docs/api/matchers" tabindex="0">Matchers</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" href="/docs/api/actions" tabindex="0">Actions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" href="/docs/api/expect" tabindex="0">Expect</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a aria-current="page" class="menu__link menu__link--active" href="/docs/api/webviews" tabindex="0">Web Views</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" href="/docs/api/system" tabindex="0">System</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" href="/docs/api/logger" tabindex="0">Logger</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" href="/docs/api/pilot" tabindex="0">Wix Pilot</a></li></ul></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/api/internals">Internals API</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a aria-expanded="false" class="menu__link menu__link--sublist menu__link--sublist-caret" href="#">Tech Articles</a></div></li></ul></nav></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav aria-label="Breadcrumbs" class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg class="breadcrumbHomeIcon_YNFT" viewbox="0 0 24 24"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li class="breadcrumbs__item"><span class="breadcrumbs__link">Client API</span><meta content="1" itemprop="position"/></li><li class="breadcrumbs__item breadcrumbs__item--active" itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem"><span class="breadcrumbs__link" itemprop="name">Web Views</span><meta content="2" itemprop="position"/></li></ul></nav><span class="theme-doc-version-badge badge badge--secondary">Version: 20.x</span><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button class="clean-btn tocCollapsibleButton_TO0P" type="button">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Web Views</h1><p>Web views are native components that render content not natively supported by the platform, like web pages or PDF documents. | |
| However, elements within web views are not native components, making direct interaction through Detox challenging. | |
| To address this, Detox offers a suite of matchers, actions, and expectations designed for interacting with content inside web views.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="locating-elements-in-web-views">Locating Elements in Web Views<a aria-label="Direct link to Locating Elements in Web Views" class="hash-link" href="#locating-elements-in-web-views" title="Direct link to Locating Elements in Web Views"></a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="webelementmatcher"><code>web.element(matcher)</code><a aria-label="Direct link to webelementmatcher" class="hash-link" href="#webelementmatcher" title="Direct link to webelementmatcher"></a></h3><p>In cases where there's only one web view present on the screen, you may use the <code>web.element()</code> function, paired with <a href="/docs/api/webviews#matchers">web view matchers</a>, to reference elements within the web view. | |
| Upon obtaining the element reference, you can utilize web view actions and expectations on the webView element.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword" style="color: rgb(189, 147, 249); font-style: italic;">const</span><span class="token plain"> innerElement </span><span class="token operator">=</span><span class="token plain"> web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">id</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'inner_element_identifier'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><span class="token plain"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain"></span><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> </span><span class="token function" style="color: rgb(80, 250, 123);">expect</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">innerElement</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">toHaveText</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'Hello World!'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><p>In the example above, we locate an inner element by its <code>id</code> HTML attribute and verify its text content.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="webnativematcherelementmatcher"><code>web(nativeMatcher).element(matcher)</code><a aria-label="Direct link to webnativematcherelementmatcher" class="hash-link" href="#webnativematcherelementmatcher" title="Direct link to webnativematcherelementmatcher"></a></h3><p>If you have multiple web views on the screen, you must locate a specific web view first by using a <a href="/docs/api/matchers">native matcher</a>, e.g.:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword" style="color: rgb(189, 147, 249); font-style: italic;">const</span><span class="token plain"> myWebView </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color: rgb(80, 250, 123);">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">id</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'webview_identifier'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><p>Following that, you can locate the element within the identified web view:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword" style="color: rgb(189, 147, 249); font-style: italic;">const</span><span class="token plain"> innerElement </span><span class="token operator">=</span><span class="token plain"> myWebView</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">id</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'inner_element_identifier'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><span class="token plain"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain"></span><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> </span><span class="token function" style="color: rgb(80, 250, 123);">expect</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">innerElement</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">toHaveText</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'Hello World!'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="webnativematcheratindexindexelementmatcher-ios-only"><code>web(nativeMatcher).atIndex(index).element(matcher)</code> (iOS only)<a aria-label="Direct link to webnativematcheratindexindexelementmatcher-ios-only" class="hash-link" href="#webnativematcheratindexindexelementmatcher-ios-only" title="Direct link to webnativematcheratindexindexelementmatcher-ios-only"></a></h3><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewbox="0 0 14 16"><path d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z" fill-rule="evenodd"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>This matcher is available for iOS only. See <a href="/_404.html" rel="noopener noreferrer" target="_blank">this GitHub issue</a> for more information.</p></div></div><p>If you have multiple web views on the screen and you want to interact with a specific web view, you can use the <code>atIndex()</code> method to choose the web view at the specified index.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword" style="color: rgb(189, 147, 249); font-style: italic;">const</span><span class="token plain"> myWebView </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color: rgb(80, 250, 123);">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">id</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'webview_identifier'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">atIndex</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token number">1</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><span class="token plain"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain"></span><span class="token keyword" style="color: rgb(189, 147, 249); font-style: italic;">const</span><span class="token plain"> innerElement </span><span class="token operator">=</span><span class="token plain"> myWebView</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">id</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'inner_element_identifier'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><span class="token plain"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain"></span><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> </span><span class="token function" style="color: rgb(80, 250, 123);">expect</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">innerElement</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">toHaveText</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'Hello World!'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><p>In the example above, we use <code>atIndex()</code> to select the second web view on the screen (that has the specified accessibility identifier) and then locate an HTML element inside that web view.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="matchers">Matchers<a aria-label="Direct link to Matchers" class="hash-link" href="#matchers" title="Direct link to Matchers"></a></h2><p>Web view matchers are used to find elements within a web view:</p><ul><li><a href="/docs/api/webviews#bywebidid"><code>by.web.id()</code></a></li><li><a href="/docs/api/webviews#bywebclassnameclassname"><code>by.web.className()</code></a></li><li><a href="/docs/api/webviews#bywebcssselectorcssselector"><code>by.web.cssSelector()</code></a></li><li><a href="/docs/api/webviews#bywebnamename"><code>by.web.name()</code></a></li><li><a href="/docs/api/webviews#bywebxpathxpath"><code>by.web.xpath()</code></a></li><li><a href="/docs/api/webviews#bywebhrefhref"><code>by.web.href()</code></a></li><li><a href="/docs/api/webviews#bywebhrefcontainshref"><code>by.web.hrefContains()</code></a></li><li><a href="/docs/api/webviews#bywebtagtag"><code>by.web.tag()</code></a></li><li><a href="/docs/api/webviews#bywebvaluevalue"><code>by.web.value()</code></a> (iOS only)</li><li><a href="/docs/api/webviews#byweblabellabel"><code>by.web.label()</code></a> (iOS only, supports <a href="/docs/api/webviews#assecured"><code>asSecured()</code></a>)</li><li><a href="/docs/api/webviews#bywebtypeaccessibilitytype"><code>by.web.type()</code></a> (iOS only, <a href="/docs/api/webviews#assecured"><code>asSecured()</code></a> only)</li><li><a href="/docs/api/webviews#atindexindex"><code>atIndex()</code></a></li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="bywebidid"><code>by.web.id(id)</code><a aria-label="Direct link to bywebidid" class="hash-link" href="#bywebidid" title="Direct link to bywebidid"></a></h3><p>Match elements with the specified accessibility identifier.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">id</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'identifier'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="bywebclassnameclassname"><code>by.web.className(className)</code><a aria-label="Direct link to bywebclassnameclassname" class="hash-link" href="#bywebclassnameclassname" title="Direct link to bywebclassnameclassname"></a></h3><p>Match elements with the specified CSS class name.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">className</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'className'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="bywebcssselectorcssselector"><code>by.web.cssSelector(cssSelector)</code><a aria-label="Direct link to bywebcssselectorcssselector" class="hash-link" href="#bywebcssselectorcssselector" title="Direct link to bywebcssselectorcssselector"></a></h3><p>Match elements with the specified CSS selector.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">cssSelector</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'#cssSelector'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="bywebnamename"><code>by.web.name(name)</code><a aria-label="Direct link to bywebnamename" class="hash-link" href="#bywebnamename" title="Direct link to bywebnamename"></a></h3><p>Match form input elements with the specified <a href="/_404.html" rel="noopener noreferrer" target="_blank"><code>name</code> attribute</a>.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">name</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'name'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="bywebxpathxpath"><code>by.web.xpath(xpath)</code><a aria-label="Direct link to bywebxpathxpath" class="hash-link" href="#bywebxpathxpath" title="Direct link to bywebxpathxpath"></a></h3><p>Match elements with the specified XPath.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">xpath</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'//*[@id="testingh1-1"]'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="bywebhrefhref"><code>by.web.href(href)</code><a aria-label="Direct link to bywebhrefhref" class="hash-link" href="#bywebhrefhref" title="Direct link to bywebhrefhref"></a></h3><p>Match elements with the specified <code>href</code>.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">href</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'https://wix.com'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewbox="0 0 14 16"><path d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z" fill-rule="evenodd"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>You might face issues with this matcher on Android. Check <a href="/_404.html" rel="noopener noreferrer" target="_blank">this GitHub issue</a> for more information.</p></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="bywebhrefcontainshref"><code>by.web.hrefContains(href)</code><a aria-label="Direct link to bywebhrefcontainshref" class="hash-link" href="#bywebhrefcontainshref" title="Direct link to bywebhrefcontainshref"></a></h3><p>Match elements that contain the specified <code>href</code>.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">hrefContains</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'wix'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewbox="0 0 14 16"><path d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z" fill-rule="evenodd"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>You might face issues with this matcher on Android. Check <a href="/_404.html" rel="noopener noreferrer" target="_blank">this GitHub issue</a> for more information.</p></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="bywebtagtag"><code>by.web.tag(tag)</code><a aria-label="Direct link to bywebtagtag" class="hash-link" href="#bywebtagtag" title="Direct link to bywebtagtag"></a></h3><p>Match elements with the specified tag.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">tag</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'h1'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="bywebvaluevalue"><code>by.web.value(value)</code><a aria-label="Direct link to bywebvaluevalue" class="hash-link" href="#bywebvaluevalue" title="Direct link to bywebvaluevalue"></a></h3><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewbox="0 0 14 16"><path d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z" fill-rule="evenodd"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>This matcher is available for <strong>iOS only</strong> at the moment.</p></div></div><p>Match elements with the specified value.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">value</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'value'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="byweblabellabel"><code>by.web.label(label)</code><a aria-label="Direct link to byweblabellabel" class="hash-link" href="#byweblabellabel" title="Direct link to byweblabellabel"></a></h3><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewbox="0 0 14 16"><path d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z" fill-rule="evenodd"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>This matcher is available for <strong>iOS only</strong> at the moment and supports <a href="/docs/api/webviews#assecured"><code>asSecured()</code></a>.</p></div></div><p>Match elements with the specified label.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">label</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'label'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><p>Supports <a href="/docs/api/webviews#assecured"><code>asSecured()</code></a> on <strong>iOS only</strong>:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">label</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'label'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">asSecured</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="bywebtypeaccessibilitytype"><code>by.web.type(accessibilityType)</code><a aria-label="Direct link to bywebtypeaccessibilitytype" class="hash-link" href="#bywebtypeaccessibilitytype" title="Direct link to bywebtypeaccessibilitytype"></a></h3><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewbox="0 0 14 16"><path d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z" fill-rule="evenodd"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>This matcher is available for <strong>iOS only</strong> at the moment and supported with <a href="/docs/api/webviews#assecured"><code>asSecured()</code></a> only.</p></div></div><p>Match elements with the specified type.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">type</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'textField'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">asSecured</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><p>The type value can be any of XCUIElement.ElementType values, such as 'button' or 'textField'. See <a href="/_404.html" rel="noopener noreferrer" target="_blank">XCUIElement.ElementType</a>.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="atindexindex"><code>atIndex(index)</code><a aria-label="Direct link to atindexindex" class="hash-link" href="#atindexindex" title="Direct link to atindexindex"></a></h3><p>Choose the element at the specified index.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">tag</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'h1'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">atIndex</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token number">1</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><p>Use it sparingly for those rare cases when you cannot make your matcher less ambiguous, so it returns one element only.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="actions">Actions<a aria-label="Direct link to Actions" class="hash-link" href="#actions" title="Direct link to Actions"></a></h2><p>Web view actions are used to interact with elements within a web view:</p><ul><li><a href="/docs/api/webviews#tap"><code>tap()</code></a> (supports <a href="/docs/api/webviews#assecured"><code>asSecured()</code></a>)</li><li><a href="/docs/api/webviews#typetexttext-iscontenteditable"><code>typeText()</code></a> (supports <a href="/docs/api/webviews#assecured"><code>asSecured()</code></a>)</li><li><a href="/docs/api/webviews#replacetexttext"><code>replaceText()</code></a> (supports <a href="/docs/api/webviews#assecured"><code>asSecured()</code></a>)</li><li><a href="/docs/api/webviews#cleartext"><code>clearText()</code></a> (supports <a href="/docs/api/webviews#assecured"><code>asSecured()</code></a>)</li><li><a href="/docs/api/webviews#selectalltext"><code>selectAllText()</code></a></li><li><a href="/docs/api/webviews#gettext"><code>getText()</code></a></li><li><a href="/docs/api/webviews#scrolltoview"><code>scrollToView()</code></a></li><li><a href="/docs/api/webviews#focus"><code>focus()</code></a></li><li><a href="/docs/api/webviews#movecursortoend"><code>moveCursorToEnd()</code></a></li><li><a href="/docs/api/webviews#runscriptscript-args"><code>runScript()</code></a></li><li><a href="/docs/api/webviews#getcurrenturl"><code>getCurrentUrl()</code></a></li><li><a href="/docs/api/webviews#gettitle"><code>getTitle()</code></a></li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="tap"><code>tap()</code><a aria-label="Direct link to tap" class="hash-link" href="#tap" title="Direct link to tap"></a></h3><p>Tap the element.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">id</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'identifier'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">tap</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><p>Supports <a href="/docs/api/webviews#assecured"><code>asSecured()</code></a> on <strong>iOS only</strong>:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">label</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'Submit'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">asSecured</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">tap</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="typetexttext-iscontenteditable"><code>typeText(text[, isContentEditable])</code><a aria-label="Direct link to typetexttext-iscontenteditable" class="hash-link" href="#typetexttext-iscontenteditable" title="Direct link to typetexttext-iscontenteditable"></a></h3><p>Type the specified text into the element.</p><p><code>isContentEditable</code> is an optional parameter that indicates whether the element should be a <a href="/_404.html" rel="noopener noreferrer" target="_blank">content-editable</a> (<code>contenteditable</code>) element, and defaults to <code>false</code>.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">id</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'identifier'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">typeText</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'Hello World!'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><p>Supports <a href="/docs/api/webviews#assecured"><code>asSecured()</code></a> on <strong>iOS only</strong>: </p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">type</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'textField'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">asSecured</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">typeText</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'Hello World!'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewbox="0 0 14 16"><path d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z" fill-rule="evenodd"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>The <code>isContentEditable</code> parameter is currently necessary for content-editable elements only on Android.</p><p>On iOS, Detox automatically detects content-editable elements regardless of this parameter.</p></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="replacetexttext"><code>replaceText(text)</code><a aria-label="Direct link to replacetexttext" class="hash-link" href="#replacetexttext" title="Direct link to replacetexttext"></a></h3><p>Replace the text of the element with the specified text.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">id</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'identifier'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">replaceText</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'Hello World!'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><p>Supports <a href="/docs/api/webviews#assecured"><code>asSecured()</code></a> on <strong>iOS only</strong>:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">type</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'textField'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">asSecured</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">replaceText</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'Hello World!'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewbox="0 0 14 16"><path d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z" fill-rule="evenodd"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>This action is currently not supported for content-editable elements on Android.</p><p>On iOS, Detox automatically detects content-editable elements and replaces their text.</p></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="cleartext"><code>clearText()</code><a aria-label="Direct link to cleartext" class="hash-link" href="#cleartext" title="Direct link to cleartext"></a></h3><p>Clear the text of the element.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">id</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'identifier'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">clearText</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><p>Supports <a href="/docs/api/webviews#assecured"><code>asSecured()</code></a> on <strong>iOS only</strong>:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">type</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'textField'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">asSecured</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">clearText</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewbox="0 0 14 16"><path d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z" fill-rule="evenodd"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>This action is currently not supported for content-editable elements on Android.</p><p>On iOS, Detox automatically detects content-editable elements and clears their text.</p></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="selectalltext"><code>selectAllText()</code><a aria-label="Direct link to selectalltext" class="hash-link" href="#selectalltext" title="Direct link to selectalltext"></a></h3><p>Select all the text of the element.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">id</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'identifier'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">selectAllText</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewbox="0 0 14 16"><path d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z" fill-rule="evenodd"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>This action is currently supported for content-editable elements only on Android.</p><p>On iOS, Detox can select all the text of any element that supports it (for example, an input element).</p></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="gettext"><code>getText()</code><a aria-label="Direct link to gettext" class="hash-link" href="#gettext" title="Direct link to gettext"></a></h3><p>Get the text of the element.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword" style="color: rgb(189, 147, 249); font-style: italic;">const</span><span class="token plain"> text </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">id</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'identifier'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">getText</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="scrolltoview"><code>scrollToView()</code><a aria-label="Direct link to scrolltoview" class="hash-link" href="#scrolltoview" title="Direct link to scrolltoview"></a></h3><p>Scroll to the element until its top is at the top of the viewport.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">id</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'identifier'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">scrollToView</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="focus"><code>focus()</code><a aria-label="Direct link to focus" class="hash-link" href="#focus" title="Direct link to focus"></a></h3><p>Focus on the element.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">id</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'identifier'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">focus</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="movecursortoend"><code>moveCursorToEnd()</code><a aria-label="Direct link to movecursortoend" class="hash-link" href="#movecursortoend" title="Direct link to movecursortoend"></a></h3><p>Move the input cursor to the end of the element's content.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">id</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'identifier'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">moveCursorToEnd</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewbox="0 0 14 16"><path d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z" fill-rule="evenodd"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>This action is currently supported for content-editable elements only on Android.</p><p>On iOS, Detox can move the cursor to the end of any element that supports it (for example, an input element).</p></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="runscriptscript-args"><code>runScript(script[, args])</code><a aria-label="Direct link to runscriptscript-args" class="hash-link" href="#runscriptscript-args" title="Direct link to runscriptscript-args"></a></h3><p>Run the specified script on the element. | |
| The script should be a string that contains a valid JavaScript function. | |
| It will be called with that element as the first argument:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword" style="color: rgb(189, 147, 249); font-style: italic;">const</span><span class="token plain"> webElement </span><span class="token operator">=</span><span class="token plain"> web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">id</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'identifier'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><span class="token plain"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain"></span><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> webElement</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">runScript</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'(el) => el.click()'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><p>For convenience, you can pass a function instead of a string, but please note that this will not work if the function uses any variables from the outer scope:</p><p>The script can accept additional arguments and return a value. Make sure the values are primitive types or serializable objects, as they will be converted to JSON and back:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword" style="color: rgb(189, 147, 249); font-style: italic;">const</span><span class="token plain"> text </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> webElement</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">runScript</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token keyword" style="color: rgb(189, 147, 249); font-style: italic;">function</span><span class="token plain"> </span><span class="token function" style="color: rgb(80, 250, 123);">get</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token parameter">element</span><span class="token parameter punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token parameter"> property</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token plain"> </span><span class="token punctuation" style="color: rgb(248, 248, 242);">{</span><span class="token plain"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain"> </span><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">return</span><span class="token plain"> element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">[</span><span class="token plain">property</span><span class="token punctuation" style="color: rgb(248, 248, 242);">]</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><span class="token plain"></span><br/></span><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token plain"></span><span class="token punctuation" style="color: rgb(248, 248, 242);">}</span><span class="token punctuation" style="color: rgb(248, 248, 242);">,</span><span class="token plain"> </span><span class="token punctuation" style="color: rgb(248, 248, 242);">[</span><span class="token string" style="color: rgb(255, 121, 198);">'textContent'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">]</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="getcurrenturl"><code>getCurrentUrl()</code><a aria-label="Direct link to getcurrenturl" class="hash-link" href="#getcurrenturl" title="Direct link to getcurrenturl"></a></h3><p>Get the current URL of the web view.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword" style="color: rgb(189, 147, 249); font-style: italic;">const</span><span class="token plain"> url </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">id</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'identifier'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">getCurrentUrl</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewbox="0 0 14 16"><path d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z" fill-rule="evenodd"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>Although this action returns the URL of the presented web document, it can be called from an inner element only (for example, an iframe id or the HTML) and not from the root native web view element itself.</p><p>You might face issues with this action on Android. Check <a href="/_404.html" rel="noopener noreferrer" target="_blank">this GitHub issue</a> for more information.</p></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="gettitle"><code>getTitle()</code><a aria-label="Direct link to gettitle" class="hash-link" href="#gettitle" title="Direct link to gettitle"></a></h3><p>Get the title of the web view.</p><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewbox="0 0 14 16"><path d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z" fill-rule="evenodd"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>Although this action returns the title of the presented web document, it can be called from an inner element only (for example, an iframe id or the HTML) and not from the root native web view element itself.</p></div></div><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword" style="color: rgb(189, 147, 249); font-style: italic;">const</span><span class="token plain"> title </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">id</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'identifier'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">getTitle</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="expectations">Expectations<a aria-label="Direct link to Expectations" class="hash-link" href="#expectations" title="Direct link to Expectations"></a></h2><p>Web view expectations are used to assert the state of elements within a web view:</p><ul><li><a href="/docs/api/webviews#tohavetexttext"><code>toHaveText()</code></a></li><li><a href="/docs/api/webviews#toexist"><code>toExist()</code></a> (supports <a href="/docs/api/webviews#assecured"><code>asSecured()</code></a>)</li><li><a href="/docs/api/webviews#not"><code>not</code></a> (supports <a href="/docs/api/webviews#assecured"><code>asSecured()</code></a>)</li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="tohavetexttext"><code>toHaveText(text)</code><a aria-label="Direct link to tohavetexttext" class="hash-link" href="#tohavetexttext" title="Direct link to tohavetexttext"></a></h3><p>Assert that the element has the specified text.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> </span><span class="token function" style="color: rgb(80, 250, 123);">expect</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">id</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'identifier'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">toHaveText</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'Hello World!'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="toexist"><code>toExist()</code><a aria-label="Direct link to toexist" class="hash-link" href="#toexist" title="Direct link to toexist"></a></h3><p>Assert that the element exists.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> </span><span class="token function" style="color: rgb(80, 250, 123);">expect</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">id</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'identifier'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">toExist</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><p>Supports <a href="/docs/api/webviews#assecured"><code>asSecured()</code></a> on <strong>iOS only</strong>:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> </span><span class="token function" style="color: rgb(80, 250, 123);">expect</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">label</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'Hello World!'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">asSecured</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">toExist</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewbox="0 0 14 16"><path d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z" fill-rule="evenodd"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>You might face issues with this expectation on Android. Check <a href="/_404.html" rel="noopener noreferrer" target="_blank">this GitHub issue</a> for more information.</p></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="not"><code>not</code><a aria-label="Direct link to not" class="hash-link" href="#not" title="Direct link to not"></a></h3><p>Negate the expectation.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> </span><span class="token function" style="color: rgb(80, 250, 123);">expect</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">id</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'identifier'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">not</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">toHaveText</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'Hello World!'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><p>Supports <a href="/docs/api/webviews#assecured"><code>asSecured()</code></a> on <strong>iOS only</strong>:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> </span><span class="token function" style="color: rgb(80, 250, 123);">expect</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">label</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'Hello World!'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">asSecured</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">atIndex</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token number">1</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">not</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">toExist</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Toggle word wrap" class="clean-btn" title="Toggle word wrap" type="button"><svg aria-hidden="true" class="wordWrapButtonIcon_Bwma" viewbox="0 0 24 24"><path d="M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z" fill="currentColor"></path></svg></button><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="assecured"><code>asSecured()</code><a aria-label="Direct link to assecured" class="hash-link" href="#assecured" title="Direct link to assecured"></a></h2><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewbox="0 0 14 16"><path d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z" fill-rule="evenodd"></path></svg></span>experimental</div><div class="admonitionContent_S0QG"><p>This API is available only on <strong>iOS</strong> and is currently in the experimental phase. It is subject to changes in the near future.</p></div></div><p>The <code>asSecured()</code> API is designed for interacting with web pages that use secured protocols, such as PCI DSS for payment pages. Use it when the regular API fails to interact with such pages. Detox uses system-level interactions with the webview in these scenarios. This approach is less performant and has fewer APIs.</p><p>Example:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color: #F8F8F2; --prism-background-color: #282A36;"><div class="codeBlockContent_biex"><pre class="prism-code language-js codeBlock_bY9V thin-scrollbar" tabindex="0"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color: rgb(248, 248, 242);"><span class="token keyword control-flow" style="color: rgb(189, 147, 249); font-style: italic;">await</span><span class="token plain"> web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">element</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token plain">by</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token property-access">web</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">label</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token string" style="color: rgb(255, 121, 198);">'Submit'</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">asSecured</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">.</span><span class="token method function property-access" style="color: rgb(80, 250, 123);">tap</span><span class="token punctuation" style="color: rgb(248, 248, 242);">(</span><span class="token punctuation" style="color: rgb(248, 248, 242);">)</span><span class="token punctuation" style="color: rgb(248, 248, 242);">;</span><br/></span></code></pre><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="why-use-assecured">Why use <code>asSecured()</code>?<a aria-label="Direct link to why-use-assecured" class="hash-link" href="#why-use-assecured" title="Direct link to why-use-assecured"></a></h3><p>Use <code>asSecured()</code> for web pages with secured protocols when regular Detox interactions fail. For CORS issues, consider passing the <a href="/docs/api/device#12-detoxdisablewebkitsecuritydisable-webkit-security-ios-only"><code>detoxDisableWebKitSecurity</code></a> launch argument to enable less strict security limitations for interacting with secured web views.</p></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a class="theme-edit-this-page" href="/_404.html" rel="noreferrer noopener" target="_blank"><svg aria-hidden="true" class="iconEdit_Z9Sw" fill="currentColor" height="20" viewbox="0 0 40 40" width="20"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav aria-label="Docs pages" class="pagination-nav docusaurus-mt-lg"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/api/expect"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Expect</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/api/system"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">System</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a class="table-of-contents__link toc-highlight" href="#locating-elements-in-web-views">Locating Elements in Web Views</a><ul><li><a class="table-of-contents__link toc-highlight" href="#webelementmatcher"><code>web.element(matcher)</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#webnativematcherelementmatcher"><code>web(nativeMatcher).element(matcher)</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#webnativematcheratindexindexelementmatcher-ios-only"><code>web(nativeMatcher).atIndex(index).element(matcher)</code> (iOS only)</a></li></ul></li><li><a class="table-of-contents__link toc-highlight" href="#matchers">Matchers</a><ul><li><a class="table-of-contents__link toc-highlight" href="#bywebidid"><code>by.web.id(id)</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#bywebclassnameclassname"><code>by.web.className(className)</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#bywebcssselectorcssselector"><code>by.web.cssSelector(cssSelector)</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#bywebnamename"><code>by.web.name(name)</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#bywebxpathxpath"><code>by.web.xpath(xpath)</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#bywebhrefhref"><code>by.web.href(href)</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#bywebhrefcontainshref"><code>by.web.hrefContains(href)</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#bywebtagtag"><code>by.web.tag(tag)</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#bywebvaluevalue"><code>by.web.value(value)</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#byweblabellabel"><code>by.web.label(label)</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#bywebtypeaccessibilitytype"><code>by.web.type(accessibilityType)</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#atindexindex"><code>atIndex(index)</code></a></li></ul></li><li><a class="table-of-contents__link toc-highlight" href="#actions">Actions</a><ul><li><a class="table-of-contents__link toc-highlight" href="#tap"><code>tap()</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#typetexttext-iscontenteditable"><code>typeText(text[, isContentEditable])</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#replacetexttext"><code>replaceText(text)</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#cleartext"><code>clearText()</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#selectalltext"><code>selectAllText()</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#gettext"><code>getText()</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#scrolltoview"><code>scrollToView()</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#focus"><code>focus()</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#movecursortoend"><code>moveCursorToEnd()</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#runscriptscript-args"><code>runScript(script[, args])</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#getcurrenturl"><code>getCurrentUrl()</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#gettitle"><code>getTitle()</code></a></li></ul></li><li><a class="table-of-contents__link toc-highlight" href="#expectations">Expectations</a><ul><li><a class="table-of-contents__link toc-highlight" href="#tohavetexttext"><code>toHaveText(text)</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#toexist"><code>toExist()</code></a></li><li><a class="table-of-contents__link toc-highlight" href="#not"><code>not</code></a></li></ul></li><li><a class="table-of-contents__link toc-highlight" href="#assecured"><code>asSecured()</code></a><ul><li><a class="table-of-contents__link toc-highlight" href="#why-use-assecured">Why use <code>asSecured()</code>?</a></li></ul></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="row footer__links"><div class="col footer__col footer__col_docs"><div class="footer__title">Docs</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item" href="/docs/introduction/getting-started">Getting Started</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/contributing">Contributing to Detox</a></li></ul></div><div class="col footer__col footer__col_support"><div class="footer__title">Support</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item footer__link-item_ask-a-question-on-stack-overflow" href="/_404.html" rel="noopener noreferrer" target="_blank">Ask a question on Stack Overflow</a></li><li class="footer__item"><a class="footer__link-item footer__link-item_create-new-issue-on-github" href="/_404.html" rel="noopener noreferrer" target="_blank">Create new issue on Github</a></li></ul></div><div class="col footer__col footer__col_more"><div class="footer__title">More</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item footer__link-item_git-hub" href="/_404.html" rel="noopener noreferrer" target="_blank">GitHub</a></li><li class="footer__item"><a class="footer__link-item footer__link-item_twitter" href="/_404.html" rel="noopener noreferrer" target="_blank">Twitter</a></li><li class="footer__item"><a class="footer__link-item footer__link-item_discord" href="/_404.html" rel="noopener noreferrer" target="_blank">Discord</a></li></ul></div></div></div></footer></div> | |
| <script src="/assets/js/runtime~main.12cb17c3.js"></script> | |
| <script src="/assets/js/main.899efd46.js"></script> | |
| <iframe allowtransparency="true" frameborder="0" scrolling="no" src="/_cdn/platform.twitter.com/widgets/widget_iframe.1227a5674072e080ffb1ba14ac0c1079.html?origin=https%3A%2F%2Fwix.github.io" style="display: none;" title="Twitter settings iframe"></iframe><div class="c--anim" id="cc--main" style="position: fixed;"><div class="cc_div" id="cc_div"><div aria-describedby="c-txt" aria-labelledby="c-ttl" aria-modal="true" class="box bottom center zoom" id="cm" role="dialog" style="visibility: hidden;" tabindex="-1"><div id="c-inr"><div id="c-inr-i"><h2 id="c-ttl">We use cookies!</h2><div id="c-txt">This website uses essential cookies to ensure its proper operation and tracking cookies to understand how you interact with it. The latter will be set only after consent.</div></div><div id="c-bns"><button class="c-bn" id="c-p-bn" type="button"><span tabindex="-1">I agree</span></button><button class="c-bn c_link" id="c-s-bn" type="button"><span tabindex="-1">Customize</span></button></div></div></div><div id="cm-ov" style="visibility: hidden; opacity: 0;"></div><div aria-hidden="true" aria-labelledby="s-ttl" aria-modal="true" class="zoom" id="s-cnt" role="dialog" style="visibility: hidden;" tabindex="-1"><div id="c-vln"><div id="cs"><div id="c-s-in"><div class="bns-t" id="s-inr"><div id="s-hdr"><h2 id="s-ttl">Cookie settings</h2><div id="s-c-bnc"><button aria-label="Close" class="c-bn" id="s-c-bn" type="button"><span tabindex="-1"></span></button></div></div><div id="s-bl"><div class="c-bl"><div class="title"><div aria-level="3" class="b-tl" role="heading">Cookie usage</div></div><div class="desc"><div class="p">We use cookies to ensure the basic functionalities of the website and to enhance your online experience. You can choose for each category to opt-in/out whenever you want.</div></div></div><div class="c-bl b-ex"><div class="title b-bn"><button aria-controls="c-ac-1" aria-expanded="false" class="b-tl exp" type="button">Functionality cookies</button><label class="b-tg"><input class="c-tgl" disabled="" type="checkbox" value="functionality_storage"/><span aria-hidden="true" class="c-tg c-ro"><span class="on-i"></span><span class="off-i"></span></span><span class="t-lb">Functionality cookies</span></label></div><div aria-hidden="true" class="desc b-acc" id="c-ac-1"><div class="p">These cookies are necessary for the proper functioning of our website. Without these cookies, the website might not be working properly.</div></div></div><div class="c-bl b-ex"><div class="title b-bn"><button aria-controls="c-ac-2" aria-expanded="false" class="b-tl exp" type="button">Security cookies</button><label class="b-tg"><input class="c-tgl" type="checkbox" value="security_storage"/><span aria-hidden="true" class="c-tg"><span class="on-i"></span><span class="off-i"></span></span><span class="t-lb">Security cookies</span></label></div><div aria-hidden="true" class="desc b-acc" id="c-ac-2"><div class="p">Security cookies allows storage of security-related information, such as authentication, fraud protection, and other means to protect the user.</div></div></div><div class="c-bl b-ex"><div class="title b-bn"><button aria-controls="c-ac-3" aria-expanded="false" class="b-tl exp" type="button">Personalization cookies</button><label class="b-tg"><input class="c-tgl" type="checkbox" value="personalization_storage"/><span aria-hidden="true" class="c-tg"><span class="on-i"></span><span class="off-i"></span></span><span class="t-lb">Personalization cookies</span></label></div><div aria-hidden="true" class="desc b-acc" id="c-ac-3"><div class="p">Personalisation cookies may use third party cookies to help them personalise content and track users across different websites and devices.</div></div></div><div class="c-bl b-ex"><div class="title b-bn"><button aria-controls="c-ac-4" aria-expanded="false" class="b-tl exp" type="button">Ad cookies</button><label class="b-tg"><input class="c-tgl" type="checkbox" value="ad_storage"/><span aria-hidden="true" class="c-tg"><span class="on-i"></span><span class="off-i"></span></span><span class="t-lb">Ad cookies</span></label></div><div aria-hidden="true" class="desc b-acc" id="c-ac-4"><div class="p">Advertising cookies are used by us or our partners to show you relevant content or advertisements both on our site and on third party sites. This enables us to create profiles based on your interests, so-called pseudonymised profiles. Based on this information, it is generally not possible to directly identify you as a person, as only pseudonymised data is used. Unless you express your consent, you will not receive content and advertisements tailored to your interests.</div></div></div><div class="c-bl b-ex"><div class="title b-bn"><div class="b-tl">Ad user data</div><label class="b-tg"><input class="c-tgl" type="checkbox" value="ad_user_data"/><span aria-hidden="true" class="c-tg"><span class="on-i"></span><span class="off-i"></span></span><span class="t-lb">Ad user data</span></label></div><div aria-hidden="true" class="desc b-acc" id="c-ac-5"></div></div><div class="c-bl b-ex"><div class="title b-bn"><div class="b-tl">Ad personalization</div><label class="b-tg"><input class="c-tgl" type="checkbox" value="ad_personalization"/><span aria-hidden="true" class="c-tg"><span class="on-i"></span><span class="off-i"></span></span><span class="t-lb">Ad personalization</span></label></div><div aria-hidden="true" class="desc b-acc" id="c-ac-6"></div></div><div class="c-bl b-ex"><div class="title b-bn"><button aria-controls="c-ac-7" aria-expanded="false" class="b-tl exp" type="button">Analytics cookies</button><label class="b-tg"><input class="c-tgl" type="checkbox" value="analytics_storage"/><span aria-hidden="true" class="c-tg"><span class="on-i"></span><span class="off-i"></span></span><span class="t-lb">Analytics cookies</span></label></div><div aria-hidden="true" class="desc b-acc" id="c-ac-7"><div class="p">Analytics cookies allow us to measure the performance of our website and our advertising campaigns. We use them to determine the number of visits and sources of visits to our website. We process the data obtained through these cookies in aggregate, without using identifiers that point to specific users of our website. If you disable the use of analytics cookies in relation to your visit, we lose the ability to analyse performance and optimise our measures.</div></div></div><div class="c-bl"><div class="title"><div aria-level="3" class="b-tl" role="heading">More information</div></div><div class="desc"><div class="p">For any queries in relation to our policy on cookies and your choices, please contact us.</div></div></div></div><div id="s-bns"><button class="c-bn" id="s-all-bn" type="button">Accept all</button><button class="c-bn" id="s-rall-bn" type="button">Accept necessary</button><button class="c-bn" id="s-sv-bn" type="button">Save settings</button></div></div></div></div></div></div><div id="cs-ov" style="visibility: hidden; opacity: 0;"></div></div></div><iframe allowfullscreen="true" allowtransparency="true" frameborder="0" id="rufous-sandbox" scrolling="no" style="position: absolute; visibility: hidden; display: none; width: 0px; height: 0px; padding: 0px; border-width: medium; border-style: none; border-color: currentcolor; border-image: initial;" title="Twitter analytics iframe"></iframe></body></html> |