1 回答
TA贡献1790条经验 获得超9个赞
您仅将WebDriver实例声明为:
public WebDriver driver;
您还需要对其进行初始化,如下所示:
driver = new FirefoxDriver();
您的有效代码块的实例FirefoxOptions()将是:
System.setProperty("webdriver.firefox.driver","C:\\Users\\Nabila\\Downloads\\geckodriver-v0.26.0-win64\\geckodriver.exe");
FirefoxOptions options = new FirefoxOptions();
options.addArguments("test-type");
options.addArguments("start-maximized");
options.addArguments("--js-flags=--expose-gc");
options.addArguments("--enable-precise-memory-info");
options.addArguments("--disable-popup-blocking");
options.addArguments("--disable-default-apps");
options.addArguments("test-type=browser");
options.addArguments("disable-infobars");
driver = new FirefoxDriver(options);
driver.navigate().to("http://www.demo.guru99.com/V4/");
driver.manage().timeouts().implicitlyWait(300, TimeUnit.SECONDS);
添加回答
举报