public void FillFormwithMessage(int i) { var path = Directory.GetCurrentDirectory(); string fileName = path + "\\Test\\Data\\TestData.xlsx"; // ExcelHelper eat = new ExcelHelper(fileName); // string strWorksheetName = eat.getExcelSheetName(fileName, 1); // ComboBoxHelper.SelectInDropDownByText(SubjectHeading, eat.GetCellData(strWorksheetName, "SubjectHeading", i)); ComboBoxHelper.SelectInDropDownByText(SubjectHeading, "Customer service1"); Thread.Sleep(5000); // TextBoxHelper.ClearandTypeinTextBox(Emailaddress, eat.GetCellData(strWorksheetName, "Email address", i)); TextBoxHelper.ClearandTypeinTextBox(Emailaddress, "*****@*****.**"); Thread.Sleep(5000); //TextBoxHelper.ClearandTypeinTextBox(OrderReference, eat.GetCellData(strWorksheetName, "Order Reference", i)); TextBoxHelper.ClearandTypeinTextBox(OrderReference, "AAAA"); Thread.Sleep(5000); TextBoxHelper.ClearandTypeinTextBox(Message, "This is with Reference to My Order"); Thread.Sleep(5000); Send.Click(); Thread.Sleep(5000); string ConfirmationMsg = ConfirmationMessage.Text; Thread.Sleep(5000); AssertHelper.AreEqual(ConfirmationMsg, "Your message has been successfully sent to our team."); Thread.Sleep(5000); }
// public string CreateCustomerDetails(string colconame, int i, string lineofbusiness, string band) public string CreateCustomerDetails(string colconame, int i) { string customerERP = ""; string pth = AppDomain.CurrentDomain.BaseDirectory; Actions action = new Actions(DriverContext.GetDriver <IWebDriver>()); IReadOnlyCollection <string> all_windowHandles = DriverContext.GetDriver <IWebDriver>().WindowHandles; foreach (string handle in all_windowHandles) { DriverContext.GetDriver <IWebDriver>().SwitchTo().Window(handle); if (DriverContext.GetDriver <IWebDriver>().Title.Contains(colconame)) { string fileName = ConfigReader.TestDataFilepath; ExcelHelper eat = new ExcelHelper(fileName); string strWorksheetName = eat.getExcelSheetName(fileName, 1); BrowserHelper.BrowserMaximize(); action.MoveToElement(Start).Build().Perform(); action.MoveToElement(Customers).Build().Perform(); action.MoveToElement(CreatetopLevelCustomer).Click().Build().Perform(); ComboBoxHelper.SelectInDropDownByText(LineOfBusiness, eat.GetCellData(strWorksheetName, "LineOfBusiness", i)); ComboBoxHelper.SelectInDropDownByText(LineOfBusiness, lineofbusiness); string randomnumber = RandomNumberandStringGenerator.randomnumberwithoneargument(6); string fullname = "Automation" + randomnumber; TextBoxHelper.ClearandTypeinTextBox(FullName, fullname); TextBoxHelper.ClearandTypeinTextBox(ShortName, fullname); TextBoxHelper.ClearandTypeinTextBox(TradingName, fullname); ComboBoxHelper.SelectInDropDownByText(LegalEntity, eat.GetCellData(strWorksheetName, "LegalEntity", i)); TextBoxHelper.ClearandTypeinTextBox(IncorporationDate, eat.GetCellData(strWorksheetName, "IncorporationDate", i)); IncorporationDate.SendKeys(Keys.Tab); TextBoxHelper.ClearandTypeinTextBox(VATRegistrationNumber, randomnumber); ComboBoxHelper.SelectInDropDownByText(Band, eat.GetCellData(strWorksheetName, "Band", i)); ComboBoxHelper.SelectInDropDownByText(MarketingSegmentation, eat.GetCellData(strWorksheetName, "MarketingSegmentation", i)); TextBoxHelper.ClearandTypeinTextBox(CreditLimit, eat.GetCellData(strWorksheetName, "CreditLimit", i)); TextBoxHelper.ClearandTypeinTextBox(RequestedLimit, eat.GetCellData(strWorksheetName, "RequestedLimit", i)); Save.Click(); customerERP = DriverContext.GetDriver <IWebDriver>().FindElement(By.XPath("")).GetAttribute("value"); LogHelper.WriteLog(ConfigReader.logFilePath, "Customer ERP is :-" + customerERP); string customerERPValue = eat.SetCellData(strWorksheetName, "CustomerERP", i, customerERP); } } return(customerERP); }
public void NavigatetoandCreateManualFees(string quantity, string unitprice, string manaulfeetext) { try { string fileName = ""; ExcelHelper eat = new ExcelHelper(fileName); string strWorksheetName = eat.getExcelSheetName(fileName, 12); GenericHelper.ExplicitWaitByXpath(SearchMenu, 3000); TextBoxHelper.ClearandTypeinTextBox(SearchMenu, "Manual Fees"); GenericHelper.ExplicitWaitByXpath(ManualFeees, 3000); GenericHelper.MouseHoverToElementbylocator(ManualFeees); GenericHelper.ExplicitWaitByXpath(ManualFeees, 3000); GenericHelper.MouseHoverToElementandClickbylocator(ManualFeees); GenericHelper.ExplicitWaitByXpath(NewManualFees, 3000); GenericHelper.MouseHoverToElementandClickbylocator(NewManualFees); } catch (Exception e) { Console.WriteLine(e.Message); } }
public string CreateCustomerDetails(string colconame, int i, string lineofbusiness, string band) { string customerERP = ""; string pth = AppDomain.CurrentDomain.BaseDirectory; Actions action = new Actions(DriverContext.Driver); IReadOnlyCollection <string> all_windowHandles = DriverContext.Driver.WindowHandles; foreach (string handle in all_windowHandles) { if (DriverContext.Driver.Title.Contains(colconame)) { string fileName = @""; ExcelHelper eat = new ExcelHelper(fileName); BrowserHelper.BrowserMaximize(); action.MoveToElement(Start).Build().Perform(); action.MoveToElement(Customers).Build().Perform(); action.MoveToElement(CreatetopLevelCustomer).Click().Build().Perform(); ComboBoxHelper.SelectInDropDownByText(LineOfBusiness, lineofbusiness); string randomnumber = RandomNumberandStringGenerator.randomnumberwithoneargument(6); string fullname = "Automation" + randomnumber; TextBoxHelper.ClearandTypeinTextBox(FullName, fullname); TextBoxHelper.ClearandTypeinTextBox(ShortName, fullname); TextBoxHelper.ClearandTypeinTextBox(TradingName, fullname); } } return(customerERP); }
public void FillFormwithoutMessage(int i) { var path = Directory.GetCurrentDirectory(); string fileName = path + "\\Test\\Data\\TestData.xlsx"; // ExcelHelper eat = new ExcelHelper(fileName); // string strWorksheetName = eat.getExcelSheetName(fileName, 1); // ComboBoxHelper.SelectInDropDownByText(SubjectHeading, eat.GetCellData(strWorksheetName, "SubjectHeading", i)); ComboBoxHelper.SelectInDropDownByText(SubjectHeading, "Customer service1"); Thread.Sleep(5000); // TextBoxHelper.ClearandTypeinTextBox(Emailaddress, eat.GetCellData(strWorksheetName, "Email address", i)); TextBoxHelper.ClearandTypeinTextBox(Emailaddress, "*****@*****.**"); Thread.Sleep(5000); // TextBoxHelper.ClearandTypeinTextBox(OrderReference, eat.GetCellData(strWorksheetName, "Order Reference", i)); TextBoxHelper.ClearandTypeinTextBox(OrderReference, "AAAA"); Thread.Sleep(5000); Send.Click(); Thread.Sleep(5000); string ErrorMsg = ErrorMessage.Text; Thread.Sleep(5000); AssertHelper.AreEqual(ErrorMsg, "The message cannot be blank."); Thread.Sleep(5000); }