12

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).

1
  • 1
    Try searching for f.QueryInterface is not a function instead. You'll get many more results. The leading u is just Python indicating that you have a Unicode string. Jun 13, 2014 at 18:22

4 Answers 4

7

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.

3

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

0

After the help of Luke:

I found: https://code.google.com/p/selenium/issues/detail?id=6988

I was able to get around this issue by doing the following:

Downgrade to FF v25
Install java on the mac
Download and run selenium server
After running it once I stopped the selenium server

Reran the my project tests and it worked fine.

Maybe the foxdriver is not getting installed properly?

I reinstalled firefox java and webdriver and that fixed my problem. I'm not sure what was actually going on. I think perhaps in the update something got redirected :S. But yeah in case anyone encounters this as well I believe that reinstalling all of your imports / tools will fix the issue. No idea how it happened but it wasn't a hard fix.

@Luke Woodward - thanks I didn't see the unicode part. I also didn't realize the error was unrelated to that.

0

IF YOU ARE USING ANGULAR

I was getting this error when I called Capybara.current_session.visit('about'). This was passing locally but failing in a docker container. This is because the docker container was running the app on http://docker.myapp.com:3000 . It was passing locally because I had grabbed the url to set from the browser and the browser had appended '/#/' because angular. When I changed the call to Capybara.current_session.visit('/#/about') everything worked perfectly.

Long story short. You may see this error with angular if you don't use '/#/'. Also, f.QueryInterface is not a function is the worst error message ever. Also, check your urls.

1
  • Interesting, I wasn't running angular but this may be helpful to others. Thanks!
    – Tai
    Nov 2, 2015 at 5:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.