GPAL - Generally Positive Automation Library v1.0
GPAL The Fluent Automation LIbrary
Loading...
Searching...
No Matches
GenerallyPositive.RESTClient Class Reference

Fluent REST client for making API calls with a chained interface. Supports defining workflows, executing them in loops, and accessing results. Results are accessed via a non-generic indexer, requiring casting to the desired type. More...

Inheritance diagram for GenerallyPositive.RESTClient:
GenerallyPositive.IRESTClient GenerallyPositive.IAllowToGPALObject< TResult > GenerallyPositive.IAllowRestMethods GenerallyPositive.IAllowRangeValue GenerallyPositive.IAllowRESTCaptureOptions GenerallyPositive.IAllowRESTStorageOptions GenerallyPositive.IAllowRESTWithUploadFilename GenerallyPositive.IAllowRESTWithDownloadFilename GenerallyPositive.IAllowSelectOptions GenerallyPositive.IAllowRESTWorkflow GenerallyPositive.IAllowRESTInputText GenerallyPositive.IAllowRESTParameters GenerallyPositive.IAllowRESTAttribute GenerallyPositive.IAllowCheckNetworkIdleOrExecution GenerallyPositive.IAllowRESTParametersOrExecution GenerallyPositive.IAllowRESTExecution GenerallyPositive.IAllowRESTDragAndDrop GenerallyPositive.IAllowRESTScrollElement GenerallyPositive.IAllowRESTMethod GenerallyPositive.IAllowRESTEndpointDetails GenerallyPositive.IAllowRESTEndpoint

Public Member Functions

IAllowRESTEndpointDetails WithAPIBase (string url)
 Sets the API base URL with download path.
IAllowRESTEndpointDetails WithAPIBase (string url, TimeSpan httpTimeout)
 Sets the API base URL and how long one attempt is given before it is abandoned.
IAllowRESTParametersOrExecution WithEndpoint (string endpoint)
 Sets the endpoint as a string.
IAllowRESTParametersOrExecution WithEndpoint (ApiEndpoint endpoint)
 Sets the endpoint from an ApiEndpoint enum.
IAllowRESTEndpointDetails LoadOpenAPIMap (string yamlOrUrl)
IAllowRESTEndpointDetails LoadOpenAPIMap (GPALFile openApiMapFile)
void LoadOpenApiRulesInternal (string yamlContent)
IAllowRESTEndpointDetails ListOpenAPIEndPoints ()
IAllowRESTParametersOrExecution WithResultName (string name)
 Sets the result name for the next execution.
IAllowRESTParametersOrExecution WithUrl (string url)
 Sets the URL parameter.
IAllowRESTParametersOrExecution WithUrlFromResult (int resultIndex)
 Sets the URL from a result by index.
IAllowRESTParametersOrExecution WithUrlFromResult (string name)
 Sets the URL from a result by name.
IAllowRESTParametersOrExecution WithTabId (int tabId)
 Sets the tab ID parameter.
IAllowRESTParametersOrExecution WithTabIdFromResult (int resultIndex)
 Sets the tab ID from a result by index.
IAllowRESTParametersOrExecution WithTabIdFromResult (string name)
 Sets the tab ID from a result by name.
IAllowRESTParametersOrExecution WithScript (string script)
 Sets the script parameter.
IAllowRESTParametersOrExecution WithKey (string key)
 Sets the key parameter.
IAllowRESTParametersOrExecution WithKeyFromResult (int resultIndex)
 Sets the key from a result by index.
IAllowRESTParametersOrExecution WithKeyFromResult (string name)
 Sets the key from a result by name.
IAllowRESTEndpointDetails WithName (string name)
 Sets the client name.
IAllowRESTParametersOrExecution WithCss (string css)
 Sets the CSS parameter.
IAllowRESTParametersOrExecution WithCssFromResult (int resultIndex)
 Sets the CSS from a result by index.
IAllowRESTParametersOrExecution WithCssFromResult (string name)
 Sets the CSS from a result by name.
IAllowRESTParametersOrExecution WithElement (IGPALElement gPALElement)
 Sets the element parameter.
IAllowRESTParametersOrExecution WithElementIdFromResult (int resultIndex)
 Sets the element from a result by index.
IAllowRESTParametersOrExecution WithElementIdFromResult (string name)
 Sets the element from a result by name.
IAllowCheckNetworkIdleOrExecution WithTimeoutMs (int timeoutMs)
 Sets the timeout in milliseconds.
IAllowCheckNetworkIdleOrExecution WithPruneMs (int pruneMs)
 Sets the prune interval in milliseconds.
IAllowCheckNetworkIdleOrExecution WithMaxConnections (int maxConnections)
 Sets the maximum connections.
IAllowRESTExecution WithUploadFile (string uploadPath)
 Sets the timeout in milliseconds.
IAllowRESTExecution WithUploadFiles (GPALFile uploadPaths)
 Sets the timeout in milliseconds.
IAllowRESTParametersOrExecution WithXPath (string xpath)
 Sets the XPath parameter.
IAllowRESTParametersOrExecution WithXPathFromResult (int resultIndex)
 Sets the XPath from a result by index.
IAllowRESTParametersOrExecution WithXPathFromResult (string name)
 Sets the XPath from a result by name.
IAllowRESTParametersOrExecution WithParameters (params object[] parameters)
 Sets parameters as a variable argument list.
IAllowRESTParametersOrExecution WithParameters (object parameters)
 Sets parameters as a single object.
IAllowRESTParametersOrExecution WithParametersFromResult (int resultIndex)
 Sets parameters from a result by index.
IAllowRESTParametersOrExecution WithParametersFromResult (string name)
 Sets parameters from a result by name.
IAllowRESTStorageOptions WithData (string data)
 Sets the set storage data parameter.
IAllowRESTStorageOptions WithStorageStoreName (string storeName)
 Sets the storage domain parameter.
IAllowRESTStorageOptions WithStorageDomain (string domain)
 Sets the storage domain parameter.
IAllowRESTStorageOptions WithStoragePath (string path)
 Sets the storage path parameter.
IAllowRESTStorageOptions WithStorageType (WebsiteStorageType storageType)
 Sets the storage path parameter.
IAllowRESTStorageOptions WithStorageKey (string key)
 Sets the storage key parameter.
IAllowRESTStorageOptions WithDeleteAcrossOrigins (bool crossOrigin)
IAllowRESTParametersOrExecution WithPixels (int pixels)
 Sets the pixels parameter.
IAllowRESTParametersOrExecution WithPixelsFromResult (int resultIndex)
 Sets the pixels from a result by index.
IAllowRESTParametersOrExecution WithPixelsFromResult (string name)
 Sets the pixels from a result by name.
IAllowRESTParametersOrExecution WithReferrer (string url)
 Sets the referrer parameter.
IAllowRESTParametersOrExecution WithReferrerFromResult (int resultIndex)
 Sets the referrer from a result by index.
IAllowRESTParametersOrExecution WithReferrerFromResult (string name)
 Sets the referrer from a result by name.
IAllowRESTExecution WithText (string text)
 Sets the text parameter.
IAllowRESTExecution WithTextFromResult (int resultIndex)
 Sets the text from a result by index.
IAllowRESTExecution WithTextFromResult (string name)
 Sets the text from a result by name.
IAllowRESTParametersOrExecution DownloadTo (GPALFile downloadPath)
 Where a file the browser downloads should end up.
Not SaveTo, which is GPAL writing a file it already has. This is a request the browser carries out, and what it can honor differs by engine: the extension names the download but cannot place it, so the file arrives in the browser's own download directory and the download watcher moves it here. client.WithEndpoint(ApiEndpoint.LeftClickAndDownload).DownloadTo(file).Execute();.
IAllowRESTParametersOrExecution SaveResultsTo (GPALFile file)
 Saves the response to a file if the endpoint returns a downloadable content client.WithEndpoint(ApiEndpoint.LeftClickAndDownload).SaveResultsTo(file).Execute();.
IAllowRESTExecution WithHttpMethod (string method)
 Sets the HTTP method.
IAllowRESTAttribute WithIndex (int index)
 Specifies the option index for select menu operations client.SetAttribute("element123").WithAttribute("disabled").WithValue("true").Execute();.
IAllowRESTExecution WithDeviceName (string sinkName)
 Sets the CSS parameter.
string Execute (bool publishEvent=true)
 Executes the request synchronously.
T Execute< T > (bool publishEvent=true)
 Executes the request synchronously with type.
IRESTClient AndThen (bool publishEvent=true)
 Executes and chains the request.
IRESTClient AndThen< T > (bool publishEvent=true)
 Executes and chains the request with type.
async Task< string > ExecuteAsync (bool publishEvent=true)
 Executes the request asynchronously and returns the raw response await client.ExecuteAsync();.
async Task< T > ExecuteAsync< T > (bool publishEvent=true)
 Executes the request asynchronously with type.
IRESTClient ToGPALObject ()
 Converts the client to a GPAL object.
IAllowRESTWorkflow ClearWorkflows ()
 Gets the execution results.
IAllowRESTExecution ClearResults ()
 Empties what WithResultName has stored, so GetExecutionResults answers about what has happened since rather than everything since the client was made.
ResultCollection GetExecutionResults ()
IReadOnlyList< object > GetExecutionResults (string name)
 Every result stored under name , in the order it was stored, so a loop that ran five times answers with five. Ask without a name for the whole collection, or index it by name for the last answer alone.
IAllowRESTWorkflow WithWorkflow (Action< RESTClient > workflow)
 Adds a workflow definition client.WithWorkflow(c => c.WithEndpoint(...).Execute()).While(...);.
IAllowRESTParametersOrExecution While (Func< bool > condition)
 Executes workflows while condition holds client.While(() => someCondition).Execute();.
IAllowRESTParametersOrExecution Until (Func< bool > condition)
 Executes workflows until condition holds.
IAllowRESTParametersOrExecution WithElementId (string elementId)
 Sets the element ID parameter.
IAllowRESTParametersOrExecution WithEncoding (ContentEncoding encoding)
 Specifiy the encoiding type for posted parameters: json or urlencoded.
IAllowRESTExecution WithHeader (string name, string value)
 Adds an HTTP header to the request client.WithHeader("Authorization", "Bearer YOUR_ACCESS_TOKEN").Execute();.
IAllowRESTExecution WithTimeout (TimeSpan httpTimeout)
 How long one attempt is given before it is abandoned. Said after the base url, so a client handed a session by ContinueAsRESTClient can still be told, and changed between calls on the same client.
IAllowRESTExecution WithHeaderFromResult (int resultIndex)
 Sets the header from a result by index.
IAllowRESTExecution WithHeaderFromResult (string name)
 Sets the header from a result by name.
IAllowRESTDragAndDrop WithDeltaX (int deltaX)
 Sets the horizontal drop offset for a drag-and-drop operation.
IAllowRESTDragAndDrop WithDeltaY (int deltaY)
 Sets the vertical drop offset for a drag-and-drop operation.
IAllowRESTDragAndDrop WithOffsetX (int offsetX)
 Sets the horizontal grab offset within the element for a drag-and-drop operation.
IAllowRESTDragAndDrop WithOffsetY (int offsetY)
 Sets the vertical grab offset within the element for a drag-and-drop operation.
IAllowRESTScrollElement WithHPixels (int hPixels)
 Sets the horizontal pixels parameter.
IAllowRESTScrollElement WithHPixelsFromResult (int resultIndex)
 Sets the horizontal pixels from a result by index.
IAllowRESTScrollElement WithHPixelsFromResult (string name)
 Sets the horizontal pixels from a result by name.
IAllowRESTScrollElement WithVPixels (int vPixels)
 Sets the vertical pixels parameter.
IAllowRESTScrollElement WithVPixelsFromResult (int resultIndex)
 Sets the vertical pixels from a result by index.
IAllowRESTScrollElement WithVPixelsFromResult (string name)
 Sets the vertical pixels from a result by name.
IAllowRESTExecution CaptureVisibleTab (ImageFormat imageFormat=ImageFormat.JPEG)
 Get a screenshot of the current tab visble contents.
IAllowRESTExecution SetDownloadFilename (string downloadPath)
 Sets the download filename for the current session client.SetDownloadFilename("/path/to/file").Execute();.
IAllowRESTExecution WithDownloadFile (string downloadPath)
IAllowRESTExecution Evaluate (string xpath)
 Evaluates an XPath expression client.Evaluate("//div").Execute();.
IAllowRESTExecution EvaluateAll (string xpath)
 Evaluates an XPath expression for multiple elements client.EvaluateAll("//div").Execute<string[]>();.
