Skip to content

Commit d47644c

Browse files
committed
Add nth, first and last to the locator index
1 parent bb536b6 commit d47644c

File tree

1 file changed

+3
-0
lines changed
  • docs/sources/k6/next/javascript-api/k6-browser/locator

1 file changed

+3
-0
lines changed

docs/sources/k6/next/javascript-api/k6-browser/locator/_index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Locator can be created with the [page.locator(selector[, options])](https://graf
2525
| [dblclick([options])](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/locator/dblclick) {{< docs/bwipt id="471" >}} | Mouse double click on the chosen element. |
2626
| [dispatchEvent(type, eventInit, [options])](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/locator/dispatchevent) | Dispatches HTML DOM event types e.g. `'click'`. |
2727
| [fill(value, [options])](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/locator/fill) | Fill an `input`, `textarea` or `contenteditable` element with the provided value. |
28+
| [first()](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/locator/first) | Returns `locator` to the first matching element. |
2829
| [focus([options])](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/locator/focus) | Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the element, if it can be focused. |
2930
| [getAttribute(name, [options])](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/locator/getattribute) | Returns the element attribute value for the given attribute name. |
3031
| [hover([options])](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/locator/hover) {{< docs/bwipt id="471" >}} | Hovers over the element. |
@@ -37,6 +38,8 @@ Locator can be created with the [page.locator(selector[, options])](https://graf
3738
| [isEnabled([options])](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/locator/isenabled) | Checks if the element is `enabled`. |
3839
| [isHidden()](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/locator/ishidden) | Checks if the element is `hidden`. |
3940
| [isVisible()](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/locator/isvisible) | Checks if the element is `visible`. |
41+
| [last()](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/locator/last) | Returns `locator` to the last matching element. |
42+
| [nth()](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/locator/nth) | Returns `locator` to the n-th matching element. |
4043
| [press(key, [options])](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/locator/press) | Press a single key on the keyboard or a combination of keys. |
4144
| [selectOption(values, [options])](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/locator/selectoption) {{< docs/bwipt id="470" >}} | Select one or more options which match the values. |
4245
| [setChecked(checked[, options])](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/locator/setchecked) | Sets the `checkbox` or `radio` input element's value to the specified checked or unchecked state. |

0 commit comments

Comments
 (0)