首页 文章

robot framework - 使用selenium grid启动远程浏览器时出错

提问于
浏览
1

如果我遗漏任何细节,请第一次在这里发帖,请原谅我 .

我使用以下设置:
机器人框架:3.0.1(Python 2.7.10)
硒:3.4.1
selenium2library:1.4.1

我有一台mac机器配置为网格集线器,另一台mac机器配置为节点 .

这是我的RF测试:

Open Browser    url=http://www.google.com    browser=firefox    remote_url=http://hub-server:4444/wd/hub    desired_capabilities=browser:firefox
Maximize Browser Window

我只是想尝试在其他机器上打开浏览器以使其正常工作,但在尝试执行脚本时出现以下错误:

KeyError:'desiredCapabilities'

当我将测试更改为:

Open Browser    url=http://www.google.com    browser=firefox    remote_url=http://hub-server:4444/wd/hub    desiredCapabilities=browser:firefox
Maximize Browser Window

我收到此错误:

关键字'Selenium2Library.Open Browser'在命名参数后得到了位置参数 .

我用Google搜索并发现https://github.com/SeleniumHQ/selenium/issues/3808但我不确定这是否与我的问题有关 . 任何帮助深表感谢 . 谢谢!

1 回答

  • 0

    根据文档,关键字是 desired_capabilities ,而不是 desiredCapabilities

    如果为remote指定值,则还可以指定'desired_capabilities',它是key1:val1,key2:val2形式的字符串,用于指定远程服务器的desired_capabilities . 这对于为Internet Explorer指定代理服务器或指定浏览器和操作系统(如果您使用saucelabs.com)非常有用 . 'desired_capabilities'也可以是dictonary(用'Create Dictionary'创建)以允许更复杂的配置 .

相关问题