IAllowRESTExecution EvaluatePersistent (string xpath)
 Evaluates an XPath expression client.Evaluate("//div").Execute();.
IAllowRESTExecution EvaluateAllPersistent (string xpath)
 Evaluates an XPath expression for multiple elements client.EvaluateAll("//div").Execute<string[]>();.
IAllowRESTExecution ClearReferrer ()
 Clears the referrer client.ClearReferrer().Execute();.
IAllowRESTExecution FireChangeEvent (string elementId)
 Fires a change event on an element by ID client.FireChangeEvent("element123").Execute();.
IAllowRESTExecution Focus (string elementId)
 Focuses an element by ID client.Focus("element123").Execute();.
IAllowRESTExecution GetBoundingClientRect (string elementId)
 Gets the bounding client rect of an element by ID client.GetBoundingClientRect("element123").Execute<string>();.
IAllowRESTExecution ElementFromPoint (string elementId, int x, int y)
 Asks whether a click at this viewport point would reach the element, rather than land on whatever is covering it there.
IAllowRESTExecution TrustedLeftClick (int x, int y, int holdMs=0)
 Clicks a viewport point through the browser's own input pipeline, so the page reads the event as trusted. Answers OK when the click was made and NOTOK where the browser has no debugger to attach, which is Firefox. client.TrustedLeftClick(120, 340).Execute<bool>();.
IAllowRESTExecution TrustedMiddleClick (int x, int y, int holdMs=0)
 Middle clicks a viewport point through the browser's own input pipeline, so the page reads the event as trusted. Answers OK when the click was made and NOTOK where the browser has no debugger to attach, which is Firefox. client.TrustedMiddleClick(120, 340).Execute<bool>();.
IAllowRESTExecution GetWindowRectangle ()
IAllowRESTExecution GetContentAndCss (string elementId)
IAllowRESTExecution GetCssAttributes (string elementId)
IAllowRESTExecution GetDomAttributes (string elementId)
IAllowRESTExecution GetDomProperties (string elementId)
IAllowRESTExecution GetElementAttributeHash (string elementId)
 Gets the attribute hash of an element client.GetElementAttributeHash().Execute<string>();.
IAllowRESTExecution GetOptions (string elementId)
 Get the options in a Select manue.
IAllowRESTExecution GetPageSource ()
IAllowRESTExecution GetParentNode (string elementId)
 Gets the parent node of an element by ID client.GetParentNode("element123").Execute<string>();.
IAllowRESTExecution HideElement (string elementId)
 Hides an element by ID client.HideElement("element123").Execute();.
IAllowRESTExecution IsClickable (string elementId)
 Checks if an element is clickable by ID client.IsClickAble("element123").Execute<bool>();.
IAllowRESTExecution IsDisplayed (string elementId)
 Checks if an element is displayed by ID client.IsDisplayed("element123").Execute<bool>();.
IAllowRESTExecution IsEnabled (string elementId)
 Checks if an element is enabled by ID client.IsEnabled("element123").Execute<bool>();.
IAllowRESTExecution IsEndOfPage ()
 Checks if the page is at the end client.IsEndOfPage().Execute<bool>();.
IAllowRESTExecution IsVisibleInViewport (string elementId)
 Checks if an element is visible in viewport by ID client.IsVisibleInViewport("element123").Execute<bool>();.
IAllowRESTExecution LeftClick (string elementId)
 Performs a left click on an element by ID client.LeftClick("element123").Execute();.
IAllowRESTExecution LeftDoubleClick (string elementId)
 Performs a left double click on an element by ID client.LeftDoubleClick("element123").Execute();.
IAllowRESTExecution MiddleClick (string elementId)
 Performs a left click on an element by ID client.LeftClick("element123").Execute();.
IAllowRESTExecution QuerySelector (string css)
 Queries a single element using a CSS selector client.QuerySelector(".class").Execute();.
IAllowRESTExecution QuerySelectors (string css)
 Queries multiple elements using a CSS selector client.QuerySelectors(".class").Execute<string[]>();.
IAllowRESTExecution QueryPersistentSelector (string css)
 Queries a single element using a CSS selector client.QuerySelector(".class").Execute();.
IAllowRESTExecution QueryPersistentSelectors (string css)
 Queries multiple elements using a CSS selector client.QuerySelectors(".class").Execute<string[]>();.
IAllowRESTExecution RightClick (string elementId)
 Performs a right click on an element by ID client.RightClick("element123").Execute();.
IAllowRESTExecution ScrollIntoView (string elementId)
 Scrolls an element into view by ID client.ScrollIntoView("element123").Execute();.
IAllowRESTExecution ScrollElement (int hPixels, int vPixels)
 Scrolls an element by horizontal and vertical pixels client.ScrollElement(100, 200).Execute();.
IAllowRESTAttribute GetAttribute (string elementId)
 Starts getting an attribute of an element by ID client.GetAttribute("element123").WithAttribute("value").Execute<string>();.
IAllowRESTAttribute SetAttribute (string elementId)
 Starts setting an attribute of an element by ID client.SetAttribute("element123").WithAttribute("disabled").WithValue("true").Execute();.
IAllowRESTExecution TopBrowser ()
 Top the browser, bring it into focus. Used before performing any actions on the browser.
IAllowRESTAttribute WithAttribute (string attribute)
 Specifies the attribute name for get or set operation client.GetAttribute("element123").WithAttribute("value").Execute<string>();.
IAllowRangeValue SetRange (string elementId)
 Starts setting an attribute of an element by ID client.SetAttribute("element123").WithAttribute("disabled").WithValue("true").Execute();.
IAllowRESTExecution WithRangeValue (int rangeValue)
 Specifies the value for SetRange operation client.SetRange("element123").WithRangeValue(63).Execute();.
IAllowRESTAttribute WithValue (string value)
 Specifies the value for set operation client.SetAttribute("element123").WithAttribute("disabled").WithValue("true").Execute();.
IAllowRESTExecution WindowInnerHeight ()
 Gets the window inner height client.WindowInnerHeight().Execute<int>();.
IAllowRESTExecution WindowInnerWidth ()
 Gets the window inner width client.WindowInnerWidth().Execute<int>();.
IAllowRESTExecution WindowOuterHeight ()
 Gets the window outer height client.WindowOuterHeight().Execute<int>();.
IAllowRESTExecution WindowOuterWidth ()
 Gets the window outer width client.WindowOuterWidth().Execute<int>();.
IAllowRESTParametersOrExecution Fetch (string url)
 Issue an API request from inside the page, so it carries the session the browser has already earned: its cookies, TLS fingerprint, header order and any anti-bot clearance. A relative url resolves against wherever the browser currently is. client.Fetch("/api/search?page=1").Execute();.
IAllowRESTParametersOrExecution WithVerb (string method)
 Sets the verb of the request being fetched. Not .WithHttpMethod, which is the verb of the REST call itself. GET when nothing was said. client.Fetch(url).WithVerb("POST").Execute();.
IAllowRESTParametersOrExecution WithBody (string body)
 Sets the body of the request being fetched. client.Fetch(url).WithVerb("POST").WithBody(json).Execute();.
IAllowRESTParametersOrExecution WithContentType (string contentType)
 Sets the content type of the body of the request being fetched. client.Fetch(url).WithContentType("application/json").Execute();.
IAllowRESTParametersOrExecution WithHeaders (string[] headers)
 Sets extra headers for the request being fetched, flattened to name, value, name, value. client.Fetch(url).WithHeaders(new[] { "Accept", "application/json" }).Execute();.
IAllowRESTParametersOrExecution WithBytes (bool bytes)
 True to bring the fetched response body back base64 encoded, which is what a file needs. Text is the default, and reading a file as text would put a replacement character wherever a byte is not valid utf-8. client.Fetch(url).WithBytes(true).Execute();.
IAllowRESTExecution WindowPageOffsetX ()
 Gets the window page offset X client.WindowPageOffsetX().Execute<int>();.
IAllowRESTExecution WindowPageOffsetY ()
 Gets the window page offset Y client.WindowPageOffsetY().Execute<int>();.
IAllowRESTExecution WindowScreenLeft ()
 Gets the window screen left position client.WindowScreenLeft().Execute<int>();.
IAllowRESTExecution WindowScreenTop ()
 Gets the window screen top position client.WindowScreenTop().Execute<int>();.
IAllowRESTExecution Hover (string elementId)
 Hovers over an element by ID client.Hover("element123").Execute();.
IAllowRESTExecution Back ()
 Navigates browser history back client.Back().Execute();.
IAllowRESTExecution CheckNetworkIdle (int maxConnections=0)
 Checks if network is idle with max connections client.CheckNetworkIdle(5).Execute<bool>();.
IAllowRESTExecution CloseTab (int tabId)
 Closes a tab by tab ID client.CloseTab(1).Execute();.
IAllowRESTExecution CloseTab (GPALUrl url=null)
 Closes a tab by URL client.CloseTab("https://example.com").Execute();.
IAllowRESTParameters ExecuteJavaScript (string script)
 Executes JavaScript code client.ExecuteJavaScript("return document.title").Execute<string>();.
IAllowRESTParameters InjectScript (string script)
 Registers a script to run on every new document load. Persists until ClearInjectedScripts is called.
IAllowRESTParameters ClearInjectedScripts ()
 Removes all scripts previously registered via InjectScript(string).
IAllowRESTExecution Forward ()
 Navigates browser history forward client.Forward().Execute();.
IAllowRESTExecution FullScreen ()
 Sets browser to full screen client.FullScreen().Execute();.
IAllowRESTExecution GetBrowserSettings ()
 Gets browser settings client.GetBrowserSettings().Execute();.
IAllowRESTExecution GetCurrentUrl ()
 Gets the current URL client.GetCurrentUrl().Execute<string>();.
IAllowRESTExecution GetDocumentStamp ()
 Gets the current URL and the document identity in one call.
A form posting to itself and a route rewritten in place both build a new document at the same address, which the url alone does not distinguish. client.GetDocumentStamp().Execute<string>();.
IAllowRESTExecution GetHydrationScripts ()
 Gets the page title, the NEXT_DATA payload and any React Flight chunks, read from the document rather than its markup. client.GetHydrationScripts().Execute<string>();.
IAllowRESTExecution GetGpalSettings ()
 Gets GPAL settings client.GetGpalSettings().Execute();.
IAllowRESTExecution GetReadyStatus ()
 Gets the ready status client.GetReadyStatus().Execute<string>();.
IAllowRESTExecution GetSettings ()
 Gets settings client.GetSettings().Execute();.
IAllowRESTExecution GetShadowRoot (string css)
 Gets the shadow root for a CSS selector client.GetShadowRoot(".class").Execute();.
IAllowRESTExecution GetLanguages ()
 Gets the browser's preferred languages, most preferred first client.GetLanguages().Execute<string>();.
IAllowRESTCaptureOptions CaptureCalls (bool capture=true)
 Starts or stops recording what the page asks for. Narrow it with WithCallFilter and start from nothing with WithClearCalls. client.CaptureCalls(true).WithCallFilter("/api/search").Execute();.
IAllowRESTCaptureOptions WithCallFilter (string urlFragment)
 Records only the calls whose url holds this, so a page that talks to a dozen places narrows to the one worth having.
IAllowRESTCaptureOptions WithClearCalls (bool clear=true)
 Forgets what was already recorded before starting, so a second capture is not read as the first.
IAllowRESTExecution GetCapturedCalls ()
 Everything recorded so far, oldest first, as the json the extension keeps. string json = client.GetCapturedCalls().Execute();.
IAllowRESTExecution GetUserAgent ()
 Gets the user agent client.GetUserAgent().Execute<string>();.
IAllowRESTExecution GetWorkflow ()
 Gets the workflow client.GetWorkflow().Execute();.
IAllowRESTExecution GoTo (GPALUrl url)
 Navigates to a URL client.Goto("https://example.com").Execute();.
IAllowRESTExecution GoToTab (int tabId)
 Navigates to a tab by tab ID client.GotoTab(1).Execute();.
IAllowRESTExecution GoToTab (GPALUrl url)
 Navigates to a tab by URL client.GotoTab("https://example.com").Execute();.
IAllowRESTInputText FillInAppend (string elementId)
 Appends text to an element client.FillInAppend("input123").WithText("Hello").Execute();.
IAllowRESTInputText FillInInsert (string elementId)
 Appends text to an element client.FillInAppend("input123").WithText("Hello").Execute();.
IAllowRESTInputText FillInOverwrite (string elementId)
 Appends text to an element client.FillInAppend("input123").WithText("Hello").Execute();.
