public void createEmployee() { string[] username1 = null; string[] password1 = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var corp_EmployeeHelper = new Corp_EmployeeHelper(GetWebDriver()); username1 = oXMLData.getData("settings/Credentials", "username_corp"); password1 = oXMLData.getData("settings/Credentials", "password"); // Variable random var username = "******" + RandomNumber(1, 9999); var email = "Test" + RandomNumber(1, 99) + "@gmail.com"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("CreateEmployee", "Login with valid username and password"); Login(username1[0], password1[0]); executionLog.Log("CreateEmployee", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("CreateEmployee", "Go to Create employee page"); VisitCorp("employees/create"); corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CreateEmployee", "Verify title"); VerifyTitle("Employees"); //corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CreateEmployee", "Enter Name"); corp_EmployeeHelper.TypeText("UserName", username); //corp_EmployeeHelper.WaitForWorkAround(1000); executionLog.Log("CreateEmployee", "Enter PrimaryEmail"); corp_EmployeeHelper.TypeText("PrimaryEmail", email); //corp_EmployeeHelper.WaitForWorkAround(1000); executionLog.Log("CreateEmployee", "Enter Salutation"); corp_EmployeeHelper.Select("Salutation", "Mr"); //corp_EmployeeHelper.WaitForWorkAround(1000); executionLog.Log("CreateEmployee", "Enter First name"); corp_EmployeeHelper.TypeText("FirstName", "Test Name"); //corp_EmployeeHelper.WaitForWorkAround(1000); executionLog.Log("CreateEmployee", "Enter Last name"); corp_EmployeeHelper.TypeText("LastName", "Test LastName"); //corp_EmployeeHelper.WaitForWorkAround(1000); executionLog.Log("CreateEmployee", " Click CorporateAdmin Avatar"); corp_EmployeeHelper.ClickElement("AvtarCorporateAdmin"); //corp_EmployeeHelper.WaitForWorkAround(1000); executionLog.Log("CreateEmployee", "Select Phone Country"); corp_EmployeeHelper.Select("PhoneSelectCountry", "1"); //corp_EmployeeHelper.WaitForWorkAround(1000); executionLog.Log("CreateEmployee", "Enter PhoneNumber"); corp_EmployeeHelper.TypeText("PhoneNumber", "9898398438"); //corp_EmployeeHelper.WaitForWorkAround(1000); executionLog.Log("CreateEmployee", "Select Primary Phone Number"); corp_EmployeeHelper.ClickElement("PrimaryPhoneRadio"); //corp_EmployeeHelper.WaitForWorkAround(1000); executionLog.Log("CreateEmployee", "Enter eAddress"); corp_EmployeeHelper.TypeText("eAddress", email); //corp_EmployeeHelper.WaitForWorkAround(1000); executionLog.Log("CreateEmployee", "Click Primary Email"); corp_EmployeeHelper.ClickElement("PrimaryEmailRadio"); //corp_EmployeeHelper.WaitForWorkAround(1000); executionLog.Log("CreateEmployee", "Enter AddressLine1"); corp_EmployeeHelper.TypeText("AddressLine1", "F-TEST"); //corp_EmployeeHelper.WaitForWorkAround(1000); executionLog.Log("CreateEmployee", "Enter ZipCode"); corp_EmployeeHelper.TypeText("ZipCode", "60601"); corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CreateEmployee", "CliCK On Save button"); corp_EmployeeHelper.ClickElement("Save"); //corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CreateEmployee", "Wait for success message"); corp_EmployeeHelper.WaitForText("Employee Created Successfully.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); Console.WriteLine("Counter value is " + counter); String Description = executionLog.GetAllTextFile("CreateEmployee"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Create Employee"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Create Employee", "Bug", "Medium", "Employee page", "QA", "Log in as: " + username1[0] + " / " + password1[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Create Employee"); TakeScreenshot("CreateEmployee"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CreateEmployee.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("CreateEmployee"); string id = loginHelper.getIssueID("Create Employee"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CreateEmployee.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Create Employee"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Create Employee"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("CreateEmployee"); executionLog.WriteInExcel("Create Employee", Status, JIRA, "Corp Employee"); } }
public void verifyingEmployeeAdvanceFilterOrder() { string[] username1 = null; string[] password1 = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var corp_EmployeeHelper = new Corp_EmployeeHelper(GetWebDriver()); username1 = oXMLData.getData("settings/Credentials", "username_corp"); password1 = oXMLData.getData("settings/Credentials", "password2"); // Variable random var username = "******" + GetRandomNumber(); var email = "Test" + GetRandomNumber() + "@gmail.com"; String JIRA = ""; String Status = "Pass"; // try // { executionLog.Log("VerifyDefaultDisplayColumnEmployee", "Login with valid username and password"); Login(username1[0], password1[0]); executionLog.Log("VerifyDefaultDisplayColumnEmployee", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyDefaultDisplayColumnEmployee", "Go to Employee page"); VisitCorp("employees"); executionLog.Log("VerifyDefaultDisplayColumnEmployee", "Verify Page title"); VerifyTitle("Employees"); executionLog.Log("VerifyDefaultDisplayColumnEmployee", "Click on advance filter."); corp_EmployeeHelper.ClickElement("AdvanceFilter"); // corp_EmployeeHelper.WaitForElementPresent("LastLog9", 10); executionLog.Log("VerifyDefaultDisplayColumnEmployee", "Go to Employee page"); // Assert.IsTrue(corp_EmployeeHelper.IsElementPresent("LastLog9")); executionLog.Log("VerifyDefaultDisplayColumnEmployee", "Go to Employee page"); // Assert.IsFalse(corp_EmployeeHelper.IsElementPresent("LastLog3")); // executionLog.Log("VerifyDefaultDisplayColumnEmployee", "Click on advance filter."); corp_EmployeeHelper.ClickElement("AdvanceFilter"); executionLog.Log("VerifyDefaultDisplayColumnEmployee", "Go to Employee page"); corp_EmployeeHelper.ClickElement("LastLogon"); executionLog.Log("VerifyDefaultDisplayColumnEmployee", "Go to Employee page"); corp_EmployeeHelper.ClickElement("UpButton"); executionLog.Log("VerifyDefaultDisplayColumnEmployee", "Go to Employee page"); corp_EmployeeHelper.ClickElement("UpButton"); executionLog.Log("VerifyDefaultDisplayColumnEmployee", "Go to Employee page"); Assert.IsFalse(corp_EmployeeHelper.IsElementPresent("LastLog9")); executionLog.Log("VerifyDefaultDisplayColumnEmployee", "Go to Employee page"); Assert.IsTrue(corp_EmployeeHelper.IsElementPresent("LastLog3")); }
public void employeeAdvanceFilterIssue() { string[] username1 = null; string[] password1 = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username1 = oXMLData.getData("settings/Credentials", "username_corp"); password1 = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var corp_EmployeeHelper = new Corp_EmployeeHelper(GetWebDriver()); // Variable random String JIRA = ""; String Status = "Pass"; try { executionLog.Log("EmployeeAdvanceFilterIssue", "Login with valid username and password"); Login(username1[0], password1[0]); executionLog.Log("EmployeeAdvanceFilterIssue", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("EmployeeAdvanceFilterIssue", "Go to Employee page"); VisitCorp("employees"); executionLog.Log("EmployeeAdvanceFilterIssue", "Verify Page title"); VerifyTitle("Employees"); executionLog.Log("EmployeeAdvanceFilterIssue", "Go to Create employee page"); VisitCorp("employees"); executionLog.Log("EmployeeAdvanceFilterIssue", "Verify Page title"); VerifyTitle("Employees"); executionLog.Log("EmployeeAdvanceFilterIssue", "Click on advance filter"); corp_EmployeeHelper.ClickElement("AdvanceFilter"); corp_EmployeeHelper.WaitForWorkAround(2000); executionLog.Log("EmployeeAdvanceFilterIssue", "Select Phone in Sort By"); corp_EmployeeHelper.Select("SortBy", "phone"); executionLog.Log("EmployeeAdvanceFilterIssue", "Click Ascending Radio Button"); corp_EmployeeHelper.ClickElement("AscendingRadio"); executionLog.Log("EmployeeAdvanceFilterIssue", "Click Apply Button"); corp_EmployeeHelper.ClickElement("Apply"); corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("EmployeeAdvanceFilterIssue", "Verify error message not present"); corp_EmployeeHelper.VerifyTextNotPresent("Oops.. You are trying to access a non-existent page on the website"); corp_EmployeeHelper.WaitForWorkAround(3000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("EmployeeAdvanceFilterIssue"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Employee Advance Filter Issue"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Employee Advance Filter Issue", "Bug", "Medium", "Corp Employee page", "QA", "Log in as: " + username1[0] + " / " + password1[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Employee Advance Filter Issue"); TakeScreenshot("EmployeeAdvanceFilterIssue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EmployeeAdvanceFilterIssue.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("EmployeeAdvanceFilterIssue"); string id = loginHelper.getIssueID("Employee Advance Filter Issue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EmployeeAdvanceFilterIssue.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Employee Advance Filter Issue"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Employee Advance Filter Issue"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("EmployeeAdvanceFilterIssue"); executionLog.WriteInExcel("Employee Advance Filter Issue", Status, JIRA, "Corp Employee"); } }
public void corpEmployeeAdvanceFilter() { string[] username1 = null; string[] password1 = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var corp_EmployeeHelper = new Corp_EmployeeHelper(GetWebDriver()); username1 = oXMLData.getData("settings/Credentials", "username_corp"); password1 = oXMLData.getData("settings/Credentials", "password"); // Variable random String JIRA = ""; String Status = "Pass"; try { executionLog.Log("CorpEmployeeAdvanceFilter", "Login with valid username and password"); Login(username1[0], password1[0]); executionLog.Log("CorpEmployeeAdvanceFilter", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("CorpEmployeeAdvanceFilter", "Redirect at employees page."); VisitCorp("employees"); corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter", "Verify Page title"); VerifyTitle("Employees"); //corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter", "Click on advance filter."); corp_EmployeeHelper.ClickElement("AdvanceFilter"); corp_EmployeeHelper.WaitForWorkAround(2000); executionLog.Log("CorpEmployeeAdvanceFilter", "Select city in avail columns."); corp_EmployeeHelper.SelectByText("AvailableCols", "City"); //corp_EmployeeHelper.WaitForWorkAround(2000); executionLog.Log("CorpEmployeeAdvanceFilter", "Click arrow to move column."); corp_EmployeeHelper.ClickElement("AddCols"); //corp_EmployeeHelper.WaitForWorkAround(2000); executionLog.Log("CorpEmployeeAdvanceFilter", "Select state in avail columns."); corp_EmployeeHelper.SelectByText("AvailableCols", "State"); //corp_EmployeeHelper.WaitForWorkAround(2000); executionLog.Log("CorpEmployeeAdvanceFilter", "Click arrow to move column"); corp_EmployeeHelper.ClickElement("AddCols"); //corp_EmployeeHelper.WaitForWorkAround(2000); executionLog.Log("CorpEmployeeAdvanceFilter", "Select zipcode in avail columns."); corp_EmployeeHelper.SelectByText("AvailableCols", "Zipcode"); //corp_EmployeeHelper.WaitForWorkAround(2000); executionLog.Log("CorpEmployeeAdvanceFilter", "Click arrow to move column"); corp_EmployeeHelper.ClickElement("AddCols"); //corp_EmployeeHelper.WaitForWorkAround(2000); executionLog.Log("CorpEmployeeAdvanceFilter", "Click on apply button."); corp_EmployeeHelper.ClickElement("Apply"); corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter", "Verify columns in displayed list present on page."); corp_EmployeeHelper.IsElementPresent("HeadCity"); //corp_EmployeeHelper.WaitForWorkAround(2000); executionLog.Log("CorpEmployeeAdvanceFilter", "Verify columns in displayed list present on page."); corp_EmployeeHelper.IsElementPresent("HeadState"); //corp_EmployeeHelper.WaitForWorkAround(2000); executionLog.Log("CorpEmployeeAdvanceFilter", "Verify columns in displayed list present on page."); corp_EmployeeHelper.IsElementPresent("HeadZipCode"); //corp_EmployeeHelper.WaitForWorkAround(2000); executionLog.Log("CorpEmployeeAdvanceFilter", "Redirect at merchants page."); VisitCorp("merchants"); corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter", "Verify page title as merchants"); VerifyTitle("Clients"); //corp_EmployeeHelper.WaitForWorkAround(4000); executionLog.Log("CorpEmployeeAdvanceFilter", "Redirect at employees page."); VisitCorp("employees"); corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter", "Verify Page title"); VerifyTitle("Employees"); //corp_EmployeeHelper.WaitForWorkAround(4000); executionLog.Log("CorpEmployeeAdvanceFilter", "Verify default position of phone column."); corp_EmployeeHelper.IsElementPresent("Phone3"); //corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter", "Verify default position of email column."); corp_EmployeeHelper.IsElementPresent("Email2"); //corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter", "Click on advance filter."); corp_EmployeeHelper.ClickElement("AdvanceFilter"); corp_EmployeeHelper.WaitForWorkAround(2000); executionLog.Log("CorpEmployeeAdvanceFilter", "Select email in displayed column."); corp_EmployeeHelper.SelectByText("DisplayCols", "E-Mail"); //corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter", "Move email 1 step up."); corp_EmployeeHelper.ClickElement("MoveUp"); //corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter", "Select phone in displayed column."); corp_EmployeeHelper.SelectByText("DisplayCols", "Phone"); //corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter", "Move email 1 step down."); corp_EmployeeHelper.ClickElement("MoveDown"); //corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter", "Click on apply button."); corp_EmployeeHelper.ClickElement("Apply"); corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter", "Verify changed position of email column."); corp_EmployeeHelper.IsElementPresent("Email1"); //corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter", "Verify changed position of phone column."); corp_EmployeeHelper.IsElementPresent("Phone4"); //corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter", "Logout from the application."); VisitCorp("logout"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); Console.WriteLine("Counter value is " + counter); String Description = executionLog.GetAllTextFile("CorpEmployeeAdvanceFilter"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Corp Employee Advance Filter"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Corp Employee Advance Filter", "Bug", "Medium", "Employee page", "QA", "Log in as: " + username1[0] + " / " + password1[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Corp Employee Advance Filter"); TakeScreenshot("CorpEmployeeAdvanceFilter"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CorpEmployeeAdvanceFilter.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("CorpEmployeeAdvanceFilter"); string id = loginHelper.getIssueID("Corp Employee Advance Filter"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CorpEmployeeAdvanceFilter.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Corp Employee Advance Filter"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Corp Employee Advance Filter"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("CorpEmployeeAdvanceFilter"); executionLog.WriteInExcel("Corp Employee Advance Filter", Status, JIRA, "Corp Emplaoyee"); } }
public void corpEmployeeUrlChange() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_corp"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var corp_EmployeesHelper = new Corp_EmployeeHelper(GetWebDriver()); // Variable var FirstName = "Test" + GetRandomNumber(); var LastName = "Tester" + GetRandomNumber(); var Number = "12345678" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("CorpEmployeeUrlChange", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("CorpEmployeeUrlChange", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("CorpEmployeeUrlChange", "Go To Employee"); VisitCorp("employees"); corp_EmployeesHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeUrlChange", "Enter the name of employee"); corp_EmployeesHelper.TypeText("SearchEmpName", "Aslam Tester"); corp_EmployeesHelper.WaitForWorkAround(2000); executionLog.Log("CorpEmployeeUrlChange", "Click On any Employee"); corp_EmployeesHelper.ClickElement("ClickOnEmployee"); corp_EmployeesHelper.WaitForWorkAround(2000); executionLog.Log("CorpEmployeeUrlChange", "Change the url with the url number of another Corp"); VisitCorp("employees/view/1108"); corp_EmployeesHelper.WaitForWorkAround(2000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("CorpEmployeeUrlChange"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Corp Employee Url Change"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Corp Employee Url Change", "Bug", "Medium", "Corp employee page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Corp Employee Url Change"); TakeScreenshot("CorpEmployeeUrlChange"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CorpEmployeeUrlChange.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("CorpEmployeeUrlChange"); string id = loginHelper.getIssueID("Corp Employee Url Change"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CorpEmployeeUrlChange.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Corp Employee Url Change"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Corp Employee Url Change"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("CorpEmployeeUrlChange"); executionLog.WriteInExcel("Corp Employee Url Change", Status, JIRA, "Corp Employees"); } }
public void editCorpEmployee() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_corp"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var corp_EmployeeHelper = new Corp_EmployeeHelper(GetWebDriver()); String Status = "Pass"; String JIRA = ""; var username1 = "testingcorpuser" + RandomNumber(111, 999999); try { executionLog.Log("EditCorpEmployee", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("EditCorpEmployee", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("EditCorpEmployee", "Click on employee tab."); corp_EmployeeHelper.ClickElement("EmployeesTab"); executionLog.Log("EditCorpEmployee", "Search Employee"); corp_EmployeeHelper.TypeText("SearchEmpName", "Test Tester"); var Loc = "//table[@id='list1']/tbody/tr[2]"; if (corp_EmployeeHelper.IsElementPresent(Loc)) { executionLog.Log("EditCorpEmployee", "Click on Edit"); corp_EmployeeHelper.ClickElement("ClickOnEdit"); corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("EditCorpEmployee", "Enter zip code"); corp_EmployeeHelper.TypeText("ZipCode", "60601"); corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("EditCorpEmployee", "Enter First Name"); corp_EmployeeHelper.TypeText("FirstName", "Test"); executionLog.Log("EditCorpEmployee", "Enter Last Name"); corp_EmployeeHelper.TypeText("LastName", "Tester"); executionLog.Log("EditCorpEmployee", "Enter Phone number."); corp_EmployeeHelper.TypeText("PhoneNumber", "1111111111"); executionLog.Log("EditCorpEmployee", "Click primary radio button."); corp_EmployeeHelper.ClickElement("PrimaryPhoneRadio"); executionLog.Log("EditCorpEmployee", "Enter eAddress"); corp_EmployeeHelper.TypeText("eAddress", "*****@*****.**"); executionLog.Log("EditCorpEmployee", "Click primary radio button."); corp_EmployeeHelper.ClickElement("PrimaryEmailRadio"); executionLog.Log("EditCorpEmployee", "Click On Save"); corp_EmployeeHelper.ClickElement("Save"); executionLog.Log("EditCorpEmployee", "Verify message"); corp_EmployeeHelper.WaitForText("Employee Details successfully updated", 10); } else { executionLog.Log("EditCorpEmployee", "ClickOnCreate"); corp_EmployeeHelper.ClickElement("Create"); executionLog.Log("EditCorpEmployee", "Enter User Name"); var usernme = "EmpUser" + RandomNumber(1, 999); corp_EmployeeHelper.TypeText("UserName", usernme); executionLog.Log("EditCorpEmployee", "Click On Save"); corp_EmployeeHelper.ClickElement("Save"); executionLog.Log("EditCorpEmployee", "Verify This field is required."); corp_EmployeeHelper.VerifyPageText("This field is required."); executionLog.Log("EditCorpEmployee", "verify validation "); corp_EmployeeHelper.VerifyPageText("This field is required."); executionLog.Log("EditCorpEmployee", "verify validation"); corp_EmployeeHelper.VerifyText("VerifyValidation", "This field is required."); executionLog.Log("EditCorpEmployee", "Verify validation"); corp_EmployeeHelper.VerifyText("VerifyAvatar", "This field is required."); executionLog.Log("EditCorpEmployee", "Verify validatation"); corp_EmployeeHelper.VerifyText("VerifyEmail", "This field is required."); executionLog.Log("EditCorpEmployee", "Verify validation"); corp_EmployeeHelper.VerifyText("VerifyPhoneNumber", "This field is required."); executionLog.Log("EditCorpEmployee", "Verify validation"); corp_EmployeeHelper.VerifyText("VerifyLastName", "This field is required."); executionLog.Log("EditCorpEmployee", "Enter First Name"); corp_EmployeeHelper.TypeText("FirstName", "Test"); executionLog.Log("EditCorpEmployee", "Enter Last Name"); corp_EmployeeHelper.TypeText("LastName", "Tester"); executionLog.Log("EditCorpEmployee", "Enter Primary Email"); var Email = "Email" + RandomNumber(1, 999) + "@yopmail.com"; corp_EmployeeHelper.TypeText("PrimaryEmail", Email); executionLog.Log("EditCorpEmployee", "Click On Check box "); corp_EmployeeHelper.ClickElement("AvtarCorporateAdmin"); executionLog.Log("EditCorpEmployee", "Enter Phone Number"); corp_EmployeeHelper.TypeText("PhoneNumber", "9898777332"); executionLog.Log("EditCorpEmployee", "Enter Eaddress"); var mail = "mail" + RandomNumber(1, 999) + "@yopmail.com"; corp_EmployeeHelper.TypeText("eAddress", mail); executionLog.Log("EditCorpEmployee", "Enter Username"); corp_EmployeeHelper.TypeText("UserName", username1); executionLog.Log("EditCorpEmployee", "Select Avatar"); corp_EmployeeHelper.ClickElement("AdminUserAvatar"); executionLog.Log("EditCorpEmployee", "Click On Save"); corp_EmployeeHelper.ClickElement("ClickSaveBtn"); executionLog.Log("EditCorpEmployee", "verify success message"); corp_EmployeeHelper.WaitForText("Employee Created Successfully.", 10); executionLog.Log("EditCorpEmployee", "Search Employee"); corp_EmployeeHelper.TypeText("SearchEmpName", "Test Tester"); executionLog.Log("EditCorpEmployee", "Enter Email To Search"); corp_EmployeeHelper.TypeText("SearchEnterEmail", Email); corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("EditCorpEmployee", "Click on Edit"); corp_EmployeeHelper.ClickElement("ClickOnEdit"); corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("EditCorpEmployee", "Enter zip code"); corp_EmployeeHelper.TypeText("ZipCode", "60601"); corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("EditCorpEmployee", "Enter First Name"); corp_EmployeeHelper.TypeText("FirstName", "Test"); executionLog.Log("EditCorpEmployee", "Enter Last Name"); corp_EmployeeHelper.TypeText("LastName", "Tester"); executionLog.Log("EditCorpEmployee", "Click On Save"); corp_EmployeeHelper.ClickElement("ClickOnSave"); executionLog.Log("EditCorpEmployee", "Verify success message"); corp_EmployeeHelper.WaitForText("Employee Details successfully updated", 10); } } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("EditCorpEmployee"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Edit Corp Employee"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Delete PDF Template Corp", "Bug", "Medium", "Employee", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Edit Corp Employee"); TakeScreenshot("EditCorpEmployee"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EditCorpEmployee.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("EditCorpEmployee"); string id = loginHelper.getIssueID("Edit Corp Employee"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EditCorpEmployee.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Edit Corp Employee"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Edit Corp Employee"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("EditCorpEmployee"); executionLog.WriteInExcel("Edit Corp Employee", Status, JIRA, "Corp Employee"); } }
public void verifyDefaultDisplayColumnEmployee() { string[] username1 = null; string[] password1 = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var corp_EmployeeHelper = new Corp_EmployeeHelper(GetWebDriver()); username1 = oXMLData.getData("settings/Credentials", "username_corp"); password1 = oXMLData.getData("settings/Credentials", "password2"); // Variable random var username = "******" + GetRandomNumber(); var email = "Test" + GetRandomNumber() + "@gmail.com"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyDefaultDisplayColumnEmployee", "Login with valid username and password"); Login(username1[0], password1[0]); executionLog.Log("VerifyDefaultDisplayColumnEmployee", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyDefaultDisplayColumnEmployee", "Go to Employee page"); VisitCorp("employees"); executionLog.Log("VerifyDefaultDisplayColumnEmployee", "Verify Page title"); VerifyTitle("Employees"); executionLog.Log("VerifyDefaultDisplayColumnEmployee", "Click on advance filter."); corp_EmployeeHelper.ClickElement("AdvanceFilter"); executionLog.Log("VerifyDefaultDisplayColumnEmployee", "Verify name column in displayed column"); corp_EmployeeHelper.VerifyColumn("Name"); executionLog.Log("VerifyDefaultDisplayColumnEmployee", "Verify email in displayed column"); corp_EmployeeHelper.VerifyColumn("E-Mail"); executionLog.Log("VerifyDefaultDisplayColumnEmployee", "Verify phone in displayed column"); corp_EmployeeHelper.VerifyColumn("Phone"); executionLog.Log("VerifyDefaultDisplayColumnEmployee", "Verify modified in displayed column"); corp_EmployeeHelper.VerifyColumn("Modified"); executionLog.Log("VerifyDefaultDisplayColumnEmployee", "Verify last logon in displayed column"); corp_EmployeeHelper.VerifyColumn("Last Logon"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyDefaultDisplayColumnEmployee"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Default Display Column Employee"); if (!result) { if (Int16.Parse(counter) < 5) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Default Display Column Employee", "Bug", "Medium", "Corp Employee page", "QA", "Log in as: " + username1[0] + " / " + password1[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Default Display Column Employee"); TakeScreenshot("VerifyDefaultDisplayColumnEmployee"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyDefaultDisplayColumnEmployee.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 5) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyDefaultDisplayColumnEmployee"); string id = loginHelper.getIssueID("Verify Default Display Column Employee"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyDefaultDisplayColumnEmployee.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Default Display Column Employee"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Default Display Column Employee"); executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyDefaultDisplayColumnEmployee"); executionLog.WriteInExcel("Verify Default Display Column Employee", Status, JIRA, "Corp Employee"); } }
public void corpEmployeeAdvanceFilter2() { string[] username1 = null; string[] password1 = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var corp_EmployeeHelper = new Corp_EmployeeHelper(GetWebDriver()); username1 = oXMLData.getData("settings/Credentials", "username_corp"); password1 = oXMLData.getData("settings/Credentials", "password"); // Variable random String JIRA = ""; String Status = "Pass"; try { executionLog.Log("CorpEmployeeAdvanceFilter2", "Login with valid username and password"); Login(username1[0], password1[0]); executionLog.Log("CorpEmployeeAdvanceFilter2", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("CorpEmployeeAdvanceFilter2", "Redirect at employees page."); VisitCorp("employees"); corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Verify Page title"); VerifyTitle("Employees"); //corp_EmployeeHelper.WaitForWorkAround(5000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Click on advance filter."); corp_EmployeeHelper.ClickElement("AdvanceFilter"); corp_EmployeeHelper.WaitForWorkAround(2000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Select number of records to 10."); corp_EmployeeHelper.SelectByText("ResultsPerPage", "10"); //corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Click on apply button."); corp_EmployeeHelper.ClickElement("Apply"); corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Verify number of records displayed."); corp_EmployeeHelper.ShowResult(10); //corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Click on advance filter."); corp_EmployeeHelper.ClickElement("AdvanceFilter"); corp_EmployeeHelper.WaitForWorkAround(2000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Select number of records to 20."); corp_EmployeeHelper.SelectByText("ResultsPerPage", "20"); //corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Click on apply button."); corp_EmployeeHelper.ClickElement("Apply"); corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Verify number of records displayed."); corp_EmployeeHelper.ShowResult(20); //corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Click on advance filter."); corp_EmployeeHelper.ClickElement("AdvanceFilter"); corp_EmployeeHelper.WaitForWorkAround(2000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Select number of records to 50."); corp_EmployeeHelper.SelectByText("ResultsPerPage", "50"); //corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Click on apply button."); corp_EmployeeHelper.ClickElement("Apply"); corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Verify number of records displayed."); corp_EmployeeHelper.ShowResult(50); //corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Click on advance filter."); corp_EmployeeHelper.ClickElement("AdvanceFilter"); corp_EmployeeHelper.WaitForWorkAround(2000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Select number of records to 100."); corp_EmployeeHelper.SelectByText("ResultsPerPage", "100"); //corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Click on apply button."); corp_EmployeeHelper.ClickElement("Apply"); corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Verify number of records displayed."); corp_EmployeeHelper.ShowResult(100); //corp_EmployeeHelper.WaitForWorkAround(4000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Click on advance filter."); corp_EmployeeHelper.ClickElement("AdvanceFilter"); corp_EmployeeHelper.WaitForWorkAround(2000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Select city in avail columns."); corp_EmployeeHelper.SelectByText("AvailableCols", "City"); //corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Click arrow to move column."); corp_EmployeeHelper.ClickElement("AddCols"); //corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Select zipcode in avail columns."); corp_EmployeeHelper.SelectByText("AvailableCols", "Zipcode"); //corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Click arrow to move column"); corp_EmployeeHelper.ClickElement("AddCols"); //corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Click on apply button."); corp_EmployeeHelper.ClickElement("Apply"); corp_EmployeeHelper.WaitForWorkAround(3000); corp_EmployeeHelper.ClickElement("AdvanceFilter"); corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Enter first name in user details."); corp_EmployeeHelper.TypeText("UserDetailsFN", "Sel"); executionLog.Log("CorpEmployeeAdvanceFilter2", "Enter last name in user details."); corp_EmployeeHelper.TypeText("UserDetailsLN", "Enium"); executionLog.Log("CorpEmployeeAdvanceFilter2", "Enter email in user details."); corp_EmployeeHelper.TypeText("UserDetailEmail", "*****@*****.**"); executionLog.Log("CorpEmployeeAdvanceFilter2", "Enter city name in user details."); corp_EmployeeHelper.TypeText("UserDetailsCity", "Chicago"); //corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Enter zipcode in user details."); corp_EmployeeHelper.TypeText("UserDetailZipCode", "60601"); //corp_EmployeeHelper.WaitForWorkAround(5000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Click on apply button."); corp_EmployeeHelper.ClickElement("Apply"); corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Verify employee name on the page."); corp_EmployeeHelper.VerifyText("VerifyName", "Sel Enium"); //corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter2", "Verify employee email on the page."); corp_EmployeeHelper.VerifyText("VerifyEmail2", "*****@*****.**"); //corp_EmployeeHelper.WaitForWorkAround(3000); executionLog.Log("CorpEmployeeAdvanceFilter2", "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("CorpEmployeeAdvanceFilter2"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Corp Employee Advance Filter2"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Corp Employee Advance Filter2", "Bug", "Medium", "Employee page", "QA", "Log in as: " + username1[0] + " / " + password1[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Corp Employee Advance Filter2"); TakeScreenshot("CorpEmployeeAdvanceFilter2"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CorpEmployeeAdvanceFilter2.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("CorpEmployeeAdvanceFilter2"); string id = loginHelper.getIssueID("Corp Employee Advance Filter2"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CorpEmployeeAdvanceFilter2.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Corp Employee Advance Filter2"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Corp Employee Advance Filter2"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("CorpEmployeeAdvanceFilter2"); executionLog.WriteInExcel("Corp Employee Advance Filter2", Status, JIRA, "Corp Emplaoyee"); } }