gpt4 book ai didi

javascript - Selenium 构建 Internet Explorer 驱动程序 javascript 错误

转载 作者:行者123 更新时间:2023-12-03 02:20:06 38 4
gpt4 key购买 nike

我使用 selenium-standalone start --drivers.ie.arch=ia32 配置将我的 selenium 独立服务器设置为以 IEDriver 作为参数运行。

当我尝试运行 Internet Explorer Selenium 测试时,出现以下错误:

index.js:673
throw new Error('Do not know how to build driver: ' + browser
^

Error: Do not know how to build driver: IE; did you forget to call
usingServer(url)?

但是我的代码中列出了正确的服务器:

const {Builder, By, Key, until} = require('selenium-webdriver');

driver = await new webdriver.Builder().forBrowser('IE').usingServer('http://localhost:4444/wd/hub').build();

我也尝试过这个:

let driver = new webdriver.Builder()
.forBrowser('internet explorer')
.usingServer('http://localhost:4444/wd/hub')
.build();

但是这些都不起作用,我收到了相同的错误消息......

如有任何帮助,我们将不胜感激!

最佳答案

https://github.com/SeleniumHQ/selenium/wiki/Grid2刚读完这篇文章,你就错过了一些东西。并在将来以管理员身份运行 IE 测试。

driver = new webdriver.Builder().
usingServer("http://localhost:4444/wd/hub").
withCapabilities(webdriver.Capabilities.ie()).
build();

这对我有用。

关于javascript - Selenium 构建 Internet Explorer 驱动程序 javascript 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49196478/

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