0 votes
1 view
in Devops and Agile by (19.8k 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 (28.4k 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);

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


Categories

...