Writing selenium java page navigation

Learn how to navigate between multiple pages in a website. Test case are written and explained using www.digitalappconsultancy.com pages.

If you feel this video is useful, Please share it with your friends on Facebook, twitter Google plus etc.

Code developed in this tutorial provided below:

import org.openqa.selenium.chrome.ChromeDriver;

public class HelloWorld {

	/**
	 * @param args
	 * @throws InterruptedException 
	 */
	public static void main(String[] args) throws InterruptedException {
		// TODO Auto-generated method stub
		
		// Replace the path of chrome driver according to your setup
		System.setProperty("webdriver.chrome.driver", "/Users/Niranjan/My Briefcase/My Development/eclipse_learning/SeleniumLearning/lib/webdrivers/chromedriver");
		
		ChromeDriver driver = new ChromeDriver();
		driver.get("http://www.digitalappconsultancy.com");
		Thread.sleep(1000);
		driver.get("http://digitalappconsultancy.com/site/blog/");
		Thread.sleep(1000);
		driver.get("http://digitalappconsultancy.com/site/contact/");
		Thread.sleep(1000);
		driver.get("http://www.digitalappconsultancy.com");
		
		Thread.sleep(3000);
		driver.quit();

	}

}

 

Learning Selenium Java Page Navigation
Tagged on:     

Leave a Reply

Your email address will not be published. Required fields are marked *