IAllowRESTWithDownloadFilename LeftClickAndDownload (string elementId)
 Performs a left click and download on an element client.LeftClickAndDownload("element123").SetDownloadFileName(fileName).Execute();.
IAllowRESTWithUploadFilename LeftClickAndUpload (string elementId)
 Purely headless mode, attaches the file to the input[type=file] client.LeftClickAndUpload("element123").WithUploadFile(filePath).Execute();.
IAllowRESTExecution Maximize ()
 Maximizes the browser window client.Maximize().Execute();.
IAllowRESTExecution Minimize ()
 Minimizes the browser window client.Minimize().Execute();.
IAllowRESTExecution MoveTo (string elementId)
 Moves to an element client.MoveTo("element123").Execute();.
IAllowRESTExecution NewTab (GPALUrl url)
 Opens a new tab with optional URL client.NewTab("https://example.com").Execute();.
IAllowRESTExecution NextTab ()
 Switches to the next tab client.NextTab().Execute();.
IAllowRESTExecution TabCount ()
 How many tabs the browser actually has open, which is not the same as how many GPAL opened. A tab can close itself, which is what a browser does with a tab whose first navigation turns into a download. int tabs = client.TabCount().Execute<int>();.
IAllowRESTExecution NextWindow ()
 Switches to the next window client.NextTab().Execute();.
IAllowRESTExecution Normal ()
 Restores the browser window to normal client.Normal().Execute();.
IAllowRESTExecution OverrideReferrer (string referrer)
 Overrides the referrer URL client.OverrideReferrr("https://google.com").Execute();.
IAllowRESTExecution SetUserAgent (string userAgent)
 Overrides the browser's user agent string client.SetUserAgent("Mozilla/5.0 ...").Execute();.
IAllowRESTExecution PageDown (int pagesToScroll=1)
 Scrolls the page down by pages client.PageDown(1).Execute();.
IAllowRESTExecution PageEnd ()
 Scrolls to the page end client.PageEnd().Execute();.
IAllowRESTExecution PageTop ()
 Scrolls to the page top client.PageTop().Execute();.
IAllowRESTExecution PageUp (int pagesToScroll=1)
 Scrolls the page up by pages client.PageUp(1).Execute();.
IAllowRESTExecution PressModifierKey (ModifierKeys modifierKeys)
 Press the modifier keys specified. Keep pressed until a release is sent.
IAllowRESTExecution PreviousTab ()
 Switches to the previous tab client.PreviousTab().Execute();.
IAllowRESTExecution PreviousWindow ()
 Switches to the next window client.NextTab().Execute();.
IAllowRESTExecution Refresh ()
 Refreshes the current page client.Refresh().Execute();.
IAllowRESTExecution ReleaseModifierKey (ModifierKeys modifierKeys)
 Press the modifier keys specified. Keep pressed until a release is sent.
IAllowRESTExecution Restore ()
 Restores the browser window client.Restore().Execute();.
IAllowRESTDragAndDrop DragAndDrop (string elementId)
 Drags an element from its current position by the given offset and drops it client.DragAndDrop("element123").WithDeltaX(100).WithDeltaY(50).Execute();.
IAllowRESTScrollElement ScrollElement (string elementId)
 Starts scrolling an element by ID client.ScrollElement("element123").WithHPixels(100).WithVPixels(200).Execute();.
IAllowRESTExecution ScrollWindow (int hPixels, int vPixels)
IAllowRESTExecution ScrollWindowByHorizontal (int hPixels)
 Scrolls the window horizontally by pixels client.ScrollWindowByHorizontal(100).Execute();.
IAllowRESTExecution ScrollWindowByVertical (int vPixels)
 Scrolls the window vertically by pixels client.ScrollWindowByVertical(100).Execute();.
IAllowSelectOptions SelectClick (string elementId)
 Click a Select menu option.
IAllowRESTExecution WithSelectValue (string selectValue)
 Set the value to choose from the Select menu.
IAllowRESTExecution WithSelectIndex (int selectIndex)
IAllowRESTExecution SendKey (byte vkcode)
 Sends a key client.SendKey("Enter").Execute();.
IAllowRESTExecution SendString (string text, int delayMs=0)
 Sends a string client.SendString("Hello").Execute();.
IAllowRESTParametersOrExecution SetValueFrom (string destSelector)
 Sets the value of the destination element identified by destSelector from the source element identified by the preceding WithCss(string) or WithElementId(string) call. client.WithElementId("srcSelector").SetValueFrom("destSelector").Execute();.
IAllowRESTExecution SetGoogleReferrer ()
 Overrides referrer stealthily - sets to google.com client.SetGoogleReferrer().Execute();.
IAllowRESTExecution SwitchToDefaultContent ()
 Switches to default content client.SwitchToDefaultContent().Execute();.
IAllowRESTParametersOrExecution WithWindowId (int windowId)
 Sets the window ID parameter client.CloseWindow(123).Execute<WindowTuple>();.
IAllowRESTParametersOrExecution WithWindowIdFromResult (int resultIndex)
 Sets the window ID from a result by index client.GoToWindow().WithWindowIdFromResult(0).Execute<WindowTuple>();.
IAllowRESTParametersOrExecution WithWindowIdFromResult (string name)
 Sets the window ID from a result by name client.GoToWindow().WithWindowIdFromResult("windowResult").Execute<WindowTuple>();.
IAllowRESTExecution OpenWindow (GPALUrl url)
 Opens a new window with the specified URL client.OpenWindow("https://example.com").Execute<WindowTuple>();.
IAllowRESTExecution GoToWindow (GPALUrl url)
 Switches to a window by URL client.GoToWindow("https://example.com").Execute<WindowTuple>();.
IAllowRESTExecution GoToWindow (int windowId)
 Switches to a window by window ID client.GoToWindow(123).Execute<WindowTuple>();.
IAllowRESTExecution CloseBrowser ()
 Closes every window the browser has, which is how it is asked to quit client.CloseBrowser().Execute();.
IAllowRESTExecution CloseWindow (GPALUrl url)
 Closes a window by URL, optionally switching to the main window client.CloseWindow("https://example.com").Execute<WindowTuple>();.
IAllowRESTExecution CloseWindow (int windowId)
 Closes a window by window ID, optionally switching to the main window client.CloseWindow(123).Execute<WindowTuple>();.
IAllowRESTStorageOptions DeleteStorage (WebsiteStorageType storageType)
 Delete the specified storage type.
IAllowRESTStorageOptions GetStorage (WebsiteStorageType storageType)
 Get the specified storage type.
IAllowRESTStorageOptions SetStorage (WebsiteStorageType storageType)
 Set data for the specified storage type.
IAllowRESTExecution GetCurrentWindow ()
 Gets the current window's ID and URL client.GetCurrentWindow().Execute<WindowTuple>();.
IAllowRESTExecution SwitchToElement (string elementId)
 Switches to an element to search for selectors contained client.SwitchToElement("div123").Execute();.
IAllowRESTExecution SwitchToFrame (string elementId)
 Switches to a frame client.SwitchToFrame("frame123").Execute();.
IAllowRESTExecution SwitchToShadowRoot (string elementId)
 Switches to a shadow root client.SwitchToShadowRoot("shadow123").Execute();.
Public Member Functions inherited from GenerallyPositive.IAllowRESTParameters
IAllowRESTParametersOrExecution WithEncoding (Enums.ContentEncoding encoding)

Properties

int StatusCode [get]
 The HTTP status code the last call came back with.
int RetryAfterSeconds [get]
 The seconds the last call was asked to wait before asking again, zero when it was not asked.
string Name [get, set]
 Gets or sets the client name.

Detailed Description

Fluent REST client for making API calls with a chained interface. Supports defining workflows, executing them in loops, and accessing results. Results are accessed via a non-generic indexer, requiring casting to the desired type.

.WithAPIBase(browser.RestApiBaseUrl)
.WithName("JavaScriptClient")
// Execute JavaScript to get the page title and store it as "pageTitle"
.WithEndpoint(ApiEndpoint.ExecuteJavaScript) // Uses RESTHelper.Endpoints to map to "/execute-javascript"
.WithParameters("return document.title", new object[] { }) // Pass the JavaScript code and arguments
.WithResultName("pageTitle")
.AndThen<string>()
// Chain the result: use the page title in an input text operation
.WithEndpoint(ApiEndpoint.InputText) // Uses RESTHelper.Endpoints to map to "/input-text"
.WithXPath("//input[@id='search']")
.WithTextFromResult("pageTitle") // Uses the stored "pageTitle" result
.Execute();
var results = client.GetExecutionResults();
GPAL.PublishSimpleEvent(GPALEventType.NOTICE, $"Page Title: [{(string)results["pageTitle"]}]");
GPAL.PublishSimpleEvent(GPALEventType.NOTICE, $"Page Title from iteration 0: [{(string)results["pageTitle", 0]}]");
Everything starts here, all the GPAL controls and global settings using fluent syntax are here....
Definition GPAL.cs:49
static IAllowRESTEndpoint RESTClient
Instantiate a new fluent RESTClient.
Definition GPAL.cs:950
static void PublishSimpleEvent(GPALEventType gPALEventType, string msg, dynamic gPALObject=null, Enums.GPALObjectType gPALObjectType=GPALObjectType.None, Exception ex=null)
Publish a message to either the information channel or exception channel (if exception passed in) Pub...
Definition GPAL.cs:2568
Fluent REST client for making API calls with a chained interface. Supports defining workflows,...
Definition RESTClient.cs:56
IAllowRESTParametersOrExecution WithResultName(string name)
Sets the result name for the next execution.
IAllowRESTParametersOrExecution WithEndpoint(string endpoint)
Sets the endpoint as a string.

Definition at line 55 of file RESTClient.cs.

Member Function Documentation

◆ AndThen()

IRESTClient GenerallyPositive.RESTClient.AndThen ( bool publishEvent = true)

Executes and chains the request.

Returns

Implements GenerallyPositive.IAllowRESTExecution.

Definition at line 1518 of file RESTClient.cs.

◆ AndThen< T >()

IRESTClient GenerallyPositive.RESTClient.AndThen< T > ( bool publishEvent = true)

Executes and chains the request with type.

Template Parameters
TThe result type
Returns

Implements GenerallyPositive.IAllowRESTExecution.

Definition at line 1531 of file RESTClient.cs.

◆ Back()

IAllowRESTExecution GenerallyPositive.RESTClient.Back ( )

Navigates browser history back client.Back().Execute();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2941 of file RESTClient.cs.

◆ CaptureCalls()

IAllowRESTCaptureOptions GenerallyPositive.RESTClient.CaptureCalls ( bool capture = true)

Starts or stops recording what the page asks for. Narrow it with WithCallFilter and start from nothing with WithClearCalls. client.CaptureCalls(true).WithCallFilter("/api/search").Execute();.

Parameters
captureTrue to record, false to stop
Returns
Fluent interface to narrow what is recorded, or to execute

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3160 of file RESTClient.cs.

◆ CaptureVisibleTab()

IAllowRESTExecution GenerallyPositive.RESTClient.CaptureVisibleTab ( ImageFormat imageFormat = ImageFormat::JPEG)

Get a screenshot of the current tab visble contents.

Returns
Base64 string

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2165 of file RESTClient.cs.

◆ CheckNetworkIdle()

IAllowRESTExecution GenerallyPositive.RESTClient.CheckNetworkIdle ( int maxConnections = 0)

Checks if network is idle with max connections client.CheckNetworkIdle(5).Execute<bool>();.

Parameters
maxConnectionsMaximum connections allowed
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2953 of file RESTClient.cs.

◆ ClearInjectedScripts()

IAllowRESTParameters GenerallyPositive.RESTClient.ClearInjectedScripts ( )

Removes all scripts previously registered via InjectScript(string).

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3021 of file RESTClient.cs.

◆ ClearReferrer()

IAllowRESTExecution GenerallyPositive.RESTClient.ClearReferrer ( )

Clears the referrer client.ClearReferrer().Execute();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2252 of file RESTClient.cs.

◆ ClearResults()

IAllowRESTExecution GenerallyPositive.RESTClient.ClearResults ( )

Empties what WithResultName has stored, so GetExecutionResults answers about what has happened since rather than everything since the client was made.

client.ClearResults();
Returns
Fluent interface to write your workflow

Implements GenerallyPositive.IAllowRESTExecution.

Definition at line 1727 of file RESTClient.cs.

◆ ClearWorkflows()

IAllowRESTWorkflow GenerallyPositive.RESTClient.ClearWorkflows ( )

Gets the execution results.

