Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I'm updating to version 2.40 and was looking at the change log. http://selenium.googlecode.com/git/dotnet/CHANGELOG

It says "Now provide an option to hide command prompt window for driver service executables (IEDriverServer.exe, chromedriver.exe, etc.) in .NET bindings."

I can't find what setting to use to make this happen. How do I do it?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

Yes, you can hide command prompt window now in Selenium 2.40.0. I was writing a blog article about this earlier, which you might want to have a look here.

Please note that hiding command prompt window is not recommended.

ChromeDriver

var driverService = ChromeDriverService.CreateDefaultService();
driverService.HideCommandPromptWindow = true;

var driver = new ChromeDriver(driverService, new ChromeOptions());

InternetExplorerDriver

var driverService = InternetExplorerDriverService.CreateDefaultService();
driverService.HideCommandPromptWindow = true;

var driver = new InternetExplorerDriver(driverService, new InternetExplorerOptions());

PhantomJSDriver

var driverService = PhantomJSDriverService.CreateDefaultService();
driverService.HideCommandPromptWindow = true;

var driver = new PhantomJSDriver(driverService);
share|improve this answer
    
Interesting that it is an option, even though it is not suggested. Do you know an acceptable use case for this? –  Aligned Mar 5 at 20:01
1  
@Aligned: If someone is using Selenium to develop an application that runs on client's computer. So it is a good idea to hide command window. Otherwise for testing purposes, I can't think of any. –  Yi Zeng Mar 5 at 20:30
2  
@Aligned It's an option because enough people who use the .NET bindings asked for it, even though the maintainer of the .NET bindings believes it to be a mistake to hide the window. If, for some reason, your WebDriver code fails, and incorrectly doesn't call the .Quit method, with the command prompt window showing, it's blatantly obvious there's an extra process running. With the command prompt window hidden, it's not obvious. –  JimEvans Mar 26 at 22:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.