Firefox webdriver lunch

selenium

This is the sample of selenium firefox webdriver code.
It just open the browser, more like first step of selenium webdriver testing.

package com.webdriver_01;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class FirstWebDriver {

	public WebDriver driver;
	private String baseUrl;
	
	public static void main(String[] args){
		FirstWebDriver fwb = new FirstWebDriver();
		fwb.launch_browser();
	}
	public void launch_browser(){
		try{
		 driver = new FirefoxDriver();
		 baseUrl = "http://www.google.co.in";
		 driver.get(baseUrl);
		 driver.manage().window().maximize();
		 System.out.println("Open " + baseUrl);
		 driver.quit();
		}
		catch (Exception ex)
		{
			ex.getMessage();
		}
	}
}

Related posts:

Leave a Reply

Your email address will not be published. Required fields are marked *