Browser Launch in Selenium Webdriver

There are some popular browsers available, for example, Google Chrome, Mozilla Firefox, Internet Explorer, Opera, Safari etc. In this article, we will learn the Browser Launch in Selenium Webdriver.

  • Browsers should be available in the System.
  • To Launch the Mozilla Firefox browser latest version 45 or above, Gecko Driver should be available in the system. So we can download it from below site as per the system

https://github.com/mozilla/geckodriver/releases

  • To Launch Google Chrome, the chromedriver.exe should be available. So we can download the chromedriver.exe from below site

https://sites.google.com/a/chromium.org/chromedriver/downloads

  • To Launch Internet Explorer, the Internet Explorer Driver Server should be available. So we can download the InternetExplorerDriver.exe from the below site

http://www.seleniumhq.org/download/

  • To Launch Opera or Safari browser, the Opera Driver or Safari Driver should be available. So we can download the Opera Driver.exe or Safari driver from the above site
  • Click on the latest release driver then download driver according to the system like a win32.zip file or any.
  • Extract the Zip file then copy and paste it into Library folder.

How to launch the latest version of Mozilla Firefox Browser?

public void Launch_NewFirefox()

{

System.setProperty(“webdriver.gecko.driver”, “D:\\Selenium\\Library\\geckodriver.exe”);

driver=new FirefoxDriver();

driver.get(“https://workforquality.com”);

}       

 

How to launch the Old version (Firefox V 45 or below) of Mozilla Firefox Browser?

public void Launch_OldFirefox()

{

driver=new FirefoxDriver();

driver.get(“https://workforquality.com”);

}       

        

How to launch the latest version of Google Chrome Browser?

public void Launch_Chrome()

{

System.setProperty(“webdriver.chrome.driver”, “D:\\Selenium\\Library\\chromedriver.exe”);

driver=new ChromeDriver();

driver.get(“https://workforquality.com”);

}

 

How to launch the latest version of Internet Explorer Browser?        

public void Launch_IE()

{

System.setProperty(“webdriver.InternetExplorer.driver”, “D:\\Selenium\\Library\\IEDriverServer.exe”);

driver=new InternetExplorerDriver();

driver.get(“https://workforquality.com”);

}

 

How to launch the latest version of Opera Browser?

public void Launch_Opera()

{

System.setProperty(“webdriver.opera.driver”, “D:\\Selenium\\Library\\operadriver.exe”);

driver=new OperaDriver();

driver.get(“https://workforquality.com”);

}

 

How to launch the latest version of Safari Browser?

public void Launch_Safari()

{

System.setProperty(“webdriver.safari.driver”, “D:\\Selenium\\Library\\safaridriver.exe”);

driver=new SafariDriver();

driver.get(“https://workforquality.com”);

}

 

Please click here to read Selenium Webdriver features

Please click here to read Locators in Selenium Webdriver

16 Thoughts on Browser Launch in Selenium Webdriver

  1. It has been simply incredibly generous with you to provide openly what exactly many individuals would’ve marketed for an eBook to end up making some cash for their end, primarily given that you could have tried it in the event you wanted.

    selenium training in porur

  2. Thank you for sharing this worth able content with us. The concept taken here will be useful for my future programs and I will surely use them.

  3. Search Engine Optimisation (SEO) is a powerful method used to increase a website’s visibility for the products and services it offers on search engines such as Google, Yahoo and Bing. Organic search has the lions share of web traffic and SEO puts your business in front of the widest possible audience

    Your website will be competing with millions of other sites to try and get people to visit. It is therefore crucial to optimise your site through SEO so that your website will be found above your competitors. As a long established internet marketing and SEO Company in Chennai, we have the skills and capacity to help our clients get to the top of Google (and stay there)

Leave a Comment