Returns
The result collection

Empties the workflow steps declared with WithWorkflow, so the next While or Until loop runs a new set rather than that one plus everything added before it. Steps otherwise stay on the client for as long as it lives, which is what lets the same set be run more than once.

client.ClearWorkflows().WithWorkflow(c => ...).While(() => ...);
Returns
Fluent interface to declare the next workflow

Implements GenerallyPositive.IAllowRESTWorkflow.

Definition at line 1712 of file RESTClient.cs.

◆ CloseBrowser()

IAllowRESTExecution GenerallyPositive.RESTClient.CloseBrowser ( )

Closes every window the browser has, which is how it is asked to quit client.CloseBrowser().Execute();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3854 of file RESTClient.cs.

◆ CloseTab() [1/2]

IAllowRESTExecution GenerallyPositive.RESTClient.CloseTab ( GPALUrl url = null)

Closes a tab by URL client.CloseTab("https://example.com").Execute();.

Parameters
urlThe URL (optional)
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2977 of file RESTClient.cs.

◆ CloseTab() [2/2]

IAllowRESTExecution GenerallyPositive.RESTClient.CloseTab ( int tabId)

Closes a tab by tab ID client.CloseTab(1).Execute();.

Parameters
tabIdThe tab ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2965 of file RESTClient.cs.

◆ CloseWindow() [1/2]

IAllowRESTExecution GenerallyPositive.RESTClient.CloseWindow ( GPALUrl url)

Closes a window by URL, optionally switching to the main window client.CloseWindow("https://example.com").Execute<WindowTuple>();.

Parameters
urlThe window URL
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3866 of file RESTClient.cs.

◆ CloseWindow() [2/2]

IAllowRESTExecution GenerallyPositive.RESTClient.CloseWindow ( int windowId)

Closes a window by window ID, optionally switching to the main window client.CloseWindow(123).Execute<WindowTuple>();.

Parameters
windowIdThe window ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3882 of file RESTClient.cs.

◆ DeleteStorage()

IAllowRESTStorageOptions GenerallyPositive.RESTClient.DeleteStorage ( WebsiteStorageType storageType)

Delete the specified storage type.

Parameters
storageType
Returns
fluent interface to chain parameters

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3893 of file RESTClient.cs.

◆ DownloadTo()

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.DownloadTo ( GPALFile downloadPath)

Where a file the browser downloads should end up.
Not SaveTo, which is GPAL writing a file it already has. This is a request the browser carries out, and what it can honor differs by engine: the extension names the download but cannot place it, so the file arrives in the browser's own download directory and the download watcher moves it here. client.WithEndpoint(ApiEndpoint.LeftClickAndDownload).DownloadTo(file).Execute();.

Parameters
downloadPathWhere the downloaded file is to end up
Returns
Fluent interface to continue building the request

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 1255 of file RESTClient.cs.

◆ DragAndDrop()

IAllowRESTDragAndDrop GenerallyPositive.RESTClient.DragAndDrop ( string elementId)

Drags an element from its current position by the given offset and drops it client.DragAndDrop("element123").WithDeltaX(100).WithDeltaY(50).Execute();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3594 of file RESTClient.cs.

◆ ElementFromPoint()

IAllowRESTExecution GenerallyPositive.RESTClient.ElementFromPoint ( string elementId,
int x,
int y )

Asks whether a click at this viewport point would reach the element, rather than land on whatever is covering it there.

Parameters
elementIdThe element that should receive the click
xViewport x
yViewport y
Returns
Fluent interface to continue building the request

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2302 of file RESTClient.cs.

◆ Evaluate()

IAllowRESTExecution GenerallyPositive.RESTClient.Evaluate ( string xpath)

Evaluates an XPath expression client.Evaluate("//div").Execute();.

Parameters
xpathThe XPath expression
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2205 of file RESTClient.cs.

◆ EvaluateAll()

IAllowRESTExecution GenerallyPositive.RESTClient.EvaluateAll ( string xpath)

Evaluates an XPath expression for multiple elements client.EvaluateAll("//div").Execute<string[]>();.

Parameters
xpathThe XPath expression
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2217 of file RESTClient.cs.

◆ EvaluateAllPersistent()

IAllowRESTExecution GenerallyPositive.RESTClient.EvaluateAllPersistent ( string xpath)

Evaluates an XPath expression for multiple elements client.EvaluateAll("//div").Execute<string[]>();.

Parameters
xpathThe XPath expression
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2241 of file RESTClient.cs.

◆ EvaluatePersistent()

IAllowRESTExecution GenerallyPositive.RESTClient.EvaluatePersistent ( string xpath)

Evaluates an XPath expression client.Evaluate("//div").Execute();.

Parameters
xpathThe XPath expression
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2229 of file RESTClient.cs.

◆ Execute()

string GenerallyPositive.RESTClient.Execute ( bool publishEvent = true)

Executes the request synchronously.

Returns
The result string

Implements GenerallyPositive.IAllowRESTExecution.

Definition at line 1345 of file RESTClient.cs.

◆ Execute< T >()

T GenerallyPositive.RESTClient.Execute< T > ( bool publishEvent = true)

Executes the request synchronously with type.

Template Parameters
TThe result type
Returns
The typed result

Implements GenerallyPositive.IAllowRESTExecution.

Definition at line 1428 of file RESTClient.cs.

◆ ExecuteAsync()

async Task< string > GenerallyPositive.RESTClient.ExecuteAsync ( bool publishEvent = true)

Executes the request asynchronously and returns the raw response await client.ExecuteAsync();.

Returns
The response string

Implements GenerallyPositive.IAllowRESTExecution.

Definition at line 1544 of file RESTClient.cs.

◆ ExecuteAsync< T >()

async Task< T > GenerallyPositive.RESTClient.ExecuteAsync< T > ( bool publishEvent = true)

Executes the request asynchronously with type.

Template Parameters
TThe result type
Returns
The typed result

Implements GenerallyPositive.IAllowRESTExecution.

Definition at line 1622 of file RESTClient.cs.

◆ ExecuteJavaScript()

IAllowRESTParameters GenerallyPositive.RESTClient.ExecuteJavaScript ( string script)

Executes JavaScript code client.ExecuteJavaScript("return document.title").Execute<string>();.

Parameters
scriptThe JavaScript code
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2992 of file RESTClient.cs.

◆ Fetch()

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.Fetch ( string url)

Issue an API request from inside the page, so it carries the session the browser has already earned: its cookies, TLS fingerprint, header order and any anti-bot clearance. A relative url resolves against wherever the browser currently is. client.Fetch("/api/search?page=1").Execute();.

Parameters
urlUrl to request, relative or absolute
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2777 of file RESTClient.cs.

◆ FillInAppend()

IAllowRESTInputText GenerallyPositive.RESTClient.FillInAppend ( string elementId)

Appends text to an element client.FillInAppend("input123").WithText("Hello").Execute();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3282 of file RESTClient.cs.

◆ FillInInsert()

IAllowRESTInputText GenerallyPositive.RESTClient.FillInInsert ( string elementId)

Appends text to an element client.FillInAppend("input123").WithText("Hello").Execute();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3294 of file RESTClient.cs.

◆ FillInOverwrite()

IAllowRESTInputText GenerallyPositive.RESTClient.FillInOverwrite ( string elementId)

Appends text to an element client.FillInAppend("input123").WithText("Hello").Execute();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3306 of file RESTClient.cs.

◆ FireChangeEvent()

IAllowRESTExecution GenerallyPositive.RESTClient.FireChangeEvent ( string elementId)

Fires a change event on an element by ID client.FireChangeEvent("element123").Execute();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2264 of file RESTClient.cs.

◆ Focus()

IAllowRESTExecution GenerallyPositive.RESTClient.Focus ( string elementId)

Focuses an element by ID client.Focus("element123").Execute();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2276 of file RESTClient.cs.

◆ Forward()

IAllowRESTExecution GenerallyPositive.RESTClient.Forward ( )

Navigates browser history forward client.Forward().Execute();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3033 of file RESTClient.cs.

◆ FullScreen()

IAllowRESTExecution GenerallyPositive.RESTClient.FullScreen ( )

Sets browser to full screen client.FullScreen().Execute();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3044 of file RESTClient.cs.

◆ GetAttribute()

IAllowRESTAttribute GenerallyPositive.RESTClient.GetAttribute ( string elementId)

Starts getting an attribute of an element by ID client.GetAttribute("element123").WithAttribute("value").Execute<string>();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2640 of file RESTClient.cs.

◆ GetBoundingClientRect()

IAllowRESTExecution GenerallyPositive.RESTClient.GetBoundingClientRect ( string elementId)

Gets the bounding client rect of an element by ID client.GetBoundingClientRect("element123").Execute<string>();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2288 of file RESTClient.cs.

◆ GetBrowserSettings()

IAllowRESTExecution GenerallyPositive.RESTClient.GetBrowserSettings ( )

Gets browser settings client.GetBrowserSettings().Execute();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3055 of file RESTClient.cs.

◆ GetCapturedCalls()

IAllowRESTExecution GenerallyPositive.RESTClient.GetCapturedCalls ( )

Everything recorded so far, oldest first, as the json the extension keeps. string json = client.GetCapturedCalls().Execute();.

Returns
Fluent interface to execute the request

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3208 of file RESTClient.cs.

◆ GetContentAndCss()

IAllowRESTExecution GenerallyPositive.RESTClient.GetContentAndCss ( string elementId)

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2369 of file RESTClient.cs.

◆ GetCssAttributes()

IAllowRESTExecution GenerallyPositive.RESTClient.GetCssAttributes ( string elementId)

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2378 of file RESTClient.cs.

◆ GetCurrentUrl()

IAllowRESTExecution GenerallyPositive.RESTClient.GetCurrentUrl ( )

Gets the current URL client.GetCurrentUrl().Execute<string>();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3066 of file RESTClient.cs.

◆ GetCurrentWindow()

IAllowRESTExecution GenerallyPositive.RESTClient.GetCurrentWindow ( )

Gets the current window's ID and URL client.GetCurrentWindow().Execute<WindowTuple>();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3928 of file RESTClient.cs.

◆ GetDocumentStamp()

IAllowRESTExecution GenerallyPositive.RESTClient.GetDocumentStamp ( )

Gets the current URL and the document identity in one call.
A form posting to itself and a route rewritten in place both build a new document at the same address, which the url alone does not distinguish. client.GetDocumentStamp().Execute<string>();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3079 of file RESTClient.cs.

◆ GetDomAttributes()

IAllowRESTExecution GenerallyPositive.RESTClient.GetDomAttributes ( string elementId)

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2387 of file RESTClient.cs.

◆ GetDomProperties()

IAllowRESTExecution GenerallyPositive.RESTClient.GetDomProperties ( string elementId)

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2396 of file RESTClient.cs.

◆ GetElementAttributeHash()

IAllowRESTExecution GenerallyPositive.RESTClient.GetElementAttributeHash ( string elementId)

Gets the attribute hash of an element client.GetElementAttributeHash().Execute<string>();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2410 of file RESTClient.cs.

◆ GetExecutionResults() [1/2]

ResultCollection GenerallyPositive.RESTClient.GetExecutionResults ( )

Implements GenerallyPositive.IAllowRESTExecution.

Definition at line 1733 of file RESTClient.cs.

◆ GetExecutionResults() [2/2]

IReadOnlyList< object > GenerallyPositive.RESTClient.GetExecutionResults ( string name)

Every result stored under name , in the order it was stored, so a loop that ran five times answers with five. Ask without a name for the whole collection, or index it by name for the last answer alone.

int passes = client.GetExecutionResults("atBottom").Count;
Parameters
nameThe name given to WithResultName
Returns
What was stored under that name

Implements GenerallyPositive.IAllowRESTExecution.

Definition at line 1746 of file RESTClient.cs.

◆ GetGpalSettings()

IAllowRESTExecution GenerallyPositive.RESTClient.GetGpalSettings ( )

Gets GPAL settings client.GetGpalSettings().Execute();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3102 of file RESTClient.cs.

◆ GetHydrationScripts()

IAllowRESTExecution GenerallyPositive.RESTClient.GetHydrationScripts ( )

Gets the page title, the NEXT_DATA payload and any React Flight chunks, read from the document rather than its markup. client.GetHydrationScripts().Execute<string>();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3091 of file RESTClient.cs.

◆ GetLanguages()

IAllowRESTExecution GenerallyPositive.RESTClient.GetLanguages ( )

Gets the browser's preferred languages, most preferred first client.GetLanguages().Execute<string>();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3147 of file RESTClient.cs.

