使用Watir时,“NameError:未初始化的常量UserAgent”

时间:2013-03-07 01:00:18

标签: ruby selenium webdriver watir irb

我是ruby的新手,我似乎已经成功安装了watir-webdriverwebdriver-user-agent宝石,但当我试图按照说明here时,我偶然发现了。怎么办?

>> require 'watir-webdriver'
=> true
>> require 'webdriver-user-agent'
=> true
>> driver = UserAgent.driver(:browser => :chrome, :agent => :iphone, :orientation => :landscape)
NameError: uninitialized constant UserAgent
    from (irb):3
    from /usr/bin/irb:12:in `<main>'

1 个答案:

答案 0 :(得分:7)

尝试使用Webdriver::UserAgent