google-chrome - 在Selenium ChromeDriver中使用 native 消息传递?

标签 google-chrome selenium google-chrome-extension selenium-chromedriver chrome-native-messaging

我正在使用本机消息传递的chrome扩展程序。本机消息在我的个人Chrome副本上效果很好,但是当通过ChromeDriver在硒中使用该扩展程序时,我从扩展程序中收到错误消息:

Error in event handler for runtime.onMessage: Error: Attempting to use a disconnected port object


我正在通过以下量角器配置加载扩展:

capabilities: {
    'browserName': 'chrome',
    'chromeOptions': {
        'args': [
            '--load-extension=./build/chrome'
        ]
    },
}


要启用ChromeDriver中的本机消息传递,是否需要做一些特殊的事情?我尝试将我们的本机消息清单文件添加到Chrome和Chromium的全局位置,但还是没有运气。

最佳答案

截至2018.11,使用Chrome 70和chromedriver 2.43,本机消息传递效果很好。

关于google-chrome - 在Selenium ChromeDriver中使用 native 消息传递?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47851635/

相关文章:

google-chrome - 构建 Chrome : Unable to Rebase Cygwin

google-chrome - 为什么 woff2 不在 mimetype 目录中?

javascript - Google Chrome JavaScript 错误 - 无法调用 null 的方法 'join'

python - 按钮未被点击

javascript - 如何让桌面通知保持不变?

css - 焦点边框未出现在 html 按钮上或在 Google Chrome 中选择(仅限 OSX 10.10.3)

使用没有元素 id 的 Selenium 测试 Angularjs

Python - 如何从类调用外部函数然后返回到类

javascript - 如何从扩展中退出 Chrome?

javascript - 从内容脚本触发点击事件 - chrome 扩展