The type org.openqa.selenium.chromium.ChromiumDriver cannot be resolved. It is indirectly referenced from required .class files

776 views
Skip to first unread message

Kamalakannan Anandan

unread,
Apr 5, 2022, 11:59:22 AM4/5/22
to Selenium Users
Hello Everyone,

Below is my Code. I am getting error message on very first line which is highlited in yellow color. Error Message "The type org.openqa.selenium.chromium.ChromiumDriver cannot be resolved. It is indirectly referenced from required .class files". I tried to fix the problem change the setting in project properties but i couldn't make it. please help me to solve this issue?


package testNG;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.Test;


public class SuitExample {
   
    WebDriver driver;
    long startTime;
    long endTime;
    long totalTime;
   
    // Aim open google chrome method
    // open google, open bing, open yahoo
   
    @BeforeSuite
    public void launchBrowser() {
       
        startTime = System.currentTimeMillis();
       
        // Launch Chrome Browser
        System.setProperty("webdriver.chrome.driver", "./drivers/chromedriver.exe");
        driver = (WebDriver) new ChromeDriver();    
    }
   
    @Test
    public void openGoogle() {
       
        driver.get("https://www.google.com");
    }
   
    @Test
    public void openBing() {
       
        driver.get("https://www.bing.com");    
    }
   
    @Test
    public void openYahoo() {
       
        driver.get("https://www.yahoo.com");    
    }
   
    @AfterSuite
    public void closeBrowser() {
       
        //Close Browser
        driver.quit();
       
        endTime = System.currentTimeMillis();
        totalTime = endTime-startTime;
        System.out.println("Total Time Taken:"+totalTime);
    }
   

}

Kamalakannan Anandan

unread,
Apr 5, 2022, 11:59:24 AM4/5/22
to Selenium Users
Hello everyone,

This is my code. I am getting error message "The type org.openqa.selenium.chromium.ChromiumDriver cannot be resolved. It is indirectly referenced from required .class files" on pacage testNG; first line. i tried to fix the issue changing the settings right click the project, Go to Properties -> libraries and change to
"JRE System Library [JavaSE-1.8]" to " JRE System Library [J2SE-1.5]"and JRE System Library [JavaSE-1.7]". I changed all the option but i could make it. Anyone can please help me to solve this issue?
Thanks and regards,
Kamal


Reply all
Reply to author
Forward
0 new messages