1

I'm having an issue I've hit a wall on, I'm hoping someone else has encountered. I am running selenium/splinter tests on a VM with Chromedriver installed. When I open the webpage on the VM with Chrome the WebGL objects work, when I watch the script run via selenium, the WebGL objects error.

So far I have checked the Chrome settings in chrome://flags/ and everything is enabled. I've updated my chromedriver. What are some other potential things I might check out? I haven't been able to reproduce this issue on my local machine.

The error I'm getting is:

WebGL not enabled

where the WebGL object would normally be displayed. Which WebGL is enabled when opened via the browser.

1

You need to verify webgl is activated. Type on chrome address bar:
chrome://gpu/
You should see:

enter image description here


If not, follow this steps:

  1. Open Google Chrome
  2. Type chrome://flags in the address bar
  3. Press Ctrl + f and type ” Rendering list “, “Override software rendering list” should come up, Now click on Enable and restart the browser
  4. Completely kill Chrome: Type killall chrome into a console.
  5. Go to chrome://settings and enable Use hardware acceleration when available. By default it is off since version 43
1

You might have to run Chrome using a profile (set the capabilities when defining your WebDriver). I had to do that to get the DRM component to work.

Note: This will not work if any Chrome process is currently running. Be sure to close all Chrome processes before running your test(s) and only run 1 test at a time on any one machine (no parallel runs on one machine).

C# Code:

// Create an options object to specify command line arguments for the Chrome web driver
ChromeOptions options = new ChromeOptions();
// Use a real profile so that all components load
string localAppData = Environment.GetEnvironmentVariable("LocalAppData");
options.AddArgument(@"user-data-dir=" + localAppData + @"\Google\Chrome\User Data\");
options.AddArgument(@"--profile-directory=Default");
// Allow components to update (some components will not load if out of date)
options.AddExcludedArgument(@"disable-component-update");
// Disable extensions (optional, not needed to set/use a profile)
options.AddArgument(@"--disable-extensions");

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.