You have only declared the WebDriver instance as:
public WebDriver driver;
You need to initialize it too as follows:
driver = new FirefoxDriver();
Along with the instance of FirefoxOptions()
your effective code block will be:
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);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…