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
• 720 points
712 views

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/libOSMesa.so.6 /opt/google/chrome/libosmesa.so
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: https://cs.chromium.org/chromium/src/third_party/mesa/README.chromium
Or else, for running headless in general, you can use this: https://gist.github.com/addyosmani/5336747

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 in Selenium by Surya
• 970 points
5,042 views
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 in Selenium by Abha
• 27,180 points
388 views
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,650 points
3,667 views
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,130 points
1,858 views
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,110 points
1,009 views
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,130 points
1,154 views
+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
12,610 views
+1 vote
2 answers