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
• 700 points
402 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
• 760 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
• 780 points
609 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,590 points
2,052 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
643 views
0 votes
1 answer

How to Check if any alert exists in selenium using Python

This might work for you. It did ...READ MORE

answered May 10, 2018 in Selenium by king_kenny
• 3,590 points
2,329 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,030 points
60 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
432 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
• 760 points
5,278 views
0 votes
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 6 days ago in Selenium by mslavikas@gmail.com
4,239 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.