1
在Visual Studio中使用MSTest时,我遇到了Selenium WebDriver,特别是ChromeDriver的问题。每当我打电话给ChromeDriver退出时,我都会收到“chromedriver.exe”已停止工作的消息“并且程序冻结了。Selenium ChromeDriver在Quit()上停止工作
我试图在所有测试结束时关闭每个驱动程序,在类清理:
[ClassCleanup]
public static void ClassCleanup() {
drivers.ForEach(x => x.Quit());
}
Firefox的驱动程序倒闭罚款,但Chrome的司机总是甫一停止工作谁能帮我这个
编辑:?我更多的代码一点,为清楚起见(路径指向我已经添加到我的解决方案中的chromedriver.exe程序):
static IWebDriver driver;
static IWebDriver chromeDriver;
static string baseURL;
static List<IWebDriver> drivers;
[ClassInitialize]
public static void ClassInitialize(TestContext context) {
drivers = new List<IWebDriver>();
driver = new FirefoxDriver();
chromeDriver = new ChromeDriver(path);
drivers.Add(driver);
drivers.Add(chromeDriver);
baseURL = "http://localhost:4444/";
}