Skip to content

GetPageByIndex.cs

Avrigeanu Laurian edited this page Apr 11, 2023 · 1 revision

GetPageByIndex Method

Retrieves a page by its index in the browser's list of pages.

Parameters

  • index : An int value representing the index of the page to retrieve.

Returns

An IPage object representing the page at the specified index.

Remarks

This method retrieves the page at the specified index from the _pages list. It first checks if the provided index is within the range of the _pages list using an if statement. If the index is valid, it returns the page at the specified index from the _pages list.

This method depends on the _pages object, which is a list of pages currently open in the browser. It returns an IPage object, which is an interface defined in the Microsoft.Playwright namespace.

Clone this wiki locally