0

得到如下错误:

C:\Ruby\Scripts>W9_File_delete_v1.rb
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.30.0/lib/selenium/webdr
iver/common/timeouts.rb:33:in `page_load=': undefined method `setTimeout' for #<
Selenium::WebDriver::Driver:0xa3263e4 browser=:firefox> (NoMethodError)
        from C:/Documents and Settings/rakshiar/My Documents/userdata/Ruby/Scrip
ts/W9_File_delete_v1.rb:19:in `<main>'

使用以下代码:

#--------------------------------------------------------------
#Creating here Firefox Browser agent to get into the
#file deletion process
#--------------------------------------------------------------
driver = Selenium::WebDriver.for :firefox
driver.get "https://demo.com/"

#driver.manage.timeouts.implicit_wait = 200 # seconds
pgload = Selenium::WebDriver::Timeouts.new(driver)
pgload.page_load=(300)

我可以帮忙吗?

4

1 回答 1

1

您不需要Selenium::WebDriver::Timeouts直接创建对象。相反,请使用driver对象中的适当方法。

driver.manage.timeouts.page_load = 300
于 2013-03-18T16:03:15.767 回答