RESTClient

Browser Navigation via REST

GoTo navigates the browser to the specified URL. Back, Forward, and Refresh mirror browser toolbar buttons. NewTab opens a new tab, CloseTab closes one, and NextTab/PreviousTab switch between them. GoToTab and CloseTab accept a URL or tab ID. Window management follows the same pattern: OpenWindow, CloseWindow, NextWindow, PreviousWindow, GoToWindow. Maximize, Minimize, Normal, Restore, and FullScreen control window state.

Examples

GPAL Fluent: High-level fluent C# API

//Each navigation method configures the request but does not send it until Execute() is called. The WithUrl and WithUrlFromResult parameter methods let you pass URLs derived from prior results in a chain.

// the client object first, then the calls on it

IRESTClient client = (IRESTClient)GPAL.RESTClient

.WithAPIBase("http://localhost:9222")

.ToGPALObject();


// Navigate to a URL

client

.GoTo((GPALUrl)GPAL.Url.ForUrl("https://example.com").ToGPALObject())

.Execute();


// Open a new tab

client

.NewTab((GPALUrl)GPAL.Url.ForUrl("https://example.com/reports").ToGPALObject())

.Execute();


// Maximize the browser window

client

.Maximize()

.Execute();

💬 Ask GPAL