Пример #1
0
        public T SelectFactorFlow <T>(params string[] factorFlow) where T : BasePage
        {
            var node = GetLastNode();

            node.Info("Question: " + QuestionLable.Text);
            string currentUrl = WebDriver.Url;

            foreach (var item in factorFlow)
            {
                if (!IsElementDisplayed(_txtFactor))
                {
                    FactorButton(item).Click();
                    node.Info("Select the answer: " + item);
                }
                else
                {
                    FactorTextbox.InputText(item);
                    node.Info("lnput the answer: " + item);
                }
            }
            WaitForElementEnabled(_btnNext);
            NextButton.Click();
            WaitForUrlChanged(currentUrl);
            var page = (T)Activator.CreateInstance(typeof(T));

            page.WaitForPageLoad();
            return(page);
        }
Пример #2
0
 public QuestionPage Answer(string answerText)
 {
     Driver.FindElement(By.XPath("//label[contains(@class, 'multiple-choice--radio') and text() = \"" + answerText + "\"]")).Click();
     NextButton.Click();
     AwaitNextQuestionPage();
     return(new QuestionPage(Driver));
 }
Пример #3
0
 public QuestionPage Answer(int answerOrder, bool requireButtonAwait = true)
 {
     Driver.FindElement(By.XPath("(//label[contains(@class, 'multiple-choice--radio')])[" + answerOrder + "]")).Click();
     NextButton.Click();
     AwaitNextQuestionPage(requireButtonAwait);
     return(new QuestionPage(Driver));
 }
Пример #4
0
 public QuestionPage Answer(string answerText)
 {
     _driver.FindElement(By.XPath("//span[contains(@class, 'answer-text') and text() = \"" + answerText + "\"]/preceding-sibling::span[contains(@class, 'answer-radio')]")).Click();
     NextButton.Click();
     AwaitNextQuestionPage();
     return(new QuestionPage(_driver));
 }
        public override PluginExecutionResult PerformAction()
        {
            WaitForAvailable(ShortTimeout);
            if (HPAccessControlJAServerNameEdit.EnterText(_jaServerName, ShortTimeout) != ResultCode.Passed)
            {
                return(new PluginExecutionResult(PluginResult.Failed, "Failed to Enter JA Server Name"));
            }

            if (HPAccessControlIPMServerNameEdit.EnterText(_ipmServerName, ShortTimeout) != ResultCode.Passed)
            {
                return(new PluginExecutionResult(PluginResult.Failed, "Failed to Enter IPM Server Name"));
            }

            if (HPAccessControlPullPrintServerNameEdit.EnterText(_pullprintServerName, ShortTimeout) != ResultCode.Passed)
            {
                return(new PluginExecutionResult(PluginResult.Failed, "Failed to Enter Pull Print Server Name"));
            }

            Thread.Sleep(HumanTimeSpan);
            if (NextButton.Click(ShortTimeout) != ResultCode.Passed)
            {
                return(new PluginExecutionResult(PluginResult.Failed, string.Format("Failed to proceed beyond {0} Screen", ScreenName)));
            }
            return(new PluginExecutionResult(PluginResult.Passed));
        }
Пример #6
0
 public QuestionPage Answer(int answerOrder, bool requireButtonAwait = true)
 {
     _driver.FindElement(By.XPath("(//span[contains(@class, 'answer-radio')])[" + answerOrder + "]")).Click();
     NextButton.Click();
     AwaitNextQuestionPage(requireButtonAwait);
     return(new QuestionPage(_driver));
 }
