Tutorials

Tutorials

A Minimal OttoMagic Smoke Test

The smallest possible OttoMagic workflow: turn on the engine, launch a maximized Chrome browser, navigate, and close. Useful as a first check that OttoMagic is installed and wired up correctly before building anything more elaborate on top of it.

Automating a Desktop App: Notepad++

GPAL.Application drives Windows desktop applications the same way GPAL.Browser drives a browser: open the app, define selectors against its UI Automation tree, and chain actions like InsertFrom, AppendFrom, FillInFrom, and key combinations. This tutorial opens Notepad++, types and edits text, then hovers over a toolbar button and a menu item.

Automating a Login Flow with a Native Menu Selection

A common real-world pattern: before you can log in, you have to pick an option from a dropdown menu (like choosing which portal to log into), then fill in a username and password. This tutorial walks through clicking a native menu, selecting an option, filling in credentials, and using StealthLeftClick on the final submit button.

Automating Microsoft Teams with Desktop Application Selectors

Not every workflow lives in a browser. GPAL.Application launches a desktop executable, then drives it with the same Selector and fluent action model used for the browser - here, opening Microsoft Teams, clicking into a team, and sending a chat message.

Automating YouTube Studio: Navigating a Multi-Step Upload Dialog

YouTube Studio's video upload dialog is a multi-step wizard - details, monetization, visibility, and more - each step reached by clicking a tab and then interacting with that step's controls. This tutorial shows the selector-and-click pattern for moving through a wizard like this, plus attaching to a browser that's already running on a debug port.

Behavior-Style Workflows with GPAL.Gherkin

GPAL.Gherkin lets you write the same kind of workflow as tut-simple-scraper as a Given/When/And/Then scenario - each step is a plain method, no special syntax or test framework required. This tutorial rewrites the eBay search as a behavior spec and shows how steps with parameters work.

Building a Form: Controls, FillInFrom, and CallAfterFillIn

GPALForm lets you build a real Windows Form out of fluent GPAL control definitions, then drive it from a data file. This tutorial builds a small form with a label, buttons, radio buttons, and a checkbox, fills it from a GPALFile row by row with FillInFrom, pops up an approval dialog after each row via CallAfterFillIn, and shows the difference between Show() and ShowDialog().

Building a Live AI Summarizer Form

A small WinForms project (LiveAISummarizer) puts WithLiveInputFrom to work: type or paste text into one text area, and a summary appears in another a moment after you stop typing, with no button and no Execute() calls of your own.

Calling REST Endpoints with GPAL.RESTClient

GPAL.RESTClient gives you a fluent, chainable client for talking to any REST API - including GPAL's own OttoMagic browser-automation API. This tutorial drives a remote browser purely through REST calls: opening tabs, navigating, filling in forms, scrolling, and reading page state, all with the same With*/Execute pattern.

Casting a Tab or Desktop to a Network Device

CastTab and CastDesktop drive Chrome's built-in cast feature to send a tab or the whole desktop to a network device such as a smart TV, then StopCasting ends the session. The workflow also shows the common (IBrowser)/(Browser) cast pattern of looping over AutomationEngine and skipping engines that don't support a given feature.

Chaining Browser Actions Through GPAL.RESTClient with AndThen

GPAL.RESTClient is the general-purpose fluent REST client behind GPAL.OttoMagicClient. Point it at any API base, pick an ApiEndpoint, and chain calls together with AndThen<T>() - each step's result can be named and reused by a later step, building a multi-step browser workflow out of individual REST calls.

Chaining Workflows: CallAfterFillIn and CallIfFound Together

This tutorial links three Units of Work into one workflow: an input grid drives a search box, CallAfterFillIn reacts to each row by clicking search and finding result links, and CallIfFound opens each result to scrape details into a master grid. A persistent selector runs alongside to dismiss popups whenever they appear.

Clicking a Captcha with a GPALForm and Hardware Input

A small GPALForm with a single button kicks off an Application automation chain: open an app, find an image-matched captcha checkbox, and click it with simulated mouse movement. Shows how a desktop form can act as a manual trigger for a GPAL workflow.

Cross-Site Workflow: Find a Book, Then Search for It Elsewhere

