Exemplo n.º 1
0
        public void NavigateToEditBillingForm()
        {
            //click Admin link from Dashboard
            AdminLink.Click();

            //Click Customers link
            CustLink.Click();
            Driver.wait(3);

            //Click Edit button on Customers Page
            Editbtn_Cust_page.Click();

            //Pass control to IFrame (Edit Customer details) or Edit Client
            Driver.driver.SwitchTo().Frame(Driver.driver.FindElement(By.TagName("iframe")));

            Driver.wait(2);

            //Check if IsSame Checkbox selected. If yes then uncheck it to enable Edit Billing ContactButton

            if (IsSameContactBtn.Selected)
            {
                IsSameContactBtn.Click();
            }

            //Click Edit Billing Contact btn on  Edit Customers Page
            EditBillingBtn.Click();

            //Pass control to IFrame with title Edit Contact
            Driver.driver.SwitchTo().Frame(Driver.driver.FindElement(By.TagName("iframe")));

            Driver.wait(2);
        }
Exemplo n.º 2
0
        internal void CreateCustomerValid()
        {
            ExcelLib.PopulateInCollection(Test.Base.ExcelPath, "Customer");

            // Go to Admin > Customer
            Driver.wait(2);
            AdminLink.Click();
            CustLink.Click();
            Driver.wait(2);

            // Create Customer
            CreateNewBtn.Click();
            Driver.wait(2);
            CustNameTB.Clear();
            CustNameTB.SendKeys(ExcelLib.ReadData(2, "Name"));

            // Edit Contact
            EditContactBtn.Click();


            WebDriverWait wait    = new WebDriverWait(Driver.driver, TimeSpan.Parse("10"));
            IWebElement   element = wait.Until(
                ExpectedConditions.VisibilityOfAllElementsLocatedBy(By.Id("FirstName"))
                ).FirstOrDefault();

            element.SendKeys("test");

            //FirstNameTB.Click();
            //FirstNameTB.SendKeys("Myfirst");
            ////           FirstNameTB.SendKeys(ExcelLib.ReadData(2, "FirstName"));
            //            LastNameTB.Clear();
            //            LastNameTB.SendKeys(ExcelLib.ReadData(2, "LastName"));
            //            PreferredNameTB.Clear();
            //            PreferredNameTB.SendKeys(ExcelLib.ReadData(2, "PreferredName"));
            //            PhoneTB.Clear();
            //            PhoneTB.SendKeys(ExcelLib.ReadData(2, "Phone"));
            //            MobileTB.Clear();
            //            MobileTB.SendKeys(ExcelLib.ReadData(2, "Mobile"));
            //            EmailTB.Clear();
            //            EmailTB.SendKeys(ExcelLib.ReadData(2, "Email"));
            //            FaxTB.Clear();
            //            FaxTB.SendKeys(ExcelLib.ReadData(2, "Fax"));
            //            StreetTB.Clear();
            //            StreetTB.SendKeys(ExcelLib.ReadData(2, "Street"));
            //            CityTB.Clear();
            //            CityTB.SendKeys(ExcelLib.ReadData(2, "City"));
            //            CountryTB.Clear();
            //            CountryTB.SendKeys(ExcelLib.ReadData(2, "Country"));
            SaveContactBtn.Click();

            //ExitEditContactBtn.Click();
            Driver.wait(10);

            // Billing Contact
            IsSameContactBtn.Click();

            //GST
            GstTB.Clear();
            GstTB.SendKeys(ExcelLib.ReadData(2, "GST"));

            // Save Customer
            SaveBtn.Click();
            Driver.wait(10);
        }