public void cancelEditProfile() { 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 office_MyProfileHelper = new Office_MyProfileHelper(GetWebDriver()); // VARIABLE var name = "TestEmployee" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("CancelEditProfile", "Login with valid username and password"); Login(username[0], password[0]); executionLog.Log("CancelEditProfile", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("CancelEditProfile", "Redirect to my profile"); VisitOffice("myprofile"); executionLog.Log("CancelEditProfile", "Click On EditProfile"); office_MyProfileHelper.ClickElement("EditProfile"); office_MyProfileHelper.WaitForWorkAround(2000); executionLog.Log("CancelEditProfile", "Click on camcel button."); office_MyProfileHelper.ClickElement("Cancel"); office_MyProfileHelper.WaitForWorkAround(4000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("CancelEditProfile"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Cancel Edit Profile"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Cancel Edit Profile", "Bug", "Medium", "Profile page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Cancel Edit Profile"); TakeScreenshot("CancelEditProfile"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CancelEditProfile.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("CancelEditProfile"); string id = loginHelper.getIssueID("Cancel Edit Profile"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CancelEditProfile.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Cancel Edit Profile"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Cancel Edit Profile"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("CancelEditProfile"); executionLog.WriteInExcel("Cancel Edit Profile", Status, JIRA, "My profile"); } }
public void loginError2() { string[] username = null; string[] password = null; string[] log = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); log = oXMLData.getData("settings/URL", "logout"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var office_MyProfileHelper = new Office_MyProfileHelper(GetWebDriver()); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("LoginError2", "Verify title"); VerifyTitle("Login"); executionLog.Log("LoginError2", "Click on Verify my account"); office_MyProfileHelper.ClickElement("VerifyAccount"); executionLog.Log("LoginError2", "Enter username"); office_MyProfileHelper.TypeText("VerifyUsername", "aa"); executionLog.Log("LoginError2", "Click any where"); office_MyProfileHelper.ClickElement("VerifyBody"); executionLog.Log("LoginError2", "Click on Send email button"); office_MyProfileHelper.ClickMultiple("VerifySend"); office_MyProfileHelper.WaitForWorkAround(2000); executionLog.Log("LoginError2", "Accept Alert"); office_MyProfileHelper.AcceptAlert(); office_MyProfileHelper.WaitForWorkAround(2000); executionLog.Log("LoginError2", "Enter username"); office_MyProfileHelper.TypeText("VerifyUsername", "aslamKhan"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("LoginError2"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Login Error 2"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Login Error 2", "Bug", "Medium", "Login page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Login Error 2"); TakeScreenshot("LoginError2"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\LoginError2.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("LoginError2"); string id = loginHelper.getIssueID("Login Error 2"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\LoginError2.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Login Error 2"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Login Error 2"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("LoginError2"); executionLog.WriteInExcel("Login Error 2", Status, JIRA, "Office"); } }
public void verifyMyProfileEmailIconWorking() { string[] username = null; string[] password = null; XMLParse oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username"); password = oXMLData.getData("settings/Credentials", "password"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var office_MyProfileHelper = new Office_MyProfileHelper(GetWebDriver()); // Variable var name = "Testing Subject" + GetRandomNumber(); var email = "Test" + GetRandomNumber() + "@gmail.com"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyMyProfileEmailIconWorking", " Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyMyProfileEmailIconWorking", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("VerifyMyProfileEmailIconWorking", "Redirect at admin page."); VisitOffice("admin"); executionLog.Log("VerifyMyProfileEmailIconWorking", "Redirect to My Profile page."); VisitOffice("myprofile"); executionLog.Log("VerifyMyProfileEmailIconWorking", "Verify page title as My profile."); VerifyTitle("My Profile"); executionLog.Log("VerifyMyProfileEmailIconWorking", "Click on email icon"); office_MyProfileHelper.ClickElement("ClicktoEmailIcon"); office_MyProfileHelper.WaitForWorkAround(5000); office_MyProfileHelper.SwitchToWindow(); executionLog.Log("VerifyMyProfileEmailIconWorking", "Verify title as compose."); VerifyTitle("Compose"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyMyProfileEmailIconWorking"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify My Profile Email Icon Working"); if (!result) { if (Int16.Parse(counter) < 5) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify My Profile Email Icon Working", "Bug", "Medium", "Document page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify My Profile Email Icon Working"); TakeScreenshot("VerifyMyProfileEmailIconWorking"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyMyProfileEmailIconWorking.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 5) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyMyProfileEmailIconWorking"); string id = loginHelper.getIssueID("Verify My Profile Email Icon Working"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyMyProfileEmailIconWorking.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify My Profile Email Icon Working"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify My Profile Email Icon Working"); executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyMyProfileEmailIconWorking"); executionLog.WriteInExcel("Verify My Profile Email Icon Working", Status, JIRA, "Admin Corp"); } }
public void profilePictureChange() { string[] username = null; string[] password = null; string[] log = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); log = oXMLData.getData("settings/URL", "logout"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var office_MyProfileHelper = new Office_MyProfileHelper(GetWebDriver()); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("ProfilePictureChange", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("ProfilePictureChange", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("ProfilePictureChange", "Go to Profile page"); VisitOffice("myprofile"); office_MyProfileHelper.WaitForWorkAround(6000); executionLog.Log("ProfilePictureChange", "Verify title"); VerifyTitle("My Profile"); executionLog.Log("ProfilePictureChange", "Click on Edit profile button"); office_MyProfileHelper.ClickElement("EditProfile"); office_MyProfileHelper.WaitForWorkAround(4000); executionLog.Log("ProfilePictureChange", "Verify title"); VerifyTitle("Edit Profile"); executionLog.Log("ProfilePictureChange", "Upload image"); string path = GetPathToFile() + "index.jpg"; office_MyProfileHelper.UploadImage("UploadImage", path); executionLog.Log("ProfilePictureChange", "Click on Save button"); office_MyProfileHelper.ClickElement("Save"); office_MyProfileHelper.WaitForWorkAround(6000); executionLog.Log("ProfilePictureChange", "Verify title"); VerifyTitle("My Profile"); executionLog.Log("ProfilePictureChange", "Check default image not displayed"); office_MyProfileHelper.verifyElementNotPresent("ProfileDefault"); executionLog.Log("ProfilePictureChange", "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("ProfilePictureChange"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Profile Picture Change"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Profile Picture Change", "Bug", "Medium", "My Profile page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Profile Picture Change"); TakeScreenshot("ProfilePictureChange"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ProfilePictureChange.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ProfilePictureChange"); string id = loginHelper.getIssueID("Profile Picture Change"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ProfilePictureChange.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Profile Picture Change"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Profile Picture Change"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ProfilePictureChange"); executionLog.WriteInExcel("Profile Picture Change", Status, JIRA, "My Profile"); } }
public void validationForFileTypeOfficeLogo() { 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 office_MyProfileHelper = new Office_MyProfileHelper(GetWebDriver()); try { executionLog.Log("ValidationForFileTypeOfficeLogo", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("ValidationForFileTypeOfficeLogo", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("ValidationForFileTypeOfficeLogo", "Navigate to on edit profile page"); VisitOffice("editProfile"); string path = GetPathToFile() + "2.pdf"; executionLog.Log("ValidationForFileTypeOfficeLogo", "Upload Invalid File"); office_MyProfileHelper.UploadFile("//*[@id='EmployeeProfileImage']", path); executionLog.Log("ValidationForFileTypeOfficeLogo", "Verify Alert text"); office_MyProfileHelper.VerifyAlertText("please select a valid file!"); office_MyProfileHelper.WaitForWorkAround(4000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ValidationForFileTypeOfficeLogo"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Validation For File Type Office Logo"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Validation For File Type Office Logo", "Bug", "Medium", "My Profile page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Validation For File Type Office Logo"); TakeScreenshot("ValidationForFileTypeOfficeLogo"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ValidationForFileTypeOfficeLogo.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ValidationForFileTypeOfficeLogo"); string id = loginHelper.getIssueID("Validation For File Type Office Logo"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ValidationForFileTypeOfficeLogo.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Validation For File Type Office Logo"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Validation For File Type Office Logo"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ValidationForFileTypeOfficeLogo"); executionLog.WriteInExcel("Validation For File Type Office Logo", Status, JIRA, "My Profile"); } }
public void uplaodFileAfterDeleting() { string[] username = null; string[] password = null; XMLParse 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 office_MyProfileHelper = new Office_MyProfileHelper(GetWebDriver()); // Variable var name = "Testing Subject" + GetRandomNumber(); var email = "Test" + GetRandomNumber() + "@gmail.com"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("UplaodFileAfterDeleting", " Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("UplaodFileAfterDeleting", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("UplaodFileAfterDeleting", "Click On Admin"); VisitOffice("admin"); executionLog.Log("UplaodFileAfterDeleting", "Redirect to My corp page."); VisitOffice("mycorp"); office_MyProfileHelper.WaitForWorkAround(5000); executionLog.Log("UplaodFileAfterDeleting", "Click on add document link."); office_MyProfileHelper.ClickJS("AddDoc"); office_MyProfileHelper.WaitForWorkAround(4000); executionLog.Log("UplaodFileAfterDeleting", "Enter Document name"); office_MyProfileHelper.TypeText("DocName", "Test Document"); executionLog.Log("UplaodFileAfterDeleting", "Upload File "); String Filename = GetPathToFile() + "index.jpg"; office_MyProfileHelper.Upload("BrowseFile", Filename); executionLog.Log("UplaodFileAfterDeleting", "Delete uploaded file."); office_MyProfileHelper.ClickJS("RemoveFile"); executionLog.Log("UplaodFileAfterDeleting", "Click on save button."); office_MyProfileHelper.ClickJS("SaveDoc"); office_MyProfileHelper.WaitForWorkAround(6000); executionLog.Log("UplaodFileAfterDeleting", "Verify validation is displayed for attacment."); office_MyProfileHelper.VerifyText("VerifyValidation", "This field is required."); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("UplaodFileAfterDeleting"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Uplaod File After Deleting"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Uplaod File After Deleting", "Bug", "Medium", "Document page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Uplaod File After Deleting"); TakeScreenshot("UplaodFileAfterDeleting"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\UplaodFileAfterDeleting.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("UplaodFileAfterDeleting"); string id = loginHelper.getIssueID("Uplaod File After Deleting"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\UplaodFileAfterDeleting.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Uplaod File After Deleting"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Uplaod File After Deleting"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("UplaodFileAfterDeleting"); executionLog.WriteInExcel("Uplaod File After Deleting", Status, JIRA, "Admin Corporate"); } }