<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Frame on Grafana Labs</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/</link><description>Recent content in Frame on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/k6/v2.3.x/javascript-api/k6-browser/frame/index.xml" rel="self" type="application/rss+xml"/><item><title>$(selector)</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/frame-dollar/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/frame-dollar/</guid><content><![CDATA[&lt;h1 id=&#34;selector&#34;&gt;$(selector)&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Use locator-based 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/locator/&#34;&gt;&lt;code&gt;frame.locator(selector)&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;The method finds an element matching the specified selector within the frame. If no elements match the selector, the return value resolves to &lt;code&gt;null&lt;/code&gt;. To wait for an element on the frame, use 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/waitfor/&#34;&gt;locator.waitFor([options])&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;ElementHandle | null&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fulfills with the 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/elementhandle/&#34;&gt;ElementHandle&lt;/a&gt;  of the selector when a matching element is found or &lt;code&gt;null&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="selector">$(selector)&lt;/h1>
&lt;div class="admonition admonition-warning">&lt;blockquote>&lt;p class="title text-uppercase">Warning&lt;/p>&lt;p>Use locator-based
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/frame/locator/">&lt;code>frame.locator(selector)&lt;/code>&lt;/a> instead.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>The method finds an element matching the specified selector within the frame. If no elements match the selector, the return value resolves to &lt;code>null&lt;/code>. To wait for an element on the frame, use
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/locator/waitfor/">locator.waitFor([options])&lt;/a>.&lt;/p></description></item><item><title>$$(selector)</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/frame-doubledollar/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/frame-doubledollar/</guid><content><![CDATA[&lt;h1 id=&#34;selector&#34;&gt;$$(selector)&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Use locator-based 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/locator/&#34;&gt;&lt;code&gt;frame.locator(selector)&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;The method finds all elements matching the specified selector within the page. If no elements match the selector, the return value resolves to &lt;code&gt;[]&lt;/code&gt;. The results are returned in DOM order.&lt;/p&gt;
&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;ElementHandle[]&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fulfills with the 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/elementhandle/&#34;&gt;ElementHandle&lt;/a&gt; array of the selector when matching elements are found.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="selector">$$(selector)&lt;/h1>
&lt;div class="admonition admonition-warning">&lt;blockquote>&lt;p class="title text-uppercase">Warning&lt;/p>&lt;p>Use locator-based
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/frame/locator/">&lt;code>frame.locator(selector)&lt;/code>&lt;/a> instead.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>The method finds all elements matching the specified selector within the page. If no elements match the selector, the return value resolves to &lt;code>[]&lt;/code>. The results are returned in DOM order.&lt;/p></description></item><item><title>check(selector[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/check/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/check/</guid><content><![CDATA[&lt;h1 id=&#34;checkselector-options&#34;&gt;check(selector[, options])&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Use locator-based 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/check/&#34;&gt;&lt;code&gt;locator.check([options])&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;This method is used to select an input checkbox.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;selector&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.force&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Setting this to &lt;code&gt;true&lt;/code&gt; will bypass the actionability checks (&lt;code&gt;visible&lt;/code&gt;, &lt;code&gt;stable&lt;/code&gt;, &lt;code&gt;enabled&lt;/code&gt;).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.noWaitAfter&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;If set to &lt;code&gt;true&lt;/code&gt; and a navigation occurs from performing this action, it will not wait for it to complete.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.position&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A point to use relative to the top left corner of the element. If not supplied, a visible point of the element is used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.position.x&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;0&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The x coordinate.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.position.y&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;0&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The y coordinate.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.strict&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When &lt;code&gt;true&lt;/code&gt;, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.trial&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Setting this to &lt;code&gt;true&lt;/code&gt; will perform the actionability checks without performing the action.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;void&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fulfills when the check action is finished.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="checkselector-options">check(selector[, options])&lt;/h1>
&lt;div class="admonition admonition-warning">&lt;blockquote>&lt;p class="title text-uppercase">Warning&lt;/p>&lt;p>Use locator-based
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/locator/check/">&lt;code>locator.check([options])&lt;/code>&lt;/a> instead.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>This method is used to select an input checkbox.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Default&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>selector&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.force&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>Setting this to &lt;code>true&lt;/code> will bypass the actionability checks (&lt;code>visible&lt;/code>, &lt;code>stable&lt;/code>, &lt;code>enabled&lt;/code>).&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.noWaitAfter&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>If set to &lt;code>true&lt;/code> and a navigation occurs from performing this action, it will not wait for it to complete.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.position&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>A point to use relative to the top left corner of the element. If not supplied, a visible point of the element is used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.position.x&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>0&lt;/code>&lt;/td>
&lt;td>The x coordinate.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.position.y&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>0&lt;/code>&lt;/td>
&lt;td>The y coordinate.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.strict&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>When &lt;code>true&lt;/code>, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.timeout&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>30000&lt;/code>&lt;/td>
&lt;td>Maximum time in milliseconds. Pass &lt;code>0&lt;/code> to disable the timeout. Default is overridden by the &lt;code>setDefaultTimeout&lt;/code> option on
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/">BrowserContext&lt;/a> or
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/page/">Page&lt;/a>.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.trial&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>Setting this to &lt;code>true&lt;/code> will perform the actionability checks without performing the action.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Promise&amp;lt;void&amp;gt;&lt;/code>&lt;/td>
&lt;td>A Promise that fulfills when the check action is finished.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>childFrames()</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/childframes/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/childframes/</guid><content><![CDATA[&lt;h1 id=&#34;childframes&#34;&gt;childFrames()&lt;/h1&gt;
&lt;p&gt;This method returns an array of child frames.&lt;/p&gt;
&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Frame[]&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;An array of 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/&#34;&gt;Frame&lt;/a&gt; objects.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="childframes">childFrames()&lt;/h1>
&lt;p>This method returns an array of child frames.&lt;/p>
&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Frame[]&lt;/code>&lt;/td>
&lt;td>An array of
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/frame/">Frame&lt;/a> objects.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>click(selector[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/click/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/click/</guid><content><![CDATA[&lt;h1 id=&#34;clickselector-options&#34;&gt;click(selector[, options])&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Use locator-based 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/click/&#34;&gt;&lt;code&gt;locator.click([options])&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;This method clicks on an element matching a &lt;code&gt;selector&lt;/code&gt;.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;selector&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.button&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;left&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The mouse button (&lt;code&gt;left&lt;/code&gt;, &lt;code&gt;middle&lt;/code&gt; or &lt;code&gt;right&lt;/code&gt;) to use during the action.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.clickCount&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The number of times the action is performed.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.delay&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;0&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Milliseconds to wait between &lt;code&gt;mousedown&lt;/code&gt; and &lt;code&gt;mouseup&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.force&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Setting this to &lt;code&gt;true&lt;/code&gt; will bypass the actionability checks (&lt;code&gt;visible&lt;/code&gt;, &lt;code&gt;stable&lt;/code&gt;, &lt;code&gt;enabled&lt;/code&gt;). Avoid using &lt;code&gt;force: true&lt;/code&gt; in  &lt;code&gt;click&lt;/code&gt; actions, as it may mask underlying test design or app issues. It bypasses normal user interaction checks, and elements may not be clickable due to 
    &lt;a href=&#34;/docs/k6/v2.3.x/using-k6-browser/recommended-practices/prevent-cookie-banners-blocking/&#34;&gt;cookie banner interference&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.modifiers&lt;/td&gt;
              &lt;td&gt;string[]&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;Alt&lt;/code&gt;, &lt;code&gt;Control&lt;/code&gt;, &lt;code&gt;Meta&lt;/code&gt; or &lt;code&gt;Shift&lt;/code&gt; modifiers keys pressed during the action. If not specified, currently pressed modifiers are used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.noWaitAfter&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;If set to &lt;code&gt;true&lt;/code&gt; and a navigation occurs from performing this action, it will not wait for it to complete.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.position&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A point to use relative to the top left corner of the element. If not supplied, a visible point of the element is used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.position.x&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;0&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The x coordinate.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.position.y&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;0&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The y coordinate.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.strict&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When &lt;code&gt;true&lt;/code&gt;, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.trial&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Setting this to &lt;code&gt;true&lt;/code&gt; will perform the actionability checks without performing the action. Useful to wait until the element is ready for the action without performing it.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;void&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fulfills when the click action is finished.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="clickselector-options">click(selector[, options])&lt;/h1>
&lt;div class="admonition admonition-warning">&lt;blockquote>&lt;p class="title text-uppercase">Warning&lt;/p>&lt;p>Use locator-based
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/locator/click/">&lt;code>locator.click([options])&lt;/code>&lt;/a> instead.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>This method clicks on an element matching a &lt;code>selector&lt;/code>.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Default&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>selector&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.button&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>left&lt;/code>&lt;/td>
&lt;td>The mouse button (&lt;code>left&lt;/code>, &lt;code>middle&lt;/code> or &lt;code>right&lt;/code>) to use during the action.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.clickCount&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>1&lt;/code>&lt;/td>
&lt;td>The number of times the action is performed.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.delay&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>0&lt;/code>&lt;/td>
&lt;td>Milliseconds to wait between &lt;code>mousedown&lt;/code> and &lt;code>mouseup&lt;/code>.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.force&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>Setting this to &lt;code>true&lt;/code> will bypass the actionability checks (&lt;code>visible&lt;/code>, &lt;code>stable&lt;/code>, &lt;code>enabled&lt;/code>). Avoid using &lt;code>force: true&lt;/code> in &lt;code>click&lt;/code> actions, as it may mask underlying test design or app issues. It bypasses normal user interaction checks, and elements may not be clickable due to
&lt;a href="/docs/k6/v2.3.x/using-k6-browser/recommended-practices/prevent-cookie-banners-blocking/">cookie banner interference&lt;/a>.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.modifiers&lt;/td>
&lt;td>string[]&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;code>Alt&lt;/code>, &lt;code>Control&lt;/code>, &lt;code>Meta&lt;/code> or &lt;code>Shift&lt;/code> modifiers keys pressed during the action. If not specified, currently pressed modifiers are used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.noWaitAfter&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>If set to &lt;code>true&lt;/code> and a navigation occurs from performing this action, it will not wait for it to complete.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.position&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>A point to use relative to the top left corner of the element. If not supplied, a visible point of the element is used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.position.x&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>0&lt;/code>&lt;/td>
&lt;td>The x coordinate.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.position.y&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>0&lt;/code>&lt;/td>
&lt;td>The y coordinate.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.strict&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>When &lt;code>true&lt;/code>, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.timeout&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>30000&lt;/code>&lt;/td>
&lt;td>Maximum time in milliseconds. Pass &lt;code>0&lt;/code> to disable the timeout. Default is overridden by the &lt;code>setDefaultTimeout&lt;/code> option on
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/">BrowserContext&lt;/a> or
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/page/">Page&lt;/a>.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.trial&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>Setting this to &lt;code>true&lt;/code> will perform the actionability checks without performing the action. Useful to wait until the element is ready for the action without performing it.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Promise&amp;lt;void&amp;gt;&lt;/code>&lt;/td>
&lt;td>A Promise that fulfills when the click action is finished.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>content()</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/content/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/content/</guid><content><![CDATA[&lt;h1 id=&#34;content&#34;&gt;content()&lt;/h1&gt;
&lt;p&gt;Gets the HTML content of the frame.&lt;/p&gt;
&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;string&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fulfills with the HTML content of the frame as a string value or &lt;code&gt;null&lt;/code&gt; if the attribute is not present.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="content">content()&lt;/h1>
&lt;p>Gets the HTML content of the frame.&lt;/p>
&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Promise&amp;lt;string&amp;gt;&lt;/code>&lt;/td>
&lt;td>A Promise that fulfills with the HTML content of the frame as a string value or &lt;code>null&lt;/code> if the attribute is not present.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>dblclick(selector[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/dblclick/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/dblclick/</guid><content><![CDATA[&lt;h1 id=&#34;dblclickselector-options&#34;&gt;dblclick(selector[, options])&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Use locator-based 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/dblclick/&#34;&gt;&lt;code&gt;locator.dblclick([options])&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Double clicks on an element matching the provided selector.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;selector&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A selector to search for an element. The first element will be used if multiple elements match the selector.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.button&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;left&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The mouse button (&lt;code&gt;left&lt;/code&gt;, &lt;code&gt;middle&lt;/code&gt; or &lt;code&gt;right&lt;/code&gt;) to use during the action.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.delay&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;0&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Milliseconds to wait between &lt;code&gt;mousedown&lt;/code&gt; and &lt;code&gt;mouseup&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.force&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Bypasses the actionability checks (&lt;code&gt;visible&lt;/code&gt;, &lt;code&gt;stable&lt;/code&gt;, &lt;code&gt;enabled&lt;/code&gt;) if set to &lt;code&gt;true&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.modifiers&lt;/td&gt;
              &lt;td&gt;string[]&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;Alt&lt;/code&gt;, &lt;code&gt;Control&lt;/code&gt;, &lt;code&gt;Meta&lt;/code&gt; or &lt;code&gt;Shift&lt;/code&gt; modifiers keys pressed during the action. If not specified, currently pressed modifiers are used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.noWaitAfter&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;If set to &lt;code&gt;true&lt;/code&gt; and a navigation occurs from performing this action, it will not wait for it to complete.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.position&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A point to use relative to the top left corner of the element. If not supplied, a visible point of the element is used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.position.x&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;0&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The x coordinate.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.position.y&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;0&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The y coordinate.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.strict&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When &lt;code&gt;true&lt;/code&gt;, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.trial&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Setting this to &lt;code&gt;true&lt;/code&gt; will perform the actionability checks without performing the action.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;void&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fulfills when the double click action is finished.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="dblclickselector-options">dblclick(selector[, options])&lt;/h1>
&lt;div class="admonition admonition-warning">&lt;blockquote>&lt;p class="title text-uppercase">Warning&lt;/p>&lt;p>Use locator-based
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/locator/dblclick/">&lt;code>locator.dblclick([options])&lt;/code>&lt;/a> instead.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>Double clicks on an element matching the provided selector.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Default&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>selector&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>A selector to search for an element. The first element will be used if multiple elements match the selector.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.button&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>left&lt;/code>&lt;/td>
&lt;td>The mouse button (&lt;code>left&lt;/code>, &lt;code>middle&lt;/code> or &lt;code>right&lt;/code>) to use during the action.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.delay&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>0&lt;/code>&lt;/td>
&lt;td>Milliseconds to wait between &lt;code>mousedown&lt;/code> and &lt;code>mouseup&lt;/code>.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.force&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>Bypasses the actionability checks (&lt;code>visible&lt;/code>, &lt;code>stable&lt;/code>, &lt;code>enabled&lt;/code>) if set to &lt;code>true&lt;/code>.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.modifiers&lt;/td>
&lt;td>string[]&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;code>Alt&lt;/code>, &lt;code>Control&lt;/code>, &lt;code>Meta&lt;/code> or &lt;code>Shift&lt;/code> modifiers keys pressed during the action. If not specified, currently pressed modifiers are used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.noWaitAfter&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>If set to &lt;code>true&lt;/code> and a navigation occurs from performing this action, it will not wait for it to complete.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.position&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>A point to use relative to the top left corner of the element. If not supplied, a visible point of the element is used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.position.x&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>0&lt;/code>&lt;/td>
&lt;td>The x coordinate.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.position.y&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>0&lt;/code>&lt;/td>
&lt;td>The y coordinate.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.strict&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>When &lt;code>true&lt;/code>, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.timeout&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>30000&lt;/code>&lt;/td>
&lt;td>Maximum time in milliseconds. Pass &lt;code>0&lt;/code> to disable the timeout. Default is overridden by the &lt;code>setDefaultTimeout&lt;/code> option on
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/">BrowserContext&lt;/a> or
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/page/">Page&lt;/a>.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.trial&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>Setting this to &lt;code>true&lt;/code> will perform the actionability checks without performing the action.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Promise&amp;lt;void&amp;gt;&lt;/code>&lt;/td>
&lt;td>A Promise that fulfills when the double click action is finished.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>dispatchEvent(selector, type, eventInit[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/dispatchevent/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/dispatchevent/</guid><content><![CDATA[&lt;h1 id=&#34;dispatcheventselector-type-eventinit-options&#34;&gt;dispatchEvent(selector, type, eventInit[, options])&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Use locator-based 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/dispatchevent/&#34;&gt;&lt;code&gt;locator.dispatchEvent(type, eventInit[, options])&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Dispatches HTML DOM event types e.g. &lt;code&gt;&#39;click&#39;&lt;/code&gt;.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Defaults&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;selector&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;type&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;DOM event type e.g. &lt;code&gt;&#39;click&#39;&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;eventInit&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Optional event specific properties. See &lt;a href=&#34;#eventinit&#34;&gt;eventInit&lt;/a&gt; for more details.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.strict&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When &lt;code&gt;true&lt;/code&gt;, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;eventinit&#34;&gt;eventInit&lt;/h3&gt;
&lt;p&gt;Since &lt;code&gt;eventInit&lt;/code&gt; is event-specific, please refer to the events documentation for the lists of initial properties:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/API/DragEvent/DragEvent&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;DragEvent&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent/FocusEvent&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;FocusEvent&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/KeyboardEvent&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;KeyboardEvent&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/MouseEvent&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;MouseEvent&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/PointerEvent&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;PointerEvent&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/TouchEvent&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;TouchEvent&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/API/Event/Event&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Event&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;void&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fulfills when the event is dispatched.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="dispatcheventselector-type-eventinit-options">dispatchEvent(selector, type, eventInit[, options])&lt;/h1>
&lt;div class="admonition admonition-warning">&lt;blockquote>&lt;p class="title text-uppercase">Warning&lt;/p>&lt;p>Use locator-based
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/locator/dispatchevent/">&lt;code>locator.dispatchEvent(type, eventInit[, options])&lt;/code>&lt;/a> instead.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>Dispatches HTML DOM event types e.g. &lt;code>'click'&lt;/code>.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Defaults&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>selector&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>type&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>DOM event type e.g. &lt;code>'click'&lt;/code>.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>eventInit&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>Optional event specific properties. See &lt;a href="#eventinit">eventInit&lt;/a> for more details.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.strict&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>When &lt;code>true&lt;/code>, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.timeout&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>30000&lt;/code>&lt;/td>
&lt;td>Maximum time in milliseconds. Pass &lt;code>0&lt;/code> to disable the timeout. Default is overridden by the &lt;code>setDefaultTimeout&lt;/code> option on
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/">BrowserContext&lt;/a> or
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/page/">Page&lt;/a>.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="eventinit">eventInit&lt;/h3>
&lt;p>Since &lt;code>eventInit&lt;/code> is event-specific, please refer to the events documentation for the lists of initial properties:&lt;/p></description></item><item><title>evaluate(pageFunction[, arg])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/evaluate/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/evaluate/</guid><content><![CDATA[&lt;h1 id=&#34;evaluatepagefunction-arg&#34;&gt;evaluate(pageFunction[, arg])&lt;/h1&gt;
&lt;p&gt;Executes JavaScript code in the page and returns the value of the &lt;code&gt;pageFunction&lt;/code&gt; invocation.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Defaults&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;pageFunction&lt;/td&gt;
              &lt;td&gt;function or string&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
              &lt;td&gt;Function to be evaluated in the page context. This can also be a string.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;arg&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Optional argument to pass to &lt;code&gt;pageFunction&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;any&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The value of the &lt;code&gt;pageFunction&lt;/code&gt; invocation.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="evaluatepagefunction-arg">evaluate(pageFunction[, arg])&lt;/h1>
&lt;p>Executes JavaScript code in the page and returns the value of the &lt;code>pageFunction&lt;/code> invocation.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Defaults&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>pageFunction&lt;/td>
&lt;td>function or string&lt;/td>
&lt;td>&lt;/td>
&lt;td>Function to be evaluated in the page context. This can also be a string.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>arg&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>Optional argument to pass to &lt;code>pageFunction&lt;/code>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Promise&amp;lt;any&amp;gt;&lt;/code>&lt;/td>
&lt;td>The value of the &lt;code>pageFunction&lt;/code> invocation.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>evaluateHandle(pageFunction[, arg])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/evaluatehandle/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/evaluatehandle/</guid><content><![CDATA[&lt;h1 id=&#34;evaluatehandlepagefunction-arg&#34;&gt;evaluateHandle(pageFunction[, arg])&lt;/h1&gt;
&lt;p&gt;Executes JavaScript code in the page and returns the value of the &lt;code&gt;pageFunction&lt;/code&gt; invocation as a 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/jshandle/&#34;&gt;JSHandle&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The only difference between &lt;code&gt;page.evaluate()&lt;/code&gt; and &lt;code&gt;page.evaluateHandle()&lt;/code&gt; is that &lt;code&gt;page.evaluateHandle()&lt;/code&gt; returns 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/jshandle/&#34;&gt;JSHandle&lt;/a&gt;.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Defaults&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;pageFunction&lt;/td&gt;
              &lt;td&gt;function or string&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
              &lt;td&gt;Function to be evaluated in the page context. This can also be a string.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;arg&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Optional argument to pass to &lt;code&gt;pageFunction&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;JSHandle&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/jshandle/&#34;&gt;JSHandle&lt;/a&gt; instance associated with the frame.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="evaluatehandlepagefunction-arg">evaluateHandle(pageFunction[, arg])&lt;/h1>
&lt;p>Executes JavaScript code in the page and returns the value of the &lt;code>pageFunction&lt;/code> invocation as a
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/jshandle/">JSHandle&lt;/a>.&lt;/p>
&lt;p>The only difference between &lt;code>page.evaluate()&lt;/code> and &lt;code>page.evaluateHandle()&lt;/code> is that &lt;code>page.evaluateHandle()&lt;/code> returns
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/jshandle/">JSHandle&lt;/a>.&lt;/p></description></item><item><title>fill(selector, value[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/fill/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/fill/</guid><content><![CDATA[&lt;h1 id=&#34;fillselector-value-options&#34;&gt;fill(selector, value[, options])&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Use locator-based 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/fill/&#34;&gt;&lt;code&gt;locator.fill(value[, options])&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Fill an &lt;code&gt;input&lt;/code&gt;, &lt;code&gt;textarea&lt;/code&gt; or &lt;code&gt;contenteditable&lt;/code&gt; element with the provided value.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;selector&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;value&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Value to fill out for the &lt;code&gt;input&lt;/code&gt;, &lt;code&gt;textarea&lt;/code&gt; or &lt;code&gt;contenteditable&lt;/code&gt; element.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.force&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Setting this to &lt;code&gt;true&lt;/code&gt; will bypass the actionability checks (&lt;code&gt;visible&lt;/code&gt;, &lt;code&gt;stable&lt;/code&gt;, &lt;code&gt;enabled&lt;/code&gt;).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.noWaitAfter&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;If set to &lt;code&gt;true&lt;/code&gt; and a navigation occurs from performing this action, it will not wait for it to complete.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.strict&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When &lt;code&gt;true&lt;/code&gt;, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;void&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fulfills when the element is filled with the value.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="fillselector-value-options">fill(selector, value[, options])&lt;/h1>
&lt;div class="admonition admonition-warning">&lt;blockquote>&lt;p class="title text-uppercase">Warning&lt;/p>&lt;p>Use locator-based
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/locator/fill/">&lt;code>locator.fill(value[, options])&lt;/code>&lt;/a> instead.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>Fill an &lt;code>input&lt;/code>, &lt;code>textarea&lt;/code> or &lt;code>contenteditable&lt;/code> element with the provided value.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Default&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>selector&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>value&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>Value to fill out for the &lt;code>input&lt;/code>, &lt;code>textarea&lt;/code> or &lt;code>contenteditable&lt;/code> element.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.force&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>Setting this to &lt;code>true&lt;/code> will bypass the actionability checks (&lt;code>visible&lt;/code>, &lt;code>stable&lt;/code>, &lt;code>enabled&lt;/code>).&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.noWaitAfter&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>If set to &lt;code>true&lt;/code> and a navigation occurs from performing this action, it will not wait for it to complete.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.strict&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>When &lt;code>true&lt;/code>, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.timeout&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>30000&lt;/code>&lt;/td>
&lt;td>Maximum time in milliseconds. Pass &lt;code>0&lt;/code> to disable the timeout. Default is overridden by the &lt;code>setDefaultTimeout&lt;/code> option on
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/">BrowserContext&lt;/a> or
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/page/">Page&lt;/a>.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Promise&amp;lt;void&amp;gt;&lt;/code>&lt;/td>
&lt;td>A Promise that fulfills when the element is filled with the value.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>focus(selector[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/focus/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/focus/</guid><content><![CDATA[&lt;h1 id=&#34;focusselector-options&#34;&gt;focus(selector[, options])&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Use locator-based 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/focus/&#34;&gt;&lt;code&gt;locator.focus([options])&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;This method fetches an element with &lt;code&gt;selector&lt;/code&gt; and focuses it.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;selector&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.strict&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When &lt;code&gt;true&lt;/code&gt;, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;void&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fulfills when the element is focused.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="focusselector-options">focus(selector[, options])&lt;/h1>
&lt;div class="admonition admonition-warning">&lt;blockquote>&lt;p class="title text-uppercase">Warning&lt;/p>&lt;p>Use locator-based
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/locator/focus/">&lt;code>locator.focus([options])&lt;/code>&lt;/a> instead.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>This method fetches an element with &lt;code>selector&lt;/code> and focuses it.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Default&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>selector&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.strict&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>When &lt;code>true&lt;/code>, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.timeout&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>30000&lt;/code>&lt;/td>
&lt;td>Maximum time in milliseconds. Pass &lt;code>0&lt;/code> to disable the timeout. Default is overridden by the &lt;code>setDefaultTimeout&lt;/code> option on
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/">BrowserContext&lt;/a> or
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/page/">Page&lt;/a>.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Promise&amp;lt;void&amp;gt;&lt;/code>&lt;/td>
&lt;td>A Promise that fulfills when the element is focused.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>frameElement()</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/frameelement/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/frameelement/</guid><content><![CDATA[&lt;h1 id=&#34;frameelement&#34;&gt;frameElement()&lt;/h1&gt;
&lt;p&gt;This method returns the frame&amp;rsquo;s &lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/API/Element&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;DOM element&lt;/a&gt; as an 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/elementhandle/&#34;&gt;ElementHandle&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;ElementHandle&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fulfills with the 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/elementhandle/&#34;&gt;ElementHandle&lt;/a&gt; of the frame&amp;rsquo;s DOM element.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="frameelement">frameElement()&lt;/h1>
&lt;p>This method returns the frame&amp;rsquo;s &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Element" target="_blank" rel="noopener noreferrer">DOM element&lt;/a> as an
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/elementhandle/">ElementHandle&lt;/a>.&lt;/p>
&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Promise&amp;lt;ElementHandle&amp;gt;&lt;/code>&lt;/td>
&lt;td>A Promise that fulfills with the
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/elementhandle/">ElementHandle&lt;/a> of the frame&amp;rsquo;s DOM element.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>frameLocator(selector)</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/framelocator/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/framelocator/</guid><content><![CDATA[&lt;h1 id=&#34;framelocatorselector&#34;&gt;frameLocator(selector)&lt;/h1&gt;
&lt;p&gt;Returns a 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/framelocator/&#34;&gt;FrameLocator&lt;/a&gt; for the iframe that matches the given &lt;code&gt;selector&lt;/code&gt; within this frame. Use this to interact with elements inside nested iframes.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;selector&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;A selector that resolves to an iframe element (for example &lt;code&gt;iframe#payment&lt;/code&gt; or &lt;code&gt;iframe[name=&amp;quot;form&amp;quot;]&lt;/code&gt;).&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/framelocator/&#34;&gt;FrameLocator&lt;/a&gt;&lt;/td&gt;
              &lt;td&gt;A &lt;code&gt;FrameLocator&lt;/code&gt; for the matched nested iframe.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;example&#34;&gt;Example&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;

export const options = {
  scenarios: {
    browser: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  },
};

export default async function () {
  const page = await browser.newPage();

  try {
    await page.goto(&amp;#39;https://example.com/page-with-nested-iframes&amp;#39;);

    // Get the outer frame, then locate a nested iframe inside it
    const mainFrame = page.mainFrame();
    const innerFrame = mainFrame.frameLocator(&amp;#39;iframe#inner&amp;#39;);
    await innerFrame.locator(&amp;#39;button&amp;#39;).click();
  } finally {
    await page.close();
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="framelocatorselector">frameLocator(selector)&lt;/h1>
&lt;p>Returns a
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/framelocator/">FrameLocator&lt;/a> for the iframe that matches the given &lt;code>selector&lt;/code> within this frame. Use this to interact with elements inside nested iframes.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>selector&lt;/td>
&lt;td>string&lt;/td>
&lt;td>A selector that resolves to an iframe element (for example &lt;code>iframe#payment&lt;/code> or &lt;code>iframe[name=&amp;quot;form&amp;quot;]&lt;/code>).&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/framelocator/">FrameLocator&lt;/a>&lt;/td>
&lt;td>A &lt;code>FrameLocator&lt;/code> for the matched nested iframe.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="example">Example&lt;/h3>
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">JavaScript&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-javascript">import { browser } from &amp;#39;k6/browser&amp;#39;;
export const options = {
scenarios: {
browser: {
executor: &amp;#39;shared-iterations&amp;#39;,
options: {
browser: {
type: &amp;#39;chromium&amp;#39;,
},
},
},
},
};
export default async function () {
const page = await browser.newPage();
try {
await page.goto(&amp;#39;https://example.com/page-with-nested-iframes&amp;#39;);
// Get the outer frame, then locate a nested iframe inside it
const mainFrame = page.mainFrame();
const innerFrame = mainFrame.frameLocator(&amp;#39;iframe#inner&amp;#39;);
await innerFrame.locator(&amp;#39;button&amp;#39;).click();
} finally {
await page.close();
}
}&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div></description></item><item><title>getAttribute(selector, name[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getattribute/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getattribute/</guid><content><![CDATA[&lt;h1 id=&#34;getattributeselector-name-options&#34;&gt;getAttribute(selector, name[, options])&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Use locator-based 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/getattribute/&#34;&gt;&lt;code&gt;locator.getAttribute()&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Returns the element attribute value for the given attribute name.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;selector&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;name&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Attribute name to get the value for.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.strict&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When &lt;code&gt;true&lt;/code&gt;, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;string | null&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fulfills with the value of the attribute. Else, it returns &lt;code&gt;null&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="getattributeselector-name-options">getAttribute(selector, name[, options])&lt;/h1>
&lt;div class="admonition admonition-warning">&lt;blockquote>&lt;p class="title text-uppercase">Warning&lt;/p>&lt;p>Use locator-based
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/locator/getattribute/">&lt;code>locator.getAttribute()&lt;/code>&lt;/a> instead.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>Returns the element attribute value for the given attribute name.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Default&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>selector&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>name&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>Attribute name to get the value for.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.strict&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>When &lt;code>true&lt;/code>, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.timeout&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>30000&lt;/code>&lt;/td>
&lt;td>Maximum time in milliseconds. Pass &lt;code>0&lt;/code> to disable the timeout. Default is overridden by the &lt;code>setDefaultTimeout&lt;/code> option on
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/">BrowserContext&lt;/a> or
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/page/">Page&lt;/a>.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Promise&amp;lt;string | null&amp;gt;&lt;/code>&lt;/td>
&lt;td>A Promise that fulfills with the value of the attribute. Else, it returns &lt;code>null&lt;/code>.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>getByAltText(altText[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbyalttext/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbyalttext/</guid><content><![CDATA[

&lt;div data-shared=&#34;browser/getby-apis/getbyalttext-spec.md&#34;&gt;
            &lt;h1 id=&#34;getbyalttextalttext-options&#34;&gt;getByAltText(altText[, options])&lt;/h1&gt;
&lt;p&gt;Returns a locator for elements with the specified alt text. This method is useful for locating images and other elements that have an &lt;code&gt;alt&lt;/code&gt; attribute, making your tests more accessible and user-focused.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;altText&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;string | RegExp&lt;/td&gt;
              &lt;td&gt;-&lt;/td&gt;
              &lt;td&gt;Required. The alt text to search for. Can be a string for exact match or a RegExp for pattern matching.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;options&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;options.exact&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Whether to match the alt text exactly with case sensitivity. When &lt;code&gt;true&lt;/code&gt;, performs a case-sensitive match.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;returns&#34;&gt;Returns&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/&#34;&gt;Locator&lt;/a&gt;&lt;/td&gt;
              &lt;td&gt;A locator object that can be used to interact with elements matching the specified alt text.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;/div&gt;

        
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;h3 id=&#34;basic-alt-text-matching&#34;&gt;Basic alt text matching&lt;/h3&gt;
&lt;p&gt;Find and click an image by its alt text:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;

export const options = {
  scenarios: {
    ui: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  },
};

export default async function () {
  const page = await browser.newPage();

  try {
    await page.goto(&amp;#39;https://quickpizza.grafana.com&amp;#39;);

    const logo = page.mainFrame().getByAltText(&amp;#39;LOGO&amp;#39;);
    await logo.waitFor();

    await logo.click();
    await page.waitForLoadState();
  } finally {
    await page.close();
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;exact-alt-text-matching&#34;&gt;Exact alt text matching&lt;/h3&gt;
&lt;p&gt;Use exact matching for precise alt text:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;

export const options = {
  scenarios: {
    ui: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  },
};

export default async function () {
  const page = await browser.newPage();

  try {
    await page.goto(&amp;#39;https://quickpizza.grafana.com&amp;#39;);

    const logo = page.mainFrame().getByAltText(&amp;#39;logo&amp;#39;, { exact: true });
    await logo.waitFor();

    await logo.click();
    await page.waitForLoadState();
  } finally {
    await page.close();
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;using-regular-expressions&#34;&gt;Using regular expressions&lt;/h3&gt;
&lt;p&gt;Find images using pattern matching:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;

export const options = {
  scenarios: {
    ui: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  },
};

export default async function () {
  const page = await browser.newPage();

  try {
    await page.goto(&amp;#39;https://quickpizza.grafana.com&amp;#39;);

    const logo = page.mainFrame().getByAltText(/logo/s);
    await logo.waitFor();

    await logo.click();
    await page.waitForLoadState();
  } finally {
    await page.close();
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;div data-shared=&#34;browser/getby-apis/getbyalttext-tips.md&#34;&gt;
            &lt;h2 id=&#34;common-use-cases&#34;&gt;Common use cases&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Image testing:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Testing image alt text for accessibility compliance&lt;/li&gt;
&lt;li&gt;Interacting with clickable images/banners&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Accessibility testing:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Ensuring all images have meaningful alt text&lt;/li&gt;
&lt;li&gt;Testing screen reader compatibility&lt;/li&gt;
&lt;li&gt;Validating WCAG compliance&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;UI interaction:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Clicking on logo images to navigate home&lt;/li&gt;
&lt;li&gt;Selecting images in galleries or carousels&lt;/li&gt;
&lt;li&gt;Interacting with image-based buttons&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;best-practices&#34;&gt;Best practices&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Use descriptive alt text&lt;/strong&gt;: When creating tests, ensure your application uses meaningful alt text that describes the image content or function.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Prefer exact matches&lt;/strong&gt;: Use &lt;code&gt;exact: true&lt;/code&gt; when you need precise matching to avoid false positives.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Accessibility-first&lt;/strong&gt;: Using &lt;code&gt;getByAltText()&lt;/code&gt; encourages better accessibility practices by ensuring images have proper alt attributes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Regular expressions for patterns&lt;/strong&gt;: Use RegExp for flexible matching when dealing with dynamic or numbered content.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Combine with assertions&lt;/strong&gt;: Always verify that the located elements behave as expected using assertions.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;

        
&lt;h2 id=&#34;related&#34;&gt;Related&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbyrole/&#34;&gt;frame.getByRole()&lt;/a&gt; - Locate by ARIA role&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbylabel/&#34;&gt;frame.getByLabel()&lt;/a&gt; - Locate by form labels&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbyplaceholder/&#34;&gt;frame.getByPlaceholder()&lt;/a&gt; - Locate by placeholder text&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbytestid/&#34;&gt;frame.getByTestId()&lt;/a&gt; - Locate by test ID&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbytitle/&#34;&gt;frame.getByTitle()&lt;/a&gt; - Locate by title attribute&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbytext/&#34;&gt;frame.getByText()&lt;/a&gt; - Locate by visible text&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;div data-shared="browser/getby-apis/getbyalttext-spec.md">
&lt;h1 id="getbyalttextalttext-options">getByAltText(altText[, options])&lt;/h1>
&lt;p>Returns a locator for elements with the specified alt text. This method is useful for locating images and other elements that have an &lt;code>alt&lt;/code> attribute, making your tests more accessible and user-focused.&lt;/p></description></item><item><title>getByLabel(text[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbylabel/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbylabel/</guid><content><![CDATA[

&lt;div data-shared=&#34;browser/getby-apis/getbylabel-spec.md&#34;&gt;
            &lt;h1 id=&#34;getbylabeltext-options&#34;&gt;getByLabel(text[, options])&lt;/h1&gt;
&lt;p&gt;Returns a locator for form controls associated with the specified label text. This method is ideal for interacting with form elements in an accessible and user-focused way, as it mirrors how users typically identify form fields.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;text&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;string | RegExp&lt;/td&gt;
              &lt;td&gt;-&lt;/td&gt;
              &lt;td&gt;Required. The label text to search for. Can be a string for exact match or a RegExp for pattern matching.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;options&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;options.exact&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Whether to match the label text exactly with case sensitivity. When &lt;code&gt;true&lt;/code&gt;, performs a case-sensitive match.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;returns&#34;&gt;Returns&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/&#34;&gt;Locator&lt;/a&gt;&lt;/td&gt;
              &lt;td&gt;A locator object that can be used to interact with the form control associated with the specified label.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;/div&gt;

        
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;h3 id=&#34;basic-form-interaction&#34;&gt;Basic form interaction&lt;/h3&gt;
&lt;p&gt;Fill form fields using their labels:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;

export const options = {
  scenarios: {
    ui: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  },
};

export default async function () {
  const page = await browser.newPage();

  try {
    await page.setContent(`
      &amp;lt;label for=&amp;#34;username&amp;#34;&amp;gt;Username (hint: default)&amp;lt;/label&amp;gt;
      &amp;lt;input type=&amp;#34;text&amp;#34; id=&amp;#34;username&amp;#34; name=&amp;#34;username&amp;#34;&amp;gt;
      &amp;lt;label for=&amp;#34;password&amp;#34;&amp;gt;Password (hint: 12345678)&amp;lt;/label&amp;gt;
      &amp;lt;input type=&amp;#34;password&amp;#34; id=&amp;#34;password&amp;#34; name=&amp;#34;password&amp;#34;&amp;gt;
    `);

    const frame = page.mainFrame();
    const username = frame.getByLabel(&amp;#39;Username (hint: default)&amp;#39;, { exact: true });
    const password = frame.getByLabel(/^Password.*$/);

    await username.fill(&amp;#39;default&amp;#39;);
    await password.fill(&amp;#39;12345678&amp;#39;);
  } finally {
    await page.close();
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;working-with-different-input-types&#34;&gt;Working with different input types&lt;/h3&gt;
&lt;p&gt;Handle various form control types in various label association patterns:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;

export const options = {
  scenarios: {
    browser: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  },
};

export default async function () {
  const page = await browser.newPage();

  try {
    await page.setContent(`
      &amp;lt;label for=&amp;#34;username&amp;#34;&amp;gt;Username (hint: default)&amp;lt;/label&amp;gt;
      &amp;lt;input type=&amp;#34;text&amp;#34; id=&amp;#34;username&amp;#34; name=&amp;#34;username&amp;#34;&amp;gt;
      &amp;lt;span id=&amp;#34;password-label&amp;#34;&amp;gt;Password (hint: 12345678)&amp;lt;/span&amp;gt;
      &amp;lt;input type=&amp;#34;password&amp;#34; aria-labelledby=&amp;#34;password-label&amp;#34;&amp;gt;
      &amp;lt;label for=&amp;#34;subscribe&amp;#34;&amp;gt;Subscribe to newsletter&amp;lt;/label&amp;gt;
      &amp;lt;input type=&amp;#34;checkbox&amp;#34; id=&amp;#34;subscribe&amp;#34; name=&amp;#34;subscribe&amp;#34;&amp;gt;
      &amp;lt;label for=&amp;#34;email&amp;#34;&amp;gt;Email&amp;lt;/label&amp;gt;
      &amp;lt;input type=&amp;#34;radio&amp;#34; id=&amp;#34;email&amp;#34; value=&amp;#34;email&amp;#34;&amp;gt;
      &amp;lt;label for=&amp;#34;sms&amp;#34;&amp;gt;Text message&amp;lt;/label&amp;gt;
      &amp;lt;input type=&amp;#34;radio&amp;#34; id=&amp;#34;sms&amp;#34; value=&amp;#34;sms&amp;#34;&amp;gt;
      &amp;lt;label for=&amp;#34;theme&amp;#34;&amp;gt;Theme&amp;lt;/label&amp;gt;
      &amp;lt;select id=&amp;#34;theme&amp;#34; name=&amp;#34;theme&amp;#34;&amp;gt;
        &amp;lt;option value=&amp;#34;light&amp;#34;&amp;gt;Light&amp;lt;/option&amp;gt;
        &amp;lt;option value=&amp;#34;dark&amp;#34;&amp;gt;Dark&amp;lt;/option&amp;gt;
        &amp;lt;option value=&amp;#34;system&amp;#34;&amp;gt;System&amp;lt;/option&amp;gt;
      &amp;lt;/select&amp;gt;
      &amp;lt;textarea aria-label=&amp;#34;Comments&amp;#34;&amp;gt;&amp;lt;/textarea&amp;gt;
    `);

    const frame = page.mainFrame();

    // Inputs
    await frame.getByLabel(&amp;#39;Username (hint: default)&amp;#39;, { exact: true }).fill(&amp;#39;default&amp;#39;);
    await frame.getByLabel(/^Password.*$/).fill(&amp;#39;12345678&amp;#39;);

    // Checkbox
    await frame.getByLabel(&amp;#39;Subscribe to newsletter&amp;#39;).check();

    // Radio button
    await frame.getByLabel(&amp;#39;Email&amp;#39;, { exact: true }).check();

    // Select dropdown
    await frame.getByLabel(&amp;#39;Theme&amp;#39;).selectOption(&amp;#39;light&amp;#39;);

    // Textarea
    await frame.getByLabel(&amp;#39;Comments&amp;#39;).fill(&amp;#39;This is a test comment&amp;#39;);
  } finally {
    await page.close();
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;div data-shared=&#34;browser/getby-apis/getbylabel-tips.md&#34;&gt;
            &lt;h2 id=&#34;label-association-patterns&#34;&gt;Label association patterns&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;getByLabel()&lt;/code&gt; method works with several HTML patterns for associating labels with form controls:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Explicit association with &lt;code&gt;for&lt;/code&gt; attribute:&lt;/p&gt;
&lt;!-- eslint-skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;HTML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-html&#34;&gt;&amp;lt;label for=&amp;#34;username&amp;#34;&amp;gt;Username&amp;lt;/label&amp;gt; &amp;lt;input type=&amp;#34;text&amp;#34; id=&amp;#34;username&amp;#34; name=&amp;#34;username&amp;#34; /&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;ARIA labeling:&lt;/p&gt;
&lt;!-- eslint-skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;HTML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-html&#34;&gt;&amp;lt;span id=&amp;#34;username-label&amp;#34;&amp;gt;Username&amp;lt;/span&amp;gt; &amp;lt;input type=&amp;#34;text&amp;#34; aria-labelledby=&amp;#34;username-label&amp;#34; /&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;ARIA label attribute:&lt;/p&gt;
&lt;!-- eslint-skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;HTML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-html&#34;&gt;&amp;lt;input type=&amp;#34;text&amp;#34; aria-label=&amp;#34;Username&amp;#34; /&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;common-use-cases&#34;&gt;Common use cases&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Form testing&lt;/strong&gt;: Login forms, registration forms, contact forms&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;E-commerce&lt;/strong&gt;: Checkout forms, shipping information, payment details&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Settings pages&lt;/strong&gt;: User preferences, account settings, configuration forms&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Accessibility testing&lt;/strong&gt;: Ensuring proper label association and screen reader compatibility&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;best-practices&#34;&gt;Best practices&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Accessibility-first approach&lt;/strong&gt;: Using &lt;code&gt;getByLabel()&lt;/code&gt; ensures your tests work the same way users with assistive technology interact with forms.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Meaningful labels&lt;/strong&gt;: Encourage developers to use descriptive, unique label text that clearly identifies the form control&amp;rsquo;s purpose.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Required field indicators&lt;/strong&gt;: When testing required fields, include any visual indicators (like asterisks) in your label text matching.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Form validation testing&lt;/strong&gt;: Use labels to test form validation scenarios, as they provide a stable way to identify fields regardless of styling changes.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;

        
&lt;h2 id=&#34;related&#34;&gt;Related&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbyrole/&#34;&gt;frame.getByRole()&lt;/a&gt; - Locate by ARIA role&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbyalttext/&#34;&gt;frame.getByAltText()&lt;/a&gt; - Locate by alt text&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbyplaceholder/&#34;&gt;frame.getByPlaceholder()&lt;/a&gt; - Locate by placeholder text&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbytestid/&#34;&gt;frame.getByTestId()&lt;/a&gt; - Locate by test ID&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbytitle/&#34;&gt;frame.getByTitle()&lt;/a&gt; - Locate by title attribute&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbytext/&#34;&gt;frame.getByText()&lt;/a&gt; - Locate by text content&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;div data-shared="browser/getby-apis/getbylabel-spec.md">
&lt;h1 id="getbylabeltext-options">getByLabel(text[, options])&lt;/h1>
&lt;p>Returns a locator for form controls associated with the specified label text. This method is ideal for interacting with form elements in an accessible and user-focused way, as it mirrors how users typically identify form fields.&lt;/p></description></item><item><title>getByPlaceholder(placeholder[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbyplaceholder/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbyplaceholder/</guid><content><![CDATA[

&lt;div data-shared=&#34;browser/getby-apis/getbyplaceholder-spec.md&#34;&gt;
            &lt;h1 id=&#34;getbyplaceholderplaceholder-options&#34;&gt;getByPlaceholder(placeholder[, options])&lt;/h1&gt;
&lt;p&gt;Returns a locator for input elements with the specified &lt;code&gt;placeholder&lt;/code&gt; attribute. This method is useful for locating form fields that use &lt;code&gt;placeholder&lt;/code&gt; attribute to provide hints or examples to users about the expected input format.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;placeholder&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;string | RegExp&lt;/td&gt;
              &lt;td&gt;-&lt;/td&gt;
              &lt;td&gt;Required. The placeholder text to search for. Can be a string for exact match or a RegExp for pattern matching.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;options&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;options.exact&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Whether to match the placeholder text exactly with case sensitivity. When &lt;code&gt;true&lt;/code&gt;, performs a case-sensitive match.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;returns&#34;&gt;Returns&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/&#34;&gt;Locator&lt;/a&gt;&lt;/td&gt;
              &lt;td&gt;A locator object that can be used to interact with the input elements matching the specified placeholder text.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;/div&gt;

        
&lt;h2 id=&#34;example&#34;&gt;Example&lt;/h2&gt;
&lt;p&gt;Find and fill inputs by their placeholder text:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;

export const options = {
  scenarios: {
    browser: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  },
};

export default async function () {
  const page = await browser.newPage();

  try {
    await page.setContent(`
      &amp;lt;input type=&amp;#34;text&amp;#34; placeholder=&amp;#34;First name&amp;#34;&amp;gt;
      &amp;lt;input type=&amp;#34;text&amp;#34; placeholder=&amp;#34;Last name&amp;#34;&amp;gt;
      &amp;lt;input type=&amp;#34;text&amp;#34; placeholder=&amp;#34;dd/mm/yyyy&amp;#34;&amp;gt;
      &amp;lt;input type=&amp;#34;text&amp;#34; placeholder=&amp;#34;your.email@example.com&amp;#34;&amp;gt;
      &amp;lt;input type=&amp;#34;text&amp;#34; placeholder=&amp;#34;&amp;#43;1 (555) 123-4567&amp;#34;&amp;gt;
    `);

    const frame = page.mainFrame();
    await frame.getByPlaceholder(&amp;#39;First name&amp;#39;).fill(&amp;#39;First&amp;#39;);
    await frame.getByPlaceholder(&amp;#39;Last name&amp;#39;).fill(&amp;#39;Last&amp;#39;);
    await frame.getByPlaceholder(&amp;#39;dd/mm/yyyy&amp;#39;).fill(&amp;#39;01/01/1990&amp;#39;);

    await frame.getByPlaceholder(&amp;#39;your.email@example.com&amp;#39;).fill(&amp;#39;first.last@example.com&amp;#39;);
    await frame.getByPlaceholder(&amp;#39;&amp;#43;1 (555) 123-4567&amp;#39;).fill(&amp;#39;&amp;#43;1 (555) 987-6543&amp;#39;);
  } finally {
    await page.close();
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;div data-shared=&#34;browser/getby-apis/getbyplaceholder-tips.md&#34;&gt;
            &lt;h2 id=&#34;common-use-cases&#34;&gt;Common use cases&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Form field identification:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Login and registration forms without explicit labels&lt;/li&gt;
&lt;li&gt;Quick search boxes&lt;/li&gt;
&lt;li&gt;Filter and input controls&lt;/li&gt;
&lt;li&gt;Comment and feedback forms&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;E-commerce:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Product search bars&lt;/li&gt;
&lt;li&gt;Quantity input fields&lt;/li&gt;
&lt;li&gt;Promo code entry&lt;/li&gt;
&lt;li&gt;Address and payment information&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Interactive applications:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Chat input fields&lt;/li&gt;
&lt;li&gt;Command input interfaces&lt;/li&gt;
&lt;li&gt;Settings and configuration forms&lt;/li&gt;
&lt;li&gt;Data entry applications&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;best-practices&#34;&gt;Best practices&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Complement, don&amp;rsquo;t replace labels&lt;/strong&gt;: Placeholder text should supplement, not replace proper form labels for accessibility.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use descriptive placeholders&lt;/strong&gt;: Ensure placeholder text clearly indicates the expected input format or content.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Consider internationalization&lt;/strong&gt;: When testing multi-language applications, be aware that placeholder text may change.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Accessibility considerations&lt;/strong&gt;: Remember that placeholder text alone may not be sufficient for users with disabilities.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;

        
&lt;h2 id=&#34;related&#34;&gt;Related&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbyrole/&#34;&gt;frame.getByRole()&lt;/a&gt; - Locate by ARIA role&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbyalttext/&#34;&gt;frame.getByAltText()&lt;/a&gt; - Locate by alt text&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbylabel/&#34;&gt;frame.getByLabel()&lt;/a&gt; - Locate by form labels (preferred for accessibility)&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbytestid/&#34;&gt;frame.getByTestId()&lt;/a&gt; - Locate by test ID&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbytitle/&#34;&gt;frame.getByTitle()&lt;/a&gt; - Locate by title attribute&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbytext/&#34;&gt;frame.getByText()&lt;/a&gt; - Locate by visible text&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;div data-shared="browser/getby-apis/getbyplaceholder-spec.md">
&lt;h1 id="getbyplaceholderplaceholder-options">getByPlaceholder(placeholder[, options])&lt;/h1>
&lt;p>Returns a locator for input elements with the specified &lt;code>placeholder&lt;/code> attribute. This method is useful for locating form fields that use &lt;code>placeholder&lt;/code> attribute to provide hints or examples to users about the expected input format.&lt;/p></description></item><item><title>getByRole(role[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbyrole/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbyrole/</guid><content><![CDATA[

&lt;div data-shared=&#34;browser/getby-apis/getbyrole-spec.md&#34;&gt;
            &lt;h1 id=&#34;getbyrolerole-options&#34;&gt;getByRole(role[, options])&lt;/h1&gt;
&lt;p&gt;Returns a locator for elements with the specified ARIA role. This is the preferred way to locate elements as it most closely resembles how users and assistive technology perceive the page.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;role&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;-&lt;/td&gt;
              &lt;td&gt;Required. The ARIA role to search for. For example, &lt;code&gt;&#39;button&#39;&lt;/code&gt;, &lt;code&gt;&#39;link&#39;&lt;/code&gt;, &lt;code&gt;&#39;heading&#39;&lt;/code&gt;, or &lt;code&gt;&#39;textbox&#39;&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;options.checked&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Filter elements by their checked state. Only applicable for roles like &lt;code&gt;checkbox&lt;/code&gt;, &lt;code&gt;radio&lt;/code&gt;, &lt;code&gt;menuitemcheckbox&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;options.disabled&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Filter elements by their disabled state.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;options.exact&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Whether to match the accessible name exactly with case sensitivity. When &lt;code&gt;true&lt;/code&gt;, performs a case-sensitive match.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;options.expanded&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Filter elements by their expanded state. Only applicable for roles that support the &lt;code&gt;aria-expanded&lt;/code&gt; attribute.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;options.includeHidden&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Whether to include elements that are normally excluded from the accessibility tree in the search.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;options.level&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Filter headings by their level 1 to 6. Only applicable for &lt;code&gt;heading&lt;/code&gt; role.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;options.name&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;string|RegExp&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Filter elements by their accessible name. The accessible name is typically the text content, label text, or aria-label attribute.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;options.pressed&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Filter elements by their pressed state. Only applicable for roles like &lt;code&gt;button&lt;/code&gt; with toggle behavior.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;options.selected&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Filter elements by their selected state. Only applicable for roles like &lt;code&gt;option&lt;/code&gt;, &lt;code&gt;tab&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;returns&#34;&gt;Returns&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/&#34;&gt;Locator&lt;/a&gt;&lt;/td&gt;
              &lt;td&gt;A locator object that can be used to interact with the elements matching the specified role and options.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;/div&gt;

        
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;h3 id=&#34;basic-role-selection&#34;&gt;Basic role selection&lt;/h3&gt;
&lt;p&gt;Find and click a button by its role:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;

export const options = {
  scenarios: {
    browser: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  },
};

export default async function () {
  const page = await browser.newPage();

  try {
    await page.goto(&amp;#39;https://quickpizza.grafana.com/&amp;#39;);

    const frame = page.mainFrame();
    await frame.getByRole(&amp;#39;button&amp;#39;, { name: &amp;#39;Pizza, Please!&amp;#39; }).click();
  } finally {
    page.close();
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;div data-shared=&#34;browser/getby-apis/getbyrole-tips.md&#34;&gt;
            &lt;h2 id=&#34;complete-aria-roles-reference&#34;&gt;Complete ARIA roles reference&lt;/h2&gt;
&lt;p&gt;The following roles are supported and can be used with &lt;code&gt;getByRole()&lt;/code&gt;, organized by category:&lt;/p&gt;
&lt;h3 id=&#34;widgets--inputs&#34;&gt;Widgets &amp;amp; Inputs&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;button&lt;/code&gt; - Buttons and clickable elements&lt;/li&gt;
&lt;li&gt;&lt;code&gt;checkbox&lt;/code&gt; - Checkable boxes that can be on/off&lt;/li&gt;
&lt;li&gt;&lt;code&gt;combobox&lt;/code&gt; - Editable drop-down menu combining input and list box&lt;/li&gt;
&lt;li&gt;&lt;code&gt;listbox&lt;/code&gt; - Container for selectable list options&lt;/li&gt;
&lt;li&gt;&lt;code&gt;menu&lt;/code&gt; - Menu of actions or navigation&lt;/li&gt;
&lt;li&gt;&lt;code&gt;menubar&lt;/code&gt; - Container for top-level menus&lt;/li&gt;
&lt;li&gt;&lt;code&gt;menuitem&lt;/code&gt; - Option within a menu&lt;/li&gt;
&lt;li&gt;&lt;code&gt;menuitemcheckbox&lt;/code&gt; - Checkable menu item&lt;/li&gt;
&lt;li&gt;&lt;code&gt;menuitemradio&lt;/code&gt; - Mutually exclusive menu item&lt;/li&gt;
&lt;li&gt;&lt;code&gt;meter&lt;/code&gt; - Scalar measurement within a known range&lt;/li&gt;
&lt;li&gt;&lt;code&gt;option&lt;/code&gt; - Selectable option in a list box or combo box&lt;/li&gt;
&lt;li&gt;&lt;code&gt;progressbar&lt;/code&gt; - Progress indicator of an operation&lt;/li&gt;
&lt;li&gt;&lt;code&gt;radio&lt;/code&gt; - Single-select option in a group&lt;/li&gt;
&lt;li&gt;&lt;code&gt;radiogroup&lt;/code&gt; - Grouping of related radio buttons&lt;/li&gt;
&lt;li&gt;&lt;code&gt;scrollbar&lt;/code&gt; - Control for scrolling content&lt;/li&gt;
&lt;li&gt;&lt;code&gt;searchbox&lt;/code&gt; - Text field for search input&lt;/li&gt;
&lt;li&gt;&lt;code&gt;separator&lt;/code&gt; - Divider that separates content or controls&lt;/li&gt;
&lt;li&gt;&lt;code&gt;slider&lt;/code&gt; - Adjustable value control within a range&lt;/li&gt;
&lt;li&gt;&lt;code&gt;spinbutton&lt;/code&gt; - Numeric input with increment/decrement controls&lt;/li&gt;
&lt;li&gt;&lt;code&gt;status&lt;/code&gt; - Advisory status information (non-alert)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;switch&lt;/code&gt; - On/off toggle control&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tab&lt;/code&gt; - A tab in a tabbed interface&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tablist&lt;/code&gt; - Container for a set of tabs&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tabpanel&lt;/code&gt; - Content panel associated with a tab&lt;/li&gt;
&lt;li&gt;&lt;code&gt;textbox&lt;/code&gt; - Input field for free-form text&lt;/li&gt;
&lt;li&gt;&lt;code&gt;timer&lt;/code&gt; - Running time display that updates&lt;/li&gt;
&lt;li&gt;&lt;code&gt;toolbar&lt;/code&gt; - Group of interactive controls&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tooltip&lt;/code&gt; - Contextual help popup&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tree&lt;/code&gt; - Hierarchical list of items&lt;/li&gt;
&lt;li&gt;&lt;code&gt;treeitem&lt;/code&gt; - Item in a tree&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;tables--grids&#34;&gt;Tables &amp;amp; Grids&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;table&lt;/code&gt; - Tabular data with rows and columns.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;rowgroup&lt;/code&gt; - Section that groups rows. For example, &lt;code&gt;thead&lt;/code&gt;, &lt;code&gt;tbody&lt;/code&gt;, &lt;code&gt;tfoot&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;row&lt;/code&gt; - A row of cells within a table or grid.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;rowheader&lt;/code&gt; - Header cell for a row.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;columnheader&lt;/code&gt; - Header cell for a column.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cell&lt;/code&gt; - Data cell in a table.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;grid&lt;/code&gt; - Interactive, tabular widget, such as a spreadsheet.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;gridcell&lt;/code&gt; - Cell within a grid.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;treegrid&lt;/code&gt; - Tree-structured grid with expandable rows.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;document-structure--semantics&#34;&gt;Document Structure &amp;amp; Semantics&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;article&lt;/code&gt; - Self-contained composition (article)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;blockquote&lt;/code&gt; - Quotation from another source&lt;/li&gt;
&lt;li&gt;&lt;code&gt;caption&lt;/code&gt; - Caption for a figure, table, or media&lt;/li&gt;
&lt;li&gt;&lt;code&gt;code&lt;/code&gt; - Fragment of computer code&lt;/li&gt;
&lt;li&gt;&lt;code&gt;definition&lt;/code&gt; - Definition of a term&lt;/li&gt;
&lt;li&gt;&lt;code&gt;deletion&lt;/code&gt; - Content removed from a document&lt;/li&gt;
&lt;li&gt;&lt;code&gt;directory&lt;/code&gt; - List of references&lt;/li&gt;
&lt;li&gt;&lt;code&gt;document&lt;/code&gt; - Standalone document content&lt;/li&gt;
&lt;li&gt;&lt;code&gt;emphasis&lt;/code&gt; - Content with emphatic stress&lt;/li&gt;
&lt;li&gt;&lt;code&gt;feed&lt;/code&gt; - Stream of articles or entries&lt;/li&gt;
&lt;li&gt;&lt;code&gt;figure&lt;/code&gt; - Figure with optional caption&lt;/li&gt;
&lt;li&gt;&lt;code&gt;generic&lt;/code&gt; - Generic container with no specific semantics&lt;/li&gt;
&lt;li&gt;&lt;code&gt;img&lt;/code&gt; - Image treated as a single graphic&lt;/li&gt;
&lt;li&gt;&lt;code&gt;insertion&lt;/code&gt; - Content added to a document&lt;/li&gt;
&lt;li&gt;&lt;code&gt;link&lt;/code&gt; - Hyperlink to another location&lt;/li&gt;
&lt;li&gt;&lt;code&gt;list&lt;/code&gt; - List of items&lt;/li&gt;
&lt;li&gt;&lt;code&gt;listitem&lt;/code&gt; - A single item within a list&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mark&lt;/code&gt; - Highlighted or marked content&lt;/li&gt;
&lt;li&gt;&lt;code&gt;marquee&lt;/code&gt; - Scrolling region of text&lt;/li&gt;
&lt;li&gt;&lt;code&gt;math&lt;/code&gt; - Mathematical expression&lt;/li&gt;
&lt;li&gt;&lt;code&gt;note&lt;/code&gt; - An aside or annotation&lt;/li&gt;
&lt;li&gt;&lt;code&gt;none&lt;/code&gt; - No semantic role; remove semantics&lt;/li&gt;
&lt;li&gt;&lt;code&gt;paragraph&lt;/code&gt; - Paragraph of text&lt;/li&gt;
&lt;li&gt;&lt;code&gt;presentation&lt;/code&gt; - Presentational only; ignore semantics&lt;/li&gt;
&lt;li&gt;&lt;code&gt;strong&lt;/code&gt; - Content of strong importance&lt;/li&gt;
&lt;li&gt;&lt;code&gt;subscript&lt;/code&gt; - Subscripted text&lt;/li&gt;
&lt;li&gt;&lt;code&gt;superscript&lt;/code&gt; - Superscripted text&lt;/li&gt;
&lt;li&gt;&lt;code&gt;term&lt;/code&gt; - A term being defined&lt;/li&gt;
&lt;li&gt;&lt;code&gt;time&lt;/code&gt; - A time or date&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;landmarks--regions&#34;&gt;Landmarks &amp;amp; Regions&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;banner&lt;/code&gt; - Site header landmark&lt;/li&gt;
&lt;li&gt;&lt;code&gt;complementary&lt;/code&gt; - Complementary content (sidebar)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;contentinfo&lt;/code&gt; - Page footer information&lt;/li&gt;
&lt;li&gt;&lt;code&gt;form&lt;/code&gt; - Region containing a form&lt;/li&gt;
&lt;li&gt;&lt;code&gt;main&lt;/code&gt; - Main content landmark&lt;/li&gt;
&lt;li&gt;&lt;code&gt;navigation&lt;/code&gt; - Navigation region of links&lt;/li&gt;
&lt;li&gt;&lt;code&gt;region&lt;/code&gt; - Generic region of the page&lt;/li&gt;
&lt;li&gt;&lt;code&gt;search&lt;/code&gt; - Search region&lt;/li&gt;
&lt;li&gt;&lt;code&gt;application&lt;/code&gt; - Application container widget&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;usage-examples-by-category&#34;&gt;Usage Examples by Category&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Form Testing:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;!-- md-k6:skip --&gt;
&lt;!-- eslint-skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;// Text inputs
await page.getByRole(&amp;#39;textbox&amp;#39;, { name: &amp;#39;Email&amp;#39; }).fill(&amp;#39;user@example.com&amp;#39;);
await page.getByRole(&amp;#39;searchbox&amp;#39;, { name: &amp;#39;Search products&amp;#39; }).fill(&amp;#39;laptop&amp;#39;);

// Selections
await page.getByRole(&amp;#39;checkbox&amp;#39;, { name: &amp;#39;Agree to terms&amp;#39; }).check();
await page.getByRole(&amp;#39;radio&amp;#39;, { name: &amp;#39;Standard shipping&amp;#39; }).check();
await page.getByRole(&amp;#39;combobox&amp;#39;, { name: &amp;#39;Country&amp;#39; }).selectOption(&amp;#39;US&amp;#39;);

// Interactive controls
await page.getByRole(&amp;#39;slider&amp;#39;, { name: &amp;#39;Volume&amp;#39; }).fill(&amp;#39;75&amp;#39;);
await page.getByRole(&amp;#39;switch&amp;#39;, { name: &amp;#39;Enable notifications&amp;#39; }).click();&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Navigation Testing:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;!-- md-k6:skip --&gt;
&lt;!-- eslint-skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;// Tabs
await page.getByRole(&amp;#39;tab&amp;#39;, { name: &amp;#39;Overview&amp;#39; }).click();
await expect(page.getByRole(&amp;#39;tabpanel&amp;#39;, { name: &amp;#39;Overview&amp;#39; })).toBeVisible();&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Content Verification:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;!-- md-k6:skip --&gt;
&lt;!-- eslint-skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;// Structure
await expect(page.getByRole(&amp;#39;article&amp;#39;)).toHaveCount(5);
await expect(page.getByRole(&amp;#39;heading&amp;#39;, { level: 1 })).toHaveText(&amp;#39;Welcome&amp;#39;);

// Status and feedback
await expect(page.getByRole(&amp;#39;alert&amp;#39;)).toHaveText(&amp;#39;Form submitted successfully&amp;#39;);
await expect(page.getByRole(&amp;#39;status&amp;#39;)).toHaveText(&amp;#39;3 items selected&amp;#39;);&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;best-practices&#34;&gt;Best practices&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Prefer role-based selection&lt;/strong&gt;: &lt;code&gt;getByRole()&lt;/code&gt; is the preferred method for locating elements as it closely mirrors how users and assistive technology interact with your page.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use accessible names&lt;/strong&gt;: Always try to use the &lt;code&gt;name&lt;/code&gt; option to make your tests more specific and reliable.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Consider accessibility&lt;/strong&gt;: Using &lt;code&gt;getByRole()&lt;/code&gt; encourages better accessibility practices in your application by ensuring elements have proper ARIA roles.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;

        
&lt;h2 id=&#34;related&#34;&gt;Related&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbyalttext/&#34;&gt;frame.getByAltText()&lt;/a&gt; - Locate by alt text&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbylabel/&#34;&gt;frame.getByLabel()&lt;/a&gt; - Locate by form labels&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbyplaceholder/&#34;&gt;frame.getByPlaceholder()&lt;/a&gt; - Locate by placeholder text&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbytestid/&#34;&gt;frame.getByTestId()&lt;/a&gt; - Locate by test ID&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbytext/&#34;&gt;frame.getByText()&lt;/a&gt; - Locate by text content&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbytitle/&#34;&gt;frame.getByTitle()&lt;/a&gt; - Locate by title attribute&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;div data-shared="browser/getby-apis/getbyrole-spec.md">
&lt;h1 id="getbyrolerole-options">getByRole(role[, options])&lt;/h1>
&lt;p>Returns a locator for elements with the specified ARIA role. This is the preferred way to locate elements as it most closely resembles how users and assistive technology perceive the page.&lt;/p></description></item><item><title>getByTestId(testId)</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbytestid/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbytestid/</guid><content><![CDATA[

&lt;div data-shared=&#34;browser/getby-apis/getbytestid-spec.md&#34;&gt;
            &lt;h1 id=&#34;getbytestidtestid&#34;&gt;getByTestId(testId)&lt;/h1&gt;
&lt;p&gt;Returns a locator for elements with the specified test ID attribute. This method is designed for robust test automation by locating elements using dedicated test identifiers that are independent of the visual appearance or content changes. Currently it can only work with the &lt;code&gt;data-testid&lt;/code&gt; attribute.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;testId&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;string | RegExp&lt;/td&gt;
              &lt;td&gt;-&lt;/td&gt;
              &lt;td&gt;Required. The test ID value to search for. Searches for the &lt;code&gt;data-testid&lt;/code&gt; attribute. Can be a string for exact match or a RegExp for pattern matching.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;returns&#34;&gt;Returns&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/&#34;&gt;Locator&lt;/a&gt;&lt;/td&gt;
              &lt;td&gt;A locator object that can be used to interact with the elements matching the specified test ID.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;/div&gt;

        
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;h3 id=&#34;basic-test-id-usage&#34;&gt;Basic test ID usage&lt;/h3&gt;
&lt;p&gt;Locate and interact with elements using test IDs:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;

export const options = {
  scenarios: {
    browser: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  },
};

export default async function () {
  const page = await browser.newPage();

  try {
    await page.setContent(`
      &amp;lt;input type=&amp;#34;text&amp;#34; data-testid=&amp;#34;username&amp;#34;&amp;gt;
      &amp;lt;input type=&amp;#34;text&amp;#34; data-testid=&amp;#34;email&amp;#34;&amp;gt;
      &amp;lt;button data-testid=&amp;#34;submit-button&amp;#34;&amp;gt;Submit&amp;lt;/button&amp;gt;
    `);

    const frame = page.mainFrame();
    await frame.getByTestId(&amp;#39;username&amp;#39;).fill(&amp;#39;FirstLast&amp;#39;);
    await frame.getByTestId(&amp;#39;email&amp;#39;).fill(&amp;#39;firstlast@example.com&amp;#39;);
    await frame.getByTestId(&amp;#39;submit-button&amp;#39;).click();
  } finally {
    await page.close();
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;div data-shared=&#34;browser/getby-apis/getbytestid-tips.md&#34;&gt;
            &lt;h2 id=&#34;best-practices&#34;&gt;Best practices&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Stable identifiers&lt;/strong&gt;: Use meaningful, stable test IDs that won&amp;rsquo;t change with refactoring or content updates.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hierarchical naming&lt;/strong&gt;: Use consistent naming conventions like &lt;code&gt;user-profile-edit-btn&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Avoid duplicates&lt;/strong&gt;: Ensure test IDs are unique within the page to prevent ambiguity.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Strategic placement&lt;/strong&gt;: Add test IDs to key interactive elements and components that are frequently tested.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Team coordination&lt;/strong&gt;: Establish test ID conventions with your development team to ensure consistency.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;

        
&lt;h2 id=&#34;related&#34;&gt;Related&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbyrole/&#34;&gt;frame.getByRole()&lt;/a&gt; - Locate by ARIA role&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbyalttext/&#34;&gt;frame.getByAltText()&lt;/a&gt; - Locate by alt text&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbylabel/&#34;&gt;frame.getByLabel()&lt;/a&gt; - Locate by form labels&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbyplaceholder/&#34;&gt;frame.getByPlaceholder()&lt;/a&gt; - Locate by placeholder text&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbytext/&#34;&gt;frame.getByText()&lt;/a&gt; - Locate by text content&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbytitle/&#34;&gt;frame.getByTitle()&lt;/a&gt; - Locate by title attribute&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;div data-shared="browser/getby-apis/getbytestid-spec.md">
&lt;h1 id="getbytestidtestid">getByTestId(testId)&lt;/h1>
&lt;p>Returns a locator for elements with the specified test ID attribute. This method is designed for robust test automation by locating elements using dedicated test identifiers that are independent of the visual appearance or content changes. Currently it can only work with the &lt;code>data-testid&lt;/code> attribute.&lt;/p></description></item><item><title>getByText(text[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbytext/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbytext/</guid><content><![CDATA[

&lt;div data-shared=&#34;browser/getby-apis/getbytext-spec.md&#34;&gt;
            &lt;h1 id=&#34;getbytexttext-options&#34;&gt;getByText(text[, options])&lt;/h1&gt;
&lt;p&gt;Returns a locator for elements containing the specified text. This method finds elements by their visible text content, making it ideal for locating user-facing content like buttons, links, headings, and other text elements.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;text&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;string | RegExp&lt;/td&gt;
              &lt;td&gt;-&lt;/td&gt;
              &lt;td&gt;Required. The text content to search for. Can be a string for exact match or a RegExp for pattern matching.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;options&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;options.exact&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Whether to match the text exactly with case sensitivity. When &lt;code&gt;true&lt;/code&gt;, performs a case-sensitive match.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;returns&#34;&gt;Returns&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/&#34;&gt;Locator&lt;/a&gt;&lt;/td&gt;
              &lt;td&gt;A locator object that can be used to interact with the elements containing the specified text.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;/div&gt;

        
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;Find and click elements by their visible text:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;

export const options = {
  scenarios: {
    browser: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  },
};

export default async function () {
  const page = await browser.newPage();

  try {
    await page.goto(&amp;#39;https://quickpizza.grafana.com/&amp;#39;);

    const frame = page.mainFrame();
    await frame.getByText(&amp;#39;Pizza, Please!&amp;#39;).click();

    const noThanksBtn = frame.getByText(&amp;#39;No thanks&amp;#39;);
    await noThanksBtn.click();
  } finally {
    await page.close();
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;div data-shared=&#34;browser/getby-apis/getbytext-tips.md&#34;&gt;
            &lt;h2 id=&#34;text-matching-behavior&#34;&gt;Text matching behavior&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Whitespace normalization&lt;/strong&gt;: Text matching automatically normalizes whitespace, meaning:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Multiple spaces become single spaces&lt;/li&gt;
&lt;li&gt;Line breaks become spaces&lt;/li&gt;
&lt;li&gt;Leading and trailing whitespace is ignored&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Consider the following DOM structure:&lt;/p&gt;
&lt;!-- md-k6:skip --&gt;
&lt;!-- eslint-skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;HTML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-html&#34;&gt;&amp;lt;div&amp;gt;Hello &amp;lt;span&amp;gt;world&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;div&amp;gt;Hello&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;You can locate by text substring, exact string, or a regular expression:&lt;/p&gt;
&lt;!-- md-k6:skip --&gt;
&lt;!-- eslint-skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;js&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-js&#34;&gt;// Matches &amp;lt;span&amp;gt;
page.getByText(&amp;#39;world&amp;#39;);
// Matches first &amp;lt;div&amp;gt;
page.getByText(&amp;#39;Hello world&amp;#39;);
// Matches second &amp;lt;div&amp;gt;
page.getByText(&amp;#39;Hello&amp;#39;, { exact: true });
// Matches both &amp;lt;div&amp;gt;s
page.getByText(/Hello/);
// Matches second &amp;lt;div&amp;gt;
page.getByText(/^hello$/i);&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;common-use-cases&#34;&gt;Common use cases&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Button interactions&lt;/strong&gt;: Submit, Cancel, Delete, Edit buttons&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Navigation&lt;/strong&gt;: Menu items, breadcrumbs, pagination links&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Content verification&lt;/strong&gt;: Success messages, error messages, headings&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Form interactions&lt;/strong&gt;: Checkbox labels, radio button options&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Status indicators&lt;/strong&gt;: Active, Inactive, Pending states&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;best-practices&#34;&gt;Best practices&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;User-focused testing&lt;/strong&gt;: Using &lt;code&gt;getByText()&lt;/code&gt; ensures your tests interact with content as users see it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Avoid brittle text&lt;/strong&gt;: Be cautious with exact text that might change frequently (like dates, counts, or user-generated content).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use meaningful text&lt;/strong&gt;: Prefer descriptive button text and labels over generic terms like &amp;ldquo;Click here&amp;rdquo; or &amp;ldquo;Button&amp;rdquo;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Handle dynamic content&lt;/strong&gt;: Use regular expressions for text that contains variable parts (timestamps, user names, counts).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Consider accessibility&lt;/strong&gt;: Text-based selection encourages better accessibility practices in your application.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Internationalization&lt;/strong&gt;: For multi-language applications, consider using test IDs or roles instead of text for critical interactions.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;

        
&lt;h2 id=&#34;related&#34;&gt;Related&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbyrole/&#34;&gt;frame.getByRole()&lt;/a&gt; - Locate by ARIA role&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbyalttext/&#34;&gt;frame.getByAltText()&lt;/a&gt; - Locate by alt text&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbylabel/&#34;&gt;frame.getByLabel()&lt;/a&gt; - Locate by form labels&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbyplaceholder/&#34;&gt;frame.getByPlaceholder()&lt;/a&gt; - Locate by placeholder text&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbytestid/&#34;&gt;frame.getByTestId()&lt;/a&gt; - Locate by test ID&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbytitle/&#34;&gt;frame.getByTitle()&lt;/a&gt; - Locate by title attribute&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;div data-shared="browser/getby-apis/getbytext-spec.md">
&lt;h1 id="getbytexttext-options">getByText(text[, options])&lt;/h1>
&lt;p>Returns a locator for elements containing the specified text. This method finds elements by their visible text content, making it ideal for locating user-facing content like buttons, links, headings, and other text elements.&lt;/p></description></item><item><title>getByTitle(title[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbytitle/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbytitle/</guid><content><![CDATA[

&lt;div data-shared=&#34;browser/getby-apis/getbytitle-spec.md&#34;&gt;
            &lt;h1 id=&#34;getbytitletitle-options&#34;&gt;getByTitle(title[, options])&lt;/h1&gt;
&lt;p&gt;Returns a locator for elements with the specified &lt;code&gt;title&lt;/code&gt; attribute. This method is useful for locating elements that use the &lt;code&gt;title&lt;/code&gt; attribute to provide additional information, tooltips, or accessibility context.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;title&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;string | RegExp&lt;/td&gt;
              &lt;td&gt;-&lt;/td&gt;
              &lt;td&gt;Required. The title text to search for. Can be a string for exact match or a RegExp for pattern matching.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;options&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;options.exact&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Whether to match the title text exactly with case sensitivity. When &lt;code&gt;true&lt;/code&gt;, performs a case-sensitive match.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;returns&#34;&gt;Returns&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/&#34;&gt;Locator&lt;/a&gt;&lt;/td&gt;
              &lt;td&gt;A locator object that can be used to interact with the elements matching the specified title attribute.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;/div&gt;

        
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;Find and interact with elements by their title attribute:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;

export const options = {
  scenarios: {
    browser: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  },
};

export default async function () {
  const page = await browser.newPage();

  try {
    await page.setContent(`
      &amp;lt;button title=&amp;#34;Hello World&amp;#34;&amp;gt;Hi&amp;lt;/button&amp;gt;
      &amp;lt;select title=&amp;#34;Favorite Color&amp;#34;&amp;gt;
        &amp;lt;option value=&amp;#34;Red&amp;#34;&amp;gt;Red&amp;lt;/option&amp;gt;
        &amp;lt;option value=&amp;#34;Green&amp;#34;&amp;gt;Green&amp;lt;/option&amp;gt;
        &amp;lt;option value=&amp;#34;Blue&amp;#34;&amp;gt;Blue&amp;lt;/option&amp;gt;
      &amp;lt;/select&amp;gt;
      &amp;lt;input type=&amp;#34;checkbox&amp;#34; title=&amp;#34;Check me&amp;#34;&amp;gt;
    `);

    const frame = page.mainFrame();

    await frame.getByTitle(&amp;#39;Hello World&amp;#39;).click();

    await frame.getByTitle(&amp;#39;Favorite Color&amp;#39;).selectOption(&amp;#39;Red&amp;#39;);

    await frame.getByTitle(&amp;#39;Check me&amp;#39;).check();
  } finally {
    await page.close();
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;div data-shared=&#34;browser/getby-apis/getbytitle-tips.md&#34;&gt;
            &lt;h2 id=&#34;common-use-cases&#34;&gt;Common use cases&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;User interface controls:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Toolbar buttons and action items&lt;/li&gt;
&lt;li&gt;Navigation controls (previous/next, pagination)&lt;/li&gt;
&lt;li&gt;Media player controls&lt;/li&gt;
&lt;li&gt;Menu and drop-down triggers&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Informational elements:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Help icons and tooltips&lt;/li&gt;
&lt;li&gt;Status indicators and badges&lt;/li&gt;
&lt;li&gt;Progress indicators&lt;/li&gt;
&lt;li&gt;Warning and error messages&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Accessibility support:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Screen reader descriptions&lt;/li&gt;
&lt;li&gt;Alternative text for complex elements&lt;/li&gt;
&lt;li&gt;Context-sensitive help&lt;/li&gt;
&lt;li&gt;Form field explanations&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;best-practices&#34;&gt;Best practices&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Meaningful titles&lt;/strong&gt;: Ensure title attributes provide clear, helpful information about the element&amp;rsquo;s purpose or content.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Accessibility compliance&lt;/strong&gt;: Use titles to enhance accessibility, especially for elements that might not have clear visual labels.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Avoid redundancy&lt;/strong&gt;: Don&amp;rsquo;t duplicate visible text in the title attribute unless providing additional context.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Dynamic content&lt;/strong&gt;: When testing applications with changing title content, use flexible matching patterns or regular expressions.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tooltip testing&lt;/strong&gt;: Remember that title attributes often create tooltips on hover, which can be useful for UI testing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Internationalization&lt;/strong&gt;: Consider that title text may change in different language versions of your application.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;

        
&lt;h2 id=&#34;related&#34;&gt;Related&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbyrole/&#34;&gt;frame.getByRole()&lt;/a&gt; - Locate by ARIA role&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbyalttext/&#34;&gt;frame.getByAltText()&lt;/a&gt; - Locate by alt text&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbylabel/&#34;&gt;frame.getByLabel()&lt;/a&gt; - Locate by form labels&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbyplaceholder/&#34;&gt;frame.getByPlaceholder()&lt;/a&gt; - Locate by placeholder text&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbytestid/&#34;&gt;frame.getByTestId()&lt;/a&gt; - Locate by test ID&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/getbytext/&#34;&gt;frame.getByText()&lt;/a&gt; - Locate by visible text&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;div data-shared="browser/getby-apis/getbytitle-spec.md">
&lt;h1 id="getbytitletitle-options">getByTitle(title[, options])&lt;/h1>
&lt;p>Returns a locator for elements with the specified &lt;code>title&lt;/code> attribute. This method is useful for locating elements that use the &lt;code>title&lt;/code> attribute to provide additional information, tooltips, or accessibility context.&lt;/p></description></item><item><title>goto(url[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/goto/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/goto/</guid><content><![CDATA[&lt;h1 id=&#34;gotourl-options&#34;&gt;goto(url[, options])&lt;/h1&gt;
&lt;p&gt;Navigates to the specified URL and returns the main resource response.&lt;/p&gt;
&lt;p&gt;Navigating to &lt;code&gt;about:blank&lt;/code&gt; or navigation to the same URL with a different hash, will succeed and return &lt;code&gt;null&lt;/code&gt;.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;url&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;URL to navigate frame to. The url should include scheme, e.g. &lt;code&gt;https://&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.referer&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Referer header value.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum operation time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. The default value can be changed via the 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/setdefaultnavigationtimeout/&#34;&gt;browserContext.setDefaultNavigationTimeout(timeout)&lt;/a&gt;, 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/setdefaulttimeout/&#34;&gt;browserContext.setDefaultTimeout(timeout)&lt;/a&gt;, 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/setdefaultnavigationtimeout/&#34;&gt;page.setDefaultNavigationTimeout(timeout)&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/setdefaulttimeout/&#34;&gt;page.setDefaultTimeout(timeout)&lt;/a&gt; methods. Setting the value to &lt;code&gt;0&lt;/code&gt; will disable the timeout.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.waitUntil&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;load&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When to consider operation to have succeeded. See &lt;a href=&#34;#events&#34;&gt;Events&lt;/a&gt; for more details.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;events&#34;&gt;Events&lt;/h3&gt;


&lt;div class=&#34;admonition admonition-caution&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Caution&lt;/p&gt;&lt;p&gt;&lt;code&gt;networkidle&lt;/code&gt; is DISCOURAGED. Don&amp;rsquo;t use this method for testing especially with chatty websites where the event may never fire, rely on web assertions to assess readiness instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Events can be either:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&#39;domcontentloaded&#39;&lt;/code&gt; - consider operation to be finished when the &lt;code&gt;DOMContentLoaded&lt;/code&gt; event is fired.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&#39;load&#39;&lt;/code&gt; - consider operation to be finished when the &lt;code&gt;load&lt;/code&gt; event is fired.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&#39;networkidle&#39;&lt;/code&gt; - Consider operation to be finished when there are no network connections for at least &lt;code&gt;500&lt;/code&gt; ms.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;&amp;lt;Promise&amp;lt;Response | null&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/response/&#34;&gt;Response&lt;/a&gt;&amp;gt; instance associated with the frame. Else, it returns &lt;code&gt;null&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="gotourl-options">goto(url[, options])&lt;/h1>
&lt;p>Navigates to the specified URL and returns the main resource response.&lt;/p>
&lt;p>Navigating to &lt;code>about:blank&lt;/code> or navigation to the same URL with a different hash, will succeed and return &lt;code>null&lt;/code>.&lt;/p></description></item><item><title>hover(selector[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/hover/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/hover/</guid><content><![CDATA[&lt;h1 id=&#34;hoverselector-options&#34;&gt;hover(selector[, options])&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Use locator-based 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/hover/&#34;&gt;&lt;code&gt;locator.hover([options])&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;This method hovers over an element matching &lt;code&gt;selector&lt;/code&gt;.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;selector&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.force&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Setting this to &lt;code&gt;true&lt;/code&gt; will bypass the actionability checks (&lt;code&gt;visible&lt;/code&gt;, &lt;code&gt;stable&lt;/code&gt;, &lt;code&gt;enabled&lt;/code&gt;).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.modifiers&lt;/td&gt;
              &lt;td&gt;string[]&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;Alt&lt;/code&gt;, &lt;code&gt;Control&lt;/code&gt;, &lt;code&gt;Meta&lt;/code&gt; or &lt;code&gt;Shift&lt;/code&gt; modifiers keys pressed during the action. If not specified, currently pressed modifiers are used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.noWaitAfter&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;If set to &lt;code&gt;true&lt;/code&gt; and a navigation occurs from performing this action, it will not wait for it to complete.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.position&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A point to use relative to the top left corner of the element. If not supplied, a visible point of the element is used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.position.x&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;0&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The x coordinate.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.position.y&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;0&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The y coordinate.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.strict&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When &lt;code&gt;true&lt;/code&gt;, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.trial&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Setting this to &lt;code&gt;true&lt;/code&gt; will perform the actionability checks without performing the action.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;void&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fulfills when the hover action is finished.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="hoverselector-options">hover(selector[, options])&lt;/h1>
&lt;div class="admonition admonition-warning">&lt;blockquote>&lt;p class="title text-uppercase">Warning&lt;/p>&lt;p>Use locator-based
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/locator/hover/">&lt;code>locator.hover([options])&lt;/code>&lt;/a> instead.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>This method hovers over an element matching &lt;code>selector&lt;/code>.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Default&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>selector&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.force&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>Setting this to &lt;code>true&lt;/code> will bypass the actionability checks (&lt;code>visible&lt;/code>, &lt;code>stable&lt;/code>, &lt;code>enabled&lt;/code>).&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.modifiers&lt;/td>
&lt;td>string[]&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;code>Alt&lt;/code>, &lt;code>Control&lt;/code>, &lt;code>Meta&lt;/code> or &lt;code>Shift&lt;/code> modifiers keys pressed during the action. If not specified, currently pressed modifiers are used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.noWaitAfter&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>If set to &lt;code>true&lt;/code> and a navigation occurs from performing this action, it will not wait for it to complete.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.position&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>A point to use relative to the top left corner of the element. If not supplied, a visible point of the element is used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.position.x&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>0&lt;/code>&lt;/td>
&lt;td>The x coordinate.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.position.y&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>0&lt;/code>&lt;/td>
&lt;td>The y coordinate.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.strict&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>When &lt;code>true&lt;/code>, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.timeout&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>30000&lt;/code>&lt;/td>
&lt;td>Maximum time in milliseconds. Pass &lt;code>0&lt;/code> to disable the timeout. Default is overridden by the &lt;code>setDefaultTimeout&lt;/code> option on
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/">BrowserContext&lt;/a> or
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/page/">Page&lt;/a>.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.trial&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>Setting this to &lt;code>true&lt;/code> will perform the actionability checks without performing the action.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Promise&amp;lt;void&amp;gt;&lt;/code>&lt;/td>
&lt;td>A Promise that fulfills when the hover action is finished.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>innerHTML(selector[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/innerhtml/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/innerhtml/</guid><content><![CDATA[&lt;h1 id=&#34;innerhtmlselector-options&#34;&gt;innerHTML(selector[, options])&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Use locator-based 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/innerhtml/&#34;&gt;&lt;code&gt;locator.innerHTML([options])&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Returns the &lt;code&gt;element.innerHTML&lt;/code&gt;.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;selector&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.strict&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When &lt;code&gt;true&lt;/code&gt;, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;string&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fullfils with the inner HTML of the element.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="innerhtmlselector-options">innerHTML(selector[, options])&lt;/h1>
&lt;div class="admonition admonition-warning">&lt;blockquote>&lt;p class="title text-uppercase">Warning&lt;/p>&lt;p>Use locator-based
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/locator/innerhtml/">&lt;code>locator.innerHTML([options])&lt;/code>&lt;/a> instead.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>Returns the &lt;code>element.innerHTML&lt;/code>.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Default&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>selector&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.strict&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>When &lt;code>true&lt;/code>, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.timeout&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>30000&lt;/code>&lt;/td>
&lt;td>Maximum time in milliseconds. Pass &lt;code>0&lt;/code> to disable the timeout. Default is overridden by the &lt;code>setDefaultTimeout&lt;/code> option on
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/">BrowserContext&lt;/a> or
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/page/">Page&lt;/a>.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Promise&amp;lt;string&amp;gt;&lt;/code>&lt;/td>
&lt;td>A Promise that fullfils with the inner HTML of the element.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>innerText(selector[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/innertext/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/innertext/</guid><content><![CDATA[&lt;h1 id=&#34;innertextselector-options&#34;&gt;innerText(selector[, options])&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Use locator-based 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/innertext/&#34;&gt;&lt;code&gt;locator.innerText([options])&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Returns the &lt;code&gt;element.innerText&lt;/code&gt;.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;selector&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.strict&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When &lt;code&gt;true&lt;/code&gt;, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;string&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fullfils with the inner text (represents the rendered text content of an element handle and its descendants) of the element.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="innertextselector-options">innerText(selector[, options])&lt;/h1>
&lt;div class="admonition admonition-warning">&lt;blockquote>&lt;p class="title text-uppercase">Warning&lt;/p>&lt;p>Use locator-based
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/locator/innertext/">&lt;code>locator.innerText([options])&lt;/code>&lt;/a> instead.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>Returns the &lt;code>element.innerText&lt;/code>.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Default&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>selector&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.strict&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>When &lt;code>true&lt;/code>, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.timeout&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>30000&lt;/code>&lt;/td>
&lt;td>Maximum time in milliseconds. Pass &lt;code>0&lt;/code> to disable the timeout. Default is overridden by the &lt;code>setDefaultTimeout&lt;/code> option on
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/">BrowserContext&lt;/a> or
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/page/">Page&lt;/a>.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Promise&amp;lt;string&amp;gt;&lt;/code>&lt;/td>
&lt;td>A Promise that fullfils with the inner text (represents the rendered text content of an element handle and its descendants) of the element.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>inputValue(selector[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/inputvalue/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/inputvalue/</guid><content><![CDATA[&lt;h1 id=&#34;inputvalueselector-options&#34;&gt;inputValue(selector[, options])&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Use locator-based 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/inputvalue/&#34;&gt;&lt;code&gt;locator.inputValue([options])&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Returns &lt;code&gt;input.value&lt;/code&gt; for the selected &lt;code&gt;input&lt;/code&gt;, &lt;code&gt;textarea&lt;/code&gt; or &lt;code&gt;select&lt;/code&gt; element.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;selector&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.strict&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When &lt;code&gt;true&lt;/code&gt;, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;string&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fullfils with the input value of the element.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="inputvalueselector-options">inputValue(selector[, options])&lt;/h1>
&lt;div class="admonition admonition-warning">&lt;blockquote>&lt;p class="title text-uppercase">Warning&lt;/p>&lt;p>Use locator-based
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/locator/inputvalue/">&lt;code>locator.inputValue([options])&lt;/code>&lt;/a> instead.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>Returns &lt;code>input.value&lt;/code> for the selected &lt;code>input&lt;/code>, &lt;code>textarea&lt;/code> or &lt;code>select&lt;/code> element.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Default&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>selector&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.strict&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>When &lt;code>true&lt;/code>, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.timeout&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>30000&lt;/code>&lt;/td>
&lt;td>Maximum time in milliseconds. Pass &lt;code>0&lt;/code> to disable the timeout. Default is overridden by the &lt;code>setDefaultTimeout&lt;/code> option on
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/">BrowserContext&lt;/a> or
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/page/">Page&lt;/a>.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Promise&amp;lt;string&amp;gt;&lt;/code>&lt;/td>
&lt;td>A Promise that fullfils with the input value of the element.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>isChecked(selector[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/ischecked/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/ischecked/</guid><content><![CDATA[&lt;h1 id=&#34;ischeckedselector-options&#34;&gt;isChecked(selector[, options])&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Use locator-based 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/ischecked/&#34;&gt;&lt;code&gt;locator.isChecked([options])&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Checks to see if the &lt;code&gt;checkbox&lt;/code&gt; &lt;code&gt;input&lt;/code&gt; type is selected or not.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;selector&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.strict&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When &lt;code&gt;true&lt;/code&gt;, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;bool&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fullfils with &lt;code&gt;true&lt;/code&gt; if the checkbox is selected, else &lt;code&gt;false&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="ischeckedselector-options">isChecked(selector[, options])&lt;/h1>
&lt;div class="admonition admonition-warning">&lt;blockquote>&lt;p class="title text-uppercase">Warning&lt;/p>&lt;p>Use locator-based
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/locator/ischecked/">&lt;code>locator.isChecked([options])&lt;/code>&lt;/a> instead.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>Checks to see if the &lt;code>checkbox&lt;/code> &lt;code>input&lt;/code> type is selected or not.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Default&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>selector&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.strict&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>When &lt;code>true&lt;/code>, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.timeout&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>30000&lt;/code>&lt;/td>
&lt;td>Maximum time in milliseconds. Pass &lt;code>0&lt;/code> to disable the timeout. Default is overridden by the &lt;code>setDefaultTimeout&lt;/code> option on
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/">BrowserContext&lt;/a> or
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/page/">Page&lt;/a>.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Promise&amp;lt;bool&amp;gt;&lt;/code>&lt;/td>
&lt;td>A Promise that fullfils with &lt;code>true&lt;/code> if the checkbox is selected, else &lt;code>false&lt;/code>.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>isDetached()</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/isdetached/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/isdetached/</guid><content><![CDATA[&lt;h1 id=&#34;isdetached&#34;&gt;isDetached()&lt;/h1&gt;
&lt;p&gt;Reports whether the frame is detached from the DOM.&lt;/p&gt;
&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;bool&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;true&lt;/code&gt; if the frame is detached from the DOM, and &lt;code&gt;false&lt;/code&gt; otherwise.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="isdetached">isDetached()&lt;/h1>
&lt;p>Reports whether the frame is detached from the DOM.&lt;/p>
&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>bool&lt;/code>&lt;/td>
&lt;td>&lt;code>true&lt;/code> if the frame is detached from the DOM, and &lt;code>false&lt;/code> otherwise.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>isDisabled(selector[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/isdisabled/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/isdisabled/</guid><content><![CDATA[&lt;h1 id=&#34;isdisabledselector-options&#34;&gt;isDisabled(selector[, options])&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Use locator-based 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/isdisabled/&#34;&gt;&lt;code&gt;locator.isDisabled([options])&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Checks if the element is &lt;code&gt;disabled&lt;/code&gt;.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;selector&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.strict&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When &lt;code&gt;true&lt;/code&gt;, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;bool&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fullfils with &lt;code&gt;true&lt;/code&gt; if the element is &lt;code&gt;disabled&lt;/code&gt;, else &lt;code&gt;false&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="isdisabledselector-options">isDisabled(selector[, options])&lt;/h1>
&lt;div class="admonition admonition-warning">&lt;blockquote>&lt;p class="title text-uppercase">Warning&lt;/p>&lt;p>Use locator-based
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/locator/isdisabled/">&lt;code>locator.isDisabled([options])&lt;/code>&lt;/a> instead.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>Checks if the element is &lt;code>disabled&lt;/code>.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Default&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>selector&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.strict&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>When &lt;code>true&lt;/code>, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.timeout&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>30000&lt;/code>&lt;/td>
&lt;td>Maximum time in milliseconds. Pass &lt;code>0&lt;/code> to disable the timeout. Default is overridden by the &lt;code>setDefaultTimeout&lt;/code> option on
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/">BrowserContext&lt;/a> or
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/page/">Page&lt;/a>.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Promise&amp;lt;bool&amp;gt;&lt;/code>&lt;/td>
&lt;td>A Promise that fullfils with &lt;code>true&lt;/code> if the element is &lt;code>disabled&lt;/code>, else &lt;code>false&lt;/code>.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>isEditable(selector[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/iseditable/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/iseditable/</guid><content><![CDATA[&lt;h1 id=&#34;iseditableselector-options&#34;&gt;isEditable(selector[, options])&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Use locator-based 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/iseditable/&#34;&gt;&lt;code&gt;locator.isEditable([options])&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Checks if the element is &lt;code&gt;editable&lt;/code&gt;.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;selector&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.strict&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When &lt;code&gt;true&lt;/code&gt;, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;bool&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fullfils with &lt;code&gt;true&lt;/code&gt; if the element is &lt;code&gt;editable&lt;/code&gt;, else &lt;code&gt;false&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="iseditableselector-options">isEditable(selector[, options])&lt;/h1>
&lt;div class="admonition admonition-warning">&lt;blockquote>&lt;p class="title text-uppercase">Warning&lt;/p>&lt;p>Use locator-based
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/locator/iseditable/">&lt;code>locator.isEditable([options])&lt;/code>&lt;/a> instead.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>Checks if the element is &lt;code>editable&lt;/code>.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Default&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>selector&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.strict&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>When &lt;code>true&lt;/code>, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.timeout&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>30000&lt;/code>&lt;/td>
&lt;td>Maximum time in milliseconds. Pass &lt;code>0&lt;/code> to disable the timeout. Default is overridden by the &lt;code>setDefaultTimeout&lt;/code> option on
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/">BrowserContext&lt;/a> or
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/page/">Page&lt;/a>.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Promise&amp;lt;bool&amp;gt;&lt;/code>&lt;/td>
&lt;td>A Promise that fullfils with &lt;code>true&lt;/code> if the element is &lt;code>editable&lt;/code>, else &lt;code>false&lt;/code>.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>isEnabled(selector[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/isenabled/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/isenabled/</guid><content><![CDATA[&lt;h1 id=&#34;isenabledselector-options&#34;&gt;isEnabled(selector[, options])&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Use locator-based 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/isenabled/&#34;&gt;&lt;code&gt;locator.isEnabled([options])&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Checks if the element is &lt;code&gt;enabled&lt;/code&gt;.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;selector&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.strict&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When &lt;code&gt;true&lt;/code&gt;, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;bool&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fullfils with &lt;code&gt;true&lt;/code&gt; if the element is &lt;code&gt;enabled&lt;/code&gt;, else &lt;code&gt;false&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="isenabledselector-options">isEnabled(selector[, options])&lt;/h1>
&lt;div class="admonition admonition-warning">&lt;blockquote>&lt;p class="title text-uppercase">Warning&lt;/p>&lt;p>Use locator-based
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/locator/isenabled/">&lt;code>locator.isEnabled([options])&lt;/code>&lt;/a> instead.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>Checks if the element is &lt;code>enabled&lt;/code>.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Default&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>selector&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.strict&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>When &lt;code>true&lt;/code>, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.timeout&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>30000&lt;/code>&lt;/td>
&lt;td>Maximum time in milliseconds. Pass &lt;code>0&lt;/code> to disable the timeout. Default is overridden by the &lt;code>setDefaultTimeout&lt;/code> option on
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/">BrowserContext&lt;/a> or
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/page/">Page&lt;/a>.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Promise&amp;lt;bool&amp;gt;&lt;/code>&lt;/td>
&lt;td>A Promise that fullfils with &lt;code>true&lt;/code> if the element is &lt;code>enabled&lt;/code>, else &lt;code>false&lt;/code>.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>isHidden(selector[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/ishidden/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/ishidden/</guid><content><![CDATA[&lt;h1 id=&#34;ishiddenselector-options&#34;&gt;isHidden(selector[, options])&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Use locator-based 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/ishidden/&#34;&gt;&lt;code&gt;locator.isHidden([options])&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Checks if the element is &lt;code&gt;hidden&lt;/code&gt;.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;selector&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A selector to search for an element. If there are multiple elements satisfying the selector, the first one will be used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.strict&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When &lt;code&gt;true&lt;/code&gt;, the call requires the selector to resolve to a single element. If the given selector resolves to more than one element, the call throws an exception.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;bool&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;true&lt;/code&gt; if the element is &lt;code&gt;hidden&lt;/code&gt;, &lt;code&gt;false&lt;/code&gt; otherwise.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;example&#34;&gt;Example&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;

export const options = {
  scenarios: {
    browser: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  },
};

export default async function () {
  const page = await browser.newPage();

  await page.goto(&amp;#39;https://test.k6.io/browser.php&amp;#39;);
  if (await page.isHidden(&amp;#39;#input-text-hidden&amp;#39;)) {
    console.log(&amp;#39;element is hidden&amp;#39;);
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="ishiddenselector-options">isHidden(selector[, options])&lt;/h1>
&lt;div class="admonition admonition-warning">&lt;blockquote>&lt;p class="title text-uppercase">Warning&lt;/p>&lt;p>Use locator-based
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/locator/ishidden/">&lt;code>locator.isHidden([options])&lt;/code>&lt;/a> instead.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>Checks if the element is &lt;code>hidden&lt;/code>.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Default&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>selector&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>A selector to search for an element. If there are multiple elements satisfying the selector, the first one will be used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.strict&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>When &lt;code>true&lt;/code>, the call requires the selector to resolve to a single element. If the given selector resolves to more than one element, the call throws an exception.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>bool&lt;/td>
&lt;td>&lt;code>true&lt;/code> if the element is &lt;code>hidden&lt;/code>, &lt;code>false&lt;/code> otherwise.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="example">Example&lt;/h3>
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">JavaScript&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-javascript">import { browser } from &amp;#39;k6/browser&amp;#39;;
export const options = {
scenarios: {
browser: {
executor: &amp;#39;shared-iterations&amp;#39;,
options: {
browser: {
type: &amp;#39;chromium&amp;#39;,
},
},
},
},
};
export default async function () {
const page = await browser.newPage();
await page.goto(&amp;#39;https://test.k6.io/browser.php&amp;#39;);
if (await page.isHidden(&amp;#39;#input-text-hidden&amp;#39;)) {
console.log(&amp;#39;element is hidden&amp;#39;);
}
}&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div></description></item><item><title>isVisible(selector[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/isvisible/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/isvisible/</guid><content><![CDATA[&lt;h1 id=&#34;isvisibleselector-options&#34;&gt;isVisible(selector[, options])&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Use locator-based 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/isvisible/&#34;&gt;&lt;code&gt;locator.isVisible([options])&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Checks if the element is &lt;code&gt;visible&lt;/code&gt;.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;selector&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A selector to search for an element. If there are multiple elements satisfying the selector, the first one will be used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.strict&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When &lt;code&gt;true&lt;/code&gt;, the call requires the selector to resolve to a single element. If the given selector resolves to more than one element, the call throws an exception.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;bool&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;true&lt;/code&gt; if the element is &lt;code&gt;visible&lt;/code&gt;, &lt;code&gt;false&lt;/code&gt; otherwise.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;example&#34;&gt;Example&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;

export const options = {
  scenarios: {
    browser: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  },
};

export default async function () {
  const page = await browser.newPage();

  await page.goto(&amp;#39;https://test.k6.io/browser.php&amp;#39;);

  const frames = page.frames();

  if (frames[0].isVisible(&amp;#39;#text1&amp;#39;)) {
    console.log(&amp;#39;element is visible&amp;#39;);
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="isvisibleselector-options">isVisible(selector[, options])&lt;/h1>
&lt;div class="admonition admonition-warning">&lt;blockquote>&lt;p class="title text-uppercase">Warning&lt;/p>&lt;p>Use locator-based
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/locator/isvisible/">&lt;code>locator.isVisible([options])&lt;/code>&lt;/a> instead.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>Checks if the element is &lt;code>visible&lt;/code>.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Default&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>selector&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>A selector to search for an element. If there are multiple elements satisfying the selector, the first one will be used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.strict&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>When &lt;code>true&lt;/code>, the call requires the selector to resolve to a single element. If the given selector resolves to more than one element, the call throws an exception.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>bool&lt;/td>
&lt;td>&lt;code>true&lt;/code> if the element is &lt;code>visible&lt;/code>, &lt;code>false&lt;/code> otherwise.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="example">Example&lt;/h3>
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">JavaScript&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-javascript">import { browser } from &amp;#39;k6/browser&amp;#39;;
export const options = {
scenarios: {
browser: {
executor: &amp;#39;shared-iterations&amp;#39;,
options: {
browser: {
type: &amp;#39;chromium&amp;#39;,
},
},
},
},
};
export default async function () {
const page = await browser.newPage();
await page.goto(&amp;#39;https://test.k6.io/browser.php&amp;#39;);
const frames = page.frames();
if (frames[0].isVisible(&amp;#39;#text1&amp;#39;)) {
console.log(&amp;#39;element is visible&amp;#39;);
}
}&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div></description></item><item><title>locator(selector[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/locator/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/locator/</guid><content><![CDATA[&lt;h1 id=&#34;locatorselector-options&#34;&gt;locator(selector[, options])&lt;/h1&gt;
&lt;p&gt;The method returns an element 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/&#34;&gt;Locator&lt;/a&gt;. Locators resolve to the element when the action takes place, which means locators can span over navigations where the underlying dom changes.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;selector&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A selector to use when resolving a DOM element.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.hasText&lt;/td&gt;
              &lt;td&gt;string or RegExp&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Matches only elements that contain the specified text. String or regular expression. Optional.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.hasNotText&lt;/td&gt;
              &lt;td&gt;string or RegExp&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Matches only elements that do not contain the specified text. String or regular expression. Optional.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/&#34;&gt;Locator&lt;/a&gt;&lt;/td&gt;
              &lt;td&gt;The element &lt;code&gt;Locator&lt;/code&gt; associated with the frame.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;example&#34;&gt;Example&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;

export const options = {
  scenarios: {
    ui: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  },
};

export default async function () {
  const page = await browser.newPage();

  try {
    await page.goto(&amp;#39;https://quickpizza.grafana.com&amp;#39;);

    // Get the mainframe of the page
    const frame = page.mainFrame();

    // Create a locator with text filtering options
    const submitButton = frame.locator(&amp;#39;button&amp;#39;, { hasText: &amp;#39;Pizza, Please!&amp;#39; });
    await submitButton.click();
  } finally {
    await page.close();
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="locatorselector-options">locator(selector[, options])&lt;/h1>
&lt;p>The method returns an element
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/locator/">Locator&lt;/a>. Locators resolve to the element when the action takes place, which means locators can span over navigations where the underlying dom changes.&lt;/p></description></item><item><title>name()</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/name/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/name/</guid><content><![CDATA[&lt;h1 id=&#34;name&#34;&gt;name()&lt;/h1&gt;
&lt;p&gt;This method returns the name of the frame.&lt;/p&gt;
&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;string&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The name of the frame.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="name">name()&lt;/h1>
&lt;p>This method returns the name of the frame.&lt;/p>
&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>string&lt;/code>&lt;/td>
&lt;td>The name of the frame.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>page()</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/page/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/page/</guid><content><![CDATA[&lt;h1 id=&#34;page&#34;&gt;page()&lt;/h1&gt;
&lt;p&gt;This method returns the parent 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt; object of the 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/&#34;&gt;Frame&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Page&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The parent page object of the frame.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="page">page()&lt;/h1>
&lt;p>This method returns the parent
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/page/">Page&lt;/a> object of the
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/frame/">Frame&lt;/a>.&lt;/p>
&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Page&lt;/code>&lt;/td>
&lt;td>The parent page object of the frame.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>parentFrame()</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/parentframe/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/parentframe/</guid><content><![CDATA[&lt;h1 id=&#34;parentframe&#34;&gt;parentFrame()&lt;/h1&gt;
&lt;p&gt;This method returns the parent 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/&#34;&gt;Frame&lt;/a&gt; object of the current frame.&lt;/p&gt;
&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Frame | null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The parent frame object of the frame. Or &lt;code&gt;null&lt;/code&gt; if the frame has no parent (main frame).&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="parentframe">parentFrame()&lt;/h1>
&lt;p>This method returns the parent
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/frame/">Frame&lt;/a> object of the current frame.&lt;/p>
&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Frame | null&lt;/code>&lt;/td>
&lt;td>The parent frame object of the frame. Or &lt;code>null&lt;/code> if the frame has no parent (main frame).&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>press(selector, key[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/press/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/press/</guid><content><![CDATA[&lt;h1 id=&#34;pressselector-key-options&#34;&gt;press(selector, key[, options])&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Use locator-based 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/press/&#34;&gt;&lt;code&gt;locator.press()&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Focuses the element, and then uses &lt;code&gt;keyboard.down(key)&lt;/code&gt; and &lt;code&gt;keyboard.up(key)&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;A superset of the &lt;code&gt;key&lt;/code&gt; values can be found &lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Following modification shortcuts are also supported: &lt;code&gt;Shift&lt;/code&gt;, &lt;code&gt;Control&lt;/code&gt;, &lt;code&gt;Alt&lt;/code&gt;, &lt;code&gt;Meta&lt;/code&gt;, &lt;code&gt;ShiftLeft&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Holding down &lt;code&gt;Shift&lt;/code&gt; will type the text that corresponds to the &lt;code&gt;key&lt;/code&gt; in the upper case.&lt;/p&gt;
&lt;p&gt;If &lt;code&gt;key&lt;/code&gt; is a single character, it is case-sensitive, so the values &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;A&lt;/code&gt; will generate different respective texts.&lt;/p&gt;
&lt;p&gt;Shortcuts such as &lt;code&gt;key: &amp;quot;Control&#43;o&amp;quot;&lt;/code&gt; or &lt;code&gt;key: &amp;quot;Control&#43;Shift&#43;T&amp;quot;&lt;/code&gt; are supported as well. When specified with the modifier, modifier is pressed and being held while the subsequent key is being pressed.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;selector&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;key&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Name of the key to press or a character to generate, such as &lt;code&gt;ArrowLeft&lt;/code&gt; or &lt;code&gt;a&lt;/code&gt;. A superset of the key values can be found &lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;here&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.delay&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;0&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Milliseconds to wait between &lt;code&gt;keydown&lt;/code&gt; and &lt;code&gt;keyup&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.noWaitAfter&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;If set to &lt;code&gt;true&lt;/code&gt; and a navigation occurs from performing this action, it will not wait for it to complete.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.strict&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When &lt;code&gt;true&lt;/code&gt;, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;void&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fullfils when the press action is finished.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="pressselector-key-options">press(selector, key[, options])&lt;/h1>
&lt;div class="admonition admonition-warning">&lt;blockquote>&lt;p class="title text-uppercase">Warning&lt;/p>&lt;p>Use locator-based
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/locator/press/">&lt;code>locator.press()&lt;/code>&lt;/a> instead.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>Focuses the element, and then uses &lt;code>keyboard.down(key)&lt;/code> and &lt;code>keyboard.up(key)&lt;/code>.&lt;/p>
&lt;p>A superset of the &lt;code>key&lt;/code> values can be found &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values" target="_blank" rel="noopener noreferrer">here&lt;/a>.&lt;/p></description></item><item><title>selectOption(selector, values[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/selectoption/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/selectoption/</guid><content><![CDATA[&lt;h1 id=&#34;selectoptionselector-values-options&#34;&gt;selectOption(selector, values[, options])&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Use locator-based 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/selectoption/&#34;&gt;&lt;code&gt;locator.selectOption()&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Selects one or more options which match the values from a &lt;code&gt;&amp;lt;select&amp;gt;&lt;/code&gt; element.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;selector&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;values&lt;/td&gt;
              &lt;td&gt;string or string[] or object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;If the &lt;code&gt;select&lt;/code&gt; has the multiple attribute, all matching options are selected, otherwise only the first option matching one of the passed options is selected. Object can be made up of keys with &lt;code&gt;value&lt;/code&gt;, &lt;code&gt;label&lt;/code&gt; or &lt;code&gt;index&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.force&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Setting this to &lt;code&gt;true&lt;/code&gt; will bypass the actionability checks (&lt;code&gt;visible&lt;/code&gt;, &lt;code&gt;stable&lt;/code&gt;, &lt;code&gt;enabled&lt;/code&gt;).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.noWaitAfter&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;If set to &lt;code&gt;true&lt;/code&gt; and a navigation occurs from performing this action, it will not wait for it to complete.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.strict&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When &lt;code&gt;true&lt;/code&gt;, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;string[]&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fulfills with the list of the selected options.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="selectoptionselector-values-options">selectOption(selector, values[, options])&lt;/h1>
&lt;div class="admonition admonition-warning">&lt;blockquote>&lt;p class="title text-uppercase">Warning&lt;/p>&lt;p>Use locator-based
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/locator/selectoption/">&lt;code>locator.selectOption()&lt;/code>&lt;/a> instead.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>Selects one or more options which match the values from a &lt;code>&amp;lt;select&amp;gt;&lt;/code> element.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Default&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>selector&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>values&lt;/td>
&lt;td>string or string[] or object&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>If the &lt;code>select&lt;/code> has the multiple attribute, all matching options are selected, otherwise only the first option matching one of the passed options is selected. Object can be made up of keys with &lt;code>value&lt;/code>, &lt;code>label&lt;/code> or &lt;code>index&lt;/code>.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.force&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>Setting this to &lt;code>true&lt;/code> will bypass the actionability checks (&lt;code>visible&lt;/code>, &lt;code>stable&lt;/code>, &lt;code>enabled&lt;/code>).&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.noWaitAfter&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>If set to &lt;code>true&lt;/code> and a navigation occurs from performing this action, it will not wait for it to complete.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.strict&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>When &lt;code>true&lt;/code>, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.timeout&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>30000&lt;/code>&lt;/td>
&lt;td>Maximum time in milliseconds. Pass &lt;code>0&lt;/code> to disable the timeout. Default is overridden by the &lt;code>setDefaultTimeout&lt;/code> option on
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/">BrowserContext&lt;/a> or
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/page/">Page&lt;/a>.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Promise&amp;lt;string[]&amp;gt;&lt;/code>&lt;/td>
&lt;td>A Promise that fulfills with the list of the selected options.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>setChecked(selector, checked[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/setchecked/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/setchecked/</guid><content><![CDATA[&lt;h1 id=&#34;setcheckedselector-checked-options&#34;&gt;setChecked(selector, checked[, options])&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Use 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/setchecked/&#34;&gt;&lt;code&gt;locator.setChecked(checked [, options])&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Use this method to select on unselect an &lt;code&gt;input&lt;/code&gt; or &lt;code&gt;radio&lt;/code&gt; checkbox.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Optional parameters.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.force&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Setting this to &lt;code&gt;true&lt;/code&gt; will bypass the actionability checks (&lt;code&gt;visible&lt;/code&gt;, &lt;code&gt;stable&lt;/code&gt;, &lt;code&gt;enabled&lt;/code&gt;).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.noWaitAfter&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;If set to &lt;code&gt;true&lt;/code&gt; and a navigation occurs from performing this action, it will not wait for it to complete.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.position&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A point to use relative to the top left corner of the element. If not supplied, a visible point of the element is used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.position.x&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;0&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The x coordinate.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.position.y&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;0&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The y coordinate.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.trial&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Setting this to &lt;code&gt;true&lt;/code&gt; will perform the actionability checks without performing the action.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.strict&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When &lt;code&gt;true&lt;/code&gt;, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;void&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fulfills when the check action is finished.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;example&#34;&gt;Example&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;

export const options = {
  scenarios: {
    browser: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  },
};

export default async function () {
  const page = await browser.newPage();
  await page.goto(&amp;#39;https://test.k6.io/browser.php&amp;#39;);

  const frame = page.mainFrame();
  await frame.setChecked(&amp;#39;#checkbox1&amp;#39;, true);
  await frame.setChecked(&amp;#39;#checkbox1&amp;#39;, false);

  await page.close();
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="setcheckedselector-checked-options">setChecked(selector, checked[, options])&lt;/h1>
&lt;div class="admonition admonition-warning">&lt;blockquote>&lt;p class="title text-uppercase">Warning&lt;/p>&lt;p>Use
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/locator/setchecked/">&lt;code>locator.setChecked(checked [, options])&lt;/code>&lt;/a> instead.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>Use this method to select on unselect an &lt;code>input&lt;/code> or &lt;code>radio&lt;/code> checkbox.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Default&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>Optional parameters.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.force&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>Setting this to &lt;code>true&lt;/code> will bypass the actionability checks (&lt;code>visible&lt;/code>, &lt;code>stable&lt;/code>, &lt;code>enabled&lt;/code>).&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.noWaitAfter&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>If set to &lt;code>true&lt;/code> and a navigation occurs from performing this action, it will not wait for it to complete.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.position&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>A point to use relative to the top left corner of the element. If not supplied, a visible point of the element is used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.position.x&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>0&lt;/code>&lt;/td>
&lt;td>The x coordinate.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.position.y&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>0&lt;/code>&lt;/td>
&lt;td>The y coordinate.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.timeout&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>30000&lt;/code>&lt;/td>
&lt;td>Maximum time in milliseconds. Pass &lt;code>0&lt;/code> to disable the timeout. Default is overridden by the &lt;code>setDefaultTimeout&lt;/code> option on
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/">BrowserContext&lt;/a> or
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/page/">Page&lt;/a>.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.trial&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>Setting this to &lt;code>true&lt;/code> will perform the actionability checks without performing the action.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.strict&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>When &lt;code>true&lt;/code>, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Promise&amp;lt;void&amp;gt;&lt;/code>&lt;/td>
&lt;td>A Promise that fulfills when the check action is finished.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="example">Example&lt;/h3>
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">JavaScript&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-javascript">import { browser } from &amp;#39;k6/browser&amp;#39;;
export const options = {
scenarios: {
browser: {
executor: &amp;#39;shared-iterations&amp;#39;,
options: {
browser: {
type: &amp;#39;chromium&amp;#39;,
},
},
},
},
};
export default async function () {
const page = await browser.newPage();
await page.goto(&amp;#39;https://test.k6.io/browser.php&amp;#39;);
const frame = page.mainFrame();
await frame.setChecked(&amp;#39;#checkbox1&amp;#39;, true);
await frame.setChecked(&amp;#39;#checkbox1&amp;#39;, false);
await page.close();
}&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div></description></item><item><title>setContent(html[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/setcontent/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/setcontent/</guid><content><![CDATA[&lt;h1 id=&#34;setcontenthtml-options&#34;&gt;setContent(html[, options])&lt;/h1&gt;
&lt;p&gt;Sets the supplied HTML string to the current frame.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;html&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;HTML markup to assign to the page.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum operation time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. The default value can be changed via the 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/setdefaultnavigationtimeout/&#34;&gt;browserContext.setDefaultNavigationTimeout(timeout)&lt;/a&gt;, 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/setdefaulttimeout/&#34;&gt;browserContext.setDefaultTimeout(timeout)&lt;/a&gt;, 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/setdefaultnavigationtimeout/&#34;&gt;page.setDefaultNavigationTimeout(timeout)&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/setdefaulttimeout/&#34;&gt;page.setDefaultTimeout(timeout)&lt;/a&gt; methods. Setting the value to &lt;code&gt;0&lt;/code&gt; will disable the timeout.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.waitUntil&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;load&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When to consider operation to have succeeded. See Events for more details.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;void&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fulfills when the page has been set with the supplied HTML.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="setcontenthtml-options">setContent(html[, options])&lt;/h1>
&lt;p>Sets the supplied HTML string to the current frame.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Default&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>html&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>HTML markup to assign to the page.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.timeout&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>30000&lt;/code>&lt;/td>
&lt;td>Maximum operation time in milliseconds. Pass &lt;code>0&lt;/code> to disable the timeout. The default value can be changed via the
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/setdefaultnavigationtimeout/">browserContext.setDefaultNavigationTimeout(timeout)&lt;/a>,
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/setdefaulttimeout/">browserContext.setDefaultTimeout(timeout)&lt;/a>,
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/page/setdefaultnavigationtimeout/">page.setDefaultNavigationTimeout(timeout)&lt;/a> or
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/page/setdefaulttimeout/">page.setDefaultTimeout(timeout)&lt;/a> methods. Setting the value to &lt;code>0&lt;/code> will disable the timeout.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.waitUntil&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>load&lt;/code>&lt;/td>
&lt;td>When to consider operation to have succeeded. See Events for more details.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Promise&amp;lt;void&amp;gt;&lt;/code>&lt;/td>
&lt;td>A Promise that fulfills when the page has been set with the supplied HTML.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>setInputFiles(selector, file[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/setinputfiles/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/setinputfiles/</guid><content><![CDATA[&lt;h1 id=&#34;setinputfilesselector-file-options&#34;&gt;setInputFiles(selector, file[, options])&lt;/h1&gt;
&lt;p&gt;Sets the file input element&amp;rsquo;s value to the specified files.&lt;/p&gt;
&lt;p&gt;To work with local files on the file system, use the &lt;a href=&#34;/docs/k6/latest/javascript-api/k6-experimental/fs/&#34;&gt;experimental fs module&lt;/a&gt; to load and read the file contents.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;selector&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;file&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;This is a required parameter.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;file.name&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The name of the file. For example, &lt;code&gt;file.txt&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;file.mimeType&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The type of the file content. For example, &lt;code&gt;text/plain&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;file.buffer&lt;/td&gt;
              &lt;td&gt;ArrayBuffer&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;[]&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Base64 encoded content of the file.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;This is an optional parameter.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.noWaitAfter&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;If set to &lt;code&gt;true&lt;/code&gt; and a navigation occurs from performing this action, it will not wait for it to complete.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;inline-file-example&#34;&gt;Inline File Example&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;
import encoding from &amp;#39;k6/encoding&amp;#39;;

export const options = {
  scenarios: {
    browser: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  },
};

export default async function () {
  const page = await browser.newPage();

  try {
    // In this example we create a simple web page with an upload input field.
    // Usually, you would use page.goto to navigate to a page with a file input field.
    await page.setContent(`
      &amp;lt;html&amp;gt;
        &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;
        &amp;lt;body&amp;gt;
            &amp;lt;!-- Simple file upload form --&amp;gt;
            &amp;lt;form method=&amp;#34;POST&amp;#34; action=&amp;#34;/upload&amp;#34; enctype=&amp;#34;multipart/form-data&amp;#34;&amp;gt;
                &amp;lt;input type=&amp;#34;file&amp;#34; id=&amp;#34;upload&amp;#34; multiple /&amp;gt;
                &amp;lt;input type=&amp;#34;submit&amp;#34; value=&amp;#34;Send&amp;#34; /&amp;gt;
            &amp;lt;/form&amp;gt;
        &amp;lt;/body&amp;gt;
      &amp;lt;/html&amp;gt;`);

    const frame = page.mainFrame();

    // The file is set to the input element with the id &amp;#34;upload&amp;#34;.
    frame.setInputFiles(&amp;#39;input[id=&amp;#34;upload&amp;#34;]&amp;#39;, {
      name: &amp;#39;file.txt&amp;#39;,
      mimetype: &amp;#39;text/plain&amp;#39;,
      buffer: encoding.b64encode(&amp;#39;hello world&amp;#39;),
    });
  } finally {
    await page.close();
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;local-file-example&#34;&gt;Local File Example&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;
import encoding from &amp;#39;k6/encoding&amp;#39;;
import { open } from &amp;#39;k6/experimental/fs&amp;#39;;

export const options = {
  scenarios: {
    ui: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  },
};

// Declare the location of the file on the local filesystem.
let file;
(async function () {
  file = await open(&amp;#39;/abs/path/to/file.txt&amp;#39;);
})();

export default async function () {
  const page = await browser.newPage();

  try {
    // In this example we create a simple web page with an upload input field.
    // Usually, you would use page.goto to navigate to a page with a file input field.
    await page.setContent(`
      &amp;lt;html&amp;gt;
        &amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;
        &amp;lt;body&amp;gt;
            &amp;lt;!-- Simple file upload form --&amp;gt;
            &amp;lt;form method=&amp;#34;POST&amp;#34; action=&amp;#34;/upload&amp;#34; enctype=&amp;#34;multipart/form-data&amp;#34;&amp;gt;
                &amp;lt;input type=&amp;#34;file&amp;#34; id=&amp;#34;upload&amp;#34; multiple /&amp;gt;
                &amp;lt;input type=&amp;#34;submit&amp;#34; value=&amp;#34;Send&amp;#34; /&amp;gt;
            &amp;lt;/form&amp;gt;
        &amp;lt;/body&amp;gt;
      &amp;lt;/html&amp;gt;`);

    const frame = page.mainFrame();

    // Read the whole file content into a buffer.
    const buffer = await readAll(file);

    // The file is set to the input element with the id &amp;#34;upload&amp;#34;.
    frame.setInputFiles({
      name: &amp;#39;file.txt&amp;#39;,
      mimetype: &amp;#39;text/plain&amp;#39;,
      buffer: encoding.b64encode(buffer),
    });
  } finally {
    await page.close();
  }
}

// readAll will read the whole of the file from the local filesystem into a
// buffer.
async function readAll(file) {
  const fileInfo = await file.stat();
  const buffer = new Uint8Array(fileInfo.size);

  const bytesRead = await file.read(buffer);
  if (bytesRead !== fileInfo.size) {
    throw new Error(&amp;#39;unexpected number of bytes read&amp;#39;);
  }

  return buffer;
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="setinputfilesselector-file-options">setInputFiles(selector, file[, options])&lt;/h1>
&lt;p>Sets the file input element&amp;rsquo;s value to the specified files.&lt;/p>
&lt;p>To work with local files on the file system, use the &lt;a href="/docs/k6/latest/javascript-api/k6-experimental/fs/">experimental fs module&lt;/a> to load and read the file contents.&lt;/p></description></item><item><title>tap(selector[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/tap/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/tap/</guid><content><![CDATA[&lt;h1 id=&#34;tapselector-options&#34;&gt;tap(selector[, options])&lt;/h1&gt;
&lt;p&gt;Tap the first element that matches the selector.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;selector&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.force&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Setting this to &lt;code&gt;true&lt;/code&gt; will bypass the actionability checks (&lt;code&gt;visible&lt;/code&gt;, &lt;code&gt;stable&lt;/code&gt;, &lt;code&gt;enabled&lt;/code&gt;).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.modifiers&lt;/td&gt;
              &lt;td&gt;string[]&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;Alt&lt;/code&gt;, &lt;code&gt;Control&lt;/code&gt;, &lt;code&gt;Meta&lt;/code&gt; or &lt;code&gt;Shift&lt;/code&gt; modifiers keys pressed during the action. If not specified, currently pressed modifiers are used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.noWaitAfter&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;If set to &lt;code&gt;true&lt;/code&gt; and a navigation occurs from performing this action, it will not wait for it to complete.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.position&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A point to use relative to the top left corner of the element. If not supplied, a visible point of the element is used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.position.x&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;0&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The x coordinate.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.position.y&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;0&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The y coordinate.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.strict&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When &lt;code&gt;true&lt;/code&gt;, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.trial&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Setting this to &lt;code&gt;true&lt;/code&gt; will perform the actionability checks without performing the action.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;void&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fulfills when the tap action is finished.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;example&#34;&gt;Example&lt;/h3&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;

export const options = {
  scenarios: {
    browser: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  },
};

export default async function () {
  const page = await browser.newPage({
    hasTouch: true,
  });

  await page.goto(&amp;#39;https://test.k6.io/browser.php&amp;#39;);
  const frame = page.mainFrame();
  await frame.tap(&amp;#34;#numbers-options&amp;#34;);
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="tapselector-options">tap(selector[, options])&lt;/h1>
&lt;p>Tap the first element that matches the selector.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Default&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>selector&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.force&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>Setting this to &lt;code>true&lt;/code> will bypass the actionability checks (&lt;code>visible&lt;/code>, &lt;code>stable&lt;/code>, &lt;code>enabled&lt;/code>).&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.modifiers&lt;/td>
&lt;td>string[]&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;code>Alt&lt;/code>, &lt;code>Control&lt;/code>, &lt;code>Meta&lt;/code> or &lt;code>Shift&lt;/code> modifiers keys pressed during the action. If not specified, currently pressed modifiers are used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.noWaitAfter&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>If set to &lt;code>true&lt;/code> and a navigation occurs from performing this action, it will not wait for it to complete.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.position&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>A point to use relative to the top left corner of the element. If not supplied, a visible point of the element is used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.position.x&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>0&lt;/code>&lt;/td>
&lt;td>The x coordinate.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.position.y&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>0&lt;/code>&lt;/td>
&lt;td>The y coordinate.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.strict&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>When &lt;code>true&lt;/code>, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.timeout&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>30000&lt;/code>&lt;/td>
&lt;td>Maximum time in milliseconds. Pass &lt;code>0&lt;/code> to disable the timeout. Default is overridden by the &lt;code>setDefaultTimeout&lt;/code> option on
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/">BrowserContext&lt;/a> or
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/page/">Page&lt;/a>.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.trial&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>Setting this to &lt;code>true&lt;/code> will perform the actionability checks without performing the action.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Promise&amp;lt;void&amp;gt;&lt;/code>&lt;/td>
&lt;td>A Promise that fulfills when the tap action is finished.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="example">Example&lt;/h3>
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">JavaScript&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-javascript">import { browser } from &amp;#39;k6/browser&amp;#39;;
export const options = {
scenarios: {
browser: {
executor: &amp;#39;shared-iterations&amp;#39;,
options: {
browser: {
type: &amp;#39;chromium&amp;#39;,
},
},
},
},
};
export default async function () {
const page = await browser.newPage({
hasTouch: true,
});
await page.goto(&amp;#39;https://test.k6.io/browser.php&amp;#39;);
const frame = page.mainFrame();
await frame.tap(&amp;#34;#numbers-options&amp;#34;);
}&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div></description></item><item><title>textContent(selector[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/textcontent/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/textcontent/</guid><content><![CDATA[&lt;h1 id=&#34;textcontentselector-options&#34;&gt;textContent(selector[, options])&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Use locator-based 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/textcontent/&#34;&gt;&lt;code&gt;locator.textContent([options])&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Returns the &lt;code&gt;element.textContent&lt;/code&gt;.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;selector&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.strict&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When &lt;code&gt;true&lt;/code&gt;, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;string | null&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fulfills with the text content of the selector or &lt;code&gt;null&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="textcontentselector-options">textContent(selector[, options])&lt;/h1>
&lt;div class="admonition admonition-warning">&lt;blockquote>&lt;p class="title text-uppercase">Warning&lt;/p>&lt;p>Use locator-based
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/locator/textcontent/">&lt;code>locator.textContent([options])&lt;/code>&lt;/a> instead.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>Returns the &lt;code>element.textContent&lt;/code>.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Default&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>selector&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.strict&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>When &lt;code>true&lt;/code>, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.timeout&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>30000&lt;/code>&lt;/td>
&lt;td>Maximum time in milliseconds. Pass &lt;code>0&lt;/code> to disable the timeout. Default is overridden by the &lt;code>setDefaultTimeout&lt;/code> option on
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/">BrowserContext&lt;/a> or
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/page/">Page&lt;/a>.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Promise&amp;lt;string | null&amp;gt;&lt;/code>&lt;/td>
&lt;td>A Promise that fulfills with the text content of the selector or &lt;code>null&lt;/code>.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>title()</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/title/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/title/</guid><content><![CDATA[&lt;h1 id=&#34;title&#34;&gt;title()&lt;/h1&gt;
&lt;p&gt;Returns the frame&amp;rsquo;s title.&lt;/p&gt;
&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;string&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fulfills with the frame&amp;rsquo;s title.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="title">title()&lt;/h1>
&lt;p>Returns the frame&amp;rsquo;s title.&lt;/p>
&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Promise&amp;lt;string&amp;gt;&lt;/code>&lt;/td>
&lt;td>A Promise that fulfills with the frame&amp;rsquo;s title.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>type(selector, text[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/type/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/type/</guid><content><![CDATA[&lt;h1 id=&#34;typeselector-text-options&#34;&gt;type(selector, text[, options])&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Use locator-based 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/type/&#34;&gt;&lt;code&gt;locator.type()&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Type the &lt;code&gt;text&lt;/code&gt; in the first element found that matches the selector.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;selector&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;text&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A text to type into a focused element.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.delay&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;0&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Milliseconds to wait between key presses. Defaults to &lt;code&gt;0&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.noWaitAfter&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;If set to &lt;code&gt;true&lt;/code&gt; and a navigation occurs from performing this action, it will not wait for it to complete.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.strict&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When &lt;code&gt;true&lt;/code&gt;, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;void&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fulfills when the text has been typed.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="typeselector-text-options">type(selector, text[, options])&lt;/h1>
&lt;div class="admonition admonition-warning">&lt;blockquote>&lt;p class="title text-uppercase">Warning&lt;/p>&lt;p>Use locator-based
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/locator/type/">&lt;code>locator.type()&lt;/code>&lt;/a> instead.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>Type the &lt;code>text&lt;/code> in the first element found that matches the selector.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Default&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>selector&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>text&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>A text to type into a focused element.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.delay&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>0&lt;/code>&lt;/td>
&lt;td>Milliseconds to wait between key presses. Defaults to &lt;code>0&lt;/code>.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.noWaitAfter&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>If set to &lt;code>true&lt;/code> and a navigation occurs from performing this action, it will not wait for it to complete.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.strict&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>When &lt;code>true&lt;/code>, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.timeout&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>30000&lt;/code>&lt;/td>
&lt;td>Maximum time in milliseconds. Pass &lt;code>0&lt;/code> to disable the timeout. Default is overridden by the &lt;code>setDefaultTimeout&lt;/code> option on
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/">BrowserContext&lt;/a> or
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/page/">Page&lt;/a>.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Promise&amp;lt;void&amp;gt;&lt;/code>&lt;/td>
&lt;td>A Promise that fulfills when the text has been typed.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>uncheck(selector[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/uncheck/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/uncheck/</guid><content><![CDATA[&lt;h1 id=&#34;uncheckselector-options&#34;&gt;uncheck(selector[, options])&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Use locator-based 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/uncheck/&#34;&gt;&lt;code&gt;locator.uncheck([options])&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;This method is used to unselect an input checkbox.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;selector&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.force&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Setting this to &lt;code&gt;true&lt;/code&gt; will bypass the actionability checks (&lt;code&gt;visible&lt;/code&gt;, &lt;code&gt;stable&lt;/code&gt;, &lt;code&gt;enabled&lt;/code&gt;).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.noWaitAfter&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;If set to &lt;code&gt;true&lt;/code&gt; and a navigation occurs from performing this action, it will not wait for it to complete.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.position&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A point to use relative to the top left corner of the element. If not supplied, a visible point of the element is used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.position.x&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;0&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The x coordinate.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.position.y&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;0&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The y coordinate.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.strict&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When &lt;code&gt;true&lt;/code&gt;, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.trial&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Setting this to &lt;code&gt;true&lt;/code&gt; will perform the actionability checks without performing the action.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;void&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fulfills when the checkbox is unchecked.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="uncheckselector-options">uncheck(selector[, options])&lt;/h1>
&lt;div class="admonition admonition-warning">&lt;blockquote>&lt;p class="title text-uppercase">Warning&lt;/p>&lt;p>Use locator-based
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/locator/uncheck/">&lt;code>locator.uncheck([options])&lt;/code>&lt;/a> instead.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>This method is used to unselect an input checkbox.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Default&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>selector&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.force&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>Setting this to &lt;code>true&lt;/code> will bypass the actionability checks (&lt;code>visible&lt;/code>, &lt;code>stable&lt;/code>, &lt;code>enabled&lt;/code>).&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.noWaitAfter&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>If set to &lt;code>true&lt;/code> and a navigation occurs from performing this action, it will not wait for it to complete.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.position&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>A point to use relative to the top left corner of the element. If not supplied, a visible point of the element is used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.position.x&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>0&lt;/code>&lt;/td>
&lt;td>The x coordinate.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.position.y&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>0&lt;/code>&lt;/td>
&lt;td>The y coordinate.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.strict&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>When &lt;code>true&lt;/code>, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.timeout&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>30000&lt;/code>&lt;/td>
&lt;td>Maximum time in milliseconds. Pass &lt;code>0&lt;/code> to disable the timeout. Default is overridden by the &lt;code>setDefaultTimeout&lt;/code> option on
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/">BrowserContext&lt;/a> or
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/page/">Page&lt;/a>.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.trial&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>Setting this to &lt;code>true&lt;/code> will perform the actionability checks without performing the action.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>Promise&amp;lt;void&amp;gt;&lt;/code>&lt;/td>
&lt;td>A Promise that fulfills when the checkbox is unchecked.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>url()</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/url/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/url/</guid><content><![CDATA[&lt;h1 id=&#34;url&#34;&gt;url()&lt;/h1&gt;
&lt;p&gt;Returns the frame&amp;rsquo;s URL.&lt;/p&gt;
&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;The frame&amp;rsquo;s URL.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="url">url()&lt;/h1>
&lt;p>Returns the frame&amp;rsquo;s URL.&lt;/p>
&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>string&lt;/td>
&lt;td>The frame&amp;rsquo;s URL.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>waitForFunction(pageFunction, options[, arg])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/waitforfunction/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/waitforfunction/</guid><content><![CDATA[&lt;h1 id=&#34;waitforfunctionpagefunction-options-arg&#34;&gt;waitForFunction(pageFunction, options[, arg])&lt;/h1&gt;
&lt;p&gt;Returns when the &lt;code&gt;pageFunction&lt;/code&gt; returns a truthy value.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;pageFunction&lt;/td&gt;
              &lt;td&gt;function&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
              &lt;td&gt;Function to be evaluated in the page context.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.polling&lt;/td&gt;
              &lt;td&gt;number, &lt;code&gt;raf&lt;/code&gt;, or &lt;code&gt;mutation&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;raf&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;If &lt;code&gt;polling&lt;/code&gt; is &lt;code&gt;&#39;raf&#39;&lt;/code&gt;, then &lt;code&gt;pageFunction&lt;/code&gt; is constantly executed in &lt;code&gt;requestAnimationFrame&lt;/code&gt; callback. If &lt;code&gt;polling&lt;/code&gt; is &lt;code&gt;&#39;mutation&#39;&lt;/code&gt;, then &lt;code&gt;pageFunction&lt;/code&gt; is executed on each change to the DOM tree. If &lt;code&gt;polling&lt;/code&gt; is a number, then it is treated as an interval in milliseconds at which the function would be executed.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;arg&lt;/td&gt;
              &lt;td&gt;any&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Optional argument to pass to &lt;code&gt;pageFunction&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Promise&amp;lt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/jshandle/&#34;&gt;JSHandle&lt;/a&gt;&amp;gt;&lt;/td&gt;
              &lt;td&gt;The &lt;code&gt;JSHandle&lt;/code&gt; instance associated with the page.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="waitforfunctionpagefunction-options-arg">waitForFunction(pageFunction, options[, arg])&lt;/h1>
&lt;p>Returns when the &lt;code>pageFunction&lt;/code> returns a truthy value.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Default&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>pageFunction&lt;/td>
&lt;td>function&lt;/td>
&lt;td>&lt;/td>
&lt;td>Function to be evaluated in the page context.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.polling&lt;/td>
&lt;td>number, &lt;code>raf&lt;/code>, or &lt;code>mutation&lt;/code>&lt;/td>
&lt;td>&lt;code>raf&lt;/code>&lt;/td>
&lt;td>If &lt;code>polling&lt;/code> is &lt;code>'raf'&lt;/code>, then &lt;code>pageFunction&lt;/code> is constantly executed in &lt;code>requestAnimationFrame&lt;/code> callback. If &lt;code>polling&lt;/code> is &lt;code>'mutation'&lt;/code>, then &lt;code>pageFunction&lt;/code> is executed on each change to the DOM tree. If &lt;code>polling&lt;/code> is a number, then it is treated as an interval in milliseconds at which the function would be executed.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.timeout&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>30000&lt;/code>&lt;/td>
&lt;td>Maximum time in milliseconds. Pass &lt;code>0&lt;/code> to disable the timeout. Default is overridden by the &lt;code>setDefaultTimeout&lt;/code> option on
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/">BrowserContext&lt;/a> or
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/page/">Page&lt;/a>.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>arg&lt;/td>
&lt;td>any&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>Optional argument to pass to &lt;code>pageFunction&lt;/code>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="returns">Returns&lt;/h3>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Type&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Promise&amp;lt;
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/jshandle/">JSHandle&lt;/a>&amp;gt;&lt;/td>
&lt;td>The &lt;code>JSHandle&lt;/code> instance associated with the page.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section></description></item><item><title>waitForLoadState(state[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/waitforloadstate/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/waitforloadstate/</guid><content><![CDATA[&lt;h1 id=&#34;waitforloadstatestate-options&#34;&gt;waitForLoadState(state[, options])&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-caution&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Caution&lt;/p&gt;&lt;p&gt;This method has &lt;strong&gt;known issues&lt;/strong&gt;. For details, refer to &lt;a href=&#34;https://github.com/grafana/xk6-browser/issues/880&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;#880&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;This waits for the given load state to be reached. It will immediately unblock if that lifecycle event has already been received.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;state&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;load&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Optional load state to wait for. See &lt;a href=&#34;#events&#34;&gt;Events&lt;/a&gt; for more details.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;events&#34;&gt;Events&lt;/h3&gt;


&lt;div class=&#34;admonition admonition-caution&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Caution&lt;/p&gt;&lt;p&gt;&lt;code&gt;networkidle&lt;/code&gt; is DISCOURAGED. Don&amp;rsquo;t use this method for testing especially with chatty websites where the event may never fire, rely on web assertions to assess readiness instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Events can be either:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&#39;domcontentloaded&#39;&lt;/code&gt; - consider operation to be finished when the &lt;code&gt;DOMContentLoaded&lt;/code&gt; event is fired.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&#39;load&#39;&lt;/code&gt; - consider operation to be finished when the &lt;code&gt;load&lt;/code&gt; event is fired.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&#39;networkidle&#39;&lt;/code&gt; - Consider operation to be finished when there are no network connections for at least &lt;code&gt;500&lt;/code&gt; ms.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;void&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fulfills when the load state is reached.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="waitforloadstatestate-options">waitForLoadState(state[, options])&lt;/h1>
&lt;div class="admonition admonition-caution">&lt;blockquote>&lt;p class="title text-uppercase">Caution&lt;/p>&lt;p>This method has &lt;strong>known issues&lt;/strong>. For details, refer to &lt;a href="https://github.com/grafana/xk6-browser/issues/880" target="_blank" rel="noopener noreferrer">#880&lt;/a>.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>This waits for the given load state to be reached. It will immediately unblock if that lifecycle event has already been received.&lt;/p></description></item><item><title>waitForNavigation([options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/waitfornavigation/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/waitfornavigation/</guid><content><![CDATA[&lt;h1 id=&#34;waitfornavigationoptions&#34;&gt;waitForNavigation([options])&lt;/h1&gt;
&lt;p&gt;Waits for the given navigation lifecycle event to occur and returns the main resource response.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.url&lt;/td&gt;
              &lt;td&gt;string|RegExp&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;URL or URL pattern to match the navigation URL against. Useful when frame navigation performs multiple redirects and you need to wait until a final destination within the frame is reached.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.waitUntil&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;load&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When to consider operation to have succeeded. See &lt;a href=&#34;#events&#34;&gt;Events&lt;/a&gt; for more details.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;when-to-use-the-url-option&#34;&gt;When to use the url option&lt;/h3&gt;
&lt;p&gt;Use &lt;code&gt;options.url&lt;/code&gt; when frame navigation passes through several intermediate pages (e.g., third‑party authentication or consent flows) before settling on a final URL. Matching the final URL or a regex pattern helps you reliably wait for the intended destination inside the frame. However, opt to work with 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/waitforurl/&#34;&gt;waitForURL&lt;/a&gt; instead since it mitigates the risk of race conditions better than &lt;code&gt;waitForNavigation&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;events&#34;&gt;Events&lt;/h3&gt;


&lt;div class=&#34;admonition admonition-caution&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Caution&lt;/p&gt;&lt;p&gt;&lt;code&gt;networkidle&lt;/code&gt; is DISCOURAGED. Don&amp;rsquo;t use this method for testing especially with chatty websites where the event may never fire, rely on web assertions to assess readiness instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Events can be either:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&#39;domcontentloaded&#39;&lt;/code&gt; - consider operation to be finished when the &lt;code&gt;DOMContentLoaded&lt;/code&gt; event is fired.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&#39;load&#39;&lt;/code&gt; - consider operation to be finished when the &lt;code&gt;load&lt;/code&gt; event is fired.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&#39;networkidle&#39;&lt;/code&gt; - Consider operation to be finished when there are no network connections for at least &lt;code&gt;500&lt;/code&gt; ms.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Promise&amp;lt;null | 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/response/&#34;&gt;Response&lt;/a&gt;&amp;gt;&lt;/td&gt;
              &lt;td&gt;The &lt;code&gt;Response&lt;/code&gt; instance associated with the frame. Else, it returns &lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;

export const options = {
  scenarios: {
    browser: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  },
};

export default async function () {
  const page = await browser.newPage();

  try {
    await page.setContent(`
      &amp;lt;iframe src=&amp;#34;https://quickpizza.grafana.com/test.k6.io/&amp;#34; width=&amp;#34;50%&amp;#34; height=&amp;#34;50%&amp;#34;&amp;gt;&amp;lt;/iframe&amp;gt;
    `);

    // Retreive the frame of the iframe
    const iframeElement = await page.$(&amp;#39;iframe&amp;#39;);
    const frame = await iframeElement.contentFrame();

    // Wait for navigation to a specific URL
    await Promise.all([
      frame.click(&amp;#39;a[href=&amp;#34;/my_messages.php&amp;#34;]&amp;#39;),
      frame.waitForNavigation({ url: &amp;#39;https://quickpizza.grafana.com/my_messages.php&amp;#39; }),
    ]);

    await frame.goto(&amp;#39;https://quickpizza.grafana.com/test.k6.io/&amp;#39;);

    // Wait for navigation using URL pattern with RegExp
    await Promise.all([
      frame.click(&amp;#39;a[href=&amp;#34;/browser.php&amp;#34;]&amp;#39;),
      frame.waitForNavigation({ url: /\/browser\.php$/ }),
    ]);
  } finally {
    await page.close();
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="waitfornavigationoptions">waitForNavigation([options])&lt;/h1>
&lt;p>Waits for the given navigation lifecycle event to occur and returns the main resource response.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Default&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.timeout&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>30000&lt;/code>&lt;/td>
&lt;td>Maximum time in milliseconds. Pass &lt;code>0&lt;/code> to disable the timeout. Default is overridden by the &lt;code>setDefaultTimeout&lt;/code> option on
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/">BrowserContext&lt;/a> or
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/page/">Page&lt;/a>.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.url&lt;/td>
&lt;td>string|RegExp&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>URL or URL pattern to match the navigation URL against. Useful when frame navigation performs multiple redirects and you need to wait until a final destination within the frame is reached.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.waitUntil&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>load&lt;/code>&lt;/td>
&lt;td>When to consider operation to have succeeded. See &lt;a href="#events">Events&lt;/a> for more details.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="when-to-use-the-url-option">When to use the url option&lt;/h3>
&lt;p>Use &lt;code>options.url&lt;/code> when frame navigation passes through several intermediate pages (e.g., third‑party authentication or consent flows) before settling on a final URL. Matching the final URL or a regex pattern helps you reliably wait for the intended destination inside the frame. However, opt to work with
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/frame/waitforurl/">waitForURL&lt;/a> instead since it mitigates the risk of race conditions better than &lt;code>waitForNavigation&lt;/code>.&lt;/p></description></item><item><title>waitForSelector(selector[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/waitforselector/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/waitforselector/</guid><content><![CDATA[&lt;h1 id=&#34;waitforselectorselector-options&#34;&gt;waitForSelector(selector[, options])&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Use web assertions that assert visibility or a locator-based 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/waitfor/&#34;&gt;&lt;code&gt;locator.waitFor([options])&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Returns when element specified by selector satisfies &lt;code&gt;state&lt;/code&gt; option.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;selector&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;&#39;&#39;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.state&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;visible&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Can be either &lt;code&gt;attached&lt;/code&gt;, &lt;code&gt;detached&lt;/code&gt;, &lt;code&gt;visible&lt;/code&gt;, &lt;code&gt;hidden&lt;/code&gt; See &lt;a href=&#34;#element-states&#34;&gt;Element states&lt;/a&gt; for more details.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.strict&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When &lt;code&gt;true&lt;/code&gt;, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;element-states&#34;&gt;Element states&lt;/h3&gt;
&lt;p&gt;Element states can be either:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&#39;attached&#39;&lt;/code&gt; - wait for element to be present in DOM.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&#39;detached&#39;&lt;/code&gt; - wait for element to not be present in DOM.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&#39;visible&#39;&lt;/code&gt; - wait for element to have non-empty bounding box and no &lt;code&gt;visibility:hidden&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&#39;hidden&#39;&lt;/code&gt; - wait for element to be either detached from DOM, or have an empty bounding box or &lt;code&gt;visibility:hidden&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;ElementHandle | null&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fulfills with the 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/keyboard/&#34;&gt;ElementHandle&lt;/a&gt; when a matching element is found, or &lt;code&gt;null&lt;/code&gt; if the element is not found.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="waitforselectorselector-options">waitForSelector(selector[, options])&lt;/h1>
&lt;div class="admonition admonition-note">&lt;blockquote>&lt;p class="title text-uppercase">Note&lt;/p>&lt;p>Use web assertions that assert visibility or a locator-based
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/locator/waitfor/">&lt;code>locator.waitFor([options])&lt;/code>&lt;/a> instead.&lt;/p>&lt;/blockquote>&lt;/div>
&lt;p>Returns when element specified by selector satisfies &lt;code>state&lt;/code> option.&lt;/p>
&lt;section class="expand-table-wrapper">&lt;div class="button-div">
&lt;button class="expand-table-btn">Expand table&lt;/button>
&lt;/div>&lt;div class="responsive-table-wrapper">
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Parameter&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Default&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>selector&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>''&lt;/code>&lt;/td>
&lt;td>A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options&lt;/td>
&lt;td>object&lt;/td>
&lt;td>&lt;code>null&lt;/code>&lt;/td>
&lt;td>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.state&lt;/td>
&lt;td>string&lt;/td>
&lt;td>&lt;code>visible&lt;/code>&lt;/td>
&lt;td>Can be either &lt;code>attached&lt;/code>, &lt;code>detached&lt;/code>, &lt;code>visible&lt;/code>, &lt;code>hidden&lt;/code> See &lt;a href="#element-states">Element states&lt;/a> for more details.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.strict&lt;/td>
&lt;td>boolean&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;td>When &lt;code>true&lt;/code>, the call requires selector to resolve to a single element. If given selector resolves to more than one element, the call throws an exception.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>options.timeout&lt;/td>
&lt;td>number&lt;/td>
&lt;td>&lt;code>30000&lt;/code>&lt;/td>
&lt;td>Maximum time in milliseconds. Pass &lt;code>0&lt;/code> to disable the timeout. Default is overridden by the &lt;code>setDefaultTimeout&lt;/code> option on
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/">BrowserContext&lt;/a> or
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/page/">Page&lt;/a>.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;/div>
&lt;/section>&lt;h3 id="element-states">Element states&lt;/h3>
&lt;p>Element states can be either:&lt;/p></description></item><item><title>waitForTimeout(timeout)</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/waitfortimeout/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/waitfortimeout/</guid><content><![CDATA[&lt;h1 id=&#34;waitfortimeouttimeout&#34;&gt;waitForTimeout(timeout)&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Never wait for timeout in production, use this only for debugging. Tests that wait for time are inherently flaky. Use 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/locator/&#34;&gt;&lt;code&gt;Locator&lt;/code&gt;&lt;/a&gt; actions and web assertions that wait automatically.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Waits for the given &lt;code&gt;timeout&lt;/code&gt; in milliseconds.&lt;/p&gt;
&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Promise&amp;lt;void&amp;gt;&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A Promise that fulfills when the timeout is reached.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="waitfortimeouttimeout">waitForTimeout(timeout)&lt;/h1>
&lt;div class="admonition admonition-note">&lt;blockquote>&lt;p class="title text-uppercase">Note&lt;/p>&lt;p>Never wait for timeout in production, use this only for debugging. Tests that wait for time are inherently flaky. Use
&lt;a href="/docs/k6/v2.3.x/javascript-api/k6-browser/locator/">&lt;code>Locator&lt;/code>&lt;/a> actions and web assertions that wait automatically.&lt;/p></description></item><item><title>waitForURL(url[, options])</title><link>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/waitforurl/</link><pubDate>Mon, 21 Sep 2026 15:16:28 +0000</pubDate><guid>https://grafana.com/docs/k6/v2.3.x/javascript-api/k6-browser/frame/waitforurl/</guid><content><![CDATA[&lt;h1 id=&#34;waitforurlurl-options&#34;&gt;waitForURL(url[, options])&lt;/h1&gt;
&lt;p&gt;Waits for the frame to navigate to the specified URL. This method is useful for ensuring that navigation within a specific frame (such as an iframe) to a particular URL has completed before proceeding with the test. This is especially useful if there are multiple redirects before hitting the end destination.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Parameter&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;url&lt;/td&gt;
              &lt;td&gt;string|RegExp&lt;/td&gt;
              &lt;td&gt;-&lt;/td&gt;
              &lt;td&gt;Required. URL or URL pattern to match against. The method will wait until the frame navigates to a URL that matches this parameter.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options&lt;/td&gt;
              &lt;td&gt;object&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.timeout&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30000&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum time in milliseconds. Pass &lt;code&gt;0&lt;/code&gt; to disable the timeout. Default is overridden by the &lt;code&gt;setDefaultTimeout&lt;/code&gt; option on 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/browsercontext/&#34;&gt;BrowserContext&lt;/a&gt; or 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/&#34;&gt;Page&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;options.waitUntil&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;load&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;When to consider operation to have succeeded. See &lt;a href=&#34;#events&#34;&gt;Events&lt;/a&gt; for more details.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;events&#34;&gt;Events&lt;/h3&gt;


&lt;div class=&#34;admonition admonition-caution&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Caution&lt;/p&gt;&lt;p&gt;&lt;code&gt;networkidle&lt;/code&gt; is DISCOURAGED. Don&amp;rsquo;t use this method for testing especially with chatty websites where the event may never fire, rely on web assertions to assess readiness instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Events can be either:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&#39;domcontentloaded&#39;&lt;/code&gt; - consider operation to be finished when the &lt;code&gt;DOMContentLoaded&lt;/code&gt; event is fired.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&#39;load&#39;&lt;/code&gt; - consider operation to be finished when the &lt;code&gt;load&lt;/code&gt; event is fired.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&#39;networkidle&#39;&lt;/code&gt; - Consider operation to be finished when there are no network connections for at least &lt;code&gt;500&lt;/code&gt; ms.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;returns&#34;&gt;Returns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Promise&lt;/td&gt;
              &lt;td&gt;A Promise that resolves when the frame has navigated to the specified URL and the specified load state has been reached.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;
&lt;!-- md-k6:skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JavaScript&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-javascript&#34;&gt;import { browser } from &amp;#39;k6/browser&amp;#39;;

export const options = {
  scenarios: {
    browser: {
      executor: &amp;#39;shared-iterations&amp;#39;,
      options: {
        browser: {
          type: &amp;#39;chromium&amp;#39;,
        },
      },
    },
  },
};

export default async function () {
  const page = await browser.newPage();

  try {
    await page.setContent(`
      &amp;lt;iframe src=&amp;#34;https://quickpizza.grafana.com/test.k6.io/&amp;#34; width=&amp;#34;50%&amp;#34; height=&amp;#34;50%&amp;#34;&amp;gt;&amp;lt;/iframe&amp;gt;
    `);

    const iframeElement = await page.$(&amp;#39;iframe&amp;#39;);
    const iframeContent = await iframeElement.contentFrame();

    // Wait for navigation to a specific URL
    await Promise.all([
      iframeContent.click(&amp;#39;a[href=&amp;#34;/my_messages.php&amp;#34;]&amp;#39;),
      iframeContent.waitForURL(&amp;#39;https://quickpizza.grafana.com/my_messages.php&amp;#39;),
    ]);

    await iframeContent.goto(&amp;#39;https://quickpizza.grafana.com/test.k6.io/&amp;#39;);

    // Wait for navigation using URL pattern with RegExp
    await Promise.all([
      iframeContent.click(&amp;#39;a[href=&amp;#34;/browser.php&amp;#34;]&amp;#39;),
      iframeContent.waitForURL(/\/browser\.php$/),
    ]);
  } finally {
    await page.close();
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;valid-usage-patterns-for-waitforurl&#34;&gt;Valid usage patterns for waitForURL&lt;/h3&gt;
&lt;p&gt;Use one of the following patterns to coordinate the action that triggers navigation with waiting for the final URL.&lt;/p&gt;
&lt;!-- eslint-skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;js&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-js&#34;&gt;await Promise.all([
  frame.waitForURL(&amp;#39;https://quickpizza.grafana.com/my_messages.php&amp;#39;),
  frame.locator(&amp;#39;a[href=&amp;#34;/my_messages.php&amp;#34;]&amp;#39;).click(),
]);&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;!-- eslint-skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;js&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-js&#34;&gt;const navPromise = frame.waitForURL(&amp;#39;https://quickpizza.grafana.com/my_messages.php&amp;#39;);
await frame.locator(&amp;#39;a[href=&amp;#34;/my_messages.php&amp;#34;]&amp;#39;).click();
await navPromise;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Unlike 
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/page/waitfornavigation/&#34;&gt;waitForNavigation&lt;/a&gt;, &lt;code&gt;waitForURL&lt;/code&gt; will first check whether it is already on the page with the given URL before proceeding to wait. If it is already there and the &lt;code&gt;waitUntil&lt;/code&gt; condition has also been met, it will return straight away. This means that it is safe to do this:&lt;/p&gt;
&lt;!-- eslint-skip --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;js&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-js&#34;&gt;await frame.locator(&amp;#39;a[href=&amp;#34;/my_messages.php&amp;#34;]&amp;#39;).click();
await frame.waitForURL(&amp;#39;https://quickpizza.grafana.com/my_messages.php&amp;#39;);&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;best-practices&#34;&gt;Best practices&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Verify frame existence&lt;/strong&gt;: Frames can be created, destroyed, or replaced during page navigation. Always verify frame existence before calling &lt;code&gt;waitForURL()&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Use appropriate selectors&lt;/strong&gt;: Use frame selectors that are stable and unique.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Handle cross-origin scenarios&lt;/strong&gt;: Be aware of limitations when working with cross-origin iframes.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Combine with content verification&lt;/strong&gt;: After URL change, verify that the expected content is present.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Consider frame timing&lt;/strong&gt;: Frame navigation may happen after page navigation, so allow appropriate time.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;common-use-cases&#34;&gt;Common use cases&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Payment processing&lt;/strong&gt;: Waiting for payment iframe redirects&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Social media embeds&lt;/strong&gt;: Handling navigation in embedded social content&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;OAuth flows&lt;/strong&gt;: Managing authentication within iframes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Multi-frame applications&lt;/strong&gt;: Coordinating navigation across multiple frames&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Embedded widgets&lt;/strong&gt;: Testing third-party widget navigation&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;related&#34;&gt;Related&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/waitfornavigation/&#34;&gt;frame.waitForNavigation()&lt;/a&gt; - Wait for frame navigation events&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/k6/v2.3.x/javascript-api/k6-browser/frame/waitforloadstate/&#34;&gt;frame.waitForLoadState()&lt;/a&gt; - Wait for load states&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="waitforurlurl-options">waitForURL(url[, options])&lt;/h1>
&lt;p>Waits for the frame to navigate to the specified URL. This method is useful for ensuring that navigation within a specific frame (such as an iframe) to a particular URL has completed before proceeding with the test. This is especially useful if there are multiple redirects before hitting the end destination.&lt;/p></description></item></channel></rss>