问题描述
我已经创建了一个播放器,它将在 C# 中使用 selenium 和 ChromeDriver 自动执行 chrome.它工作正常.
I have created a player which will automate chrome using selenium and ChromeDriver in C#. It's working fine.
我面临的问题是,当它为 ChromDriver 创建一个对象时,它将启动 ChromeDriver 应用程序,该应用程序会弹出,然后 Chrome 将加载.这是完美的,因为该应用程序正在为我加载那个 chrome.
Issue what I am facing is, when it creates an object for ChromDriver, it will start ChromeDriver application, which gets pop up and then Chrome will load. It's perfect as that application is loading that chrome for me.
无论如何,我可以打开隐藏的 ChromeDriver 吗?
Is there anyway, that I can open that ChromeDriver hidden?
推荐答案
是的,需要修改WebDriver\DriverService.cs中Start()
中的源代码;添加:
Yes, you need modify source code in WebDriver\DriverService.cs in Start()
; add:
this.driverServiceProcess.StartInfo.CreateNoWindow = true;
这篇关于ChromeDriver 控制台应用程序隐藏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!