Browser

Navigation

Methods for navigating the browser to URLs, moving through history, and closing the browser instance.

Methods for navigating the browser to URLs, moving through history, and closing the browser instance.

GoTo launches the browser (if not already open) and navigates to the specified URL in headful mode. Get does the same in headless mode. Back, Forward, and Refresh mirror the browser toolbar buttons. Close terminates the browser instance - pass true to also terminate all processes associated with it, including driver processes. NewTab opens a URL in a new tab. Tabs and windows are indexed and can be navigated with NextTab, PreviousTab, and GoToTab.

TIP

GoTo opens a visible browser window. Get opens a headless browser (no visible window). Both accept a GPALUrl or implicit string. The rest of the Browser API works identically after either call.

Examples

GPAL Fluent: High-level fluent C# API

//Browser navigation methods return the same Browser instance so you can chain additional actions. GoTo and Get accept either a GPALUrl object (built with GPAL.Url()) or an implicit string conversion.

// Navigate to a URL and interact GPAL.Browser .WithBrowserType(BrowserType.Chrome) .GoTo("https://example.com") .WithSelector("#login") .LeftClick(); // Headless navigation GPAL.Browser .Get("https://api.example.com/data") .GetPageSource(out string html); // History navigation GPAL.Browser .GoTo("https://example.com") .GoTo("https://example.com/page2") .Back .Forward; // Open a new tab and navigate to it GPAL.Browser .GoTo("https://example.com") .NewTab("https://example.com/reports") .NextTab();