Пример #7
0
        ///// <summary>
        ///// JQuery selector example
        ///// </summary>
        //public IWebElement LoginButton => WebDriver.FindElementByJQuery("input[name='btnSubmit']");

        public LoginPage BrittleLoginAsAdmin(string baseUrl, string password)
        {
            // https://crm422752.crm.dynamics.com/
            WebDriver.Navigate().GoToUrl(baseUrl);

            UserIdField.Clear();
            // sending a single quote is not possible with the Chrome Driver, it sends two single quotes!
            UserIdField.SendKeys("*****@*****.**");

            NextButton.Click();

            PasswordField.Clear();
            PasswordField.SendKeys(password);

            var wait = new WebDriverWait(WebDriver, TimeSpan.FromSeconds(5));

            wait.Until(f => f.FindElements(By.XPath("//div[@class='col-xs-24 no-padding-left-right button-container']/div/input")).FirstOrDefault());

            SignInButton = WebDriver.FindElements(By.Id("idSIButton9")).FirstOrDefault();
            SignInButton.Click();

            var staySignedInDialog = WebDriver.FindElement(By.XPath("//div[@role='heading']"));

            if (staySignedInDialog?.Text == "Stay signed in?")
            {
                wait = new WebDriverWait(WebDriver, TimeSpan.FromSeconds(5));
                wait.Until(f => f.FindElements(By.XPath("//div[@class='col-xs-24 no-padding-left-right button-container']/div/input")).FirstOrDefault());

                var noButton = WebDriver.FindElements(By.Id("idBtn_Back")).FirstOrDefault();
                noButton.Click();
            }

            return(this);
        }
        internal int SearchListings(string CategoryToSearch, string TitleToSearch, string DescriptionToSearch)
        {
            //Initialize the Record count to 0
            int RecordFound = 0;

            Thread.Sleep(2000);

            //loop through the pages
            for (int i = 0; i < PaginationButtons.Count - 2; i++)
            {
                Thread.Sleep(2000);

                //Check the Category, Title and Description values for each row in a page, if matches increment the record found variable
                foreach (IWebElement listingRecord in TableRows)
                {
                    string Category    = listingRecord.FindElement(By.XPath("td[2]")).Text;
                    string Title       = listingRecord.FindElement(By.XPath("td[3]")).Text;
                    string Description = listingRecord.FindElement(By.XPath("td[4]")).Text;
                    if (Category == CategoryToSearch && Title == TitleToSearch && Description == DescriptionToSearch)
                    {
                        RecordFound++;
                    }
                }

                //If Next button is enable click it to Navigate to next page
                if (NextButton.Enabled == true)
                {
                    NextButton.Click();
                }
            }

            //Returning the records found
            return(RecordFound);
        }
Пример #9
0
 public QuestionPage AnswerAndVerifyQuestion(int answerOrder, string expectedQuestion, bool requireButtonAwait = true)
 {
     Driver.FindElement(By.XPath("(//label[contains(@class, 'multiple-choice--radio')])[" + answerOrder + "]")).Click();
     NextButton.Click();
     AwaitNextQuestionPage(requireButtonAwait);
     Assert.AreEqual(expectedQuestion, Header.Text);
     return(new QuestionPage(Driver));
 }
