How can I start PhantomJS + Selenium window in background?

ぃ、小莉子 提交于 2019-12-01 04:25:51

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!