public void createShippingCarrier()
        {
            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" + GetRandomNumber();
            var    URL    = "http://www.Test" + GetRandomNumber() + ".com";
            String JIRA   = "";
            String Status = "Pass";

            try
            {
                executionLog.Log("CreateShippingCarrier", "Login with valid username and password");
                Login(username[0], password[0]);
                Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]);

                executionLog.Log("CreateShippingCarrier", "Verify Page title");
                VerifyTitle("Dashboard");

                executionLog.Log("CreateShippingCarrier", "Click On  Admin");
                VisitOffice("admin");

                executionLog.Log("CreateShippingCarrier", "Redirect To Shipping Carrier");
                VisitOffice("shipping_carriers");

                executionLog.Log("CreateShippingCarrier", "Verify title");
                VerifyTitle("Shipping Carriers");

                executionLog.Log("CreateShippingCarrier", " Click On Create");
                equipment_ShippingCarrierHelper.ClickElement("Create");

                executionLog.Log("CreateShippingCarrier", "Verify title");
                VerifyTitle("Manage Shipping Carrier");

                executionLog.Log("CreateShippingCarrier", "Enter Name");
                equipment_ShippingCarrierHelper.TypeText("Name", name);

                executionLog.Log("CreateShippingCarrier", "Enter Website");
                equipment_ShippingCarrierHelper.TypeText("Website", "http://www.Test.com");

                executionLog.Log("CreateShippingCarrier", "Enter tracking URL");
                equipment_ShippingCarrierHelper.TypeText("TrackingURL", URL);

                executionLog.Log("CreateShippingCarrier", " Click on Save button  ");
                equipment_ShippingCarrierHelper.ClickElement("Save");

                executionLog.Log("CreateShippingCarrier", "Wait for text");
                equipment_ShippingCarrierHelper.WaitForText("The shipping carrier is successfully created", 30);
            }

            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("CreateShippingCarrier");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Create Shipping Carrier");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Create Shipping Carrier", "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("Create Shipping Carrier");
                        TakeScreenshot("CreateShippingCarrier");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\CreateShippingCarrier.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("CreateShippingCarrier");
                        string id            = loginHelper.getIssueID("Create Shipping Carrier");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\CreateShippingCarrier.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Create Shipping Carrier"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Create Shipping Carrier");
                //  executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("CreateShippingCarrier");
                executionLog.WriteInExcel("Create Shipping Carrier", Status, JIRA, "Equipment Management");
            }
        }
        public void adminEquipmentShippingCarrierURLChange()
        {
            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    FirstName = "Test" + GetRandomNumber();
            var    LastName  = "Tester" + GetRandomNumber();
            var    Number    = "12345678" + GetRandomNumber();
            String JIRA      = "";
            String Status    = "Pass";

            try
            {
                executionLog.Log("AdminEquipmentShippingCarrierURLChange", "Login with valid username and password");
                Login(username[0], password[0]);
                Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]);

                executionLog.Log("AdminEquipmentShippingCarrierURLChange", "Verify Page title");
                VerifyTitle("Dashboard");
                Console.WriteLine("Redirected at Dashboard screen.");

                executionLog.Log("AdminEquipmentShippingCarrierURLChange", "Goto User Equipments   >> Shipping Carrier  ");
                VisitOffice("shipping_carriers");

                executionLog.Log("AdminEquipmentShippingCarrierURLChange", "Click On any Shipping carrier");
                equipment_ShippingCarrierHelper.ClickElement("OpenAnyShiping");
                equipment_ShippingCarrierHelper.WaitForWorkAround(2000);

                executionLog.Log("AdminEquipmentShippingCarrierURLChange", "Change the url with the url number of another office");
                VisitOffice("manage_shipping_carriers/61");
                equipment_ShippingCarrierHelper.WaitForWorkAround(1000);

                executionLog.Log("AdminEquipmentShippingCarrierURLChange", "Verify Validation");
                equipment_ShippingCarrierHelper.VerifyPageText("The shipping carrier is does not exists.");
                equipment_ShippingCarrierHelper.WaitForWorkAround(4000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("AdminEquipmentShippingCarrierURLChange");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Admin Equipment Shipping Carrier URL Change");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Admin Equipment Shipping Carrier 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("Admin Equipment Shipping Carrier URL Change");
                        TakeScreenshot("AdminEquipmentShippingCarrierURLChange");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\AdminEquipmentShippingCarrierURLChange.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("AdminEquipmentShippingCarrierURLChange");
                        string id            = loginHelper.getIssueID("Admin Equipment Shipping Carrier URL Change");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\AdminEquipmentShippingCarrierURLChange.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Admin Equipment Shipping Carrier URL Change"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Admin Equipment Shipping Carrier URL Change");
                // executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("AdminEquipmentShippingCarrierURLChange");
                executionLog.WriteInExcel("Admin Equipment Shipping Carrier URL Change", Status, JIRA, "Office Equipment");
            }
        }
