示例#1
0
        public void revenueAdjustmentSaleAgentAddAmount()
        {
            string[] username = null;
            string[] password = null;
            String   JIRA     = "";
            String   Status   = "Pass";

            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var agent_1099SalesAgentHelper = new Agent_1099SalesAgentHelper(GetWebDriver());


            // Variable random
            var name = "TESTCLIENT" + RandomNumber(1, 999);


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

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

                executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Click on Click On Partner Agent");
                VisitOffice("partners/agents");

                var loc = "//table[@id='list1']/tbody/tr[2]";
                if (agent_1099SalesAgentHelper.IsElementPresent(loc))
                {
                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Click On Sale Agent");
                    agent_1099SalesAgentHelper.ClickElement("ClickOnAgent1099");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Click On Create btn Adjmnt");
                    agent_1099SalesAgentHelper.ClickElement("ClickOnCreatebtnAdjmnt");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Enter Adjustment Name");
                    agent_1099SalesAgentHelper.TypeText("EnterAdjustmentName", "SaleAdjustment");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Select Adjustment For");
                    agent_1099SalesAgentHelper.Select("SelectAdjustmentFor", "Agent");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Select type");
                    agent_1099SalesAgentHelper.Select("AdjustmentType", "Transaction");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Select period");
                    agent_1099SalesAgentHelper.Select("SelectReportingPeriod", "00");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Select Processor");
                    agent_1099SalesAgentHelper.Select("SelectProcessor", "Any");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Select rule");
                    agent_1099SalesAgentHelper.Select("SelectRuleType", "1");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Enter Amount");
                    agent_1099SalesAgentHelper.TypeText("EnterAmount", "20");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "AddRemove");
                    agent_1099SalesAgentHelper.Select("AddRemove", "Add");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Click On Save Btn");
                    agent_1099SalesAgentHelper.ClickElement("ClickOnSaveBtnAdjustmnet");
                    agent_1099SalesAgentHelper.WaitForWorkAround(3000);

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Verify Messsage");
                    agent_1099SalesAgentHelper.WaitForText("Master Adjustment Rules Created Successfully.", 10);
                }
                else
                {
                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", " Click On Create button");
                    agent_1099SalesAgentHelper.ClickElement("ClickOnCreateBtn");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Select Salutation");
                    agent_1099SalesAgentHelper.Select("SelectSalutation", "Mr");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Enter FirstNAME");
                    agent_1099SalesAgentHelper.TypeText("FirstNAME", "Sale Agent Revenue Adjustment");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Enter LastName");
                    agent_1099SalesAgentHelper.TypeText("LastName", "Tester");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Enter Date Of Birth");
                    agent_1099SalesAgentHelper.TypeText("BirthDay", "1991-03-02");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Select eAddressType");
                    agent_1099SalesAgentHelper.Select("eAddressType", "E-Mail");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Select eAddressLebel");
                    agent_1099SalesAgentHelper.Select("eAddressLebel", "Work");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Enter eAddressType");
                    var Email = "Sale" + RandomNumber(1, 999) + "@yopmail.com";
                    agent_1099SalesAgentHelper.TypeText("eAddress", Email);

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Select SelectPhoneType");
                    agent_1099SalesAgentHelper.Select("SelectPhoneType", "Work");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Enter PhoneNumber");
                    agent_1099SalesAgentHelper.TypeText("PhoneNumber", "9828928943");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Select Address Type    ");
                    agent_1099SalesAgentHelper.Select("AddressType", "Office");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Enter AddressLine1");
                    agent_1099SalesAgentHelper.TypeText("AddressLine1", "FC 89");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Enter City");
                    agent_1099SalesAgentHelper.TypeText("City", "Test City");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Enter Postal code");
                    agent_1099SalesAgentHelper.TypeText("PostalCode", "60601");
                    agent_1099SalesAgentHelper.WaitForWorkAround(3000);

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Click On Checkbox");
                    agent_1099SalesAgentHelper.ClickElement("ClickONcheckBox");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Enter UserName");
                    agent_1099SalesAgentHelper.TypeText("UserName", name);

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Click On Avatar");
                    agent_1099SalesAgentHelper.ClickElement("ClickOnSAvatarBtn");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Click on save button");
                    agent_1099SalesAgentHelper.ClickElement("ClickSaveNskin");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Enter agent name to search");
                    agent_1099SalesAgentHelper.TypeText("EnterAgentName", "Sale Agent Revenue Adjustment Tester");

                    agent_1099SalesAgentHelper.Select("SelectStatusAdjtmnt", "");
                    agent_1099SalesAgentHelper.WaitForWorkAround(4000);

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Click On Sale Agent");
                    agent_1099SalesAgentHelper.ClickElement("ClickOnAgent1099");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Click On Create btn Adjmnt");
                    agent_1099SalesAgentHelper.ClickElement("ClickOnCreatebtnAdjmnt");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Click on SaleAgent");
                    agent_1099SalesAgentHelper.ClickElement("ClickSaleManager");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Enter Adjustment Name");
                    agent_1099SalesAgentHelper.TypeText("EnterAdjustmentName", "SaleAdjustment");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Select Adjustment For");
                    agent_1099SalesAgentHelper.Select("SelectAdjustmentFor", "Agent");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Select type");
                    agent_1099SalesAgentHelper.Select("AdjustmentType", "Transaction");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Select period");
                    agent_1099SalesAgentHelper.Select("SelectReportingPeriod", "00");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Select Processor");
                    agent_1099SalesAgentHelper.Select("SelectProcessor", "Any");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "select rule");
                    agent_1099SalesAgentHelper.Select("SelectRuleType", "1");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Enter Amount");
                    agent_1099SalesAgentHelper.TypeText("EnterAmount", "20");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "AddRemove");
                    agent_1099SalesAgentHelper.Select("AddRemove", "Add");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Click On Save Btn");
                    agent_1099SalesAgentHelper.ClickElement("ClickOnSaveBtnAdjustmnet");

                    executionLog.Log("RevenueAdjustmentSaleAgentAddAmount", "Verify Message");
                    agent_1099SalesAgentHelper.WaitForText("Master Adjustment Rules Created Successfully.", 10);
                }
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("RevenueAdjustmentSaleAgentAddAmount");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Revenue Adjustment Sale Agent Add Amount");
                if (!result)
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Revenue Adjustment Sale Agent Add Amount", "Bug", "Medium", "Agent sale page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Revenue Adjustment Sale Agent Add Amount");
                        TakeScreenshot("RevenueAdjustmentSaleAgentAddAmount");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\RevenueAdjustmentSaleAgentAddAmount.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("RevenueAdjustmentSaleAgentAddAmount");
                        string id            = loginHelper.getIssueID("Revenue Adjustment Sale Agent Add Amount");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\RevenueAdjustmentSaleAgentAddAmount.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Revenue Adjustment Sale Agent Add Amount"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Revenue Adjustment Sale Agent Add Amount");
                executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("RevenueAdjustmentSaleAgentAddAmount");
                executionLog.WriteInExcel("Revenue Adjustment Sale Agent Add Amount", Status, JIRA, "Agent Portal");
            }
        }
        public void bulkUpdateSaleAgent()
        {
            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 agent_1099SaleAagentHelper = new Agent_1099SalesAgentHelper(GetWebDriver());


            // Variable random
            var    filePath = GetPathToFile() + "AgentImport.xlsx";
            var    name     = "TESTCLIENT" + GetRandomNumber();
            String JIRA     = "";
            String Status   = "Pass";

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

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

                executionLog.Log("BulkUpdateSaleAgent", "Go to Sales agent page.");
                VisitOffice("sales_agents");
                agent_1099SaleAagentHelper.WaitForWorkAround(3000);

                executionLog.Log("BulkUpdateSaleAgent", "Verify title");
                VerifyTitle("Sales Agents");

                executionLog.Log("BulkUpdateSaleAgent", "Click On Sale Agnet ChkBox");
                agent_1099SaleAagentHelper.ClickElement("ClickOnSaleAgnetChkBox");

                executionLog.Log("BulkUpdateSaleAgent", "ClickOnBulkUpdate");
                agent_1099SaleAagentHelper.ClickJs("ClickOnBulkUpdate");
                agent_1099SaleAagentHelper.WaitForWorkAround(2000);

                executionLog.Log("BulkUpdateSaleAgent", "Click on change department");
                agent_1099SaleAagentHelper.ClickElement("ChangeDepartment");
                agent_1099SaleAagentHelper.WaitForWorkAround(2000);

                executionLog.Log("BulkUpdateSaleAgent", "Select Department");
                agent_1099SaleAagentHelper.SelectByText("SelectDepartmentSaleAgnet", "Information Technology");

                executionLog.Log("BulkUpdateSaleAgent", "ClickOnBulkUpdate");
                agent_1099SaleAagentHelper.ClickDisplayed("//a[@title='Update']");
                agent_1099SaleAagentHelper.AcceptAlert();
                agent_1099SaleAagentHelper.WaitForWorkAround(4000);

                executionLog.Log("BulkUpdateSaleAgent", "ClickOnBulkUpdate");
                agent_1099SaleAagentHelper.ClickElement("ClickOnSaleAgnetChkBox");
                agent_1099SaleAagentHelper.ClickJs("ClickOnBulkUpdate");
                agent_1099SaleAagentHelper.WaitForWorkAround(2000);

                executionLog.Log("BulkUpdateSaleAgent", "ClickOnChange role");
                agent_1099SaleAagentHelper.ClickElement("ChangeRole");
                agent_1099SaleAagentHelper.WaitForWorkAround(2000);

                executionLog.Log("BulkUpdateSaleAgent", "ClickOnBulkUpdate");
                agent_1099SaleAagentHelper.Click("//*[@id='EmpRoleUpdateSalesUsersForm']/div[3]/a");
                agent_1099SaleAagentHelper.AcceptAlert();
                agent_1099SaleAagentHelper.WaitForWorkAround(4000);

                executionLog.Log("BulkUpdateSaleAgent", "Click on first check box");
                agent_1099SaleAagentHelper.ClickElement("ClickOnSaleAgnetChkBox");

                executionLog.Log("BulkUpdateSaleAgent", "ClickOnBulkUpdate");
                agent_1099SaleAagentHelper.ClickJs("ClickOnBulkUpdate");
                agent_1099SaleAagentHelper.WaitForWorkAround(3000);

                executionLog.Log("BulkUpdateSaleAgent", "Change Team");
                agent_1099SaleAagentHelper.ClickElement("ChangeTeam");
                agent_1099SaleAagentHelper.WaitForWorkAround(2000);

                executionLog.Log("BulkUpdateSaleAgent", "Click on update button");
                agent_1099SaleAagentHelper.ClickViaJavaScript("//*[@id='EmpTeamUpdateSalesUsersForm']//a");
                agent_1099SaleAagentHelper.AcceptAlert();
                agent_1099SaleAagentHelper.WaitForWorkAround(4000);

                executionLog.Log("BulkUpdateSaleAgent", "Click On first check box");
                agent_1099SaleAagentHelper.ClickElement("ClickOnSaleAgnetChkBox");

                executionLog.Log("BulkUpdateSaleAgent", "ClickOnBulkUpdate");
                agent_1099SaleAagentHelper.ClickJs("ClickOnBulkUpdate");
                agent_1099SaleAagentHelper.WaitForWorkAround(2000);

                executionLog.Log("BulkUpdateSaleAgent", "Change Status");
                agent_1099SaleAagentHelper.ClickElement("ChangeStatus");
                agent_1099SaleAagentHelper.WaitForWorkAround(2000);

                executionLog.Log("BulkUpdateSaleAgent", "Select Department");
                agent_1099SaleAagentHelper.Select("SelectStatus", "Active");

                executionLog.Log("BulkUpdateSaleAgent", "Click On Bulk Update");
                agent_1099SaleAagentHelper.ClickDisplayed("//a[@title='Update']");

                executionLog.Log("BulkUpdateSaleAgent", "Accept alert message.");
                agent_1099SaleAagentHelper.AcceptAlert();
                agent_1099SaleAagentHelper.WaitForWorkAround(1000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("BulkUpdateSaleAgent");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Bulk Update Sale Agent");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Bulk Update Sale Agent", "Bug", "Medium", "Sale Agent", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Bulk Update Sale Agent");
                        TakeScreenshot("BulkUpdateSaleAgent");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\BulkUpdateSaleAgent.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("BulkUpdateSaleAgent");
                        string id            = loginHelper.getIssueID("Bulk Update Sale Agent");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\BulkUpdateSaleAgent.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Bulk Update Sale Agent"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Bulk Update Sale Agent");
                //  executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("BulkUpdateSaleAgent");
                executionLog.WriteInExcel("Bulk Update Sale Agent", Status, JIRA, "Agents Portal");
            }
        }
