一尘不染

如何在后台启动PhantomJS + Selenium窗口?

selenium

我在应用程序中使用selenium+ phantomjs,但我想在后台启动我的应用程序,selenium和phantomjs窗口。我该怎么做?

我试过了:

PhantomJSOptions options = new PhantomJSOptions();
options.AddAdditionalCapability("start-maximized", false);
IWebDriver driver = new PhantomJSDriver(Environment.CurrentDirectory + @"\drivers", options);

阅读 378

收藏
2020-06-26

共1个答案

一尘不染

var serviceJs = PhantomJSDriverService.CreateDefaultService(phantomPath);
serviceJs.HideCommandPromptWindow = true;

Instance = new PhantomJSDriver(serviceJs);
2020-06-26