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

Mohit Tyagi
  • 2,788
  • 4
  • 17
  • 29
roma k
  • 9
  • 4

1 Answers1

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();
iamsankalp89
  • 4,607
  • 2
  • 15
  • 36
  • You change the path of geckodriver – iamsankalp89 Oct 11 '17 at 12:19
  • tried above but not working : 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 5:49:45 PM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Detected dialect: W3C 1507724385576 geckodriver INFO Listening on 127.0.0.1:26330 1507724386078 geckodriver::marionette INFOStarting browser \\?\C:\Program Files\Mozilla Firefox\firefox.exe with args ["-marionette"] – roma k Oct 11 '17 at 12:22
  • Try it with chrome – iamsankalp89 Oct 11 '17 at 12:29
  • Which version of selenium and firefox you are using – iamsankalp89 Oct 11 '17 at 12:32
  • Selenium 3.4.0 Firefox browser 47.0.2 geckodriver-v0.16.1-win64 – roma k Oct 12 '17 at 07:07
  • Update the broser to 50 or 51 and geckdriver too – iamsankalp89 Oct 12 '17 at 09:52
  • that will work with selenium 3.4.0 or I need to update selenium too – roma k Oct 12 '17 at 09:56