2
import org.apache.xpath.operations.String;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;


 public class First {

    public static void main(String[] args)
    {
        WebDriver driver=new FirefoxDriver();
        driver.get("www.facebook.com");
        driver.manage().window().maximize();
    }

}

I am getting this error when I am trying to run it in Eclipse Kepler:

Exception in thread "main" org.openqa.selenium.WebDriverException: f.QueryInterface is not a function Command duration or timeout: 18 milliseconds Build info: version: '2.46.0', revision: '87c69e2', time: '2015-06-04 16:17:10' System info: host: 'Jyoti-PC', ip: '192.168.112.1', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_40' Driver info: org.openqa.selenium.firefox.FirefoxDriver Capabilities [{applicationCacheEnabled=true, rotatable=false, handlesAlerts=true, databaseEnabled=true, version=37.0.1, platform=WINDOWS, nativeEvents=false, acceptSslCerts=true, webStorageEnabled=true, locationContextEnabled=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}] Session ID: a35eb217-b3b2-4de8-abc2-4e72ceb06916 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:605) at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:306) at first.main(first.java:10) Caused by: org.openqa.selenium.WebDriverException: f.QueryInterface is not a function Build info: version: '2.46.0', revision: '87c69e2', time: '2015-06-04 16:17:10' System info: host: 'Jyoti-PC', ip: '192.168.112.1', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_40' Driver info: driver.version: unknown at .FirefoxDriver.prototype.get(file:///C:/Users/Jyoti/AppData/Local/Temp/anonymous573077067589922398webdriver-profile/extensions/fxdriver@googlecode.com/components/driver-component.js:10160) at .DelayedCommand.prototype.executeInternal_/h(file:///C:/Users/Jyoti/AppData/Local/Temp/anonymous573077067589922398webdriver-profile/extensions/fxdriver@googlecode.com/components/command-processor.js:12282) at .DelayedCommand.prototype.executeInternal_(file:///C:/Users/Jyoti/AppData/Local/Temp/anonymous573077067589922398webdriver-profile/extensions/fxdriver@googlecode.com/components/command-processor.js:12287) at .DelayedCommand.prototype.execute/<(file:///C:/Users/Jyoti/AppData/Local/Temp/anonymous573077067589922398webdriver-profile/extensions/fxdriver@googlecode.com/components/command-processor.js:12229)

  • 1
    possible duplicate of [Error: Main method not found in class Calculate, please define the main method as: public static void main(String\[\] args)](http://stackoverflow.com/questions/20268262/error-main-method-not-found-in-class-calculate-please-define-the-main-method-a) – Saifur Aug 22 '15 at 02:38
  • that one i resolved but i m still getting problm @saifur – jyotsana namdev Aug 22 '15 at 02:58
  • hey.. did you tried like driver.get("http://www.facebook.com"); means starting the url with http:// ? but not sure why import org.apache.xpath.operations.String; is imported as those two line required it? – murali selenium Aug 22 '15 at 07:21
  • sorry in above comment http:// is not displaying in get method.. – murali selenium Aug 22 '15 at 07:23

1 Answers1

0

Exception in thread "main" org.openqa.selenium.WebDriverException: f.QueryInterface is not a function

This exception happens because you are trying to get() a URL that's not prefixed with http:// or https://

driver.get("https://www.facebook.com");