Release Notes - v0.1.0¶
Initial release of the W3Pilot Client SDK.
Highlights¶
Go client for W3Pilot browser automation platform with full feature parity with JavaScript and Python clients.
This SDK provides a native Go interface to the W3Pilot browser automation platform, which uses the WebDriver BiDi protocol for bidirectional communication with the browser.
Features¶
Browser Control¶
Browser.Launch()- Launch browser with configurable options (headless, port, executable path)Launch()/LaunchHeadless()- Convenience functions for common launch patternsQuit()- Graceful browser shutdown
Navigation¶
Go(url)- Navigate to URL with automatic wait for page loadReload()- Reload current pageBack()/Forward()- Browser history navigationURL()/Title()- Get current page URL and titleWaitForNavigation()- Wait for navigation to complete
Element Interaction¶
Find(selector)- Find element by CSS selector with actionability waitsFindAll(selector)- Find all matching elementsMustFind(selector)- Find or panic (for concise test code)Click()- Click with automatic actionability checks (visible, stable, enabled)Type(text)- Type text with editability checksText()- Get element text contentGetAttribute(name)- Get element attribute valueBoundingBox()/Center()- Get element geometry
Screenshots & JavaScript¶
Screenshot()- Capture page as PNGEvaluate(script)- Execute JavaScript in page context
Debug Logging¶
- Set
W3PILOT_DEBUG=1to enable structured JSON logging via Go'sslogpackage
Installation¶
Prerequisites¶
The W3Pilot clicker binary is required. Set W3PILOT_CLICKER_PATH to point to the binary.
Quick Example¶
package main
import (
"context"
"log"
"github.com/agentplexus/w3pilot"
)
func main() {
ctx := context.Background()
pilot, err := w3pilot.Launch(ctx)
if err != nil {
log.Fatal(err)
}
defer pilot.Quit(ctx)
if err := pilot.Go(ctx, "https://example.com"); err != nil {
log.Fatal(err)
}
link, err := pilot.Find(ctx, "a", nil)
if err != nil {
log.Fatal(err)
}
if err := link.Click(ctx, nil); err != nil {
log.Fatal(err)
}
}
Feature Parity¶
| Feature | JS | Python | Go |
|---|---|---|---|
browser.Launch() |
✅ | ✅ | ✅ |
pilot.Go(url) |
✅ | ✅ | ✅ |
pilot.Screenshot() |
✅ | ✅ | ✅ |
pilot.Find(selector) |
✅ | ✅ | ✅ |
pilot.FindAll(selector) |
❌ | ❌ | ✅ |
pilot.Evaluate(script) |
✅ | ✅ | ✅ |
pilot.Reload() |
❌ | ❌ | ✅ |
pilot.Back() / pilot.Forward() |
❌ | ❌ | ✅ |
pilot.Quit() |
✅ | ✅ | ✅ |
element.Click() |
✅ | ✅ | ✅ |
element.Type(text) |
✅ | ✅ | ✅ |
element.Text() |
✅ | ✅ | ✅ |
element.GetAttribute() |
✅ | ✅ | ✅ |
element.BoundingBox() |
✅ | ✅ | ✅ |
| Actionability waits | ✅ | ✅ | ✅ |
| Debug logging | ✅ | ❌ | ✅ |