How to solve “Webdriver cannot be resolved to a type” Error in Selenium?

In this video it shows how one can resolve the “Webdriver cannot be resolved to a type” error while working with selenium in Eclipse.

The JAR files mentioned in the video can be downloaded from the below path:

https://www.selenium.dev/downloads/

I hope you like this video. For any questions, suggestions or appreciation please contact us at: https://programmerworld.co/contact/ or email at: programmerworld1990@gmail.com

The source code shown in this video:


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

public class ErrorDemo {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		System.setProperty("webdriver.chrome.driver", "C:\\work\\Selenium\\chromedriver_win32\\chromedriver.exe");
		WebDriver driver = new ChromeDriver();
		driver.get("https://www.google.com/");
		
		driver.findElement(By.xpath("//input[@class='gLFyf gsfi']")).sendKeys("xxxxx");
		driver.findElement(By.xpath("//div[@class='eIPGRd']/div")).click();
	}

}

Leave a Reply