JavaScript error: undefined, line 492: Component returned failure code:

0

I am new to selenium, and getting this below error.

Selenium 3.4.0 Firefox browser 47.0.2 geckodriver-v0.16.1-win64

Please help on this, Thanks in advance. :)

Below is the test code:

System.setProperty("webdriver.gecko.driver","C:\\Users\\User\\Downloads\\geckodriver-v0.16.1-win64\\geckodriver.exe");

    /*   DesiredCapabilities capabilities = DesiredCapabilities.firefox();
       capabilities.setCapability("marionette", false); // true getting : AddonManager is not initialized
       WebDriver driver = new FirefoxDriver(capabilities); */

    driver = new FirefoxDriver();
    vURL = "http://www.facebook.com";
    driver.navigate().to(vURL);

    driver.findElement(By.xpath("//*[@id='day']")).sendKeys("9");
    driver.quit();

Error:

JavaScript error: undefined, line 492: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.getCharPref] JavaScript error: resource://gre/modules/AddonManager.jsm, line 2484: NS_ERROR_NOT_INITIALIZED: AddonManager is not initialized Oct 11, 2017 3:43:19 PM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Detected dialect: W3C

java
selenium
selenium-webdriver
selenium-chromedriver
selenium-grid
asked on Stack Overflow Oct 11, 2017 by roma k • edited Oct 11, 2017 by Mohit Tyagi

1 Answer

0

You are commented the code

WebDriver driver = new FirefoxDriver(capabilities); 

then how driver is instantiate

use this it is working

    System.setProperty("webdriver.gecko.driver","E:\\geckodriver.exe");
    WebDriver driver=new FirefoxDriver(); 
    String vURL = "http://www.facebook.com";
    driver.navigate().to(vURL);

    driver.findElement(By.xpath("//*[@id='day']")).sendKeys("9");
    driver.quit();
answered on Stack Overflow Oct 11, 2017 by iamsankalp89 • edited Oct 11, 2017 by iamsankalp89

User contributions licensed under CC BY-SA 3.0