public void AccountLogin() { SeleniumHelper.NavigateToURL(ObjectRepository.Config.GetAccountLoginLink()); Thread.Sleep(3000); SeleniumHelper.EnterText(By.XPath("//input[@id='username']"), "*****@*****.**"); SeleniumHelper.Clickbtn(By.XPath("//button[@id='bx-continue']")); }
public void AccountActivation() { SeleniumHelper.NavigateToURL(ObjectRepository.Config.GetAccountActivationLink()); Thread.Sleep(3000); SeleniumHelper.EnterText(By.XPath("//input[@id='pswd']"), "Australia198@"); SeleniumHelper.EnterText(By.XPath("//input[@id='pswd-rpt']"), "Australia198@"); //SeleniumHelper.EnterText(By.Id("pswd-rpt"), "Abcd1234"); SeleniumHelper.Clickbtn(By.XPath("//button[@type='submit'][@class='btn btn-primary-bxt pull-right']")); }
public void TenantCreation() { SeleniumHelper.NavigateToURL(ObjectRepository.Config.GetAccCreationEnv()); SeleniumHelper.ClickLink(By.XPath("//*[@id='myModal']/div/span")); SeleniumHelper.ClickLink(By.XPath("//div[@id='top-bar']/div/div[3]/ul/li[4]/div/a/span")); SeleniumHelper.EnterText(By.Id("nf-field-1661"), "Fahad"); SeleniumHelper.EnterText(By.Id("nf-field-1662"), "ABC"); SeleniumHelper.EnterText(By.Id("nf-field-1663"), "*****@*****.**"); SeleniumHelper.EnterText(By.Id("nf-field-1664"), "0427268762"); SeleniumHelper.SelectElement(By.Id("nf-field-1781"), 1); SeleniumHelper.SelectElement(By.Id("nf-field-1782"), 13); SeleniumHelper.Clickbtn(By.Id("nf-field-1669")); SeleniumHelper.Clickbtn(By.Id("nf-field-1744-container")); SeleniumHelper.Clickbtn(By.Id("nf-field-1670")); }
public Dashboard Login(string url, string loginId, string password) { webDriver.Url = url; Thread.Sleep(TimeSpan.FromSeconds(1)); // SeleniumHelper.EnterTextById(webDriver, "email", loginId); SeleniumHelper.EnterText(webDriver, By.XPath("//input[@name='password']"), password); SeleniumHelper.EnterTextById(webDriver, "email", loginId); SeleniumHelper.Click(webDriver, By.XPath("//button[@type='submit']")); // 検証エラーチェック try { var element = webDriver.FindElement(By.XPath("//div[@class='alert alert-red'")); throw new Exception($"ログイン失敗!{element.Text}"); } catch (NoSuchElementException) { // 検証エラー時にだけ存在するので無い場合に成功になる return(new Dashboard(webDriver)); } }