We develop extensions for Chrome, Firefox and Safari and we test our Chrome and Firefox extensions with Selenium. But the problem is, some of the Firefox tests get stuck for hours, and they only stop when we kill the display sudo killall Xvfb
(we could also kill the test process). Is it possible to set a time limit (15 minutes) for the Selenium tests, and the test will fail if it reached the time limit? I tried to set page load timeout but it doesn't solve the problem:
self.driver = webdriver.Firefox(firefox_profile=firefox_profile)
time.sleep(30)
self.driver.set_window_size(width=1920, height=1080)
size = self.driver.get_window_size()
print("Window size: width = {}px, height = {}px.".format(size["width"], size["height"]))
self.driver.set_page_load_timeout(time_to_wait=45)
We are using Selenium 2.45.0
. Do we need to upgrade?
My class inherits from unittest.TestCase
.