我正在Eclipse中创建chrome测试功能。
程序没有错误。但是执行该程序时会显示以下错误。
错误:找不到或加载主类CrossBrowserTesting.ChromeTesting 造成原因: java.lang.ClassNotFoundException:CrossBrowserTesting.ChromeTesting
但是我不知道为什么会出现此错误。因为我的代码没有错误。
我在下面附上我的代码,
time()
我的文件结构是
package CrossBrowserTesting;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class ChromeTesting {
public static void main(String[] args) {
WebDriver driver;
System.setProperty("webdriver.chrome.driver","\\selenium webdrivers\\chromedriver.exe");
driver = new ChromeDriver();
driver.get("https://www.example.com");
driver.quit();
}
}