public void permanentlyDeleteDocumentNewSkin() { 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 officeActivities_DocumentHelper = new OfficeActivities_DocumentHelper(GetWebDriver()); // Variable random var name = "TESTCLIENT" + RandomNumber(1, 999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("PermanentlyDeleteDocumentNewSkin", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("PermanentlyDeleteDocumentNewSkin", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("PermanentlyDeleteDocumentNewSkin", "Redirect To Document"); VisitOffice("documents"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("PermanentlyDeleteDocumentNewSkin", "Click On Create"); officeActivities_DocumentHelper.ClickElement("ClickOnDoc"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("PermanentlyDeleteDocumentNewSkin", "ClickOnCreate"); officeActivities_DocumentHelper.TypeText("Name", "DELETE DOCUMENT"); string pathtofile = GetPathToFile() + "index.jpg"; executionLog.Log("PermanentlyDeleteDocumentNewSkin", "Attach File"); officeActivities_DocumentHelper.UploadFile("//*[@id='DocumentFile']", pathtofile); executionLog.Log("PermanentlyDeleteDocumentNewSkin", "Click on Save"); officeActivities_DocumentHelper.ClickElement("Save"); executionLog.Log("PermanentlyDeleteDocumentNewSkin", "Verify message"); officeActivities_DocumentHelper.WaitForText("Document saved successfully.", 05); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("PermanentlyDeleteDocumentNewSkin", "Search Documet "); officeActivities_DocumentHelper.TypeText("SearchDocumet", "DELETE DOCUMENT"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("PermanentlyDeleteDocumentNewSkin", "Select All in owner field"); officeActivities_DocumentHelper.SelectByText("OwnerField", "All"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("PermanentlyDeleteDocumentNewSkin", "Click on Checkbox"); officeActivities_DocumentHelper.ClickElement("ClickOnCheckBox"); executionLog.Log("PermanentlyDeleteDocumentNewSkin", "Click On delete"); officeActivities_DocumentHelper.ClickElement("ClickOndelete"); executionLog.Log("PermanentlyDeleteDocumentNewSkin", "Accept alert messsage."); officeActivities_DocumentHelper.AcceptAlert(); executionLog.Log("PermanentlyDeleteDocumentNewSkin", "Verify Document deleted successfully."); officeActivities_DocumentHelper.WaitForText("Document deleted successfully.", 10); executionLog.Log("PermanentlyDeleteDocumentNewSkin", "Click on Recycle bin"); officeActivities_DocumentHelper.ClickElement("ClickOnReycleBin"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("PermanentlyDeleteDocumentNewSkin", "Search Documet "); officeActivities_DocumentHelper.TypeText("SearchDocumet", "DELETE DOCUMENT"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("PermanentlyDeleteDocumentNewSkin", "Select All in owner field"); officeActivities_DocumentHelper.SelectByText("OwnerField", "All"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("PermanentlyDeleteDocumentNewSkin", "ClickOnDeletePer"); officeActivities_DocumentHelper.ClickElement("ClickOnDeletePer"); executionLog.Log("PermanentlyDeleteDocumentNewSkin", "Accept alert messsage."); officeActivities_DocumentHelper.AcceptAlert(); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("PermanentlyDeleteDocumentNewSkin", "verify Document Permanently Deleted."); officeActivities_DocumentHelper.WaitForText("Document Permanently Deleted.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("PermanentlyDeleteDocumentNewSkin"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Permanently Delete Document New Skin"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Permanently Delete Document New Skin", "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("Permanently Delete Document New Skin"); TakeScreenshot("PermanentlyDeleteDocumentNewSkin"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\PermanentlyDeleteDocumentNewSkin.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("PermanentlyDeleteDocumentNewSkin"); string id = loginHelper.getIssueID("Permanently Delete Document New Skin"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\PermanentlyDeleteDocumentNewSkin.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Permanently Delete Document New Skin"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Permanently Delete Document New Skin"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("PermanentlyDeleteDocumentNewSkin"); executionLog.WriteInExcel("Permanently Delete Document New Skin", Status, JIRA, "Office Activities"); } }
public void verifyDocumentsOnEmailAttachment() { 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 officeActivities_DocumentHelper = new OfficeActivities_DocumentHelper(GetWebDriver()); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyDocumentsOnEmailAttachment", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyDocumentsOnEmailAttachment", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyDocumentsOnEmailAttachment", "Redirect at documents page."); VisitOffice("documents"); officeActivities_DocumentHelper.WaitForWorkAround(3000); //officeActivities_DocumentHelper.TypeText("SearchDocumet", "Don't Delete"); //officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsOnEmailAttachment", "Click on any document"); officeActivities_DocumentHelper.ClickElement("OpenDoc"); officeActivities_DocumentHelper.WaitForWorkAround(3000); //executionLog.Log("VerifyDocumentsOnEmailAttachment", "Wait for locator to present."); //officeActivities_DocumentHelper.WaitForElementPresent("EmailThisDocument", 10); executionLog.Log("VerifyDocumentsOnEmailAttachment", "Click on add new version button"); officeActivities_DocumentHelper.ClickElement("AddVersion"); officeActivities_DocumentHelper.WaitForWorkAround(1000); executionLog.Log("VerifyDocumentsOnEmailAttachment", "Attach File"); officeActivities_DocumentHelper.UploadFile("//*[@id='DocumentFile']", "E:/pegqa/Pegasus_New_skin/Files/Up.jpg"); officeActivities_DocumentHelper.WaitForWorkAround(1000); executionLog.Log("VerifyDocumentsOnEmailAttachment", "Click on add new version button"); officeActivities_DocumentHelper.TypeText("DocCommnet", "comment"); //officeActivities_DocumentHelper.WaitForWorkAround(1000); executionLog.Log("VerifyDocumentsOnEmailAttachment", "Click on Save button"); officeActivities_DocumentHelper.ClickElement("AddVersionSave"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsOnEmailAttachment", "Click on email this note."); officeActivities_DocumentHelper.ClickElement("EmailThisDocument"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsOnEmailAttachment", "Verify attached file is pdf file"); officeActivities_DocumentHelper.VerifyText("VerifyEmailAttachment", "Up.jpg"); //officeActivities_DocumentHelper.WaitForWorkAround(3000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyDocumentsOnEmailAttachment"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Documents On Email Attachment"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Documents On Email Attachment", "Bug", "Medium", "Documents page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Documents On Email Attachment"); TakeScreenshot("VerifyDocumentsOnEmailAttachment"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyDocumentsOnEmailAttachment.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyDocumentsOnEmailAttachment"); string id = loginHelper.getIssueID("Verify Documents On Email Attachment"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyDocumentsOnEmailAttachment.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Documents On Email Attachment"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Documents On Email Attachment"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyDocumentsOnEmailAttachment"); executionLog.WriteInExcel("Verify Documents On Email Attachment", Status, JIRA, "Activities Management"); } }
public void verifyRedirectedToEmailPageIssue() { 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 officeActivities_DocumentsHelper = new OfficeActivities_DocumentHelper(GetWebDriver()); // Random Variable String JIRA = ""; String Status = "Pass"; var docname = "Testdoc" + RandomNumber(111, 9999); try { executionLog.Log("VerifyRedirectedToEmailPageIssue", " Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyRedirectedToEmailPageIssue", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("VerifyRedirectedToEmailPageIssue", "Redirect to Create Document page"); VisitOffice("documents/create"); executionLog.Log("VerifyRedirectedToEmailPageIssue", "Enter document name"); officeActivities_DocumentsHelper.TypeText("Name", docname); executionLog.Log("VerifyRedirectedToEmailPageIssue", "Upload document"); officeActivities_DocumentsHelper.UploadFile("//*[@id='DocumentFile']", "C:/Users/Public/Pictures/Sample Pictures/Desert.jpg"); executionLog.Log("VerifyRedirectedToEmailPageIssue", "Select User Group"); officeActivities_DocumentsHelper.SelectByText("UserGroup", "Secondary"); executionLog.Log("VerifyRedirectedToEmailPageIssue", "Click on Save button"); officeActivities_DocumentsHelper.ClickElement("Save"); officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyRedirectedToEmailPageIssue", "Enter document name in Search field"); officeActivities_DocumentsHelper.TypeText("SearchDocumet", docname); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyRedirectedToEmailPageIssue", "Open document"); officeActivities_DocumentsHelper.ClickElement("OpenDoc"); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyRedirectedToEmailPageIssue", "Click on User Group"); officeActivities_DocumentsHelper.ClickElement("AssgnUserGroup"); officeActivities_DocumentsHelper.WaitForWorkAround(4000); executionLog.Log("VerifyRedirectedToEmailPageIssue", "Verify User not directed to Compose Email page"); officeActivities_DocumentsHelper.VerifyTextNotAvailable("E-Mails"); Console.WriteLine("User is not redirected to Compose Email page"); executionLog.Log("VerifyRedirectedToEmailPageIssue", "Redirect to All Document page"); VisitOffice("documents"); officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyRedirectedToEmailPageIssue", "Enter document name in Search field"); officeActivities_DocumentsHelper.TypeText("SearchDocumet", docname); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyRedirectedToEmailPageIssue", "Select document"); officeActivities_DocumentsHelper.ClickElement("ClickOnCheckBox"); executionLog.Log("VerifyRedirectedToEmailPageIssue", "Click on Delete button"); officeActivities_DocumentsHelper.ClickElement("ClickOndelete"); //officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyRedirectedToEmailPageIssue", "Accept Alert"); officeActivities_DocumentsHelper.AcceptAlert(); officeActivities_DocumentsHelper.WaitForText("Document deleted successfully.", 05); Console.WriteLine("Document Deleted"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyRedirectedToEmailPageIssue"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Redirected To Email Page Issue"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Redirected To Email Page Issue", "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 Redirected To Email Page Issue"); TakeScreenshot("VerifyRedirectedToEmailPageIssue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyRedirectedToEmailPageIssue.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyRedirectedToEmailPageIssue"); string id = loginHelper.getIssueID("Verify Redirected To Email Page Issue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyRedirectedToEmailPageIssue.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Redirected To Email Page Issue"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Redirected To Email Page Issue"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyRedirectedToEmailPageIssue"); executionLog.WriteInExcel("Verify Redirected To Email Page Issue", Status, JIRA, "Office Activities"); } }
public void editDocSaveIssue() { 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 officeActivities_DocumentHelper = new OfficeActivities_DocumentHelper(GetWebDriver()); var Name = "QADoc" + RandomNumber(100, 999); String Status = "Pass"; String JIRA = ""; try { executionLog.Log("EditDocSaveIssue", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("EditDocSaveIssue", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("EditDocSaveIssue", "Redirect to create document page"); VisitOffice("documents/create"); officeActivities_DocumentHelper.WaitForWorkAround(5000); executionLog.Log("EditDocSaveIssue", "verify title"); VerifyTitle("Create a New Document"); executionLog.Log("EditDocSaveIssue", "Enter Document name"); officeActivities_DocumentHelper.TypeText("Name", Name); executionLog.Log("EditDocSaveIssue", "Click on document version"); officeActivities_DocumentHelper.ClickElement("DocumentVersion"); executionLog.Log("EditDocSaveIssue", "Upload File "); String Filename = GetPathToFile() + "index.jpg"; officeActivities_DocumentHelper.Upload("BrowseAttachment", Filename); executionLog.Log("EditDocSaveIssue", "Select Assign owner"); officeActivities_DocumentHelper.ClickElement("AssignOwner"); executionLog.Log("EditDocSaveIssue", "Select status"); officeActivities_DocumentHelper.ClickElement("Status"); executionLog.Log("EditDocSaveIssue", "Click on Save button"); officeActivities_DocumentHelper.ClickElement("Save"); executionLog.Log("EditDocSaveIssue", "Wait for success message."); officeActivities_DocumentHelper.WaitForText("Document saved successfully.", 10); executionLog.Log("EditDocSaveIssue", "Search the document"); officeActivities_DocumentHelper.TypeText("SearchDocumet", Name); officeActivities_DocumentHelper.WaitForWorkAround(4000); executionLog.Log("EditDocSaveIssue", "Edit first doc"); officeActivities_DocumentHelper.ClickElement("EditDoc"); executionLog.Log("EditDocSaveIssue", "Verify title"); VerifyTitle("Edit Document"); executionLog.Log("EditDocSaveIssue", "Click on Save button"); officeActivities_DocumentHelper.ClickElement("Save"); executionLog.Log("EditDocSaveIssue", "Verify Save button working properly"); officeActivities_DocumentHelper.WaitForText("Document updated successfully.", 10); VisitOffice("documents"); officeActivities_DocumentHelper.WaitForWorkAround(5000); executionLog.Log("EditDocSaveIssue", "Search the Document"); officeActivities_DocumentHelper.TypeText("SearchDocumet", Name); officeActivities_DocumentHelper.WaitForWorkAround(4000); executionLog.Log("EditDocSaveIssue", "Delete the document"); officeActivities_DocumentHelper.ClickElement("CheckDocToDel"); officeActivities_DocumentHelper.ClickElement("DeleteDoc"); officeActivities_DocumentHelper.AcceptAlert(); officeActivities_DocumentHelper.WaitForWorkAround(3000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("EditDocSaveIssue"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Edit Doc Save Issue"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Edit Doc Save Issue", "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("Edit Doc Save Issue"); TakeScreenshot("EditDocSaveIssue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EditDocSaveIssue.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("EditDocSaveIssue"); string id = loginHelper.getIssueID("Edit Doc Save Issue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EditDocSaveIssue.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Edit Doc Save Issue"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Edit Doc Save Issue"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("EditDocSaveIssue"); executionLog.WriteInExcel("Edit Doc Save Issue", Status, JIRA, "Office Activities"); } }
public void opportunitiesnDocumentUrlChange() { 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_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver()); var officeActivities_DocumentHelper = new OfficeActivities_DocumentHelper(GetWebDriver()); // Variable String JIRA = ""; String Status = "Pass"; try { executionLog.Log("OpportunitiesnDocumentUrlChange", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("OpportunitiesnDocumentUrlChange", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("OpportunitiesnDocumentUrlChange", "Goto User Opportunities"); VisitOffice("opportunities"); office_OpportunitiesHelper.WaitForWorkAround(4000); executionLog.Log("OpportunitiesnDocumentUrlChange", "Click On Any Opportunity"); office_OpportunitiesHelper.ClickElement("OpenOpportunity"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("OpportunitiesnDocumentUrlChange", "Click On Add Document"); office_OpportunitiesHelper.ClickElement("AddDocument"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("OpportunitiesnDocumentUrlChange", "Enter Document Name"); officeActivities_DocumentHelper.TypeText("Name", "Document Test"); var File = GetPathToFile() + "index.jpg"; executionLog.Log("OpportunitiesnDocumentUrlChange", "Upload File"); officeActivities_DocumentHelper.Upload("BrowseFile", File); officeActivities_DocumentHelper.WaitForWorkAround(1000); executionLog.Log("OpportunitiesnDocumentUrlChange", "Click Save"); officeActivities_DocumentHelper.ClickOnDisplayed("SaveDocOppo"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("OpportunitiesnDocumentUrlChange", "Wait for success message."); officeActivities_DocumentHelper.WaitForText("Documents successfully Added.", 10); executionLog.Log("OpportunitiesnDocumentUrlChange", "Open the document"); officeActivities_DocumentHelper.PressEnter("ClickDocument1"); officeActivities_DocumentHelper.WaitForWorkAround(1000); executionLog.Log("OpportunitiesnDocumentUrlChange", "Change the url with the url number of another office"); VisitOffice("documents/view/41"); executionLog.Log("OpportunitiesnDocumentUrlChange", "Verify Validation"); officeActivities_DocumentHelper.WaitForText("You don't have privilege.", 10); executionLog.Log("OpportunitiesnDocumentUrlChange", "Redirect to opportunity Page"); VisitOffice("opportunities"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("OpportunitiesnDocumentUrlChange", "Click On Any Opportunity"); office_OpportunitiesHelper.ClickElement("OpenOpportunity"); office_OpportunitiesHelper.WaitForWorkAround(2000); executionLog.Log("OpportunitiesnDocumentUrlChange", "Click On Document "); officeActivities_DocumentHelper.PressEnter("ClickDocument1"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("OpportunitiesnDocumentUrlChange", "Click OnDelete icon"); officeActivities_DocumentHelper.ClickElement("DeleteDocumentopp"); executionLog.Log("OpportunitiesnDocumentUrlChange", "Accept alert message"); officeActivities_DocumentHelper.AcceptAlert(); officeActivities_DocumentHelper.WaitForWorkAround(4000); executionLog.Log("OpportunitiesnDocumentUrlChange", "Wait for delete message"); officeActivities_DocumentHelper.WaitForText("Document deleted successfully.", 5); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("OpportunitiesnDocumentUrlChange"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Opportunities Document Url Change"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Opportunities Document Url Change", "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("Opportunities Document Url Change"); TakeScreenshot("OpportunitiesnDocumentUrlChange"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\OpportunitiesnDocumentUrlChange.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("OpportunitiesnDocumentUrlChange"); string id = loginHelper.getIssueID("Opportunities Document Url Change"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\OpportunitiesnDocumentUrlChange.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Opportunities Document Url Change"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Opportunities Document Url Change"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("OpportunitiesnDocumentUrlChange"); executionLog.WriteInExcel("Opportunities Document Url Change", Status, JIRA, "Office Opportunities"); } }
public void documentUpdateVersion() { 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 officeActivities_DocumentHelper = new OfficeActivities_DocumentHelper(GetWebDriver()); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("DocumentUpdateVersion", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("DocumentUpdateVersion", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("DocumentUpdateVersion", "Redirect to URL"); VisitOffice("documents"); executionLog.Log("DocumentUpdateVersion", "Wait for element to present"); officeActivities_DocumentHelper.WaitForElementPresent("EditDoc", 10); executionLog.Log("DocumentUpdateVersion", " Click On Edit Icon"); officeActivities_DocumentHelper.ClickElement("EditDoc"); executionLog.Log("DocumentUpdateVersion", "Verify page title"); VerifyTitle("Edit Document"); executionLog.Log("DocumentUpdateVersion", "ClickOnAddNewVesion"); officeActivities_DocumentHelper.ClickElement("NewVersion"); string value = officeActivities_DocumentHelper.GetAtrributeByLocator("//*[@id='DocumentVersion']", "value"); Console.WriteLine("Value in string = " + value); executionLog.Log("DocumentUpdateVersion", "upload file"); var path = GetPathToFile() + "1.pdf"; officeActivities_DocumentHelper.UploadFile("//*[@id='DocumentFile']", path); executionLog.Log("DocumentUpdateVersion", "Enter coment"); officeActivities_DocumentHelper.TypeText("DocCommnet", "Test Comment"); executionLog.Log("DocumentUpdateVersion", "Click Save"); officeActivities_DocumentHelper.ClickDisplayed("//input[@title='Save']"); officeActivities_DocumentHelper.WaitForWorkAround(1000); executionLog.Log("DocumentUpdateVersion", "New Version File Uploaded successfully."); officeActivities_DocumentHelper.WaitForText("New Version File Uploaded successfully.", 8); double intValue = double.Parse(value); Console.WriteLine("Value in int = " + intValue); officeActivities_DocumentHelper.WaitForWorkAround(5000); value = officeActivities_DocumentHelper.GetAtrributeByLocator("//*[@id='DocumentVersion']", "value"); Assert.IsTrue(intValue + 1 == double.Parse(value)); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("DocumentUpdateVersion"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Document Update Version"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Document Update Version", "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("Document Update Version"); TakeScreenshot("DocumentUpdateVersion"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\DocumentUpdateVersion.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("DocumentUpdateVersion"); string id = loginHelper.getIssueID("Document Update Version"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\DocumentUpdateVersion.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Document Update Version"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Document Update Version"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("DocumentUpdateVersion"); executionLog.WriteInExcel("Document Update Version", Status, JIRA, "Office Activities"); } }
public void verifyCreatorNameOfDocumentInMerchant() { string[] username1 = null; string[] username = null; string[] password = null; XMLParse oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); username = oXMLData.getData("settings/Credentials", "username_corp"); username1 = 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 corp_MerchantHelper = new Corp_MerchantHelper(GetWebDriver()); var office_clientsHelper = new Office_ClientsHelper(GetWebDriver()); var myprofilepagehelper = new MyProfilePageHelper(GetWebDriver()); var officeActivities_DocumentHelper = new OfficeActivities_DocumentHelper(GetWebDriver()); // variables String JIRA = ""; String Status = "Pass"; var docname = "TestDoc" + RandomNumber(111, 999999); try { executionLog.Log("VerifyCreatorNameOfDocumentInMerchant", "Login to office portal with valid username and password"); Login(username1[0], password[0]); Console.WriteLine("Logged in as: " + username1[0] + " / " + password[0]); executionLog.Log("VerifyCreatorNameOfDocumentInMerchant", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyCreatorNameOfDocumentInMerchant", "Redirect at My Profile page."); VisitOffice("myprofile"); executionLog.Log("VerifyCreatorNameOfDocumentInMerchant", "Click on Edit profile Button."); myprofilepagehelper.ClickElement("EditProfileBtn"); myprofilepagehelper.WaitForWorkAround(2000); executionLog.Log("VerifyCreatorNameOfDocumentInMerchant", "Get First Name of User"); var name = myprofilepagehelper.GetValue("//input[@id='EmployeeFirstName']"); executionLog.Log("VerifyCreatorNameOfDocumentInMerchant", "Redirect at merchants page."); VisitOffice("clients"); office_clientsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyCreatorNameOfDocumentInMerchant", "Click on a client"); var clientname = office_clientsHelper.GetText("//table[@id='list1']/tbody/tr[2]/td[15]/a"); office_clientsHelper.ClickElement("Client1"); office_clientsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyCreatorNameOfDocumentInMerchant", "Click on New Task"); office_clientsHelper.ClickElement("AddDoc"); office_clientsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyCreatorNameOfDocumentInMerchant", "Enter document name"); officeActivities_DocumentHelper.TypeText("Name", docname); executionLog.Log("VerifyCreatorNameOfDocumentInMerchant", "Upload file"); var path = GetPathToFile() + "Desert.jpg"; officeActivities_DocumentHelper.UploadFile("//*[@id='DocumentFiles']", path); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("VerifyCreatorNameOfDocumentInMerchant", "Click on Save button"); officeActivities_DocumentHelper.ClickElement("ClientPopupSave"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyCreatorNameOfDocumentInMerchant", "Logout from office portal"); VisitOffice("logout"); office_clientsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyCreatorNameOfDocumentInMerchant", "Login to corporate portal with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyCreatorNameOfDocumentInMerchant", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyCreatorNameOfDocumentInMerchant", "Redirect at merchants page."); VisitCorp("merchants"); corp_MerchantHelper.WaitForWorkAround(2000); executionLog.Log("VerifyCreatorNameOfDocumentInMerchant", "Enter client name in search box"); corp_MerchantHelper.TypeText("EnterClinentToSearch", clientname); corp_MerchantHelper.WaitForWorkAround(2000); executionLog.Log("VerifyCreatorNameOfDocumentInMerchant", "Click on Merchant"); corp_MerchantHelper.ClickElement("ClickOnMerchant"); corp_MerchantHelper.WaitForWorkAround(2000); executionLog.Log("VerifyCreatorNameOfDocumentInMerchant", "Select Activity Type >> Documents"); corp_MerchantHelper.Select("SelectActivityType", "Documents"); corp_MerchantHelper.WaitForWorkAround(2000); executionLog.Log("VerifyCreatorNameOfDocumentInMerchant", "Enter document name"); corp_MerchantHelper.TypeText("SearchActivityName", docname); corp_MerchantHelper.WaitForWorkAround(2000); executionLog.Log("VerifyCreatorNameOfDocumentInMerchant", "Click on document"); corp_MerchantHelper.ClickElement("ClickOnActivityAny"); corp_MerchantHelper.WaitForWorkAround(3000); executionLog.Log("VerifyCreatorNameOfDocumentInMerchant", "Verify Created By name is appearing"); corp_MerchantHelper.VerifyText("CreatedOnText", name); Console.WriteLine("Creator Name of Document is " + name); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyCreatorNameOfDocumentInMerchant"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Creator Name Of Document In Merchant"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Creator Name Of Document In Merchant", "Bug", "Medium", "Merchant corp", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Creator Name Of Document In Merchant"); TakeScreenshot("VerifyCreatorNameOfDocumentInMerchant"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyCreatorNameOfDocumentInMerchant.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyCreatorNameOfDocumentInMerchant"); string id = loginHelper.getIssueID("Verify Creator Name Of Document In Merchant"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyCreatorNameOfDocumentInMerchant.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Creator Name Of Document In Merchant"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Creator Name Of Document In Merchant"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyCreatorNameOfDocumentInMerchant"); executionLog.WriteInExcel("Verify Creator Name Of Document In Merchant", Status, JIRA, "Corp Merchant"); } }
public void documentForMeetingReplaceInvalidFile() { 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 officeActivities_MeetingHelper = new OfficeActivities_MeetingHelper(GetWebDriver()); var officeActivities_DocumentHelper = new OfficeActivities_DocumentHelper(GetWebDriver()); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("DocumentUpdateVersion", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("DocumentUpdateVersion", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Go to meetings page"); VisitOffice("meetings"); executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Click On Meeting In Activity"); officeActivities_MeetingHelper.ClickElement("ClickOnAnyMeeting"); officeActivities_MeetingHelper.WaitForWorkAround(2000); executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Click On Add Document Btn"); officeActivities_MeetingHelper.ClickElement("ClickOnAddDocumentBtn"); officeActivities_MeetingHelper.WaitForWorkAround(1000); executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Enter Doc Name"); var DocName = "Test Valid Doc" + GetRandomNumber(); officeActivities_MeetingHelper.TypeText("EnterDocumentName", DocName); executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Upload Invalid file(exe)"); var InvalidFile = GetPathToFile() + "chrome.exe"; officeActivities_MeetingHelper.Upload("BrowseDoc", InvalidFile); officeActivities_MeetingHelper.WaitForWorkAround(5000); executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Replace with valid file(jpg)"); var ValidFile = GetPathToFile() + "Up.jpg"; officeActivities_MeetingHelper.Upload("BrowserDoc1", ValidFile); officeActivities_MeetingHelper.WaitForWorkAround(5000); executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Click Save Of Doc Pop Up"); officeActivities_MeetingHelper.ClickElement("ClickSaveOfDocPopUp"); officeActivities_MeetingHelper.WaitForWorkAround(3000); executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Verify Confirmation"); officeActivities_MeetingHelper.WaitForText("Documents successfully Added.", 10); executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Redirect To Document Section Activities"); VisitOffice("documents"); officeActivities_MeetingHelper.WaitForWorkAround(1000); executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Search Document"); officeActivities_MeetingHelper.TypeText("SearchSubject", DocName); officeActivities_MeetingHelper.WaitForWorkAround(2000); executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Select All in owner field"); officeActivities_MeetingHelper.SelectByText("OwnerField", "All"); officeActivities_MeetingHelper.WaitForWorkAround(2000); executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Verify Added Document Present"); officeActivities_MeetingHelper.VerifyText("DoucumentFirstInList", DocName); officeActivities_MeetingHelper.WaitForWorkAround(1000); executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Search Document"); officeActivities_DocumentHelper.TypeText("SearchDocumet", DocName); officeActivities_MeetingHelper.WaitForWorkAround(3000); executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Select document"); officeActivities_DocumentHelper.ClickElement("CheckDocToDel"); executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Click on delete."); officeActivities_DocumentHelper.ClickElement("ClickOndelete"); executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Accept alert message."); officeActivities_DocumentHelper.AcceptAlert(); executionLog.Log("DocumentForMeetingReplaceInvalidFile", "Wait for success message."); officeActivities_DocumentHelper.WaitForText("Document deleted successfully.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("DocumentForMeetingReplaceInvalidFile"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Document For Meeting Replace InvalidFile"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("DocumentForMeetingReplaceInvalidFile", "Bug", "Medium", "Meeting page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Document For Meeting Replace InvalidFile"); TakeScreenshot("DocumentForMeetingReplaceInvalidFile"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\DocumentForMeetingReplaceInvalidFile.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("DocumentForMeetingReplaceInvalidFile"); string id = loginHelper.getIssueID("Document For Meeting Replace InvalidFile"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\DocumentForMeetingReplaceInvalidFile.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Document For Meeting Replace InvalidFile"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Document For Meeting Replace InvalidFile"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("DocumentForMeetingReplaceInvalidFile"); executionLog.WriteInExcel("Document For Meeting Replace InvalidFile", Status, JIRA, "Office Activities"); } }
public void verifyQuickLookLabelsForDocuments() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); //Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var officeActivities_DocumentsHelper = new OfficeActivities_DocumentHelper(GetWebDriver()); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Variable var name = "Doc" + RandomNumber(1, 9999); var email = "Test" + GetRandomNumber() + "@gmail.com"; var ValidFile = GetPathToFile() + "index.jpg"; var InvalidFile = GetPathToFile() + "chrome.exe"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyQuickLookLabelsForDocuments", " Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Redirect at create document page"); VisitOffice("documents/create"); officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForDocuments", "verify title"); VerifyTitle("Create a New Document"); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Click on Save button"); officeActivities_DocumentsHelper.ClickElement("Save"); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Verify validation message for name."); officeActivities_DocumentsHelper.VerifyText("NameError", "This field is required."); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Verify validation message for attachment."); officeActivities_DocumentsHelper.VerifyText("AttachmentError", "This field is required."); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Enter Document name"); officeActivities_DocumentsHelper.TypeText("Name", name); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Click on document version"); officeActivities_DocumentsHelper.ClickElement("DocumentVersion"); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Upload an invalid File "); officeActivities_DocumentsHelper.Upload("BrowseAttachment", InvalidFile); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Verify alert message for invalid file."); officeActivities_DocumentsHelper.VerifyAlertText("please select a valid file!"); officeActivities_DocumentsHelper.AcceptAlert(); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Upload a valid File."); officeActivities_DocumentsHelper.Upload("BrowseAttachment", ValidFile); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Select Assign owner"); officeActivities_DocumentsHelper.SelectByText("AssignOwner", "Howard Tang"); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Select status"); officeActivities_DocumentsHelper.Select("Status", "Active"); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Click on Save button"); officeActivities_DocumentsHelper.ClickElement("Save"); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Wait for success message."); officeActivities_DocumentsHelper.WaitForText("Document saved successfully.", 10); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Redirect at document page"); VisitOffice("documents"); officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForDocuments", "verify page title"); VerifyTitle("Documents"); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Search created document."); officeActivities_DocumentsHelper.TypeText("SearchDocumet", name); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Click on any document."); officeActivities_DocumentsHelper.ClickElement("OpenDoc"); officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Verify label for document status."); officeActivities_DocumentsHelper.VerifyText("VerifyStatus", "Active"); //officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Verify label for document category."); officeActivities_DocumentsHelper.VerifyText("VerifyCategory", "click to add"); //officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Verify label for document responsibility."); officeActivities_DocumentsHelper.VerifyText("VerifyResponsibility", "Howard Tang"); //officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Click on edit button."); officeActivities_DocumentsHelper.ClickElement("EditLink"); officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Select status for document."); officeActivities_DocumentsHelper.SelectByText("Status", "InActive"); //officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Select category for document."); officeActivities_DocumentsHelper.SelectByText("Category", "pdf"); //officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Select owner for document."); officeActivities_DocumentsHelper.SelectByText("AssignOwner", "Howard Tang"); //officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Click on save button."); officeActivities_DocumentsHelper.ClickElement("Save"); officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Verify label for document status."); officeActivities_DocumentsHelper.VerifyText("VerifyStatus", "InActive"); //officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Verify label for document category."); officeActivities_DocumentsHelper.VerifyText("Category2", "pdf"); //officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Verify label for document responsibility."); officeActivities_DocumentsHelper.VerifyText("VerifyResponsibility", "Howard Tang"); //officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Click on delete icon."); officeActivities_DocumentsHelper.ClickElement("DeleteVersion"); officeActivities_DocumentsHelper.AcceptAlert(); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Wait for success message."); officeActivities_DocumentsHelper.WaitForText("Document deleted successfully.", 10); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Redirect at documents recyclebin page."); VisitOffice("documents/recyclebin"); officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Verify page title."); VerifyTitle("Recycled Documents"); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Search document by name."); officeActivities_DocumentsHelper.TypeText("SearchDocumet", name); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Select 'All' at Owner Field"); officeActivities_DocumentsHelper.SelectByText("OwnerField", "All"); officeActivities_DocumentsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Click on delete icon."); officeActivities_DocumentsHelper.ClickElement("DeleteRecycle"); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Acccept alert to delete doc."); officeActivities_DocumentsHelper.AcceptAlert(); executionLog.Log("VerifyQuickLookLabelsForDocuments", "Wait for success message."); officeActivities_DocumentsHelper.WaitForText("Document Permanently Deleted.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyQuickLookLabelsForDocuments"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("VerifyQuickLookLabelsForDocuments"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("VerifyQuickLookLabelsForDocuments", "Bug", "Medium", "Tasks page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("VerifyQuickLookLabelsForDocuments"); TakeScreenshot("VerifyQuickLookLabelsForDocuments"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\Contact.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyQuickLookLabelsForDocuments"); string id = loginHelper.getIssueID("VerifyQuickLookLabelsForDocuments"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\Contact.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("VerifyQuickLookLabelsForDocuments"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("VerifyQuickLookLabelsForDocuments"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyQuickLookLabelsForDocuments"); executionLog.WriteInExcel("VerifyQuickLookLabelsForDocuments", Status, JIRA, "Activities Management"); } }
public void activitiesDocumentManagement2() { 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 officeActivities_DocumentsHelper = new OfficeActivities_DocumentHelper(GetWebDriver()); var office_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); var office_LeadsHelper = new Office_LeadsHelper(GetWebDriver()); var office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver()); var ticket_CreateATicketHelper = new OfficeTickets_CreateTicketsHelper(GetWebDriver()); // Variable var name = "Doc" + RandomNumber(1, 9999); var email = "Test" + GetRandomNumber() + "@gmail.com"; String ValidFile = GetPathToFile() + "index.jpg"; String InvalidFile = GetPathToFile() + "chrome.exe"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("ActivitiesDocumentManagement2", " Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("ActivitiesDocumentManagement2", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("ActivitiesDocumentManagement2", "Click On Admin"); VisitOffice("admin"); executionLog.Log("ActivitiesDocumentManagement2", "Redirect to create document page"); VisitOffice("documents/create"); executionLog.Log("ActivitiesDocumentManagement2", "verify title"); VerifyTitle("Create a New Document"); executionLog.Log("ActivitiesDocumentManagement2", "Click on Save button"); officeActivities_DocumentsHelper.ClickElement("Save"); executionLog.Log("ActivitiesDocumentManagement2", "Verify validation message for name."); officeActivities_DocumentsHelper.VerifyText("NameError", "This field is required."); executionLog.Log("ActivitiesDocumentManagement2", "Verify validation message for attachment."); officeActivities_DocumentsHelper.VerifyText("AttachmentError", "This field is required."); executionLog.Log("ActivitiesDocumentManagement2", "Enter Document name"); officeActivities_DocumentsHelper.TypeText("Name", name); executionLog.Log("ActivitiesDocumentManagement2", "Click on document version"); officeActivities_DocumentsHelper.ClickElement("DocumentVersion"); executionLog.Log("ActivitiesDocumentManagement2", "Upload an invalid File "); officeActivities_DocumentsHelper.Upload("BrowseAttachment", InvalidFile); executionLog.Log("ActivitiesDocumentManagement2", "Verify alert message for invalid file."); officeActivities_DocumentsHelper.VerifyAlertText("please select a valid file!"); officeActivities_DocumentsHelper.AcceptAlert(); executionLog.Log("ActivitiesDocumentManagement2", "Upload a valid File."); officeActivities_DocumentsHelper.Upload("BrowseAttachment", ValidFile); executionLog.Log("ActivitiesDocumentManagement2", "Select Assign owner"); officeActivities_DocumentsHelper.SelectByText("AssignOwner", "Howard Tang"); executionLog.Log("ActivitiesDocumentManagement2", "Select status"); officeActivities_DocumentsHelper.Select("Status", "Active"); executionLog.Log("ActivitiesDocumentManagement2", "Click on Save button"); officeActivities_DocumentsHelper.ClickElement("Save"); executionLog.Log("ActivitiesDocumentManagement2", "Wait for success message."); officeActivities_DocumentsHelper.WaitForText("Document saved successfully.", 10); executionLog.Log("ActivitiesDocumentManagement2", "Search document by name."); officeActivities_DocumentsHelper.TypeText("SearchDocumet", name); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement2", "Select All in owner field"); officeActivities_DocumentsHelper.SelectByText("OwnerField", "All"); officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement2", "Click on edit icon."); officeActivities_DocumentsHelper.ClickElement("EditDoc"); executionLog.Log("ActivitiesDocumentManagement2", "Select document related to."); officeActivities_DocumentsHelper.Select("ReletedTo", "18"); officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement2", "Click on find list icon."); officeActivities_DocumentsHelper.ClickElement("Assign"); officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement2", "Click on any meeting."); officeActivities_DocumentsHelper.ClickElement("AssignUser"); officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement2", "Click on Save button"); officeActivities_DocumentsHelper.ClickElement("Save"); executionLog.Log("ActivitiesDocumentManagement2", "Wait for success message."); officeActivities_DocumentsHelper.WaitForText("Document updated successfully.", 10); executionLog.Log("ActivitiesDocumentManagement2", "Redirect at meetings page."); VisitOffice("meetings"); executionLog.Log("ActivitiesDocumentManagement2", "Wait for locator to be present."); officeActivities_DocumentsHelper.WaitForElementPresent("ClickOnAnyMeeting", 10); executionLog.Log("ActivitiesDocumentManagement2", "Click on any meeting."); office_ClientsHelper.ClickElement("ClickOnAnyMeeting"); office_ClientsHelper.WaitForWorkAround(3000); VisitOffice("documents"); office_ClientsHelper.WaitForWorkAround(3000); VerifyTitle("Documents"); executionLog.Log("ActivitiesDocumentManagement2", "Search document by name."); officeActivities_DocumentsHelper.TypeText("SearchDocumet", name); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement2", "Select All in owner field"); officeActivities_DocumentsHelper.SelectByText("OwnerField", "All"); officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement2", "Click on edit icon."); officeActivities_DocumentsHelper.ClickElement("EditDoc"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement2", "Select document related to."); officeActivities_DocumentsHelper.SelectByText("ReletedTo", "Client"); officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement2", "Click on find list icon."); officeActivities_DocumentsHelper.ClickElement("Assign"); officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement2", "Click on any task."); officeActivities_DocumentsHelper.ClickElement("AssignUser"); officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement2", "Click on Save button"); officeActivities_DocumentsHelper.ClickElement("Save"); executionLog.Log("ActivitiesDocumentManagement2", "Wait for success message."); officeActivities_DocumentsHelper.WaitForText("Document updated successfully.", 10); executionLog.Log("ActivitiesDocumentManagement2", "Redirect at tasks page."); VisitOffice("tasks"); executionLog.Log("ActivitiesDocumentManagement2", "Wait for locator to be present."); officeActivities_DocumentsHelper.WaitForElementPresent("OpenTask", 10); VisitOffice("documents"); office_ClientsHelper.WaitForWorkAround(3000); VerifyTitle("Documents"); executionLog.Log("ActivitiesDocumentManagement2", "Search document by name."); officeActivities_DocumentsHelper.TypeText("SearchDocumet", name); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement2", "Select All in owner field"); officeActivities_DocumentsHelper.SelectByText("OwnerField", "All"); officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement2", "Click on edit icon."); officeActivities_DocumentsHelper.ClickElement("EditDoc"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement2", "Click on add new version."); officeActivities_DocumentsHelper.ClickElement("NewVersion"); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement2", "Upload a valid File."); officeActivities_DocumentsHelper.Upload("BrowseAttachment", ValidFile); office_ClientsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement2", "Write a comment about version."); officeActivities_DocumentsHelper.TypeText("DocCommnet", "This is newly added version."); executionLog.Log("ActivitiesDocumentManagement2", "Click on save button."); officeActivities_DocumentsHelper.ClickElement("AddVersionSave"); executionLog.Log("ActivitiesDocumentManagement2", "Wait for success message."); officeActivities_DocumentsHelper.WaitForText("New Version File Uploaded successfully.", 10); executionLog.Log("ActivitiesDocumentManagement2", "Redirect to document page"); VisitOffice("documents"); executionLog.Log("ActivitiesDocumentManagement2", "Wait for locator to be present."); officeActivities_DocumentsHelper.WaitForElementPresent("SearchDocumet", 10); executionLog.Log("ActivitiesDocumentManagement2", "Search document by name."); officeActivities_DocumentsHelper.TypeText("SearchDocumet", name); officeActivities_DocumentsHelper.WaitForWorkAround(3000); officeActivities_DocumentsHelper.SelectByText("OwnerField", "All"); officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement2", "Click on Checkbox"); officeActivities_DocumentsHelper.ClickElement("CheckDocToDel"); executionLog.Log("ActivitiesDocumentManagement2", "Click on Delete button"); officeActivities_DocumentsHelper.ClickElement("DeleteDoc"); executionLog.Log("ActivitiesDocumentManagement2", "Acccept alert to delete doc."); officeActivities_DocumentsHelper.AcceptAlert(); officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement2", "Wait for success message."); officeActivities_DocumentsHelper.WaitForText("Document deleted successfully.", 20); executionLog.Log("ActivitiesDocumentManagement2", "Redirect at recyclebin page."); VisitOffice("documents/recyclebin"); executionLog.Log("ActivitiesDocumentManagement2", "Wait for locator to be present."); officeActivities_DocumentsHelper.WaitForElementPresent("DeleteRecycle", 10); executionLog.Log("ActivitiesDocumentManagement2", "Search document by name."); officeActivities_DocumentsHelper.TypeText("SearchDocumet", name); officeActivities_DocumentsHelper.WaitForWorkAround(3000); officeActivities_DocumentsHelper.SelectByText("OwnerField", "All"); officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement2", "Click on delete icon."); officeActivities_DocumentsHelper.ClickElement("DeleteRecycle"); officeActivities_DocumentsHelper.AcceptAlert(); officeActivities_DocumentsHelper.WaitForWorkAround(3000); executionLog.Log("ActivitiesDocumentManagement2", "Wait for success message.."); officeActivities_DocumentsHelper.WaitForText("Document Permanently Deleted.", 20); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ActivitiesDocumentManagement2"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Activities Document Management"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Activities Document Management", "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("Activities Document Management"); TakeScreenshot("ActivitiesDocumentManagement2"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ActivitiesDocumentManagement2.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ActivitiesDocumentManagement2"); string id = loginHelper.getIssueID("Activities Document Management"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ActivitiesDocumentManagement2.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Activities Document Management"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Activities Document Management"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ActivitiesDocumentManagement2"); executionLog.WriteInExcel("Activities Document Management", Status, JIRA, "Office Activities"); } }
public void documentManagement() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var officeActivities_DocumentHelper = new OfficeActivities_DocumentHelper(GetWebDriver()); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Variable var fileInvalid = GetPathToFile() + "Invalid.dll"; var file = GetPathToFile() + "index.jpg"; var Document = "New" + RandomNumber(99, 99999); var CDBA = "New" + RandomNumber(99, 99999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("DocumentManagement", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("DocumentManagement", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("DocumentManagement", "Visit Document"); VisitOffice("documents"); officeActivities_DocumentHelper.WaitForWorkAround(5000); executionLog.Log("DocumentManagement", "Click on Create Document"); officeActivities_DocumentHelper.ClickElement("ClickOnCreateDoc"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("DocumentManagement", "Document Name"); officeActivities_DocumentHelper.TypeText("Name", Document); executionLog.Log("DocumentManagement", "Upload Document"); officeActivities_DocumentHelper.UploadFile("//*[@id='DocumentFile']", file); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("DocumentManagement", "Click on Save button."); officeActivities_DocumentHelper.ClickElement("Save"); executionLog.Log("DocumentManagement", "Wait for Confirmation"); officeActivities_DocumentHelper.WaitForText("Document saved successfully.", 10); executionLog.Log("DocumentManagement", "Search Document"); officeActivities_DocumentHelper.TypeText("SearchDocumet", Document); officeActivities_DocumentHelper.WaitForWorkAround(2000); officeActivities_DocumentHelper.selectOwner("//*[@id='gs_first_name']"); officeActivities_DocumentHelper.WaitForWorkAround(6000); executionLog.Log("DocumentManagement", "Click on Edit"); officeActivities_DocumentHelper.ClickElement("EditDoc"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("DocumentManagement", "Click on Save"); officeActivities_DocumentHelper.ClickElement("Save"); executionLog.Log("DocumentManagement", "Verify Confirmation"); officeActivities_DocumentHelper.WaitForText("Document updated successfully.", 10); executionLog.Log("DocumentManagement", "Redirect at Documents page."); VisitOffice("documents"); officeActivities_DocumentHelper.WaitForWorkAround(5000); executionLog.Log("DocumentManagement", "Click on Create Document"); officeActivities_DocumentHelper.ClickElement("ClickOnCreateDoc"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("DocumentManagement", "Click on Save button."); officeActivities_DocumentHelper.ClickElement("Save"); executionLog.Log("DocumentManagement", "Wait for Validation"); officeActivities_DocumentHelper.WaitForText("This field is required.", 10); executionLog.Log("DocumentManagement", "Uplaod File"); officeActivities_DocumentHelper.UploadFile("//*[@id='DocumentFile']", fileInvalid); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("DocumentManagement", "Accept alert message."); officeActivities_DocumentHelper.AcceptAlert(); executionLog.Log("DocumentManagement", "Valiadtion please select a valid file"); officeActivities_DocumentHelper.WaitForText("please select a valid file", 10); executionLog.Log("DocumentManagement", "Accept alert message."); officeActivities_DocumentHelper.AcceptAlert(); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("DocumentManagement", "Click on Cancel"); officeActivities_DocumentHelper.ClickElement("DocumentCancelButton"); officeActivities_DocumentHelper.WaitForWorkAround(3000); officeActivities_DocumentHelper.VerifyText("VerifyDocumentHeader", "Documents"); officeActivities_DocumentHelper.WaitForWorkAround(1000); executionLog.Log("DocumentManagement", "Redirect at documents page."); VisitOffice("documents"); officeActivities_DocumentHelper.WaitForWorkAround(5000); executionLog.Log("DocumentManagement", "Click on first document"); officeActivities_DocumentHelper.ClickElement("DocumentClick"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("DocumentManagement", "Add Version"); officeActivities_DocumentHelper.ClickElement("AddVersion"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("DocumentManagement", "Uplaod"); officeActivities_DocumentHelper.UploadFile("//*[@id='DocumentFile']", file); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("DocumentManagement", "Add Comment"); officeActivities_DocumentHelper.TypeText("AddComment", "Test Comment"); executionLog.Log("DocumentManagement", "Click on Save"); officeActivities_DocumentHelper.ClickElement("AddVersionSave"); executionLog.Log("DocumentManagement", "Wait for Confirmation"); officeActivities_DocumentHelper.WaitForText("New Version File Uploaded successfully.", 10); executionLog.Log("DocumentManagement", "Click on Delete"); officeActivities_DocumentHelper.ClickElement("DeleteVersion"); officeActivities_DocumentHelper.AcceptAlert(); executionLog.Log("DocumentManagement", "Confirmation"); officeActivities_DocumentHelper.WaitForText("Document Version Deleted Permanently.", 10); executionLog.Log("DocumentManagement", "Goto Document"); VisitOffice("documents"); officeActivities_DocumentHelper.WaitForWorkAround(5000); executionLog.Log("DocumentManagement", "Search Documet"); officeActivities_DocumentHelper.TypeText("SearchDocumet", Document); officeActivities_DocumentHelper.selectOwner("//*[@id='gs_first_name']"); officeActivities_DocumentHelper.WaitForWorkAround(4000); executionLog.Log("DocumentManagement", "Click on Check box for first document"); officeActivities_DocumentHelper.ClickElement("ClickOnCheckBox"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("DocumentManagement", "Click Delete"); officeActivities_DocumentHelper.ClickElement("DeleteDocument"); officeActivities_DocumentHelper.AcceptAlert(); executionLog.Log("DocumentManagement", "Confirmaion"); officeActivities_DocumentHelper.WaitForText("Document deleted successfully.", 10); executionLog.Log("DocumentManagement", "Redirect at Recycle bin"); VisitOffice("documents/recyclebin"); executionLog.Log("DocumentManagement", "Search Document"); officeActivities_DocumentHelper.TypeText("SearchDocumet", Document); officeActivities_DocumentHelper.selectOwner("//*[@id='gs_first_name']"); officeActivities_DocumentHelper.WaitForWorkAround(4000); executionLog.Log("DocumentManagement", "Restore Document"); officeActivities_DocumentHelper.ClickElement("RestoredDoc"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("DocumentManagement", "Confirmation"); officeActivities_DocumentHelper.WaitForText("Document Restored Successfully.", 10); executionLog.Log("DocumentManagement", "Goto Document"); VisitOffice("documents"); officeActivities_DocumentHelper.WaitForWorkAround(5000); executionLog.Log("DocumentManagement", "Search Document"); officeActivities_DocumentHelper.TypeText("SearchDocumet", Document); officeActivities_DocumentHelper.selectOwner("//*[@id='gs_first_name']"); officeActivities_DocumentHelper.WaitForWorkAround(4000); executionLog.Log("DocumentManagement", "Select document"); officeActivities_DocumentHelper.ClickElement("CheckDocToDel"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("DocumentManagement", "Click on Delete"); officeActivities_DocumentHelper.ClickElement("DeleteDocument"); officeActivities_DocumentHelper.AcceptAlert(); executionLog.Log("DocumentManagement", "Wait for Confirmation"); officeActivities_DocumentHelper.WaitForText("Document deleted successfully.", 10); executionLog.Log("DocumentManagement", "Redirect at Recycle bin"); VisitOffice("documents/recyclebin"); officeActivities_DocumentHelper.WaitForWorkAround(5000); executionLog.Log("DocumentManagement", "Search Document"); officeActivities_DocumentHelper.TypeText("SearchDocumet", Document); officeActivities_DocumentHelper.selectOwner("//*[@id='gs_first_name']"); officeActivities_DocumentHelper.WaitForWorkAround(4000); executionLog.Log("DocumentManagement", "Delete From Recycle bin"); officeActivities_DocumentHelper.ClickElement("DeleteRecycleBin"); officeActivities_DocumentHelper.AcceptAlert(); executionLog.Log("DocumentManagement", "Wait for Confirmation"); officeActivities_DocumentHelper.WaitForText("Document Permanently Deleted.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("DocumentManagement"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("DocumentManagement"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("DocumentManagement", "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("DocumentManagement"); TakeScreenshot("DocumentManagement"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\DocumentManagement.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("DocumentManagement"); string id = loginHelper.getIssueID("DocumentManagement"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\DocumentManagement.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("DocumentManagement"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("DocumentManagement"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("DocumentManagement"); executionLog.WriteInExcel("DocumentManagement", Status, JIRA, "Office Activities."); } }
public void documentVersionError() { 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 officeActivities_DocumentHelper = new OfficeActivities_DocumentHelper(GetWebDriver()); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("DocumentVersionError", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("DocumentVersionError", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("DocumentVersionError", "Redirect To Document"); VisitOffice("documents/create"); executionLog.Log("DocumentVersionError", "Verify title"); VerifyTitle("Create a New Document"); executionLog.Log("DocumentVersionError", "Verify version is set to 1"); string value = officeActivities_DocumentHelper.getFiledText("DocumentVersion"); Assert.IsTrue(value.Contains("1")); executionLog.Log("DocumentVersionError", "Redirect To Document"); VisitOffice("documents"); executionLog.Log("DocumentVersionError", "Verify title"); VerifyTitle("Documents"); executionLog.Log("DocumentVersionError", "Edit first doc"); officeActivities_DocumentHelper.ClickElement("EditDoc"); executionLog.Log("DocumentVersionError", "Verify title"); VerifyTitle("Edit Document"); executionLog.Log("DocumentVersionError", "Verify document version is not user editable"); Console.WriteLine("CHECK = " + officeActivities_DocumentHelper.GetAtrributeByLocator("//*[@id='DocumentVersion']", "readonly")); Assert.IsTrue(officeActivities_DocumentHelper.GetAtrributeByLocator("//*[@id='DocumentVersion']", "readonly").Contains("true")); executionLog.Log("DocumentVersionError", "Click on Add new version"); officeActivities_DocumentHelper.ClickElement("NewVersion"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("DocumentVersionError", "Upload file"); officeActivities_DocumentHelper.UploadFile("//*[@id='DocumentFile']", GetPathToFile() + "2.pdf"); executionLog.Log("DocumentVersionError", "Enter comment"); officeActivities_DocumentHelper.TypeText("DocCommnet", "Comment"); executionLog.Log("DocumentVersionError", "Click on Save button"); officeActivities_DocumentHelper.ClickElement("EditSave"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("DocumentVersionError", "Verify added version is not deletable"); officeActivities_DocumentHelper.verifyVersionNotDeletable(); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("DocumentVersionError"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Document Version Error"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Document Version Error", "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("Document Version Error"); TakeScreenshot("DocumentVersionError"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\DocumentVersionError.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("DocumentVersionError"); string id = loginHelper.getIssueID("Document Version Error"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\DocumentVersionError.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Document Version Error"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Document Version Error"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("DocumentVersionError"); executionLog.WriteInExcel("Document Version Error", Status, JIRA, "Office Activities"); } }
public void verifyLeadPDFTabError() { string[] username = null; string[] password = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var office_LeadsHelper = new Office_LeadsHelper(GetWebDriver()); var officeActivities_DocumentHelper = new OfficeActivities_DocumentHelper(GetWebDriver()); var officeActivities_CallsHelper = new OfficeActivities_CallsHelper(GetWebDriver()); username = oXMLData.getData("settings/Credentials", "username_office"); password = oXMLData.getData("settings/Credentials", "password"); // Variable var FName = "Test" + RandomNumber(99, 99999); var LName = "Test" + RandomNumber(99, 99999); var CDBA = "New" + RandomNumber(99, 99999); var doc = "Docname" + RandomNumber(99, 9999); var file = GetPathToFile() + "Up.jpg"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyLeadPDFTabError", "Login with valid credentials"); Login(username[0], password[0]); executionLog.Log("VerifyLeadPDFTabError", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyLeadPDFTabError", "Redirect at Create Lead"); VisitOffice("leads/create"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLeadPDFTabError", "Enter First Name"); office_LeadsHelper.TypeText("FirstNameLead", FName); executionLog.Log("VerifyLeadPDFTabError", "Enter Last Name"); office_LeadsHelper.TypeText("LeadLastName", LName); executionLog.Log("VerifyLeadPDFTabError", "Enter Lead Company DBA Name"); office_LeadsHelper.TypeText("CompanyName", CDBA); executionLog.Log("VerifyLeadPDFTabError", "Wait for element to be visible."); office_LeadsHelper.WaitForElementPresent("LeadStatus", 10); executionLog.Log("VerifyLeadPDFTabError", "Select Lead Status"); office_LeadsHelper.SelectByText("LeadStatus", "New"); executionLog.Log("VerifyLeadPDFTabError", "Select Responsibilities"); office_LeadsHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("VerifyLeadPDFTabError", "Click on Save"); office_LeadsHelper.ClickElement("SaveLeadNewSkin"); office_LeadsHelper.WaitForWorkAround(3000); var loc = "//h3[text()='Existing Leads']"; if (office_LeadsHelper.IsElementPresent(loc)) { Console.WriteLine("We are in first If cond as lead is duplicate !!"); executionLog.Log("VerifyLeadPDFTabError", "Click on Duplicate"); office_LeadsHelper.ClickOnDisplayed("CraeteLeadDub"); office_LeadsHelper.WaitForText("Lead saved successfully.", 10); executionLog.Log("VerifyLeadPDFTabError", "Redirect at leads page."); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLeadPDFTabError", "Verify page title as leads."); VerifyTitle("Leads"); executionLog.Log("VerifyLeadPDFTabError", "Dearch lead by company name."); office_LeadsHelper.TypeText("CompanySearch", CDBA); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyLeadPDFTabError", "Click to view searched lead."); office_LeadsHelper.ClickElement("Lead1"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLeadPDFTabError", "Go to PDF Tab"); office_LeadsHelper.ClickElement("PDFTab"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLeadPDFTabError", "Click on Add Document"); office_LeadsHelper.ClickElement("AddDocument"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyLeadPDFTabError", "Enter document name"); officeActivities_DocumentHelper.TypeText("Name", doc); executionLog.Log("VerifyLeadPDFTabError", "Upload file"); officeActivities_DocumentHelper.Upload("Attachment", file); officeActivities_DocumentHelper.WaitForWorkAround(1000); executionLog.Log("VerifyLeadPDFTabError", "Click Save button"); officeActivities_DocumentHelper.ClickElement("ClientPopupSave"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("VerifyLeadPDFTabError", "Verify 500 Error not occured"); office_LeadsHelper.verifyElementPresent("AddDocument"); executionLog.Log("VerifyLeadPDFTabError", "Click on Log a Call"); office_LeadsHelper.ClickElement("LogACall"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyLeadPDFTabError", "Enter from name"); officeActivities_CallsHelper.TypeText("CallFromName", "test1"); executionLog.Log("VerifyLeadPDFTabError", "Enter to name"); officeActivities_CallsHelper.TypeText("CallToName", "test2"); executionLog.Log("VerifyLeadPDFTabError", "Enter from number"); officeActivities_CallsHelper.TypeText("FromNumber", "4584698569"); executionLog.Log("VerifyLeadPDFTabError", "Enter to number"); officeActivities_CallsHelper.TypeText("CallTONumber", "6984589652"); executionLog.Log("VerifyLeadPDFTabError", "Click on Save button"); officeActivities_CallsHelper.ClickElement("PopupSave"); officeActivities_CallsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyLeadPDFTabError", "Verify 500 Error not occured"); office_LeadsHelper.verifyElementPresent("AddDocument"); } else { Console.WriteLine("We are in first else cond as lead is not duplicate !!"); executionLog.Log("VerifyLeadPDFTabError", "Wait for Confirmation"); office_LeadsHelper.WaitForText("Lead saved successfully.", 10); executionLog.Log("VerifyLeadPDFTabError", "Redirect at leads page."); VisitOffice("leads"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLeadPDFTabError", "Verify page title as leads."); VerifyTitle("Leads"); executionLog.Log("VerifyLeadPDFTabError", "Dearch lead by company name."); office_LeadsHelper.TypeText("CompanySearch", CDBA); office_LeadsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyLeadPDFTabError", "Click to view searched lead."); office_LeadsHelper.ClickElement("Lead1"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLeadPDFTabError", "Go to PDF Tab"); office_LeadsHelper.ClickElement("PDFTab"); office_LeadsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyLeadPDFTabError", "Click on Add Document"); office_LeadsHelper.ClickElement("AddDocument"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyLeadPDFTabError", "Enter document name"); officeActivities_DocumentHelper.TypeText("Name", doc); executionLog.Log("VerifyLeadPDFTabError", "Upload file"); officeActivities_DocumentHelper.Upload("Attachment", file); officeActivities_DocumentHelper.WaitForWorkAround(1000); executionLog.Log("VerifyLeadPDFTabError", "Click Save button"); officeActivities_DocumentHelper.ClickElement("ClientPopupSave"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("VerifyLeadPDFTabError", "Verify 500 Error not occured"); office_LeadsHelper.verifyElementPresent("AddDocument"); executionLog.Log("VerifyLeadPDFTabError", "Click on Log a Call"); office_LeadsHelper.ClickElement("LogACall"); office_LeadsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyLeadPDFTabError", "Enter from name"); officeActivities_CallsHelper.TypeText("CallFromName", "test1"); executionLog.Log("VerifyLeadPDFTabError", "Enter to name"); officeActivities_CallsHelper.TypeText("CallToName", "test2"); executionLog.Log("VerifyLeadPDFTabError", "Enter from number"); officeActivities_CallsHelper.TypeText("FromNumber", "4584698569"); executionLog.Log("VerifyLeadPDFTabError", "Enter to number"); officeActivities_CallsHelper.TypeText("CallTONumber", "6984589652"); executionLog.Log("VerifyLeadPDFTabError", "Click on Save button"); officeActivities_CallsHelper.ClickElement("PopupSave"); officeActivities_CallsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyLeadPDFTabError", "Verify 500 Error not occured"); office_LeadsHelper.verifyElementPresent("AddDocument"); } } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyLeadPDFTabError"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("VerifyLeadPDFTabError"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("VerifyLeadPDFTabError", "Bug", "Medium", "Leads page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("VerifyLeadPDFTabError"); TakeScreenshot("VerifyLeadPDFTabError"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\Verify Lead PDF Tab Error.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyLeadPDFTabError"); string id = loginHelper.getIssueID("VerifyLeadPDFTabError"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\Verify Lead PDF Tab Error.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("VerifyLeadPDFTabError"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("VerifyLeadPDFTabError"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("LeadCreateAndViewIssue"); executionLog.WriteInExcel("LeadCreateAndViewIssue", Status, JIRA, "Leads Management"); } }
public void uniqueDocError() { 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_ClientsHelper = new Office_ClientsHelper(GetWebDriver()); var officeActivities_DocumentHelper = new OfficeActivities_DocumentHelper(GetWebDriver()); try { executionLog.Log("UniqueDocError", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("UniqueDocError", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("UniqueDocError", "Redirect To create Document page"); VisitOffice("documents/create"); executionLog.Log("UniqueDocError", "Verify title"); VerifyTitle("Create a New Document"); executionLog.Log("UniqueDocError", "ClickOnCreate"); officeActivities_DocumentHelper.TypeText("Name", "Doc1"); string pathtofile = GetPathToFile() + "Upload1.pdf"; executionLog.Log("UniqueDocError", "Attach File"); officeActivities_DocumentHelper.UploadFile("//*[@id='DocumentFile']", pathtofile); executionLog.Log("UniqueDocError", "Select releted to"); officeActivities_DocumentHelper.SelectByText("ReletedTo", "Client"); executionLog.Log("UniqueDocError", "Select Client"); officeActivities_DocumentHelper.ClickElement("Assign"); officeActivities_DocumentHelper.WaitForWorkAround(4000); officeActivities_DocumentHelper.ClickElement("AssignUser"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("UniqueDocError", "Click on Save"); officeActivities_DocumentHelper.ClickElement("Save"); executionLog.Log("UniqueDocError", "Wait for success message."); officeActivities_DocumentHelper.WaitForText("Document saved successfully.", 10); executionLog.Log("UniqueDocError", "Redirect To Document"); VisitOffice("documents/create"); executionLog.Log("UniqueDocError", "Verify title"); VerifyTitle("Create a New Document"); executionLog.Log("UniqueDocError", "ClickOnCreate"); officeActivities_DocumentHelper.TypeText("Name", "Doc2"); pathtofile = GetPathToFile() + "Upload2.pdf"; executionLog.Log("UniqueDocError", "Attach File"); officeActivities_DocumentHelper.UploadFile("//*[@id='DocumentFile']", pathtofile); executionLog.Log("UniqueDocError", "Select releted to"); officeActivities_DocumentHelper.SelectByText("ReletedTo", "Client"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("UniqueDocError", "Select Client"); officeActivities_DocumentHelper.ClickElement("Assign"); officeActivities_DocumentHelper.WaitForWorkAround(4000); officeActivities_DocumentHelper.ClickElement("AssignUser"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("UniqueDocError", "Click on Save"); officeActivities_DocumentHelper.ClickElement("Save"); executionLog.Log("UniqueDocError", "Wait for success message."); officeActivities_DocumentHelper.WaitForText("Document saved successfully.", 10); executionLog.Log("UniqueDocError", "Verify page title."); VerifyTitle("Documents"); executionLog.Log("UniqueDocError", "Redirect To Document"); VisitOffice("documents/create"); executionLog.Log("UniqueDocError", "ClickOnCreate"); officeActivities_DocumentHelper.TypeText("Name", "Doc3"); pathtofile = GetPathToFile() + "Upload3.pdf"; executionLog.Log("UniqueDocError", "Attach File"); officeActivities_DocumentHelper.UploadFile("//*[@id='DocumentFile']", pathtofile); executionLog.Log("UniqueDocError", "Select releted to"); officeActivities_DocumentHelper.SelectByText("ReletedTo", "Client"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("UniqueDocError", "Select Client"); officeActivities_DocumentHelper.ClickElement("Assign"); officeActivities_DocumentHelper.WaitForWorkAround(4000); officeActivities_DocumentHelper.ClickElement("AssignUser"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("UniqueDocError", "Click on Save"); officeActivities_DocumentHelper.ClickElement("Save"); executionLog.Log("UniqueDocError", "Wait for success message."); officeActivities_DocumentHelper.WaitForText("Document saved successfully.", 10); executionLog.Log("UniqueDocError", "Go to client page"); VisitOffice("clients"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("UniqueDocError", "Verify title"); VerifyTitle(); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("UniqueDocError", "Open the client"); office_ClientsHelper.ClickElement("Client1"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("UniqueDocError", "Click on info"); office_ClientsHelper.ClickElement("Info"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("UniqueDocError", "Verify title"); VerifyTitle("- Details"); officeActivities_DocumentHelper.WaitForWorkAround(2000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("UniqueDocError"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Unique Doc Error"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Unique Doc Error", "Bug", "Medium", "Documents page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Unique Doc Error"); TakeScreenshot("UniqueDocError"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\UniqueDocError.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("UniqueDocError"); string id = loginHelper.getIssueID("Unique Doc Error"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\UniqueDocError.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Unique Doc Error"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Unique Doc Error"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("UniqueDocError"); executionLog.WriteInExcel("Unique Doc Error", Status, JIRA, "Office Activities"); } }