0

Getting error as below :

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

With the below code :

#--------------------------------------------------------------
#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)

Can I have help on that.

1 Answer 1

1

You should not need to create the Selenium::WebDriver::Timeouts object directly. Instead, use the appropriate method from the driver object.

driver.manage.timeouts.page_load = 300
Sign up to request clarification or add additional context in comments.

3 Comments

But what's the wrong with my above? Why that's statement didn't work? clarify please.
I do not know a lot about the selenium-webdriver internals, but my best guess is that you are initializing a Selenium::WebDriver::Timeouts object using a driver object. Based on the api docs, it expects a bridge object instead. It is usually best to use the public api rather than internal classes.
Humm! you are right.I have researched on it a lots. Good idea is to use,public methods. :) Thanks for your heads up.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.