public void verifyDeletedTicketDisappearUnderMerchant() { 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_MerchantHelper = new Office_ClientsHelper(GetWebDriver()); var officeticketsHelper = new OfficeTickets_CreateTicketsHelper(GetWebDriver()); var DBA = "ClientDBA" + RandomNumber(1, 5000); var ticketname = "Testticket" + RandomNumber(1, 500); // Variable random String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyDeletedTicketDisappearUnderMerchant", "Login with valid username and password"); Login(username[0], password[0]); executionLog.Log("VerifyDeletedTicketDisappearUnderMerchant", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("VerifyDeletedTicketDisappearUnderMerchant", "Redirect to Create merchant page"); VisitOffice("clients/create"); office_MerchantHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDeletedTicketDisappearUnderMerchant", "Enter DBA name"); office_MerchantHelper.TypeText("ClientDBAName", DBA); executionLog.Log("VerifyDeletedTicketDisappearUnderMerchant", "Select the client status"); office_MerchantHelper.SelectByText("Status", "New"); executionLog.Log("VerifyDeletedTicketDisappearUnderMerchant", "select the responsibity"); office_MerchantHelper.SelectByText("Responsibility", "Howard Tang"); executionLog.Log("VerifyDeletedTicketDisappearUnderMerchant", "Click on save btn"); office_MerchantHelper.ClickElement("Save"); office_MerchantHelper.WaitForWorkAround(4000); executionLog.Log("VerifyDeletedTicketDisappearUnderMerchant", "Click Create Ticket button"); office_MerchantHelper.ClickForce("CreateTicket"); office_MerchantHelper.WaitForWorkAround(1000); executionLog.Log("VerifyDeletedTicketDisappearUnderMerchant", "Enter Subject name"); officeticketsHelper.TypeText("TicketName", ticketname); executionLog.Log("VerifyDeletedTicketDisappearUnderMerchant", "Select Status"); officeticketsHelper.SelectByText("TickStatus", "New"); executionLog.Log("VerifyDeletedTicketDisappearUnderMerchant", "Select Assigned To"); officeticketsHelper.SelectByText("Assignedto", "Howard Tang"); executionLog.Log("VerifyDeletedTicketDisappearUnderMerchant", "Click on save btn"); officeticketsHelper.ClickElement("Save1"); officeticketsHelper.WaitForWorkAround(4000); executionLog.Log("VerifyDeletedTicketDisappearUnderMerchant", "Redirect to All merchants page"); VisitOffice("clients"); office_MerchantHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDeletedTicketDisappearUnderMerchant", "Search merchant by name"); office_MerchantHelper.TypeText("SearchClient", DBA); office_MerchantHelper.WaitForWorkAround(2000); executionLog.Log("VerifyDeletedTicketDisappearUnderMerchant", "Click on client"); office_MerchantHelper.ClickElement("Client1"); office_MerchantHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDeletedTicketDisappearUnderMerchant", "Click on created ticket"); office_MerchantHelper.ClickForce("Ticket1"); office_MerchantHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDeletedTicketDisappearUnderMerchant", "Click on Delete button"); officeticketsHelper.ClickElement("ClickDeleteBtn"); officeticketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyDeletedTicketDisappearUnderMerchant", "Redirect to All merchants page"); VisitOffice("clients"); office_MerchantHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDeletedTicketDisappearUnderMerchant", "Search merchant by name"); office_MerchantHelper.TypeText("SearchClient", DBA); office_MerchantHelper.WaitForWorkAround(2000); executionLog.Log("VerifyDeletedTicketDisappearUnderMerchant", "Click on client"); office_MerchantHelper.ClickElement("Client1"); office_MerchantHelper.WaitForWorkAround(5000); executionLog.Log("VerifyDeletedTicketDisappearUnderMerchant", "Verify ticket disappeared"); office_MerchantHelper.VerifyText("NoTickets", "No Data Available."); Console.WriteLine("Deleted ticket disappeared"); office_MerchantHelper.WaitForWorkAround(1000); VisitOffice("clients"); office_MerchantHelper.WaitForWorkAround(3000); executionLog.Log("VerifyDeletedTicketDisappearUnderMerchant", "Search the company Name"); office_MerchantHelper.TypeText("SearchClient", DBA); office_MerchantHelper.WaitForWorkAround(2000); executionLog.Log("VerifyDeletedTicketDisappearUnderMerchant", "Click on check box"); office_MerchantHelper.ClickElement("ClickOnCheckBox"); executionLog.Log("VerifyDeletedTicketDisappearUnderMerchant", "Delete the client"); office_MerchantHelper.ClickElement("DeleteClient"); office_MerchantHelper.AcceptAlert(); office_MerchantHelper.WaitForWorkAround(4000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyDeletedTicketDisappearUnderMerchant"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Deleted Ticket Disappear Under Merchant"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Deleted Ticket Disappear Under Merchant", "Bug", "Medium", "Office Merchant page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify Deleted Ticket Disappear Under Merchant"); TakeScreenshot("VerifyDeletedTicketDisappearUnderMerchant"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyDeletedTicketDisappearUnderMerchant.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyDeletedTicketDisappearUnderMerchant"); string id = loginHelper.getIssueID("Verify Deleted Ticket Disappear Under Merchant"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyDeletedTicketDisappearUnderMerchant.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Deleted Ticket Disappear Under Merchant"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Deleted Ticket Disappear Under Merchant"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyDeletedTicketDisappearUnderMerchant"); executionLog.WriteInExcel("Verify Deleted Ticket Disappear Under Merchant", Status, JIRA, "Office Merchant"); } }
public void verifyTicketsBulkUpdates() { 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 officeTickets_CreateTicketsHelper = new OfficeTickets_CreateTicketsHelper(GetWebDriver()); // Random Variables. var TickName = "Ticket" + RandomNumber(666, 9999); var Ticket2 = "Ticket2" + RandomNumber(333, 9999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyTicketsBulkUpdates", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyTicketsBulkUpdates", "Verify Page title"); VerifyTitle("Dashboard"); //officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Redirect To Tickets"); VisitOffice("tickets/create"); officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyTicketsBulkUpdates", "Verify page title."); VerifyTitle("Create a Ticket"); //officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyTicketsBulkUpdates", "Click on Save"); officeTickets_CreateTicketsHelper.ClickElement("ClickOnSaveTicket"); //officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Verify validation text for name"); officeTickets_CreateTicketsHelper.VerifyText("TickNameErr", "This field is required."); executionLog.Log("VerifyTicketsBulkUpdates", "Verify validation text for assignee."); officeTickets_CreateTicketsHelper.VerifyText("TickParentErr", "This field is required."); executionLog.Log("VerifyTicketsBulkUpdates", "Enter Ticket Name"); officeTickets_CreateTicketsHelper.TypeText("TicketName", TickName); executionLog.Log("VerifyTicketsBulkUpdates", "Click On Client Display Icon"); officeTickets_CreateTicketsHelper.ClickElement("ClientDisplayIcon"); officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "ClickOnClient"); officeTickets_CreateTicketsHelper.ClickElement("ClickOnClient"); officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Select client status."); officeTickets_CreateTicketsHelper.SelectByText("TickStatus", "Resolved"); //officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Click on Save"); officeTickets_CreateTicketsHelper.ClickElement("ClickOnSaveTicket"); executionLog.Log("VerifyTicketsBulkUpdates", "Wait text Ticket Created Successfully."); officeTickets_CreateTicketsHelper.WaitForText("Ticket Created Successfully.", 05); executionLog.Log("VerifyTicketsBulkUpdates", "Redirect To Tickets"); VisitOffice("tickets/create"); officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyTicketsBulkUpdates", "Verify page title."); VerifyTitle("Create a Ticket"); //officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyTicketsBulkUpdates", "Click on Save"); officeTickets_CreateTicketsHelper.ClickElement("ClickOnSaveTicket"); //officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Verify validation text for name"); officeTickets_CreateTicketsHelper.VerifyText("TickNameErr", "This field is required."); //officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Verify validation text for assignee."); officeTickets_CreateTicketsHelper.VerifyText("TickParentErr", "This field is required."); //officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyTicketsBulkUpdates", "Enter Ticket Name"); officeTickets_CreateTicketsHelper.TypeText("TicketName", Ticket2); //officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyTicketsBulkUpdates", "Select client status."); officeTickets_CreateTicketsHelper.SelectByText("TickStatus", "Resolved"); //officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyTicketsBulkUpdates", "Click On Client Display Icon"); officeTickets_CreateTicketsHelper.ClickElement("ClientDisplayIcon"); officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "ClickOnClient"); officeTickets_CreateTicketsHelper.ClickElement("ClickOnClient"); officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Click on Save"); officeTickets_CreateTicketsHelper.ClickElement("ClickOnSaveTicket"); officeTickets_CreateTicketsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyTicketsBulkUpdates", "Wait text Ticket Created Successfully."); officeTickets_CreateTicketsHelper.WaitForText("Ticket Created Successfully.", 05); executionLog.Log("VerifyTicketsBulkUpdates", "Redirect To Tickets"); VisitOffice("tickets"); officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyTicketsBulkUpdates", "Verify page title."); VerifyTitle("Tickets"); //officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); //executionLog.Log("VerifyTicketsBulkUpdates", "Wait for locator to present."); //officeTickets_CreateTicketsHelper.WaitForElementPresent("BulkUpdate", 30); executionLog.Log("VerifyTicketsBulkUpdates", "Click on bulk update."); officeTickets_CreateTicketsHelper.ClickElement("BulkUpdate"); officeTickets_CreateTicketsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyTicketsBulkUpdates", "Click to update status"); officeTickets_CreateTicketsHelper.ClickElement("ChangeStatus"); officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Verify Alert message for selecting record."); officeTickets_CreateTicketsHelper.VerifyAlertText("Please select atleast one record to proceed."); officeTickets_CreateTicketsHelper.AcceptAlert(); //officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); //executionLog.Log("VerifyTicketsBulkUpdates", "Wait for locator to present."); //officeTickets_CreateTicketsHelper.WaitForElementPresent("Checkbox1", 20); executionLog.Log("VerifyTicketsBulkUpdates", "Click on first checkbox."); officeTickets_CreateTicketsHelper.ClickElement("Checkbox1"); officeTickets_CreateTicketsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyTicketsBulkUpdates", "Click on seconf checkbox."); officeTickets_CreateTicketsHelper.ClickElement("Checkbox2"); officeTickets_CreateTicketsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyTicketsBulkUpdates", "Click on bulk update."); officeTickets_CreateTicketsHelper.ClickElement("BulkUpdate"); officeTickets_CreateTicketsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyTicketsBulkUpdates", "Click on change status."); officeTickets_CreateTicketsHelper.ClickElement("ChangeStatus"); officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Verify page title."); officeTickets_CreateTicketsHelper.SelectByText("UpdatedStatus", "New"); officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Click on update button."); officeTickets_CreateTicketsHelper.ClickElement("UPButton"); officeTickets_CreateTicketsHelper.AcceptAlert(); //officeTickets_CreateTicketsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyTicketsBulkUpdates", "Wait updation success message."); officeTickets_CreateTicketsHelper.WaitForText("2 Record(s) updated successfully", 10); officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); //executionLog.Log("VerifyTicketsBulkUpdates", "Wait for locator to present."); //officeTickets_CreateTicketsHelper.WaitForElementPresent("Checkbox1", 20); executionLog.Log("VerifyTicketsBulkUpdates", "Click on first checkbox."); officeTickets_CreateTicketsHelper.ClickElement("Checkbox1"); //officeTickets_CreateTicketsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyTicketsBulkUpdates", "Click on seconf checkbox."); officeTickets_CreateTicketsHelper.ClickElement("Checkbox2"); //officeTickets_CreateTicketsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyTicketsBulkUpdates", "Click on bulk update.."); officeTickets_CreateTicketsHelper.ClickElement("BulkUpdate"); officeTickets_CreateTicketsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyTicketsBulkUpdates", "Verify page title."); officeTickets_CreateTicketsHelper.ClickElement("ChangeCategory"); officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Verify page title."); officeTickets_CreateTicketsHelper.SelectByText("SelectCategoryy", "Billing"); //officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyTicketsBulkUpdates", "Click on update button."); officeTickets_CreateTicketsHelper.ClickElement("UpdateButton"); officeTickets_CreateTicketsHelper.AcceptAlert(); //officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyTicketsBulkUpdates", "Wait updation success message."); officeTickets_CreateTicketsHelper.WaitForText("2 Record(s) updated successfully", 10); //executionLog.Log("VerifyTicketsBulkUpdates", "Wait for locator to present."); //officeTickets_CreateTicketsHelper.WaitForElementPresent("Checkbox1", 30); executionLog.Log("VerifyTicketsBulkUpdates", "Click on first checkbox."); officeTickets_CreateTicketsHelper.ClickElement("Checkbox1"); //officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Click on seconf checkbox."); officeTickets_CreateTicketsHelper.ClickElement("Checkbox2"); //officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Click on bulk update.."); officeTickets_CreateTicketsHelper.ClickElement("BulkUpdate"); officeTickets_CreateTicketsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyTicketsBulkUpdates", "Verify page title."); officeTickets_CreateTicketsHelper.ClickElement("ChangeTopic"); officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Verify page title."); officeTickets_CreateTicketsHelper.SelectByText("SelectTopic", "Merge"); //officeTickets_CreateTicketsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyTicketsBulkUpdates", "Click on update button."); officeTickets_CreateTicketsHelper.ClickElement("UpdateTopic"); officeTickets_CreateTicketsHelper.AcceptAlert(); //officeTickets_CreateTicketsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyTicketsBulkUpdates", "Wait updation success message."); officeTickets_CreateTicketsHelper.WaitForText("2 Record(s) updated successfully", 10); //officeTickets_CreateTicketsHelper.WaitForWorkAround(1000); //executionLog.Log("VerifyTicketsBulkUpdates", "Wait for locator to present."); //officeTickets_CreateTicketsHelper.WaitForElementPresent("Checkbox1", 20); executionLog.Log("VerifyTicketsBulkUpdates", "Click on first checkbox."); officeTickets_CreateTicketsHelper.ClickElement("Checkbox1"); //officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Click on seconf checkbox."); officeTickets_CreateTicketsHelper.ClickElement("Checkbox2"); //officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Click on bulk update.."); officeTickets_CreateTicketsHelper.ClickJs("BulkUpdate"); officeTickets_CreateTicketsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyTicketsBulkUpdates", "Verify page title."); officeTickets_CreateTicketsHelper.ClickJs("ChangePriority"); officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Verify page title."); officeTickets_CreateTicketsHelper.SelectByText("SelectPriority", "Medium"); //officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Click on update button."); officeTickets_CreateTicketsHelper.ClickElement("UpdatePrirority"); officeTickets_CreateTicketsHelper.AcceptAlert(); //officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Wait updation success message."); officeTickets_CreateTicketsHelper.WaitForText("2 Record(s) updated successfully", 10); //officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); //executionLog.Log("VerifyTicketsBulkUpdates", "Wait for locator to present."); //officeTickets_CreateTicketsHelper.WaitForElementPresent("Checkbox1", 20); executionLog.Log("VerifyTicketsBulkUpdates", "Click on first checkbox."); officeTickets_CreateTicketsHelper.ClickElement("Checkbox1"); //officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Click on seconf checkbox."); officeTickets_CreateTicketsHelper.ClickElement("Checkbox2"); //officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Click on bulk update.."); officeTickets_CreateTicketsHelper.ClickJs("BulkUpdate"); officeTickets_CreateTicketsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyTicketsBulkUpdates", "Verify page title."); officeTickets_CreateTicketsHelper.ClickJs("ChangeOwner"); officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Verify page title."); officeTickets_CreateTicketsHelper.SelectByText("OwnerSelect", "Howard Tang"); //officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Click on update button."); officeTickets_CreateTicketsHelper.ClickJs("UpdateOwner"); officeTickets_CreateTicketsHelper.AcceptAlert(); //officeTickets_CreateTicketsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyTicketsBulkUpdates", "Wait updation success message."); officeTickets_CreateTicketsHelper.WaitForText("2 Record(s) updated successfully", 10); //executionLog.Log("VerifyTicketsBulkUpdates", "Wait for locator to present."); //officeTickets_CreateTicketsHelper.WaitForElementPresent("Checkbox1", 20); executionLog.Log("VerifyTicketsBulkUpdates", "Click on first checkbox."); officeTickets_CreateTicketsHelper.ClickElement("Checkbox1"); //officeTickets_CreateTicketsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyTicketsBulkUpdates", "Click on seconf checkbox."); officeTickets_CreateTicketsHelper.ClickElement("Checkbox2"); //officeTickets_CreateTicketsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyTicketsBulkUpdates", "Click on bulk update.."); officeTickets_CreateTicketsHelper.ClickJs("BulkUpdate"); officeTickets_CreateTicketsHelper.WaitForWorkAround(1000); executionLog.Log("VerifyTicketsBulkUpdates", "Verify page title."); officeTickets_CreateTicketsHelper.ClickJs("ChangeManager"); officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Verify page title."); officeTickets_CreateTicketsHelper.SelectByText("SelectManager", "Howard Tang"); //officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Click on update button."); officeTickets_CreateTicketsHelper.ClickJs("UpdateManager"); officeTickets_CreateTicketsHelper.AcceptAlert(); //officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Wait updation success message."); officeTickets_CreateTicketsHelper.WaitForText("2 Record(s) updated successfully", 10); //officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyTicketsBulkUpdates", "Redirect To Tickets"); VisitOffice("tickets"); officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyTicketsBulkUpdates", "SearchTicket by Name"); officeTickets_CreateTicketsHelper.TypeText("SearchTicket", TickName); officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Select 'All' in Assigned field"); officeTickets_CreateTicketsHelper.SelectByText("AssignedField", "All"); officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Select first ticket"); officeTickets_CreateTicketsHelper.ClickElement("Checkbox1"); executionLog.Log("VerifyTicketsBulkUpdates", "Click on delete link"); officeTickets_CreateTicketsHelper.ClickElement("DeleteBulk"); officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Accept alert message."); officeTickets_CreateTicketsHelper.AcceptAlert(); //officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Redirect To Tickets"); VisitOffice("tickets"); officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("VerifyTicketsBulkUpdates", "SearchTicket by Name"); officeTickets_CreateTicketsHelper.TypeText("SearchTicket", Ticket2); officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Select 'All' in Assigned field"); officeTickets_CreateTicketsHelper.SelectByText("AssignedField", "All"); officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Select first ticket"); officeTickets_CreateTicketsHelper.ClickElement("Checkbox1"); executionLog.Log("VerifyTicketsBulkUpdates", "Click on delete link"); officeTickets_CreateTicketsHelper.ClickElement("DeleteBulk"); //officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketsBulkUpdates", "Accept alert message."); officeTickets_CreateTicketsHelper.AcceptAlert(); officeTickets_CreateTicketsHelper.WaitForWorkAround(4000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyTicketsBulkUpdates"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Tickets Bulk Updates"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Tickets Bulk Updates", "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("Verify Tickets Bulk Updates"); TakeScreenshot("VerifyTicketsBulkUpdates"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyTicketsBulkUpdates.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyTicketsBulkUpdates"); string id = loginHelper.getIssueID("Verify Tickets Bulk Updates"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyTicketsBulkUpdates.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Tickets Bulk Updates"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Tickets Bulk Updates"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyTicketsBulkUpdates"); executionLog.WriteInExcel("Verify Tickets Bulk Updates", Status, JIRA, "Office Activities"); } }
public void changeStatusOfTicketAndVerifyStatus() { 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 officeTickets_CreateTicketsHelper = new OfficeTickets_CreateTicketsHelper(GetWebDriver()); // Variable random var name = "Ticket" + RandomNumber(1, 999); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("ChangeStatusOfTicketAndVerifyStatus", "Login with valid username and password"); Login(username[0], password[0]); executionLog.Log("ChangeStatusOfTicketAndVerifyStatus", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("ChangeStatusOfTicketAndVerifyStatus", "Click on ticket tab."); officeTickets_CreateTicketsHelper.ClickJs("TicketTab"); officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("ChangeStatusOfTicketAndVerifyStatus", "Click On Create"); officeTickets_CreateTicketsHelper.ClickElement("Create"); officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("ChangeStatusOfTicketAndVerifyStatus", "ClickOnCreate"); officeTickets_CreateTicketsHelper.TypeText("TicketName", name); executionLog.Log("ChangeStatusOfTicketAndVerifyStatus", "Click on Client icon"); officeTickets_CreateTicketsHelper.ClickElement("ClientDisplayIcon"); officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("ChangeStatusOfTicketAndVerifyStatus", "ClickOnClient"); officeTickets_CreateTicketsHelper.ClickElement("Client"); officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("ChangeStatusOfTicketAndVerifyStatus", "Select the Status"); officeTickets_CreateTicketsHelper.SelectByText("TickStatus", "New"); executionLog.Log("ChangeStatusOfTicketAndVerifyStatus", "Click on Save"); officeTickets_CreateTicketsHelper.ClickJs("Save"); executionLog.Log("ChangeStatusOfTicketAndVerifyStatus", "Verify result"); officeTickets_CreateTicketsHelper.WaitForText("Ticket Created Successfully.", 10); executionLog.Log("ChangeStatusOfTicketAndVerifyStatus", "Redirect To Document"); VisitOffice("tickets"); officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("ChangeStatusOfTicketAndVerifyStatus", "Search ticket by name. "); officeTickets_CreateTicketsHelper.TypeText("SearchTicket", name); officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("ChangeStatusOfTicketAndVerifyStatus", "Select All in Assigned to field"); officeTickets_CreateTicketsHelper.SelectByText("AssignedField", "All"); officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("ChangeStatusOfTicketAndVerifyStatus", "Click on ticket to open it."); officeTickets_CreateTicketsHelper.ClickElement("ClickOnTicket"); officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("ChangeStatusOfTicketAndVerifyStatus", "Click on resolved"); officeTickets_CreateTicketsHelper.ClickElement("ResolvedBtn"); officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("ChangeStatusOfTicketAndVerifyStatus", "Select ticket resolved status."); officeTickets_CreateTicketsHelper.SelectByText("SelectTicketResolution", "Resolved"); executionLog.Log("ChangeStatusOfTicketAndVerifyStatus", "Click Resolved SaveBtn"); officeTickets_CreateTicketsHelper.ClickElement("ClickResolvedSaveBtn"); executionLog.Log("ChangeStatusOfTicketAndVerifyStatus", "Ticket Resolved Successfully"); officeTickets_CreateTicketsHelper.WaitForText("Ticket Resolved Successfully.", 10); officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("ChangeStatusOfTicketAndVerifyStatus", "Search ticket by name "); officeTickets_CreateTicketsHelper.TypeText("SearchTicket", name); officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("ChangeStatusOfTicketAndVerifyStatus", "Select All in Assigned to field"); officeTickets_CreateTicketsHelper.SelectByText("AssignedField", "All"); officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("ChangeStatusOfTicketAndVerifyStatus", "Verify Status"); officeTickets_CreateTicketsHelper.VerifyPageText("Resolved"); executionLog.Log("ChangeStatusOfTicketAndVerifyStatus", "Select ticket"); officeTickets_CreateTicketsHelper.ClickElement("Ticket1"); officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("ChangeStatusOfTicketAndVerifyStatus", "Click On Closed "); officeTickets_CreateTicketsHelper.ClickElement("ClosedTicket"); officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("ChangeStatusOfTicketAndVerifyStatus", "Verify Ticket Closed Successfully."); officeTickets_CreateTicketsHelper.WaitForText("Ticket Closed Successfully.", 10); executionLog.Log("ChangeStatusOfTicketAndVerifyStatus", "Search ticket "); officeTickets_CreateTicketsHelper.TypeText("SearchTicket", name); officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("ChangeStatusOfTicketAndVerifyStatus", "Select All in Assigned to field"); officeTickets_CreateTicketsHelper.SelectByText("AssignedField", "All"); officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("ChangeStatusOfTicketAndVerifyStatus", "Verify Status closed"); officeTickets_CreateTicketsHelper.VerifyPageText("Closed"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ChangeStatusOfTicketAndVerifyStatus"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Change Status Of Ticket And Verify Status"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Change Status Of Ticket And Verify Status", "Bug", "Medium", "Ticket page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Change Status Of Ticket And Verify Status"); TakeScreenshot("ChangeStatusOfTicketAndVerifyStatus"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ChangeStatusOfTicketAndVerifyStatus.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ChangeStatusOfTicketAndVerifyStatus"); string id = loginHelper.getIssueID("Change Status Of Ticket And Verify Status"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ChangeStatusOfTicketAndVerifyStatus.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Change Status Of Ticket And Verify Status"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Change Status Of Ticket And Verify Status"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ChangeStatusOfTicketAndVerifyStatus"); executionLog.WriteInExcel("Change Status Of Ticket And Verify Status", Status, JIRA, "Ticketing System"); } }
public void verifyTicketResolution() { 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 ticket_CreateATicketHelper = new OfficeTickets_CreateTicketsHelper(GetWebDriver()); var ticket_ViewATicketHelper = new OfficeTickets_ViewTicketsHelper(GetWebDriver()); // Variable var TickName = "Test Ticket" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; //try //{ executionLog.Log("VerifyTicketResolution", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyTicketResolution", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("VerifyTicketResolution", "Redirect To Create Tickets"); VisitOffice("tickets/create"); executionLog.Log("VerifyTicketResolution", "Verify Page title"); VerifyTitle("Create a Ticket"); executionLog.Log("VerifyTicketResolution", "Enter Ticket Name"); ticket_CreateATicketHelper.TypeText("TicketName", TickName); ticket_CreateATicketHelper.WaitForWorkAround(1000); executionLog.Log("VerifyTicketResolution", "Select the status"); ticket_CreateATicketHelper.SelectByText("TickStatus", "Open"); ticket_CreateATicketHelper.WaitForWorkAround(1000); executionLog.Log("VerifyTicketResolution", "Click On Select Client Button"); ticket_CreateATicketHelper.ClickElement("ClientDisplayIcon"); ticket_CreateATicketHelper.WaitForWorkAround(4000); executionLog.Log("VerifyTicketResolution", "Search DBA Client by Company Name"); ticket_CreateATicketHelper.TypeText("CompanyName", "Thompson"); executionLog.Log("VerifyTicketResolution", "Search Button"); ticket_CreateATicketHelper.ClickElement("SearchBtn"); ticket_CreateATicketHelper.WaitForWorkAround(4000); executionLog.Log("VerifyTicketResolution", "Click On Client"); ticket_CreateATicketHelper.ClickElement("ClickOnClient"); ticket_CreateATicketHelper.WaitForWorkAround(4000); executionLog.Log("VerifyTicketResolution", "Assigned To "); ticket_CreateATicketHelper.SelectByText("Assignedto", "Howard Tang"); executionLog.Log("VerifyTicketResolution", "Assigned Manager"); ticket_CreateATicketHelper.SelectByText("AssignedManager", "Howard Tang"); executionLog.Log("VerifyTicketResolution", "Click on Save"); ticket_CreateATicketHelper.ClickElement("ClickOnSaveTicket"); ticket_CreateATicketHelper.WaitForWorkAround(3000); executionLog.Log("VerifyTicketResolution", "Verify Ticket Created Successfully."); ticket_CreateATicketHelper.WaitForText("Ticket Created Successfully.", 10); executionLog.Log("VerifyTicketResolution", "Click on Resolve Button"); ticket_ViewATicketHelper.ClickElement("ResolveBtn"); ticket_ViewATicketHelper.WaitForWorkAround(2000); executionLog.Log("VerifyTicketResolution", "Click on Resolution Drop down"); ticket_ViewATicketHelper.ClickElement("Resolution"); ticket_ViewATicketHelper.WaitForWorkAround(3000); executionLog.Log("VerifyTicketResolution", "Click on Drop down options present"); ticket_ViewATicketHelper.IsElementVisible("//option[@value='Resolved']"); //} //catch (Exception e) //{ //} }
public void ticketStatusIssue() { 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 officeTickets_CreateTicketsHelper = new OfficeTickets_CreateTicketsHelper(GetWebDriver()); try { executionLog.Log("TicketStatusIssue", "Login with valid username and password"); Login(username[0], password[0]); executionLog.Log("TicketStatusIssue", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("TicketStatusIssue", "Go to Create Ticket page"); VisitOffice("tickets/create"); officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketStatusIssue", "Verify title"); VerifyTitle("Create a Ticket"); executionLog.Log("TicketStatusIssue", "Set blank ticket status"); officeTickets_CreateTicketsHelper.SelectByText("TickStatus", "Select Status"); officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketStatusIssue", "Collapse the Assignment section"); officeTickets_CreateTicketsHelper.ClickElement("TickAssi"); officeTickets_CreateTicketsHelper.WaitForWorkAround(2000); executionLog.Log("TicketStatusIssue", "Enter ticket name"); officeTickets_CreateTicketsHelper.TypeText("TicketName", "Other"); executionLog.Log("TicketStatusIssue", "Click on Assign link"); officeTickets_CreateTicketsHelper.ClickElement("Assign"); officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketStatusIssue", "Click on Assign user"); officeTickets_CreateTicketsHelper.ClickElement("AssignUser"); executionLog.Log("TicketStatusIssue", "Wait for save button to be visible."); officeTickets_CreateTicketsHelper.WaitForElementPresent("Save", 10); executionLog.Log("TicketStatusIssue", "Click on 'Save' button"); officeTickets_CreateTicketsHelper.ClickElement("Save"); officeTickets_CreateTicketsHelper.WaitForWorkAround(3000); executionLog.Log("TicketStatusIssue", "Verify validation for required status field displayed"); officeTickets_CreateTicketsHelper.verifyElementVisible("TickAssiErr"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("TicketStatusIssue"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Ticket Status Issue"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Ticket Status Issue", "Bug", "Medium", "Ticket page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Ticket Status Issue"); TakeScreenshot("TicketStatusIssue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\TicketStatusIssue.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("TicketStatusIssue"); string id = loginHelper.getIssueID("Ticket Status Issue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\TicketStatusIssue.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Ticket Status Issue"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Ticket Status Issue"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("TicketStatusIssue"); executionLog.WriteInExcel("Ticket Status Issue", Status, JIRA, "Ticketing System"); } }
public void editTicketVerifyResponsibility() { 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 ticket_CreateATicketHelper = new OfficeTickets_CreateTicketsHelper(GetWebDriver()); // Variable var TickName = "Test Ticket" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("EditTicketVerifyResponsibility", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("EditTicketVerifyResponsibility", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("EditTicketVerifyResponsibility", "Redirect To Tickets"); VisitOffice("tickets/create"); executionLog.Log("EditTicketVerifyResponsibility", "Verify page title."); VerifyTitle("Create a Ticket"); executionLog.Log("EditTicketVerifyResponsibility", "Enter Ticket Name"); ticket_CreateATicketHelper.TypeText("TicketName", TickName); executionLog.Log("EditTicketVerifyResponsibility", "Select the status"); ticket_CreateATicketHelper.SelectByText("TickStatus", "New"); executionLog.Log("EditTicketVerifyResponsibility", "ClickOnClientDisplayIcon"); ticket_CreateATicketHelper.ClickElement("ClientDisplayIcon"); ticket_CreateATicketHelper.WaitForWorkAround(2000); executionLog.Log("EditTicketVerifyResponsibility", "ClickOnClient"); ticket_CreateATicketHelper.ClickElement("ClickOnClient"); ticket_CreateATicketHelper.WaitForWorkAround(1000); executionLog.Log("EditTicketVerifyResponsibility", "Select Assigned To "); ticket_CreateATicketHelper.SelectDropDownByText("//*[@id='TicketAssignedUserId']", "Howard Tang"); executionLog.Log("EditTicketVerifyResponsibility", "Select Assigned Manager"); ticket_CreateATicketHelper.SelectDropDownByText("//*[@id='TicketAssignedManagerId']", "Howard Tang"); executionLog.Log("EditTicketVerifyResponsibility", "Click on Save"); ticket_CreateATicketHelper.ClickElement("ClickOnSaveTicket"); ticket_CreateATicketHelper.WaitForWorkAround(1000); executionLog.Log("EditTicketVerifyResponsibility", "Wait text Ticket Created Successfully."); ticket_CreateATicketHelper.WaitForText("Ticket Created Successfully.", 10); executionLog.Log("EditTicketVerifyResponsibility", "Redirect To Tickets"); VisitOffice("tickets"); ticket_CreateATicketHelper.WaitForWorkAround(3000); executionLog.Log("EditTicketVerifyResponsibility", "SearchTicket by Name"); ticket_CreateATicketHelper.TypeText("SearchTicket", TickName); ticket_CreateATicketHelper.WaitForWorkAround(2000); executionLog.Log("EditTicketVerifyResponsibility", "Select all in assign field"); ticket_CreateATicketHelper.SelectByText("AssignedField", "All"); ticket_CreateATicketHelper.WaitForWorkAround(2000); executionLog.Log("EditTicketVerifyResponsibility", "Click on edit icon"); ticket_CreateATicketHelper.ClickElement("ClickOnEdit"); executionLog.Log("EditTicketVerifyResponsibility", "Verify page title."); VerifyTitle("Edit Ticket"); executionLog.Log("EditTicketVerifyResponsibility", "Click on Save"); ticket_CreateATicketHelper.ClickElement("ClickOnSaveTicket"); ticket_CreateATicketHelper.WaitForWorkAround(3000); executionLog.Log("EditTicketVerifyResponsibility", "Verify Success message. "); ticket_CreateATicketHelper.WaitForText("Ticket Edited Successfully", 10); executionLog.Log("EditTicketVerifyResponsibility", "Redirect To Tickets"); VisitOffice("tickets"); ticket_CreateATicketHelper.WaitForWorkAround(1000); executionLog.Log("EditTicketVerifyResponsibility", "SearchTicket by Name"); ticket_CreateATicketHelper.TypeText("SearchTicket", TickName); ticket_CreateATicketHelper.WaitForWorkAround(2000); executionLog.Log("EditTicketVerifyResponsibility", "Select all in assign field"); ticket_CreateATicketHelper.SelectByText("AssignedField", "All"); ticket_CreateATicketHelper.WaitForWorkAround(2000); executionLog.Log("EditTicketVerifyResponsibility", "Select first ticket"); ticket_CreateATicketHelper.ClickElement("Checkbox1"); executionLog.Log("EditTicketVerifyResponsibility", "Click on delete link"); ticket_CreateATicketHelper.ClickElement("DeleteBulk"); executionLog.Log("EditTicketVerifyResponsibility", "Accept alert message."); ticket_CreateATicketHelper.AcceptAlert(); executionLog.Log("EditTicketVerifyResponsibility", "Wait for success message."); ticket_CreateATicketHelper.WaitForText("1 Records deleted successfully", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("EditTicketVerifyResponsibility"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Edit Ticket Verify Responsibility"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Edit Ticket Verify Responsibility", "Bug", "Medium", "Ticket page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Edit Ticket Verify Responsibility"); TakeScreenshot("EditTicketVerifyResponsibility"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EditTicketVerifyResponsibility.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("EditTicketVerifyResponsibility"); string id = loginHelper.getIssueID("Edit Ticket Verify Responsibility"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EditTicketVerifyResponsibility.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Edit Ticket Verify Responsibility"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Edit Ticket Verify Responsibility"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("EditTicketVerifyResponsibility"); executionLog.WriteInExcel("Edit Ticket Verify Responsibility", Status, JIRA, "Office Tickets"); } }