问题
I'm using selenium + phantomjs in my application, but I want to start my application, selenium and phantomjs window in background. How can I do it?
I tried:
PhantomJSOptions options = new PhantomJSOptions();
options.AddAdditionalCapability("start-maximized", false);
IWebDriver driver = new PhantomJSDriver(Environment.CurrentDirectory + @"\drivers", options);
回答1:
var serviceJs = PhantomJSDriverService.CreateDefaultService(phantomPath);
serviceJs.HideCommandPromptWindow = true;
Instance = new PhantomJSDriver(serviceJs);
来源:https://stackoverflow.com/questions/26133336/how-can-i-start-phantomjs-selenium-window-in-background