I'm using selenium to do some stuff that involves loading quite a number of pages, potentially with numerous images and/or flash ads, which is apparently rather stressful on the browsers, since my firefox browsers are freezing. Is selenium capable of detecting if a browser is frozen, as in has reached that horrid state of "not responding" in the task manager and won't focus if i click on the tab? If not, does anybody know of a way to deal with that case?
EDIT:
I ended up using the following:
browser = webdriver.Firefox()
try:
browser.set_page_load_timeout(_DEFAULT_LOAD_TIME)
browser.get('http://' + domain)
except TimeoutException as te:
print "Loading %s timed out. Killing browser." % domain
print te
browser.close()
Although it does not close the browser if it gets into a (not responding) state, but with a low enough _DEFAULT_LOAD_TIME, it usually manages to kill the browser before it gets into that state.