◆ GetOptions()

IAllowRESTExecution GenerallyPositive.RESTClient.GetOptions ( string elementId)

Get the options in a Select manue.

Parameters
elementId
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2421 of file RESTClient.cs.

◆ GetPageSource()

IAllowRESTExecution GenerallyPositive.RESTClient.GetPageSource ( )

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2426 of file RESTClient.cs.

◆ GetParentNode()

IAllowRESTExecution GenerallyPositive.RESTClient.GetParentNode ( string elementId)

Gets the parent node of an element by ID client.GetParentNode("element123").Execute<string>();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2437 of file RESTClient.cs.

◆ GetReadyStatus()

IAllowRESTExecution GenerallyPositive.RESTClient.GetReadyStatus ( )

Gets the ready status client.GetReadyStatus().Execute<string>();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3113 of file RESTClient.cs.

◆ GetSettings()

IAllowRESTExecution GenerallyPositive.RESTClient.GetSettings ( )

Gets settings client.GetSettings().Execute();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3124 of file RESTClient.cs.

◆ GetShadowRoot()

IAllowRESTExecution GenerallyPositive.RESTClient.GetShadowRoot ( string css)

Gets the shadow root for a CSS selector client.GetShadowRoot(".class").Execute();.

Parameters
cssThe CSS selector
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3136 of file RESTClient.cs.

◆ GetStorage()

IAllowRESTStorageOptions GenerallyPositive.RESTClient.GetStorage ( WebsiteStorageType storageType)

Get the specified storage type.

Parameters
storageType
Returns
fluent interface to chain parameters

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3905 of file RESTClient.cs.

◆ GetUserAgent()

IAllowRESTExecution GenerallyPositive.RESTClient.GetUserAgent ( )

Gets the user agent client.GetUserAgent().Execute<string>();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3219 of file RESTClient.cs.

◆ GetWindowRectangle()

IAllowRESTExecution GenerallyPositive.RESTClient.GetWindowRectangle ( )

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2364 of file RESTClient.cs.

◆ GetWorkflow()

IAllowRESTExecution GenerallyPositive.RESTClient.GetWorkflow ( )

Gets the workflow client.GetWorkflow().Execute();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3230 of file RESTClient.cs.

◆ GoTo()

IAllowRESTExecution GenerallyPositive.RESTClient.GoTo ( GPALUrl url)

Navigates to a URL client.Goto("https://example.com").Execute();.

Parameters
urlThe URL
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3242 of file RESTClient.cs.

◆ GoToTab() [1/2]

IAllowRESTExecution GenerallyPositive.RESTClient.GoToTab ( GPALUrl url)

Navigates to a tab by URL client.GotoTab("https://example.com").Execute();.

Parameters
urlThe URL
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3270 of file RESTClient.cs.

◆ GoToTab() [2/2]

IAllowRESTExecution GenerallyPositive.RESTClient.GoToTab ( int tabId)

Navigates to a tab by tab ID client.GotoTab(1).Execute();.

Parameters
tabIdThe tab ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3258 of file RESTClient.cs.

◆ GoToWindow() [1/2]

IAllowRESTExecution GenerallyPositive.RESTClient.GoToWindow ( GPALUrl url)

Switches to a window by URL client.GoToWindow("https://example.com").Execute<WindowTuple>();.

Parameters
urlThe window URL
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3831 of file RESTClient.cs.

◆ GoToWindow() [2/2]

IAllowRESTExecution GenerallyPositive.RESTClient.GoToWindow ( int windowId)

Switches to a window by window ID client.GoToWindow(123).Execute<WindowTuple>();.

Parameters
windowIdThe window ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3843 of file RESTClient.cs.

◆ HideElement()

IAllowRESTExecution GenerallyPositive.RESTClient.HideElement ( string elementId)

Hides an element by ID client.HideElement("element123").Execute();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2449 of file RESTClient.cs.

◆ Hover()

IAllowRESTExecution GenerallyPositive.RESTClient.Hover ( string elementId)

Hovers over an element by ID client.Hover("element123").Execute();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2914 of file RESTClient.cs.

◆ InjectScript()

IAllowRESTParameters GenerallyPositive.RESTClient.InjectScript ( string script)

Registers a script to run on every new document load. Persists until ClearInjectedScripts is called.

Parameters
scriptThe JavaScript code to inject
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3007 of file RESTClient.cs.

◆ IsClickable()

IAllowRESTExecution GenerallyPositive.RESTClient.IsClickable ( string elementId)

Checks if an element is clickable by ID client.IsClickAble("element123").Execute<bool>();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2461 of file RESTClient.cs.

◆ IsDisplayed()

IAllowRESTExecution GenerallyPositive.RESTClient.IsDisplayed ( string elementId)

Checks if an element is displayed by ID client.IsDisplayed("element123").Execute<bool>();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2473 of file RESTClient.cs.

◆ IsEnabled()

IAllowRESTExecution GenerallyPositive.RESTClient.IsEnabled ( string elementId)

Checks if an element is enabled by ID client.IsEnabled("element123").Execute<bool>();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2485 of file RESTClient.cs.

◆ IsEndOfPage()

IAllowRESTExecution GenerallyPositive.RESTClient.IsEndOfPage ( )

Checks if the page is at the end client.IsEndOfPage().Execute<bool>();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2496 of file RESTClient.cs.

◆ IsVisibleInViewport()

IAllowRESTExecution GenerallyPositive.RESTClient.IsVisibleInViewport ( string elementId)

Checks if an element is visible in viewport by ID client.IsVisibleInViewport("element123").Execute<bool>();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2508 of file RESTClient.cs.

◆ LeftClick()

IAllowRESTExecution GenerallyPositive.RESTClient.LeftClick ( string elementId)

Performs a left click on an element by ID client.LeftClick("element123").Execute();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2520 of file RESTClient.cs.

◆ LeftClickAndDownload()

IAllowRESTWithDownloadFilename GenerallyPositive.RESTClient.LeftClickAndDownload ( string elementId)

Performs a left click and download on an element client.LeftClickAndDownload("element123").SetDownloadFileName(fileName).Execute();.

Parameters
elementIdThe element ID
Returns
Interace chaining to SetDownloadFileName

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3318 of file RESTClient.cs.

◆ LeftClickAndUpload()

IAllowRESTWithUploadFilename GenerallyPositive.RESTClient.LeftClickAndUpload ( string elementId)

Purely headless mode, attaches the file to the input[type=file] client.LeftClickAndUpload("element123").WithUploadFile(filePath).Execute();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3330 of file RESTClient.cs.

◆ LeftDoubleClick()

IAllowRESTExecution GenerallyPositive.RESTClient.LeftDoubleClick ( string elementId)

Performs a left double click on an element by ID client.LeftDoubleClick("element123").Execute();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2532 of file RESTClient.cs.

◆ ListOpenAPIEndPoints()

IAllowRESTEndpointDetails GenerallyPositive.RESTClient.ListOpenAPIEndPoints ( )

Implements GenerallyPositive.IAllowRESTEndpointDetails.

Definition at line 465 of file RESTClient.cs.

◆ LoadOpenAPIMap() [1/2]

IAllowRESTEndpointDetails GenerallyPositive.RESTClient.LoadOpenAPIMap ( GPALFile openApiMapFile)

Implements GenerallyPositive.IAllowRESTEndpoint.

Definition at line 392 of file RESTClient.cs.

◆ LoadOpenAPIMap() [2/2]

IAllowRESTEndpointDetails GenerallyPositive.RESTClient.LoadOpenAPIMap ( string yamlOrUrl)

Implements GenerallyPositive.IAllowRESTEndpoint.

Definition at line 339 of file RESTClient.cs.

◆ LoadOpenApiRulesInternal()

void GenerallyPositive.RESTClient.LoadOpenApiRulesInternal ( string yamlContent)

Definition at line 408 of file RESTClient.cs.

◆ Maximize()

IAllowRESTExecution GenerallyPositive.RESTClient.Maximize ( )

Maximizes the browser window client.Maximize().Execute();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3341 of file RESTClient.cs.

◆ MiddleClick()

IAllowRESTExecution GenerallyPositive.RESTClient.MiddleClick ( string elementId)

Performs a left click on an element by ID client.LeftClick("element123").Execute();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2543 of file RESTClient.cs.

◆ Minimize()

IAllowRESTExecution GenerallyPositive.RESTClient.Minimize ( )

Minimizes the browser window client.Minimize().Execute();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3352 of file RESTClient.cs.

◆ MoveTo()

IAllowRESTExecution GenerallyPositive.RESTClient.MoveTo ( string elementId)

Moves to an element client.MoveTo("element123").Execute();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3364 of file RESTClient.cs.

◆ NewTab()

IAllowRESTExecution GenerallyPositive.RESTClient.NewTab ( GPALUrl url)

Opens a new tab with optional URL client.NewTab("https://example.com").Execute();.

Parameters
urlThe URL (optional)
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3376 of file RESTClient.cs.

◆ NextTab()

IAllowRESTExecution GenerallyPositive.RESTClient.NextTab ( )

Switches to the next tab client.NextTab().Execute();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3392 of file RESTClient.cs.

◆ NextWindow()

IAllowRESTExecution GenerallyPositive.RESTClient.NextWindow ( )

Switches to the next window client.NextTab().Execute();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3415 of file RESTClient.cs.

◆ Normal()

IAllowRESTExecution GenerallyPositive.RESTClient.Normal ( )

Restores the browser window to normal client.Normal().Execute();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3426 of file RESTClient.cs.

◆ OpenWindow()

IAllowRESTExecution GenerallyPositive.RESTClient.OpenWindow ( GPALUrl url)

Opens a new window with the specified URL client.OpenWindow("https://example.com").Execute<WindowTuple>();.

Parameters
urlThe URL to open (optional, defaults to "https://google.com")
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3816 of file RESTClient.cs.

◆ OverrideReferrer()

IAllowRESTExecution GenerallyPositive.RESTClient.OverrideReferrer ( string referrer)

Overrides the referrer URL client.OverrideReferrr("https://google.com").Execute();.

Parameters
referrerThe referrer URL
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3438 of file RESTClient.cs.

◆ PageDown()

IAllowRESTExecution GenerallyPositive.RESTClient.PageDown ( int pagesToScroll = 1)

Scrolls the page down by pages client.PageDown(1).Execute();.

Parameters
pagesToScrollNumber of pages to scroll
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3466 of file RESTClient.cs.

◆ PageEnd()

IAllowRESTExecution GenerallyPositive.RESTClient.PageEnd ( )

Scrolls to the page end client.PageEnd().Execute();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3481 of file RESTClient.cs.

◆ PageTop()

IAllowRESTExecution GenerallyPositive.RESTClient.PageTop ( )

Scrolls to the page top client.PageTop().Execute();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3492 of file RESTClient.cs.

◆ PageUp()

IAllowRESTExecution GenerallyPositive.RESTClient.PageUp ( int pagesToScroll = 1)

Scrolls the page up by pages client.PageUp(1).Execute();.

Parameters
pagesToScrollNumber of pages to scroll
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3504 of file RESTClient.cs.

◆ PressModifierKey()

IAllowRESTExecution GenerallyPositive.RESTClient.PressModifierKey ( ModifierKeys modifierKeys)

Press the modifier keys specified. Keep pressed until a release is sent.

Parameters
modifierKeys
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3519 of file RESTClient.cs.

◆ PreviousTab()

IAllowRESTExecution GenerallyPositive.RESTClient.PreviousTab ( )

Switches to the previous tab client.PreviousTab().Execute();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3533 of file RESTClient.cs.

◆ PreviousWindow()

IAllowRESTExecution GenerallyPositive.RESTClient.PreviousWindow ( )

Switches to the next window client.NextTab().Execute();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3544 of file RESTClient.cs.

◆ QueryPersistentSelector()

IAllowRESTExecution GenerallyPositive.RESTClient.QueryPersistentSelector ( string css)

Queries a single element using a CSS selector client.QuerySelector(".class").Execute();.

Parameters
cssThe CSS selector
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2579 of file RESTClient.cs.

◆ QueryPersistentSelectors()

IAllowRESTExecution GenerallyPositive.RESTClient.QueryPersistentSelectors ( string css)

Queries multiple elements using a CSS selector client.QuerySelectors(".class").Execute<string[]>();.

Parameters
cssThe CSS selector
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2591 of file RESTClient.cs.

◆ QuerySelector()

IAllowRESTExecution GenerallyPositive.RESTClient.QuerySelector ( string css)

Queries a single element using a CSS selector client.QuerySelector(".class").Execute();.

