public void partAgentLeadsCreditsIssue()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

            // Initializing the objects
            var executionLog       = new ExecutionLog();
            var loginHelper        = new LoginHelper(GetWebDriver());
            var office_LeadsHelper = new Office_LeadsHelper(GetWebDriver());

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

            // Variable
            var    FName  = "Test" + RandomNumber(99, 99999);
            var    LName  = "Test" + RandomNumber(99, 99999);
            var    CDBA   = "New" + RandomNumber(99, 99999);
            String JIRA   = "";
            String Status = "Pass";

            try
            {
                executionLog.Log("PartAgentLeadsCreditsIssue", "Login with valid credential  Username");
                Login(username[0], password[0]);
                Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]);
                //office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("PartAgentLeadsCreditsIssue", "Redirect to Create Lead page.");
                VisitOffice("leads/create");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("PartAgentLeadsCreditsIssue", "Verify page title.");
                VerifyTitle("Create a Lead");

                executionLog.Log("PartAgentLeadsCreditsIssue", "Enter First Name");
                office_LeadsHelper.TypeText("FirstNameLead", FName);

                executionLog.Log("PartAgentLeadsCreditsIssue", "Enter Last Name");
                office_LeadsHelper.TypeText("LastName", LName);

                executionLog.Log("PartAgentLeadsCreditsIssue", "Enter Company DBA");
                office_LeadsHelper.TypeText("CompanyName", CDBA);

                executionLog.Log("PartAgentLeadsCreditsIssue", "Select Status");
                office_LeadsHelper.SelectByText("LeadStatus", "New");

                executionLog.Log("PartAgentLeadsCreditsIssue", "Select lead Responsibility");
                office_LeadsHelper.SelectByText("Responsibility", "Howard Tang");

                executionLog.Log("PartAgentLeadsCreditsIssue", "Click on Save");
                office_LeadsHelper.ClickElement("SaveLeadNewSkin");

                executionLog.Log("PartAgentLeadsCreditsIssue", "Wait for creation success text.");
                office_LeadsHelper.WaitForText("Lead saved successfully.", 10);

                executionLog.Log("PartAgentLeadsCreditsIssue", "Verify Lead created by credits.");
                office_LeadsHelper.VerifyText("CreatedBy", "Howard Tang");

                executionLog.Log("PartAgentLeadsCreditsIssue", "Verify Lead modified by credits");
                office_LeadsHelper.VerifyText("ModifiedBy", "Howard Tang");

                VisitOffice("leads");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("PartAgentLeadsCreditsIssue", "Select first lead");
                office_LeadsHelper.ClickElement("CheckDocToDel");

                executionLog.Log("PartAgentLeadsCreditsIssue", "Click on delete button.");
                office_LeadsHelper.ClickElement("DeleteLead");
                office_LeadsHelper.AcceptAlert();

                executionLog.Log("PartAgentLeadsCreditsIssue", "Wait for confirmation message.");
                office_LeadsHelper.WaitForText("1 records deleted successfully", 10);

                executionLog.Log("PartAgentLeadsCreditsIssue", "Redirect at leads recycle bin page.");
                VisitOffice("leads/recyclebin");

                executionLog.Log("PartAgentLeadsCreditsIssue", "Verify page title.");
                VerifyTitle("Recycled Leads");

                executionLog.Log("PartAgentLeadsCreditsIssue", "Click on delete icon");
                office_LeadsHelper.ClickElement("DeleteLeadPer");
                office_LeadsHelper.AcceptAlert();

                executionLog.Log("PartAgentLeadsCreditsIssue", "Wait for confirmation.");
                office_LeadsHelper.WaitForText("Lead Permanently Deleted.", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("PartAgentLeadsCreditsIssue");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("PartAgentLeadsCreditsIssue");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("PartAgentLeadsCreditsIssue", "Bug", "Medium", "Leads page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("PartAgentLeadsCreditsIssue");
                        TakeScreenshot("PartAgentLeadsCreditsIssue");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\PartAgentLeadsCreditsIssue.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("PartAgentLeadsCreditsIssue");
                        string id            = loginHelper.getIssueID("PartAgentLeadsCreditsIssue");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\PartAgentLeadsCreditsIssue.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("PartAgentLeadsCreditsIssue"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("PartAgentLeadsCreditsIssue");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("PartAgentLeadsCreditsIssue");
                executionLog.WriteInExcel("PartAgentLeadsCreditsIssue", Status, JIRA, "Lead Management");
            }
        }
Esempio n. 2
0
        public void verifyQuickLookLabelsForLeads()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

            // Initializing the objects
            var executionLog       = new ExecutionLog();
            var loginHelper        = new LoginHelper(GetWebDriver());
            var office_LeadsHelper = new Office_LeadsHelper(GetWebDriver());

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

            // Variable
            var    name   = "Lead" + RandomNumber(99, 99999);
            var    CDBA   = "DBA" + RandomNumber(99, 99999);
            String JIRA   = "";
            String Status = "Pass";

            try
            {
                executionLog.Log("VerifyQuickLookLabelsForLeads", "Login with valid credential  Username");
                Login(username[0], password[0]);

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

                executionLog.Log("VerifyQuickLookLabelsForLeads", "Redirect at Create Lead");
                VisitOffice("leads/create");

                executionLog.Log("VerifyQuickLookLabelsForLeads", "Click on Save");
                office_LeadsHelper.ClickElement("SaveLeadNewSkin");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForLeads", "Enter First Name");
                office_LeadsHelper.TypeText("FirstNameLead", "LeadFirst");

                executionLog.Log("VerifyQuickLookLabelsForLeads", "Enter Last Name");
                office_LeadsHelper.TypeText("LeadLastName", "LeadLast");

                executionLog.Log("VerifyQuickLookLabelsForLeads", "Enter Lead Company DBA Name");
                office_LeadsHelper.TypeText("CompanyName", CDBA);

                executionLog.Log("VerifyQuickLookLabelsForLeads", "Wait for element to be visible.");
                office_LeadsHelper.WaitForElementPresent("LeadStatus", 10);

                executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Lead Status");
                office_LeadsHelper.SelectByText("LeadStatus", "New");

                executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Responsibilities");
                office_LeadsHelper.SelectByText("Responsibility", "Howard Tang");

                executionLog.Log("VerifyQuickLookLabelsForLeads", "Click on Save");
                office_LeadsHelper.ClickElement("SaveLeadNewSkin");
                office_LeadsHelper.WaitForWorkAround(7000);


                var loc = "//h3[text()='Existing Leads']";
                if (office_LeadsHelper.IsElementPresent(loc))
                {
                    Console.WriteLine("We are in first If cond as lead is duplicate !!");
                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Click on Duplicate");
                    office_LeadsHelper.ClickJS("CraeteLeadDub");
                    office_LeadsHelper.WaitForText("Lead saved successfully.", 10);
                }
                else
                {
                    Console.WriteLine("We are in first else cond as lead is not duplicate !!");
                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Wait for Confirmation");
                    office_LeadsHelper.WaitForText("Lead saved successfully.", 10);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for Leads type.");
                    office_LeadsHelper.VerifyText("ClientType", "Click to edit");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for status.");
                    office_LeadsHelper.VerifyText("Status", "New");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for source.");
                    office_LeadsHelper.VerifyText("Source", "Select");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for category");
                    office_LeadsHelper.VerifyText("Category", "Click to edit");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for responsibility");
                    office_LeadsHelper.VerifyText("Responsibilityl", "Howard Tang");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for account manager.");
                    office_LeadsHelper.VerifyText("AccountManager", "Select");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for partner agent.");
                    office_LeadsHelper.VerifyText("PartnerAgentl", "Select");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Save Button");
                    office_LeadsHelper.VerifyText("PartnerAssociationl", "Select");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Save Button");
                    office_LeadsHelper.VerifyText("SalesManager", "Select");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Click on company details tab.");
                    office_LeadsHelper.ClickElement("CompanyDetails");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Click on assignments.");
                    office_LeadsHelper.ClickElement("EditAssignment");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Wait for locator to be present.");
                    office_LeadsHelper.WaitForElementPresent("Clientt", 10);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Leads type.");
                    office_LeadsHelper.Select("Clientt", "Processing");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Leads refferal source.");
                    office_LeadsHelper.Select("SelectSource", "Campaign");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Leads category.");
                    office_LeadsHelper.SelectByText("SelectCat", "test");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select account manager.");
                    office_LeadsHelper.SelectByText("SelectAcc.Mgr", "Howard Tang");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Leads user group.");
                    office_LeadsHelper.Select("Ugroup", "81");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select sales manager.");
                    office_LeadsHelper.SelectByText("SelectSaleManager", "Howard Tang");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Leads responsibility");
                    office_LeadsHelper.SelectByText("Responsibility", "Howard Tang");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select partner agent.");
                    office_LeadsHelper.SelectByText("PartnerAgent", "Mark Matthews");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select partner association.");
                    office_LeadsHelper.SelectByText("PartnerAssociation", "AslamP.Association.");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "click on save Leads");
                    office_LeadsHelper.ClickElement("SaveLead");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "click on info tab.");
                    office_LeadsHelper.ClickElement("InfoTab");

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Wait for locator to be present.");
                    office_LeadsHelper.WaitForElementPresent("ClientsType", 10);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for Leads type.");
                    office_LeadsHelper.VerifyText("ClientsType", "Processing");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for status.");
                    office_LeadsHelper.VerifyText("Status", "New");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for source.");
                    office_LeadsHelper.VerifyText("Source", "Campaign");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for category.");
                    office_LeadsHelper.VerifyText("Category", "test");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for responsibility.");
                    office_LeadsHelper.VerifyText("Responsibilityl", "Howard Tang");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for account manager.");
                    office_LeadsHelper.VerifyText("AccountManager", "Howard Tang");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for partner agent.");
                    office_LeadsHelper.VerifyText("PartnerAgentl", "Mark Matthews");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for partner association.");
                    office_LeadsHelper.VerifyText("PartnerAssociationl", "AslamP.Association.");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for partner association.");
                    office_LeadsHelper.VerifyText("SalesManager", "Howard Tang");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Redirect To leads page. ");
                    VisitOffice("leads");

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Enter Company Name");
                    office_LeadsHelper.TypeText("CompanySearch", CDBA);
                    office_LeadsHelper.WaitForWorkAround(2000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select lead by check box");
                    office_LeadsHelper.ClickElement("ClickOn1stOpp");
                    office_LeadsHelper.WaitForWorkAround(2000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Click on delete lead");
                    office_LeadsHelper.ClickElement("DeleteLead");

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Accept alert message.");
                    office_LeadsHelper.AcceptAlert();

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Wait for success message.");
                    office_LeadsHelper.WaitForText("1 records deleted successfully", 10);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Redirect To leads recycle bin page. ");
                    VisitOffice("leads/recyclebin");

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Enter Company Name");
                    office_LeadsHelper.TypeText("SearchLeadRbin", CDBA);
                    office_LeadsHelper.WaitForWorkAround(2000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Click on delete leads");
                    office_LeadsHelper.ClickElement("DeleteRbin");

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Accept alert message.");
                    office_LeadsHelper.AcceptAlert();

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Wait for success message.");
                    office_LeadsHelper.WaitForText("Lead Permanently Deleted.", 10);
                }
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyQuickLookLabelsForLeads");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("VerifyQuickLookLabelsForLeads");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Opportunities", "Bug", "Medium", "Leadss page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("VerifyQuickLookLabelsForLeads");
                        TakeScreenshot("VerifyQuickLookLabelsForLeads");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyQuickLookLabelsForLeads.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyQuickLookLabelsForLeads");
                        string id            = loginHelper.getIssueID("VerifyQuickLookLabelsForLeads");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyQuickLookLabelsForLeads.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("VerifyQuickLookLabelsForLeads"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("VerifyQuickLookLabelsForLeads");
                //    executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyQuickLookLabelsForLeads");
                executionLog.WriteInExcel("VerifyQuickLookLabelsForLeads", Status, JIRA, "Leads management");
            }
        }
        public void verifyModifiedByCredentialsforLead()
        {
            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 office_LeadsHelper = new Office_LeadsHelper(GetWebDriver());

            // Variable
            var    FirstName = "Test" + RandomNumber(1, 99);
            var    LastName  = "Tester" + RandomNumber(1, 99);
            var    Number    = "12345678" + RandomNumber(10, 99);
            String JIRA      = "";
            String Status    = "Pass";

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

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

                executionLog.Log("VerifyModifiedByCredentialsforLead", "Click on Leads in Topmenu");
                VisitOffice("leads");

                executionLog.Log("VerifyModifiedByCredentialsforLead", "Verify Page title");
                VerifyTitle("Leads");

                executionLog.Log("VerifyModifiedByCredentialsforLead", "Click On Any Lead");
                office_LeadsHelper.ClickElement("ClickAnyLead");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyModifiedByCredentialsforLead", "Click On Convert lead button");
                office_LeadsHelper.ClickElement("ClickConvert");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyModifiedByCredentialsforLead", "Click on save button");
                office_LeadsHelper.ClickElement("SaveConvertLead");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyModifiedByCredentialsforLead", "Verify Success text for lead conversion.");
                office_LeadsHelper.VerifyPageText("Lead is converted and moved to recyclebin.");

                executionLog.Log("VerifyModifiedByCredentialsforLead", "");
                office_LeadsHelper.VerifyPageText("Clients");

                executionLog.Log("VerifyModifiedByCredentialsforLead", "Verify Modified by name.");
                office_LeadsHelper.VerifyText("Editedby", "By Howard Tang");
                office_LeadsHelper.WaitForWorkAround(2000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyModifiedByCredentialsforLead");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Modified By Credentials for Lead");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Modified By Credentials for Lead", "Bug", "Medium", "Lead  page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Modified By Credentials for Lead");
                        TakeScreenshot("VerifyModifiedByCredentialsforLead");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyModifiedByCredentialsforLead.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("Verify Modified By Credentials for Lead");
                        string id            = loginHelper.getIssueID("Verify Modified By Credentials for Lead");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyModifiedByCredentialsforLead.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Modified By Credentials for Lead"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Modified By Credentials for Lead");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyModifiedByCredentialsforLead");
                executionLog.WriteInExcel("Verify Modified By Credentials for Lead", Status, JIRA, "Leads Management");
            }
        }
        public void leadsAdvanceFilterResultsPP()
        {
            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 office_LeadsHelper = new Office_LeadsHelper(GetWebDriver());

            // Variable
            var    DocName = "Test Exe" + GetRandomNumber();
            var    fileUpl = GetPathToFile() + "chrome.exe";
            String JIRA    = "";
            String Status  = "Pass";

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

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

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Redirect To URL");
                VisitOffice("leads");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Verify page title.");
                VerifyTitle("Leads");

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Click on advance filter.");
                office_LeadsHelper.ClickElement("AdvanceFilter");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Select number of records to 10.");
                office_LeadsHelper.SelectByText("ResultsPerPage", "10");
                //office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Click on apply button.");
                office_LeadsHelper.ClickElement("Apply");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Verify number of records displayed.");
                office_LeadsHelper.VerifyText("No.ofResults", "Showing 1 - 10 of");
                //office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Click on advance filter.");
                office_LeadsHelper.ClickElement("AdvanceFilter");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Select number of records to 20.");
                office_LeadsHelper.SelectByText("ResultsPerPage", "20");
                //office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Click on apply button.");
                office_LeadsHelper.ClickElement("Apply");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Verify number of records displayed.");
                office_LeadsHelper.VerifyText("No.ofResults", "Showing 1 - 20 of");
                //office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Click on advance filter.");
                office_LeadsHelper.ClickElement("AdvanceFilter");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Select number of records to 50.");
                office_LeadsHelper.SelectByText("ResultsPerPage", "50");
                //office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Click on apply button.");
                office_LeadsHelper.ClickElement("Apply");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Verify number of records displayed.");
                office_LeadsHelper.VerifyText("No.ofResults", "Showing 1 - 50 of");
                //office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Click on advance filter.");
                office_LeadsHelper.ClickElement("AdvanceFilter");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Select number of records to 100.");
                office_LeadsHelper.SelectByText("ResultsPerPage", "100");
                //office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Click on apply button.");
                office_LeadsHelper.ClickElement("Apply");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Verify number of records displayed.");
                office_LeadsHelper.VerifyText("No.ofResults", "Showing 1 - 100 of");
                //office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterResultsPP", "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("LeadsAdvanceFilterResultsPP");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Clients Advance Filter ResultsPP");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Clients 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("Clients Advance Filter ResultsPP");
                        TakeScreenshot("LeadsAdvanceFilterResultsPP");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\LeadsAdvanceFilterResultsPP.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("LeadsAdvanceFilterResultsPP");
                        string id            = loginHelper.getIssueID("Clients Advance Filter ResultsPP");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\LeadsAdvanceFilterResultsPP.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Clients Advance Filter ResultsPP"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Clients Advance Filter ResultsPP");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("LeadsAdvanceFilterResultsPP");
                executionLog.WriteInExcel("Clients Advance Filter ResultsPP", Status, JIRA, "Opportunities Management");
            }
        }
        public void verifyingIssuesOnPartnerAssoPage()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

            // Initializing the objects
            var executionLog       = new ExecutionLog();
            var loginHelper        = new LoginHelper(GetWebDriver());
            var office_LeadsHelper = new Office_LeadsHelper(GetWebDriver());

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

            // Variable
            var    FName  = "Test" + RandomNumber(99, 99999);
            var    LName  = "Test" + RandomNumber(99, 99999);
            var    CDBA   = "New" + RandomNumber(99, 99999);
            String JIRA   = "";
            String Status = "Pass";

            try
            {
                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Login with valid credentials");
                Login("aslamassociate", "123456");
                Console.WriteLine("Logged in as: aslamassociate / 123456");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Redirect to All leads");
                office_LeadsHelper.ClickElement("LeadTab");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Click on create button.");
                office_LeadsHelper.ClickElement("CreateIcon");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Verify page title.");
                VerifyTitle("Create a Lead");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Enter First Name");
                office_LeadsHelper.TypeText("FirstNameLead", FName);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Enter Last Name");
                office_LeadsHelper.TypeText("LastName", LName);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Enter Company DBA");
                office_LeadsHelper.TypeText("CompanyName", CDBA);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Click on Assignments");
                office_LeadsHelper.ClickElement("Assignments");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Wait for element to be visible.");
                office_LeadsHelper.WaitForElementPresent("LeadStatus", 10);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Select Status");
                office_LeadsHelper.SelectByText("LeadStatus", "New");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Select Responsibilities");
                office_LeadsHelper.SelectByText("Responsibility", "Howard Tang");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Select source.");
                office_LeadsHelper.SelectByText("SelectSource", "Email");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Enter Zip code");
                office_LeadsHelper.TypeText("LeadZip", "60601");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Enter address line1");
                office_LeadsHelper.TypeText("AddressLine1", "test line 1");
                //office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Enter address line2");
                office_LeadsHelper.TypeText("AddressLine2", "line 2");
                //office_LeadsHelper.WaitForWorkAround(3000);

                //executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Wait for locator to be present.");
                //office_LeadsHelper.IsElementVisible("//*[@id='LeadDetailSameAsLocation']");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Click on same as location checkbox.");
                office_LeadsHelper.Click("//*[@id='LeadDetailSameAsLocation']");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Click on Save");
                office_LeadsHelper.ClickElement("SaveLeadNewSkin");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Wait for creation success text.");
                office_LeadsHelper.WaitForText("Lead saved successfully.", 10);
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Search lead usnig company name.");
                office_LeadsHelper.TypeText("CompanySearch", CDBA);
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Click on edit icon to edit lead.");
                office_LeadsHelper.ClickElement("EditLeadPartner");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Verify page title as edit a lead");
                VerifyTitle("Edit a Lead");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Verify mailing address line 1 address copied.");
                office_LeadsHelper.verifyAddress1();
                //office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Verify mailing line 2 copied address.");
                office_LeadsHelper.verifyAddress2();
                //office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Click on Save");
                office_LeadsHelper.ClickElement("SaveLeadNewSkin");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Wait for updation success text.");
                office_LeadsHelper.WaitForText("Lead updated successfully.", 10);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Verify Lead created by credits.");
                office_LeadsHelper.VerifyText("CreatedBy", "Aslam Associate");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Verify Lead modified by credits");
                office_LeadsHelper.VerifyText("ModifiedBy", "Aslam Associate");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Logout from the application");
                VisitOffice("logout");

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

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Verify page Tilte");
                VerifyTitle("Dashboard");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Redirect at leads page.");
                VisitOffice("leads");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Verify page titles.");
                VerifyTitle("Leads");

                //executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Login with valid credential  Username");
                //office_LeadsHelper.WaitForElementPresent("CheckDocToDel", 10);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Search lead");
                office_LeadsHelper.TypeText("SearchCompany", CDBA);
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Select first lead");
                office_LeadsHelper.ClickElement("CheckDocToDel");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Click on delete button.");
                office_LeadsHelper.ClickElement("DeleteLead");
                office_LeadsHelper.AcceptAlert();

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Wait for confirmation message.");
                office_LeadsHelper.WaitForText("1 records deleted successfully", 10);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Redirect at leads recycle bin page.");
                VisitOffice("leads/recyclebin");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Verify page title.");
                VerifyTitle("Recycled Leads");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Click on delete icon");
                office_LeadsHelper.ClickElement("DeleteLeadPer");
                office_LeadsHelper.AcceptAlert();

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Wait for confirmation.");
                office_LeadsHelper.WaitForText("Lead Permanently Deleted.", 10);

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

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyingIssuesOnPartnerAssoPage");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("VerifyingIssuesOnPartnerAssoPage");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("VerifyingIssuesOnPartnerAssoPage", "Bug", "Medium", "Leads page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("VerifyingIssuesOnPartnerAssoPage");
                        TakeScreenshot("VerifyingIssuesOnPartnerAssoPage");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyingIssuesOnPartnerAssoPage.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyingIssuesOnPartnerAssoPage");
                        string id            = loginHelper.getIssueID("VerifyingIssuesOnPartnerAssoPage");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyingIssuesOnPartnerAssoPage.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("VerifyingIssuesOnPartnerAssoPage"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("VerifyingIssuesOnPartnerAssoPage");
                // executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyingIssuesOnPartnerAssoPage");
                executionLog.WriteInExcel("VerifyingIssuesOnPartnerAssoPage", Status, JIRA, "Lead Management");
            }
        }
        public void leadLabelSelectForCategory()
        {
            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 office_LeadsHelper = new Office_LeadsHelper(GetWebDriver());

            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("LeadLabelSelectForCategory", "Redirects at leads page.");
                VisitOffice("leads");

                executionLog.Log("LeadLabelSelectForCategory", "Click on any lead.");
                office_LeadsHelper.ClickElement("ClickAnyLead");
                office_LeadsHelper.WaitForWorkAround(1000);

                executionLog.Log("LeadLabelSelectForCategory", "Verify label for category present.");
                office_LeadsHelper.VerifyText("CategoryLeads", "Click to edit");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("LeadLabelSelectForCategory");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Lead Label Select For Category");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Lead Label Select For Category", "Bug", "Medium", "Leads page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Lead Label Select For Category");
                        TakeScreenshot("LeadLabelSelectForCategory");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\LeadLabelSelectForCategory.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("LeadLabelSelectForCategory");
                        string id            = loginHelper.getIssueID("Lead Label Select For Category");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\LeadLabelSelectForCategory.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Lead Label Select For Category"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Lead Label Select For Category");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("LeadLabelSelectForCategory");
                executionLog.WriteInExcel("Lead Label Select For Category", Status, JIRA, "Leads Management");
            }
        }
        public void leadModifiedByIssue()
        {
            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 office_LeadsHelper = new Office_LeadsHelper(GetWebDriver());

            // Variable
            var    FirstName = "Test" + RandomNumber(1, 99);
            var    LastName  = "Tester" + RandomNumber(1, 99);
            var    Number    = "12345678" + RandomNumber(10, 99);
            var    Company   = "TEST COMPANY" + GetRandomNumber();
            String JIRA      = "";
            String Status    = "Pass";

            try
            {
                executionLog.Log("LeadModifiedByIssue", "Login with valid username and password");
                Login(username[0], password[0]);

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

                executionLog.Log("LeadModifiedByIssue", "Redirect at create leads page.");
                VisitOffice("leads/create");
                office_LeadsHelper.WaitForWorkAround(4000);

                executionLog.Log("LeadModifiedByIssue", "Wait for element to be visible.");
                office_LeadsHelper.WaitForElementPresent("LeadType", 10);

                executionLog.Log("LeadModifiedByIssue", "Select Lead Status");
                office_LeadsHelper.SelectByText("LeadStatus", "New");

                executionLog.Log("LeadModifiedByIssue", "Select Responsibity");
                office_LeadsHelper.SelectByText("Responsibility", "Howard Tang");

                executionLog.Log("LeadModifiedByIssue", "Select Salutation");
                office_LeadsHelper.Select("Salutaion", "Mr");

                executionLog.Log("LeadModifiedByIssue", "Enter First Name");
                office_LeadsHelper.TypeText("FirstNameLead", FirstName);

                executionLog.Log("LeadModifiedByIssue", "Enter Last Name");
                office_LeadsHelper.TypeText("LastName", LastName);

                executionLog.Log("LeadModifiedByIssue", "Enter Company Name ");
                office_LeadsHelper.TypeText("CompanyName", Company);

                executionLog.Log("LeadModifiedByIssue", "Click on Save button");
                office_LeadsHelper.ClickElement("Save");
                office_LeadsHelper.WaitForWorkAround(7000);

                executionLog.Log("LeadModifiedByIssue", "Verify success message");
                office_LeadsHelper.WaitForText("Lead saved successfully. .", 10);

                executionLog.Log("LeadModifiedByIssue", "Verify page title details");
                VerifyTitle("Details");

                executionLog.Log("LeadModifiedByIssue", "Verify modified by credentials.");
                office_LeadsHelper.VerifyText("ModifiedBy", "By Howard Tang");

                executionLog.Log("LeadModifiedByIssue", "Go to Lead");
                VisitOffice("leads");

                executionLog.Log("LeadModifiedByIssue", "Click on First Lead To check");
                office_LeadsHelper.ClickElement("CheckDocToDel");

                executionLog.Log("LeadModifiedByIssue", "Click on Delete button.");
                office_LeadsHelper.ClickElement("ClickDelLeadbutton");
                office_LeadsHelper.AcceptAlert();

                executionLog.Log("LeadModifiedByIssue", "Verify Confirmation");
                office_LeadsHelper.WaitForText("1 records deleted successfully", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("LeadModifiedByIssue");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Lead Modified By Issue");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Lead Modified By Issue", "Bug", "Medium", "Leads page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Lead Modified By Issue");
                        TakeScreenshot("LeadModifiedByIssue");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\LeadModifiedByIssue.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("LeadModifiedByIssue");
                        string id            = loginHelper.getIssueID("Lead Modified By Issue");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\LeadModifiedByIssue.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Lead Modified By Issue"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Lead Modified By Issue");
                //  executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("LeadModifiedByIssue");
                executionLog.WriteInExcel("Lead Modified By Issue", Status, JIRA, "Leads Management");
            }
        }