Selenium WebDriver : How To Navigate URL, Forward and Backward With Example

In my earlier posts, we have learnt few BASIC ACTION COMMANDS of selenium WebDriver software testing tool with examples. You will have to use them on daily basis for you software web application's webdriver test case preparation. It is very important for you to use them on right time and right place. Now let we learn 3 more action commands of webdriver.

1. driver.navigate().to
If you wants to navigate on specific software web application page or URL in between your software test then you can use driver.navigate().to command as bellow.

2. driver.navigate().back();
This command is useful to go back on previous page. Same as we are clicking browser back button. You can use this command as bellow. In Selenium IDE software testing tool, we can use "goBack" to perform same action.

3. driver.navigate().forward();
Same as we are clicking on forward button of browser

Bellow given example will cover all three commands. Execute it in your eclipse to know them practically.

Copy bellow given @Test method part of driver.navigate() command examples and replace it with the @Test method part of example given on THIS PAGE(Note : @Test method is marked with pink color in that linked page).
 public void test () throws InterruptedException 

  //To navigate back (Same as clicking on browser back button)

  //To navigate forward (Same as clicking on browser forward button)


  1. sir plz send me example of radio button and check box button in selenium in java....plz.....i take example of

  2. Komal Thakkar you can you Xpath absolute your given site url i had check and you radio button xpath is