From 01beb6310a93120527789ba3ab50dfeeb6289a7a Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Mon, 14 Mar 2022 21:06:44 +0100 Subject: [PATCH] docs: mention locator.nth is zero based (#12750) Co-authored-by: Pavel Feldman --- docs/src/api/class-framelocator.md | 2 +- docs/src/api/class-locator.md | 2 +- packages/playwright-core/types/types.d.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/src/api/class-framelocator.md b/docs/src/api/class-framelocator.md index 9e57a0be87..7db64f85f3 100644 --- a/docs/src/api/class-framelocator.md +++ b/docs/src/api/class-framelocator.md @@ -128,7 +128,7 @@ The method finds an element matching the specified selector in the FrameLocator' ## method: FrameLocator.nth - returns: <[FrameLocator]> -Returns locator to the n-th matching frame. +Returns locator to the n-th matching frame. It's zero based, `nth(0)` selects the first frame. ### param: FrameLocator.nth.index - `index` <[int]> diff --git a/docs/src/api/class-locator.md b/docs/src/api/class-locator.md index 82257fa0cc..649e7e8ada 100644 --- a/docs/src/api/class-locator.md +++ b/docs/src/api/class-locator.md @@ -550,7 +550,7 @@ The method finds an element matching the specified selector in the `Locator`'s s ## method: Locator.nth - returns: <[Locator]> -Returns locator to the n-th matching element. +Returns locator to the n-th matching element. It's zero based, `nth(0)` selects the first element. ### param: Locator.nth.index - `index` <[int]> diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.ts index 9c4885abe8..28bba91bdc 100644 --- a/packages/playwright-core/types/types.d.ts +++ b/packages/playwright-core/types/types.d.ts @@ -9403,7 +9403,7 @@ export interface Locator { }): Locator; /** - * Returns locator to the n-th matching element. + * Returns locator to the n-th matching element. It's zero based, `nth(0)` selects the first element. * @param index */ nth(index: number): Locator; @@ -13846,7 +13846,7 @@ export interface FrameLocator { }): Locator; /** - * Returns locator to the n-th matching frame. + * Returns locator to the n-th matching frame. It's zero based, `nth(0)` selects the first frame. * @param index */ nth(index: number): FrameLocator;