Skip to content

Test

Status: PASS (Go module resolution confirmed)

The chromedp Go module resolves and installs. There is no standalone binary or version flag; the test is module acquisition and build success.

What was tested

bash
cd /tmp/chromedp-test
go mod init chromedp-test
go get github.com/chromedp/chromedp@latest
go mod tidy

Actual output from go.mod:

require github.com/chromedp/chromedp v0.15.1

Module resolution succeeded. Version 0.15.1 confirmed.

What this test confirms

The Go module is publicly available and installs without error. Writing code against it and running go build succeeds.

What is required for actual browser automation

chromedp is a Go library, not a CLI. It requires:

  • A running Chrome or Chromium instance on $PATH
  • A Go project that imports and calls the library
  • No separate download step beyond go get

Smoke test procedure

Step 1: Initialize a module

bash
mkdir chromedp-smoke && cd chromedp-smoke
go mod init chromedp-smoke
go get github.com/chromedp/chromedp@latest
go mod tidy

Step 2: Create a minimal test program (save as main.go)

go
package main

import (
    "context"
    "fmt"
    "log"

    "github.com/chromedp/chromedp"
)

func main() {
    ctx, cancel := chromedp.NewContext(context.Background())
    defer cancel()

    var title string
    if err := chromedp.Run(ctx,
        chromedp.Navigate("https://example.com"),
        chromedp.Title(&title),
    ); err != nil {
        log.Fatal(err)
    }

    fmt.Println("Page title:", title)
}

Step 3: Run

bash
go run main.go

Expected output:

Page title: Example Domain

If Chrome is not installed:

exec: "google-chrome": executable file not found in $PATH

Install Chrome or Chromium for your OS and retry.

Note on test scope

Module resolution was confirmed. The go run main.go browser test was not executed because it requires Chrome installed in the test environment. The module acquisition step is the verifiable gate.