Parameters
cssThe CSS selector
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2555 of file RESTClient.cs.

◆ QuerySelectors()

IAllowRESTExecution GenerallyPositive.RESTClient.QuerySelectors ( string css)

Queries multiple elements using a CSS selector client.QuerySelectors(".class").Execute<string[]>();.

Parameters
cssThe CSS selector
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2567 of file RESTClient.cs.

◆ Refresh()

IAllowRESTExecution GenerallyPositive.RESTClient.Refresh ( )

Refreshes the current page client.Refresh().Execute();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3555 of file RESTClient.cs.

◆ ReleaseModifierKey()

IAllowRESTExecution GenerallyPositive.RESTClient.ReleaseModifierKey ( ModifierKeys modifierKeys)

Press the modifier keys specified. Keep pressed until a release is sent.

Parameters
modifierKeys
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3567 of file RESTClient.cs.

◆ Restore()

IAllowRESTExecution GenerallyPositive.RESTClient.Restore ( )

Restores the browser window client.Restore().Execute();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3582 of file RESTClient.cs.

◆ RightClick()

IAllowRESTExecution GenerallyPositive.RESTClient.RightClick ( string elementId)

Performs a right click on an element by ID client.RightClick("element123").Execute();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2603 of file RESTClient.cs.

◆ SaveResultsTo()

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.SaveResultsTo ( GPALFile file)

Saves the response to a file if the endpoint returns a downloadable content client.WithEndpoint(ApiEndpoint.LeftClickAndDownload).SaveResultsTo(file).Execute();.

Parameters
fileThe GPAL file defining the save location
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 1276 of file RESTClient.cs.

◆ ScrollElement() [1/2]

IAllowRESTExecution GenerallyPositive.RESTClient.ScrollElement ( int hPixels,
int vPixels )

Scrolls an element by horizontal and vertical pixels client.ScrollElement(100, 200).Execute();.

Parameters
hPixelsThe horizontal pixels
vPixelsThe vertical pixels
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2628 of file RESTClient.cs.

◆ ScrollElement() [2/2]

IAllowRESTScrollElement GenerallyPositive.RESTClient.ScrollElement ( string elementId)

Starts scrolling an element by ID client.ScrollElement("element123").WithHPixels(100).WithVPixels(200).Execute();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3606 of file RESTClient.cs.

◆ ScrollIntoView()

IAllowRESTExecution GenerallyPositive.RESTClient.ScrollIntoView ( string elementId)

Scrolls an element into view by ID client.ScrollIntoView("element123").Execute();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2615 of file RESTClient.cs.

◆ ScrollWindow()

IAllowRESTExecution GenerallyPositive.RESTClient.ScrollWindow ( int hPixels,
int vPixels )

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3612 of file RESTClient.cs.

◆ ScrollWindowByHorizontal()

IAllowRESTExecution GenerallyPositive.RESTClient.ScrollWindowByHorizontal ( int hPixels)

Scrolls the window horizontally by pixels client.ScrollWindowByHorizontal(100).Execute();.

Parameters
pixelsThe horizontal pixels
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3623 of file RESTClient.cs.

◆ ScrollWindowByVertical()

IAllowRESTExecution GenerallyPositive.RESTClient.ScrollWindowByVertical ( int vPixels)

Scrolls the window vertically by pixels client.ScrollWindowByVertical(100).Execute();.

Parameters
pixelsThe vertical pixels
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3637 of file RESTClient.cs.

◆ SelectClick()

IAllowSelectOptions GenerallyPositive.RESTClient.SelectClick ( string elementId)

Click a Select menu option.

Parameters
elementId
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3650 of file RESTClient.cs.

◆ SendKey()

IAllowRESTExecution GenerallyPositive.RESTClient.SendKey ( byte vkcode)

Sends a key client.SendKey("Enter").Execute();.

Parameters
keyThe key to send
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3684 of file RESTClient.cs.

◆ SendString()

IAllowRESTExecution GenerallyPositive.RESTClient.SendString ( string text,
int delayMs = 0 )

Sends a string client.SendString("Hello").Execute();.

Parameters
textThe text to send
delayMsInter-character pacing delay in milliseconds. 0 sends the whole string atomically; greater than 0 dispatches character-by-character with this delay between characters.
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3709 of file RESTClient.cs.

◆ SetAttribute()

IAllowRESTAttribute GenerallyPositive.RESTClient.SetAttribute ( string elementId)

Starts setting an attribute of an element by ID client.SetAttribute("element123").WithAttribute("disabled").WithValue("true").Execute();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2652 of file RESTClient.cs.

◆ SetDownloadFilename()

IAllowRESTExecution GenerallyPositive.RESTClient.SetDownloadFilename ( string downloadPath)

Sets the download filename for the current session client.SetDownloadFilename("/path/to/file").Execute();.

Parameters
downloadPathThe download path
Returns

Names where the next download the browser starts should be saved, without clicking anything.

client.SetDownloadFilename("c: emp ile.pdf").Execute();</example> <param name="downloadPath">Where the file is to be saved

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2183 of file RESTClient.cs.

◆ SetGoogleReferrer()

IAllowRESTExecution GenerallyPositive.RESTClient.SetGoogleReferrer ( )

Overrides referrer stealthily - sets to google.com client.SetGoogleReferrer().Execute();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3742 of file RESTClient.cs.

◆ SetRange()

IAllowRangeValue GenerallyPositive.RESTClient.SetRange ( string elementId)

Starts setting an attribute of an element by ID client.SetAttribute("element123").WithAttribute("disabled").WithValue("true").Execute();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2689 of file RESTClient.cs.

◆ SetStorage()

IAllowRESTStorageOptions GenerallyPositive.RESTClient.SetStorage ( WebsiteStorageType storageType)

Set data for the specified storage type.

Parameters
storageType
Returns
fluent interface to chain parameters

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3917 of file RESTClient.cs.

◆ SetUserAgent()

IAllowRESTExecution GenerallyPositive.RESTClient.SetUserAgent ( string userAgent)

Overrides the browser's user agent string client.SetUserAgent("Mozilla/5.0 ...").Execute();.

Parameters
userAgentThe user agent string to use
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3450 of file RESTClient.cs.

◆ SetValueFrom()

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.SetValueFrom ( string destSelector)

Sets the value of the destination element identified by destSelector from the source element identified by the preceding WithCss(string) or WithElementId(string) call. client.WithElementId("srcSelector").SetValueFrom("destSelector").Execute();.

Parameters
destSelectorCSS selector identifying the destination element whose value is set
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 3727 of file RESTClient.cs.

◆ SwitchToDefaultContent()

IAllowRESTExecution GenerallyPositive.RESTClient.SwitchToDefaultContent ( )

Switches to default content client.SwitchToDefaultContent().Execute();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3753 of file RESTClient.cs.

◆ SwitchToElement()

IAllowRESTExecution GenerallyPositive.RESTClient.SwitchToElement ( string elementId)

Switches to an element to search for selectors contained client.SwitchToElement("div123").Execute();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3940 of file RESTClient.cs.

◆ SwitchToFrame()

IAllowRESTExecution GenerallyPositive.RESTClient.SwitchToFrame ( string elementId)

Switches to a frame client.SwitchToFrame("frame123").Execute();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3956 of file RESTClient.cs.

◆ SwitchToShadowRoot()

IAllowRESTExecution GenerallyPositive.RESTClient.SwitchToShadowRoot ( string elementId)

Switches to a shadow root client.SwitchToShadowRoot("shadow123").Execute();.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3972 of file RESTClient.cs.

◆ TabCount()

IAllowRESTExecution GenerallyPositive.RESTClient.TabCount ( )

How many tabs the browser actually has open, which is not the same as how many GPAL opened. A tab can close itself, which is what a browser does with a tab whose first navigation turns into a download. int tabs = client.TabCount().Execute<int>();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 3404 of file RESTClient.cs.

◆ ToGPALObject()

IRESTClient GenerallyPositive.RESTClient.ToGPALObject ( )

Converts the client to a GPAL object.

Returns
The GPAL object

Implements GenerallyPositive.IAllowToGPALObject< TResult >.

Definition at line 1696 of file RESTClient.cs.

◆ TopBrowser()

IAllowRESTExecution GenerallyPositive.RESTClient.TopBrowser ( )

Top the browser, bring it into focus. Used before performing any actions on the browser.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2662 of file RESTClient.cs.

◆ TrustedLeftClick()

IAllowRESTExecution GenerallyPositive.RESTClient.TrustedLeftClick ( int x,
int y,
int holdMs = 0 )

Clicks a viewport point through the browser's own input pipeline, so the page reads the event as trusted. Answers OK when the click was made and NOTOK where the browser has no debugger to attach, which is Firefox. client.TrustedLeftClick(120, 340).Execute<bool>();.

Parameters
xViewport x to click
yViewport y to click
holdMsMilliseconds to hold the button down, 0 for an ordinary click
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2322 of file RESTClient.cs.

◆ TrustedMiddleClick()

IAllowRESTExecution GenerallyPositive.RESTClient.TrustedMiddleClick ( int x,
int y,
int holdMs = 0 )

Middle clicks a viewport point through the browser's own input pipeline, so the page reads the event as trusted. Answers OK when the click was made and NOTOK where the browser has no debugger to attach, which is Firefox. client.TrustedMiddleClick(120, 340).Execute<bool>();.

Parameters
xViewport x to click
yViewport y to click
holdMsMilliseconds to hold the button down, 0 for an ordinary click
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2348 of file RESTClient.cs.

◆ Until()

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.Until ( Func< bool > condition)

Executes workflows until condition holds.

Parameters
conditionThe condition function
Returns

Implements GenerallyPositive.IAllowRESTWorkflow.

Definition at line 1828 of file RESTClient.cs.

◆ While()

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.While ( Func< bool > condition)

Executes workflows while condition holds client.While(() => someCondition).Execute();.

Parameters
conditionThe condition function
Returns

Implements GenerallyPositive.IAllowRESTWorkflow.

Definition at line 1778 of file RESTClient.cs.

◆ WindowInnerHeight()

IAllowRESTExecution GenerallyPositive.RESTClient.WindowInnerHeight ( )

Gets the window inner height client.WindowInnerHeight().Execute<int>();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2730 of file RESTClient.cs.

◆ WindowInnerWidth()

IAllowRESTExecution GenerallyPositive.RESTClient.WindowInnerWidth ( )

Gets the window inner width client.WindowInnerWidth().Execute<int>();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2741 of file RESTClient.cs.

◆ WindowOuterHeight()

IAllowRESTExecution GenerallyPositive.RESTClient.WindowOuterHeight ( )

Gets the window outer height client.WindowOuterHeight().Execute<int>();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2752 of file RESTClient.cs.

◆ WindowOuterWidth()

IAllowRESTExecution GenerallyPositive.RESTClient.WindowOuterWidth ( )

Gets the window outer width client.WindowOuterWidth().Execute<int>();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2763 of file RESTClient.cs.

◆ WindowPageOffsetX()

IAllowRESTExecution GenerallyPositive.RESTClient.WindowPageOffsetX ( )

Gets the window page offset X client.WindowPageOffsetX().Execute<int>();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2869 of file RESTClient.cs.

◆ WindowPageOffsetY()

IAllowRESTExecution GenerallyPositive.RESTClient.WindowPageOffsetY ( )

Gets the window page offset Y client.WindowPageOffsetY().Execute<int>();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2880 of file RESTClient.cs.

◆ WindowScreenLeft()

IAllowRESTExecution GenerallyPositive.RESTClient.WindowScreenLeft ( )

Gets the window screen left position client.WindowScreenLeft().Execute<int>();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2891 of file RESTClient.cs.

◆ WindowScreenTop()

IAllowRESTExecution GenerallyPositive.RESTClient.WindowScreenTop ( )

Gets the window screen top position client.WindowScreenTop().Execute<int>();.

Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2902 of file RESTClient.cs.

◆ WithAPIBase() [1/2]

IAllowRESTEndpointDetails GenerallyPositive.RESTClient.WithAPIBase ( string url)

Sets the API base URL with download path.

Parameters
urlThe base URL
Returns

Implements GenerallyPositive.IAllowRESTEndpoint.

Definition at line 279 of file RESTClient.cs.

◆ WithAPIBase() [2/2]

IAllowRESTEndpointDetails GenerallyPositive.RESTClient.WithAPIBase ( string url,
TimeSpan httpTimeout )

Sets the API base URL and how long one attempt is given before it is abandoned.