Пример #10
0
        //Adding Repayment,Expenses and Liabilities
        internal void RepaymentExpensesLiabilities()
        {
            //To skip the highlighted option
            SkipButton?.Click();
            System.Threading.Thread.Sleep(5000);
            // Populating the data from Excel
            ExcelLib.PopulateInCollection(Base.ExcelPath, "AddNewProperty");
            OwnersSelect.Click();
            System.Threading.Thread.Sleep(5000);
            PropertiesSelect.Click();
            ClickingAddNewProperty.Click();
            //Value set for property page details
            PropertyName.SendKeys(ExcelLib.ReadData(2, "Value"));
            SearchAddress.SendKeys(ExcelLib.ReadData(33, "Value"));
            System.Threading.Thread.Sleep(5000);
            //Value set using google api
            var address = Global.Driver.driver.FindElements(By.ClassName("pac-item"))[0];

            address.Click();
            TargetRent.SendKeys(ExcelLib.ReadData(14, "Value"));
            LandArea.SendKeys(ExcelLib.ReadData(10, "Value"));
            BedRooms.SendKeys(ExcelLib.ReadData(11, "Value"));
            CarParks.SendKeys(ExcelLib.ReadData(12, "Value"));
            Description.SendKeys(ExcelLib.ReadData(13, "Value"));
            FloorArea.SendKeys(ExcelLib.ReadData(15, "Value"));
            BathRooms.SendKeys(ExcelLib.ReadData(16, "Value"));
            YearBuilt.SendKeys(ExcelLib.ReadData(9, "Value"));
            NextButton.Click();
            //Value set for financial details page
            System.Threading.Thread.Sleep(2000);
            PurchasePrice.SendKeys(ExcelLib.ReadData(17, "Value"));
            HomeValue.SendKeys(ExcelLib.ReadData(18, "Value"));
            Mortgage.SendKeys(ExcelLib.ReadData(19, "Value"));
            //Adding repayment option
            AddRepayment.Click();
            RepaymentAmount.SendKeys(ExcelLib.ReadData(2, "AddRepaymentfieldValue"));
            RepaymentStartDate.SendKeys(ExcelLib.ReadData(3, "AddRepaymentfieldValue"));
            //Adding expenses option
            AddExpense.Click();
            ExpenseAmount.SendKeys(ExcelLib.ReadData(2, "AddExpensefieldValue"));
            var ExpenseDescription = Global.Driver.driver.FindElement(By.ClassName("seven")).FindElement(By.ClassName("width")).FindElement(By.Id("Text1"));

            ExpenseDescription.SendKeys(ExcelLib.ReadData(3, "AddExpensefieldValue"));
            ExpenseDate.SendKeys(ExcelLib.ReadData(4, "AddExpensefieldValue"));
            NextButton2.Click();
            //Value set for financial details page
            TenantEmail.SendKeys(ExcelLib.ReadData(20, "Value"));
            FirstName.SendKeys(ExcelLib.ReadData(21, "Value"));
            LastName.SendKeys(ExcelLib.ReadData(22, "Value"));
            StartDate.SendKeys(ExcelLib.ReadData(23, "Value"));
            EndDate.SendKeys(ExcelLib.ReadData(24, "Value"));
            RentAmount.SendKeys(ExcelLib.ReadData(25, "Value"));
            PaymentStartDate.SendKeys(ExcelLib.ReadData(26, "Value"));
            //Adding liability option
            NewLiability.Click();
            Amount.SendKeys(ExcelLib.ReadData(2, "NewLiabilityFieldValue"));
            Save.Click();
        }
Пример #11
0
 public TypeTrainPage ClickTypeTrain()
 {
     new WebDriverWait(driver, TimeSpan.FromSeconds(10)).Until(ExpectedConditions.ElementIsVisible(By.XPath("//*[@id='ufs-railway-app']/div/div[2]/div[2]/div[4]/div/div[3]/div/div[4]")));
     TypeButton.Click();
     new WebDriverWait(driver, TimeSpan.FromSeconds(10)).Until(ExpectedConditions.ElementIsVisible(By.XPath("//*[@id='ufs-railway-app']/div/div[2]/div[2]/div[4]/div/div[5]/div[3]/button")));
     NextButton.Click();
     new WebDriverWait(driver, TimeSpan.FromSeconds(10)).Until(ExpectedConditions.ElementIsVisible(By.XPath("//*[@id='ufs-railway-app']/div/div[2]/div[2]/div[4]/div/div[5]/div[2]/span/span")));
     return(this);
 }
Пример #12
0
        public HomePage SignIn(User user)
        {
            LoginInput.SendKeys(user.Name);
            NextButton.Click();
            PasswordInput.SendKeys(user.Password);
            SubmitButton.Click();

            return(new HomePage(driver));
        }
Пример #13
0
 public TypeTrainPage ClickTypeTrain()
 {
     new WebDriverWait(driver, TimeSpan.FromSeconds(10)).Until(ExpectedConditions.ElementIsVisible(By.XPath("//div[@class='wg-wagon-type']/div[1]")));
     TypeButton.Click();
     new WebDriverWait(driver, TimeSpan.FromSeconds(10)).Until(ExpectedConditions.ElementIsVisible(By.XPath("//button[@class='wg-button']")));
     NextButton.Click();
     new WebDriverWait(driver, TimeSpan.FromSeconds(10)).Until(ExpectedConditions.ElementIsVisible(By.XPath("//span[@class='wg-block__section-label t_error']/span")));
     return(this);
 }
