Пример #1
0
        public void ClickSubmitBtn()
        {
            IJavaScriptExecutor js = (IJavaScriptExecutor)driver;

            js.ExecuteScript("window.scrollTo(0, document.body.scrollHeight)");
            SubmitBtn.Click();
        }
 internal UltimateQAHomePage FillOutEmergenctDetails(TestUser emergencyContactUser)
 {
     SetGenderForEmergencyContact(emergencyContactUser);
     FirstNameFieldForEmergencyContact.SendKeys(emergencyContactUser.firstName);
     LastNameFieldForEmergencyContact.SendKeys(emergencyContactUser.lastName);
     SubmitBtn.Click();
     return(new UltimateQAHomePage(Driver));
 }
 internal UltimateQAHomePage FillOutPrimaryContactFormAndSubmit(TestUser user)
 {
     SetGender(user);
     FirstNameField.SendKeys(user.firstName);
     LastNameField.SendKeys(user.lastName);
     SubmitBtn.Click();
     return(new UltimateQAHomePage(Driver));
 }
Пример #4
0
        public void test()
        {
            // Focuses on small window to scroll
            PropertiesCollection.driver.SwitchTo().Frame(PropertiesCollection.driver.FindElement(By.Id("container")));

            // Implement javascript to scroll window
            IJavaScriptExecutor js = (IJavaScriptExecutor)PropertiesCollection.driver;

            js.ExecuteScript("window.scrollBy(0,200)");

            SetMethods.EnterText(TextBox, "Tosca");

            // Focus back on entire html page
            PropertiesCollection.driver.SwitchTo().DefaultContent();

            SubmitBtn.Click();
            Thread.Sleep(800);
            Assert.IsTrue(Completed.Text.Contains("Good job"), "Not Completed");
            ClosePopUp.Click();
        }
Пример #5
0
 public void test()
 {
     GenerateBtn.Click();
     for (int i = 2; i < 7; i++)
     {
         IWebElement         letter     = PropertiesCollection.driver.FindElement(By.XPath("/html/body/div[2]/div[1]/div[1]/div[2]/div/div[2]/div[2]/div[2]/table/tr[" + i + "]/td[1]"));
         IWebElement         ddl        = PropertiesCollection.driver.FindElement(By.XPath("/html/body/div[2]/div[1]/div[1]/div[2]/div/div[2]/div[2]/div[2]/table/tr[" + i + "]/td[2]/select"));
         SelectElement       selectList = new SelectElement(ddl);
         IList <IWebElement> options    = selectList.Options;
         for (int j = 1; j < 6; j++)
         {
             string optionText = options[j].Text.ToString();
             if (CheckLetter(letter.Text).Equals(optionText.Substring(0, 1)))
             {
                 SetMethods.SelectDropDown(ddl, optionText);
                 break;
             }
         }
     }
     SubmitBtn.Click();
     Thread.Sleep(800);
     Assert.IsTrue(Completed.Text.Contains("Good job"), "Not Completed");
     ClosePopUp.Click();
 }