2014-06-19 33 views
0

我能做到這樣,我可以使用新的對象的alias_method並給它固定參數嗎?

但我得到了一些錯誤有關硒

alias_method :select_by ,Selenium::WebDriver::Support::Select.new(@driver.find_element(:id, "time_entry_activity_id")).select_by 


[remote server] file:///var/folders/n5/b8s03z3d7ljg5w74qxm_k4500000gn/T/webdriver-profile20140619-17231-9tb59x/extensions/[email protected]/components/driver_component.js:9470:7:in `FirefoxDriver.prototype.findElementInternal_': Unable to locate element: {"method":"id","selector":"time_entry_activity_id"} (Selenium::WebDriver::Error::NoSuchElementError) 
    from [remote server] file:///var/folders/n5/b8s03z3d7ljg5w74qxm_k4500000gn/T/webdriver-profile20140619-17231-9tb59x/extensions/[email protected]/components/driver_component.js:9479:3:in `FirefoxDriver.prototype.findElement' 
    from [remote server] file:///var/folders/n5/b8s03z3d7ljg5w74qxm_k4500000gn/T/webdriver-profile20140619-17231-9tb59x/extensions/[email protected]/components/command_processor.js:11455:11:in `DelayedCommand.prototype.executeInternal_/h' 
    from [remote server] file:///var/folders/n5/b8s03z3d7ljg5w74qxm_k4500000gn/T/webdriver-profile20140619-17231-9tb59x/extensions/[email protected]/components/command_processor.js:11460:7:in `DelayedCommand.prototype.executeInternal_' 
    from [remote server] file:///var/folders/n5/b8s03z3d7ljg5w74qxm_k4500000gn/T/webdriver-profile20140619-17231-9tb59x/extensions/[email protected]/components/command_processor.js:11402:5:in `DelayedCommand.prototype.execute/<' 
    from /Users/hsu-wei-cheng/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/remote/response.rb:51:in `assert_ok' 
    from /Users/hsu-wei-cheng/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/remote/response.rb:15:in `initialize' 

回答

相關問題