Playwright is a Java library to automate Chromium, Firefox and WebKit with a single API.

Overview

🎭 Playwright for Java

javadoc maven version Sonatype Nexus (Snapshots) Join Slack

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 90.0.4430.0
WebKit 14.2
Firefox 87.0b10

Headless execution is supported for all the browsers on all platforms. Check out system requirements for details.

Usage

Playwright requires Java 8 or newer.

Add Maven dependency

Playwright is distributed as a set of Maven modules. The easiest way to use it is to add one dependency to your Maven pom.xml file as described below. If you're not familiar with Maven please refer to its documentation.

To run Playwright simply add following dependency to your Maven project:

<dependency>
  <groupId>com.microsoft.playwrightgroupId>
  <artifactId>playwrightartifactId>
  <version>1.10.0version>
dependency>

Is Playwright thread-safe?

No, Playwright is not thread safe, i.e. all its methods as well as methods on all objects created by it (such as BrowserContext, Browser, Page etc.) are expected to be called on the same thread where Playwright object was created or proper synchronization should be implemented to ensure only one thread calls Playwright methods at any given time. Having said that it's okay to create multiple Playwright instances each on its own thread.

Examples

You can find Maven project with the examples here.

Page screenshot

This code snippet navigates to whatsmyuseragent.org 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("http://whatsmyuseragent.org/");
          page.screenshot(new Page.ScreenshotOptions().setPath(Paths.get("screenshot-" + browserType.name() + ".png")));
        }
      }
    }
  }
}

Mobile and geolocation

This snippet emulates Mobile Chromium on a device at a given geolocation, navigates to openstreetmap.org, performs action and takes a screenshot.

import com.microsoft.playwright.options.*;
import com.microsoft.playwright.*;

import java.nio.file.Paths;

import static java.util.Arrays.asList;

public class MobileAndGeolocation {
  public static void main(String[] args) {
    try (Playwright playwright = Playwright.create()) {
      Browser browser = playwright.chromium().launch();
      BrowserContext context = browser.newContext(new Browser.NewContextOptions()
        .setUserAgent("Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36")
        .setViewportSize(411, 731)
        .setDeviceScaleFactor(2.625)
        .setIsMobile(true)
        .setHasTouch(true)
        .setLocale("en-US")
        .setGeolocation(41.889938, 12.492507)
        .setPermissions(asList("geolocation")));
      Page page = context.newPage();
      page.navigate("https://www.openstreetmap.org/");
      page.click("a[data-original-title=\"Show My Location\"]");
      page.screenshot(new Page.ScreenshotOptions().setPath(Paths.get("colosseum-pixel2.png")));
    }
  }
}

Evaluate JavaScript in browser

This code snippet navigates to example.com in Firefox, and executes a script in the page context.

import com.microsoft.playwright.*;

public class EvaluateInBrowserContext {
  public static void main(String[] args) {
    try (Playwright playwright = Playwright.create()) {
      Browser browser = playwright.firefox().launch();
      BrowserContext context = browser.newContext();
      Page page = context.newPage();
      page.navigate("https://www.example.com/");
      Object dimensions = page.evaluate("() => {\n" +
        "  return {\n" +
        "      width: document.documentElement.clientWidth,\n" +
        "      height: document.documentElement.clientHeight,\n" +
        "      deviceScaleFactor: window.devicePixelRatio\n" +
        "  }\n" +
        "}");
      System.out.println(dimensions);
    }
  }
}

Intercept network requests

This code snippet sets up request routing for a WebKit page to log all network requests.

import com.microsoft.playwright.*;

public class InterceptNetworkRequests {
  public static void main(String[] args) {
    try (Playwright playwright = Playwright.create()) {
      Browser browser = playwright.webkit().launch();
      BrowserContext context = browser.newContext();
      Page page = context.newPage();
      page.route("**", route -> {
        System.out.println(route.request().url());
        route.resume();
      });
      page.navigate("http://todomvc.com");
    }
  }
}

Documentation

Check out our new documentation site!.

You can also browse javadoc online.

Contributing

Follow the instructions to build the project from source and install the driver.

Is Playwright for Java ready?

Yes, Playwright for Java is ready. v1.10.0 is the first stable release. Going forward we will adhere to semantic versioning of the API.

