Error: Main method not found in class chrome_driver, please define the main method as: public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import javax.swing.*;
import java.io.IOException;
public class chrome_driver {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "C:/Users/Admin/Desktop/chromedriver_win32/chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("http://www.google.com");
}
}
如何修复此错误消息?