Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 99418

java.lang.Error: Unresolved compilation problems : WebDriver/ChromeDriver cannot be resolved to a type error while executing selenium tests

$
0
0

Here is my code:

package seleniumTutorials;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;

public class BasicsSelenium {

public static void main(String[] args) {
    boolean status;
    status=true;
    boolean newstatus = false;

    System.out.println("My Old status was "+status);
    System.out.println("My new status was "+newstatus);
    System.setProperty("webdriver.chrome.driver", "F:\\Samraj\\MavenAutomation\\Jar Files\\Selenium Java\\chromedriver.exe");
    ChromeOptions chromeOptions = new ChromeOptions();
    chromeOptions.addArguments("--start-maximized");
    WebDriver driver = new ChromeDriver(chromeOptions);
    driver.get("dev.findmyfare.io");
    System.out.println(driver.getTitle());
 }
 }

Below is the error message which am getting after declaring webdriver concept:

Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
WebDriver cannot be resolved to a type   ChromeDriver cannot be resolved to a type
    at seleniumTutorials.BasicsSelenium.main(BasicsSelenium.java:13)

Note: I can able to execute simple java program.

Screenshot of my Eclipse


Viewing all articles
Browse latest Browse all 99418

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>