Пример #14
0
 public void InputAccountInformation(String bankAccountNumber, String bankStateBranchCode, String bankNameField, String accountNameField)
 {
     BankAccountNumberField.SendKeys(bankAccountNumber);
     BankStateBranchCodeField.SendKeys(bankStateBranchCode);
     BankNameField.SendKeys(bankNameField);
     AccountNameField.SendKeys(accountNameField);
     ScrollToElement(NextButton);
     NextButton.Click();
 }
Пример #15
0
 public void InputContactInformation(String address, String city, String stateCode, String zip, String contactPhone, String emailAddress)
 {
     AddressField.SendKeys(address);
     CityField.SendKeys(city);
     new SelectElement(StateSelect).SelectByValue(stateCode);
     ZipField.SendKeys(zip);
     ContactPhoneNumber.SendKeys(contactPhone);
     EmailField.SendKeys(emailAddress);
     NextButton.Click();
 }
Пример #16
0
 public void InputPaymentInformation(String paymentType, String creditCardNumber, String expirationMonth, String expirationYear)
 {
     new SelectElement(PaymentTypeSelect).SelectByText(paymentType);
     CreditCardNumberField.SendKeys(creditCardNumber);
     new SelectElement(CreditCardExpirationMonth).SelectByValue(expirationMonth);
     new SelectElement(CreditCardExpirationYear).SelectByText(expirationYear);
     BillingAddressSameButton.Click();
     Thread.Sleep(1000);
     NextButton.Click();
 }
        public void LogInToDD365(string userName, string password)
        {
            UsernameInput.SendKeys("");
            UsernameInput.SendKeys(userName);
            NextButton.SendKeys("");
            NextButton.Click();
            PasswordInput.SendKeys("");
            PasswordInput.SendKeys(password);

            SigninButton.Click();
        }
Пример #18
0
        public override PluginExecutionResult PerformAction()
        {
            WaitForAvailable(ShortTimeout);

            Thread.Sleep(HumanTimeSpan);
            if (NextButton.Click() != ResultCode.Passed)
            {
                return(new PluginExecutionResult(PluginResult.Failed, string.Format("Failed to proceed beyond {0} Screen", ScreenName)));
            }
            return(new PluginExecutionResult(PluginResult.Passed));
        }
Пример #19
0
 public void Login(string email, string password)
 {
     enterEmail(email);
     NextButton.Click();
     WaitHelper.WaitForElementAccessable(PasswordInput, WaitHelper.DefaultTimeStep, "Password Input");
     enterPassword(password);
     if (RememberMeCheckbox.Selected)
     {
         RememberMeCheckbox.Click();
     }
     SignInButton.Click();
 }
Пример #20
0
        public QuestionPage AnswerYes()
        {
            if (!_driver.FindElements(By.Id("Yes")).Any())
            {
                throw new Exception("No answer with id 'Yes' could be found for question " + Header.Text);
            }

            AnswerYesButton.Click();
            NextButton.Click();
            AwaitNextQuestionPage();
            return(new QuestionPage(_driver));
        }
