How to enable WebGL if i'm using headless chrome on Ubuntu?

0 votes
How to install webgl in headless chrome in Ubuntu 14? I have tried installing libosmesa6, but this did not work. Can someone please help me out because I wanna use webgl on headless chrome for selenium tests. I'm using nightwatch to run tests.
May 29, 2018 in Selenium by eLiJha
• 760 points

1 answer to this question.

0 votes

Use this on Chrome for using osmesa

sudo apt-get install libosmesa
sudo ln -s /usr/lib/x86_64-linux-gnu/ /opt/google/chrome/
google-chrome --no-first-run --user-data-dir=~/chrome-stuff --use-gl=osmesa

Warning: If your using osmesa, the entire page will be rendered with osmesa thus making it slow. So, if you can run tests that do not need WebGL, then this is preferable. 
You might also want to know that Chrome itself uses osmesa to headless test. But not all versions. Check out the suported versions here:
Or else, for running headless in general, you can use this:

answered May 29, 2018 by sniffy_god
• 780 points

Related Questions In Selenium

0 votes
1 answer

How to save as PDF on Chrome using Selenium

Hey, Vaishnavi! You could try to disable ...READ MORE

answered Mar 8, 2019 in Selenium by Surya
• 970 points
0 votes
1 answer

How to launch Chrome browser using Selenium Webdriver on MAC?

Hey Lucas, you can launch chrome browser ...READ MORE

answered Jul 18, 2019 in Selenium by Abha
• 27,740 points
0 votes
1 answer

How do i click on <input type=file> on any browser if i'm testing with Selenium Webdriver?

Does not matter which OS or which ...READ MORE

answered Apr 29, 2018 in Selenium by king_kenny
• 3,690 points
0 votes
1 answer

How to control Chrome Downloads page Using Selenium c#?

In your case you must replace 'cancel' ...READ MORE

answered May 7, 2018 in Selenium by Samarpit
• 5,850 points
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,510 points
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,850 points
+2 votes
1 answer

I want the console.log output from Chrome. I'm working with selenium on Python

So this is how you do it ...READ MORE

answered May 3, 2018 in Selenium by sniffy_god
• 780 points
+1 vote
2 answers

Is it possible to scroll down in a webpage using selenium webdriver programmed on python?

I using next code for facebook for ...READ MORE

answered May 16, 2019 in Selenium by