public void Excercise_3a() { //About Page Test mainNav = mainNav.OpenMainNav(); aboutPage = mainNav.OpenAboutPage(); //verify that the H1 tag is displayed correctly in the About page aboutPage = aboutPage.FindAboutPageHeading(); Assert.AreEqual(expected: "h1", actual: aboutPage.AboutPageHeading.TagName); //Services Page Test mainNav = mainNav.OpenMainNav(); servicesPage = mainNav.OpenServicesPage(); //verify that the H1 tag is displayed correctly in the Services page servicesPage = servicesPage.FindServicesPageHeading(); Console.Write("Services page heading is " + servicesPage.ServicesPageHeading.Text); Assert.AreEqual(expected: "Services", actual: servicesPage.ServicesPageHeading.Text); //Work Page Test mainNav = mainNav.OpenMainNav(); workPage = mainNav.OpenWorkPage(); //verify that the Work page title is as expected as could not get the text property of the H1 element workPage = workPage.FindWorkPageHeading(); Assert.AreEqual(expected: "Work | Valtech", actual: driver.Title.ToString()); }
public void TestInitialize() { //Instantiate the object for the Webdriver and the Page Object class called MaingNavigation chromeOptions.AddArgument("disable-infobars"); driver = new ChromeDriver(chromeOptions); driver.Manage().Timeouts().ImplicitWait = System.TimeSpan.FromSeconds(60); mainNav = new MainNavigation(driver: driver); //Open the Valtech homepage in Chrome and maximise the window driver.Navigate().GoToUrl("https://www.valtech.co.uk"); driver.Manage().Window.Maximize(); //Click 'Accept cookies' button on the banner displayed on the homepage mainNav = mainNav.AcceptCookies(); }