Пример #21
0
        //Add new property
        internal void AddingProperty()
        {
            //To skip the highlighted option
            SkipButton?.Click();
            System.Threading.Thread.Sleep(5000);
            // Populating the data from Excel
            ExcelLib.PopulateInCollection(Base.ExcelPath, "AddNewProperty");
            System.Threading.Thread.Sleep(5000);
            OwnersSelect.Click();
            System.Threading.Thread.Sleep(5000);
            PropertiesSelect.Click();
            ClickingAddNewProperty.Click();
            //Value set for property details page
            PropertyName.SendKeys(ExcelLib.ReadData(2, "Value"));
            SearchAddress.SendKeys(ExcelLib.ReadData(33, "Value"));
            System.Threading.Thread.Sleep(5000);
            //Value set using google api
            var address = Global.Driver.driver.FindElements(By.ClassName("pac-item"))[0];

            address.Click();
            TargetRent.SendKeys(ExcelLib.ReadData(14, "Value"));
            LandArea.SendKeys(ExcelLib.ReadData(10, "Value"));
            BedRooms.SendKeys(ExcelLib.ReadData(11, "Value"));
            CarParks.SendKeys(ExcelLib.ReadData(12, "Value"));
            Description.SendKeys(ExcelLib.ReadData(13, "Value"));
            FloorArea.SendKeys(ExcelLib.ReadData(15, "Value"));
            BathRooms.SendKeys(ExcelLib.ReadData(16, "Value"));
            YearBuilt.SendKeys(ExcelLib.ReadData(9, "Value"));
            imagebox.Click();
            //Image upload
            Global.Driver.driver.FindElement(By.Id("file-upload")).Click();
            System.Threading.Thread.Sleep(10000);
            SendKeys.SendWait("E:\\Document\\house.jpg");
            System.Threading.Thread.Sleep(10000);
            SendKeys.SendWait(@"{Enter}");
            System.Threading.Thread.Sleep(5000);
            NextButton.Click();
            System.Threading.Thread.Sleep(5000);
            //Value set for financial details page
            PurchasePrice.SendKeys(ExcelLib.ReadData(17, "Value"));
            HomeValue.SendKeys(ExcelLib.ReadData(18, "Value"));
            Mortgage.SendKeys(ExcelLib.ReadData(19, "Value"));
            NextButton2.Click();
            //Value set for Tenant details page
            TenantEmail.SendKeys(ExcelLib.ReadData(20, "Value"));
            FirstName.SendKeys(ExcelLib.ReadData(21, "Value"));
            LastName.SendKeys(ExcelLib.ReadData(22, "Value"));
            StartDate.SendKeys(ExcelLib.ReadData(23, "Value"));
            EndDate.SendKeys(ExcelLib.ReadData(24, "Value"));
            RentAmount.SendKeys(ExcelLib.ReadData(25, "Value"));
            PaymentStartDate.SendKeys(ExcelLib.ReadData(26, "Value"));
            Save.Click();
        }
Пример #22
0
 public void InputPersonalInformation(String ssn, String firstName, String middleName, String lastName, String gender, String birthMonth, String birthDay, String birthYear)
 {
     SsnField.SendKeys(ssn);
     FirstNameField.SendKeys(firstName);
     MiddleNameField.SendKeys(middleName);
     LastNameField.SendKeys(lastName);
     new SelectElement(GenderSelect).SelectByText(gender);
     new SelectElement(BirthMonthSelect).SelectByText(birthMonth);
     new SelectElement(BirthDaySelect).SelectByText(birthDay);
     new SelectElement(BirthYearSelect).SelectByText(birthYear);
     NextButton.Click();
 }
Пример #23
0
        public QuestionPage AnswerNo(bool requireButtonAwait = true)
        {
            if (!_driver.FindElements(By.Id("No")).Any())
            {
                throw new Exception("No answer with id 'No' could be found for question " + Header.Text);
            }

            AnswerNoButton.Click();
            NextButton.Click();
            AwaitNextQuestionPage(requireButtonAwait);
            return(new QuestionPage(_driver));
        }
Пример #24
0
        public QuestionPage AnswerYes()
        {
            if (!Driver.FindElements(By.CssSelector("[for='Yes']")).Any())
            {
                throw new Exception("No answer with label for 'Yes' could be found for question " + Header.Text);
            }

            AnswerYesButton.Click();
            NextButton.Click();
            AwaitNextQuestionPage();
            return(new QuestionPage(Driver));
        }
Пример #25
0
 private void ClickNextButton()
 {
     try
     {
         Logger.InfoFormat("Is Login btn displayed? {0}", NextButton.Displayed);
         NextButton.Click();
     }
     catch (Exception e)
     {
         Logger.Error("Error: ", e);
         throw (e);
     }
 }
