コード例 #1
0
 public void SubmitLoanRequestForAmount(string loanAmount, string downPayment, string fromAccountId)
 {
     selenium.SendKeys(textfieldLoanAmount, loanAmount);
     selenium.SendKeys(textfieldDownPayment, downPayment);
     selenium.Select(dropdownFromAccountId, fromAccountId);
     selenium.Click(buttonApplyForLoan);
 }
コード例 #2
0
        public void StartBrowser_LoginAndPerformChecks_StopBrowser()
        {
            selenium.NavigateTo("http://parabank.parasoft.com");

            selenium.SendKeys(By.Name("username"), "john");
            selenium.SendKeys(By.Name("password"), "demo");
            selenium.Click(By.XPath("//input[@value='Log In']"));

            /***
             * Rewrite the actions below so they use the helper methods in the SeleniumHelpers class
             * You'll need to define one helper method yourself, to perform the dropdown select action
             * All other helpers you'll need are there already
             */

            driver.FindElement(By.LinkText("Request Loan")).Click();
            driver.FindElement(By.Id("amount")).SendKeys("10000");
            driver.FindElement(By.Id("downPayment")).SendKeys("100");
            SelectElement dropdownFromAccountId = new SelectElement(driver.FindElement(By.Id("fromAccountId")));

            dropdownFromAccountId.SelectByText("54321");
            driver.FindElement(By.XPath("//input[@value='Apply Now']")).Click();

            string result = driver.FindElement(By.Id("loanStatus")).Text;

            Assert.AreEqual("Denied", result);
        }
コード例 #3
0
        public void StartBrowser_LoginAndPerformChecks_StopBrowser()
        {
            selenium.NavigateTo("http://parabank.parasoft.com");

            selenium.SendKeys(By.Name("username"), "john");
            selenium.SendKeys(By.Name("password"), "demo");
            selenium.Click(By.XPath("//input[@value='Log In']"));

            selenium.Click(By.LinkText("Request Loan"));
            selenium.SendKeys(By.Id("amount"), "10000");
            selenium.SendKeys(By.Id("downPayment"), "100");
            selenium.Select(By.Id("fromAccountId"), "54321");
            selenium.Click(By.XPath("//input[@value='Apply Now']"));

            Assert.AreEqual("Denied", selenium.GetElementText(By.Id("loanStatus")));
        }
コード例 #4
0
        public void StartBrowser_PerformGoogleSearch_AssertOnResultPage_StopBrowser()
        {
            selenium.NavigateTo("https://www.google.com");

            selenium.SendKeys(By.Name("q"), "Thomsons Online Benefits");

            selenium.Click(By.Name("btnK"));

            Assert.IsTrue(selenium.TitleIsEqualTo("Thomsons Online Benefits - Google zoeken"));

            Assert.IsTrue(selenium.ElementIsVisible(By.Id("resultStats")));
        }
コード例 #5
0
        public void LoginAndRequestLoan()
        {
            new LoginPage(driver)
            .Load()
            .LoginAs("john", "demo");

            new AccountsOverviewPage(driver)
            .SelectMenuItem("Request Loan");

            /***
             * Replace the methods below by the methods that you created
             * in the RequestLoanPage and RequestLoanResultPage Page Objects
             */

            selenium.SendKeys(By.Id("amount"), "10000");
            selenium.SendKeys(By.Id("downPayment"), "100");
            selenium.Select(By.Id("fromAccountId"), "54321");
            selenium.Click(By.XPath("//input[@value='Apply Now']"));

            Assert.AreEqual("Denied", selenium.GetElementText(By.Id("loanStatus")));
        }
コード例 #6
0
 public void LoginAs(string username, string password)
 {
     selenium.SendKeys(textfieldUsername, username);
     selenium.SendKeys(textfieldPassword, password);
     selenium.Click(buttonDoLogin);
 }
コード例 #7
0
 public LoginPage SetPassword(string password)
 {
     SeleniumHelpers.SendKeys(_driver, TextfieldPassword, password);
     return(this);
 }
コード例 #8
0
 public LoginPage SetUserName(string userName)
 {
     SeleniumHelpers.SendKeys(_driver, TextfieldUsername, userName);
     return(this);
 }
コード例 #9
0
 public GoogleHomePage EnterSearchTerm(String searchQuery)
 {
     selenium.SendKeys(textfieldSearchQuery, searchQuery);
     return(this);
 }
コード例 #10
0
        public void DoSearchFor(string searchQuery)
        {
            selenium.SendKeys(textfieldSearchQuery, searchQuery);

            new Actions(_driver).SendKeys(Keys.Enter).Build().Perform();
        }