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

Related tags

java playwright
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.

Issues
  • [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] 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
  • [Feature] connectOverCDP Support

    [Feature] connectOverCDP Support

    Are there plans to add "connectOverCDP" support to the playwright-java? This feature would finally allow me to do away with selenium webdriver in my use case.

    opened by regbo 11
  • Chromium extension can't establish connection with receiver with Playwright-Java

    Chromium extension can't establish connection with receiver with Playwright-Java

    We have an extension that adds a listener to establish a channel with a cloud service, which works fine when side-loading the extension, or using Playwright-Javascript. With the Java implementation, the extension logs the following to the console:

    Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.

    I believe it's occurring when the extension make this call (or something similar):

    .extension.onRequest.addListener((e, t, n) => { t.id === chrome.runtime.id && "?" === e.locked && n({state: this.locked, message: this.lastMessage}) })

    The call to .launchPersistentContext is nearly identical to the one that works in Playwright-Javascript:

           Path userDataDir = Paths.get("/tmp/chrome-user" + Integer.toString(instanceCount));
            String extensionPath =
                    "./src/test/java/classroom/resources/extensions/crx-" + ClassroomPlaywright.env.getString("customerID");
            List<String> chromeArgs = new ArrayList<>();
            chromeArgs.add("--disable-background-timer-throttling");
            chromeArgs.add("--disable-backgrounding-occluded-windows");
            chromeArgs.add("--disable-renderer-backgrounding");
            chromeArgs.add("--no-sandbox");
            chromeArgs.add("--disable-setuid-sandbox");
            chromeArgs.add("--disable-dev-shm-usage");
            chromeArgs.add("--disable-extensions-except=" + extensionPath);
            chromeArgs.add("--load-extension=" + extensionPath);
            BrowserType.LaunchPersistentContextOptions options = new BrowserType.LaunchPersistentContextOptions();
            options.channel = BrowserChannel.CHROME;
            options.setHeadless(false);
            options.setDevtools(false);
            options.args = chromeArgs;
    
            studentContext = student.chromium().launchPersistentContext(userDataDir, options);
            studentPage = studentContext.pages().get(0);
    

    I also tried options.setIgnoreAllDefaultArgs and switched off all but the 2 needed for loading the extension, but the error still occurred.

    I may be able to provide the extension source, if it will help to debug

    opened by dakLSS 11
  • [Question] Docker image on docker hub

    [Question] Docker image on docker hub

    Hi do you have published docker image for playwright java? Or i should build it by my own?

    opened by ocherniavskyi-lohika-tix 10
  • [Question] NoSuchFileException in jar file

    [Question] NoSuchFileException in jar file

    I didn't find any decision yet for this problem. I cannot execute jar file with my spring-boot service using playwright.

    java.lang.IllegalStateException: Failed to execute CommandLineRunner
            at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:782)
            at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:763)
            at org.springframework.boot.SpringApplication.run(SpringApplication.java:318)
            at org.springframework.boot.SpringApplication.run(SpringApplication.java:1213)
            at org.springframework.boot.SpringApplication.run(SpringApplication.java:1202)
            at ru.cnd.Application.main(Application.java:14)
            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
            at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.base/java.lang.reflect.Method.invoke(Method.java:566)
            at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
            at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
            at org.springframework.boot.loader.Launcher.launch(Launcher.java:51)
            at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
    Caused by: java.lang.RuntimeException: Failed to create driver
            at com.microsoft.playwright.impl.Driver.ensureDriverInstalled(Driver.java:46)
            at com.microsoft.playwright.impl.PlaywrightImpl.create(PlaywrightImpl.java:40)
            at com.microsoft.playwright.Playwright.create(Playwright.java:50)
            at ru.cnd.config.BrowserInitialize.launchBrowser(BrowserInitialize.java:12)
            at ru.cnd.config.ServiceInitialize.lambda$configAuthentication$0(ServiceInitialize.java:35)
            at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:779)
            ... 13 common frames omitted
    Caused by: java.lang.reflect.InvocationTargetException: null
            at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
            at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
            at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
            at com.microsoft.playwright.impl.Driver.createDriver(Driver.java:65)
            at com.microsoft.playwright.impl.Driver.ensureDriverInstalled(Driver.java:44)
            ... 18 common frames omitted
    Caused by: java.nio.file.NoSuchFileException: /BOOT-INF/lib/driver-bundle-0.180.0.jar!/driver/linux
            at jdk.zipfs/jdk.nio.zipfs.ZipPath.getAttributes(ZipPath.java:742)
    

    I found that getResource() causes this exception, but I'm not sure that it is my case. This method in DriverJar.class has such code

    private void extractDriverToTempDir() throws URISyntaxException, IOException { ClassLoader classloader = Thread.currentThread().getContextClassLoader(); URI uri = classloader.getResource("driver/" + platformDir()).toURI();

    Please, how can I run my jar file correctly or find the reason of such exception?

    opened by arkasandr 8
  • [Question] GraalVM Support

    [Question] GraalVM Support

    I was trying to create a native image to run some code using playwright and it seems it can't find the driver. Was wondering if this was something easy to iron out and support? This is the error I get when running the native binary:

    19:11:51.038 [main] INFO  i.m.context.env.DefaultEnvironment - Established active environments: [cli]
    Create Foo command running
    java.lang.RuntimeException: Failed to create driver
    	at com.microsoft.playwright.impl.Driver.ensureDriverInstalled(Driver.java:46)
    	at com.microsoft.playwright.impl.PlaywrightImpl.create(PlaywrightImpl.java:33)
    	at com.microsoft.playwright.Playwright.create(Playwright.java:76)
    	at com.foo.unwired.CreateFoo.<init>(CreateFoo.java:21)
    	at com.foo.unwired.CreateFooCommand.run(CreateFooCommand.java:93)
    	at picocli.CommandLine.executeUserObject(CommandLine.java:1939)
    	at picocli.CommandLine.access$1300(CommandLine.java:145)
    	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
    	at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
    	at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
    	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
    	at picocli.CommandLine.execute(CommandLine.java:2078)
    	at io.micronaut.configuration.picocli.PicocliRunner.run(PicocliRunner.java:137)
    	at io.micronaut.configuration.picocli.PicocliRunner.run(PicocliRunner.java:114)
    	at com.foo.UnwiredCommand.main(UnwiredCommand.java:17)
    Caused by: java.lang.reflect.InvocationTargetException
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:490)
    	at com.microsoft.playwright.impl.Driver.createDriver(Driver.java:65)
    	at com.microsoft.playwright.impl.Driver.ensureDriverInstalled(Driver.java:44)
    	... 14 more
    Caused by: java.lang.NullPointerException
    	at com.microsoft.playwright.impl.DriverJar.extractDriverToTempDir(DriverJar.java:60)
    	at com.microsoft.playwright.impl.DriverJar.<init>(DriverJar.java:32)
    	... 17 more
    
    opened by chaganiu 8
  • [BUG] new page in context open when execute javascript from page object

    [BUG] new page in context open when execute javascript from page object

    when execute the Javascript from the page.evaluate, there is a new page created with url ":". The page close status is false, but when try to close, the process will get stuck- this also affect when tear down which call browser close. I am using v 0.17.2 and Microsoft Chromium Edge 86.

    image

    opened by ephung01 8
  • [Feature] - allow configuration of WebSocketTransport

    [Feature] - allow configuration of WebSocketTransport

    The WebSocketTransport class is currently protected, and creates a new org.java_websocket.client.WebSocketClient when constructed.

    It would be great to have the ability to pass in a configuration consumer that allows for WebSocketTransport /WebSocketClient configuration. Here are a few use cases:

    • Adding authorization headers
    • Modifying the user agent for routing (ex 'playwright' user agent routed to separate endpoint vs 'selenium' user agent)
    • Expanding the size of the WebSocketTransport incoming queue (currently capped at 1k, which is easy to fill if you are stepping through the debugger. We currently use reflection to make it unbounded)

    Perhaps a Consumer options could be added to ConnectOptions? (assuming WebSocketTransport is made public)

    opened by regbo 7
  • [Question]

    [Question] "Failed to find playwright-cli " exception for execution via "java -jar " command

    After packaging the example project which is https://github.com/microsoft/playwright-java/tree/master/examples, it is not possible to execute via java -jar . It cause the exception mentioned below:

    Caused by: java.lang.RuntimeException: Failed to find playwright-cli
    	at com.microsoft.playwright.impl.Driver.ensureDriverInstalled(Driver.java:46) ~[driver-0.171.0.jar!/:na]
    	at com.microsoft.playwright.impl.PlaywrightImpl.create(PlaywrightImpl.java:38) ~[playwright-0.171.0.jar!/:na]
    	at com.microsoft.playwright.Playwright.create(Playwright.java:25) ~[playwright-0.171.0.jar!/:na]
    
    opened by ercanku 7
  • Java 16 incompatibility due to usage of internal APIs

    Java 16 incompatibility due to usage of internal APIs

    The README promises that "Playwright requires Java 8 or newer". This does not include Java 16, however. With JEP 396, further APIs were encapsulated that are being used by Playwright. As a result, running the test suite with Java 16 fails. Examples:

    [ERROR] com.microsoft.playwright.TestScreencast.shouldExposeVideoPath(Path)  Time elapsed: 0.096 s  <<< ERROR!
    java.lang.reflect.InaccessibleObjectException: Unable to make field private final sun.nio.fs.UnixFileSystem sun.nio.fs.UnixPath.fs accessible: module java.base does not "opens sun.nio.fs" to unnamed module @152f2773
    	at com.microsoft.playwright.TestScreencast.shouldExposeVideoPath(TestScreencast.java:30)
    
    ...
    
    
    [ERROR] com.microsoft.playwright.TestBrowserContextAddCookies.shouldRoundtripCookie  Time elapsed: 0.103 s  <<< ERROR!
    java.lang.reflect.InaccessibleObjectException: Unable to make private java.util.Collections$EmptyList() accessible: module java.base does not "opens java.util" to unnamed module @152f2773
    	at com.microsoft.playwright.TestBrowserContextAddCookies.shouldRoundtripCookie(TestBrowserContextAddCookies.java:53)
    

    Steps to reproduce:

    1. Install any version of OpenJDK 16 (I'm using Liberica by Bell Soft)
    2. Run mvn test

    I know about workarounds like --add-opens. But it would be great if Playwright worked without them. Because the OpenJDK team plans to enable further restrictions in the future, it might make sense to test against the newest JDK as part of each CI run.

    opened by aahlenst 2
  • [Question] Can't run in Docker container

    [Question] Can't run in Docker container

    image what's problem? Thanks

    opened by cyrly97 1
  • [Question] Network route

    [Question] Network route

    Hello When i use page.route(...) - next logic stopped and route is triggered after a certain time, it causes a lot of problems. is there a way to deal with this? For example exposeFunction good work and dont stopped next logic

    opened by NikitaNesterenko 13
  • [BUG] Playwright cannot download the browsers automatically

    [BUG] Playwright cannot download the browsers automatically

    I'm trying to use Playwright in a Java EE environment with Zulu 11 and I always get this error messaged when launching chromium.

    com.microsoft.playwright.PlaywrightException: Error {
      message='Failed to launch chromium because executable doesn't exist at C:\Users\Alex\AppData\Local\ms-playwright\chromium-857950\chrome-win\chrome.exe
    Try re-installing playwright with "npm install playwright"
      name='Error
      stack='Error: Failed to launch chromium because executable doesn't exist at C:\Users\Alex\AppData\Local\ms-playwright\chromium-857950\chrome-win\chrome.exe
    Try re-installing playwright with "npm install playwright"
        at Chromium._launchProcess (C:\Users\Alex\AppData\Local\Temp\playwright-java-12834975463618432611\package\lib\server\browserType.js:174:19)
        at async Chromium._innerLaunch (C:\Users\Alex\AppData\Local\Temp\playwright-java-12834975463618432611\package\lib\server\browserType.js:110:62)
        at async ProgressController.run (C:\Users\Alex\AppData\Local\Temp\playwright-java-12834975463618432611\package\lib\server\progress.js:79:28)
        at async Chromium.launch (C:\Users\Alex\AppData\Local\Temp\playwright-java-12834975463618432611\package\lib\server\browserType.js:78:25)
        at async BrowserTypeDispatcher.launch (C:\Users\Alex\AppData\Local\Temp\playwright-java-12834975463618432611\package\lib\dispatchers\browserTypeDispatcher.js:30:25)
        at async DispatcherConnection.dispatch (C:\Users\Alex\AppData\Local\Temp\playwright-java-12834975463618432611\package\lib\dispatchers\dispatcher.js:181:28)
    }
        at com.microsoft.playwright.impl.WaitableResult.get(WaitableResult.java:54)
        at com.microsoft.playwright.impl.ChannelOwner.runUntil(ChannelOwner.java:88)
        at com.microsoft.playwright.impl.Connection.sendMessage(Connection.java:96)
        at com.microsoft.playwright.impl.ChannelOwner.sendMessage(ChannelOwner.java:79)
        at com.microsoft.playwright.impl.BrowserTypeImpl.launchImpl(BrowserTypeImpl.java:49)
        at com.microsoft.playwright.impl.BrowserTypeImpl.lambda$launch$0(BrowserTypeImpl.java:41)
        at com.microsoft.playwright.impl.LoggingSupport.withLogging(LoggingSupport.java:47)
        at com.microsoft.playwright.impl.BrowserTypeImpl.launch(BrowserTypeImpl.java:41)
        at com.microsoft.playwright.impl.BrowserTypeImpl.launch(BrowserTypeImpl.java:34)
        at com.microsoft.playwright.BrowserType.launch(BrowserType.java:601)
        at de.symeda.sormas.ui.labmessage.LabMessageController.convertToPdf(LabMessageController.java:965)
        at de.symeda.sormas.ui.labmessage.LabMessageController.downloadLabMessage(LabMessageController.java:941)
        at de.symeda.sormas.ui.labmessage.LabMessageGrid.lambda$buildDownloadButton$c7abbaac$1(LabMessageGrid.java:177)
        at com.vaadin.server.StreamResource.getStream(StreamResource.java:143)
        at com.vaadin.server.FileDownloader.handleConnectorRequest(FileDownloader.java:167)
        at com.vaadin.server.ConnectorResourceHandler.handleRequest(ConnectorResourceHandler.java:90)
        at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1608)
        at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:448)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:750)
        at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1628)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:339)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:209)
        at de.symeda.sormas.ui.SessionFilter.lambda$doFilter$2(SessionFilter.java:72)
        at de.symeda.sormas.ui.SessionFilterBean.doFilter(SessionFilterBean.java:37)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:588)
        at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:408)
        at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:4791)
        at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:665)
        at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:836)
        at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:615)
        at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
        at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:140)
        at jdk.internal.reflect.GeneratedMethodAccessor1707.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:895)
        at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:835)
        at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:615)
        at org.jboss.weld.module.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:72)
        at org.jboss.weld.module.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)
        at jdk.internal.reflect.GeneratedMethodAccessor1687.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:895)
        at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:835)
        at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:374)
        at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:4763)
        at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4751)
        at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:212)
        at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:90)
        at com.sun.proxy.$Proxy2418.doFilter(Unknown Source)
        at de.symeda.sormas.ui.__EJB31_Generated__SessionFilterBean__Intf____Bean__.doFilter(Unknown Source)
        at de.symeda.sormas.ui.SessionFilter.doFilter(SessionFilter.java:65)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:251)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:209)
        at de.symeda.sormas.ui.Slf4jMdcFilter.doFilter(Slf4jMdcFilter.java:29)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:251)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:209)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:755)
        at org.apache.catalina.core.StandardPipeline.doChainInvoke(StandardPipeline.java:579)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:159)
        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:371)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:238)
        at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:520)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:217)
        at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:182)
        at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:156)
        at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:218)
        at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:95)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:260)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:177)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:109)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:88)
        at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:53)
        at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:524)
        at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:89)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:94)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:33)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:114)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:569)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:549)
        at java.base/java.lang.Thread.run(Thread.java:834)
    Caused by: com.microsoft.playwright.impl.DriverException: Error {
      message='Failed to launch chromium because executable doesn't exist at C:\Users\Alex\AppData\Local\ms-playwright\chromium-857950\chrome-win\chrome.exe
    Try re-installing playwright with "npm install playwright"
      name='Error
      stack='Error: Failed to launch chromium because executable doesn't exist at C:\Users\Alex\AppData\Local\ms-playwright\chromium-857950\chrome-win\chrome.exe
    Try re-installing playwright with "npm install playwright"
        at Chromium._launchProcess (C:\Users\Alex\AppData\Local\Temp\playwright-java-12834975463618432611\package\lib\server\browserType.js:174:19)
        at async Chromium._innerLaunch (C:\Users\Alex\AppData\Local\Temp\playwright-java-12834975463618432611\package\lib\server\browserType.js:110:62)
        at async ProgressController.run (C:\Users\Alex\AppData\Local\Temp\playwright-java-12834975463618432611\package\lib\server\progress.js:79:28)
        at async Chromium.launch (C:\Users\Alex\AppData\Local\Temp\playwright-java-12834975463618432611\package\lib\server\browserType.js:78:25)
        at async BrowserTypeDispatcher.launch (C:\Users\Alex\AppData\Local\Temp\playwright-java-12834975463618432611\package\lib\dispatchers\browserTypeDispatcher.js:30:25)
        at async DispatcherConnection.dispatch (C:\Users\Alex\AppData\Local\Temp\playwright-java-12834975463618432611\package\lib\dispatchers\dispatcher.js:181:28)
    }
        at com.microsoft.playwright.impl.Connection.dispatch(Connection.java:209)
        at com.microsoft.playwright.impl.Connection.processOneMessage(Connection.java:189)
        at com.microsoft.playwright.impl.ChannelOwner.runUntil(ChannelOwner.java:86)
        ... 87 more
    ]]
    

    I tried changing the path for browser download using the Environment Variable PLAYWRIGHT_BROWSERS_PATH but still the script was unable to download them.

    Any idea what might be wrong? Or any suggestion how can I debug the download script?

    Environment Specifications

    OS: Windows 10 JDK: Zulu 11 Server: Payara 5

    opened by vidi42 4
  • [Bug] can't use codegen in some page

    [Bug] can't use codegen in some page

    I have a page where I need to record operations, but there are multiple elements with empty ids (all input boxes) on the page. When I click Record, the page becomes abnormal and it is difficult to perform operations on the page. The console prints these contents:

    [DOM] Found 6 elements with non-unique id #: (More info: https://goo.gl/9p2vKq) <input class=โ€‹"ti-searchbox-input ng-pristine ng-untouched ng-valid ng-valid-maxlength" ng-class=โ€‹"{'ti-searchbox-input-clear-shown':โ€‹ isShowClear}โ€‹" ng-disabled=โ€‹"disable" ng-focus=โ€‹"focusFn($event)โ€‹" spellcheck=โ€‹"false" ng-keydown=โ€‹"inputKeydown($event)โ€‹" ng-blur=โ€‹"blurFn()โ€‹" ng-model=โ€‹"value" ng-model-options=โ€‹"{updateOn:โ€‹ 'default blur', debounce:โ€‹ { 'default':โ€‹ 200, 'blur':โ€‹ 0 }โ€‹}โ€‹" ng-change=โ€‹"changeFn(value)โ€‹" maxlength ng-trim=โ€‹"true" autocomplete=โ€‹"off" id placeholder>โ€‹ <input class=โ€‹"ti-searchbox-input ng-pristine ng-untouched ng-valid ng-valid-maxlength" ng-class=โ€‹"{'ti-searchbox-input-clear-shown':โ€‹ isShowClear}โ€‹" ng-disabled=โ€‹"disable" ng-focus=โ€‹"focusFn($event)โ€‹" spellcheck=โ€‹"false" ng-keydown=โ€‹"inputKeydown($event)โ€‹" ng-blur=โ€‹"blurFn()โ€‹" ng-model=โ€‹"value" ng-model-options=โ€‹"{updateOn:โ€‹ 'default blur', debounce:โ€‹ { 'default':โ€‹ 200, 'blur':โ€‹ 0 }โ€‹}โ€‹" ng-change=โ€‹"changeFn(value)โ€‹" maxlength ng-trim=โ€‹"true" autocomplete=โ€‹"off" id placeholder=โ€‹"ๆ”ฏๆŒๆŒ‰็…งIPๆˆ–่ฎพๅค‡ๅๆœ็ดข">โ€‹ <input class=โ€‹"ti-searchbox-input ng-pristine ng-untouched ng-valid ng-valid-maxlength" ng-class=โ€‹"{'ti-searchbox-input-clear-shown':โ€‹ isShowClear}โ€‹" ng-disabled=โ€‹"disable" ng-focus=โ€‹"focusFn($event)โ€‹" spellcheck=โ€‹"false" ng-keydown=โ€‹"inputKeydown($event)โ€‹" ng-blur=โ€‹"blurFn()โ€‹" ng-model=โ€‹"value" ng-model-options=โ€‹"{updateOn:โ€‹ 'default blur', debounce:โ€‹ { 'default':โ€‹ 200, 'blur':โ€‹ 0 }โ€‹}โ€‹" ng-change=โ€‹"changeFn(value)โ€‹" maxlength ng-trim=โ€‹"true" autocomplete=โ€‹"off" id placeholder>โ€‹ <input class=โ€‹"ti-searchbox-input ng-pristine ng-untouched ng-valid ng-valid-maxlength" ng-class=โ€‹"{'ti-searchbox-input-clear-shown':โ€‹ isShowClear}โ€‹" ng-disabled=โ€‹"disable" ng-focus=โ€‹"focusFn($event)โ€‹" spellcheck=โ€‹"false" ng-keydown=โ€‹"inputKeydown($event)โ€‹" ng-blur=โ€‹"blurFn()โ€‹" ng-model=โ€‹"value" ng-model-options=โ€‹"{updateOn:โ€‹ 'default blur', debounce:โ€‹ { 'default':โ€‹ 200, 'blur':โ€‹ 0 }โ€‹}โ€‹" ng-change=โ€‹"changeFn(value)โ€‹" maxlength ng-trim=โ€‹"true" autocomplete=โ€‹"off" id placeholder=โ€‹"่ฏฆๆƒ…ๆจก็ณŠๆœ็ดข๏ผŒIP็ฒพ็กฎๆœ็ดข">โ€‹ <input class=โ€‹"ti-searchbox-input ng-pristine ng-untouched ng-valid ng-valid-maxlength" ng-class=โ€‹"{'ti-searchbox-input-clear-shown':โ€‹ isShowClear}โ€‹" ng-disabled=โ€‹"disable" ng-focus=โ€‹"focusFn($event)โ€‹" spellcheck=โ€‹"false" ng-keydown=โ€‹"inputKeydown($event)โ€‹" ng-blur=โ€‹"blurFn()โ€‹" ng-model=โ€‹"value" ng-model-options=โ€‹"{updateOn:โ€‹ 'default blur', debounce:โ€‹ { 'default':โ€‹ 200, 'blur':โ€‹ 0 }โ€‹}โ€‹" ng-change=โ€‹"changeFn(value)โ€‹" maxlength ng-trim=โ€‹"true" id placeholder>โ€‹ <input class=โ€‹"ti-searchbox-input ng-pristine ng-untouched ng-valid ng-valid-maxlength" ng-class=โ€‹"{'ti-searchbox-input-clear-shown':โ€‹ isShowClear}โ€‹" ng-disabled=โ€‹"disable" ng-focus=โ€‹"focusFn($event)โ€‹" spellcheck=โ€‹"false" ng-keydown=โ€‹"inputKeydown($event)โ€‹" ng-blur=โ€‹"blurFn()โ€‹" ng-model=โ€‹"value" ng-model-options=โ€‹"{updateOn:โ€‹ 'default blur', debounce:โ€‹ { 'default':โ€‹ 200, 'blur':โ€‹ 0 }โ€‹}โ€‹" ng-change=โ€‹"changeFn(value)โ€‹" maxlength ng-trim=โ€‹"true" id placeholder>โ€‹
    /CloudANet-1/?region=cn-north-7&locale=zh-cn#/CloudAutoNet/CloudNetChannel/backupDetailSingle/:1 [DOM] Found 2 elements with non-unique id #: (More info: https://goo.gl/9p2vKq) <input class=โ€‹"ti-searchbox-input ng-pristine ng-untouched ng-valid ng-valid-maxlength" ng-class=โ€‹"{'ti-searchbox-input-clear-shown':โ€‹ isShowClear}โ€‹" ng-disabled=โ€‹"disable" ng-focus=โ€‹"focusFn($event)โ€‹" spellcheck=โ€‹"false" ng-keydown=โ€‹"inputKeydown($event)โ€‹" ng-blur=โ€‹"blurFn()โ€‹" ng-model=โ€‹"value" ng-model-options=โ€‹"{updateOn:โ€‹ 'default blur', debounce:โ€‹ { 'default':โ€‹ 200, 'blur':โ€‹ 0 }โ€‹}โ€‹" ng-change=โ€‹"changeFn(value)โ€‹" maxlength ng-trim=โ€‹"true" id placeholder>โ€‹ <input class=โ€‹"ti-searchbox-input ng-pristine ng-untouched ng-valid ng-valid-maxlength" ng-class=โ€‹"{'ti-searchbox-input-clear-shown':โ€‹ isShowClear}โ€‹" ng-disabled=โ€‹"disable" ng-focus=โ€‹"focusFn($event)โ€‹" spellcheck=โ€‹"false" ng-keydown=โ€‹"inputKeydown($event)โ€‹" ng-blur=โ€‹"blurFn()โ€‹" ng-model=โ€‹"value" ng-model-options=โ€‹"{updateOn:โ€‹ 'default blur', debounce:โ€‹ { 'default':โ€‹ 200, 'blur':โ€‹ 0 }โ€‹}โ€‹" ng-change=โ€‹"changeFn(value)โ€‹" maxlength ng-trim=โ€‹"true" id placeholder>โ€‹`
    
    `main.js:2 Uncaught Error: Unexpected token "" while parsing selector ""
        at unexpected (<anonymous>:206:16)
        at consumeSimpleSelector (<anonymous>:336:19)
        at consumeComplexSelector (<anonymous>:260:48)
        at consumeArgument (<anonymous>:256:16)
        at consumeFunctionArguments (<anonymous>:240:25)
        at Object.parseCSS (<anonymous>:345:20)
        at <anonymous>:1384:43
        at Array.map (<anonymous>)
        at Object.parseSelector (<anonymous>:1378:33)
        at InjectedScript.parseSelector (<anonymous>:1526:41)
    unexpected @ VM25:206
    consumeSimpleSelector @ VM25:336
    consumeComplexSelector @ VM25:260
    consumeArgument @ VM25:256
    consumeFunctionArguments @ VM25:240
    parseCSS @ VM25:345
    (anonymous) @ VM25:1384
    parseSelector @ VM25:1378
    parseSelector @ VM25:1526
    generateSelector @ VM548:2711
    _commitActionAndUpdateModelForHoveredElement @ VM548:2406
    _onMouseMove @ VM548:2383
    eval @ VM548:2207
    invokeTask @ main.js:2
    runTask @ main.js:2
    invokeTask @ main.js:2
    invokeTask @ main.js:2
    globalZoneAwareCaptureCallback @ main.js:2
    main.js:2 Uncaught Error: Unexpected token "" while parsing selector ""
        at unexpected (<anonymous>:206:16)
        at consumeSimpleSelector (<anonymous>:336:19)
        at consumeComplexSelector (<anonymous>:260:48)
        at consumeArgument (<anonymous>:256:16)
        at consumeFunctionArguments (<anonymous>:240:25)
        at Object.parseCSS (<anonymous>:345:20)
        at <anonymous>:1384:43
        at Array.map (<anonymous>)
        at Object.parseSelector (<anonymous>:1378:33)
        at InjectedScript.parseSelector (<anonymous>:1526:41)
    unexpected @ VM25:206
    consumeSimpleSelector @ VM25:336
    consumeComplexSelector @ VM25:260
    consumeArgument @ VM25:256
    consumeFunctionArguments @ VM25:240
    parseCSS @ VM25:345
    (anonymous) @ VM25:1384
    parseSelector @ VM25:1378
    parseSelector @ VM25:1526
    generateSelector @ VM548:2711
    _commitActionAndUpdateModelForHoveredElement @ VM548:2406
    _onMouseMove @ VM548:2383
    eval @ VM548:2207
    invokeTask @ main.js:2
    runTask @ main.js:2
    invokeTask @ main.js:2
    invokeTask @ main.js:2
    globalZoneAwareCaptureCallback @ main.js:2
    main.js:2 Uncaught Error: Unexpected token "" while parsing selector ""
        at unexpected (<anonymous>:206:16)
        at consumeSimpleSelector (<anonymous>:336:19)
        at consumeComplexSelector (<anonymous>:260:48)
        at consumeArgument (<anonymous>:256:16)
        at consumeFunctionArguments (<anonymous>:240:25)
        at Object.parseCSS (<anonymous>:345:20)
        at <anonymous>:1384:43
        at Array.map (<anonymous>)
        at Object.parseSelector (<anonymous>:1378:33)
        at InjectedScript.parseSelector (<anonymous>:1526:41)
    unexpected @ VM25:206
    consumeSimpleSelector @ VM25:336
    consumeComplexSelector @ VM25:260
    consumeArgument @ VM25:256
    consumeFunctionArguments @ VM25:240
    parseCSS @ VM25:345
    (anonymous) @ VM25:1384
    parseSelector @ VM25:1378
    parseSelector @ VM25:1526
    generateSelector @ VM548:2711
    _commitActionAndUpdateModelForHoveredElement @ VM548:2406
    _onMouseMove @ VM548:2383
    eval @ VM548:2207
    invokeTask @ main.js:2
    runTask @ main.js:2
    invokeTask @ main.js:2
    invokeTask @ main.js:2
    globalZoneAwareCaptureCallback @ main.js:2
    main.js:2 Uncaught Error: Unexpected token "" while parsing selector ""
        at unexpected (<anonymous>:206:16)
        at consumeSimpleSelector (<anonymous>:336:19)
        at consumeComplexSelector (<anonymous>:260:48)
        at consumeArgument (<anonymous>:256:16)
        at consumeFunctionArguments (<anonymous>:240:25)
        at Object.parseCSS (<anonymous>:345:20)
        at <anonymous>:1384:43
        at Array.map (<anonymous>)
        at Object.parseSelector (<anonymous>:1378:33)
        at InjectedScript.parseSelector (<anonymous>:1526:41)
    unexpected @ VM25:206
    consumeSimpleSelector @ VM25:336
    consumeComplexSelector @ VM25:260
    consumeArgument @ VM25:256
    consumeFunctionArguments @ VM25:240
    parseCSS @ VM25:345
    (anonymous) @ VM25:1384
    parseSelector @ VM25:1378
    parseSelector @ VM25:1526
    generateSelector @ VM548:2711
    _commitActionAndUpdateModelForHoveredElement @ VM548:2406
    _onMouseMove @ VM548:2383
    eval @ VM548:2207
    invokeTask @ main.js:2
    runTask @ main.js:2
    invokeTask @ main.js:2
    invokeTask @ main.js:2
    globalZoneAwareCaptureCallback @ main.js:2
    

    Is there any way to resolve this problems?

    triaging 
    opened by LongLiveY96 1
  • [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 7
  • [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 38
  • [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?

    opened by ephung01 49
  • [test] Test failed: com.microsoft.playwright.TestBrowserContextProxy.shouldExcludePatterns

    [test] Test failed: com.microsoft.playwright.TestBrowserContextProxy.shouldExcludePatterns

    Test failed on windows: Chromium/Webkit/Firefox

    [INFO] ------------------------------------------------------- [INFO] T E S T S [INFO] ------------------------------------------------------- [INFO] Running com.microsoft.playwright.TestBrowserContextProxy [ERROR] WARNING: An illegal reflective access operation has occurred [ERROR] WARNING: Illegal reflective access by com.google.gson.internal.reflect.UnsafeReflectionAccessor (file:/C:/Users/ephun/.m2/repository/com/google/code/gson/gson/2.8.6/gson-2.8.6.jar) to field java.io.DataInputStream.bytearr [ERROR] WARNING: Please consider reporting this to the maintainers of com.google.gson.internal.reflect.UnsafeReflectionAccessor [ERROR] WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations [ERROR] WARNING: All illegal access operations will be denied in a future release [ERROR] Tests run: 8, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 10.94 s <<< FAILURE! - in com.microsoft.playwright.TestBrowserContextProxy [ERROR] com.microsoft.playwright.TestBrowserContextProxy.shouldExcludePatterns Time elapsed: 0.409 s <<< FAILURE! org.opentest4j.AssertionFailedError: did not throw at com.microsoft.playwright.TestBrowserContextProxy.shouldExcludePatterns(TestBrowserContextProxy.java:180)

    opened by ephung01 0
Releases(v1.10.0)
Owner
Microsoft
Open source projects and samples from Microsoft
Microsoft
cdp4j - Chrome DevTools Protocol for Java

cdp4j - Browser automation libray for Java cdp4j is Java library with a clear and concise API to automate Chrome/Chromium based browser. It use Google

WebFolder 80 Mar 15, 2021
Clojure bindings for the Chromium Embedded Framework

clj-cef Clojure bindings for the Chromium Embedded Framework Dependency: Rationale From https://bitbucket.org/chromiumembedded/cef/src/master/ Some us

Adrian 30 Mar 25, 2021
Test Automation Made Simple

Karate Test Automation Made Simple. Karate is the only open-source tool to combine API test-automation, mocks, performance-testing and even UI automat

Intuit 4.5k Mar 13, 2021
A browser automation framework and ecosystem.

Selenium Selenium is an umbrella project encapsulating a variety of tools and libraries enabling web browser automation. Selenium specifically provide

Selenium 20.3k Mar 15, 2021
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 538 Mar 13, 2021
Layout and functional testing framework for websites

Galen Framework master: Galen is an open-source tool for testing layout and responsive design of web applications. It is also a powerfull functional t

Galen Framework 1.4k Mar 5, 2021
Enabling Test Automation in Java

SeLion Enabling Test Automation in Java SeLion builds on top of TestNG and Selenium to provide a set of capabilities that get you up and running with

PayPal 252 Feb 2, 2021
A simple yet powerful parameterized test runner for Java.

TestParameterInjector Introduction TestParameterInjector is a JUnit4 test runner that runs its test methods for different combinations of field/parame

Google 44 Apr 6, 2021
Test if a request/response matches a given raml definition

raml-tester Test if a request/response matches a given raml definition. Versioning Version Contents 0.8.x Stable version, uses RAML parser 0.8.x and s

Stefan Niederhauser 70 Oct 7, 2020
Java binding for Hoverfly

Hoverfly Java - Easy Creation of Stub Http Servers for Testing A Java native language binding for Hoverfly, a Go proxy which allows you to simulate ht

null 130 Feb 7, 2021
Roman Beskrovnyi 145 Mar 13, 2021
Captures log entries for unit testing purposes

LogCaptor Install with maven <dependency> <groupId>io.github.hakky54</groupId> <artifactId>logcaptor</artifactId> <version>2.4.0</version>

null 55 Mar 11, 2021
PowerMock is a Java framework that allows you to unit test code normally regarded as untestable.

Writing unit tests can be hard and sometimes good design has to be sacrificed for the sole purpose of testability. Often testability corresponds to go

PowerMock 3.4k Mar 13, 2021
PowerMock is a Java framework that allows you to unit test code normally regarded as untestable.

Writing unit tests can be hard and sometimes good design has to be sacrificed for the sole purpose of testability. Often testability corresponds to go

PowerMock 3.4k Mar 15, 2021