Parameters
urlThe base URL
httpTimeoutHow long one attempt is given. 60 seconds without this. Pass System.Threading.Timeout.InfiniteTimeSpan for no limit, which is what a call that takes as long as it takes needs
Returns

Implements GenerallyPositive.IAllowRESTEndpoint.

Definition at line 293 of file RESTClient.cs.

◆ WithAttribute()

IAllowRESTAttribute GenerallyPositive.RESTClient.WithAttribute ( string attribute)

Specifies the attribute name for get or set operation client.GetAttribute("element123").WithAttribute("value").Execute<string>();.

Parameters
attributeThe attribute name
Returns

Implements GenerallyPositive.IAllowRESTAttribute.

Definition at line 2674 of file RESTClient.cs.

◆ WithBody()

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithBody ( string body)

Sets the body of the request being fetched. client.Fetch(url).WithVerb("POST").WithBody(json).Execute();.

Parameters
bodyRequest body
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2809 of file RESTClient.cs.

◆ WithBytes()

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithBytes ( bool bytes)

True to bring the fetched response body back base64 encoded, which is what a file needs. Text is the default, and reading a file as text would put a replacement character wherever a byte is not valid utf-8. client.Fetch(url).WithBytes(true).Execute();.

Parameters
bytesTrue for a base64 encoded body, false for text
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2855 of file RESTClient.cs.

◆ WithCallFilter()

IAllowRESTCaptureOptions GenerallyPositive.RESTClient.WithCallFilter ( string urlFragment)

Records only the calls whose url holds this, so a page that talks to a dozen places narrows to the one worth having.

Parameters
urlFragmentRecord only urls holding this
Returns
Fluent interface to narrow what is recorded, or to execute

Implements GenerallyPositive.IAllowRESTCaptureOptions.

Definition at line 3178 of file RESTClient.cs.

◆ WithClearCalls()

IAllowRESTCaptureOptions GenerallyPositive.RESTClient.WithClearCalls ( bool clear = true)

Forgets what was already recorded before starting, so a second capture is not read as the first.

Parameters
clearTrue to start from nothing
Returns
Fluent interface to narrow what is recorded, or to execute

Implements GenerallyPositive.IAllowRESTCaptureOptions.

Definition at line 3193 of file RESTClient.cs.

◆ WithContentType()

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithContentType ( string contentType)

Sets the content type of the body of the request being fetched. client.Fetch(url).WithContentType("application/json").Execute();.

Parameters
contentTypeContent type
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2824 of file RESTClient.cs.

◆ WithCss()

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithCss ( string css)

Sets the CSS parameter.

Parameters
cssThe CSS selector
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 668 of file RESTClient.cs.

◆ WithCssFromResult() [1/2]

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithCssFromResult ( int resultIndex)

Sets the CSS from a result by index.

Parameters
resultIndexThe result index
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 682 of file RESTClient.cs.

◆ WithCssFromResult() [2/2]

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithCssFromResult ( string name)

Sets the CSS from a result by name.

Parameters
nameThe result name
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 701 of file RESTClient.cs.

◆ WithData()

IAllowRESTStorageOptions GenerallyPositive.RESTClient.WithData ( string data)

Sets the set storage data parameter.

Parameters
dataThe data to save in storage
Returns

Implements GenerallyPositive.IAllowRESTStorageOptions.

Definition at line 992 of file RESTClient.cs.

◆ WithDeleteAcrossOrigins()

IAllowRESTStorageOptions GenerallyPositive.RESTClient.WithDeleteAcrossOrigins ( bool crossOrigin)

Implements GenerallyPositive.IAllowRESTStorageOptions.

Definition at line 1077 of file RESTClient.cs.

◆ WithDeltaX()

IAllowRESTDragAndDrop GenerallyPositive.RESTClient.WithDeltaX ( int deltaX)

Sets the horizontal drop offset for a drag-and-drop operation.

Parameters
deltaXThe horizontal offset, in pixels, from the element's current position
Returns

Implements GenerallyPositive.IAllowRESTDragAndDrop.

Definition at line 2005 of file RESTClient.cs.

◆ WithDeltaY()

IAllowRESTDragAndDrop GenerallyPositive.RESTClient.WithDeltaY ( int deltaY)

Sets the vertical drop offset for a drag-and-drop operation.

Parameters
deltaYThe vertical offset, in pixels, from the element's current position
Returns

Implements GenerallyPositive.IAllowRESTDragAndDrop.

Definition at line 2019 of file RESTClient.cs.

◆ WithDeviceName()

IAllowRESTExecution GenerallyPositive.RESTClient.WithDeviceName ( string sinkName)

Sets the CSS parameter.

Parameters
cssThe CSS selector
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 1332 of file RESTClient.cs.

◆ WithDownloadFile()

IAllowRESTExecution GenerallyPositive.RESTClient.WithDownloadFile ( string downloadPath)

Implements GenerallyPositive.IAllowRESTWithDownloadFilename.

Definition at line 2188 of file RESTClient.cs.

◆ WithElement()

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithElement ( IGPALElement gPALElement)

Sets the element parameter.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 721 of file RESTClient.cs.

◆ WithElementId()

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithElementId ( string elementId)

Sets the element ID parameter.

Parameters
elementIdThe element ID
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 1878 of file RESTClient.cs.

◆ WithElementIdFromResult() [1/2]

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithElementIdFromResult ( int resultIndex)

Sets the element from a result by index.

Parameters
resultIndexThe result index
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 737 of file RESTClient.cs.

◆ WithElementIdFromResult() [2/2]

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithElementIdFromResult ( string name)

Sets the element from a result by name.

Parameters
nameThe result name
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 766 of file RESTClient.cs.

◆ WithEncoding()

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithEncoding ( ContentEncoding encoding)

Specifiy the encoiding type for posted parameters: json or urlencoded.

Parameters
encoding
Returns

Definition at line 1892 of file RESTClient.cs.

◆ WithEndpoint() [1/2]

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithEndpoint ( ApiEndpoint endpoint)

Sets the endpoint from an ApiEndpoint enum.

Parameters
endpointThe ApiEndpoint enum value
Returns

Implements GenerallyPositive.IAllowRESTEndpointDetails.

Definition at line 316 of file RESTClient.cs.

◆ WithEndpoint() [2/2]

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithEndpoint ( string endpoint)

Sets the endpoint as a string.

Parameters
endpointThe endpoint string
Returns

Implements GenerallyPositive.IAllowRESTEndpointDetails.

Definition at line 304 of file RESTClient.cs.

◆ WithHeader()

IAllowRESTExecution GenerallyPositive.RESTClient.WithHeader ( string name,
string value )

Adds an HTTP header to the request client.WithHeader("Authorization", "Bearer YOUR_ACCESS_TOKEN").Execute();.

Parameters
nameThe header name
valueThe header value
Returns

Implements GenerallyPositive.IAllowRESTExecution.

Definition at line 1913 of file RESTClient.cs.

◆ WithHeaderFromResult() [1/2]

IAllowRESTExecution GenerallyPositive.RESTClient.WithHeaderFromResult ( int resultIndex)

Sets the header from a result by index.

Parameters
resultIndexThe result index
Returns

Definition at line 1964 of file RESTClient.cs.

◆ WithHeaderFromResult() [2/2]

IAllowRESTExecution GenerallyPositive.RESTClient.WithHeaderFromResult ( string name)

Sets the header from a result by name.

Parameters
nameThe result name
Returns

Definition at line 1984 of file RESTClient.cs.

◆ WithHeaders()

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithHeaders ( string[] headers)

Sets extra headers for the request being fetched, flattened to name, value, name, value. client.Fetch(url).WithHeaders(new[] { "Accept", "application/json" }).Execute();.

Parameters
headersHeader names and values in pairs
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2839 of file RESTClient.cs.

◆ WithHPixels()

IAllowRESTScrollElement GenerallyPositive.RESTClient.WithHPixels ( int hPixels)

Sets the horizontal pixels parameter.

Parameters
hPixelsThe horizontal pixels
Returns

Implements GenerallyPositive.IAllowRESTScrollElement.

Definition at line 2061 of file RESTClient.cs.

◆ WithHPixelsFromResult() [1/2]

IAllowRESTScrollElement GenerallyPositive.RESTClient.WithHPixelsFromResult ( int resultIndex)

Sets the horizontal pixels from a result by index.

Parameters
resultIndexThe result index
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 2075 of file RESTClient.cs.

◆ WithHPixelsFromResult() [2/2]

IAllowRESTScrollElement GenerallyPositive.RESTClient.WithHPixelsFromResult ( string name)

Sets the horizontal pixels from a result by name.

Parameters
nameThe result name
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 2094 of file RESTClient.cs.

◆ WithHttpMethod()

IAllowRESTExecution GenerallyPositive.RESTClient.WithHttpMethod ( string method)

Sets the HTTP method.

Parameters
methodThe HTTP method
Returns

Implements GenerallyPositive.IAllowRESTMethod.

Definition at line 1292 of file RESTClient.cs.

◆ WithIndex()

IAllowRESTAttribute GenerallyPositive.RESTClient.WithIndex ( int index)

Specifies the option index for select menu operations client.SetAttribute("element123").WithAttribute("disabled").WithValue("true").Execute();.

Parameters
valueThe attribute value
Returns

Definition at line 1318 of file RESTClient.cs.

◆ WithKey()

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithKey ( string key)

Sets the key parameter.

Parameters
keyThe key
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 603 of file RESTClient.cs.

◆ WithKeyFromResult() [1/2]

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithKeyFromResult ( int resultIndex)

Sets the key from a result by index.

Parameters
resultIndexThe result index
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 618 of file RESTClient.cs.

◆ WithKeyFromResult() [2/2]

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithKeyFromResult ( string name)

Sets the key from a result by name.

Parameters
nameThe result name
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 637 of file RESTClient.cs.

◆ WithMaxConnections()

IAllowCheckNetworkIdleOrExecution GenerallyPositive.RESTClient.WithMaxConnections ( int maxConnections)

Sets the maximum connections.

Parameters
maxConnectionsThe maximum connections
Returns

Implements GenerallyPositive.IAllowCheckNetworkIdleOrExecution.

Definition at line 824 of file RESTClient.cs.

◆ WithName()

IAllowRESTEndpointDetails GenerallyPositive.RESTClient.WithName ( string name)

Sets the client name.

Parameters
nameThe client name
Returns

Implements GenerallyPositive.IAllowRESTEndpointDetails.

Definition at line 657 of file RESTClient.cs.

◆ WithOffsetX()

IAllowRESTDragAndDrop GenerallyPositive.RESTClient.WithOffsetX ( int offsetX)

Sets the horizontal grab offset within the element for a drag-and-drop operation.

Parameters
offsetXHorizontal offset, in pixels, within the element to start the drag from
Returns

Implements GenerallyPositive.IAllowRESTDragAndDrop.

Definition at line 2033 of file RESTClient.cs.

◆ WithOffsetY()

IAllowRESTDragAndDrop GenerallyPositive.RESTClient.WithOffsetY ( int offsetY)

Sets the vertical grab offset within the element for a drag-and-drop operation.

Parameters
offsetYVertical offset, in pixels, within the element to start the drag from
Returns

Implements GenerallyPositive.IAllowRESTDragAndDrop.

Definition at line 2047 of file RESTClient.cs.

◆ WithParameters() [1/2]

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithParameters ( object parameters)

Sets parameters as a single object.

Parameters
parametersThe parameters object
Returns

Implements GenerallyPositive.IAllowRESTParameters.

Definition at line 933 of file RESTClient.cs.

◆ WithParameters() [2/2]

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithParameters ( params object[] parameters)

Sets parameters as a variable argument list.

Parameters
parametersThe parameters
Returns

Implements GenerallyPositive.IAllowRESTParameters.

Definition at line 919 of file RESTClient.cs.

◆ WithParametersFromResult() [1/2]

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithParametersFromResult ( int resultIndex)

Sets parameters from a result by index.

Parameters
resultIndexThe result index
Returns

Implements GenerallyPositive.IAllowRESTParameters.

Definition at line 947 of file RESTClient.cs.

◆ WithParametersFromResult() [2/2]

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithParametersFromResult ( string name)

Sets parameters from a result by name.

Parameters
nameThe result name
Returns

Implements GenerallyPositive.IAllowRESTParameters.

Definition at line 969 of file RESTClient.cs.

◆ WithPixels()

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithPixels ( int pixels)

Sets the pixels parameter.

Parameters
pixelsThe pixels value
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 1092 of file RESTClient.cs.

◆ WithPixelsFromResult() [1/2]

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithPixelsFromResult ( int resultIndex)

