public void shippingCarrierSaveWithInvalidURLIssue() { 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 equipment_ShippingCarrierHelper = new Equipment_ShippingCarrierHelper(GetWebDriver()); String JIRA = ""; String Status = "Pass"; try { executionLog.Log("ShippingCarrierSaveWithInvalidURLIssue", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("ShippingCarrierSaveWithInvalidURLIssue", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("ShippingCarrierSaveWithInvalidURLIssue", "Redirect at shipping carriers page."); VisitOffice("shipping_carriers"); executionLog.Log("ShippingCarrierSaveWithInvalidURLIssue", "Click on Edit button."); equipment_ShippingCarrierHelper.ClickElement("Edit"); executionLog.Log("ShippingCarrierSaveWithInvalidURLIssue", "Wait for tracking Url."); equipment_ShippingCarrierHelper.WaitForElementPresent("TrackingURL", 10); executionLog.Log("ShippingCarrierSaveWithInvalidURLIssue", "Enter Tracking Url."); equipment_ShippingCarrierHelper.TypeText("TrackingURL", "Test"); executionLog.Log("ShippingCarrierSaveWithInvalidURLIssue", "Click on Save button."); equipment_ShippingCarrierHelper.ClickElement("Save"); executionLog.Log("ShippingCarrierSaveWithInvalidURLIssue", "Wait for tracking Url error validation."); equipment_ShippingCarrierHelper.WaitForElementPresent("TrackingError2", 10); executionLog.Log("ShippingCarrierSaveWithInvalidURLIssue", "Verify Please enter a valid URL."); equipment_ShippingCarrierHelper.VerifyText("TrackingError2", "Please enter a valid URL."); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ShippingCarrierSaveWithInvalidURLIssue"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Shipping Carrier Save With Invalid URL Issue"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Shipping Carrier Save With Invalid URL Issue", "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("Shipping Carrier Save With Invalid URL Issue"); TakeScreenshot("ShippingCarrierSaveWithInvalidURLIssue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ShippingCarrierSaveWithInvalidURLIssue.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ShippingCarrierSaveWithInvalidURLIssue"); string id = loginHelper.getIssueID("Shipping Carrier Save With Invalid URL Issue"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ShippingCarrierSaveWithInvalidURLIssue.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Shipping Carrier Save With Invalid URL Issue"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Shipping Carrier Save With Invalid URL Issue"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ShippingCarrierSaveWithInvalidURLIssue"); executionLog.WriteInExcel("Shipping Carrier Save With Invalid URL Issue", Status, JIRA, "Admin Equipments"); } }
public void verifyUserRedirectToShippingOnCancel() { 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"); String JIRA = ""; String Status = "Pass"; // Initializing the objects var executionLog = new ExecutionLog(); var loginHelper = new LoginHelper(GetWebDriver()); var equipment_ShippingCarrierHelper = new Equipment_ShippingCarrierHelper(GetWebDriver()); // Variable String name = "Test" + RandomNumber(1, 99); String Id = "12345" + RandomNumber(1, 99); try { executionLog.Log("VerifyUserRedirectToShippingOnCancel", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("VerifyUserRedirectToShippingOnCancel", "Verify Page title"); VerifyTitle("Dashboard"); Console.WriteLine("Redirected at Dashboard screen."); executionLog.Log("VerifyUserRedirectToShippingOnCancel", "Redirect at Admin page."); VisitOffice("admin"); executionLog.Log("VerifyUserRedirectToShippingOnCancel", "Redirect to manage shipping careers page."); VisitOffice("manage_shipping_carriers"); executionLog.Log("VerifyUserRedirectToShippingOnCancel", " Click On Cancel"); equipment_ShippingCarrierHelper.ClickElement("ClickCancelBtn"); equipment_ShippingCarrierHelper.WaitForWorkAround(3000); executionLog.Log("VerifyUserRedirectToShippingOnCancel", "Verify heading"); equipment_ShippingCarrierHelper.VerifyText("VerifyTextHedaing", "Shipping Carriers"); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("VerifyUserRedirectToShippingOnCancel"); String Error = executionLog.GetAllTextFile("Error"); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Verify User Redirect To Shipping On Cancel"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Verify User Redirect To Shipping On Cancel", "Bug", "Medium", "Shipping carriers page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Verify User Redirect To Shipping On Cancel"); TakeScreenshot("VerifyUserRedirectToShippingOnCancel"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyUserRedirectToShippingOnCancel.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("VerifyUserRedirectToShippingOnCancel"); string id = loginHelper.getIssueID("Verify User Redirect To Shipping On Cancel"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\VerifyUserRedirectToShippingOnCancel.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Verify User Redirect To Shipping On Cancel"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Verify User Redirect To Shipping On Cancel"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("VerifyUserRedirectToShippingOnCancel"); executionLog.WriteInExcel("Verify User Redirect To Shipping On Cancel", Status, JIRA, "Equipment Management"); } }
public void shippingCarrierManagement() { 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 equipment_ShippingCarrierHelper = new Equipment_ShippingCarrierHelper(GetWebDriver()); // Variable var name = "Test" + RandomNumber(1, 999); var URL = "http://www.Test" + GetRandomNumber() + ".com"; String JIRA = ""; String Status = "Pass"; try { executionLog.Log("ShippingCarrierManagement", "Login with valid username and password"); Login(username[0], password[0]); Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]); executionLog.Log("ShippingCarrierManagement", "Verify Page title"); VerifyTitle("Dashboard"); executionLog.Log("ShippingCarrierManagement", "Click On Admin"); VisitOffice("admin"); executionLog.Log("ShippingCarrierManagement", "Redirect To Shipping Carrier"); VisitOffice("shipping_carriers"); executionLog.Log("ShippingCarrierManagement", "Verify title"); VerifyTitle("Shipping Carriers"); executionLog.Log("ShippingCarrierManagement", " Click On Create"); equipment_ShippingCarrierHelper.ClickElement("Create"); executionLog.Log("ShippingCarrierManagement", "Verify title"); VerifyTitle("Manage Shipping Carrier"); executionLog.Log("ShippingCarrierManagement", " Click on Save button "); equipment_ShippingCarrierHelper.ClickElement("Save"); executionLog.Log("ShippingCarrierManagement", "Verify error for name"); equipment_ShippingCarrierHelper.VerifyText("ShippingNameErr", "This field is required."); executionLog.Log("ShippingCarrierManagement", "Verify tracking url Mandatory message."); equipment_ShippingCarrierHelper.VerifyText("TrackinError", "This field is required."); executionLog.Log("ShippingCarrierManagement", "Enter Name"); equipment_ShippingCarrierHelper.TypeText("Name", name); executionLog.Log("ShippingCarrierManagement", "Enter invalid Website"); equipment_ShippingCarrierHelper.TypeText("Website", "www.testweb.com"); executionLog.Log("ShippingCarrierManagement", "Enter invalid tracking URL"); equipment_ShippingCarrierHelper.TypeText("TrackingURL", "1213"); executionLog.Log("ShippingCarrierManagement", " Click on Save button "); equipment_ShippingCarrierHelper.ClickElement("Save"); executionLog.Log("ShippingCarrierManagement", "Verify validation for invalid url"); equipment_ShippingCarrierHelper.VerifyText("TrackingError2", "Please enter a valid URL."); executionLog.Log("ShippingCarrierManagement", "Verify validation for invalid url"); equipment_ShippingCarrierHelper.VerifyText("WebError", "Please enter a valid URL."); executionLog.Log("ShippingCarrierManagement", "Enter Name"); equipment_ShippingCarrierHelper.TypeText("Name", name); executionLog.Log("ShippingCarrierManagement", "Enter valid Website"); equipment_ShippingCarrierHelper.TypeText("Website", "http://www.test.com"); executionLog.Log("ShippingCarrierManagement", "Enter valid tracking URL"); equipment_ShippingCarrierHelper.TypeText("TrackingURL", URL); executionLog.Log("ShippingCarrierManagement", " Click on Save button "); equipment_ShippingCarrierHelper.ClickElement("Save"); executionLog.Log("ShippingCarrierManagement", "Wait for text"); equipment_ShippingCarrierHelper.WaitForText("The shipping carrier is successfully created", 10); executionLog.Log("ShippingCarrierManagement", "Enter Shipping Carrier name in search field"); equipment_ShippingCarrierHelper.TypeText("SearchName", name); equipment_ShippingCarrierHelper.WaitForWorkAround(4000); executionLog.Log("ShippingCarrierManagement", "Click on Edit "); equipment_ShippingCarrierHelper.ClickElement("Edit"); executionLog.Log("ShippingCarrierManagement", "Verify title"); VerifyTitle("Manage Shipping Carrier"); executionLog.Log("ShippingCarrierManagement", "Enter new Name"); equipment_ShippingCarrierHelper.TypeText("Name", name + "1"); executionLog.Log("ShippingCarrierManagement", "Enter a new website"); equipment_ShippingCarrierHelper.TypeText("Website", "http://www.shipping.com"); executionLog.Log("ShippingCarrierManagement", "Enter TrackingUrl"); equipment_ShippingCarrierHelper.TypeText("TrackingURL", URL); executionLog.Log("ShippingCarrierManagement", " Click on Save button "); equipment_ShippingCarrierHelper.ClickElement("Save"); executionLog.Log("ShippingCarrierManagement", "wait for success text"); equipment_ShippingCarrierHelper.WaitForText("The shipping carrier is successfully updated", 10); executionLog.Log("ShippingCarrierManagement", "Redirect To Shipping Carrier"); VisitOffice("shipping_carriers"); executionLog.Log("ShippingCarrierManagement", " Click on Status icon"); equipment_ShippingCarrierHelper.ClickElement("Status"); equipment_ShippingCarrierHelper.AcceptAlert(); executionLog.Log("ShippingCarrierManagement", " Wait for success message"); equipment_ShippingCarrierHelper.WaitForText("Equipment Shipping Carrier is successfully deactivated", 10); executionLog.Log("ShippingCarrierManagement", " Click on Status icon"); equipment_ShippingCarrierHelper.ClickElement("Status"); equipment_ShippingCarrierHelper.AcceptAlert(); executionLog.Log("ShippingCarrierManagement", " Wait for success message"); equipment_ShippingCarrierHelper.WaitForText("Equipment Shipping Carrier is successfully activated", 10); } catch (Exception e) { executionLog.Log("Error", e.StackTrace); Status = "Fail"; String counter = executionLog.readLastLine("counter"); String Description = executionLog.GetAllTextFile("ShippingCarrierManagement"); String Error = executionLog.GetAllTextFile("Error"); Console.WriteLine(Error); if (counter == "") { counter = "0"; } bool result = loginHelper.CheckExstingIssue("Shipping Carrier Management"); if (!result) { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); loginHelper.CreateIssue("Shipping Carrier Management", "Bug", "Medium", "Shipping Carrier page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error); string id = loginHelper.getIssueID("Shipping Carrier Management"); TakeScreenshot("ShippingCarrierManagement"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ShippingCarrierManagement.png"; loginHelper.AddAttachment(location, id); } } else { if (Int16.Parse(counter) < 9) { executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString()); TakeScreenshot("ShippingCarrierManagement"); string id = loginHelper.getIssueID("Shipping Carrier Management"); string directoryName = loginHelper.GetnewDirectoryName(GetPath()); var location = directoryName + "\\ShippingCarrierManagement.png"; loginHelper.AddAttachment(location, id); loginHelper.AddComment(loginHelper.getIssueID("Shipping Carrier Management"), "This issue is still occurring"); } } JIRA = loginHelper.getIssueID("Shipping Carrier Management"); // executionLog.DeleteFile("Error"); throw; } finally { executionLog.DeleteFile("ShippingCarrierManagement"); executionLog.WriteInExcel("Shipping Carrier Management", Status, JIRA, "Equipment Management"); } }