Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error Failed to create a WebGL2 context. #55

Open
MohaseenKhan opened this issue Apr 15, 2024 · 1 comment
Open

Getting error Failed to create a WebGL2 context. #55

MohaseenKhan opened this issue Apr 15, 2024 · 1 comment

Comments

@MohaseenKhan
Copy link

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
Copy link
Owner

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants