这是我的代码:
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());
}
}
以下是在声明webdriver概念后收到的错误消息:
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)
注意:我可以执行简单的Java程序。
阿波罗的战车
暮色呼如