我想设置浏览器的下载行为以满足测试需求
我已经尝试过这个主题的解决方案:puppeteer - how to set download location
var browser = await StartNewChromeAsync(); //starting new chrome without extensions
var pages = await browser.PagesAsync();
var firstPage = pages[0];
var cdp = await firstPage.Target.CreateCDPSessionAsync();
await cdp.SendAsync("Page.setDownloadBehavior", new
{
behavior = "allow",
downloadPath = Path.GetAbsolutePath("./testing_downloads")
});
await cdp.DetachAsync();
我希望,该文件将在 中下载./testing_downloads
,但它在默认路径中下载。我究竟做错了什么?