Hello Sunaina, Gecko driver is required to launch firefox as post Firefox Version 47, Firefox doesn’t allow any 3rd party tool to interact directly with it. Hence in order to interact with it, we need a proxy called GeckoDriver. In Simple terms, Selenium will send the request to GeckDriver using W3C WebDriver Protocol and then GeckoDriver will read the commands and translate them into Marionette Protocol and forwards the request to Firefox Browser. Browser will read the commands in the form of Marionette protocol and execute them. You can setup the gecko driver this way:
System.setProperty("webdriver.gecko.driver", "C:/Users/Anvi_R/geckodriver.exe");