Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in DevOps and Agile by (19.7k points)

When I execute multiple tests simultaneously, I don't want to keep the Firefox browser window visible. I can minimize it using  selenium.minimizeWindow()  but I don't want to do it.

Is there any way to hide the Firefox window? I am using FireFox WebDriver.

1 Answer

0 votes
by (27.5k points)

The default browser of PhantomJS is IE, though many browser features do not work there. In case you want to open a headless(hidden) Firefox window, you can use the new feature of Firefox 56+.

With this feature you can get a headless driver like this:

System.setProperty("webdriver.gecko.driver", firefoxDriverExePath);

FirefoxOptions options = new FirefoxOptions();


FirefoxDriver driver = new FirefoxDriver(options);

If you are interested to learn Selenium on a much deeper level and want to become a professional in the testing domain, check out Intellipaat’s Selenium online certification exam

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers


94.2k users

Browse Categories