运行此程序时遇到问题,我不断收到错误 .rb:45:in <main>': undefined method heade'
for DealerDetail:Class (NoMethodError) 我做错了什么我环顾四周,但找不到任何解决方案,我们将不胜感激
require 'watir-webdriver'
@browser = Watir::Browser.new
@page = [:dealerdetail => "www.google.com",
:findadealer => "www.google.com",
:findadealer_results => "www.google.com"
]
class DealerDetail
attr_accessor :browser
def heade
@browser.goto @page [:dealerdetail]
@browser.element(:id, 'mainNav').exists?
puts 'main navigation bar appears'
puts 'navigation bar does not appear'
end
def footer
if @browser.element(:id, 'pageFooter').exists?
puts 'footer appears'
elsif
puts 'Footer does not appear'
end
end
end
@deal = DealerDetail .new
@deal.heade