2013-03-07 27 views
2

我是新來的紅寶石,我似乎已經成功安裝了watir-webdriverwebdriver-user-agent寶石,但是當我試圖按照說明here我絆了一下。如何進行?「NameError:未初始化的常量UserAgent」當使用Watir

>> 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>' 

回答

7

嘗試使用Webdriver::UserAgent

+0

謝謝,僅此而已。有沒有辦法看到範圍內的名字(類似於ipython中的'whos')?我檢查了'local_variables',但'Webdriver'不在那裏.. – wim 2013-03-07 01:09:04

相關問題