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 30, 2018 in Selenium by eLiJha
• 770 points
3,094 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 30, 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 22, 2020 in Selenium by Abdul
33,255 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, 2019 in Selenium by Abha
• 28,140 points
5,016 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,710 points
10,322 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,910 points
9,313 views
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
12,717 views
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
8,611 views
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,910 points
6,685 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
40,682 views
+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 mslavikas@gmail.com
25,585 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP