Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium Webdriver Exception: u'f.QueryInterface is not a function

I've run into an interesting exception but I haven no Idea what caused it.

This is my exception:

File "/Users/tai/Documents/workspace/testSelenium/testS/__init__.py", line 86, in runFlashY
    openWebsites()    File "/Users/tai/Documents/workspace/testSelenium/testS/__init__.py", line 50, in openWebsites
     newSwfFiles = Sniffer.openURL(line, []);
 File "/Users/tai/Documents/workspace/testSelenium/testS/Sniffer.py", line 98, in openURL
getAllFiles();
 File "/Users/tai/Documents/workspace/testSelenium/testS/Sniffer.py", line 211, in getAllFiles
outUrl= getredirectedUrl(b[place]);
  File "/Users/tai/Documents/workspace/testSelenium/testS/Sniffer.py", line 249, in getredirectedUrl
browser.get(s);
 File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 178, in get
self.execute(Command.GET, {'url': url})
  File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 166, in execute
    self.error_handler.check_response(response)
  File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 164, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: u'f.QueryInterface is not a function' ;       Stacktrace: 
    at FirefoxDriver.prototype.get (file:///var/folders/w5/w7rmb9zj7sz3wv8pq64c8h3h0000gn/T/tmpQcIHoK/extensions/[email protected]/components/driver_component.js:8768)
    at DelayedCommand.prototype.executeInternal_/h (file:///var/folders/w5/w7rmb9zj7sz3wv8pq64c8h3h0000gn/T/tmpQcIHoK/extensions/[email protected]/components/command_processor.js:10884)
    at DelayedCommand.prototype.executeInternal_ (file:///var/folders/w5/w7rmb9zj7sz3wv8pq64c8h3h0000gn/T/tmpQcIHoK/extensions/[email protected]/components/command_processor.js:10889)
    at DelayedCommand.prototype.execute/<    (file:///var/folders/w5/w7rmb9zj7sz3wv8pq64c8h3h0000gn/T/tmpQcIHoK/extensions/[email protected]/components/command_processor.js:10831) 

I googled this exception and only found a few websites that had anything related to this error, however none of them had a solution that I understood. What is weird to me is that for the past 1 month I haven't run into this error and today when it has started occurring I wasn't working on this file.

The only modifications I have been making are in another file wheree I've been setting up a DynamoDb connection. I don't see how this could be related. In addition I was working with the dynamodb connection file and there is no way that the code is related. The url's I'm feeding in have not changed, none of the code in the files referenced in the error have been edited for days. I tried reverting to a earlier phase in my code but the error still appears sometimes. S

I know that it's reading in urls from a text file and then opening them up with selenium webdriver. The only thing I can point to that I've changed is updating my computer with the latest apple software update. Has anyone else had this experience? Before this began failing I updated my macbook air to EFI firmware update version 2.8.

I can't see a reason why editing another file would cause this error since the exception appears to be occurring in web driver's .get function.

I'm checking my sanity here, I can't find what could have triggered this. There is little to no documentation online on this error (exactly 5 google results as of posting).

like image 751
Tai Avatar asked Jun 13 '14 17:06

Tai


2 Answers

In my case that's was just wrong parsing from config.

I got same error

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

Url which I wrote was placed in quotes, but it's wrong. Url should stay as it is without any quotes.

Your error here self.execute(Command.GET, {'url': url})

Just remove quotes.

like image 135
kimandrew Avatar answered Nov 18 '22 13:11

kimandrew


you should use the URL in this "http://" format (Ex: "http://www.google.com"). Change your code as mentioned above and run it.

like image 22
Shaik Avatar answered Nov 18 '22 13:11

Shaik