Comments
  • [Question] what is the reason when the

    [Question] what is the reason when the "Browser.close" message was sent, but never received a response message back?

    image

    image

    T runUntil(Runnable code, Waitable waitable) { try { code.run(); while (!waitable.isDone()) { connection.processOneMessage(); } return waitable.get(); } finally { waitable.dispose(); } }

    ->> waitable.isDone() always return not done (null message in polling). Is there specific reason? It goes on forever (infinite loop). Can we have time out?

    triaging 
    opened by ephung01 59
  • [Question]  Search element inside frame

    [Question] Search element inside frame

    One of the issue I have encountered is when I switch to the frame and try to query element inside, it got stuck (when I have multiple frames). I build a test to see if it is working and encounter different issue; inside frames are empty (see pix). Can you please check, may be I did something wrong?

    Here is my test @Test void shouldFindInsideFrame() { page.setContent("Testing

    "); assertEquals(3, page.frames().size());

    // Test Frame 1
    ElementHandle iframeElement1 = page.querySelector("id=abc");
    Frame frame1 = iframeElement1.contentFrame();
    Object text = frame1.evalOnSelector("div", "e => e.text");
    assertEquals("Hi, I'm in frame1", text);
    
    // Test Frame 2
    ElementHandle iframeElement2 = page.querySelector("id=def");
    Frame frame2 = iframeElement2.contentFrame();
    Object text2 = frame2.evalOnSelector("div", "e => e.text");
    assertEquals("Hi, I'm in frame2", text2);
    

    }

    image

    triaging 
    opened by ephung01 39
  • [Question] StackOverflowError: com.google.gson.internal loop error

    [Question] StackOverflowError: com.google.gson.internal loop error

    Hi, im testing the playwright-java maven plugin, the version 0.180.0, with JDK 1.8 and maven project in java 1.8. I have a loop error trying the example test PageScreenshot

    This is the loop error:

    Exception in thread "main" java.lang.StackOverflowError
    	at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:378)
    	at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:383)
    
           // + 750 times loop code
    
    	at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:358)
    	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:158)
    	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100)
    	at com.google.gson.Gson.getAdapter(Gson.java:423)
    	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115)
    	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164)
    	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100)
    	at com.google.gson.Gson.getAdapter(Gson.java:423)
    	// + 250 times loop code
    	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115)
    	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164)
    	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:100)
    	at com.google.gson.Gson.getAdapter(Gson.java:423)
    	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:115)
    	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:164)
    

    How can I solve this? Thanks everyone for your help

    opened by Katakurinna 28
  • [BUG] java.lang.RuntimeException: Failed to create driver

    [BUG] java.lang.RuntimeException: Failed to create driver

    Context:

    • Playwright Version: 1.17.2
    • Operating System: [e.g. Windows]
    • Browser: [Chrome]
    • Extra: standalone Selenium Grid 4 is set up in a windows remote machine. Getting below error while running testcase through standalone selenium grid 4(created in a remote windows machine) playwright version used 1.17.2
    [INFO] Running org.example.AppTest
    java.lang.RuntimeException: Failed to create driver
    	at com.microsoft.playwright.impl.Driver.ensureDriverInstalled(Driver.java:54)
    	at com.microsoft.playwright.impl.PlaywrightImpl.create(PlaywrightImpl.java:39)
    	at com.microsoft.playwright.Playwright.create(Playwright.java:92)
    

    code snippet

    public void shouldAnswerWithTrue()
    {
        List<String> list=new ArrayList<String>();
        list.add("--start-maximized");
        Map<String, String> env = new HashMap<>();
        env.put("SELENIUM_REMOTE_URL", "http://testing.net.int:4444/");
        try(Playwright playwright = Playwright.create(new Playwright.CreateOptions().setEnv(env))){
            Browser browser = playwright.chromium().launch(new BrowserType.LaunchOptions().setHeadless(false).setSlowMo(100).setArgs(list));
            BrowserContext browserContext = browser.newContext();
            Page page = browserContext.newPage();
        }
        catch (Exception e) {
                e.printStackTrace();
            }
    }
    
    triaging 
    opened by satya081 23
  • [Question]Exception : com.microsoft.playwright.PlaywrightException: Failed to read message from driver, pipe closed. Skipping browsers download because `PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD` env variable is set.

    [Question]Exception : com.microsoft.playwright.PlaywrightException: Failed to read message from driver, pipe closed. Skipping browsers download because `PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD` env variable is set.

    Hi Team,

    Getting the below exception .

    com.microsoft.playwright.PlaywrightException: Failed to read message from driver, pipe closed. Skipping browsers download because PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD env variable is set. i'm running the test in playwright docker img via jenkins.

    Playwright version:1.14.1 JDK : 1.8.0_275 Maven: 3.6.3 Chromium : 86.0.4240.111

    triaging 
    opened by agaramudhala 23
  • Working with 1.18 with 2 playwrights when the 2 object gets closed it throws HeapSpace

    Working with 1.18 with 2 playwrights when the 2 object gets closed it throws HeapSpace

    Here is the info

    https://stackoverflow.com/questions/71242763/java-playwright-throws-java-lang-outofmemoryerror-java-heap-space-closing-a-pla?noredirect=1

    And when we connect to a wsEndPoint the problem arises when we try to close Page and Browser objects but not with Playwright object as you can see here.

    20:39:13.279 [Thread-16] WARN  c.p.h.HeadlessBrowserConfig$DataPerThread.close(219) - Closing [PageImpl] object:[838546035].
    java.io.IOException: Stream closed
    	at java.lang.ProcessBuilder$NullOutputStream.write(ProcessBuilder.java:433)
    	at java.io.OutputStream.write(OutputStream.java:116)
    	at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    	at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    	at com.microsoft.playwright.impl.WriterThread.run(PipeTransport.java:167)
    java.io.IOException: Stream closed
    	at java.lang.ProcessBuilder$NullOutputStream.write(ProcessBuilder.java:433)
    	at java.io.OutputStream.write(OutputStream.java:116)
    	at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    	at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    	at java.io.FilterOutputStream.close(FilterOutputStream.java:158)
    	at com.microsoft.playwright.impl.PipeTransport.close(PipeTransport.java:93)
    	at com.microsoft.playwright.impl.PipeTransport.poll(PipeTransport.java:71)
    	at com.microsoft.playwright.impl.Connection.processOneMessage(Connection.java:159)
    	at com.microsoft.playwright.impl.ChannelOwner.runUntil(ChannelOwner.java:101)
    	at com.microsoft.playwright.impl.Connection.sendMessage(Connection.java:107)
    	at com.microsoft.playwright.impl.ChannelOwner.sendMessage(ChannelOwner.java:94)
    	at com.microsoft.playwright.impl.JsonPipe.send(JsonPipe.java:46)
    	at com.microsoft.playwright.impl.Connection.internalSendMessage(Connection.java:135)
    	at com.microsoft.playwright.impl.Connection.sendMessageAsync(Connection.java:111)
    	at com.microsoft.playwright.impl.Connection.sendMessage(Connection.java:107)
    	at com.microsoft.playwright.impl.ChannelOwner.sendMessage(ChannelOwner.java:94)
    	at com.microsoft.playwright.impl.PageImpl.close(PageImpl.java:547)
    	at com.microsoft.playwright.Page.close(Page.java:3237)
    20:39:13.321 [Thread-16] WARN  c.p.h.HeadlessBrowserConfig$DataPerThread.close(223) - Exception [Failed to read message from driver, pipe closed.]Closing [PageImpl] object:[838546035].
    
    
    triaging 
    opened by cortizcuellar 20
  • [Bug] Wait for file chooser event is not working

    [Bug] Wait for file chooser event is not working

    I am trying the following

            Playwright playwright = Playwright.create();
            Browser browser = playwright.chromium().launch(new BrowserType.LaunchOptions()
                    .setHeadless(false));
            BrowserContext context = browser.newContext();
            Page page = context.newPage();
            page.navigate("some url");
    
            page.type("//input[@name='email']", "username");
            page.type("//input[@name='password']", "password");
            page.click("//button[@type='submit']");
    
            FileChooser fileChooser = page.waitForFileChooser(() -> {
                page.click("#file");
            });
    
            fileChooser.setFiles(Path.of("./upload_findings.csv"));
    

    File chooser is opened but Exception in thread "main" com.microsoft.playwright.TimeoutError: Timeout 30000ms exceeded is thrown at page.waitForFileChooser. Timeout is enough, it waits but throws in the end.

    I tried the same with js playwright and it is working fine.

    opened by Kremliovskyi 20
  • [Question] FullPageScreenshot is not capturing the full page

    [Question] FullPageScreenshot is not capturing the full page

    Hi - I have the following script to capture the full page screenshot

    @Test
        public void googleTest(){
           Playwright playwright = Playwright.create();
            BrowserType.LaunchOptions launchOptions = new BrowserType.LaunchOptions();
            launchOptions.setHeadless(false)
                    .setChannel(BrowserChannel.CHROME);
            Browser browser = playwright.chromium().launch(launchOptions);
            BrowserContext browserContext = browser.newContext();
            Page page = browserContext.newPage();
            page.navigate("https://google.com");
            page.click("text=I agree");
            System.out.println(page.title());
            page.screenshot(new Page.ScreenshotOptions()
                    .setPath(Paths.get("colosseum-pixel2.png"))
                    .setFullPage(true)
            );
    
        }
    

    The script runs fine and it takes the screenshot at the end. But the screenshot is not full page. Please refer attached the screenshot.

    Screenshot-Taken-By-Playwright

    I am running this script using Playwright 1.10.0 OS - Ubuntu 20.04.2

    triaging 
    opened by senthilkumar10 18
  • Playwright Java - is there a way to use system node version ?

    Playwright Java - is there a way to use system node version ?

    Playwright.create() is failing as it is installing the node.exe in the temp directory which the user is not allowed to run. Is there a way not to use this temp path and use system node js installed in program files

    image

    triaging 
    opened by mEklavya 16
  • [BUG] Can't run in Springboot  application

    [BUG] Can't run in Springboot application

    When I use spring-boot-maven-plugin to build a jar and use java -jar demo.jar, it dosen't run and throws exception.

    java.nio.file.NoSuchFileException: /BOOT-INF/lib/driver-bundle-0.180.0.jar!/driver/win32_x64 at com.sun.nio.zipfs.ZipPath.getAttributes(ZipPath.java:666) at com.sun.nio.zipfs.ZipFileSystemProvider.readAttributes(ZipFileSystemProvider.java:294) at java.nio.file.Files.readAttributes(Unknown Source) at java.nio.file.FileTreeWalker.getAttributes(Unknown Source) at java.nio.file.FileTreeWalker.visit(Unknown Source) at java.nio.file.FileTreeWalker.walk(Unknown Source) at java.nio.file.FileTreeIterator.(Unknown Source) at java.nio.file.Files.walk(Unknown Source) at java.nio.file.Files.walk(Unknown Source) at com.microsoft.playwright.impl.DriverJar.extractDriverToTempDir(DriverJar.java:58) at com.microsoft.playwright.impl.DriverJar.(DriverJar.java:18) ... 17 more

    opened by cyrly97 16
  • Temporary Files

    Temporary Files

    Using Playwright 1.25 for java on Windows with the Firefox driver. Using a 1.8 JVM

    Seeing lots of temp files leftover: temp_file_dir

    Why? And is there a way to delete them before my Playwright application ends?

    Thanks

    opened by jschlade 15
  • [Question] Is it possible to load only one locator of a page?

    [Question] Is it possible to load only one locator of a page?

    Hello!

    I am creating an application and I need to check only one locator, the website has no API and therefore I cannot do it otherwise, my question is the following:

    Is it possible to load only one locator when I navigate to an url? How? Would it make the page load faster?

    Perhaps disabling page styles would help improve performance as well.

    This is the only way I can think of to improve the performance of my application.

    Thank you!

    opened by NICOGTZL 0
  • [BUG] Playwright 1.29.0 is not yet available on Maven Central

    [BUG] Playwright 1.29.0 is not yet available on Maven Central

    Context:

    Playwright 1.29.0 is not yet available on Maven Central, latest version available right now is 1.28.1 released Nov 29, 2022

    That cause compilation issues while following the Getting Started, Installation, Usage section here. The page is referencing the 1.29.0 version in the pom.xml

    A temporal solution is using 1.28.1

    https://mvnrepository.com/artifact/com.microsoft.playwright/playwright

    image

    Code Snippet

        <dependency>
          <groupId>com.microsoft.playwright</groupId>
          <artifactId>playwright</artifactId>
          <version>1.29.0</version>
        </dependency>
    

    Describe the bug

    Missing artifact com.microsoft.playwright:playwright:jar:1.29Java(0)

    opened by emecas 0
  • Wrong version in the getting started guide

    Wrong version in the getting started guide

    The "Getting started" guide is referencing a version that hasn't been released: https://playwright.dev/java/docs/intro

    com.microsoft.playwright playwright 1.29.0

    Latest version on https://repo.maven.apache.org/maven2/com/microsoft/playwright/playwright/ is version 1.28.1

    opened by mattiaskagstrom 1
  • [Ports]: Backport client side changes

    [Ports]: Backport client side changes

    Please backport client side changes:

    • [x] https://github.com/microsoft/playwright/commit/4e58b0c2eafa5976abd03e91aa52d7164a9a0855 (chore: render timed out error message when expect timeouts (#18863))
    • [x] https://github.com/microsoft/playwright/commit/5ac426b3d5d45bd1f7092445d04b99e39b76d700 (chore: expose utility script to inner evaluates (#19147))
    • [x] https://github.com/microsoft/playwright/commit/f0e8d8f0744b4ba431a599abaa3999aff760cd85 (feat(api): introduce route.fetch and route.fulfill(json) (#19184))
    • [x] https://github.com/microsoft/playwright/commit/7aa3935dcce55a892f9f2b5982f2db048c1c889f (chore: match selected options by both value and label (#19316))
    • [x] https://github.com/microsoft/playwright/commit/256e9fd443c0e67dc6a42d3f1e0c40680dc7a5f1 (feat(connect): allow exposing local network to the remote browser (experimental) (#19372))
    • [x] https://github.com/microsoft/playwright/commit/6cadc56ea3783eac501f60dbfb4cfd42062c1f98 (feat(api): allow getByTestId(regex) (#19419))
    • [x] https://github.com/microsoft/playwright/commit/d1559a0fcc6ecd12bf6bacd3f66d848ea78aaa3a (chore: route.fetch(postData) (#19436))
    • [x] https://github.com/microsoft/playwright/commit/17a00744593adb6948b788b971f339901ac05c9e (feat(api): introduce Locator.all, enumerate (#19461))
    • [x] https://github.com/microsoft/playwright/commit/0e2732decfb511a6d625f66deae2fac760c6d87e (feat(api): introduce expect().toPass (#19463))
    • [x] https://github.com/microsoft/playwright/commit/3afd83c8cce5b036ad93b0dca188e8a5bd59abbf (chore: withdraw locator.enumerate (#19484))
    • [x] https://github.com/microsoft/playwright/commit/3f333a8ef72c2a81ed63e15764863be51f22b333 (chore: simplify post_data processing (#19490))
    • [ ] https://github.com/microsoft/playwright/commit/412c11db208da0543137ac781e775578a72eaece (fix(reuse): make sure all dispose and close sequences are executed (#19572))
    • [ ] https://github.com/microsoft/playwright/commit/d7e7cab44a28cf46e99fd9a0902a054e9088183e (fix: properly handle negated timed-out toPass matcher (#19580))
    • [ ] https://github.com/microsoft/playwright/commit/95cc5c2a2e74bfa3437dea26395c661238876974 (fix(electron): fix the directory app path (#19601))
    • [ ] https://github.com/microsoft/playwright/commit/fe989d95eb709ff436d4cace44d66acc6950abde (chore(electron): move loader to be preload (#19650))
    • [ ] https://github.com/microsoft/playwright/commit/3883799d68e165567d7ea6a8636ce7c88cddbc99 (feat: introduce locator.viewportRatio (#19761))
    • [ ] https://github.com/microsoft/playwright/commit/1afa38d5a7a8255eb4bd6e9deeea04911cf26304 (chore(expect): extract polling from expect.poll and expect().toPass (#19882))
    • [ ] https://github.com/microsoft/playwright/commit/10ccfa95173f80574ce4dfd8570204e88169e30e (feat(fetch): happy eyeballs (#19902))
    • [ ] https://github.com/microsoft/playwright/commit/31a63b5c2a750d8fb3d7d2184ea098f0604b1cc7 (fix(reuse): make reuse work with tracing (#19733))
    • [ ] https://github.com/microsoft/playwright/commit/2a49c5e4986c2d5bc570e9199b0688c70ac48336 (feat(expect): introduce expect(locator).toIntersectViewport() (#19901))
    opened by playwrightmachine 0
  • [Feature]  Visual comparisons port to java library

    [Feature] Visual comparisons port to java library

    Playwright node.js already has "Visual comparisons" functionality which can be used for visual regression testing, we need the same in playwright java library as well.

    image P3-collecting-feedback 
    opened by kabhinav26 5
