Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save erajanraja24/4b6148f25f3ae9aefee70d64c731edf1 to your computer and use it in GitHub Desktop.
Save erajanraja24/4b6148f25f3ae9aefee70d64c731edf1 to your computer and use it in GitHub Desktop.
Navigation commands in selenium webdriver
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Ex1 {
public static void main(String[] args) throws InterruptedException {
System.setProperty("webdriver.chrome.driver", "chromedriver.exe");
WebDriver driver=new ChromeDriver();
driver.get("https://www.google.co.in");
driver.manage().window().maximize();
//Navigate To
driver.navigate().to("http://www.amarindaz.com");
//Back
driver.navigate().back();
//Forward
driver.navigate().forward();
//Refresh
driver.navigate().refresh();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment