December 2015
Intermediate to advanced
192 pages
3h
English
CHAPTER 9
![]()
Navigation and Browser
Driving common web controls were covered in Chapters 2 through 8. In this chapter, I show how to manage browser windows and page navigation in them.
Go to a URL
driver.Navigate().GoToUrl("https://google.com");
Alternatively, set the driver.Url property.
driver.Url = "http://testwisely.com";
Visit pages within a site
driver.Navigate().GoToUrl() takes a full URL. Most of time, testers test against a single site and specifying a full URL (e.g., http://...) is not necessary. We can create a reusable function to simplify its usage.
String siteRootUrl = "http://test.testwisely.com";// ...public void Visit(String path) ...
Read now
Unlock full access