public void createAgentsFromExcelSheet() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var agents_EmployeesHelper = new Agents_EmployeesHelper(GetWebDriver()); var agent_1099SalesAgentHelper = new Agent_1099SalesAgentHelper(GetWebDriver()); var agents_PartnerAgentsHelper = new Agents_PartnerAgentsHelper(GetWebDriver()); var agents_PartnerAssociationHelper = new Agents_PartnerAssociationHelper(GetWebDriver()); executionLog.Log("CreateAgentsFromExcelSheet", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("CreateAgentsFromExcelSheet", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("CreateAgentsFromExcelSheet", "Read Data from Excel File and Create Agents"); Excel.Application xlApp; Excel.Workbook xlWorkBook; Excel.Worksheet xlWorkSheet; Excel.Range xlrange; string xlString; string xlString1; double xlDouble; int xlRowCnt = 0; int xlColCnt = 0; xlApp = new Excel.Application(); //Open Excel file var locFile = GetPathToFile() + "OfficeAgents.xlsx"; //var updated_path = locFile.Replace("Files", "bin"); xlWorkBook = xlApp.Workbooks.Open(locFile); xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1); //This gives the used cells in the sheet xlrange = xlWorkSheet.UsedRange; Console.WriteLine("Row count is " + xlrange.Rows.Count); for (xlRowCnt = 2; xlRowCnt <= xlrange.Rows.Count; xlRowCnt++) { // Find type of Agent xlString = (string)(xlrange.Cells[xlRowCnt, 1] as Excel.Range).Value2; if (xlString == "Employee") { GetWebDriver().Navigate().GoToUrl("https://www.mypegasuscrm.com/newthemecorp/" + username[0] + "/employees/create"); agents_EmployeesHelper.WaitForWorkAround(3000); //Employee First Name xlString = (string)(xlrange.Cells[xlRowCnt, 2] as Excel.Range).Value2; agents_EmployeesHelper.TypeText("FirstNAME", xlString); //Employee Last Name xlString = (string)(xlrange.Cells[xlRowCnt, 3] as Excel.Range).Value2; agents_EmployeesHelper.TypeText("LastName", xlString); //Employee Birthday xlString = (string)(xlrange.Cells[xlRowCnt, 4] as Excel.Range).Value2; agents_EmployeesHelper.TypeText("BirthDay", xlString); //Employee eAddress Type xlString = (string)(xlrange.Cells[xlRowCnt, 6] as Excel.Range).Value2; agents_EmployeesHelper.SelectByText("eAddressType", xlString); agents_EmployeesHelper.WaitForWorkAround(1000); //Employee eAddress Label xlString = (string)(xlrange.Cells[xlRowCnt, 7] as Excel.Range).Value2; agents_EmployeesHelper.SelectByText("eAddressLebel", xlString); //Employee eAddress xlString = (string)(xlrange.Cells[xlRowCnt, 8] as Excel.Range).Value2; agents_EmployeesHelper.TypeText("eAddress", xlString); //Employee Username xlString = (string)(xlrange.Cells[xlRowCnt, 9] as Excel.Range).Value2; agents_EmployeesHelper.TypeText("UserName", xlString); //Employee Password agents_EmployeesHelper.ClickElement("AutoGenPswdChkBox"); agents_EmployeesHelper.WaitForWorkAround(1000); try { xlDouble = (double)(xlrange.Cells[xlRowCnt, 10] as Excel.Range).Value2; xlString = "" + xlDouble; agents_EmployeesHelper.TypeText("Password", xlString); } catch (Microsoft.CSharp.RuntimeBinder.RuntimeBinderException) { xlString = (string)(xlrange.Cells[xlRowCnt, 10] as Excel.Range).Value2; agents_EmployeesHelper.TypeText("Password", xlString); } //Employee Avatar xlString = (string)(xlrange.Cells[xlRowCnt, 11] as Excel.Range).Value2; int num = agents_EmployeesHelper.XpathCount("//form[@id='EmployeeCreateEmployeeForm']/div[3]/div[5]/div/div/div[2]/div/div[3]/ul/li"); Console.WriteLine("num=" + num); for (int i = 1; i <= num; i++) { string name = agents_EmployeesHelper.GetText("//form[@id='EmployeeCreateEmployeeForm']/div[3]/div[5]/div/div/div[2]/div/div[3]/ul/li[" + i + "]/label/span"); if (name == xlString) { agents_EmployeesHelper.Click("//form[@id='EmployeeCreateEmployeeForm']/div[3]/div[5]/div/div/div[2]/div/div[3]/ul/li[" + i + "]/input"); agents_EmployeesHelper.WaitForWorkAround(1000); break; } else { continue; } } //Click on Save agents_EmployeesHelper.ClickElement("SaveEmployee"); agents_EmployeesHelper.WaitForWorkAround(3000); if (GetWebDriver().PageSource.Contains("This username already taken") == true) { continue; } } else if (xlString == "Sales Agent") { GetWebDriver().Navigate().GoToUrl("https://www.mypegasuscrm.com/newthemecorp/" + username[0] + "/sales_agents/create"); agent_1099SalesAgentHelper.WaitForWorkAround(3000); //1099 Sales Agent First Name xlString = (string)(xlrange.Cells[xlRowCnt, 2] as Excel.Range).Value2; agent_1099SalesAgentHelper.TypeText("FirstNAME", xlString); //1099 Sales Agent Last Name xlString = (string)(xlrange.Cells[xlRowCnt, 3] as Excel.Range).Value2; agent_1099SalesAgentHelper.TypeText("LastName", xlString); //1099 Sales Agent Birthday xlString = (string)(xlrange.Cells[xlRowCnt, 4] as Excel.Range).Value2; agent_1099SalesAgentHelper.TypeText("BirthDay", xlString); //1099 Sales Agent eAddress Type xlString = (string)(xlrange.Cells[xlRowCnt, 6] as Excel.Range).Value2; agent_1099SalesAgentHelper.SelectByText("eAddressType", xlString); agent_1099SalesAgentHelper.WaitForWorkAround(1000); //1099 Sales Agent eAddress Label xlString = (string)(xlrange.Cells[xlRowCnt, 7] as Excel.Range).Value2; agent_1099SalesAgentHelper.SelectByText("eAddressLebel", xlString); //1099 Sales Agent eAddress xlString = (string)(xlrange.Cells[xlRowCnt, 8] as Excel.Range).Value2; agent_1099SalesAgentHelper.TypeText("eAddress", xlString); //1099 Sales Agent Username xlString = (string)(xlrange.Cells[xlRowCnt, 9] as Excel.Range).Value2; agent_1099SalesAgentHelper.TypeText("UserName", xlString); //1099 Sales Agent Password agent_1099SalesAgentHelper.ClickElement("AutoGenPswd"); agent_1099SalesAgentHelper.WaitForWorkAround(1000); try { xlDouble = (double)(xlrange.Cells[xlRowCnt, 10] as Excel.Range).Value2; xlString = "" + xlDouble; agent_1099SalesAgentHelper.TypeText("Password", xlString); } catch (Microsoft.CSharp.RuntimeBinder.RuntimeBinderException) { xlString = (string)(xlrange.Cells[xlRowCnt, 10] as Excel.Range).Value2; agent_1099SalesAgentHelper.TypeText("Password", xlString); } //1099 Sales Agent Avatar xlString = (string)(xlrange.Cells[xlRowCnt, 11] as Excel.Range).Value2; int num = agent_1099SalesAgentHelper.XpathCount("//form[@id='EmployeeCreateSalesUserForm']/div[3]/div[3]/div/div/div[2]/div/div[3]/ul/li"); for (int i = 1; i <= num; i++) { string name = agent_1099SalesAgentHelper.GetText("//form[@id='EmployeeCreateSalesUserForm']/div[3]/div[3]/div/div/div[2]/div/div[3]/ul/li[" + i + "]/label/span"); if (name == xlString) { agent_1099SalesAgentHelper.Click("//form[@id='EmployeeCreateSalesUserForm']/div[3]/div[3]/div/div/div[2]/div/div[3]/ul/li[" + i + "]/input"); break; } else { continue; } } //Click on Save agent_1099SalesAgentHelper.ClickElement("SaveSaleAgent"); agent_1099SalesAgentHelper.WaitForWorkAround(3000); if (GetWebDriver().PageSource.Contains("This username already taken") == true) { continue; } } else if (xlString == "Referral Agent") { GetWebDriver().Navigate().GoToUrl("https://www.mypegasuscrm.com/newthemecorp/" + username[0] + "/partners/agent/create"); agents_PartnerAgentsHelper.WaitForWorkAround(3000); //Partner Agent First Name xlString = (string)(xlrange.Cells[xlRowCnt, 2] as Excel.Range).Value2; agents_PartnerAgentsHelper.TypeText("FirstName", xlString); //Partner Agent Last Name xlString = (string)(xlrange.Cells[xlRowCnt, 3] as Excel.Range).Value2; agents_PartnerAgentsHelper.TypeText("LastName", xlString); //Partner Agent Birthday xlString = (string)(xlrange.Cells[xlRowCnt, 4] as Excel.Range).Value2; agents_PartnerAgentsHelper.TypeText("BirthDay", xlString); //Partner Agent eAddress Type xlString = (string)(xlrange.Cells[xlRowCnt, 6] as Excel.Range).Value2; agents_PartnerAgentsHelper.SelectByText("eAddressType", xlString); agents_PartnerAgentsHelper.WaitForWorkAround(1000); //Partner Agent eAddress Label xlString = (string)(xlrange.Cells[xlRowCnt, 7] as Excel.Range).Value2; agents_PartnerAgentsHelper.SelectByText("eAddressLebel", xlString); //Partner Agent eAddress xlString = (string)(xlrange.Cells[xlRowCnt, 8] as Excel.Range).Value2; agents_PartnerAgentsHelper.TypeText("eAddress", xlString); //Partner Agent Username xlString = (string)(xlrange.Cells[xlRowCnt, 9] as Excel.Range).Value2; agents_PartnerAgentsHelper.TypeText("UserName", xlString); //Partner Agent Password agents_PartnerAgentsHelper.ClickElement("AutoGenPassword"); agents_PartnerAgentsHelper.WaitForWorkAround(1000); try { xlDouble = (double)(xlrange.Cells[xlRowCnt, 10] as Excel.Range).Value2; xlString = "" + xlDouble; agents_PartnerAgentsHelper.TypeText("UserPassword", xlString); } catch (Microsoft.CSharp.RuntimeBinder.RuntimeBinderException) { xlString = (string)(xlrange.Cells[xlRowCnt, 10] as Excel.Range).Value2; agents_PartnerAgentsHelper.TypeText("UserPassword", xlString); } //Partner Agent Avatar xlString = (string)(xlrange.Cells[xlRowCnt, 11] as Excel.Range).Value2; int num = agents_PartnerAgentsHelper.XpathCount("//div[@id='user_data']/div/div[3]/ul/li"); for (int i = 1; i <= num; i++) { string name = agents_PartnerAgentsHelper.GetText("//div[@id='user_data']/div/div[3]/ul/li[" + i + "]/label/span"); if (name == xlString) { agents_PartnerAgentsHelper.Click("//div[@id='user_data']/div/div[3]/ul/li[" + i + "]/input"); break; } else { continue; } } //Click on Save agents_PartnerAgentsHelper.ClickElement("ClickSave"); agents_PartnerAgentsHelper.WaitForWorkAround(3000); if (GetWebDriver().PageSource.Contains("This username already taken") == true) { continue; } } else if (xlString == "Referral Association") { GetWebDriver().Navigate().GoToUrl("https://www.mypegasuscrm.com/newthemecorp/" + username[0] + "/partners/association/create"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); //Partner Association First Name xlString = (string)(xlrange.Cells[xlRowCnt, 2] as Excel.Range).Value2; agents_PartnerAssociationHelper.TypeText("FirstNAME", xlString); //Partner Association Last Name xlString = (string)(xlrange.Cells[xlRowCnt, 3] as Excel.Range).Value2; agents_PartnerAssociationHelper.TypeText("LastName", xlString); //Partner Association Birthday xlString = (string)(xlrange.Cells[xlRowCnt, 4] as Excel.Range).Value2; agents_PartnerAssociationHelper.TypeText("Birthday", xlString); //Partner Association Name xlString = (string)(xlrange.Cells[xlRowCnt, 5] as Excel.Range).Value2; agents_PartnerAssociationHelper.TypeText("Name", xlString); //Partner Association eAddress Type xlString = (string)(xlrange.Cells[xlRowCnt, 6] as Excel.Range).Value2; agents_PartnerAssociationHelper.SelectByText("eAddressType", xlString); agents_PartnerAssociationHelper.WaitForWorkAround(1000); //Partner Association eAddress Label xlString = (string)(xlrange.Cells[xlRowCnt, 7] as Excel.Range).Value2; agents_PartnerAssociationHelper.SelectByText("eAddressLebel", xlString); //Partner Association eAddress xlString = (string)(xlrange.Cells[xlRowCnt, 8] as Excel.Range).Value2; agents_PartnerAssociationHelper.TypeText("eAddress", xlString); //Partner Association Username xlString = (string)(xlrange.Cells[xlRowCnt, 9] as Excel.Range).Value2; agents_PartnerAssociationHelper.TypeText("UserName", xlString); //Partner Association Password agents_PartnerAssociationHelper.ClickElement("AutoGenPswd"); agents_PartnerAssociationHelper.WaitForWorkAround(1000); try { xlDouble = (double)(xlrange.Cells[xlRowCnt, 10] as Excel.Range).Value2; xlString = "" + xlDouble; agents_PartnerAssociationHelper.TypeText("Password", xlString); } catch (Microsoft.CSharp.RuntimeBinder.RuntimeBinderException) { xlString = (string)(xlrange.Cells[xlRowCnt, 10] as Excel.Range).Value2; agents_PartnerAssociationHelper.TypeText("Password", xlString); } //Partner Association Avatar xlString = (string)(xlrange.Cells[xlRowCnt, 11] as Excel.Range).Value2; int num = agents_PartnerAssociationHelper.XpathCount("//form[@id='PartnerAssociationAssociationCreateForm']/div[3]/div[3]/div/div/div[2]/div/div[3]/ul/li"); for (int i = 1; i <= num; i++) { string name = agents_PartnerAssociationHelper.GetText("//form[@id='PartnerAssociationAssociationCreateForm']/div[3]/div[3]/div/div/div[2]/div/div[3]/ul/li[" + i + "]/label/span"); if (name == xlString) { agents_PartnerAssociationHelper.Click("//form[@id='PartnerAssociationAssociationCreateForm']/div[3]/div[3]/div/div/div[2]/div/div[3]/ul/li[" + i + "]/input"); break; } else { continue; } } //Click on Save agents_PartnerAssociationHelper.ClickElement("ClickSaveBTN"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); if (GetWebDriver().PageSource.Contains("This username already taken") == true) { continue; } } else { continue; } } }
public void verifyPartnerAssociationAdvanceFilterColumnOrder() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var agents_PartnerAssociationHelper = new Agents_PartnerAssociationHelper(GetWebDriver()); // Variable Random String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify Page title as dash board"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Redirect To partner association page."); VisitOffice("partners/associations"); agents_PartnerAssociationHelper.WaitForWorkAround(5000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify page title as partner association"); VerifyTitle("Partner Associations"); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify status column is visible on the page."); agents_PartnerAssociationHelper.IsElementPresent("HeadStatus"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify E-Mail column is visible on the page."); agents_PartnerAssociationHelper.IsElementPresent("HeadEmail"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify Phone column is visible on the page."); agents_PartnerAssociationHelper.IsElementPresent("HeadPhone"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify Modified column is visible on the page."); agents_PartnerAssociationHelper.IsElementPresent("HeadModified"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Click on advance filter button."); agents_PartnerAssociationHelper.ClickElement("AdvanceFilter"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Select status in displayed columns."); agents_PartnerAssociationHelper.SelectByText("DisplayedCols", "Status"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Click arrow to move column to avail cols."); agents_PartnerAssociationHelper.ClickElement("RemoveCols"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Select E-Mail in displayed columns."); agents_PartnerAssociationHelper.SelectByText("DisplayedCols", "E-Mail"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Click arrow to move column to avail cols"); agents_PartnerAssociationHelper.ClickElement("RemoveCols"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Select Phone in displayed columns."); agents_PartnerAssociationHelper.SelectByText("DisplayedCols", "Phone"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Click arrow to move column to avail cols"); agents_PartnerAssociationHelper.ClickElement("RemoveCols"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Select Modified in displayed columns."); agents_PartnerAssociationHelper.SelectByText("DisplayedCols", "Modified"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Click arrow to move column to avail cols"); agents_PartnerAssociationHelper.ClickElement("RemoveCols"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Click on Apply button."); agents_PartnerAssociationHelper.ClickElement("ApplyButton"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify status column not present on page."); agents_PartnerAssociationHelper.IsElementNotPresent("HeadStatus"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify E-Mail column not present on page."); agents_PartnerAssociationHelper.IsElementNotPresent("HeadEmail"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify Phone column not present on page."); agents_PartnerAssociationHelper.IsElementNotPresent("HeadPhone"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify Modified column not present on page."); agents_PartnerAssociationHelper.IsElementNotPresent("HeadModified"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Redirect at leads page."); VisitOffice("leads"); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify page title as leads."); VerifyTitle("Leads"); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Redirect at partner associations page."); VisitOffice("partners/associations"); agents_PartnerAssociationHelper.WaitForWorkAround(5000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify page title as partner association."); VerifyTitle("Partner Associations"); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify default position of E-Mail column."); agents_PartnerAssociationHelper.IsElementPresent("HeadEmail5"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify default position of Phone column."); agents_PartnerAssociationHelper.IsElementPresent("HeadPhone6"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Redirect at partner associations page."); VisitOffice("partners/associations"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Click on advance filter button."); agents_PartnerAssociationHelper.ClickElement("AdvanceFilter"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Select E-Mail in displayed column."); agents_PartnerAssociationHelper.SelectByText("DisplayedCols", "E-Mail"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Move email 1 step up."); agents_PartnerAssociationHelper.ClickElement("MoveUp"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Move email 1 step up."); agents_PartnerAssociationHelper.ClickElement("MoveUp"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Move email 1 step up."); agents_PartnerAssociationHelper.ClickElement("MoveUp"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Select Phone in displayed column."); agents_PartnerAssociationHelper.SelectByText("DisplayedCols", "Phone"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Move phone 1 step down."); agents_PartnerAssociationHelper.ClickElement("MoveDown"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Click on Apply button."); agents_PartnerAssociationHelper.ClickElement("ApplyButton"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify changed position of E-Mail column."); agents_PartnerAssociationHelper.IsElementPresent("HeadEmail3"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Verify changed position of Phone column."); agents_PartnerAssociationHelper.IsElementPresent("HeadPhone7"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("VerifyPartnerAssociationAdvanceFilterColumnOrder", "Logout from the application."); VisitOffice("logout"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyPartnerAssociationAdvanceFilterColumnOrder"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Partner Association Advance Filter Column Order"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Partner Association Advance Filter Column Order", "Bug", "Medium", "Activities page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Partner Association Advance Filter Column Order"); TakeScreenshot("VerifyPartnerAssociationAdvanceFilterColumnOrder"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyPartnerAssociationAdvanceFilterColumnOrder.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyPartnerAssociationAdvanceFilterColumnOrder"); string id = loginHelper.getIssueID("Verify Partner Association Advance Filter Column Order"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyPartnerAssociationAdvanceFilterColumnOrder.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Partner Association Advance Filter Column Order"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Partner Association Advance Filter Column Order"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyPartnerAssociationAdvanceFilterColumnOrder"); executionLog.WriteInExcel("Verify Partner Association Advance Filter Column Order", Status, JIRA, "Meetings Management"); } }
public void revenueShareInDecimalPartnerAssociation() { string[] username = null; string[] password = null; String JIRA = ""; String Status = "Pass"; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var agents_PartnerAssociationHelper = new Agents_PartnerAssociationHelper(GetWebDriver()); // Variable var name = "TestAgent" + GetRandomNumber(); var Agentcode = "1" + RandomNumber(99, 999); var RevenueShare = "22." + RandomNumber(1, 99); try { executionLog.Log("RevenueShareInDecimalPartnerAssociation", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("RevenueShareInDecimalPartnerAssociation", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("RevenueShareInDecimalPartnerAssociation", "Click on Click On Partner Agent"); VisitOffice("partners/associations"); executionLog.Log("RevenueShareInDecimalPartnerAssociation", "verify title"); VerifyTitle("Partner Associations"); executionLog.Log("RevenueShareInDecimalPartnerAssociation", "ClickOnRevenueShare"); agents_PartnerAssociationHelper.ClickElement("RevenueSahrnepartneragent"); executionLog.Log("RevenueShareInDecimalPartnerAssociation", "Verify title"); VerifyTitle("Partner Associations Revenue Shares"); executionLog.Log("RevenueShareInDecimalPartnerAssociation", "Click on Revenue Share Partner Agnet"); agents_PartnerAssociationHelper.ClickElement("RevenueSahrnepartnerasso"); agents_PartnerAssociationHelper.WaitForWorkAround(5000); executionLog.Log("RevenueShareInDecimalPartnerAssociation", "SelectPartnerAgnetRS"); agents_PartnerAssociationHelper.SelectByText("AgentNameSelect", "AssociationTester"); executionLog.Log("RevenueShareInDecimalPartnerAssociation", "Select processor"); agents_PartnerAssociationHelper.SelectByText("ProcessorSelect", "First Data Omaha"); executionLog.Log("RevenueShareInDecimalPartnerAssociation", "EnterPartnerCode"); agents_PartnerAssociationHelper.TypeText("ProcessorCodePAss", Agentcode); executionLog.Log("RevenueShareInDecimalPartnerAssociation", "EnterPartnerCode"); agents_PartnerAssociationHelper.TypeText("RevenueShareps", RevenueShare); executionLog.Log("RevenueShareInDecimalPartnerAssociation", "ClickOnSaveRS"); agents_PartnerAssociationHelper.ClickElement("SaveRS"); agents_PartnerAssociationHelper.WaitForWorkAround(8000); executionLog.Log("RevenueShareInDecimalPartnerAssociation", "verify message Partner agent code & revenue share saved successfully."); // agents_PartnerAssociationHelper.ver("Partner association code & revenue share saved successfully."); executionLog.Log("RevenueShareInDecimalPartnerAssociation", "Enter Deciaml value"); agents_PartnerAssociationHelper.TypeText("SearchDeciaml", RevenueShare); agents_PartnerAssociationHelper.WaitForWorkAround(4000); executionLog.Log("RevenueShareInDecimalPartnerAssociation", "Verify value oin decimal"); agents_PartnerAssociationHelper.VerifyText("VerifyValueInDecimal", RevenueShare); agents_PartnerAssociationHelper.WaitForWorkAround(4000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("RevenueShareInDecimalPartnerAssociation"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Revenue Share In Decimal Partner Association"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Revenue Share In Decimal Partner Association", "Bug", "Medium", "Partner Association page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Revenue Share In Decimal Partner Association"); TakeScreenshot("RevenueShareInDecimalPartnerAssociation"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\RevenueShareInDecimalPartnerAssociation.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("RevenueShareInDecimalPartnerAssociation"); string id = loginHelper.getIssueID("Revenue Share In Decimal Partner Association"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\RevenueShareInDecimalPartnerAssociation.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Revenue Share In Decimal Partner Association"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Revenue Share In Decimal Partner Association"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("RevenueShareInDecimalPartnerAssociation"); executionLog.WriteInExcel("Revenue Share In Decimal Partner Association", Status, JIRA, "Agent Portal"); } }
public void partnerAssociationAdvanceFilterResultsPP() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var agents_PartnerAssociationHelper = new Agents_PartnerAssociationHelper(GetWebDriver()); // Variable var DocName = "Test Exe" + GetRandomNumber(); var fileUpl = GetPathToFile() + "chrome.exe"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("PartnerAssociationAdvanceFilterResultsPP", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("PartnerAssociationAdvanceFilterResultsPP", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("PartnerAssociationAdvanceFilterResultsPP", "Redirect at employee page."); VisitOffice("partners/associations"); agents_PartnerAssociationHelper.WaitForWorkAround(5000); executionLog.Log("PartnerAssociationAdvanceFilterResultsPP", "Verify page title."); VerifyTitle("Partner Associations"); executionLog.Log("PartnerAssociationAdvanceFilterResultsPP", "Click on advance filter."); agents_PartnerAssociationHelper.ClickElement("AdvanceFilter"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("PartnerAssociationAdvanceFilterResultsPP", "Select number of records to 10."); agents_PartnerAssociationHelper.SelectByText("ResultsPerPage", "10"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("PartnerAssociationAdvanceFilterResultsPP", "Click on Apply button."); agents_PartnerAssociationHelper.ClickElement("ApplyButton"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("PartnerAssociationAdvanceFilterResultsPP", "Verify number of records displayed."); agents_PartnerAssociationHelper.ShowResult(10); //agents_PartnerAssociationHelper.VerifyText("BottomResults", "Showing 1 - 10 of"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("PartnerAssociationAdvanceFilterResultsPP", "Click on advance filter."); agents_PartnerAssociationHelper.ClickElement("AdvanceFilter"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("PartnerAssociationAdvanceFilterResultsPP", "Select number of records to 20."); agents_PartnerAssociationHelper.SelectByText("ResultsPerPage", "20"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("PartnerAssociationAdvanceFilterResultsPP", "Click on Apply button."); agents_PartnerAssociationHelper.ClickElement("ApplyButton"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("PartnerAssociationAdvanceFilterResultsPP", "Verify number of records displayed."); agents_PartnerAssociationHelper.ShowResult(20); //agents_PartnerAssociationHelper.VerifyText("BottomResults", "Showing 1 - 20 of"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("PartnerAssociationAdvanceFilterResultsPP", "Click on advance filter."); agents_PartnerAssociationHelper.ClickElement("AdvanceFilter"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("PartnerAssociationAdvanceFilterResultsPP", "Select number of records to 50."); agents_PartnerAssociationHelper.SelectByText("ResultsPerPage", "50"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("PartnerAssociationAdvanceFilterResultsPP", "Click on ApplyButton button."); agents_PartnerAssociationHelper.ClickElement("ApplyButton"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("PartnerAssociationAdvanceFilterResultsPP", "Verify number of records displayed."); agents_PartnerAssociationHelper.ShowResult(50); //agents_PartnerAssociationHelper.VerifyText("BottomResults", "Showing 1 - 50 of"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("PartnerAssociationAdvanceFilterResultsPP", "Click on advance filter."); agents_PartnerAssociationHelper.ClickElement("AdvanceFilter"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("PartnerAssociationAdvanceFilterResultsPP", "Select number of records to 100."); agents_PartnerAssociationHelper.SelectByText("ResultsPerPage", "100"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("PartnerAssociationAdvanceFilterResultsPP", "Click on ApplyButton button."); agents_PartnerAssociationHelper.ClickElement("ApplyButton"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("PartnerAssociationAdvanceFilterResultsPP", "Verify number of records displayed."); agents_PartnerAssociationHelper.ShowResult(100); //agents_PartnerAssociationHelper.VerifyText("BottomResults", "Showing 1 - 100 of"); agents_PartnerAssociationHelper.WaitForWorkAround(3000); executionLog.Log("PartnerAssociationAdvanceFilterResultsPP", "Logout from the application."); VisitOffice("logout"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("PartnerAssociationAdvanceFilterResultsPP"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Partner Association Advance Filter ResultsPP"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Partner Association Advance Filter ResultsPP", "Bug", "Medium", "Opportunities page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Partner Association Advance Filter ResultsPP"); TakeScreenshot("PartnerAssociationAdvanceFilterResultsPP"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\PartnerAssociationAdvanceFilterResultsPP.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("PartnerAssociationAdvanceFilterResultsPP"); string id = loginHelper.getIssueID("Partner Association Advance Filter ResultsPP"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\PartnerAssociationAdvanceFilterResultsPP.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Partner Association Advance Filter ResultsPP"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Partner Association Advance Filter ResultsPP"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("PartnerAssociationAdvanceFilterResultsPP"); executionLog.WriteInExcel("Partner Association Advance Filter ResultsPP", Status, JIRA, "Opportunities Management"); } }