Skip to content

[Bug]: Firefox can't record videos #565

@DasTapan09

Description

@DasTapan09

Environments

  • playwright-go Version: 0.5200.0
  • Browser: Firefox
  • OS and version: MacOS 15.6.1 Sequoia

Bug description

  • Playwright Go can't record videos of tests with Firefox
  • This fails only for Firefox with error video path error: Page did not produce any video frames
  • For Chromium and WebKit it successfully records in .webm format

To Reproduce

  • go install github.com/playwright-community/playwright-go/cmd/[email protected]
  • playwright install --with-deps
  • create scrapper.go
  • go run scrapper.go
Image
package main

import (
	"log"
	"time"

	"github.com/playwright-community/playwright-go"
)

func main() {
	pw, err := playwright.Run(&playwright.RunOptions{SkipInstallBrowsers: false})
	if err != nil {
		log.Fatalf("pw run: %v", err)
	}
	defer pw.Stop()

	browser, err := pw.Firefox.Launch(playwright.BrowserTypeLaunchOptions{
		Headless: playwright.Bool(false),
	})
	if err != nil {
		log.Fatalf("launch: %v", err)
	}
	size := playwright.Size{Width: 1280, Height: 720}
	rec := &playwright.RecordVideo{Dir: ".", Size: &size}

	ctx, err := browser.NewContext(playwright.BrowserNewContextOptions{
		RecordVideo: rec,
	})
	if err != nil {
		log.Fatalf("new context: %v", err)
	}

	page, err := ctx.NewPage()
	if err != nil {
		log.Fatalf("new page: %v", err)
	}

	page.Goto("http://saucedemo.com")
	time.Sleep(3 * time.Second)

	if err := ctx.Close(); err != nil {
		log.Fatalf("ctx close: %v", err)
	}

	if vp, err := page.Video().Path(); err == nil {
		log.Printf("video path: %s", vp)
	} else {
		log.Printf("video path error: %v", err)
	}
	browser.Close()
}

Binaries:

ls ~/Library/Caches/ms-playwright
       chromium_headless_shell-1169/       firefox-1482/
       chromium-1169/                      webkit-2158/
       ffmpeg-1011/

.zshrc:

export PATH="$PATH:$(go env GOBIN):$(go env GOPATH)/bin"

Metadata

Metadata

Assignees

No one assigned

    Labels

    p2-bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions