gpt4 book ai didi

javascript - 使用 Selenium(Javascript) 打开第二个边缘窗口时出现 WebDriverError : Unknown error,

转载 作者:行者123 更新时间:2023-12-02 23:39:22 29 4
gpt4 key购买 nike

我正在使用 selenium 为 Edge 浏览器创建自动化工具,我需要并行打开具有三个不同 URL 的三个边缘窗口。第一个 Edge 浏览器窗口成功启动,但是当为第二个 URL 调用函数 openEdgeBrowser 时,会抛出异常:WebDriverError:未知错误

const webdriver = require('selenium-webdriver');
const edgedriver = require('edgedriver');
const edge = require('selenium-webdriver/edge');


var openEdgeBrowser = async function(url){

try {
let edgeService = await new edge.ServiceBuilder(edgedriver.path);
let browser = await new webdriver.Builder().forBrowser('MicrosoftEdge').setEdgeService(edgeService).build();
await browser.get(url);
console.log('Browser launched successfully with url: ' + url);
} catch(e) {
console.log.end(`Error in launching edge browser, Exception: ${e}`);
}
};

我希望同时运行三个 Edge 实例。

最佳答案

问题是 Edge 不支持多个实例:

Hi, This is a known issue.

I just checked the Feedback Hub and I only see a Microsoft internal posting for this issue. Will you add this to the Feedback Hub? Open the Feedback Hub app by using the Search Bar (Win + s) and typing “feedback hub”

The only workaround I am aware of is to use Selenium grid with multiple Windows Clients. The Clients can be Hyper-V instances.

Appreciate you reporting this issue and wish I had a better answer for you. :-/ Steve

https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/17754737/

推特上也注意到了同样的情况。

https://twitter.com/instylevii/status/783480823445987329

我找不到任何迹象表明此错误已得到修复,因此我假设它仍然悬而未决。它在版本 41.16299.15.0 中肯定仍然很出色,而且我在发行说明中找不到任何提及版本 42 中修复的内容。

关于javascript - 使用 Selenium(Javascript) 打开第二个边缘窗口时出现 WebDriverError : Unknown error,,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56142828/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com