示例#1
0
        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 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");
            }
        }
示例#3
0
        public void equipmentModifierError()
        {
            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("EquipmentModifierError", "Login with valid username and password");
                Login(username[0], password[0]);
                Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]);

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

                executionLog.Log("EquipmentModifierError", "Redirect at Admin page.");
                VisitOffice("admin");

                executionLog.Log("EquipmentModifierError", "Redirect to equipment page.");
                VisitOffice("equipment");

                executionLog.Log("EquipmentModifierError", " Click On Create");
                eqiupment_EquipmentHelper.ClickElement("Create");
                eqiupment_EquipmentHelper.WaitForWorkAround(3000);

                executionLog.Log("EquipmentModifierError", "Click on Save button");
                eqiupment_EquipmentHelper.ClickElement("Save");

                executionLog.Log("EquipmentModifierError", "Verify modifier is not mandatory");
                Assert.IsFalse(eqiupment_EquipmentHelper.IsElementPresent("//*[@id='EquipmentModifier-error']"));
                eqiupment_EquipmentHelper.WaitForWorkAround(3000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";
                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("EquipmentModifierError");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Equipment Modifier Error");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Equipment Modifier 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("Equipment Modifier Error");
                        TakeScreenshot("EquipmentModifierError");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\EquipmentModifierError.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("EquipmentModifierError");
                        string id            = loginHelper.getIssueID("Equipment Modifier Error");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\EquipmentModifierError.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Equipment Modifier Error"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Equipment Modifier Error");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("EquipmentModifierError");
                executionLog.WriteInExcel("Equipment Modifier Error", Status, JIRA, "Equipment Management");
            }
        }
示例#4
0
        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");
            }
        }