Ejemplo n.º 1
0
        internal void GetDataFromExcel()
        {
            try
            {
                // Populating the data from Excel
                ExcelLib.PopulateInCollection(Base.ExcelPath, "FinanceDetails");

                //Edit PurchasePrice textbox
                PurchasePrice.Clear();
                Thread.Sleep(1000);
                PurchasePrice.SendKeys(ExcelLib.ReadData(2, "Purchase Price"));

                //Edit Mortgage textbox
                Mortgage.Clear();
                Thread.Sleep(1000);
                Mortgage.SendKeys(ExcelLib.ReadData(2, "Mortgage"));

                //Edit HomeValue textbox
                HomeValue.Clear();
                Thread.Sleep(1000);
                HomeValue.SendKeys(ExcelLib.ReadData(2, "Home Value"));
                HomeValue.SendKeys(Keys.Enter);


                //Click on the "Save" button
                NextButton.Click();
                Thread.Sleep(2000);
            }
            catch (Exception e)
            {
                Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Test Failed, Add Finance Details Unsuccessfull", e.Message);
            }
        }
Ejemplo n.º 2
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();
        }
Ejemplo n.º 3
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();
        }
Ejemplo n.º 4
0
 internal void FinDetailsMethod()
 {
     ExcelLib.PopulateInCollection(Base.ExcelPath, "FinancialDetails");
     Driver.wait(2);
     //Verify the title of Webpage
     Assert.IsTrue(Driver.driver.PageSource.Contains("Purchase Price"));
     try
     {
         PurchasePrice.SendKeys(ExcelLib.ReadData(2, "PurchasePrice"));
         decimal d;
         if (decimal.TryParse(ExcelLib.ReadData(2, "PurchasePrice"), out d))
         {
             Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Purchase Price field has been filled with integer");
             Mortgage.SendKeys(ExcelLib.ReadData(2, "Mortgage"));
             decimal dM;
             if (decimal.TryParse(ExcelLib.ReadData(2, "Mortgage"), out d))
             {
                 Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Purchase Price field has been filled with integer");
                 Homevalue.SendKeys(ExcelLib.ReadData(2, "HomeValue"));
                 Driver.wait(2);
                 if (ClickNext.Enabled)
                 {
                     ClickNext.Click();
                     Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Info, "Method to enter Financial details executed and mandatory fileds verified");
                 }
                 else
                 {
                     Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Next button is not enabled");
                 }
             }
             else
             {
                 Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Mortgage Field has been not been filled with numeric value");
             }
         }
         else
         {
             Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Purchase Price field has not been filled with a numeric character");
         }
     }
     catch (Exception ex)
     {
         string excepMesg = ex.Message;
         Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Exception Message:" + excepMesg);
     }
 }
        void AddFinanceDetails()
        {
            ExcelLib.PopulateInCollection(Base.ExcelPath, "FinanceDetails");

            PurchasePrice.SendKeys(ExcelLib.ReadData(2, "PurchasePrice"));
            Mortage.SendKeys(ExcelLib.ReadData(2, "Mortgage"));
            HomeValue.SendKeys(ExcelLib.ReadData(2, "HomeValue"));
            if (owneroccupied == "Yes")
            {
                SaveInFinance.Click();
            }
            else
            {
                NextInfinance.Click();
                AddTenantDetails();
            }
        }
        internal void SaveFinanceDetails(int TestDataSet)
        {
            try
            {
                //Enter the testdata into the relevant input fields
                PurchasePrice.SendKeys(ExcelLib.ReadData(TestDataSet, "PurchasePrice"));
                Mortgage.SendKeys(ExcelLib.ReadData(TestDataSet, "Mortgage"));
                HomeValue.SendKeys(ExcelLib.ReadData(TestDataSet, "HomeValue"));
                Thread.Sleep(1000);

                //Click on the Next Button to move to the Tenant Details
                NextButton.Click();
            }
            catch (Exception e)
            {
                Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Error, "Error occured when entering Finance Details for the new property: " + e.Message.ToString());
            }
        }
Ejemplo n.º 7
0
        public void FinanceDetails()
        {
            //Enter Purchase Prise value
            PurchasePrice.SendKeys(ExcelLib.ReadData(2, "PurchasePrice"));
            Driver.wait(2000);

            //Enter Mortgage value
            Mortgage.SendKeys(ExcelLib.ReadData(2, "Mortgage"));
            Driver.wait(2000);

            //Enter Home Value
            HomeValue.SendKeys(ExcelLib.ReadData(2, "HomeValue"));
            Driver.wait(2000);

            //Clicking on next button
            NextFinance.Click();
            Thread.Sleep(1000);
        }
        //A method to enter and save a given test data set for finance details
        internal bool SaveFinanceDetails(int TestDataSet)
        {
            try
            {
                //Enter the testdata into the relevant input fields
                PurchasePrice.SendKeys(ExcelLib.ReadData(TestDataSet, "PurchasePrice"));
                Mortgage.SendKeys(ExcelLib.ReadData(TestDataSet, "Mortgage"));
                HomeValue.SendKeys(ExcelLib.ReadData(TestDataSet, "HomeValue"));
                Thread.Sleep(1000);

                //Click on the Next Button to move to the Tenant Details
                FinanceNextButton.Click();
                return(true);
            }
            catch (Exception e)
            {
                // Add details of the error into the report
                Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Error, "Error occured when entering Finance Details for the new property: " + e.Message.ToString());
                // Save Screenshot to display the error
                String img = SaveScreenShotClass.SaveScreenshot(Driver.driver, "Exception Report");
                Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Info, "Image example: " + img);
                return(false);
            }
        }