Пример #3
0
        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");
            }
        }
Пример #4
0
        public void equipmentShippingValidationDublicate()
        {
            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());

            // Variable
            String name   = "Test" + GetRandomNumber();
            String Id     = "12345" + GetRandomNumber();
            String JIRA   = "";
            String Status = "Pass";


            try
            {
                executionLog.Log("EquipmentShippingValidationDublicate", "Login with valid username and password");
                Login(username[0], password[0]);
                Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]);

                executionLog.Log("EquipmentShippingValidationDublicate", "Verify Page title");
                VerifyTitle("Dashboard");
                Console.WriteLine("Redirected at Dashboard screen.");

                executionLog.Log("EquipmentShippingValidationDublicate", "Visit office Admin");
                VisitOffice("admin");
                equipment_ShippingCarrierHelper.WaitForWorkAround(2000);

                executionLog.Log("EquipmentShippingValidationDublicate", "Redirect To shipping carrier page");
                VisitOffice("shipping_carriers");
                equipment_ShippingCarrierHelper.WaitForWorkAround(4000);


                executionLog.Log("EquipmentShippingValidationDublicate", "Verify title");
                VerifyTitle("Shipping Carriers");
                equipment_ShippingCarrierHelper.WaitForWorkAround(4000);

                executionLog.Log("EquipmentShippingValidationDublicate", "Search shipping carrier.");
                equipment_ShippingCarrierHelper.TypeText("SearchName", "Shipping Validation");
                equipment_ShippingCarrierHelper.WaitForWorkAround(3000);

                executionLog.Log("EquipmentShippingValidationDublicate", "Wait for element to present.");
                equipment_ShippingCarrierHelper.WaitForElementPresent("ClickOnShippingCarriersLink", 10);
                equipment_ShippingCarrierHelper.WaitForWorkAround(4000);

                var Loc = "//table[@id='list1']/tbody/tr[2]/td[3]/a[text()='Shipping Validation']";
                if (equipment_ShippingCarrierHelper.IsElementPresent(Loc))
                {
                    executionLog.Log("EquipmentShippingValidationDublicate", "Click On Create Shipping");
                    equipment_ShippingCarrierHelper.ClickElement("ClickOnCreateShipping");
                    equipment_ShippingCarrierHelper.WaitForWorkAround(1000);

                    executionLog.Log("EquipmentShippingValidationDublicate", "Enter Shipping Carrier Name");
                    equipment_ShippingCarrierHelper.TypeText("Name", "Shipping Validation");
                    equipment_ShippingCarrierHelper.WaitForWorkAround(4000);


                    executionLog.Log("EquipmentShippingValidationDublicate", "Enter Tracking URL");
                    equipment_ShippingCarrierHelper.TypeText("TrackingURL", "https://www.mypegasuscrm.com");
                    equipment_ShippingCarrierHelper.WaitForWorkAround(4000);

                    executionLog.Log("EquipmentShippingValidationDublicate", "Click On Save Btn Shiping");
                    equipment_ShippingCarrierHelper.ClickElement("Save");
                    equipment_ShippingCarrierHelper.WaitForWorkAround(4000);

                    executionLog.Log("EquipmentShippingValidationDublicate", "Wait for validation message.");
                    equipment_ShippingCarrierHelper.WaitForText("The shipping carrier is already exists.", 30);
                    equipment_ShippingCarrierHelper.WaitForWorkAround(4000);
                }
                else
                {
                    executionLog.Log("EquipmentShippingValidationDublicate", "Click On Create Shipping");
                    equipment_ShippingCarrierHelper.ClickElement("ClickOnCreateShipping");
                    equipment_ShippingCarrierHelper.WaitForWorkAround(3000);

                    executionLog.Log("EquipmentShippingValidationDublicate", "Enter Shipping Carrier Name");
                    equipment_ShippingCarrierHelper.TypeText("Name", "Shipping Validation");
                    equipment_ShippingCarrierHelper.WaitForWorkAround(4000);


                    executionLog.Log("EquipmentShippingValidationDublicate", "Enter Tracking URL");
                    equipment_ShippingCarrierHelper.TypeText("TrackingURL", "https://www.mypegasuscrm.com");
                    equipment_ShippingCarrierHelper.WaitForWorkAround(4000);


                    executionLog.Log("EquipmentShippingValidationDublicate", "Click On Save Btn Shiping");
                    equipment_ShippingCarrierHelper.ClickElement("Save");
                    equipment_ShippingCarrierHelper.WaitForWorkAround(4000);

                    executionLog.Log("EquipmentShippingValidationDublicate", "Wait for success message.");
                    equipment_ShippingCarrierHelper.WaitForText("The shipping carrier is successfully created", 30);
                    equipment_ShippingCarrierHelper.WaitForWorkAround(4000);

                    executionLog.Log("EquipmentShippingValidationDublicate", "Click On Create Shipping");
                    equipment_ShippingCarrierHelper.ClickElement("ClickOnCreateShipping");
                    equipment_ShippingCarrierHelper.WaitForWorkAround(4000);

                    executionLog.Log("EquipmentShippingValidationDublicate", "Enter Shipping Carrier Name");
                    equipment_ShippingCarrierHelper.TypeText("Name", "Shipping Validation");
                    equipment_ShippingCarrierHelper.WaitForWorkAround(4000);

                    executionLog.Log("EquipmentShippingValidationDublicate", "Enter Tracking URL");
                    equipment_ShippingCarrierHelper.TypeText("EnterTrackingURL", "https://www.mypegasuscrm.com");
                    equipment_ShippingCarrierHelper.WaitForWorkAround(4000);

                    executionLog.Log("EquipmentShippingValidationDublicate", "Click On Save Btn Shiping");
                    equipment_ShippingCarrierHelper.ClickElement("Save");
                    equipment_ShippingCarrierHelper.WaitForWorkAround(4000);

                    executionLog.Log("EquipmentShippingValidationDublicate", "Wait for validation message.");
                    equipment_ShippingCarrierHelper.WaitForText("The shipping carrier is already exists.", 30);
                }
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("EquipmentShippingValidationDublicate");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Equipment Shipping Validation Dublicate");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Equipment Shipping Validation Dublicate", "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("Equipment Shipping Validation Dublicate");
                        TakeScreenshot("EquipmentShippingValidationDublicate");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\EquipmentShippingValidationDublicate.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("EquipmentShippingValidationDublicate");
                        string id            = loginHelper.getIssueID("Equipment Shipping Validation Dublicate");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\EquipmentShippingValidationDublicate.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Equipment Shipping Validation Dublicate"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Equipment Shipping Validation Dublicate");
                // executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("EquipmentShippingValidationDublicate");
                executionLog.WriteInExcel("Equipment Shipping Validation Dublicate", Status, JIRA, "Admin Equipments");
            }
        }
Пример #5
0
        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");
            }
        }
Пример #6
0
        public void shippingFilterError()
        {
            string[] username = null;
            string[] password = null;
            string[] log      = null;
            String   JIRA     = "";
            String   Status   = "Pass";

            var oXMLData = new XMLParse();

            oXMLData.LoadXML("../../Config/ApplicationSettings.xml");

            username = oXMLData.getData("settings/Credentials", "username_office");
            password = oXMLData.getData("settings/Credentials", "password");
            log      = oXMLData.getData("settings/URL", "logout");

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var equipment_ShippingCarrierHelper = new Equipment_ShippingCarrierHelper(GetWebDriver());

            // Initializing the event
            var Name    = "TestShipping" + RandomNumber(10, 300);
            var Website = "https://www.shipping" + RandomNumber(10, 100) + ".com";
            var Url     = "https://www.shippingtrack" + RandomNumber(10, 100) + ".com";


            try
            {
                executionLog.Log("ShippingFilterError", "Login with valid username and password");
                Login(username[0], password[0]);
                Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]);

                executionLog.Log("ShippingFilterError", "Verify Page title");
                VerifyTitle("Dashboard");
                Console.WriteLine("Redirected at Dashboard screen.");

                executionLog.Log("ShippingFilterError", "Visit to create vendor page");
                VisitOffice("shipping_carriers");
                equipment_ShippingCarrierHelper.WaitForWorkAround(3000);

                executionLog.Log("ShippingFilterError", "Verify title");
                VerifyTitle("Shipping Carriers");

                var loc = "//table[@id='list1']/tbody/tr[2]/td[2]";
                if (equipment_ShippingCarrierHelper.IsElementPresent(loc))
                {
                    equipment_ShippingCarrierHelper.WaitForWorkAround(4000);
                    executionLog.Log("ShippingFilterError", "Verify filter is reset successfully");
                    equipment_ShippingCarrierHelper.verifyElementPresent("NonFilter");
                }

                else
                {
                    executionLog.Log("ShippingFilterError", "Click on create");
                    equipment_ShippingCarrierHelper.ClickElement("Create");
                    equipment_ShippingCarrierHelper.WaitForWorkAround(4000);

                    executionLog.Log("ShippingFilterError", "Enter the name");
                    equipment_ShippingCarrierHelper.TypeText("Name", Name);

                    executionLog.Log("ShippingFilterError", "Enter the website url");
                    equipment_ShippingCarrierHelper.TypeText("Website", Website);

                    executionLog.Log("ShippingFilterError", "Enter the tracking url");
                    equipment_ShippingCarrierHelper.TypeText("TrackingURL", Url);

                    executionLog.Log("ShippingFilterError", "Click on save button");
                    equipment_ShippingCarrierHelper.ClickElement("Save");
                    equipment_ShippingCarrierHelper.WaitForWorkAround(6000);

                    executionLog.Log("ShippingFilterError", "verify title");
                    VerifyTitle("Shipping Carriers");

                    executionLog.Log("ShippingFilterError", "Verify filter is reset successfully");
                    equipment_ShippingCarrierHelper.verifyElementPresent("NonFilter");

                    executionLog.Log("ShippingFilterError", "Log out from the application");
                    VisitOffice("logout");
                }
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("ShippingFilterError");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Shipping Filter Error");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Shipping Filter 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("Shipping Filter Error");
                        TakeScreenshot("ShippingFilterError");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\ShippingFilterError.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("ShippingFilterError");
                        string id            = loginHelper.getIssueID("Shipping Filter Error");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\ShippingFilterError.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Shipping Filter Error"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Shipping Filter Error");
                //  executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("ShippingFilterError");
                executionLog.WriteInExcel("Shipping Filter Error", Status, JIRA, "Equipment Management");
            }
        }