public void OpenDorseClickOnJobPost() // Find Specific Job Posting { driver.Navigate().GoToUrl(appURL + "/"); Thread.Sleep(5000); driver.FindElement(By.LinkText("Careers")).Click(); Thread.Sleep(5000); if (driver.FindElement(By.TagName("title")).GetAttribute("innerText").Trim().Equals("BambooHR")) { Console.WriteLine(driver.Title.ToString() + " is the correct title. Currently on Careers Page."); } else { ResultsLogFileManager.ResultsLog(TestContext, "My Result"); Console.WriteLine(driver.Title.ToString() + " is the incorrect title"); Assert.Fail(); } IList <IWebElement> allLinks = driver.FindElements(By.TagName("a")); foreach (IWebElement link in allLinks) { if (link.Text.Trim().Equals("QA Analyst")) { link.Click(); break; } } Thread.Sleep(7000); if (driver.FindElement(By.TagName("h2")).GetAttribute("innerText").Equals("QA Analyst")) { Console.WriteLine(driver.Title.ToString() + " is the correct title"); } else { ResultsLogFileManager.ResultsLog(TestContext, "My Result"); Console.WriteLine(driver.Title.ToString() + " is the incorrect title"); Assert.Fail(); } }
public void NavigateToOpenDorseCareers() // Navigate to OpenDorse Career Page { driver.Navigate().GoToUrl(appURL + "/"); Thread.Sleep(5000); driver.FindElement(By.LinkText("Careers")).Click(); Thread.Sleep(5000); if (driver.FindElement(By.TagName("title")).GetAttribute("innerText").Trim().Equals("BambooHR")) { Console.WriteLine(driver.Title.ToString() + " is the correct title. Currently on Careers Page."); } else { ResultsLogFileManager.ResultsLog(TestContext, "My Result"); Console.WriteLine(driver.Title.ToString() + " is the incorrect title"); Assert.Fail(); } }