跟踪:
错误:请在类newpackage.Myclass中找不到主要方法 定义主要方法:public static void main(String [] args)或a JavaFX应用程序类必须扩展javafx.application.Application。
MyClass.java
package newpackage;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
//import javafx.application.*;
public class Myclass {
public static void main(String[] args) {
System.setProperty("webdriver.gecko.driver","C:\\Users \\karokiaswamy\\Documents\\Selenium_installation\\geckodriver-v0.15.0-win64)\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get("http://Application URL");
driver.findElement(By.xpath("//*[@id='siteLoginTab']/form/table/tbody/tr[1]/td[1]/input")).sendKeys("USER NAME");
driver.findElement(By.xpath("//*[@id='siteLoginTab']/form/table/tbody/tr[1]/td[2]/input")).sendKeys("Password");
driver.findElement(By.xpath("//*[@id='siteLoginTab]/form/table/tbody/tr[1]/td[3]/input")).click();
driver.findElement(By.xpath(".//*[@id='siteLoginTab']/form/table/tbody/tr[1]/td[2]/input")).sendKeys(" ");
driver.findElement(By.xpath(".//*[@id='siteMain']/div[1]/div/form/table/tbody/tr[3]/td/input")).click();
driver.findElement(By.xpath(".//*[@id='siteMain']/div[1]/div/form/table/tbody/tr[3]/td/input")).click();
}
}