【发布时间】:2018-05-24 12:07:58
【问题描述】:
JavaFX 应用程序类必须扩展 javafx.application.Application
package automationFramework
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class SecondTestCase
{
WebDriver driver;
public void invokeBrowser()
{
System.setProperty("webdriver.chrome.driver", "C:\\Users\\Venkat\\Desktop\\Hima2017\\Selenium\\chromedriver_win32_latest\\chromedriver.exe");
driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);
driver.get("http://amazon.com");
}
public static void main(String args[])
{
System.out.println("This is second program");
SecondTestCase myobj=new SecondTestCase();
myobj.invokeBrowser();
}
}
以下是错误:
Error: Main method not found in class automationFramework.SecondTestCase, please define the main method as:
public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application
请帮助我在上面的程序中正确的代码。
【问题讨论】: