Regarding the docs with example and as error message says
Error: Main method not found in class Demo, please define the main method as: public static void main(String[] args) or a JavaFX application class must extend javafx.application.Application
The main is in place, but inheritance not, you will need to extend javafx.application.Application, so assuming that should fix the issue:
replace the class declaration as public class Demo to public class Demo extends javafx.application.Application
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Demo extends javafx.application.Application{
public static void main(String [] args) {
System.setProperty("webdriver.chrome.driver", "C:\\javacoding\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.manage().window().maximize();
driver.get("https://google.com");
}
}
Or just public class Demo to public class Demo extends Application with import javafx.application.Application; (in the import section of the class)
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import javafx.application.Application; //added
public class Demo extends Application{
public static void main(String [] args) {
System.setProperty("webdriver.chrome.driver", "C:\\javacoding\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.manage().window().maximize();
driver.get("https://google.com");
}
}
It seems you did not created the correct type of the project in your IDE, maybe re-creation will be needed (like eg. in case of maven project you need some additional files like pom.xml, etc.)
or a JavaFX application class must extend javafx.application.Applicationmaybe? something likepublic class Demo extends javafx.application.Application? (or just Application, but be sure you will import correct file) - xxxvodnikxxx