Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"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();
    }
}
like image 387
Rakesh Avatar asked Sep 20 '25 05:09

Rakesh


2 Answers

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

like image 67
prashant.kr.mod Avatar answered Sep 23 '25 05:09

prashant.kr.mod


For me, the jar files responsible for spring framework were not their in the JRE, so i downloaded the respective jars and added in the build path.

below is the link which i followed and it worked for me.

Remember to see the section : "2) Add spring jar files" from the below link:

refer this link

like image 40
Rahul Khatoliya Avatar answered Sep 23 '25 05:09

Rahul Khatoliya