In this post , we share a working example of Selenium Web automation tool java code to invoke a website using firefox browser
This piece of code was executed successfully on Eclipse IDE integrated with Selenium WebDriver 3.4.0 . Hope it may be useful to few beginners.
package automationFramework;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Testcaseone {
public static void main(String[] args) throws InterruptedException {
// TODO Auto-generated method stub
// Create a new instance of the Firefox driver
WebDriver driver;
System.setProperty("webdriver.gecko.driver", "C:\\Eclipse\\geckodriver.exe");
driver =new FirefoxDriver();
//Launch the Online Store Website
driver.get("http://www.google.com");
// Print a Log In message to the screen
System.out.println("Successfully opened the website tayanasoftware.com");
//Wait for 5 Sec
Thread.sleep(5);
// Close the driver
driver.quit();
}
}