SeleniumException:错误:未知命令

发布于 2024-09-30 17:49:27 字数 372 浏览 1 评论 0原文

我将 setExtensionJs 与定义 doFoo 原型的 user-extensions.js 文件一起使用。 每次 Selenium 启动时都会抛出异常:

CHECKPOINT-FAIL com.thoughtworks.selenium.SeleniumException: ERROR: Unknown command "doFoo"

setExtensionJs 调用当然是在 start 调用之前。

启动 Selenium 时:

-userExtensions user-extensions.js

可以正常工作。

有谁知道我为什么会得到例外?

I'm using setExtensionJs with an user-extensions.js file that defines a doFoo prototype.
This throws an exception everytime Selenium starts:

CHECKPOINT-FAIL com.thoughtworks.selenium.SeleniumException: ERROR: Unknown command "doFoo"

The setExtensionJs call is of course before of the start call.

Launching Selenium with:

-userExtensions user-extensions.js

works without problem.

Does anyone has an idea why I got the exception?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

叹倦 2024-10-07 17:49:28

正如我在 gyrmination 博客中指出的那样

对于任何尝试这样做的人来说只是一个提示
使用这个 SetExtensionJS() 接口。
您不能使用它来创建
Selenium 命令就像你可以用的
user-extensions.js,因为代码
注册命令处理程序正在运行
在 SetExtensionJS() 注入你的之前
代码。

对不起 :-(

As I noted over at the gyrmination blog:

Just a heads-up for anyone trying to
use this SetExtensionJS() interface.
You can’t use this to create a
Selenium command like you can with
user-extensions.js, because the code
that registers command handlers is run
before SetExtensionJS() injects your
code.

Sorry :-(

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文