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 addressTypePickList() { 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("AddressTypePickList", "Login with valid username and password"); Login(username[0], password[0]); executionLog.Log("AddressTypePickList", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("AddressTypePickList", "Go to profile page"); VisitOffice("myprofile"); executionLog.Log("AddressTypePickList", "Verify title"); VerifyTitle("My Profile"); executionLog.Log("AddressTypePickList", "Click on 'Edit' profile button"); office_MyProfileHelper.ClickElement("AddressEdit"); executionLog.Log("AddressTypePickList", "Verify Title"); VerifyTitle("Edit Profile"); executionLog.Log("AddressTypePickList", "Verify Address type not a pick list"); office_MyProfileHelper.verifyElementPresent("AddressTypeDropdown"); executionLog.Log("AddressTypePickList", "Log out from the application"); VisitOffice("logout"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("AddressTypePickList"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Address Type Pick List"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Address Type Pick List", "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("Address Type Pick List"); TakeScreenshot("AddressTypePickList"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\AddressTypePickList.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("AddressTypePickList"); string id = loginHelper.getIssueID("Address Type Pick List"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\AddressTypePickList.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Address Type Pick List"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Address Type Pick List"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("AddressTypePickList"); executionLog.WriteInExcel("Address Type Pick List", Status, JIRA, "My Profile"); } }
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"); } }