markhobson / docker-maven-chrome

Docker image for Java automated UI tests.
https://hub.docker.com/r/markhobson/maven-chrome/
Apache License 2.0
96 stars 81 forks source link

Getting error Failed to create a WebGL2 context. #55

Open MohaseenKhan opened 2 months ago

MohaseenKhan commented 2 months ago

Hi @markhobson,

Thank you for this image. I was looking an image with the same configuration. I appreciate your contribution to our community. Thank you 😊.

I have a query i hope you will take a look at this.

I am currently using this image markhobson/maven-chrome:jdk-8 for launching chromeheadless in Linux OS. But i have 3D components in my application(Canvas). When i run by using this image it gives me an error in the console "THREE.WebGLRenderer: A WebGL context could not be created. Reason: " "Failed to create a WebGL2 context.".

I even added and tried with chrome options but it is still giving same error chromeOptions.addArguments("--no-sandbox"); chromeOptions.addArguments("--headless=new"); chromeOptions.addArguments("--disable-extensions"); chromeOptions.addArguments("--use-gl"); chromeOptions.addArguments("--disable-dev-shm-usage"); chromeOptions.addArguments("--disable-gpu");

I need to open chromeDriver with the following flags/options

--use-angle=swiftshader --use-gl=angle --in-process-gpu

What would you suggest the best option is here?

Thank you

markhobson commented 2 months ago

Hi @MohaseenKhan, I'm glad this image is useful.

I'm not familiar with those arguments but that is generally the way to pass arguments to ChromeDriver - see Capabilities and ChromeOptions. In their examples addArguments doesn't take the -- prefix, have you tried that?