A workflow that pulls a random, highly-rated book from one site, then opens a second site in a new tab to search for it and scrape the price. Covers persistent selectors for cookie/login popups, NewTab and CloseTab, and reacting to search results with CallIfFound and InElement.

Downloading and Patching a Browser Driver Automatically

Selenium-based engines need a matching driver executable (chromedriver, msedgedriver, geckodriver) on disk. This tutorial uses GPAL to detect the installed browser version, find the matching driver download on the vendor's release page, download it, and unzip the driver into your drivers folder.

Downloading Files with a Right-Click

Some links only offer a file when you right-click and choose Save Link As, rather than a normal left-click download. RightClickAndDownload drives that context-menu flow for you, and GPALFile.ReturnFilenames tells you exactly what landed on disk and where.

Drag and Drop with Image-Based Selectors

DragAndDrop performs a hardware-level drag from one element to another, using offsets and deltas to land precisely. This tutorial walks through closing a popup with LeftClick and then dragging a map element using a selector built from CSS, XPath, text, an image, and pixel offsets.

Driving a Browser Directly with PuppeteerClient

Under the high-level IBrowser fluent interface sits IPuppeteerClient - a thinner layer that exposes browser actions almost one-to-one with PuppeteerCommunicator's API. This tutorial gets an IPuppeteerClient from a browser, chains a few navigation and interaction calls with AndThen, and reads results back from individual calls.

Driving a Live Browser Through GPAL.OttoMagicClient

GPAL.OttoMagicClient is a ready-made IRESTClient wired to the OttoMagic REST API. Every browser action - navigation, clicks, scrolling, window management, storage, and more - is just an endpoint call away. This tutorial walks through opening tabs, driving the page, and reading results back with Execute<T>().

Driving a Search Box from a GPALFile of Search Terms

FillInFrom doesn't just take a string - point it at a GPALFile and GPAL treats each line as a token to type, run, and react to in turn. This tutorial searches a site once per line in a text file, using CallAfterFillIn to scrape and save results for each search term.

Driving a Search Form from a Database Table

InputDatabaseTest reads search terms from a SQL Server table with GPALDatabase, fills a search box with each row in turn using FillInFrom, and runs a full scrape-and-paginate workflow after every fill via CallAfterFillIn. It's the do-gpaldatabase pattern: let a table drive a repeated workflow instead of hardcoding values.

Driving Native Dropdown Menus with SelectClick

Standard HTML <select> dropdowns render as OS-level popups that scripted clicks often can't reach. This tutorial shows how to target an <option> with a hardware-emulated selector and use SelectClick to choose it directly or step through the list - next, previous, random, and wrap-around.

Driving Native Dropdowns with SelectClick

Native HTML select elements don't behave like ordinary clickable elements. SelectClick gives GPAL a vocabulary for them - left-click an option, jump to the next or previous option, wrap around at the ends, or pick at random - and WithHardware drives the dropdown the way a real user would, with actual OS-level input.

Driving the Browser Through the REST Client

GPAL.OttoMagicClient gives you the same browser actions as IBrowser, but expressed as REST calls against the OttoMagic engine - useful when the thing driving the browser isn't your C# process. This tutorial opens tabs, waits for the network to settle, and walks through Execute() versus the typed Execute<T>().

Dropping Down to PuppeteerCommunicator: Raw Chrome DevTools Commands

Underneath GPAL.Browser and PuppeteerClient sits PuppeteerCommunicator, a thin wrapper that sends raw Chrome DevTools Protocol (CDP) commands over a debug port. This tutorial shows how to reach it directly: launching a debug session, capturing screenshots, querying elements, and dispatching low-level mouse and keyboard events when the higher layers don't expose what you need.

Encryption, Hashing, and Signing with GPAL Cryptography

GPAL's Cryptography class wraps common .NET crypto operations - AES encryption in multiple modes, hashing, RSA signing and verification, and PBKDF2 key derivation - behind one fluent, chainable object. This tutorial walks through generating keys, encrypting and decrypting data, chaining encryption into hashing, and signing/verifying with RSA.

Filling In Special-Format Inputs: Color, Date, Time, and More

Modern HTML forms use specialized input types - color pickers, date/time pickers, week and month selectors - that each expect their own value format. This tutorial builds Selectors for a page full of these special-format inputs and drives them all in one chain with LeftClick and FillInFrom.

