This may belong on the user list, but I don't think it does, as its a bit more advanced, and I have never been able to get a solid answer in the chat.
I have a page. It's pretty javascript heavy, but loads for "human" users in a reasonable amount of time(let's say < 1 minute). However, when a webdriver instance loads it, it takes 20+ minutes to load this one page. The method that I use to load the page is below(Ruby)
def Sel_Utils.loading?
sleep_timer = 0
begin
while(driver.find_element(:css, ".message"))
sleep 1
sleep_timer = sleep_timer + 1;
if sleep_timer > 500
sel_log.log("ERROR","Slept way too long waiting for Loading screen")
sel_log.stop
end
end
rescue
#puts "waited #{sleep_timer} seconds"
return
end
profile = Selenium::WebDriver::Firefox::Profile.new
profile["dom.max_script_run_time"] = 0
profile["dom.max_chrome_script_run_time"] = 0
profile.log_file = ("C:\\Selenium\\firefox.#{Time.now.strftime("%Y-%m-%d.%H%M%S")}.log")
profile.add_extension("firefox-XPIs/firebug-1.8.4.xpi")
profile["extensions.firebug.currentVersion"] = "9.99"
profile["extensions.firebug.console.enableSites"] = "true"
profile["extensions.firebug.defaultPanelName"] = "console"
profile.add_extension("firefox-XPIs/firepath.xpi")
client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = 5000 # seconds
driver = Selenium::WebDriver.for :firefox, :profile => profile, :http_client=> client
driver.manage.timeouts.implicit_wait = 3
waiter = Selenium::WebDriver::Wait.new(:timeout => 60)
driver.navigate.to(URL)
#At this point, we are brought to a login page
#Send_Keys and Clickobject are just waits to element.click and element.send_keys without having to find the element.
waiter.until{ driver.find_element(:css, "input[type='password']") }
if user != ''
Sel_Utils.Send_Keys("id", "username", user)
end
if pass != ''
Sel_Utils.Send_Keys("css", "input[type='password']",
end
Sel_Utils.ClickObject("css", "input[type='submit']")
Sel_Utils.loading?
while(driver.find_element(:css, ".n-datatable-loading-label").displayed?)
sleep 2
end
##It stays in this while loop for most of the 20 minutes
Any advice on what Selenium might be doing in the background that would cause the while loop that that is above to take 20 minutes to run