Example #1
0
        public void EnterTenantDet()
        {
            _Wait.Until(ExpectedConditions.ElementExists(By.XPath("//*[@id='lname']")));
            TenantEmail.SendKeys("*****@*****.**");
            TenantFullname.SendKeys("Tenant");
            TenantLastName.SendKeys("TenantLast");
            RentAmt.SendKeys("200");

            /*   IJavaScriptExecutor js = (IJavaScriptExecutor)_driver;
             * js.ExecuteScript(StartDate.startD);
             *
             * String startD = "24/09/2018";
             */

            StartDate.SendKeys("24/09/2018");
            StartDate.Click();
            System.Threading.Thread.Sleep(1000);

            EndDate.SendKeys("24/08/2028");
            EndDate.Click();
            System.Threading.Thread.Sleep(1000);

            PaymentStartDate.SendKeys("24/09/2018");
            PaymentStartDate.Click();
            System.Threading.Thread.Sleep(1000);


            Liabilities.Click();
            _Wait.Until(ExpectedConditions.ElementExists(By.XPath("//*[@id='LiabilityDetail']/div/div[1]/div[2]/div[1]/input")));

            ValLiabilities.SendKeys("1000");
            ClickSave.Click();
        }
Example #2
0
        internal void TenantDetails4mExcel()
        {
            ExcelLib.PopulateInCollection(Base.ExcelPath, "TenantDetails");
            Driver.wait(2);
            Assert.IsTrue(Driver.driver.PageSource.Contains("Tenant Email"));
            try
            {
                bool bEmail = TenantEmailId.Enabled;
                if (bEmail)
                {
                    TenantEmailId.SendKeys(ExcelLib.ReadData(3, "EmailId"));
                    Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Email Id field is enabled and value from excel sheet passed");
                    IsMainTenant.Click();
                    //Verify first name field and last name is emabled or not
                    bool bFName = TenantFirstName.Enabled;
                    if (bFName)
                    {
                        TenantFirstName.SendKeys(ExcelLib.ReadData(3, "FirstName"));
                        TenantLastName.SendKeys(ExcelLib.ReadData(3, "LastName"));
                        Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Info, "Its a new email id; First Name and Last name filled with Excel sheet");
                    }
                    else
                    {
                        Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Info, "First Name & Last Name has been auto filled with the email id");
                    }
                    TenantStartDate.Click();
                    //verify Rent amount field is enabled or not
                    bool bRentField = RentAmount.Enabled;
                    if (bRentField)
                    {
                        RentAmount.SendKeys(ExcelLib.ReadData(3, "RentAmount"));
                        decimal d;

                        if (decimal.TryParse(ExcelLib.ReadData(3, "RentAmount"), out d))
                        {
                            PaymentFrequncy.Click();
                            Driver.wait(5);
                            Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Rent Amount field has been verified for decimal values");
                            PaymentStartDate.Click();

                            PaymentDueDate.Click();
                            if (ButtonSave.Enabled)
                            {
                                ButtonSave.Click();
                                Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "All the field has been entered on Add Tenant page");
                            }
                            else
                            {
                                Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Some of the fields on Add tenant Page need sto be cross verified, Next button is not enabled ");
                            }
                        }
                        else
                        {
                            Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Rent Amount field has been verified for decimal values");
                        }
                    }
                    else
                    {
                        Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Rent amount field is not enabled");
                    }
                }
                else
                {
                    Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Email Id Field is not enabled");
                }

                //ClickNewLiability.Click();
                //LiabilityName.Click();
                //LiabilityAmount.SendKeys(ExcelLib.ReadData(2, "LiabilityAmount"));
                //Driver.wait(5);
                //ButtonSave.Click();
            }
            catch (Exception ex)
            {
                string exMesg = ex.Message;
                Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Exception Message thrown:" + exMesg);
            }
        }