public void verifyAstrick() { string[] username = null; string[] password = null; string[] log = null; var oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); String JIRA = ""; String Status = "Pass"; username = oXMLData.getData("settings/Credentials", "username_corp"); password = oXMLData.getData("settings/Credentials", "password"); log = oXMLData.getData("settings/URL", "logout"); // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var corpOffice_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver()); var corp_EmployeeHelper = new Corp_EmployeeHelper(GetWebDriver()); try { executionLog.Log("VerifyAstrick", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyAstrick", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyAstrick", "Visit to Create office page"); VisitCorp("offices/create"); executionLog.Log("VerifyAstrick", "Verify title"); VerifyTitle("Create an Office"); executionLog.Log("VerifyAstrick", "Verify astric is present"); corpOffice_OfficeHelper.verifyElementPresent("Astric"); executionLog.Log("VerifyAstrick", "Go to create employee page"); VisitCorp("employees/create"); executionLog.Log("VerifyAstrick", "Verify astric is present."); corp_EmployeeHelper.verifyElementPresent("Astric"); executionLog.Log("VerifyAstrick", "Log out from the application"); VisitCorp("logout"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyAstrick"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Astrick"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Astrick", "Bug", "Medium", "Corp Office page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Astrick"); TakeScreenshot("VerifyAstrick"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyAstrick.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyAstrick"); string id = loginHelper.getIssueID("Verify Astrick"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyAstrick.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Astrick"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Astrick"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyAstrick"); executionLog.WriteInExcel("Verify Astrick", Status, JIRA, "Corp Office"); } }