Пример #26
0
 public void InputContactInformation(String address, String city, String stateCode, String zip, String contactPhone, String emailAddress)
 {
     AddressField.SendKeys(address);
     CityField.SendKeys(city);
     StateField.SendKeys(stateCode);
     ZipField.SendKeys(zip);
     ContactPhoneNumber.SendKeys(contactPhone);
     EmailField.SendKeys(emailAddress);
     if (IsElementDisplayed(ConfirmEmailField))
     {
         ConfirmEmailField.SendKeys(emailAddress);
     }
     NextButton.Click();
 }
Пример #27
0
        public HomePage ClickDatePickerFutureDate()
        {
            int NumberNextMonthDatePicker = 9;

            DatePickerShow.Click();
            for (int numberOfClick = NumberNextMonthDatePicker; numberOfClick > 0; numberOfClick--)
            {
                NextButton.Click();
            }
            for (int numberOfClick = 2; numberOfClick > 0; numberOfClick--)
            {
                DatePickerFutureDate.Click();
            }
            return(this);
        }
Пример #28
0
 public void InputSponsorInformation(Boolean referredByPartner, String referredByName, String referredByPhone)
 {
     Thread.Sleep(1000);
     if (referredByPartner && ReferredByNameField.Enabled)
     {
         ClickWhenClickable(ReferredYesRadioButton, TimeSpan.FromSeconds(5));
         ReferredByNameField.SendKeys(referredByName);
         ReferredByPhoneField.SendKeys(referredByPhone);
     }
     else if (!referredByPartner && ReferredByNameField.Enabled)
     {
         ClickWhenClickable(ReferredNoRadioButton, TimeSpan.FromSeconds(5));
     }
     NextButton.Click();
 }
        /* driver.FindElement(By.CssSelector(".datepicker-days .next > .glyphicon")).Click();
         * {
         *   var element = driver.FindElement(By.CssSelector(".datepicker-days .next > .glyphicon"));
         *   Actions builder = new Actions(driver);
         * builder.DoubleClick(element).Perform();
         * } */



        public void RegistrationPage()
        {
            CommonUtils cookieIgnore = new CommonUtils(driver);

            cookieIgnore.RejectAll_Cookies();

            SignIn_Page.Click();


            Excel_Suite userEmail = new Excel_Suite(Env.EXCEL_TEST_URL);

            userEmail.getCellData("SPP_TestData", true);
            Email_Text.SendKeys(Env.Email_Id);
            Password_Text.SendKeys("Test@123");

            WebDriverWait wait = new WebDriverWait(driver, System.TimeSpan.FromSeconds(800));

            Thread.Sleep(800);
            Submit.Click();


            dropdown_NCS.Click();
            NCS_Tab.Click();

            RetrieveCHICK.Click();

            Excel_Suite     childDataExcel = new Excel_Suite(Env.EXCEL_TEST_CHILD_DATA);
            ChildAward_Data ChildData      = childDataExcel.GetChildDetails(Env.EXCEL_TEST_CHILD_DATA);


            Eyp_firstname.SendKeys(ChildData.ChildFirstName);
            Eyp_lastname.SendKeys(ChildData.ChildLastName);

            DateOfBirth.SendKeys(ChildData.DateOfBirth);
            Eyp_chic.SendKeys(ChildData.ChildIdentifierCode);

            NextButton.Click();

            StartDate.SendKeys("");

            EndDate.SendKeys("");

            NextButton.Click();

            Claimedhours.SendKeys("4");
        }
Пример #30
0
        public dynamic SelectNextButton()
        {
            dynamic page;
            string  currentUrl = WebDriver.Url;

            NextButton.ScrollIntoViewBottom();
            NextButton.Click();
            WaitForUrlChanged(currentUrl);
            if (WebDriver.Url.Contains("descriptors"))
            {
                page = new VehicleDescriptorsPage();
            }
            else
            {
                page = new VehicleBodyTypePage();
            }
            page.WaitForPageLoad();
            return(page);
        }