public void verifyDocumentDisplayedColumnIssue() { 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 String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyDocumentDisplayedColumnIssue", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyDocumentDisplayedColumnIssue", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyDocumentDisplayedColumnIssue", "Redirect To URL"); VisitOffice("documents"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentDisplayedColumnIssue", "Verify page title."); VerifyTitle("Documents"); executionLog.Log("VerifyDocumentDisplayedColumnIssue", "Click on advance filter."); officeActivities_DocumentHelper.ClickElement("AdvanceFilter"); officeActivities_DocumentHelper.WaitForWorkAround(2000); executionLog.Log("VerifyDocumentDisplayedColumnIssue", "Get text of all the displayed columns."); var text = officeActivities_DocumentHelper.GetTextByXpath("//*[@id='display_cols']"); //officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentDisplayedColumnIssue", "Print all column names on thr console."); Console.WriteLine(text); //officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentDisplayedColumnIssue", "Verify owner column present in displayed column."); Assert.IsTrue(text.Contains("Owner")); //officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentDisplayedColumnIssue", "Verify modified column present in displayed column."); Assert.IsTrue(text.Contains("Modified")); //officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentDisplayedColumnIssue", "Redirect To URL"); VisitOffice("documents"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentDisplayedColumnIssue", "Verify page title."); VerifyTitle("Documents"); executionLog.Log("VerifyDocumentDisplayedColumnIssue", "Verify owner column is visible on the page."); officeActivities_DocumentHelper.IsElementPresent("HeadOwner"); //officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentDisplayedColumnIssue", "Verify Modified column is visible on the page."); officeActivities_DocumentHelper.IsElementPresent("HeadModified"); //officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentDisplayedColumnIssue", "Logout from the application."); VisitCorp("logout"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyDocumentDisplayedColumnIssue"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Document Displayed Column Issue"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Document Displayed Column Issue", "Bug", "Medium", "Activities page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Document Displayed Column Issue"); TakeScreenshot("VerifyDocumentDisplayedColumnIssue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyDocumentDisplayedColumnIssue.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyDocumentDisplayedColumnIssue"); string id = loginHelper.getIssueID("Verify Document Displayed Column Issue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyDocumentDisplayedColumnIssue.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Document Displayed Column Issue"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Document Displayed Column Issue"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyDocumentDisplayedColumnIssue"); executionLog.WriteInExcel("Verify Document Displayed Column Issue", Status, JIRA, "Tasks Management"); } }
public void verifyDocumentsAdvanceFilerColumnOrder() { 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 String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Redirect To URL"); VisitOffice("documents"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Verify page title."); VerifyTitle("Documents"); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Verify status column is visible on the page.."); officeActivities_DocumentHelper.IsElementPresent("HeadStatus"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Verify created column is visible on the page."); officeActivities_DocumentHelper.IsElementPresent("HeadCreated"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Verify owner column is visible on the page."); officeActivities_DocumentHelper.IsElementPresent("HeadOwner"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Verify Modified column is visible on the page."); officeActivities_DocumentHelper.IsElementPresent("HeadModified"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Click on advance filter."); officeActivities_DocumentHelper.ClickElement("AdvanceFilter"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Select status in displayed columns."); officeActivities_DocumentHelper.SelectByText("DisplayedCols", "Status"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Click arrow to move column to avail cols."); officeActivities_DocumentHelper.ClickElement("RemoveCols"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Select created in displayed columns."); officeActivities_DocumentHelper.SelectByText("DisplayedCols", "Created"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Click arrow to move column to avail cols"); officeActivities_DocumentHelper.ClickElement("RemoveCols"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Select owner in displayed columns."); officeActivities_DocumentHelper.SelectByText("DisplayedCols", "Owner"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Click arrow to move column to avail cols"); officeActivities_DocumentHelper.ClickElement("RemoveCols"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Select Modified in displayed columns."); officeActivities_DocumentHelper.SelectByText("DisplayedCols", "Modified"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Click arrow to move column to avail cols"); officeActivities_DocumentHelper.ClickElement("RemoveCols"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Click on apply button."); officeActivities_DocumentHelper.ClickElement("Apply"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Verify status not present on page."); officeActivities_DocumentHelper.IsElementNotPresent("HeadStatus"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Verify created not present on page."); officeActivities_DocumentHelper.IsElementNotPresent("HeadCreated"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Verify owner not present on page."); officeActivities_DocumentHelper.IsElementNotPresent("HeadOwner"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Verify Modified not present on page."); officeActivities_DocumentHelper.IsElementNotPresent("HeadModified"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Redirect at leads page."); VisitOffice("leads"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Verify page title as leads."); VerifyTitle("Leads"); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Redirect at documents page."); VisitOffice("documents"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Verify page title as documents"); VerifyTitle("Documents"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Verify default position of status column."); officeActivities_DocumentHelper.IsElementPresent("HeadStatus5"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Verify default position of owner column."); officeActivities_DocumentHelper.IsElementPresent("HeadOwner6"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Redirect at documents page."); VisitOffice("documents"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Click on advance filter."); officeActivities_DocumentHelper.ClickElement("AdvanceFilter"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Select status in displayed column."); officeActivities_DocumentHelper.SelectByText("DisplayedCols", "Status"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Move status 1 step up."); officeActivities_DocumentHelper.ClickElement("MoveUp"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Move status 1 step up."); officeActivities_DocumentHelper.ClickElement("MoveUp"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Move status 1 step up."); officeActivities_DocumentHelper.ClickElement("MoveUp"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Select owner in displayed column."); officeActivities_DocumentHelper.SelectByText("DisplayedCols", "Owner"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Move owner 1 step down."); officeActivities_DocumentHelper.ClickElement("MoveDown"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Click on apply button."); officeActivities_DocumentHelper.ClickElement("Apply"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Verify changed position of status column."); officeActivities_DocumentHelper.IsElementPresent("HeadStatus3"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Verify changed position of owner column."); officeActivities_DocumentHelper.IsElementPresent("HeadOwner7"); officeActivities_DocumentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDocumentsAdvanceFilerColumnOrder", "Logout from the application."); VisitCorp("logout"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyDocumentsAdvanceFilerColumnOrder"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Documents Advance Filer Column Order"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Documents Advance Filer Column Order", "Bug", "Medium", "Activities page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Documents Advance Filer Column Order"); TakeScreenshot("VerifyDocumentsAdvanceFilerColumnOrder"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyDocumentsAdvanceFilerColumnOrder.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyDocumentsAdvanceFilerColumnOrder"); string id = loginHelper.getIssueID("Verify Documents Advance Filer Column Order"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyDocumentsAdvanceFilerColumnOrder.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Documents Advance Filer Column Order"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Documents Advance Filer Column Order"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyDocumentsAdvanceFilerColumnOrder"); executionLog.WriteInExcel("Verify Documents Advance Filer Column Order", Status, JIRA, "Tasks Management"); } }