1
0
mirror of synced 2026-07-08 01:20:01 +00:00
Yury Semikhatsky 9d712e6f8c test: fix remaining windows bot failures
- accept all close-time error message variants in
  waitForNavigation-after-disconnect, the surfaced message depends on
  which call hits the closed connection first
- shouldDetachWhenPageCloses: only check that detach throws, like the
  upstream test
- skip @TempDir cleanup for user data dirs: on Windows Chromium 149
  keeps chrome_debug.log locked briefly after close
2026-06-12 13:20:30 -07:00
2024-11-18 17:01:09 -08:00
2026-06-12 12:56:46 -07:00
2020-09-25 11:15:33 -07:00
2020-09-25 11:15:33 -07:00
2020-09-25 11:15:33 -07:00
2026-03-23 13:58:14 -07:00
2020-09-25 11:15:33 -07:00
2024-08-28 11:09:38 -07:00

🎭 Playwright for Java

javadoc maven version Join Discord

Website | API reference

Playwright is a Java library to automate Chromium, Firefox and WebKit with a single API. Playwright is built to enable cross-browser web automation that is ever-green, capable, reliable and fast.

Linux macOS Windows
Chromium 149.0.7827.55
WebKit 26.5
Firefox 151.0

Documentation

https://playwright.dev/java/docs/intro

API Reference

https://playwright.dev/java/docs/api/class-playwright

Example

This code snippet navigates to Playwright homepage in Chromium, Firefox and WebKit, and saves 3 screenshots.

import com.microsoft.playwright.*;

import java.nio.file.Paths;
import java.util.Arrays;
import java.util.List;

public class PageScreenshot {
  public static void main(String[] args) {
    try (Playwright playwright = Playwright.create()) {
      List<BrowserType> browserTypes = Arrays.asList(
        playwright.chromium(),
        playwright.webkit(),
        playwright.firefox()
      );
      for (BrowserType browserType : browserTypes) {
        try (Browser browser = browserType.launch()) {
          BrowserContext context = browser.newContext();
          Page page = context.newPage();
          page.navigate("https://playwright.dev/");
          page.screenshot(new Page.ScreenshotOptions().setPath(Paths.get("screenshot-" + browserType.name() + ".png")));
        }
      }
    }
  }
}

Other languages

More comfortable in another programming language? Playwright is also available in

S
Description
Java version of the Playwright testing and automation library
Readme Apache-2.0 11 MiB
Languages
Java 98.1%
HTML 1.3%
Shell 0.5%
CSS 0.1%