Selenium WebDriver Navigation

This video will describe how to Navigate and various navigations present in Selenium WebDriver





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


public class Navigations {

public static void main(String[] args) throws InterruptedException {

WebDriver driver = new FirefoxDriver();

/* //1st method
driver.get("http://www.rediff.com/");
driver.manage().window().maximize();*/

//2nd method
driver.navigate().to("http://www.rediff.com/");
driver.manage().window().maximize();

driver.findElement(By.xpath("//*[@id='signin_info']/a[1]")).click();

Thread.sleep(5000);

driver.navigate().back();
Thread.sleep(5000);

driver.navigate().forward();
Thread.sleep(5000);
driver.navigate().refresh();
}


}

No comments:

Post a Comment