public void verifyEquipmentCreatedAndByModifiedByCredits() { 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 var name = "Test" + GetRandomNumber(); var Id = "12345" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Redirect To URL"); VisitOffice("equipment/create"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Verify title"); VerifyTitle("Equipment Create"); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Enter Equipment Name"); eqiupment_EquipmentHelper.TypeText("Name", name); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Select DownloadsIDName"); eqiupment_EquipmentHelper.Select("Type", "Check Reader"); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Enter Equipment Id"); eqiupment_EquipmentHelper.TypeText("EquipmentId", Id); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Enter Version"); eqiupment_EquipmentHelper.TypeText("Version", "Testing"); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Enter Description"); eqiupment_EquipmentHelper.TypeText("Description", "This is Testing Description"); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Click On First CheckBox"); eqiupment_EquipmentHelper.ClickElement("ApplicableProcessors1"); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Click On First CheckBox"); eqiupment_EquipmentHelper.ClickElement("ApplicableProcessors2"); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", " Click on Save button "); eqiupment_EquipmentHelper.ClickElement("Save"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", " Redirect at equipments."); VisitOffice("equipment"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", " Verify page title as equipments."); VerifyTitle("Equipment"); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Enter Name in seacrh field"); eqiupment_EquipmentHelper.TypeText("EnterName", name); eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Click on any equipment"); eqiupment_EquipmentHelper.ClickElement("FirstEquip"); eqiupment_EquipmentHelper.WaitForWorkAround(4000); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Verify equipment created by credits."); eqiupment_EquipmentHelper.VerifyText("CreatedBy", "Howard Tang"); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Verify equipment created by credits."); eqiupment_EquipmentHelper.VerifyText("ModifiedBy", "Howard Tang"); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Redirect at eqipments page."); VisitOffice("equipment"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Verify page title as equipments."); VerifyTitle("Equipment"); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Enter Name in seacrh field"); eqiupment_EquipmentHelper.TypeText("EnterName", name); eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Click on edit button."); eqiupment_EquipmentHelper.ClickElement("EditEquipment"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Verify title"); VerifyTitle("Equipment Edit:"); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Enter Equipment Name"); eqiupment_EquipmentHelper.TypeText("Name", name); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Enter DownloadsIDName"); eqiupment_EquipmentHelper.Select("Type", "Check Reader"); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Enter Equipment IdNum"); eqiupment_EquipmentHelper.TypeText("EquipmentId", Id); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Enter Version"); eqiupment_EquipmentHelper.TypeText("Version", "Testing"); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Enter Description"); eqiupment_EquipmentHelper.TypeText("Description", "This is Testing Description"); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", " Click on Save button"); eqiupment_EquipmentHelper.ClickElement("Save"); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", " Wait for edit message."); eqiupment_EquipmentHelper.WaitForText("The Equipment is edited successfully", 10); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", " Redirect at equipments."); VisitOffice("equipment"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", " Verify page title as equipments."); VerifyTitle("Equipment"); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Enter Name in seacrh field"); eqiupment_EquipmentHelper.TypeText("EnterName", name); eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Click on any equipment"); eqiupment_EquipmentHelper.ClickElement("FirstEquip"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Verify equipment created by credits."); eqiupment_EquipmentHelper.VerifyText("CreatedBy", "Howard Tang"); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Verify equipment created by credits."); eqiupment_EquipmentHelper.VerifyText("ModifiedBy", "Howard Tang"); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Redirect To URL"); VisitOffice("equipment"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Verify title"); VerifyTitle("Equipment"); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Enter Name to search"); eqiupment_EquipmentHelper.TypeText("SearchId", Id); eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "cLICK Delete btn "); eqiupment_EquipmentHelper.ClickElement("DeleteEuipment"); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Accept alert message. "); eqiupment_EquipmentHelper.AcceptAlert(); executionLog.Log("VerifyEquipmentCreatedAndByModifiedByCredits", "Wait for delete message. "); eqiupment_EquipmentHelper.WaitForText("Equipment deleted successfully", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyEquipmentCreatedAndByModifiedByCredits"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Create Equipments"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Create Equipments", "Bug", "Medium", "Create Eqiupment page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Create Equipments"); TakeScreenshot("VerifyEquipmentCreatedAndByModifiedByCredits"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyEquipmentCreatedAndByModifiedByCredits.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyEquipmentCreatedAndByModifiedByCredits"); string id = loginHelper.getIssueID("Create Equipments"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyEquipmentCreatedAndByModifiedByCredits.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Create Equipments"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Create Equipments"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyEquipmentCreatedAndByModifiedByCredits"); executionLog.WriteInExcel("Create Equipments", Status, JIRA, "Equipment Management"); } }
public void verifyAddAnotherVersionDisplay() { string[] username = null; string[] password = null; XMLParse oXMLData = new XMLParse(); oXMLData.LoadXML("../../Config/ApplicationSettings.xml"); String JIRA = ""; String Status = "Pass"; 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" + RandomNumber(1, 99); String Id = "12345" + RandomNumber(1, 99); try { executionLog.Log("VerifyAddAnotherVersionDisplay", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyAddAnotherVersionDisplay", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyAddAnotherVersionDisplay", "Click on Profile Icon"); eqiupment_EquipmentHelper.Clickjs("ProfileIcon"); executionLog.Log("VerifyAddAnotherVersionDisplay", "Click on Admin Button"); eqiupment_EquipmentHelper.Clickjs("AdminBtn"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAddAnotherVersionDisplay", "Click on Terminal And Equipment Tab"); eqiupment_EquipmentHelper.MouseOverAndWait("ClickOnEquipmentTab", 3); executionLog.Log("VerifyAddAnotherVersionDisplay", "Click on equipmet button"); eqiupment_EquipmentHelper.Clickjs("EquipmentBtn"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAddAnotherVersionDisplay", " Click On Create"); eqiupment_EquipmentHelper.ClickElement("Create"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("VerifyAddAnotherVersionDisplay", "Click on Add Another"); eqiupment_EquipmentHelper.ClickElement("ClickAddAnother"); executionLog.Log("VerifyAddAnotherVersionDisplay", "ClickAddAnother"); eqiupment_EquipmentHelper.ClickElement("ClickAddAnother"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyAddAnotherVersionDisplay"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify Add Another Version Display"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify Add Another Version Display", "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("Verify Add Another Version Display"); TakeScreenshot("VerifyAddAnotherVersionDisplay"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyAddAnotherVersionDisplay.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyAddAnotherVersionDisplay"); string id = loginHelper.getIssueID("Verify Add Another Version Display"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyAddAnotherVersionDisplay.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify Add Another Version Display"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify Add Another Version Display"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyAddAnotherVersionDisplay"); executionLog.WriteInExcel("Verify Add Another Version Display", Status, JIRA, "Equipment Management"); } }
public void equipmentManagement() { 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 var name = "Test" + RandomNumber(1, 999); var Id = "123" + RandomNumber(1, 999); String JIRA = ""; String Status = "Pass"; //try //{ executionLog.Log("EquipmentManagement", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("EquipmentManagement", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("EquipmentManagement", "Click On Admin"); VisitOffice("admin"); executionLog.Log("EquipmentManagement", "Redirect To URL"); VisitOffice("equipment"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipmentManagement", "Verify title"); VerifyTitle("Equipment"); executionLog.Log("EquipmentManagement", " Click On Create"); eqiupment_EquipmentHelper.Clickjs("Create"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipmentManagement", "Verify title"); VerifyTitle("Equipment Create"); executionLog.Log("EquipmentManagement", " Click on Save button "); eqiupment_EquipmentHelper.Clickjs("Save"); //eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipmentManagement", " Verify validation text on page."); eqiupment_EquipmentHelper.VerifyPageText("This field is required."); //eqiupment_EquipmentHelper.WaitForWorkAround(500); executionLog.Log("EquipmentManagement", "Enter Equipment Name"); eqiupment_EquipmentHelper.TypeText("Name", name); //eqiupment_EquipmentHelper.WaitForWorkAround(500); executionLog.Log("EquipmentManagement", "Select Equipment type"); eqiupment_EquipmentHelper.Select("Type", "Check Reader"); //eqiupment_EquipmentHelper.WaitForWorkAround(500); executionLog.Log("EquipmentManagement", "Enter Equipment Id"); eqiupment_EquipmentHelper.TypeText("EquipmentId", Id); //eqiupment_EquipmentHelper.WaitForWorkAround(500); executionLog.Log("EquipmentManagement", "Enter Version"); eqiupment_EquipmentHelper.TypeText("Version", "6.0.1"); //eqiupment_EquipmentHelper.WaitForWorkAround(500); executionLog.Log("EquipmentManagement", "Enter Description"); eqiupment_EquipmentHelper.TypeText("Description", "This is Testing Description"); //eqiupment_EquipmentHelper.WaitForWorkAround(500); executionLog.Log("EquipmentManagement", "Select first processor"); eqiupment_EquipmentHelper.ClickElement("ApplicableProcessors1"); executionLog.Log("EquipmentManagement", "Select second processor."); eqiupment_EquipmentHelper.ClickElement("ApplicableProcessors2"); executionLog.Log("EquipmentManagement", " Click on Save button "); eqiupment_EquipmentHelper.ClickElement("Save"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipmentManagement", " Wait for save equipment text "); eqiupment_EquipmentHelper.WaitForText("Equipment saved successfully", 10); executionLog.Log("EquipmentManagement", "Redirect To URL"); VisitOffice("equipment"); eqiupment_EquipmentHelper.WaitForWorkAround(4000); executionLog.Log("EquipmentManagement", "Verify title"); VerifyTitle("Equipment"); //eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipmentManagement", "Enter ID to search equipment."); eqiupment_EquipmentHelper.TypeText("SearchId", Id); eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("EquipmentManagement", "Click on edit equipment."); eqiupment_EquipmentHelper.Clickjs("EditEquipment"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipmentManagement", "Enter Version"); eqiupment_EquipmentHelper.TypeText("Version", ""); //eqiupment_EquipmentHelper.WaitForWorkAround(500); executionLog.Log("EquipmentManagement", " Click on Save button "); eqiupment_EquipmentHelper.ClickElement("Save"); //eqiupment_EquipmentHelper.WaitForWorkAround(500); executionLog.Log("EquipmentManagement", " Verify version error text."); eqiupment_EquipmentHelper.VerifyText("VerifyVersionVal", "This field is required."); //eqiupment_EquipmentHelper.WaitForWorkAround(500); executionLog.Log("EquipmentManagement", "Enter Version"); eqiupment_EquipmentHelper.TypeText("Version", "10.0.1"); //eqiupment_EquipmentHelper.WaitForWorkAround(500); executionLog.Log("EquipmentManagement", "Click on Add version."); eqiupment_EquipmentHelper.ClickElement("ClickAddAnother"); eqiupment_EquipmentHelper.WaitForWorkAround(1000); executionLog.Log("EquipmentManagement", "Enter Version"); eqiupment_EquipmentHelper.TypeText("AddedVersion", "2"); //eqiupment_EquipmentHelper.WaitForWorkAround(500); executionLog.Log("EquipmentManagement", " Click on Save button "); eqiupment_EquipmentHelper.ClickElement("Save"); eqiupment_EquipmentHelper.WaitForWorkAround(4000); executionLog.Log("EquipmentManagement", "Enter ID to search equipment"); eqiupment_EquipmentHelper.TypeText("SearchId", Id); eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("EquipmentManagement", "Click On Equipment"); eqiupment_EquipmentHelper.ClickElement("ClickOneQUIP"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipmentManagement", "Click On Clone"); eqiupment_EquipmentHelper.ClickElement("ClickOnClone"); eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("EquipmentManagement", "wait for success message."); eqiupment_EquipmentHelper.WaitForText("Equipment is cloned successfully", 20); executionLog.Log("EquipmentManagement", "Redirect To URL"); VisitOffice("equipment"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipmentManagement", "Verify title"); VerifyTitle("Equipment"); //eqiupment_EquipmentHelper.WaitForWorkAround(1000); executionLog.Log("EquipmentManagement", "Click On first chk box"); eqiupment_EquipmentHelper.ClickElement("ClickOnFirstCheckBox"); executionLog.Log("EquipmentManagement", "Click On Bulk Update"); eqiupment_EquipmentHelper.Clickjs("BulkUpdate"); eqiupment_EquipmentHelper.WaitForWorkAround(1000); executionLog.Log("EquipmentManagement", "Click to Change Status"); eqiupment_EquipmentHelper.ClickElement("ChangeStatusBU"); eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("EquipmentManagement", "Select Status as active"); eqiupment_EquipmentHelper.Select("SelectStatus", "1"); //eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("EquipmentManagement", "Click on Update button"); eqiupment_EquipmentHelper.ClickElement("ClickOnSaveBulkPopUp"); //eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("EquipmentManagement", "Accept alert message."); eqiupment_EquipmentHelper.AcceptAlert(); eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("EquipmentManagement", "Wait for success message."); eqiupment_EquipmentHelper.WaitForText("1 Record(s) updated successfully", 10); executionLog.Log("EquipmentManagement", "Click on delete Icon"); eqiupment_EquipmentHelper.ClickElement("ClickDelClone"); eqiupment_EquipmentHelper.WaitForWorkAround(1000); executionLog.Log("EquipmentManagement", "Accept alert message."); eqiupment_EquipmentHelper.AcceptAlert(); executionLog.Log("EquipmentManagement", "Wait for delete success message."); eqiupment_EquipmentHelper.WaitForText("Equipment deleted successfully.", 10); eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("EquipmentManagement", "Enter ID to search equipment."); eqiupment_EquipmentHelper.TypeText("SearchId", Id); eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("EquipmentManagement", "Click Delete Icon "); eqiupment_EquipmentHelper.Clickjs("DeleteEuipment"); eqiupment_EquipmentHelper.WaitForWorkAround(1000); executionLog.Log("EquipmentManagement", "Accept alert message. "); eqiupment_EquipmentHelper.AcceptAlert(); eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("EquipmentManagement", "Wait for delete message. "); eqiupment_EquipmentHelper.WaitForText("Equipment deleted successfully", 10); //} //catch (Exception e) //{ // executionLog.Log("Error", e.StackTrace); // Status = "Fail"; // String counter = executionLog.readLastLine("counter"); // String Description = executionLog.GetAllTextFile("EquipmentManagement"); // String Error = executionLog.GetAllTextFile("Error"); // Console.WriteLine(Error); // if (counter == "") // { // counter = "0"; // } // bool result = loginHelper.CheckExstingIssue("Equipment Management"); // if (!result) // { // if (Int16.Parse(counter) < 9) // { // executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); // loginHelper.CreateIssue("Equipment Management", "Bug", "Medium", "Create Eqiupment page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); // string id = loginHelper.getIssueID("Equipment Management"); // TakeScreenshot("EquipmentManagement"); // string directoryName = loginHelper.GetnewDirectoryName(GetPath()); // var location = directoryName + "\\EquipmentManagement.png"; // loginHelper.AddAttachment(location, id); // } // } // else // { // if (Int16.Parse(counter) < 9) // { // executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); // TakeScreenshot("EquipmentManagement"); // string id = loginHelper.getIssueID("Equipment Management"); // string directoryName = loginHelper.GetnewDirectoryName(GetPath()); // var location = directoryName + "\\EquipmentManagement.png"; // loginHelper.AddAttachment(location, id); // loginHelper.AddComment(loginHelper.getIssueID("Equipment Management"), "This issue is still occurring"); // } // } // JIRA = loginHelper.getIssueID("Equipment Management"); // // executionLog.DeleteFile("Error"); // throw; //} //finally //{ // executionLog.DeleteFile("EquipmentManagement"); // executionLog.WriteInExcel("Equipment Management", Status, JIRA, "Equipment Management"); //} }
public void equipentblankValidation() { 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 var name = "Test" + RandomNumber(1, 99); var Id = "12345" + RandomNumber(1, 99); String Status = "Pass"; String JIRA = ""; try { executionLog.Log("EquipentblankValidation", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("EquipentblankValidation", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("EquipentblankValidation", "Click On Admin"); VisitOffice("admin"); executionLog.Log("EquipentblankValidation", "Click On menu icon"); // eqiupment_EquipmentHelper.ClickElement("MenuIcon"); executionLog.Log("EquipentblankValidation", "Click on Terminal And Equipment Tab"); eqiupment_EquipmentHelper.MouseOverAndWait("ClickOnEquipmentTab", 2); executionLog.Log("EquipentblankValidation", "Click on equipment button"); eqiupment_EquipmentHelper.Clickjs("EquipmentBtn"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipentblankValidation", " Click On Create"); eqiupment_EquipmentHelper.ClickElement("Create"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipentblankValidation", " Click on Save button "); eqiupment_EquipmentHelper.ClickElement("Save"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipentblankValidation", "Verify validation"); eqiupment_EquipmentHelper.VerifyText("VerifyVersionVal", "This field is required."); executionLog.Log("EquipentblankValidation", "Enter Equipment Name"); eqiupment_EquipmentHelper.TypeText("Name", name); executionLog.Log("EquipentblankValidation", "Enter DownloadsIDName"); eqiupment_EquipmentHelper.Select("Type", "Check Reader"); executionLog.Log("EquipentblankValidation", "Enter Equipment version"); eqiupment_EquipmentHelper.TypeText("Version", "1"); executionLog.Log("EquipentblankValidation", " Click on Save button "); eqiupment_EquipmentHelper.ClickElement("Save"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipentblankValidation", "Wait for success text."); eqiupment_EquipmentHelper.WaitForText("Equipment saved successfully", 10); executionLog.Log("EquipentblankValidation", "Enter Name in seacrh field"); eqiupment_EquipmentHelper.TypeText("SearchEquipment", name); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("EquipentblankValidation", "Click on delete icon"); eqiupment_EquipmentHelper.ClickElement("DeleteEuipment"); executionLog.Log("EquipentblankValidation", "Accept Alert Message."); eqiupment_EquipmentHelper.AcceptAlert(); executionLog.Log("EquipentblankValidation", "Verify text Equipment deleted."); eqiupment_EquipmentHelper.WaitForText("Equipment deleted successfully.", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("EquipentblankValidation"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Equipent blank Validation"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Equipent blank Validation", "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("Equipent blank Validation"); TakeScreenshot("EquipentblankValidation"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EquipentblankValidation.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("EquipentblankValidation"); string id = loginHelper.getIssueID("Equipent blank Validation"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EquipentblankValidation.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Equipent blank Validation"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Equipent blank Validation"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("EquipentblankValidation"); executionLog.WriteInExcel("Equipent blank Validation", Status, JIRA, "Equipment Management"); } }
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 clickEditEquipmentAfterConfirmDelete() { 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 var name = "Test" + GetRandomNumber(); var Id = GetRandomNumber().ToString(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("ClickEditEquipmentAfterConfirmDelete", "Login with valid username and password"); Login(username[0], password[0]); executionLog.Log("ClickEditEquipmentAfterConfirmDelete", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("ClickEditEquipmentAfterConfirmDelete", "Go to Admin page"); VisitOffice("admin"); executionLog.Log("ClickEditEquipmentAfterConfirmDelete", "Go to equipments page."); VisitOffice("equipment"); executionLog.Log("ClickEditEquipmentAfterConfirmDelete", "Click On Create"); eqiupment_EquipmentHelper.ClickElement("Create"); executionLog.Log("ClickEditEquipmentAfterConfirmDelete", "Verify Page title"); VerifyTitle("Equipment Create"); executionLog.Log("ClickEditEquipmentAfterConfirmDelete", "Enter Equipment Name"); eqiupment_EquipmentHelper.TypeText("Name", name); executionLog.Log("ClickEditEquipmentAfterConfirmDelete", "Select type"); eqiupment_EquipmentHelper.Select("Type", "Check Reader"); executionLog.Log("ClickEditEquipmentAfterConfirmDelete", "Enter Equipment Id"); eqiupment_EquipmentHelper.TypeText("EquipmentId", Id); executionLog.Log("ClickEditEquipmentAfterConfirmDelete", "Enter Version"); eqiupment_EquipmentHelper.TypeText("Version", "Testing"); executionLog.Log("ClickEditEquipmentAfterConfirmDelete", "Enter Description"); eqiupment_EquipmentHelper.TypeText("Description", "This is Testing Description"); executionLog.Log("ClickEditEquipmentAfterConfirmDelete", " Click on Save button"); eqiupment_EquipmentHelper.ClickElement("Save"); executionLog.Log("ClickEditEquipmentAfterConfirmDelete", " Wait for success message."); eqiupment_EquipmentHelper.WaitForText("Equipment saved successfully", 10); executionLog.Log("ClickEditEquipmentAfterConfirmDelete", "SearchEquipmenmt"); eqiupment_EquipmentHelper.TypeText("SearchEquipment", name); eqiupment_EquipmentHelper.WaitForWorkAround(4000); executionLog.Log("ClickEditEquipmentAfterConfirmDelete", "Click on delete icon"); eqiupment_EquipmentHelper.ClickElement("DeleteEuipment"); executionLog.Log("ClickEditEquipmentAfterConfirmDelete", "Accept Alert"); eqiupment_EquipmentHelper.AcceptAlert(); executionLog.Log("ClickEditEquipmentAfterConfirmDelete", "Click edit equipment."); eqiupment_EquipmentHelper.ClickElement("DeleteEuipment"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ClickEditEquipmentAfterConfirmDelete"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Click Edit Equipment After Confirm Delete"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Click Edit Equipment After Confirm Delete", "Bug", "Medium", "Eqipment page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Click Edit Equipment After Confirm Delete"); TakeScreenshot("ClickEditEquipmentAfterConfirmDelete"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ClickEditEquipmentAfterConfirmDelete.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ClickEditEquipmentAfterConfirmDelete"); string id = loginHelper.getIssueID("Click Edit Equipment After Confirm Delete"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ClickEditEquipmentAfterConfirmDelete.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Click Edit Equipment After Confirm Delete"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Click Edit Equipment After Confirm Delete"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ClickEditEquipmentAfterConfirmDelete"); executionLog.WriteInExcel("Click Edit Equipment After Confirm Delete", Status, JIRA, "Equipment Management"); } }
public void cloneEquipment() { 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 var name = "Test" + GetRandomNumber(); var Id = "12345" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("CloneEquipment", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("CloneEquipment", "Login with valid username and password"); VerifyTitle("Dashboard"); executionLog.Log("CloneEquipment", "Visit equipment page."); VisitOffice("equipment"); executionLog.Log("CloneEquipment", "Verify page title."); VerifyTitle("Equipment"); var Loc = "//table[@id='list1']/tbody/tr[2]"; if (eqiupment_EquipmentHelper.IsElementPresent(Loc)) { executionLog.Log("CloneEquipment", "Click On Equipment"); eqiupment_EquipmentHelper.ClickElement("ClickOneQUIP"); executionLog.Log("CloneEquipment", "Click On Clone"); eqiupment_EquipmentHelper.ClickElement("ClickOnClone"); eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("CloneEquipment", "Verify Confirmation"); eqiupment_EquipmentHelper.VerifyPageText("Equipment is cloned successfully"); executionLog.Log("CloneEquipment", "Click on delete Clone"); eqiupment_EquipmentHelper.ClickElement("ClickDelClone"); executionLog.Log("CloneEquipment", "Accept alert message."); eqiupment_EquipmentHelper.AcceptAlert(); executionLog.Log("CloneEquipment", "Wait for delete success message."); eqiupment_EquipmentHelper.WaitForText("Equipment deleted successfully.", 30); } else { executionLog.Log("CloneEquipment", " Click On Create"); VisitOffice("equipment/create"); eqiupment_EquipmentHelper.WaitForWorkAround(3000); executionLog.Log("CloneEquipment", "Enter Equipment Name"); eqiupment_EquipmentHelper.TypeText("Name", "Clone Equipment"); executionLog.Log("CloneEquipment", "Select equipment type."); eqiupment_EquipmentHelper.Select("Type", "Check Reader"); executionLog.Log("CloneEquipment", "Enter Equipment Id"); eqiupment_EquipmentHelper.TypeText("EquipmentId", Id); executionLog.Log("CloneEquipment", "Enter Version"); eqiupment_EquipmentHelper.TypeText("Version", "Testing"); executionLog.Log("CloneEquipment", "Enter Description"); eqiupment_EquipmentHelper.TypeText("Description", "This is Testing Description"); executionLog.Log("CloneEquipment", " Click on Save button"); eqiupment_EquipmentHelper.ClickElement("Save"); eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("CloneEquipment", "Click On Equipment"); eqiupment_EquipmentHelper.ClickElement("FirstEquip"); executionLog.Log("CloneEquipment", "Click On Clone"); eqiupment_EquipmentHelper.ClickElement("ClickOnClone"); executionLog.Log("CloneEquipment", "Verify Equipment is cloned successfully"); eqiupment_EquipmentHelper.VerifyPageText("Equipment is cloned successfully"); eqiupment_EquipmentHelper.VerifyPageText("Clone of Equipment"); executionLog.Log("CloneEquipment", "Click on delete clone"); eqiupment_EquipmentHelper.ClickElement("ClickDelClone"); executionLog.Log("CloneEquipment", "Accept alert message."); eqiupment_EquipmentHelper.AcceptAlert(); executionLog.Log("CloneEquipment", "Verify Equipment is deleted successfully"); eqiupment_EquipmentHelper.VerifyPageText("Equipment deleted successfully."); eqiupment_EquipmentHelper.WaitForWorkAround(3000); } } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("CloneEquipment"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Clone Equipment"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Clone Equipment", "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("Clone Equipment"); TakeScreenshot("CloneEquipment"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CloneEquipment.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("CloneEquipment"); string id = loginHelper.getIssueID("Clone Equipment"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\CloneEquipment.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Clone Equipment"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Clone Equipment"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("CloneEquipment"); executionLog.WriteInExcel("Clone Equipment", Status, JIRA, "Admin Equipments"); } }
public void adminEquipmentEquipmentURLChange() { 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 var FirstName = "Test" + GetRandomNumber(); var LastName = "Tester" + GetRandomNumber(); var Number = "12345678" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("AdminEquipmentEquipmentURLChange", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("AdminEquipmentEquipmentURLChange", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("AdminEquipmentEquipmentURLChange", "Goto User Admin Product >> Product "); VisitOffice("equipment"); executionLog.Log("AdminEquipmentEquipmentURLChange", "Click On any Product >> Product"); eqiupment_EquipmentHelper.ClickElement("ClickOneQUIP"); eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("AdminEquipmentEquipmentURLChange", "Change the url with the url number of another office"); VisitOffice("equipment/view/616"); eqiupment_EquipmentHelper.WaitForWorkAround(5000); executionLog.Log("AdminEquipmentEquipmentURLChange", "Verify Validation"); eqiupment_EquipmentHelper.VerifyPageText("oops something went wrong"); eqiupment_EquipmentHelper.WaitForWorkAround(2000); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("AdminEquipmentEquipmentURLChange"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("AdminEquipment Equipment URL Change"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("AdminEquipment Equipment URL Change", "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("AdminEquipment Equipment URL Change"); TakeScreenshot("AdminEquipmentEquipmentURLChange"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\AdminEquipmentEquipmentURLChange.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("AdminEquipmentEquipmentURLChange"); string id = loginHelper.getIssueID("AdminEquipment Equipment URL Change"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\AdminEquipmentEquipmentURLChange.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("AdminEquipment Equipment URL Change"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("AdminEquipment Equipment URL Change"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("AdminEquipmentEquipmentURLChange"); executionLog.WriteInExcel("AdminEquipment Equipment URL Change", Status, JIRA, "Office Equipment"); } }
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 equipmentSortByAdvanceFilterIssue() { 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("EquipmentSortByAdvanceFilterIssue", "Login with valid credential Username"); Login(username[0], password[0]); executionLog.Log("EquipmentSortByAdvanceFilterIssue", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); eqiupment_EquipmentHelper.WaitForWorkAround(6000); executionLog.Log("EquipmentSortByAdvanceFilterIssue", "Goto Equipments."); VisitOffice("equipment"); eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("EquipmentSortByAdvanceFilterIssue", "Open Advance filter."); eqiupment_EquipmentHelper.ClickElement("AdvanceFilter"); eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("EquipmentSortByAdvanceFilterIssue", "Click on Modifier in Available column."); eqiupment_EquipmentHelper.ClickElement("Col_Modifier"); executionLog.Log("EquipmentSortByAdvanceFilterIssue", "Click on Add Icon to add from to display column."); eqiupment_EquipmentHelper.Clickjs("AddCols"); executionLog.Log("EquipmentSortByAdvanceFilterIssue", "Click on Medified By in Available column."); eqiupment_EquipmentHelper.ClickElement("Col_ModifiedBy"); executionLog.Log("EquipmentSortByAdvanceFilterIssue", "Click on Add Icon to add from to display column."); eqiupment_EquipmentHelper.Clickjs("AddCols"); eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("EquipmentSortByAdvanceFilterIssue", "Verify Modifier display in Sort by dropdown."); eqiupment_EquipmentHelper.OptionPresentInDropdown("Modifier"); executionLog.Log("EquipmentSortByAdvanceFilterIssue", "Verify Modified by display in Sort by drop down."); eqiupment_EquipmentHelper.OptionPresentInDropdown("Modified By"); executionLog.Log("EquipmentSortByAdvanceFilterIssue", "Open Reset button."); eqiupment_EquipmentHelper.ClickElement("ResetAdvnceFilter"); eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("EquipmentSortByAdvanceFilterIssue", "Open Advance filter."); eqiupment_EquipmentHelper.ClickElement("AdvanceFilter"); eqiupment_EquipmentHelper.WaitForWorkAround(2000); executionLog.Log("EquipmentSortByAdvanceFilterIssue", "Verify Modifier not display in Sort by dropdown."); eqiupment_EquipmentHelper.OptionNotPresentInDropdown("//*[@id='order']/option", "Modifier"); executionLog.Log("EquipmentSortByAdvanceFilterIssue", "Verify Modified By not display in Sort by dropdown."); eqiupment_EquipmentHelper.OptionNotPresentInDropdown("//*[@id='order']/option", "Modified By"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("EquipmentSortByAdvanceFilterIssue"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Equipment SortBy Advance Filter Issue"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Equipment SortBy Advance Filter Issue", "Bug", "Medium", "Amex page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Equipment SortBy Advance Filter Issue"); TakeScreenshot("EquipmentSortByAdvanceFilterIssue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EquipmentSortByAdvanceFilterIssue.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("EquipmentSortByAdvanceFilterIssue"); string id = loginHelper.getIssueID("Equipment SortBy Advance Filter Issue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\EquipmentSortByAdvanceFilterIssue.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Equipment SortBy Advance Filter Issue"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Equipment SortBy Advance Filter Issue"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("EquipmentSortByAdvanceFilterIssue"); executionLog.WriteInExcel("Equipment SortBy Advance Filter Issue", Status, JIRA, "Office Equipments"); } }
public void validationForAlreadyExistingEquipment() { 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()); // Random Variables var IdNum = "5" + GetRandomNumber(); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("ValidationForAlreadyExistingEquipment", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("ValidationForAlreadyExistingEquipment", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("ValidationForAlreadyExistingEquipment", "Redirect at equipment page."); VisitOffice("equipment"); eqiupment_EquipmentHelper.WaitForWorkAround(5000); var loc = "//table[@id='list1']/tbody/tr[2]/td[4]/a[text()='Test246']"; if (eqiupment_EquipmentHelper.IsElementPresent(loc)) { executionLog.Log("ValidationForAlreadyExistingEquipment", "Click on Edit equipment"); eqiupment_EquipmentHelper.ClickElement("EditEquipment3"); executionLog.Log("ValidationForAlreadyExistingEquipment", "Enter equipment name."); eqiupment_EquipmentHelper.TypeText("Name", "Test246"); executionLog.Log("ValidationForAlreadyExistingEquipment", "Click on Save button."); eqiupment_EquipmentHelper.ClickElement("Save"); executionLog.Log("ValidationForAlreadyExistingEquipment", "Wait for exisiting equipment alert."); eqiupment_EquipmentHelper.WaitForText("The Equipment name is already exist.", 10); } else { executionLog.Log("EditEquipment", " Click On Create"); eqiupment_EquipmentHelper.ClickElement("Create"); executionLog.Log("EditEquipment", "Verify title"); VerifyTitle("Equipment Create"); var name = "Equipment" + RandomNumber(11, 999); executionLog.Log("EditEquipment", "Enter Equipment Name"); eqiupment_EquipmentHelper.TypeText("Name", name); executionLog.Log("EditEquipment", "Enter DownloadsIDName"); eqiupment_EquipmentHelper.Select("Type", "Check Reader"); executionLog.Log("EditEquipment", "Enter Equipment Id"); eqiupment_EquipmentHelper.TypeText("EquipmentId", IdNum); executionLog.Log("EditEquipment", "Enter Version"); eqiupment_EquipmentHelper.TypeText("Version", "Testing"); executionLog.Log("EditEquipment", "Enter Description"); eqiupment_EquipmentHelper.TypeText("Description", "This is Testing Description"); executionLog.Log("EditEquipment", "Click On First CheckBox"); eqiupment_EquipmentHelper.ClickElement("ApplicableProcessors1"); executionLog.Log("EditEquipment", "Click On First CheckBox"); eqiupment_EquipmentHelper.ClickElement("ApplicableProcessors2"); executionLog.Log("EditEquipment", " Click on Save button "); eqiupment_EquipmentHelper.ClickElement("Save"); executionLog.Log("EditEquipment", "Wait for save message."); eqiupment_EquipmentHelper.WaitForText("Equipment saved successfully", 30); executionLog.Log("EditEquipment", "Enter Name in seacrh field"); eqiupment_EquipmentHelper.TypeText("EnterName", name); eqiupment_EquipmentHelper.WaitForWorkAround(4000); executionLog.Log("ValidationForAlreadyExistingEquipment", "Click on Edit equipment"); eqiupment_EquipmentHelper.ClickElement("EditEquipment"); executionLog.Log("ValidationForAlreadyExistingEquipment", "Enter equipment name."); eqiupment_EquipmentHelper.TypeText("Name", "Test246"); executionLog.Log("ValidationForAlreadyExistingEquipment", "Click on Save button."); eqiupment_EquipmentHelper.ClickElement("Save"); executionLog.Log("ValidationForAlreadyExistingEquipment", "Wait for exisiting equipment alert."); eqiupment_EquipmentHelper.WaitForText("The Equipment name is already exist.", 10); } } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ValidationForAlreadyExistingEquipment"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Validation For Already Existing Equipment"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Validation For Already Existing Equipment", "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("Validation For Already Existing Equipment"); TakeScreenshot("ValidationForAlreadyExistingEquipment"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ValidationForAlreadyExistingEquipment.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ValidationForAlreadyExistingEquipment"); string id = loginHelper.getIssueID("Validation For Already Existing Equipment"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ValidationForAlreadyExistingEquipment.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Validation For Already Existing Equipment"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Validation For Already Existing Equipment"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ValidationForAlreadyExistingEquipment"); executionLog.WriteInExcel("Validation For Already Existing Equipment", Status, JIRA, "Admin Equipments"); } }
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"); } }