I'm using Windows but I don't have access to install Eclipse IDE or others so the only way is to run selenium through command prompt, I know there are similar question like this or this or this but that not solved my problem. And here are my script
mySelenium.java
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class mySelenium {
public static void main(String[] args) {
WebDriver driver = new ChromeDriver();
// Open Google
driver.get("https://www.example.com");
// Close browser
driver.quit();
}
}
when I run following in CMD
java -classpath "selenium-server-standalone-3.141.59.jar" mySelenium.java
java -classpath "selenium-server-standalone-3.141.59.jar" mySelenium
I get error
Error: Could not find or load main class mySelenium.java
I don't understand why it cannot found the main because in my script here is main, so what the command that I need to run it correctly?