Browser navigation
Navigate to
The first thing you will want to do after launching a browser is to open your website. This can be achieved in a single line:
//Convenient
driver.get("https://selenium.dev");
//Longer way
driver.navigate().to("https://selenium.dev");
driver.get("https://selenium.dev")
driver.Navigate().GoToUrl(@"https://selenium.dev");
driver.navigate.to 'https://selenium.dev'
await driver.get('https://selenium.dev');
//Convenient
driver.get("https://selenium.dev")
//Longer way
driver.navigate().to("https://selenium.dev")
Back
Pressing the browser’s back button:
driver.navigate().back();
driver.back()
driver.Navigate().Back();
driver.navigate.back
await driver.navigate().back();
driver.navigate().back()
Forward
Pressing the browser’s forward button:
driver.navigate().forward();
driver.forward()
driver.Navigate().Forward();
driver.navigate.forward
await driver.navigate().forward();
driver.navigate().forward()
Refresh
Refresh the current page:
driver.navigate().refresh();
driver.refresh()
driver.Navigate().Refresh();
driver.navigate.refresh
await driver.navigate().refresh();
driver.navigate().refresh()
Last modified September 20, 2022: fix incorrect aliases from previous changes (d944c93fd7)