I have issue in my selenium script might be issue in Eclipse i tryed all possible aspect with adding all JAR library with different version but i faild to run script expert please look where i stuck
package Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class Test {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver","C:\\Chromedriver.exe");
WebDriver driver = new ChromeDriver();
String baseUrl = "https://www.facebook.com/";
driver.get(baseUrl);
WebElement email = driver.findElement(By.id("email"));
WebElement password = driver.findElement(By.id("pass"));
WebElement login = driver.findElement(By.xpath("//*[@id='loginbutton']"));
email.sendKeys("abcd@gmail.com");
password.sendKeys("abcd123");
login.click();
System.out.println("Login Done with Click");
}
}
Error :
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
WebDriver cannot be resolved to a type
at Test.Test.main(Test.java:15)
This is my JAR library structure: