GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - microsoft/playwright-java: Java version of the Playwright testing and automation library

BranchesTags
Open more actions menu

Latest commit

 

History

1,023 Commits
1,023 Commits

Folders and files

NameName
Last commit message
Last commit date
.azure-pipelines
.azure-pipelines
 
 
.claude/skills
.claude/skills
 
 
.devcontainer
.devcontainer
 
 
.github
.github
 
 
driver-bundle
driver-bundle
 
 
driver
driver
 
 
examples
examples
 
 
playwright
playwright
 
 
scripts
scripts
 
 
tools
tools
 
 
utils/docker
utils/docker
 
 
.editorconfig
.editorconfig
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
AGENTS.md
AGENTS.md
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
CodeQL.yml
CodeQL.yml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
ROLLING.md
ROLLING.md
 
 
SECURITY.md
SECURITY.md
 
 
SUPPORT.md
SUPPORT.md
 
 
pom.xml
pom.xml
 
 

Repository files navigation

🎭 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 158.0.8127.18 ✅ ✅ ✅
WebKit 27.2 ✅ ✅ ✅
Firefox 159.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

  • Node.js (JavaScript / TypeScript),
  • Python.
  • .NET,

About

Java version of the Playwright testing and automation library

playwright.dev/java/

Topics

javaplaywright

Resources

Readme
Apache-2.0 license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

1.6k stars

Watchers

34 watching

Forks

304 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.