-2

I am getting:

"Exception in thread "main" java.lang.Error: Unresolved compilation problem: Type mismatch: cannot convert from FirefoxDriver to WebDriver" error in the console

I have added jars files correctly..but still facing issue..please help enter image description here

package demo;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class TestFacebookRegistration {

public static void main(String[] args) {

    WebDriver driver= new FirefoxDriver();

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

    driver.manage().window().maximize();
    }

}
  • 1
    You need to post your code, please. – Brian Feb 13 at 18:02
  • I have added the code – Albin K S Feb 14 at 1:16
  • I meant post the code, NOT a screenshot of it 😀 – Brian Feb 14 at 1:30
  • 1
    Also, look at your imports; they are not resolving. Do you have the proper references in your project? – Brian Feb 14 at 1:34
  • sorry...updated – Albin K S Feb 14 at 1:34
2

For using FirefoxDriver, you now have to use Geckodriver's

public static void main(String[] args) {
// declaration and instantiation of objects/variables
System.setProperty("webdriver.firefox.marionette","C:\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();    
}

You can read more about it here

  • but I have already set the system properties for Geckodriver in the system settings – Albin K S Feb 14 at 1:44
  • Can you please share the full code. Also like Brian mentioned you have code import resolve issues. Is it resolved now? – Sandeep Chandra Sekhar Feb 14 at 2:37
  • No.when I try to resolve the errors with imports, it shows like " Package org.openqa.selenium.firefox is accessible from more than one moduleclient.cmbined,okio in the popup when mouse hovering above the import statements – Albin K S Feb 14 at 2:41
  • Can you check this link, exact same issue you are mentioning. link – Sandeep Chandra Sekhar Feb 14 at 3:36
0

There is a issue in your package, I think you missed one of them. I suggest you to use the pom so that it install all of thel automatically. By the way, the webdriver for Firefoix is geckodriver, not marionnette.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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