public void LogInSuccessfull() { using (IWebDriver driver = new ChromeDriver(@"C:\chromedriver\chromedriver_win32 (1)")) { driver.Navigate().GoToUrl(NavUrl); DemoHelper.Pause(5000); IWebElement acceptCoockies = driver.FindElement(By.Id(CookieID)); acceptCoockies.Click(); DemoHelper.Pause(5000); IWebElement userNameElem = driver.FindElement(By.Id("UserName")); IWebElement passwordElem = driver.FindElement(By.Id("Password")); IWebElement logInButtton = driver.FindElement(By.ClassName("button--primary")); DemoHelper.Pause(5000); userNameElem.SendKeys(UserName); passwordElem.SendKeys(Password); logInButtton.Click(); DemoHelper.Pause(5000); IWebElement loggedInUser = driver.FindElement(By.ClassName("UserName")); Assert.AreEqual(LoggedInUserString, loggedInUser.Text); } }
public void SelectMultipleElem() { using (IWebDriver driver = new ChromeDriver(@"C:\chromedriver\chromedriver_win32 (1)")) { driver.Navigate().GoToUrl(NavUrl); WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(5)); IWebElement acceptCookieBtn = wait.Until <IWebElement>((d) => { return(d.FindElement(By.Id(CookieID))); }); IList <IWebElement> submit_button = driver.FindElements(By.ClassName("Login")); DemoHelper.Pause(5000); foreach (IWebElement element in submit_button) { if (element.Text == "Login") { Assert.AreEqual("Login", element.Text); } } } }