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

尝试运行Internet Explorer硒测试时出现以下错误:

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();


这个对我有用。

10-08 11:35
查看更多