//d List<string> windowList = new ArraySegment<string>(); public void NavigateToEditContactForm() { //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); //Click Edit Contact btn on Edit Customers Page EditContactBtn.Click(); //Pass control to IFrame with title Edit Contact Driver.driver.SwitchTo().Frame(Driver.driver.FindElement(By.TagName("iframe"))); Driver.wait(2); }
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); }
public void ClicknSave_Wthout_Changes() { //click Admin link from Dashboard AdminLink.Click(); //Click Customers link CustLink.Click(); Driver.wait(3); // Declaring variable to capture the ID of record before editing int Id_For_Rec_bfore_save = Int32.Parse(Driver.driver.FindElement(By.XPath("//*[@id=\"clientsGrid\"]/div[2]/table/tbody/tr[1]/td[1]")).Text); Console.WriteLine(Id_For_Rec_bfore_save); //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); SaveBtn.Click(); Driver.driver.SwitchTo().DefaultContent(); try { // Declaring variable to capture the ID of record after clicking save with no changes made. int Id_For_Rec_aftr_save = Int32.Parse(Driver.driver.FindElement(By.XPath("html/body/div[4]/div/div/div[2]/table/tbody/tr[1]/td[1]")).Text); Console.WriteLine(Id_For_Rec_aftr_save); Assert.AreEqual(Id_For_Rec_bfore_save, Id_For_Rec_aftr_save); Test.Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "User is able to save Curtomer record without editing the record"); } catch (Exception e) { Test.Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "User is not able to save Curtomer record without editing the record"); } }
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); }