GPALConverter: Moving Data Between CSV, JSON, XML, YAML, and Classes

GPALConverter is GPAL's "anything in, anything out" data pipeline. WithInput accepts a file, a class instance, or a collection, and SaveTo writes it out as CSV, JSON, XML, YAML, HTML, or back into a typed object - all without writing format-specific parsing code yourself.

Handling Cookie Banners and Popups with Persistent Selectors

Cookie banners, newsletter popups, and other nags can appear at any point during a workflow, not just on the first page. WithPersistentSelector and PersistentCallIfFound register a selector and a callback that GPAL checks for on every navigation, so your main workflow can stay focused on the task at hand.

Image Matching and Selectors Inside Iframes

Two advanced selector techniques in one workflow: matching an element by a saved screenshot with WithImage and offsets, and reaching into nested iframes with InIframe before clicking an element that only exists inside the frame's own DOM.

Inside the GPAL REST API Server (OttoMagic's Backend)

GPALRestAPI is the local HTTP server that GPAL.OttoMagicClient talks to. It runs alongside a browser extension, listens on a local port, and translates REST calls into native-messaging commands the extension executes against the live browser. Understanding this server helps explain what's actually happening when your GPAL workflow calls .Execute().

Launching Chrome with a Real Browser Profile

WithProfileName tells GPAL to launch Chrome using one of your existing named profiles, so the browser opens already signed into whatever accounts that profile is logged into. This tutorial shows the minimal setup for a profile-based session and what to keep in mind when a real user profile is involved.

Layer-by-Layer: Click, Fill In, and Read

The same everyday operations - click an element, fill in a field, read a value - look different at each of GPAL's five layers. This tutorial walks Click and FillIn side by side across all five, then digs into Read: GPAL's GetGrid convenience, the UseAttribute selector setting that controls what GetGrid returns, and how reading a single attribute looks at each lower layer.

Left Click and Upload: Driving a File Picker

A short workflow that navigates to a page with a file upload widget, builds a GPALFile from a list of local paths, and uses LeftClickAndUpload to drive the native file picker dialog before clicking the upload button. Good first stop for any workflow that needs to attach files through a browser.

Left-Click and Download a File

A workflow that closes an ad nested inside an iframe using a persistent selector, then left-clicks a download link and saves the resulting PDF to disk. Covers GPALFile as a download target, LeftClickAndDownload, and persistent selectors for nags that can reappear at any time.

Logging to a Database and Sending Email with GPAL

GPAL.Logger can write log entries to a SQL database instead of a file, accepting plain strings, settings objects, and whole grids. GPAL.Mail sends email through a configured SMTP server with To, CC, and BCC recipients. Together they show how GPAL subsystems share the same fluent factory pattern across very different jobs.

Pacing a Workflow with WaitFor

Stepping through a native dropdown with SelectClick triggers real browser navigation between each choice. This tutorial uses that workflow to show where WaitFor belongs in a chain - right after the action that needs time to settle - and how it works whether or not WithSelector was just called.

Paging with Workflows: While and Until

WithWorkflow records a chain of AndThen calls as a repeatable block; While and Until run that block under a condition you control, and GetExecutionResults keeps every pass's named results so you can read them all back afterward - or feed one pass's result into the next pass's condition.

Reading, Writing, and Clearing Browser Storage

GPALUrl carries storage definitions - cookies, localStorage, sessionStorage, cache, and indexedDb - that you describe up front with WithStorageType and friends, then execute against the active browser with RunGet, RunSet, and RunDelete. This tutorial walks a cookie and a localStorage entry through a full get/set/delete cycle, then shows how the same verbs extend to indexedDb.

Reading, Writing, and Formatting Google Sheets

GPAL.GoogleSheets gives you a fluent client over the Google Sheets API: create spreadsheets and sheets, write and read grids of data, append/prepend/insert at specific cells, apply formatting, run sum and count calculations, and save results to a local file.

Recording and Replaying a Selector Sequence

OttoRecording captures a full search-click-scroll sequence as a chain of pre-built Selectors, then replays it against a live browser over a debug port. Each Selector carries multiple lookup strategies (CSS, XPath, value/text matches) recorded ahead of time, so the replay can fall back gracefully if one strategy stops matching.

Searching the Web with GPAL.GoogleDorking

GPAL.GoogleDorking wraps the Google Custom Search API behind a fluent query builder. This tutorial sets up credentials, builds a simple search, then layers on advanced operators like site restriction, file type, exact phrase, and date restriction, all returning results as a familiar IGPALGrid.

Talking to an OpenAPI-Described Service

If a service publishes an OpenAPI (Swagger) document, GPAL.RESTClient can load it directly and discover its endpoints for you. This short tutorial loads a spec, lists its endpoints, calls one, and pretty-prints the JSON response with GPAL.Converter.

Testing Stealth Against Anti-Bot Detection Sites

AntibotTester walks a list of bot-detection pages, captures a sequence of screenshots on each, and reacts to a few page-specific quirks along the way. It demonstrates nesting BrowserType and AutomationEngine loops with continue-based filtering, a global CallIfNotFound handler with an ignore list, and per-site conditional logic driven by UrlHelper.AreEquivalent.

Walking Sitemaps and Capturing Page Digests

GetSiteMapUrls walks a site's sitemap.xml so you can discover pages without hand-coding URLs, and GetHydratedData / GetLLMDigest pull structured and LLM-friendly summaries out of each page you visit. This tutorial crawls a sitemap, captures a modern framework's hydration data, and saves an LLM digest for every page using GPALFile.Next.

Working with Spreadsheets: GPAL.Excel End to End

GPAL.Excel turns Excel ranges, cells, rows, and columns into a fluent unit of work: read data out, run sums and counts, edit cell values, compare ranges against each other or against another file, and save results to a grid, a sheet, or a new file.

On this page


Tutorials
A Minimal OttoMagic Smoke Test
Automating a Desktop App: Notepad++
Automating a Login Flow with a Native Menu Selection
Automating Microsoft Teams with Desktop Application Selectors
Automating YouTube Studio: Navigating a Multi-Step Upload Dialog
Behavior-Style Workflows with GPAL.Gherkin
Building a Form: Controls, FillInFrom, and CallAfterFillIn
Building a Live AI Summarizer Form
Calling REST Endpoints with GPAL.RESTClient
Casting a Tab or Desktop to a Network Device
Chaining Browser Actions Through GPAL.RESTClient with AndThen
Chaining Workflows: CallAfterFillIn and CallIfFound Together
Clicking a Captcha with a GPALForm and Hardware Input
Cross-Site Workflow: Find a Book, Then Search for It Elsewhere
Downloading and Patching a Browser Driver Automatically
Downloading Files with a Right-Click
Drag and Drop with Image-Based Selectors
Driving a Browser Directly with PuppeteerClient
Driving a Live Browser Through GPAL.OttoMagicClient
Driving a Search Box from a GPALFile of Search Terms
Driving a Search Form from a Database Table
Driving Native Dropdown Menus with SelectClick
Driving Native Dropdowns with SelectClick
Driving the Browser Through the REST Client
Dropping Down to PuppeteerCommunicator: Raw Chrome DevTools Commands
Encryption, Hashing, and Signing with GPAL Cryptography
Filling In Special-Format Inputs: Color, Date, Time, and More
GPALConverter: Moving Data Between CSV, JSON, XML, YAML, and Classes
Handling Cookie Banners and Popups with Persistent Selectors
Image Matching and Selectors Inside Iframes
Inside the GPAL REST API Server (OttoMagic's Backend)
Launching Chrome with a Real Browser Profile
Layer-by-Layer: Click, Fill In, and Read
Left Click and Upload: Driving a File Picker
Left-Click and Download a File
Logging to a Database and Sending Email with GPAL
Pacing a Workflow with WaitFor
Paging with Workflows: While and Until
Reading, Writing, and Clearing Browser Storage
Reading, Writing, and Formatting Google Sheets
Recording and Replaying a Selector Sequence
Searching the Web with GPAL.GoogleDorking
Talking to an OpenAPI-Described Service
Testing Stealth Against Anti-Bot Detection Sites
Walking Sitemaps and Capturing Page Digests
Working with Spreadsheets: GPAL.Excel End to End