public void equepmentDeleteError() { 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 eqiupment_EquipmentHelper = new Eqiupment_EquipmentHelper(GetWebDriver()); String Status = "Pass"; String JIRA = ""; var eqname = "testequip" + RandomNumber(11, 99999); try { executionLog.Log("EquepmentDeleteError", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("EquepmentDeleteError", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("EquepmentDeleteError", "Redirect Create Equipment page"); VisitOffice("equipment/create"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquepmentDeleteError", "Enter Name"); eqiupment_EquipmentHelper.TypeText("Name", eqname); executionLog.Log("EquepmentDeleteError", "Select Type"); eqiupment_EquipmentHelper.SelectByText("Type", "Terminal"); executionLog.Log("EquepmentDeleteError", "Enter Version"); eqiupment_EquipmentHelper.TypeText("Version", "2"); executionLog.Log("EquepmentDeleteError", "Select Applicable Processor"); eqiupment_EquipmentHelper.ClickElement("ApplicableProcessors1"); executionLog.Log("EquepmentDeleteError", "Click on Save button"); eqiupment_EquipmentHelper.ClickElement("Save"); eqiupment_EquipmentHelper.WaitForText("Equipment saved successfully", 10); eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("EquepmentDeleteError", "Search Equipment by Name"); eqiupment_EquipmentHelper.TypeText("SearchEquipment", eqname); eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("EquepmentDeleteError", "Click on checkbox."); eqiupment_EquipmentHelper.ClickElement("SectEquip"); executionLog.Log("EquepmentDeleteError", "Delete second equipment"); eqiupment_EquipmentHelper.ClickElement("Deleteeqp"); eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("EquepmentDeleteError", "Accept alert"); eqiupment_EquipmentHelper.AcceptAlert(); executionLog.Log("EquepmentDeleteError", "navigate to other tab"); VisitCorp("newthemeoffice"); executionLog.Log("EquepmentDeleteError", "Redirect To equipment"); VisitOffice("equipment"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("EquepmentDeleteError"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Equepment Delete Error"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Equepment Delete Error", "Bug", "Medium", "Equipment page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Equepment Delete Error"); TakeScreenshot("EquepmentDeleteError"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EquepmentDeleteError.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("EquepmentDeleteError"); string id = loginHelper.getIssueID("Equepment Delete Error"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EquepmentDeleteError.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Equepment Delete Error"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Equepment Delete Error"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("EquepmentDeleteError"); executionLog.WriteInExcel("Equepment Delete Error", Status, JIRA, "Equipment Management"); } }
public void bulkUpdateEquipmentType() { 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 eqiupment_EquipmentHelper = new Eqiupment_EquipmentHelper(GetWebDriver()); // Variable String name = "Test" + GetRandomNumber(); String Id = "12345" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("BulkUpdateEquipmentType", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("BulkUpdateEquipmentType", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("BulkUpdateEquipmentType", "Redirecte to admin"); VisitOffice("admin"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("BulkUpdateEquipmentType", "Redirect To equipment"); VisitOffice("equipment"); eqiupment_EquipmentHelper.WaitForWorkAround(5000); executionLog.Log("BulkUpdateEquipmentType", "Verify title"); VerifyTitle("Equipment"); var Loc = "//table[@id='list1']/tbody/tr[2]"; if (eqiupment_EquipmentHelper.IsElementPresent(Loc)) { executionLog.Log("BulkUpdateEquipmentType", "Click On Equipment"); eqiupment_EquipmentHelper.ClickElement("ClickOnEquipChkBox"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("BulkUpdateEquipmentType", "Click On bulk update."); eqiupment_EquipmentHelper.ClickElement("ClickBulkUpdateBtn"); eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("BulkUpdateEquipmentType", "Change Status"); eqiupment_EquipmentHelper.ClickElement("ClikEquipType"); eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("BulkUpdateEquipmentType", "Select Status"); eqiupment_EquipmentHelper.SelectByText("EquipTypeStatus", "Check Reader"); executionLog.Log("BulkUpdateEquipmentType", "Click on Update button"); eqiupment_EquipmentHelper.ClickElement("SaveBulkType"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("BulkUpdateEquipmentType", "Accept alert message."); eqiupment_EquipmentHelper.AcceptAlert(); eqiupment_EquipmentHelper.WaitForWorkAround(5000); executionLog.Log("BulkUpdateEquipmentType", "Verify text."); eqiupment_EquipmentHelper.WaitForText("Record(s) updated successfully", 5); } else { executionLog.Log("BulkUpdateEquipmentType", " Click On Create"); eqiupment_EquipmentHelper.ClickElement("Create"); eqiupment_EquipmentHelper.WaitForWorkAround(6000); executionLog.Log("BulkUpdateEquipmentType", "Enter Equipment Name"); eqiupment_EquipmentHelper.TypeText("Name", "Bulk Equipment"); executionLog.Log("BulkUpdateEquipmentType", "Enter equipment type"); eqiupment_EquipmentHelper.Select("Type", "Check Reader"); executionLog.Log("BulkUpdateEquipmentType", "Enter Equipment Id"); eqiupment_EquipmentHelper.TypeText("EquipmentId", Id); executionLog.Log("BulkUpdateEquipmentType", "Enter Category"); eqiupment_EquipmentHelper.SelectByText("Category", "EQP-1"); executionLog.Log("BulkUpdateEquipmentType", "Enter Version"); eqiupment_EquipmentHelper.TypeText("Version", "Testing"); executionLog.Log("BulkUpdateEquipmentType", "Enter Description"); eqiupment_EquipmentHelper.TypeText("Description", "This is Testing Description"); executionLog.Log("BulkUpdateEquipmentType", " Click on Save button "); eqiupment_EquipmentHelper.ClickElement("Save"); eqiupment_EquipmentHelper.WaitForWorkAround(6000); executionLog.Log("BulkUpdateEquipmentType", "Click On Equipment"); eqiupment_EquipmentHelper.ClickElement("ClickOnEquipChkBox"); executionLog.Log("BulkUpdateEquipmentType", "Click On Bulk update button."); eqiupment_EquipmentHelper.ClickElement("ClickBulkUpdateBtn"); executionLog.Log("BulkUpdateEquipmentType", "Change Status"); eqiupment_EquipmentHelper.ClickElement("ClikEquipType"); executionLog.Log("BulkUpdateEquipmentType", "Select Status"); eqiupment_EquipmentHelper.Select("EquipTypeStatus", "Check Reader"); executionLog.Log("BulkUpdateEquipmentType", "Click on Update button"); eqiupment_EquipmentHelper.ClickElement("SaveBulk"); eqiupment_EquipmentHelper.WaitForWorkAround(5000); executionLog.Log("BulkUpdateEquipmentType", "Accept Alert message."); eqiupment_EquipmentHelper.AcceptAlert(); eqiupment_EquipmentHelper.WaitForWorkAround(5000); eqiupment_EquipmentHelper.WaitForText("Record(s) updated successfully", 5); } } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("BulkUpdateEquipmentType"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Bulk Update Equipment Type"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Bulk Update Equipment Type", "Bug", "Medium", "Equipment page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Bulk Update Equipment Status"); TakeScreenshot("BulkUpdateEquipmentType"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\BulkUpdateEquipmentType.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("BulkUpdateEquipmentType"); string id = loginHelper.getIssueID("Bulk Update Equipment Type"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\BulkUpdateEquipmentType.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Bulk Update Equipment Type"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Bulk Update Equipment Type"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("BulkUpdateEquipmentType"); executionLog.WriteInExcel("Bulk Update Equipment Type", Status, JIRA, "Admin Equipments"); } }
public void verifyEquipmentsAdvanceFilterColumnOrder() { 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 eqiupment_EquipmentHelper = new Eqiupment_EquipmentHelper(GetWebDriver()); // Variable Random String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Redirect To URL"); VisitOffice("equipment"); eqiupment_EquipmentHelper.WaitForWorkAround(5000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Verify page title."); VerifyTitle("Equipment"); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Verify status column is visible on the page.."); eqiupment_EquipmentHelper.IsElementPresent("HeadStatus"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Verify manufacturer name column is visible on the page."); eqiupment_EquipmentHelper.IsElementPresent("HeadManufacturer"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Verify model column is visible on the page."); eqiupment_EquipmentHelper.IsElementPresent("HeadModel"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Verify modified column is visible on the page."); eqiupment_EquipmentHelper.IsElementPresent("HeadModified"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Click on advance filter."); eqiupment_EquipmentHelper.ClickElement("AdvanceFilter"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Select status in displayed columns."); eqiupment_EquipmentHelper.SelectByText("DisplayedCols", "Status"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Click arrow to move column to avail cols."); eqiupment_EquipmentHelper.ClickElement("RemoveCols"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Select manufacturer name in displayed columns."); eqiupment_EquipmentHelper.SelectByText("DisplayedCols", "Manufacturer Name"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Click arrow to move column to avail cols"); eqiupment_EquipmentHelper.ClickElement("RemoveCols"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Select Model in displayed columns."); eqiupment_EquipmentHelper.SelectByText("DisplayedCols", "Model"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Click arrow to move column to avail cols"); eqiupment_EquipmentHelper.ClickElement("RemoveCols"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Select modified in displayed columns."); eqiupment_EquipmentHelper.SelectByText("DisplayedCols", "Modified"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Click arrow to move column to avail cols"); eqiupment_EquipmentHelper.ClickElement("RemoveCols"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Click on Apply button."); eqiupment_EquipmentHelper.ClickElement("Apply"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Verify status not present on page."); eqiupment_EquipmentHelper.IsElementNotPresent("HeadStatus"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Verify manufacturer name not present on page."); eqiupment_EquipmentHelper.IsElementNotPresent("HeadManufacturer"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Verify model not present on page."); eqiupment_EquipmentHelper.IsElementNotPresent("HeadModel"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Verify modified not present on page."); eqiupment_EquipmentHelper.IsElementNotPresent("HeadModified"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Redirect at leads page."); VisitOffice("leads"); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Verify page title as leads."); VerifyTitle("Leads"); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Redirect To URL"); VisitOffice("equipment"); eqiupment_EquipmentHelper.WaitForWorkAround(5000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Verify page title as equipments."); VerifyTitle("Equipment"); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Verify default position of manufacturer name column."); eqiupment_EquipmentHelper.IsElementPresent("HeadManufacturer5"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Verify default position of model column."); eqiupment_EquipmentHelper.IsElementPresent("HeadModel6"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Redirect at equipment page again."); VisitOffice("equipment"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Click on advance filter."); eqiupment_EquipmentHelper.ClickElement("AdvanceFilter"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Select manufacturer name in displayed column."); eqiupment_EquipmentHelper.SelectByText("DisplayedCols", "Manufacturer Name"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Move manufacturer name 1 step up."); eqiupment_EquipmentHelper.ClickElement("MoveUp"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Move manufacturer name 1 step up."); eqiupment_EquipmentHelper.ClickElement("MoveUp"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Move manufacturer name 1 step up."); eqiupment_EquipmentHelper.ClickElement("MoveUp"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Select model in displayed column."); eqiupment_EquipmentHelper.SelectByText("DisplayedCols", "Model"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Move model 1 step down."); eqiupment_EquipmentHelper.ClickElement("MoveDown"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Click on Apply button."); eqiupment_EquipmentHelper.ClickElement("Apply"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Verify changed position of manufacturer name column."); eqiupment_EquipmentHelper.IsElementPresent("HeadManufacturer3"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Verify changed position of model column."); eqiupment_EquipmentHelper.IsElementPresent("HeadModel7"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentsAdvanceFilterColumnOrder", "Logout from the application."); VisitOffice("logout"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyEquipmentsAdvanceFilterColumnOrder"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Equipments Advance Filter Column Order"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Equipments Advance Filter 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 Equipments Advance Filter Column Order"); TakeScreenshot("VerifyEquipmentsAdvanceFilterColumnOrder"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyEquipmentsAdvanceFilterColumnOrder.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyEquipmentsAdvanceFilterColumnOrder"); string id = loginHelper.getIssueID("Verify Equipments Advance Filter Column Order"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyEquipmentsAdvanceFilterColumnOrder.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Equipments Advance Filter Column Order"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Equipments Advance Filter Column Order"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyEquipmentsAdvanceFilterColumnOrder"); executionLog.WriteInExcel("Verify Equipments Advance Filter Column Order", Status, JIRA, "Meetings Management"); } }
public void equipmentsAdvanceFilterResultsPP() { 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 eqiupment_EquipmentHelper = new Eqiupment_EquipmentHelper(GetWebDriver()); // Variable String JIRA = ""; String Status = "Pass"; try { executionLog.Log("EquipmentsAdvanceFilterResultsPP", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("EquipmentsAdvanceFilterResultsPP", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("EquipmentsAdvanceFilterResultsPP", "Redirect at employee page."); VisitOffice("equipment"); eqiupment_EquipmentHelper.WaitForWorkAround(5000); executionLog.Log("EquipmentsAdvanceFilterResultsPP", "Verify page title."); VerifyTitle("Equipment"); eqiupment_EquipmentHelper.WaitForElementVisible("AdvanceFilter", 10); executionLog.Log("EquipmentsAdvanceFilterResultsPP", "Click on advance filter."); eqiupment_EquipmentHelper.ClickElement("AdvanceFilter"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipmentsAdvanceFilterResultsPP", "Select number of records to 10."); eqiupment_EquipmentHelper.SelectByText("ResultsPerPage", "10"); eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("EquipmentsAdvanceFilterResultsPP", "Click on Apply button."); eqiupment_EquipmentHelper.ClickElement("Apply"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipmentsAdvanceFilterResultsPP", "Verify number of records displayed."); // eqiupment_EquipmentHelper.VerifyText("No.ofRecords", "Showing 1 - 10 of"); eqiupment_EquipmentHelper.ShowResult(10); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipmentsAdvanceFilterResultsPP", "Click on advance filter."); eqiupment_EquipmentHelper.ClickElement("AdvanceFilter"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipmentsAdvanceFilterResultsPP", "Select number of records to 20."); eqiupment_EquipmentHelper.SelectByText("ResultsPerPage", "20"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipmentsAdvanceFilterResultsPP", "Click on Apply button."); eqiupment_EquipmentHelper.ClickElement("Apply"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipmentsAdvanceFilterResultsPP", "Verify number of records displayed."); // eqiupment_EquipmentHelper.VerifyText("No.ofRecords", "Showing 1 - 20 of"); eqiupment_EquipmentHelper.ShowResult(20); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipmentsAdvanceFilterResultsPP", "Click on advance filter."); eqiupment_EquipmentHelper.ClickElement("AdvanceFilter"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipmentsAdvanceFilterResultsPP", "Select number of records to 50."); eqiupment_EquipmentHelper.SelectByText("ResultsPerPage", "50"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipmentsAdvanceFilterResultsPP", "Click on Apply button."); eqiupment_EquipmentHelper.ClickElement("Apply"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipmentsAdvanceFilterResultsPP", "Verify number of records displayed."); // eqiupment_EquipmentHelper.VerifyText("No.ofRecords", "Showing 1 - 50 of"); eqiupment_EquipmentHelper.ShowResult(50); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipmentsAdvanceFilterResultsPP", "Click on advance filter."); eqiupment_EquipmentHelper.ClickElement("AdvanceFilter"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipmentsAdvanceFilterResultsPP", "Select number of records to 100."); eqiupment_EquipmentHelper.SelectByText("ResultsPerPage", "100"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipmentsAdvanceFilterResultsPP", "Click on Apply button."); eqiupment_EquipmentHelper.ClickElement("Apply"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipmentsAdvanceFilterResultsPP", "Verify number of records displayed."); // eqiupment_EquipmentHelper.VerifyText("No.ofRecords", "Showing 1 - 100 of"); eqiupment_EquipmentHelper.ShowResult(100); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipmentsAdvanceFilterResultsPP", "Logout from the application."); VisitOffice("logout"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("EquipmentsAdvanceFilterResultsPP"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Equipments Advance Filter ResultsPP"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Equipments Advance Filter ResultsPP", "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("Equipments Advance Filter ResultsPP"); TakeScreenshot("EquipmentsAdvanceFilterResultsPP"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EquipmentsAdvanceFilterResultsPP.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("EquipmentsAdvanceFilterResultsPP"); string id = loginHelper.getIssueID("Equipments Advance Filter ResultsPP"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EquipmentsAdvanceFilterResultsPP.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Equipments Advance Filter ResultsPP"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Equipments Advance Filter ResultsPP"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("EquipmentsAdvanceFilterResultsPP"); executionLog.WriteInExcel("Equipments Advance Filter ResultsPP", Status, JIRA, "Opportunities Management"); } }