How To Launch Firefox Browser In Selenium Webdriver Using Geckodriver

.
Question : How To Open Firefox Browser In Selenium Using Geckodriver with java ?

Answer :

Just Follow the Below steps to launch firefox browser using geckoDriver .

Step-1 Download the geckodriver.exe file from official website (Note: Download the geckodriver as per your system configuration).
Step-2 Save the gecodriver.exe at your system location.
Step-3 Set the property (you have to just copy the location of your geckodriver.exe and paste the location at "geckodriver.exe path"

Syntax 
System.setProperty(“webdriver.gecko.driver”,”geckodriver.exe path”);

Example 
System.setProperty("webdriver.gecko.driver","D:\\wxy\\Software\\geckoriver.exe");


Selenium Code to Launch firefox using geckodriver 


package automation;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

public class LaunchingFirefox
{
public static void main(String[] args)
{
System.setProperty("webdriver.gecko.driver","D:\\wxy\\Software\\geckoriver.exe");
WebDriver drivernew FirefoxDriver();
driver.navigate().to("https://google.com/");
driver.manage().window().maximize();
driver.quit();
}
}

In this tutorial we learn how to Launch firfox Browser in selenium webdriver .Hope this tutorial helpful for you ðŸ˜Š

Thanks & Regards 
Sandeep Yadav


Important Tags : How to launch firefox browser in selenium , how to launch firefox browser in selenum webdriver using geckodriver , Launching Firefox browser in selenium 


How To Launch Firefox Browser In Selenium Webdriver Using Geckodriver




Post a Comment

0 Comments