BROWSER ACTIONS

  

Package mypackage;

 

import java.util.concurrent.TimeUnit;

 

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.firefox.FirefoxDriver;

 

import class BrowserActions {

 

public static void main(String[] args) {

System.setProperty("webdriver.gecko.driver","C:\\Browser\\geckodriver.exe");

WebDriver driver=new FirefoxDriver();

driver .get("https://www.seleniumeasy.com/");

driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);


driver.findElement(By.xpath("//a[text()='TestNG']")).click();

driver.navigate().back();

driver.navigate().forward();

driver.navigate().refresh();

driver.close();        

}        

}