score:0

i had similar issue, the problem i faced was i added the selenium-server-standalone-3.141.59.jar under modulepath instead it should be under classpath

so select classpath via (project -> properties -> java bbuild path -> libraries) add the downloaded latest jar

after adding it must be something like this

enter image description here

and an appropriate driver for browser has to be downloaded for me i checked and downloaded the same version of chrome for chrome driver and added in the c:\program files\java

and following is the code that worked fine for me

    public class testuiaautomation {

        public static void main(string[] args) {

            system.out.println("jai ganesha");
            try {
                system.setproperty("webdriver.chrome.driver", "c:\\program files\\java\\chromedriver.exe");
                system.out.println(system.getproperty("webdriver.chrome.driver"));
                chromeoptions chromeoptions = new chromeoptions();
                chromeoptions.addarguments("no-sandbox");
                chromeoptions.addarguments("--test-type");
                chromeoptions.addarguments("disable-extensions");
                chromeoptions.addarguments("--start-maximized");
                webdriver driver = new chromedriver(chromeoptions);
                driver.get("https://www.google.com");
                system.out.println("google is selected");
            } catch (exception e) {
                system.err.println(e);
            }

        }

    }

for reference

score:0

just delete module-info.java from project and its solves the issue.

score:2

i had the same error before because i use the default package.

and i solved the problem in this way: right-click the project - properties - java build path - move the class from modulepath to classpath

and it worked!

score:15

the error occurs because of you add your jar library files to modulepath instead of classpath. you have to add jar files to your classpath. if you already add jar files to modlepath you have to remove from there and add jar files to classpath, there is the steps:

1] right click on your project name in eclipse ide

2] click on properties -> java build path -> click library tab .the you get the window like this:

java build path window

3] expand modulepath and select all jar files and remove it :look the picture below:

modulepath jar file removing

4] after that click on classpath ->and click the button 'addjar' and select the jar files ,your are done. look the picture below for clarification;

add jar to classpaht

5] after adding jars files in classpath it looks like this:

after adding jar file to classpath


Related Query