public void verifyEmployeeEAddressLabel() { 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()); // Variable String JIRA = ""; String Status = "Pass"; var username1 = "Testuser" + GetRandomNumber(); try { executionLog.Log("PartnerAgentCodeInQuickLook", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("PartnerAgentCodeInQuickLook", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("PartnerAgentCodeInQuickLook", "Goto Opportinuties"); VisitOffice("employees"); agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("PartnerAgentCodeInQuickLook", "Open Employee 1"); agents_EmployeesHelper.ClickElement("EditEmployee1"); agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("PartnerAgentCodeInQuickLook", "Select eAddress Label"); agents_EmployeesHelper.SelectByText("eAddressLebel", "Work"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("PartnerAgentCodeInQuickLook", "Check if User account is not created"); if (agents_EmployeesHelper.IsElementPresent("//h5[contains(text(),'Edit User Account for Employee')]")) { agents_EmployeesHelper.Click("//h5[contains(text(),'Edit User Account for Employee')]"); agents_EmployeesHelper.WaitForWorkAround(1000); executionLog.Log("PartnerAgentCodeInQuickLook", "Enter username"); agents_EmployeesHelper.TypeText("UserName", username1); executionLog.Log("PartnerAgentCodeInQuickLook", "Select avatar"); agents_EmployeesHelper.ClickElement("AdminUserAvatar"); } executionLog.Log("PartnerAgentCodeInQuickLook", "Click On Save Button"); agents_EmployeesHelper.clickJS("SaveEmployee"); agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("PartnerAgentCodeInQuickLook", "Open Employee 1"); agents_EmployeesHelper.ClickElement("EditEmployee1"); agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("PartnerAgentCodeInQuickLook", "Verify select eAddress Label Work."); agents_EmployeesHelper.selectedOption("eAddressLebel", "Work");; //agents_EmployeesHelper.WaitForWorkAround(2000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("AmexRateCorp"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Amex Rate Corp"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Amex Rate Corp", "Bug", "Medium", "Amex page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Amex Rate Corp"); TakeScreenshot("AmexRateCorp"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\AmexRateCorp.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("AmexRateCorp"); string id = loginHelper.getIssueID("Amex Rate Corp"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\AmexRateCorp.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Amex Rate Corp"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Amex Rate Corp"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("AmexRateCorp"); executionLog.WriteInExcel("Amex Rate Corp", Status, JIRA, "Corp Master Data"); } }
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 agentEmployeeAdvanceFilterResultsPP() { 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()); // Variable var DocName = "Test Exe" + GetRandomNumber(); var fileUpl = GetPathToFile() + "chrome.exe"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Redirect at employee page."); VisitOffice("employees"); agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Click on advance filter."); agents_EmployeesHelper.ClickElement("AdvanceFilter"); agents_EmployeesHelper.WaitForWorkAround(2000); executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Select number of records to 10."); agents_EmployeesHelper.SelectByText("ResultsPerPage", "10"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Click on Apply button."); agents_EmployeesHelper.ClickElement("ApplyButton"); agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Verify number of records displayed."); //agents_EmployeesHelper.VerifyText("BottomResults", "Showing 1 - 10 of"); agents_EmployeesHelper.ShowResult(10); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Click on advance filter."); agents_EmployeesHelper.ClickElement("AdvanceFilter"); agents_EmployeesHelper.WaitForWorkAround(2000); executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Select number of records to 20."); agents_EmployeesHelper.SelectByText("ResultsPerPage", "20"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Click on Apply button."); agents_EmployeesHelper.ClickElement("ApplyButton"); agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Verify number of records displayed."); // agents_EmployeesHelper.VerifyText("BottomResults", "Showing 1 - 20 of"); agents_EmployeesHelper.ShowResult(20); //agents_EmployeesHelper.WaitForWorkAround(3000); //executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Click on advance filter."); //agents_EmployeesHelper.ClickElement("AdvanceFilter"); //agents_EmployeesHelper.WaitForWorkAround(3000); //executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Select number of records to 50."); //agents_EmployeesHelper.SelectByText("ResultsPerPage", "50"); //agents_EmployeesHelper.WaitForWorkAround(3000); //executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Click on ApplyButton button."); //agents_EmployeesHelper.ClickElement("ApplyButton"); //agents_EmployeesHelper.WaitForWorkAround(3000); //executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Verify number of records displayed."); //// agents_EmployeesHelper.VerifyText("BottomResults", "Showing 1 - 50 of"); //agents_EmployeesHelper.ShowResult(50); //agents_EmployeesHelper.WaitForWorkAround(3000); //executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Click on advance filter."); //agents_EmployeesHelper.ClickElement("AdvanceFilter"); //agents_EmployeesHelper.WaitForWorkAround(3000); //executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Select number of records to 100."); //agents_EmployeesHelper.SelectByText("ResultsPerPage", "100"); //agents_EmployeesHelper.WaitForWorkAround(3000); //executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Click on ApplyButton button."); //agents_EmployeesHelper.ClickElement("ApplyButton"); //agents_EmployeesHelper.WaitForWorkAround(3000); //executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Verify number of records displayed."); ////agents_EmployeesHelper.VerifyText("BottomResults", "Showing 1 - 100 of"); //agents_EmployeesHelper.ShowResult(100); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "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("AgentEmployeeAdvanceFilterResultsPP"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Agent Employee Advance Filter ResultsPP"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Agent Employee 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("Agent Employee Advance Filter ResultsPP"); TakeScreenshot("AgentEmployeeAdvanceFilterResultsPP"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\AgentEmployeeAdvanceFilterResultsPP.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("AgentEmployeeAdvanceFilterResultsPP"); string id = loginHelper.getIssueID("Agent Employee Advance Filter ResultsPP"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\AgentEmployeeAdvanceFilterResultsPP.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Agent Employee Advance Filter ResultsPP"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Agent Employee Advance Filter ResultsPP"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("AgentEmployeeAdvanceFilterResultsPP"); executionLog.WriteInExcel("Agent Employee Advance Filter ResultsPP", Status, JIRA, "Opportunities Management"); } }
public void verifyEmployeeEAddressLabel() { 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 agent_EmployeeHelper = new Agents_EmployeesHelper(GetWebDriver()); // VARIABLE String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyEmployeeEAddressLabel", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyEmployeeEAddressLabel", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("VerifyEmployeeEAddressLabel", "Redirect To Create Employee page"); VisitOffice("employees/create"); agent_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEmployeeEAddressLabel", "Select eAddress Type >> E-mail"); agent_EmployeeHelper.SelectByText("eAddressType", "E-Mail"); agent_EmployeeHelper.WaitForWorkAround(1000); executionLog.Log("VerifyEmployeeEAddressLabel", "Verify eAddress Label >> Work"); agent_EmployeeHelper.selectedOption("eAddressLebel", "Work"); agent_EmployeeHelper.WaitForWorkAround(1000); executionLog.Log("VerifyEmployeeEAddressLabel", "Select eAddress Type >> IM"); agent_EmployeeHelper.SelectByText("eAddressType", "IM"); agent_EmployeeHelper.WaitForWorkAround(1000); executionLog.Log("VerifyEmployeeEAddressLabel", "Verify eAddress Label >> Google"); agent_EmployeeHelper.selectedOption("eAddressLebel", "Google"); agent_EmployeeHelper.WaitForWorkAround(1000); executionLog.Log("VerifyEmployeeEAddressLabel", "Select eAddress Type >> Social Media"); agent_EmployeeHelper.SelectByText("eAddressType", "Social Media"); agent_EmployeeHelper.WaitForWorkAround(1000); executionLog.Log("VerifyEmployeeEAddressLabel", "Verify eAddress Label >> Facebook"); agent_EmployeeHelper.selectedOption("eAddressLebel", "Facebook"); agent_EmployeeHelper.WaitForWorkAround(1000); executionLog.Log("VerifyEmployeeEAddressLabel", "Select eAddress Type >> Web Links"); agent_EmployeeHelper.SelectByText("eAddressType", "Web Links"); agent_EmployeeHelper.WaitForWorkAround(1000); executionLog.Log("VerifyEmployeeEAddressLabel", "Verify eAddress Label >> Web Link"); agent_EmployeeHelper.selectedOption("eAddressLebel", "Web Link"); agent_EmployeeHelper.WaitForWorkAround(1000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyEmployeeEAddressLabel"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Employee EAddress Label"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Employee EAddress Label", "Bug", "Medium", "Employee page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Employee EAddress Label"); TakeScreenshot("VerifyEmployeeEAddressLabel"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyEmployeeEAddressLabel.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyEmployeeEAddressLabel"); string id = loginHelper.getIssueID("Verify Employee EAddress Label"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyEmployeeEAddressLabel.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Employee EAddress Label"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Employee EAddress Label"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyEmployeeEAddressLabel"); executionLog.WriteInExcel("Verify Employee EAddress Label", Status, JIRA, "Office Employees"); } }
public void verifyAgentEmployeeAdvanceFilerColumnOrder() { 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()); // Variable Random String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Redirect To URL"); VisitOffice("employees"); agents_EmployeesHelper.WaitForWorkAround(4000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Verify status column is visible on the page.."); agents_EmployeesHelper.IsElementPresent("HeadStatus"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Verify role column is visible on the page."); agents_EmployeesHelper.IsElementPresent("HeadRole"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Verify department column is visible on the page."); agents_EmployeesHelper.IsElementPresent("HeadDepartment"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Verify team column is visible on the page."); agents_EmployeesHelper.IsElementPresent("HeadTeam"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Click on advance filter."); agents_EmployeesHelper.ClickElement("AdvanceFilter"); agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Select status in displayed columns."); agents_EmployeesHelper.SelectByText("DisplayedCols", "Status"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Click arrow to move column to avail cols."); agents_EmployeesHelper.ClickElement("RemoveCols"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Select role in displayed columns."); agents_EmployeesHelper.SelectByText("DisplayedCols", "Role"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Click arrow to move column to avail cols"); agents_EmployeesHelper.ClickElement("RemoveCols"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Select department in displayed columns."); agents_EmployeesHelper.SelectByText("DisplayedCols", "Department"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Click arrow to move column to avail cols"); agents_EmployeesHelper.ClickElement("RemoveCols"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Select team in displayed columns."); agents_EmployeesHelper.SelectByText("DisplayedCols", "Team"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Click arrow to move column to avail cols"); agents_EmployeesHelper.ClickElement("RemoveCols"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Click on Apply button."); agents_EmployeesHelper.ClickElement("ApplyButton"); agents_EmployeesHelper.WaitForWorkAround(4000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Verify status not present on page."); agents_EmployeesHelper.IsElementNotPresent("HeadStatus"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Verify role not present on page."); agents_EmployeesHelper.IsElementNotPresent("HeadRole"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Verify department not present on page."); agents_EmployeesHelper.IsElementNotPresent("HeadDepartment"); // agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Verify team not present on page."); agents_EmployeesHelper.IsElementNotPresent("HeadTeam"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Redirect at leads page."); VisitOffice("leads"); agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Verify page title as leads."); VerifyTitle("Leads"); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Redirect To URL"); VisitOffice("employees"); agents_EmployeesHelper.WaitForWorkAround(4000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Verify default position of role column."); agents_EmployeesHelper.IsElementPresent("HeadRole5"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Verify default position of department column."); agents_EmployeesHelper.IsElementPresent("HeadDepartment6"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Redirect at sales agents page."); VisitOffice("employees"); agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Click on advance filter."); agents_EmployeesHelper.ClickElement("AdvanceFilter"); agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Select role in displayed column."); agents_EmployeesHelper.SelectByText("DisplayedCols", "Role"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Move role 1 step up."); agents_EmployeesHelper.ClickElement("MoveUp"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Move role 1 step up."); agents_EmployeesHelper.ClickElement("MoveUp"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Move role 1 step up."); agents_EmployeesHelper.ClickElement("MoveUp"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Select department in displayed column."); agents_EmployeesHelper.SelectByText("DisplayedCols", "Department"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Move department 1 step down."); agents_EmployeesHelper.ClickElement("MoveDown"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Click on Apply button."); agents_EmployeesHelper.ClickElement("ApplyButton"); agents_EmployeesHelper.WaitForWorkAround(4000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Verify changed position of role column."); agents_EmployeesHelper.IsElementPresent("HeadRole3"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Verify changed position of department column."); agents_EmployeesHelper.IsElementPresent("HeadDepartment7"); //agents_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Logout from the application."); VisitCorp("logout"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyAgentEmployeeAdvanceFilerColumnOrder"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Tickets Advance Filer Column Order"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Tickets Advance Filer 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 Tickets Advance Filer Column Order"); TakeScreenshot("VerifyAgentEmployeeAdvanceFilerColumnOrder"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyAgentEmployeeAdvanceFilerColumnOrder.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyAgentEmployeeAdvanceFilerColumnOrder"); string id = loginHelper.getIssueID("Verify Tickets Advance Filer Column Order"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyAgentEmployeeAdvanceFilerColumnOrder.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Tickets Advance Filer Column Order"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Tickets Advance Filer Column Order"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyAgentEmployeeAdvanceFilerColumnOrder"); executionLog.WriteInExcel("Verify Tickets Advance Filer Column Order", Status, JIRA, "Meetings Management"); } }