Sets the pixels from a result by index.

Parameters
resultIndexThe result index
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 1106 of file RESTClient.cs.

◆ WithPixelsFromResult() [2/2]

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithPixelsFromResult ( string name)

Sets the pixels from a result by name.

Parameters
nameThe result name
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 1125 of file RESTClient.cs.

◆ WithPruneMs()

IAllowCheckNetworkIdleOrExecution GenerallyPositive.RESTClient.WithPruneMs ( int pruneMs)

Sets the prune interval in milliseconds.

Parameters
pruneMsThe prune interval in milliseconds
Returns

Implements GenerallyPositive.IAllowCheckNetworkIdleOrExecution.

Definition at line 810 of file RESTClient.cs.

◆ WithRangeValue()

IAllowRESTExecution GenerallyPositive.RESTClient.WithRangeValue ( int rangeValue)

Specifies the value for SetRange operation client.SetRange("element123").WithRangeValue(63).Execute();.

Parameters
rangeValueThe range value
Returns

Implements GenerallyPositive.IAllowRangeValue.

Definition at line 2701 of file RESTClient.cs.

◆ WithReferrer()

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithReferrer ( string url)

Sets the referrer parameter.

Parameters
urlThe referrer URL
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 1145 of file RESTClient.cs.

◆ WithReferrerFromResult() [1/2]

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithReferrerFromResult ( int resultIndex)

Sets the referrer from a result by index.

Parameters
resultIndexThe result index
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 1159 of file RESTClient.cs.

◆ WithReferrerFromResult() [2/2]

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithReferrerFromResult ( string name)

Sets the referrer from a result by name.

Parameters
nameThe result name
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 1178 of file RESTClient.cs.

◆ WithResultName()

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithResultName ( string name)

Sets the result name for the next execution.

Parameters
nameThe result name
Returns

Implements GenerallyPositive.IAllowRESTEndpointDetails.

Definition at line 478 of file RESTClient.cs.

◆ WithScript()

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithScript ( string script)

Sets the script parameter.

Parameters
scriptThe script
Returns

Definition at line 591 of file RESTClient.cs.

◆ WithSelectIndex()

IAllowRESTExecution GenerallyPositive.RESTClient.WithSelectIndex ( int selectIndex)

Implements GenerallyPositive.IAllowSelectOptions.

Definition at line 3670 of file RESTClient.cs.

◆ WithSelectValue()

IAllowRESTExecution GenerallyPositive.RESTClient.WithSelectValue ( string selectValue)

Set the value to choose from the Select menu.

Parameters
value
Returns

Implements GenerallyPositive.IAllowSelectOptions.

Definition at line 3662 of file RESTClient.cs.

◆ WithStorageDomain()

IAllowRESTStorageOptions GenerallyPositive.RESTClient.WithStorageDomain ( string domain)

Sets the storage domain parameter.

Parameters
domainThe domain
Returns

Implements GenerallyPositive.IAllowRESTStorageOptions.

Definition at line 1022 of file RESTClient.cs.

◆ WithStorageKey()

IAllowRESTStorageOptions GenerallyPositive.RESTClient.WithStorageKey ( string key)

Sets the storage key parameter.

Parameters
keyThe path
Returns

Implements GenerallyPositive.IAllowRESTStorageOptions.

Definition at line 1067 of file RESTClient.cs.

◆ WithStoragePath()

IAllowRESTStorageOptions GenerallyPositive.RESTClient.WithStoragePath ( string path)

Sets the storage path parameter.

Parameters
pathThe path
Returns

Implements GenerallyPositive.IAllowRESTStorageOptions.

Definition at line 1037 of file RESTClient.cs.

◆ WithStorageStoreName()

IAllowRESTStorageOptions GenerallyPositive.RESTClient.WithStorageStoreName ( string storeName)

Sets the storage domain parameter.

Parameters
domainThe domain
Returns

Implements GenerallyPositive.IAllowRESTStorageOptions.

Definition at line 1007 of file RESTClient.cs.

◆ WithStorageType()

IAllowRESTStorageOptions GenerallyPositive.RESTClient.WithStorageType ( WebsiteStorageType storageType)

Sets the storage path parameter.

Parameters
pathThe path
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 1052 of file RESTClient.cs.

◆ WithTabId()

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithTabId ( int tabId)

Sets the tab ID parameter.

Parameters
tabIdThe tab ID
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 540 of file RESTClient.cs.

◆ WithTabIdFromResult() [1/2]

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithTabIdFromResult ( int resultIndex)

Sets the tab ID from a result by index.

Parameters
resultIndexThe result index
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 552 of file RESTClient.cs.

◆ WithTabIdFromResult() [2/2]

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithTabIdFromResult ( string name)

Sets the tab ID from a result by name.

Parameters
nameThe result name
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 571 of file RESTClient.cs.

◆ WithText()

IAllowRESTExecution GenerallyPositive.RESTClient.WithText ( string text)

Sets the text parameter.

Parameters
textThe text
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 1198 of file RESTClient.cs.

◆ WithTextFromResult() [1/2]

IAllowRESTExecution GenerallyPositive.RESTClient.WithTextFromResult ( int resultIndex)

Sets the text from a result by index.

Parameters
resultIndexThe result index
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 1212 of file RESTClient.cs.

◆ WithTextFromResult() [2/2]

IAllowRESTExecution GenerallyPositive.RESTClient.WithTextFromResult ( string name)

Sets the text from a result by name.

Parameters
nameThe result name
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 1231 of file RESTClient.cs.

◆ WithTimeout()

IAllowRESTExecution GenerallyPositive.RESTClient.WithTimeout ( TimeSpan httpTimeout)

How long one attempt is given before it is abandoned. Said after the base url, so a client handed a session by ContinueAsRESTClient can still be told, and changed between calls on the same client.

60 seconds unless something says otherwise. A host that accepts the connection and never answers spends the whole of it, so a short one is what to use against a site that may refuse to talk at all. System.Threading.Timeout.InfiniteTimeSpan asks for no limit, for a call that takes as long as it takes. A timeout is not retried, so what is set here is the longest the call can cost.

browser.ContinueAsRESTClient(out IRESTClient client);
string body = client
.WithTimeout(TimeSpan.FromSeconds(10))
.WithEndpoint("/api/prices")
.Execute(false);
Parameters
httpTimeoutHow long one attempt is given
Returns
Fluent interface to carry on building the call

Implements GenerallyPositive.IAllowRESTExecution.

Definition at line 1947 of file RESTClient.cs.

◆ WithTimeoutMs()

IAllowCheckNetworkIdleOrExecution GenerallyPositive.RESTClient.WithTimeoutMs ( int timeoutMs)

Sets the timeout in milliseconds.

Parameters
timeoutMsThe timeout in milliseconds
Returns

Implements GenerallyPositive.IAllowCheckNetworkIdleOrExecution.

Definition at line 796 of file RESTClient.cs.

◆ WithUploadFile()

IAllowRESTExecution GenerallyPositive.RESTClient.WithUploadFile ( string uploadPath)

Sets the timeout in milliseconds.

Parameters
timeoutMsThe timeout in milliseconds
Returns

Implements GenerallyPositive.IAllowRESTWithUploadFilename.

Definition at line 838 of file RESTClient.cs.

◆ WithUploadFiles()

IAllowRESTExecution GenerallyPositive.RESTClient.WithUploadFiles ( GPALFile uploadPaths)

Sets the timeout in milliseconds.

Parameters
timeoutMsThe timeout in milliseconds
Returns

Implements GenerallyPositive.IAllowRESTWithUploadFilename.

Definition at line 852 of file RESTClient.cs.

◆ WithUrl()

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithUrl ( string url)

Sets the URL parameter.

Parameters
urlThe URL
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 489 of file RESTClient.cs.

◆ WithUrlFromResult() [1/2]

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithUrlFromResult ( int resultIndex)

Sets the URL from a result by index.

Parameters
resultIndexThe result index
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 501 of file RESTClient.cs.

◆ WithUrlFromResult() [2/2]

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithUrlFromResult ( string name)

Sets the URL from a result by name.

Parameters
nameThe result name
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 520 of file RESTClient.cs.

◆ WithValue()

IAllowRESTAttribute GenerallyPositive.RESTClient.WithValue ( string value)

Specifies the value for set operation client.SetAttribute("element123").WithAttribute("disabled").WithValue("true").Execute();.

Parameters
valueThe attribute value
Returns

Implements GenerallyPositive.IAllowRESTAttribute.

Definition at line 2716 of file RESTClient.cs.

◆ WithVerb()

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithVerb ( string method)

Sets the verb of the request being fetched. Not .WithHttpMethod, which is the verb of the REST call itself. GET when nothing was said. client.Fetch(url).WithVerb("POST").Execute();.

Parameters
methodHTTP verb for the fetched request
Returns

Implements GenerallyPositive.IAllowRestMethods.

Definition at line 2794 of file RESTClient.cs.

◆ WithVPixels()

IAllowRESTScrollElement GenerallyPositive.RESTClient.WithVPixels ( int vPixels)

Sets the vertical pixels parameter.

Parameters
vPixelsThe vertical pixels
Returns

Implements GenerallyPositive.IAllowRESTScrollElement.

Definition at line 2114 of file RESTClient.cs.

◆ WithVPixelsFromResult() [1/2]

IAllowRESTScrollElement GenerallyPositive.RESTClient.WithVPixelsFromResult ( int resultIndex)

Sets the vertical pixels from a result by index.

Parameters
resultIndexThe result index
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 2128 of file RESTClient.cs.

◆ WithVPixelsFromResult() [2/2]

IAllowRESTScrollElement GenerallyPositive.RESTClient.WithVPixelsFromResult ( string name)

Sets the vertical pixels from a result by name.

Parameters
nameThe result name
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 2147 of file RESTClient.cs.

◆ WithWindowId()

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithWindowId ( int windowId)

Sets the window ID parameter client.CloseWindow(123).Execute<WindowTuple>();.

Parameters
windowIdThe window ID
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 3765 of file RESTClient.cs.

◆ WithWindowIdFromResult() [1/2]

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithWindowIdFromResult ( int resultIndex)

Sets the window ID from a result by index client.GoToWindow().WithWindowIdFromResult(0).Execute<WindowTuple>();.

Parameters
resultIndexThe result index
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 3777 of file RESTClient.cs.

◆ WithWindowIdFromResult() [2/2]

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithWindowIdFromResult ( string name)

Sets the window ID from a result by name client.GoToWindow().WithWindowIdFromResult("windowResult").Execute<WindowTuple>();.

Parameters
nameThe result name
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 3796 of file RESTClient.cs.

◆ WithWorkflow()

IAllowRESTWorkflow GenerallyPositive.RESTClient.WithWorkflow ( Action< RESTClient > workflow)

Adds a workflow definition client.WithWorkflow(c => c.WithEndpoint(...).Execute()).While(...);.

Parameters
workflowThe workflow action
Returns

Implements GenerallyPositive.IAllowRESTWorkflow.

Definition at line 1757 of file RESTClient.cs.

◆ WithXPath()

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithXPath ( string xpath)

Sets the XPath parameter.

Parameters
xpathThe XPath
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 866 of file RESTClient.cs.

◆ WithXPathFromResult() [1/2]

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithXPathFromResult ( int resultIndex)

Sets the XPath from a result by index.

Parameters
resultIndexThe result index
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 880 of file RESTClient.cs.

◆ WithXPathFromResult() [2/2]

IAllowRESTParametersOrExecution GenerallyPositive.RESTClient.WithXPathFromResult ( string name)

Sets the XPath from a result by name.

Parameters
nameThe result name
Returns

Implements GenerallyPositive.IAllowRESTParametersOrExecution.

Definition at line 899 of file RESTClient.cs.

Property Documentation

◆ Name

string GenerallyPositive.RESTClient.Name
getset

Gets or sets the client name.

Implements GenerallyPositive.IRESTClient.

Definition at line 268 of file RESTClient.cs.

◆ RetryAfterSeconds

int GenerallyPositive.RESTClient.RetryAfterSeconds
get

The seconds the last call was asked to wait before asking again, zero when it was not asked.

Implements GenerallyPositive.IRESTClient.

Definition at line 76 of file RESTClient.cs.

◆ StatusCode

int GenerallyPositive.RESTClient.StatusCode
get

The HTTP status code the last call came back with.

Implements GenerallyPositive.IRESTClient.

Definition at line 71 of file RESTClient.cs.


The documentation for this class was generated from the following file: