Sample Java code to open a web page using Selenium WebDriver

Sample Java code to open a web page using Selenium WebDriver

The following sample code will open Google site in the Mozilla Firefox Browser.

Sample Code:

package seleniumPackage;

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

public class OpenWebPage {	
	
	public static void main( String[] args ) {
		
		WebDriver wd = new FirefoxDriver();
		wd.get(
			"https://www.google.com"
		);
	
	}

}

Leave a Reply