public IWebDriver LoginToMailRuAccount(string gmailLogin, string gmailPassword)//method for login to mail.ru account { IWebDriver chromeDriver = new ChromeDriver(); chromeDriver.Manage().Window.Maximize(); chromeDriver.Navigate().GoToUrl(mailRuMainPageURL); MailRuMainPage mailRuMainPage = new MailRuMainPage(chromeDriver); mailRuMainPage.LoginInputField.SendKeys(gmailLogin + Keys.Enter); mailRuMainPage.FindPasswordInputField(); mailRuMainPage.PasswordInputField.SendKeys(gmailPassword + Keys.Enter); return(chromeDriver); }
/// <summary> /// Main method /// </summary> static void Main() { const string LOGIN_USERNAME = "******"; const string LOGIN_PASSWORD = "******"; IWebDriver driver = new ChromeDriver(); driver.Manage().Window.Maximize(); MailRuLoginPage loginPage = new MailRuLoginPage(driver); loginPage.NavigateToMainPage(); loginPage.Login(LOGIN_USERNAME, LOGIN_PASSWORD); MailRuMainPage mailRuMain = new MailRuMainPage(driver); mailRuMain.SendMessage("*****@*****.**", "Hello, how are you?"); }