Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (29.3k points)

I'm looking at Selenium Server at the moment, and I don't seem to notice a driver that supports headless browser testing.

Unless I'm mistaken, it doesn't support it. If you're on X, you can create a virtual framebuffer to hide the browser window, but that's not really a headless browser.

Can anyone enlighten me? Does Selenium support headless browser testing?

1 Answer

0 votes
by (50.2k points)

Yes, you can run the headless browser testing with selenium for that you need not use PhantomJS as an alternative to Selenium. It includes a webdriver of Phantomjs class. You just need to install binary to your machine in python you can use this

from selenium import webdriver

dr = webdriver.PhantomJS() 

This will import the Phantomjs or else you can use 

options.addArguments("--headless");

For chrome driver which enables you to run a headless test in chromedriver.

For further reference: https://developers.google.com/web/updates/2017/04/headless-chrome

Browse Categories

...