【发布时间】:2017-04-08 02:13:11
【问题描述】:
在过去的几个小时里,我一直在为此苦苦挣扎。我正在尝试安装 Selenium Web 驱动程序并且遇到了一堆错误,这些错误阻止我运行测试页面。我很确定我最近的问题与此代码有关:
public static void main(String[] args) throws InterruptedException{
System.setProperty("webdriver.gecko.driver","C:/Users/theone/Downloads/geckodriver 2.exe");
非常感谢您对第二步的任何反馈!
package automationFramework;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class FirstTestCase {
public static void main(String[] args) throws InterruptedException{
System.setProperty("webdriver.gecko.driver","C:/Users/theone/Downloads/geckodriver 2.exe");
// Create a new instance of the Firefox driver
WebDriver driver = new FirefoxDriver();
//Launch the Online Store Website
driver.get("http://www.store.demoqa.com");
// Print a Log In message to the screen
System.out.println("Successfully opened the website www.Store.Demoqa.com");
//Wait for 5 Sec
Thread.sleep(5);
// Close the driver
driver.quit();
}
}
【问题讨论】:
标签: java selenium web driver gecko