Wednesday, April 29, 2015

selenium.common.exceptions.WebDriverException: Message: f.QueryInterface is not a function


browser.get('google.com')

&

browser.get('www.google.com')

while trying to execute the above statement, I see the following error


browser.get('google.com')
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 187, in get
    self.execute(Command.GET, {'url': url})
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 175, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 166, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: f.QueryInterface is not a function


If you look at the line self.execute(Command.GET, {'url': url}) the statement says GET method accepts the URL 


So, selenium throws error if the URL is not in the proper format. URL should contain http/https and www (Ex: "http://www.google.com")

The following code works:

 browser.get("http://www.google.com")

No comments:

Post a Comment