Search code examples
javaseleniumselenium-webdriverimportwebdriver

"The import org cannot be resolved" error with the imports in Eclipse Photon with selenium Standalone server 3.9.1


I'm creating a basic selenium Webdriver program by adding the selenium jars and relative jars, below is my code. but when i try to resolve firefordriver and webdriver for importing them. im getting "The import org cannot be resolved" error.

Environment details:

JavaSe-10.

Eclipse Version Photon Release (4.8.0) Build id: 20180619-1200

Selenium StandAlone server 3.9.1

Code:

package selenium;

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

public class WebDriverBasics {

    public static void main(String[] args) {

        //1. Firefox browser. 
        //geckodriver.
        System.setProperty("webdriver.gecko.driver","d:\\installations\\eclipse\\jars\\geckodriver.exe");
        WebDriver driver = new FirefoxDriver();
    }
}

Solution

  • delete module-info.java file or any other module file that was created at the time of creating the project. That will resolve the issue.

    module-info.java

    error resolved