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
• 770 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
2 answers

How to save as PDF on Chrome using Selenium

Vaishanvi, Select  ID  selected dropdown or it ...READ MORE

answered Feb 21, 2020 in Selenium by Abdul
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
• 28,040 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,710 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,890 points
0 votes
1 answer
0 votes
2 answers

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,500 points
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
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,890 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