I'm using PhantomJS + Selenium in my application. When I initialize PhantomJS, a console pops up on the screen. I would like to hide this console before it pops up. I have searched for an answer, and I found this:
var service = PhantomJSDriverService.CreateDefaultService(Environment.CurrentDirectory);
service.WebSecurity = false;
service.HideCommandPromptWindow = true;
var driver = new PhantomJSDriver(service);
The code above hides the console, but the problem is that when the console is hidden my Windows application loses the focus. So, it stops working while PhantomJS console is working. I need to hide the console and make my application work with PhantomJS at the same time.
Does anyone know how can I do that?
I am using this thing all the time works fine.
var driverService = PhantomJSDriverService.CreateDefaultService();
driverService.HideCommandPromptWindow = true;
var driver = new PhantomJSDriver(driverService);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With