public static Boolean login() { try { //var url = ConfigurationManager.AppSettings[Globalclass.envToTest]; var url = ConfigurationManager.AppSettings["QA"]; BrowserOperations.LoadDriver(url); userName_TextObject = Globalclass.driver.FindElement(By.Id("username")); userName_TextObject.Click(); userName_TextObject.SendKeys(Globalclass.ssoUserName); password_TextObject = Globalclass.driver.FindElement(By.Id("password")); password_TextObject.Click(); password_TextObject.SendKeys(Globalclass.ssoPassword); login_ButtonObject = Globalclass.driver.FindElement(By.Id("login")); login_ButtonObject.Click(); BrowserOperations.waitTillBrowserLoads(); return(true); } catch (Exception e) { //Log.Info(e.Message); return(false); } }
private static void clickMenuItem(String menuItem) { BrowserOperations.waitTillBrowserLoads(); IWebElement menu = Globalclass.driver.FindElement(By.XPath("")); menu.FindElement(By.LinkText(menuItem)).Click(); BrowserOperations.waitTillBrowserLoads(); Thread.Sleep(1000); }
private static IWebElement getMenu(String nameOfMenu) { BrowserOperations.waitTillBrowserLoads(); IList <IWebElement> menus = Globalclass.driver.FindElements(By.ClassName("ClassName")); foreach (IWebElement menu in menus) { if (menu.Text.Equals(nameOfMenu)) { return(menu); } } return(null); }