-1

After searching I found a way to add extension to the Firefox via .FirefoxProfile(). However, the same solution is mentioned everywhere.

I don't understand why I am facing an error. Here is the code:

 String firebugFilePath = "C:\FF_addons\firebug.xpi";
        FirefoxProfile profile = new FirefoxProfile();
        try {
            profile.addExtension(new File(firebugFilePath));
            // Add more FF addons if required 
        } catch (IOException err) {                
        }
        driver = new FirefoxDriver(profile);

Error I am facing is on the 4th line: incompatible types: com.gargoylesoftware.htmlunit.javascript.host.file.File cannot be converted to java.io.File.

iamdanchiv
  • 4,052
  • 4
  • 37
  • 42
Rabia Asif
  • 298
  • 3
  • 14

1 Answers1

0

It sounds like you are importing the wrong File class.

change your

import com.gargoylesoftware.htmlunit.javascript.host.file.File

to

import java.io.File
ddavison
  • 28,221
  • 15
  • 85
  • 110