-
Notifications
You must be signed in to change notification settings - Fork 0
GetPageByIndex.cs
Avrigeanu Laurian edited this page Apr 11, 2023
·
1 revision
Retrieves a page by its index in the browser's list of pages.
-
index
: Anint
value representing the index of the page to retrieve.
An IPage
object representing the page at the specified index.
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.