示例#3
0
        public void saleAgentWithUser()
        {
            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 agent_1099SaleAagentHelper = new Agent_1099SalesAgentHelper(GetWebDriver());
            var office_UserHelper          = new Office_UserHelper(GetWebDriver());

            // Variable random
            var    name   = "TESTCLIENT" + GetRandomNumber();
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("SaleAgentWithUser", "Redirect To Sale Agent");
                VisitOffice("sales_agents/create");

                executionLog.Log("SaleAgentWithUser", "Wait for element to present.");
                agent_1099SaleAagentHelper.WaitForElementPresent("SelectSalutation", 5);

                executionLog.Log("SaleAgentWithUser", "Select Salutation");
                agent_1099SaleAagentHelper.Select("SelectSalutation", "Mr");

                executionLog.Log("SaleAgentWithUser", "Enter FirstNAME");
                agent_1099SaleAagentHelper.TypeText("FirstNAME", "Test Sale gent");

                executionLog.Log("SaleAgentWithUser", "Enter LastName");
                agent_1099SaleAagentHelper.TypeText("LastName", "Tester");

                executionLog.Log("SaleAgentWithUser", "Enter Date Of Birth");
                agent_1099SaleAagentHelper.TypeText("BirthDay", "1991-03-02");

                executionLog.Log("SaleAgentWithUser", "Select eAddressType");
                agent_1099SaleAagentHelper.Select("eAddressType", "E-Mail");

                executionLog.Log("SaleAgentWithUser", "Select eAddressLebel");
                agent_1099SaleAagentHelper.Select("eAddressLebel", "Work");

                executionLog.Log("SaleAgentWithUser", "Enter eAddressType");
                var Email = "Sale" + RandomNumber(111, 9999) + "@yopmail.com";
                agent_1099SaleAagentHelper.TypeText("eAddress", Email);
                Console.WriteLine("Email is" + Email);

                executionLog.Log("SaleAgentWithUser", "Select SelectPhoneType");
                agent_1099SaleAagentHelper.Select("SelectPhoneType", "Work");

                executionLog.Log("SaleAgentWithUser", "Select Address Type   ");
                agent_1099SaleAagentHelper.Select("AddressType", "Office");

                executionLog.Log("SaleAgentWithUser", "Enter AddressLine1");
                agent_1099SaleAagentHelper.TypeText("AddressLine1", "FC 89");

                executionLog.Log("SaleAgentWithUser", "Enter City");
                agent_1099SaleAagentHelper.TypeText("City", "Test City");

                executionLog.Log("SaleAgentWithUser", "Enter Zip code");
                agent_1099SaleAagentHelper.TypeText("PostalCode", "60601");
                agent_1099SaleAagentHelper.WaitForWorkAround(2000);

                executionLog.Log("SaleAgentWithUser", "Check create a user account for agent field open or not");
                agent_1099SaleAagentHelper.ClickAndCheck("CollapseDetails");
                agent_1099SaleAagentHelper.WaitForWorkAround(2000);

                executionLog.Log("SaleAgentWithUser", "Enter UserName");
                agent_1099SaleAagentHelper.TypeText("UserName", name);
                agent_1099SaleAagentHelper.WaitForWorkAround(1000);

                executionLog.Log("SaleAgentWithUser", "Click On Avatar");
                agent_1099SaleAagentHelper.ClickElement("ClickOnSAvatarBtn");
                agent_1099SaleAagentHelper.WaitForWorkAround(2000);

                executionLog.Log("SaleAgentWithUser", "Click on Save");
                agent_1099SaleAagentHelper.ClickElement("SaveSaleAgent");
                agent_1099SaleAagentHelper.WaitForWorkAround(2000);

                executionLog.Log("SaleAgentWithUser", "Redirect To Admin");
                VisitOffice("admin");

                executionLog.Log("SaleAgentWithUser", "Redirect To User");
                VisitOffice("users");
                agent_1099SaleAagentHelper.WaitForWorkAround(2000);

                executionLog.Log("SaleAgentWithUser", "Select user type as sale agent. ");
                office_UserHelper.Select("SearchUserType", "1099 Sales Agent");
                office_UserHelper.WaitForWorkAround(4000);

                executionLog.Log("SaleAgentWithUser", "Enter Email ");
                office_UserHelper.TypeText("EnterEmail", Email);
                office_UserHelper.WaitForWorkAround(30000);

                executionLog.Log("SaleAgentWithUser", "Verify Email ");
                //       office_UserHelper.VerifyPageText(Email);
                office_UserHelper.WaitForWorkAround(2000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            // Variable random
            var    name   = "TESTCLIENT" + RandomNumber(1, 9999);
            String JIRA   = "";
            String Status = "Pass";


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

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

                executionLog.Log("SaleAgentEmailValidation", "Redirect To Create Agent page");
                VisitOffice("sales_agents/create");

                executionLog.Log("SaleAgentEmailValidation", "Wait for element to present");
                agent_1099SaleAagentHelper.WaitForElementPresent("SelectSalutation", 10);

                executionLog.Log("SaleAgentEmailValidation", "Select Salutation");
                agent_1099SaleAagentHelper.Select("SelectSalutation", "Mr");

                executionLog.Log("SaleAgentEmailValidation", "Enter FirstName");
                agent_1099SaleAagentHelper.TypeText("FirstNAME", "Test Sale gent");

                executionLog.Log("SaleAgentEmailValidation", "Enter LastName");
                agent_1099SaleAagentHelper.TypeText("LastName", "Tester");

                executionLog.Log("SaleAgentEmailValidation", "Enter Date Of Birth");
                agent_1099SaleAagentHelper.TypeText("BirthDay", "1991-03-02");

                executionLog.Log("SaleAgentEmailValidation", "Select eAddressType");
                agent_1099SaleAagentHelper.Select("eAddressType", "E-Mail");

                executionLog.Log("SaleAgentEmailValidation", "Select eAddressLebel");
                agent_1099SaleAagentHelper.Select("eAddressLebel", "Work");

                executionLog.Log("SaleAgentEmailValidation", "Enter eAddress Type ");
                agent_1099SaleAagentHelper.TypeText("eAddress", "Testgmail.com");

                executionLog.Log("SaleAgentEmailValidation", "CLICK On Save");
                agent_1099SaleAagentHelper.ClickElement("SaveSaleAgent");

                agent_1099SaleAagentHelper.WaitForText("Please enter a valid email address.", 10);
                agent_1099SaleAagentHelper.WaitForWorkAround(3000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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