Releases(v1.28.1)
  • v1.28.1(Nov 29, 2022)

    Highlights

    This patch release includes the following bug fixes:

    https://github.com/microsoft/playwright-java/issues/1130 - [Bug] Chaining Locator.getByRole() returns null https://github.com/microsoft/playwright/issues/18920 - [BUG] [expanded=false] in role selector returns elements without aria-expanded attribute

    Browser Versions

    • Chromium 108.0.5359.29
    • Mozilla Firefox 106.0
    • WebKit 16.4

    This version was also tested against the following stable channels:

    • Google Chrome 107
    • Microsoft Edge 107
    Source code(tar.gz)
    Source code(zip)
  • v1.28.0(Nov 16, 2022)

  • v1.27.1(Oct 12, 2022)

    Highlights

    This patch release includes the following bug fixes:

    https://github.com/microsoft/playwright/pull/18010 - fix(generator): generate nice locators for arbitrary selectors https://github.com/microsoft/playwright/issues/17955 - [Question] Github Actions test compatibility check failed mitigation? https://github.com/microsoft/playwright/pull/17952 - fix: fix typo in treeitem role typing

    Browser Versions

    • Chromium 107.0.5304.18
    • Mozilla Firefox 105.0.1
    • WebKit 16.0

    This version was also tested against the following stable channels:

    • Google Chrome 106
    • Microsoft Edge 106
    Source code(tar.gz)
    Source code(zip)
  • v1.27.0(Oct 8, 2022)

    Highlights

    Locators

    With these new APIs writing locators is a joy:

    page.getByLabel("User Name").fill("John");
    
    page.getByLabel("Password").fill("secret-password");
    
    page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Sign in")).click();
    
    assertThat(page.getByText("Welcome, John!")).isVisible();
    

    All the same methods are also available on Locator, FrameLocator and Frame classes.

    Other highlights

    • As announced in v1.25, Ubuntu 18 will not be supported as of Dec 2022. In addition to that, there will be no WebKit updates on Ubuntu 18 starting from the next Playwright release.

    Behavior Changes

    • expect(locator).hasAttribute(name, value, options) with an empty value does not match missing attribute anymore. For example, the following snippet will succeed when button does not have a disabled attribute.

      assertThat(page.getByRole(AriaRole.BUTTON)).hasAttribute("disabled", "");
      

    Browser Versions

    • Chromium 107.0.5304.18
    • Mozilla Firefox 105.0.1
    • WebKit 16.0

    This version was also tested against the following stable channels:

    • Google Chrome 106
    • Microsoft Edge 106
    Source code(tar.gz)
    Source code(zip)
  • v1.26.1(Sep 28, 2022)

    Highlights

    This patch includes the following bug fixes (they were reported in Playwright Python but manifested themselves in Java too):

    https://github.com/microsoft/playwright-python/issues/1561 - [Question]: 'c:\Users\ASUS' is not recognized as an internal or external command, operable program or batch file. https://github.com/microsoft/playwright-python/issues/1565 - [BUG] AttributeError: 'PlaywrightContextManager' object has no attribute '_playwright

    Browser Versions

    • Chromium 106.0.5249.30
    • Mozilla Firefox 104.0
    • WebKit 16.0

    This version was also tested against the following stable channels:

    • Google Chrome 105
    • Microsoft Edge 105
    Source code(tar.gz)
    Source code(zip)
  • v1.26.0(Sep 20, 2022)

    Highlights

    Assertions

    Other highlights

    Behavior Change

    A bunch of Playwright APIs already support the setWaitUntil(WaitUntilState.DOMCONTENTLOADED) option. For example:

    page.navigate("https://playwright.dev", new Page.NavigateOptions().setWaitUntil(WaitUntilState.DOMCONTENTLOADED));
    

    Prior to 1.26, this would wait for all iframes to fire the DOMContentLoaded event.

    To align with web specification, the WaitUntilState.DOMCONTENTLOADED value only waits for the target frame to fire the 'DOMContentLoaded' event. Use setWaitUntil(WaitUntilState.LOAD) to wait for all iframes.

    Browser Versions

    • Chromium 106.0.5249.30
    • Mozilla Firefox 104.0
    • WebKit 16.0

    This version was also tested against the following stable channels:

    • Google Chrome 105
    • Microsoft Edge 105
    Source code(tar.gz)
    Source code(zip)
  • v1.25.0(Aug 15, 2022)

    New APIs & changes

    Announcements

    • 🪦 This is the last release with macOS 10.15 support (deprecated as of 1.21).
    • ⚠️ Ubuntu 18 is now deprecated and will not be supported as of Dec 2022.

    Browser Versions

    • Chromium 105.0.5195.19
    • Mozilla Firefox 103.0
    • WebKit 16.0

    This version was also tested against the following stable channels:

    • Google Chrome 104
    • Microsoft Edge 104
    Source code(tar.gz)
    Source code(zip)
  • v1.24.1(Jul 26, 2022)

    Highlights

    This patch includes the following bug fix:

    https://github.com/microsoft/playwright/issues/15932 - [BUG] - Install MS Edge on CI Fails

    Browser Versions

    • Chromium 104.0.5112.48
    • Mozilla Firefox 102.0
    • WebKit 16.0

    This version was also tested against the following stable channels:

    • Google Chrome 103
    • Microsoft Edge 103
    Source code(tar.gz)
    Source code(zip)
  • v1.24.0(Jul 25, 2022)

    Highlights

    🐂 Debian 11 Bullseye Support

    Playwright now supports Debian 11 Bullseye on x86_64 for Chromium, Firefox and WebKit. Let us know if you encounter any issues!

    Linux support looks like this:

    | | Ubuntu 18.04 | Ubuntu 20.04 | Ubuntu 22.04 | Debian 11 | :--- | :---: | :---: | :---: | :---: | | Chromium | ✅ | ✅ | ✅ | ✅ | | WebKit | ✅ | ✅ | ✅ | ✅ | | Firefox | ✅ | ✅ | ✅ | ✅ |

    Browser Versions

    • Chromium 104.0.5112.48
    • Mozilla Firefox 102.0
    • WebKit 16.0

    This version was also tested against the following stable channels:

    • Google Chrome 103
    • Microsoft Edge 103
    Source code(tar.gz)
    Source code(zip)
  • v1.23.0(Jun 30, 2022)

    Highlights

    Network Replay

    Now you can record network traffic into a HAR file and re-use this traffic in your tests.

    To record network into HAR file:

    mvn exec:java -e -Dexec.mainClass=com.microsoft.playwright.CLI -Dexec.args="open --save-har=example.har --save-har-glob='**/api/**' https://example.com"
    

    Alternatively, you can record HAR programmatically:

    BrowserContext context = browser.newContext(new Browser.NewContextOptions()
        .setRecordHarPath(Paths.get("example.har"))
        .setRecordHarUrlFilter("**/api/**"));
    
    // ... Perform actions ...
    
    // Close context to ensure HAR is saved to disk.
    context.close();
    

    Use the new methods page.routeFromHAR() or browserContext.routeFromHAR() to serve matching responses from the HAR file:

    context.routeFromHAR(Paths.get("example.har"));
    

    Read more in our documentation.

    Advanced Routing

    You can now use route.fallback() to defer routing to other handlers.

    Consider the following example:

    // Remove a header from all requests.
    page.route("**/*", route -> {
      Map<String, String> headers = new HashMap<>(route.request().headers());
      headers.remove("X-Secret");
      route.resume(new Route.ResumeOptions().setHeaders(headers));
    });
    
    // Abort all images.
    page.route("**/*", route -> {
      if ("image".equals(route.request().resourceType()))
        route.abort();
      else
        route.fallback();
    });
    

    Note that the new methods page.routeFromHAR() and browserContext.routeFromHAR()also participate in routing and could be deferred to.

    Web-First Assertions Update

    Miscellaneous

    • If there's a service worker that's in your way, you can now easily disable it with a new context option serviceWorkers:
      BrowserContext context = browser.newContext(new Browser.NewContextOptions()
          .setServiceWorkers(ServiceWorkerPolicy.BLOCK));
      
    • Using .zip path for recordHar context option automatically zips the resulting HAR:
      BrowserContext context = browser.newContext(new Browser.NewContextOptions()
          .setRecordHarPath(Paths.get("example.har.zip")));
      
    • If you intend to edit HAR by hand, consider using the "minimal" HAR recording mode that only records information that is essential for replaying:
      BrowserContext context = browser.newContext(new Browser.NewContextOptions()
          .setRecordHarPath(Paths.get("example.har.zip"))
          .setRecordHarMode(HarMode.MINIMAL));
      
    • Playwright now runs on Ubuntu 22 amd64 and Ubuntu 22 arm64.
    Source code(tar.gz)
    Source code(zip)
  • v1.22.0(May 13, 2022)

    Highlights

    • Role selectors that allow selecting elements by their ARIA role, ARIA attributes and accessible name.

      // Click a button with accessible name "log in"
      page.click("role=button[name='log in']")
      

      Read more in our documentation.

    • New locator.filter([options]) API to filter an existing locator

      Locator buttonsLocator = page.locator("role=button");
      // ...
      Locator submitButton = buttonsLocator.filter(new Locator.FilterOptions().setHasText("Submit"));
      submitButton.click();
      
    • Playwright for Java now supports Ubuntu 20.04 ARM64 and Apple M1. You can now run Playwright for Java tests on Apple M1, inside Docker on Apple M1, and on Raspberry Pi.

    Browser Versions

    • Chromium 102.0.5005.40
    • Mozilla Firefox 99.0.1
    • WebKit 15.4

    This version was also tested against the following stable channels:

    • Google Chrome 101
    • Microsoft Edge 101
    Source code(tar.gz)
    Source code(zip)
  • v1.21.0(Apr 12, 2022)

    Highlights

    • New experimental role selectors that allow selecting elements by their ARIA role, ARIA attributes and accessible name.

      // Click a button with accessible name "log in"
      page.click("role=button[name='log in']")
      

      To use role selectors, make sure to pass PLAYWRIGHT_EXPERIMENTAL_FEATURES=1 environment variable.

      Read more in our documentation.

    • New scale option in Page.screenshot for smaller sized screenshots.

    • New caret option in Page.screenshot to control text caret. Defaults to HIDE.

    Behavior Changes

    Browser Versions

    • Chromium 101.0.4951.26
    • Mozilla Firefox 98.0.2
    • WebKit 15.4

    This version was also tested against the following stable channels:

    • Google Chrome 100
    • Microsoft Edge 100
    Source code(tar.gz)
    Source code(zip)
  • v1.20.1(Mar 23, 2022)

    Highlights

    This patch includes the following bug fixes:

    https://github.com/microsoft/playwright/issues/12711 - [REGRESSION] Page.screenshot hangs on some sites https://github.com/microsoft/playwright/issues/12807 - [BUG] Cookies get assigned before fulfilling a response https://github.com/microsoft/playwright/issues/12821 - [BUG] Chromium: Cannot click, element intercepts pointer events https://github.com/microsoft/playwright/issues/12887 - [BUG] Locator.count() with _vue selector with Repro https://github.com/microsoft/playwright/issues/12974 - [BUG] Regression - chromium browser closes during test or debugging session on macos

    Browser Versions

    • Chromium 101.0.4921.0
    • Mozilla Firefox 97.0.1
    • WebKit 15.4

    This version was also tested against the following stable channels:

    • Google Chrome 99
    • Microsoft Edge 99
    Source code(tar.gz)
    Source code(zip)
  • v1.20.0(Mar 15, 2022)

    Highlights

    Announcements

    • v1.20 is the last release to receive WebKit update for macOS 10.15 Catalina. Please update macOS to keep using latest & greatest WebKit!

    Browser Versions

    • Chromium 101.0.4921.0
    • Mozilla Firefox 97.0.1
    • WebKit 15.4

    This version was also tested against the following stable channels:

    • Google Chrome 99
    • Microsoft Edge 99
    Source code(tar.gz)
    Source code(zip)
  • v1.19.0(Feb 16, 2022)

    Version 1.19

    Locator Updates

    Locator now supports a has option that makes sure it contains another locator inside:

    page.locator("article", new Page.LocatorOptions().setHas(page.locator(".highlight"))).click();
    

    The snippet above will select article that has highlight in it and will press the button in it. Read more in locator documentation

    Other Updates

    Browser Versions

    • Chromium 100.0.4863.0
    • Mozilla Firefox 96.0.1
    • WebKit 15.4

    This version was also tested against the following stable channels:

    • Google Chrome 98
    • Microsoft Edge 98
    Source code(tar.gz)
    Source code(zip)
  • v1.18.0(Jan 20, 2022)

    API Testing

    Playwright for Java 1.18 introduces new API Testing that lets you send requests to the server directly from Java!

    Now you can:

    • test your server API
    • prepare server side state before visiting the web application in a test
    • validate server side post-conditions after running some actions in the browser

    To do a request on behalf of Playwright's Page, use new page.request() API:

    // Do a GET request on behalf of page
    APIResponse res = page.request().get("http://example.com/foo.json");
    

    Read more about it in our API testing guide.

    Web-First Assertions

    Playwright for Java 1.18 introduces Web-First Assertions.

    Consider the following example:

    ...
    import static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;
    
    public class TestExample {
      ...
      @Test
      void statusBecomesSubmitted() {
        ...
        page.click("#submit-button");
        assertThat(page.locator(".status")).hasText("Submitted");
      }
    }
    

    Playwright will be re-testing the node with the selector .status until fetched Node has the "Submitted" text. It will be re-fetching the node and checking it over and over, until the condition is met or until the timeout is reached. You can pass this timeout as an option.

    Read more in our documentation.

    Locator Improvements

    • Locator.dragTo()
    • Each locator can now be optionally filtered by the text it contains:
      page.locator("li", new Page.LocatorOptions().setHasText("my item"))
          .locator("button").click();
      

      Read more in locator documentation

    Tracing Improvements

    Tracing now can embed Java sources to recorded traces, using new setSources option.

    tracing-java-sources

    New APIs & changes

    Browser Versions

    • Chromium 99.0.4812.0
    • Mozilla Firefox 95.0
    • WebKit 15.4

    This version was also tested against the following stable channels:

    • Google Chrome 97
    • Microsoft Edge 97
    Source code(tar.gz)
    Source code(zip)
  • v1.17.2(Dec 2, 2021)

    Highlights

    This patch includes bug fixes for the following issues:

    https://github.com/microsoft/playwright/issues/10638 - [BUG] Locator.click -> subtree intercepts pointer events since version 1.17.0 https://github.com/microsoft/playwright/issues/10632 - [BUG] Playwright 1.17.0 -> After clicking the element - I get an error that click action was failed https://github.com/microsoft/playwright/issues/10627 - [REGRESSION]: Can no longer click Material UI select box https://github.com/microsoft/playwright/issues/10620 - [BUG] trailing zero width whitespace fails toHaveText

    Browser Versions

    • Chromium 98.0.4695.0
    • Mozilla Firefox 94.0.1
    • WebKit 15.4

    This version of Playwright was also tested against the following stable channels:

    • Google Chrome 96
    • Microsoft Edge 96
    Source code(tar.gz)
    Source code(zip)
  • v1.17.1(Nov 30, 2021)

    Highlights

    This patch includes bug fixes for the following issues:

    https://github.com/microsoft/playwright/issues/10127 - [BUG] Add Trace Viewer error handling (file not found, not parsable) https://github.com/microsoft/playwright/issues/10436 - [Bug]: Add hints on how to open trace from HTML report when opened locally https://github.com/microsoft/playwright/pull/10492 - [Bug]: Fix broken Firefox User-Agent on 'Desktop Firefox' devices

    Browser Versions

    • Chromium 98.0.4695.0
    • Mozilla Firefox 94.0.1
    • WebKit 15.4

    This version was also tested against the following stable channels:

    • Google Chrome 96
    • Microsoft Edge 96
    Source code(tar.gz)
    Source code(zip)
  • v1.17.0(Nov 19, 2021)

    Playwright v1.17.0

    Frame Locators

    Playwright 1.17 introduces frame locators - a locator to the iframe on the page. Frame locators capture the logic sufficient to retrieve the iframe and then locate elements in that iframe. Frame locators are strict by default, will wait for iframe to appear and can be used in Web-First assertions.

    Graphics

    Frame locators can be created with either page.FrameLocator(selector) or locator.FrameLocator(selector) method.

    Locator locator = page.frameLocator("#my-frame").locator("text=Submit");
    locator.click();
    

    Read more at our documentation.

    Trace Viewer Update

    Playwright Trace Viewer is now available online at https://trace.playwright.dev! Just drag-and-drop your trace.zip file to inspect its contents.

    NOTE: trace files are not uploaded anywhere; trace.playwright.dev is a progressive web application that processes traces locally.

    • Trace Viewer now shows test name
    • New trace metadata tab with browser details
    • Snapshots now have URL bar

    image

    Ubuntu ARM64 support + more

    • Playwright now supports Ubuntu 20.04 ARM64. You can now run Playwright tests inside Docker on Apple M1 and on Raspberry Pi.

    New APIs

    • Tracing now supports a 'title' option
    • Page navigations support a new 'commit' waiting option

    Browser Versions

    • Chromium 98.0.4695.0
    • Mozilla Firefox 94.0.1
    • WebKit 15.4

    This version was also tested against the following stable channels:

    • Google Chrome 96
    • Microsoft Edge 96

    Source code(tar.gz)
    Source code(zip)
  • v1.16.1(Oct 29, 2021)

    Highlights

    This patch includes bug fixes for the following issues:

    https://github.com/microsoft/playwright/issues/9692 - [BUG] HTML report shows locator._withElement for locator.evaluate https://github.com/microsoft/playwright/issues/7818 - [Bug]: dedup snapshot CSS images

    Browser Versions

    • Chromium 97.0.4666.0
    • Mozilla Firefox 93.0
    • WebKit 15.4

    This version was also tested against the following stable channels:

    • Google Chrome 94
    • Microsoft Edge 94

    (1.16.2-1635322350000)

    Source code(tar.gz)
    Source code(zip)
  • v1.16.0(Oct 21, 2021)

    🎭 Playwright Library

    Locator.waitFor

    Wait for a locator to resolve to a single element with a given state. Defaults to the state: 'visible'.

    Locator orderSent = page.locator("#order-sent");
    orderSent.waitFor();
    

    Read more about Locator.waitFor().

    🎭 Playwright Trace Viewer

    • run trace viewer with npx playwright show-trace and drop trace files to the trace viewer PWA
    • better visual attribution of action targets

    Read more about Trace Viewer.

    Browser Versions

    • Chromium 97.0.4666.0
    • Mozilla Firefox 93.0
    • WebKit 15.4

    This version of Playwright was also tested against the following stable channels:

    • Google Chrome 94
    • Microsoft Edge 94

    (1.16.0-1634781227000)

    Source code(tar.gz)
    Source code(zip)
  • v1.15.2(Oct 5, 2021)

    Highlights

    This patch includes bug fixes for the following issues:

    https://github.com/microsoft/playwright/issues/9261 - [BUG] npm init playwright fails on path spaces https://github.com/microsoft/playwright/issues/9298 - [Question]: Should new Headers methods work in RouteAsync ?

    Browser Versions

    • Chromium 96.0.4641.0
    • Mozilla Firefox 92.0
    • WebKit 15.0

    This version of Playwright was also tested against the following stable channels:

    • Google Chrome 93
    • Microsoft Edge 93

    (driver version: 1.15.2-1633455481000)

    Source code(tar.gz)
    Source code(zip)
  • v1.15.1(Sep 30, 2021)

    Highlights

    This patch includes bug fixes for the following issues:

    https://github.com/microsoft/playwright/pull/8955 - [BUG] fix(inspector): stop on all snapshottable actions https://github.com/microsoft/playwright/pull/8999 - [BUG] fix: do not dedup header values https://github.com/microsoft/playwright/pull/9038 - [BUG] fix: restore support for slowmo connect option

    Browser Versions

    • Chromium 96.0.4641.0
    • Mozilla Firefox 92.0
    • WebKit 15.0

    This version of Playwright was also tested against the following stable channels:

    • Google Chrome 93
    • Microsoft Edge 93
    Source code(tar.gz)
    Source code(zip)
  • v1.15.0(Sep 21, 2021)

    Version 1.15

    🖱️ Mouse Wheel

    By using Mouse.wheel you are now able to scroll vertically or horizontally.

    📜 New Headers API

    Previously it was not possible to get multiple header values of a response. This is now possible and additional helper functions are available:

    🌈 Forced-Colors emulation

    Its now possible to emulate the forced-colors CSS media feature by passing it in the context options or calling Page.emulateMedia().

    New APIs

    Browser Versions

    • Chromium 96.0.4641.0
    • Mozilla Firefox 92.0
    • WebKit 15.0

    This version of Playwright was also tested against the following stable channels:

    • Google Chrome 93
    • Microsoft Edge 93
    Source code(tar.gz)
    Source code(zip)
  • v1.14.1(Aug 24, 2021)

    Highlights

    This patch includes bug fixes for the following issues:

    microsoft/playwright#8287 - [BUG] webkit crashes intermittently: "file data stream has an unexpected number of bytes" microsoft/playwright#8281 - [BUG] HTML report crashes if diff snapshot does not exists microsoft/playwright#8230 - Using React Selectors with multiple React trees microsoft/playwright#8366 - [BUG] Mark timeout in isVisible as deprecated and noop

    Browser Versions

    • Chromium 94.0.4595.0
    • Mozilla Firefox 91.0
    • WebKit 15.0

    This version of Playwright was also tested against the following stable channels:

    • Google Chrome 92
    • Microsoft Edge 92
    Source code(tar.gz)
    Source code(zip)
  • v1.14.0(Aug 13, 2021)

    ⚡️ New "strict" mode

    Selector ambiguity is a common problem in automation testing. "strict" mode ensures that your selector points to a single element and throws otherwise.

    Use setStrict(true) in your action calls to opt in.

    // This will throw if you have more than one button!
    page.click("button", new Page.ClickOptions().setStrict(true));
    

    📍 New Locators API

    Locator represents a view to the element(s) on the page. It captures the logic sufficient to retrieve the element at any given moment.

    The difference between the Locator and ElementHandle is that the latter points to a particular element, while Locator captures the logic of how to retrieve that element.

    Also, locators are "strict" by default!

    Locator locator = page.locator("button");
    locator.click();
    

    Learn more in the documentation.

    🧩 Experimental React and Vue selector engines

    React and Vue selectors allow selecting elements by its component name and/or property values. The syntax is very similar to attribute selectors and supports all attribute selector operators.

    page.click("_react=SubmitButton[enabled=true]");
    page.click("_vue=submit-button[enabled=true]");
    

    Learn more in the react selectors documentation and the vue selectors documentation.

    ✨ New nth and visible selector engines

    • nth selector engine is equivalent to the :nth-match pseudo class, but could be combined with other selector engines.
    • visible selector engine is equivalent to the :visible pseudo class, but could be combined with other selector engines.
    // select the first button among all buttons
    button.click("button >> nth=0");
    // or if you are using locators, you can use first(), nth() and last()
    page.locator("button").first().click();
    // click a visible button
    button.click("button >> visible=true");
    

    Browser Versions

    • Chromium 94.0.4595.0
    • Mozilla Firefox 91.0
    • WebKit 15.0

    This version of Playwright was also tested against the following stable channels:

    • Google Chrome 92
    • Microsoft Edge 92
    Source code(tar.gz)
    Source code(zip)
  • v1.13.0(Jul 21, 2021)

    Playwright

    • 🖖 Programmatic drag-and-drop support via the Page.dragAndDrop() API.
    • 🔎 Enhanced HAR with body sizes for requests and responses. Use via setRecordHarPath option in Browser.newContext().

    Tools

    • Playwright Trace Viewer now shows parameters, returned values and console.log() calls.

    New and Overhauled Guides

    Browser Versions

    • Chromium 93.0.4576.0
    • Mozilla Firefox 90.0
    • WebKit 14.2

    New Playwright APIs

    Source code(tar.gz)
    Source code(zip)
  • v1.12.1(Jun 11, 2021)

    Highlights

    This patch release includes bugfixes for the following issues:

    https://github.com/microsoft/playwright/issues/7015 - [BUG] Firefox: strange undefined toJSON property on JS objects https://github.com/microsoft/playwright/issues/7048 - [BUG] Dialogs cannot be dismissed if tracing is on in Chromium or Webkit https://github.com/microsoft/playwright/issues/7058 - [BUG] Getting no video frame error for mobile chrome

    Browser Versions

    • Chromium 93.0.4530.0
    • Mozilla Firefox 89.0
    • WebKit 14.2

    This version of Playwright was also tested against the following stable channels:

    • Google Chrome 91
    • Microsoft Edge 91
    Source code(tar.gz)
    Source code(zip)
  • v1.12.0(Jun 9, 2021)

    🧟‍♂️ Introducing Playwright Trace & TraceViewer

    Playwright Trace Viewer is a new GUI tool that helps exploring recorded Playwright traces after the script ran. Playwright traces let you examine:

    • page DOM before and after each Playwright action
    • page rendering before and after each Playwright action
    • browser network during script execution

    Traces are recorded using the new BrowserContext.tracing() API:

    Browser browser = chromium.launch();
    BrowserContext context = Browser.newContext();
    
    // Start tracing before creating / navigating a page.
    context.tracing.start(new Tracing.StartOptions()
      .setScreenshots(true)
      .setSnapshots(true);
    
    Page page = context.newPage();
    page.goto("https://playwright.dev");
    
    // Stop tracing and export it into a zip archive.
    context.tracing.stop(new Tracing.StopOptions()
      .setPath(Paths.get("trace.zip")));
    

    Traces are examined later with the Playwright CLI:

    mvn exec:java -e -Dexec.mainClass=com.microsoft.playwright.CLI -Dexec.args="show-trace trace.zip"
    

    That will open the following GUI:

    image

    👉 Read more in trace viewer documentation.


    Browser Versions

    • Chromium 93.0.4530.0
    • Mozilla Firefox 89.0
    • WebKit 14.2

    This version of Playwright was also tested against the following stable channels:

    • Google Chrome 91
    • Microsoft Edge 91

    New APIs

    Source code(tar.gz)
    Source code(zip)
  • v1.11.1(May 20, 2021)

    Highlights

    This patch includes bug fixes across all languages for the following issues:

    • https://github.com/microsoft/playwright-python/issues/679 - can't get browser's context pages after connect_over_cdp
    • https://github.com/microsoft/playwright-java/issues/432 - [Bug] Videos are not complete when an exception is thrown

    Browser Versions

    • Chromium 92.0.4498.0
    • Mozilla Firefox 89.0b6
    • WebKit 14.2

    This version of Playwright was also tested against the following stable channels:

    • Google Chrome 90
    • Microsoft Edge 90
    Source code(tar.gz)
    Source code(zip)
Owner
Microsoft
Open source projects and samples from Microsoft
Microsoft
Puppeteer/Playwright in Java. High-Level headless browser.

HBrowser Another headless browser for Java with Puppeteer and Playwright implemented. Add this to your project with Maven/Gradle/Sbt/Leinigen (Java 8

Osiris-Team 99 Dec 18, 2022
This is an experiment project I used to learn more about UI Automation with Playwright

Automated Wordle using Playwright (Java) This is an experiment project I used to learn more about UI Automation with Playwright. What's in this reposi

Tom Cools 4 Jan 30, 2022
Restful-booker API test automation project using Java and REST Assured.

Restful-booker API Test Automation Restful-booker API is an API playground created by Mark Winteringham for those wanting to learn more about API test

Tahanima Chowdhury 7 Aug 14, 2022
Roman Beskrovnyi 248 Dec 21, 2022
A Java architecture test library, to specify and assert architecture rules in plain Java

ArchUnit is a free, simple and extensible library for checking the architecture of your Java code. That is, ArchUnit can check dependencies between pa

TNG Technology Consulting GmbH 2.5k Jan 2, 2023
A template for Spring Boot REST API tested with JUnit 5 and Cucumber 6

demo-bdd Un template Spring Boot pour lancer un BDD/ATDD avec Cucumber 6 et JUnit 5. Maven et le JDK 17 seront nécessaires. Exécuter les tests Le proj

Rui Lopes 4 Jul 19, 2022
This is a Java-API to controll the Lights from Phillips Hue

LightControllerAPI This is an easy to use LightControllerAPI in for Java to control Lights from PhillipsHue. How to get started Gradle (Default): repo

Maxi Zink 3 Apr 9, 2022
Library that allows tests written in Java to follow the BDD style introduced by RSpec and Jasmine.

J8Spec J8Spec is a library that allows tests written in Java to follow the BDD style introduced by RSpec and Jasmine. More details here: j8spec.github

J8Spec 45 Feb 17, 2022
Advanced Java library for integration testing, mocking, faking, and code coverage

Codebase for JMockit 1.x releases - Documentation - Release notes How to build the project: use JDK 1.8 or newer use Maven 3.6.0 or newer; the followi

The JMockit Testing Toolkit 439 Dec 9, 2022
completely ridiculous API (crAPI)

crAPI completely ridiculous API (crAPI) will help you to understand the ten most critical API security risks. crAPI is vulnerable by design, but you'l

OWASP 545 Jan 8, 2023
Consume an async api (with callback) from sync endpoint using vert.x

vertx-async-to-sync Problem statement Suppose we have two services - A and B. In a trivial and everyday scenario, client makes request to A. A then do

Tahniat Ashraf Priyam 12 Oct 19, 2022
API-автотесты для Reqres с использованием библиотеки REST Assured

API-автотесты для Reqres Покрытый функционал Разработаны автотесты на API. API Запросы GET, POST, PUT, PATCH и DELETE Отображение statusCode и body в

Karina Gordienko 2 Jan 31, 2022
A project was created using the API of the TMDB page

TMDB API The project was created using the API of the TMDB page. You can find the description of the functions and their usage at https://developers.t

Atakan Koçyiğit 3 Jan 27, 2022
Automation Tests (REST-API with REST-ASSURED examples)

Automation Tests (REST-API with REST-ASSURED examples) Technology Stack IDEA Java Junit5 Gradle Selenide Allure Jenkins Rest-Assured See details: src/

null 3 Apr 11, 2022
REST API for Apache Spark on K8S

Lighter Lighter is an opensource application for interacting with Apache Spark on Kubernetes or Apache Hadoop YARN. It is hevily inspired by Apache Li

Exacaster 38 Jan 5, 2023
Serenity BDD is a test automation library designed to make writing automated acceptance tests easier, and more fun.

That feeling you get when you know you can trust your tests Serenity BDD is a library designed to make writing automated acceptance tests easier, and

Serenity BDD 654 Dec 28, 2022
🔌 Simple library to manipulate HTTP requests/responses and capture network logs made by the browser using selenium tests without using any proxies

Simple library to manipulate HTTP requests and responses, capture the network logs made by the browser using selenium tests without using any proxies

Sudharsan Selvaraj 29 Oct 23, 2022
A library for setting up Java objects as test data.

Beanmother Beanmother helps to create various objects, simple and complex, super easily with fixtures for testing. It encourages developers to write m

Jaehyun Shin 113 Nov 7, 2022