Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
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();

options.addArguments("--headless");

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

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...