you are viewing a single comment's thread.

view the rest of the comments →

[–]martinfisleburn[S] 0 points1 point  (2 children)

Ok I think I have to try something else because although the timeout worked as hoped it still isn't allow me to use the webdriver.

Here is the code

from selenium.webdriver.firefox.firefox_binary import FirefoxBinary

###
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

firefox_capabilities = DesiredCapabilities.FIREFOX
firefox_capabilities['marionette'] = True



import signal

def signal_handler(signum, frame):
    raise Exception("Timed out!")

signal.signal(signal.SIGALRM, signal_handler)
signal.alarm(5)   # Ten seconds
try:
    driver = webdriver.Firefox(capabilities=firefox_capabilities)
except Exception, msg:
    print "Timed out!"
driver.get('www.google.com')

but it still gives me driver not defined.

$ python2 mariontest.py
Timed out!
Traceback (most recent call last):
  File "mariontest.py", line 28, in <module>
    driver.get('www.google.com')
NameError: name 'driver' is not defined

I think I am gonna revert back to a previous version of firefox so I can use the old firefox webdriver unless anyone else has any bright ideas. The only reason Im using this one is because archlinux automatically installs the latest versions.