コード例 #1
0
        public void verifyEmployeePasswordField()
        {
            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 agents_EmployeesHelper = new Agents_EmployeesHelper(GetWebDriver());

            // Variable random
            String JIRA   = "";
            String Status = "Pass";

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

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

            executionLog.Log("VerifyEmployeePasswordField", "Go to Employee page");
            VisitOffice("employees");

            executionLog.Log("EmployeeAdvanceFilterIssue", "Click on Create page");
            agents_EmployeesHelper.ClickElement("Create");
            agents_EmployeesHelper.WaitForWorkAround(3000);

            executionLog.Log("EmployeeAdvanceFilterIssue", "Deselect Auto Generate Password Check Box");
            agents_EmployeesHelper.ClickElement("AutoGenPswdChkBox");
            agents_EmployeesHelper.WaitForWorkAround(1000);

            executionLog.Log("EmployeeAdvanceFilterIssue", "Deselect Auto Generate Password Check Box");
            agents_EmployeesHelper.TypeText("Password", "123456789");
            Console.WriteLine("User is able to enter in Password field when Auto Gen Password is deselected");


            //}
            //catch (Exception e)
            //{

            //}
        }
コード例 #2
0
        public void verifyEmployeeEAddressLabel()
        {
            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 agents_EmployeesHelper = new Agents_EmployeesHelper(GetWebDriver());

            // Variable

            String JIRA      = "";
            String Status    = "Pass";
            var    username1 = "Testuser" + GetRandomNumber();

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

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

                executionLog.Log("PartnerAgentCodeInQuickLook", "Goto Opportinuties");
                VisitOffice("employees");
                agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("PartnerAgentCodeInQuickLook", "Open Employee 1");
                agents_EmployeesHelper.ClickElement("EditEmployee1");
                agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("PartnerAgentCodeInQuickLook", "Select eAddress Label");
                agents_EmployeesHelper.SelectByText("eAddressLebel", "Work");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("PartnerAgentCodeInQuickLook", "Check if User account is not created");
                if (agents_EmployeesHelper.IsElementPresent("//h5[contains(text(),'Edit User Account for Employee')]"))
                {
                    agents_EmployeesHelper.Click("//h5[contains(text(),'Edit User Account for Employee')]");
                    agents_EmployeesHelper.WaitForWorkAround(1000);

                    executionLog.Log("PartnerAgentCodeInQuickLook", "Enter username");
                    agents_EmployeesHelper.TypeText("UserName", username1);

                    executionLog.Log("PartnerAgentCodeInQuickLook", "Select avatar");
                    agents_EmployeesHelper.ClickElement("AdminUserAvatar");
                }

                executionLog.Log("PartnerAgentCodeInQuickLook", "Click On Save Button");
                agents_EmployeesHelper.clickJS("SaveEmployee");
                agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("PartnerAgentCodeInQuickLook", "Open Employee 1");
                agents_EmployeesHelper.ClickElement("EditEmployee1");
                agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("PartnerAgentCodeInQuickLook", "Verify select eAddress Label Work.");
                agents_EmployeesHelper.selectedOption("eAddressLebel", "Work");;
                //agents_EmployeesHelper.WaitForWorkAround(2000);
            }

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

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("AmexRateCorp");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Amex Rate Corp");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Amex Rate Corp", "Bug", "Medium", "Amex page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Amex Rate Corp");
                        TakeScreenshot("AmexRateCorp");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\AmexRateCorp.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("AmexRateCorp");
                        string id            = loginHelper.getIssueID("Amex Rate Corp");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\AmexRateCorp.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Amex Rate Corp"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Amex Rate Corp");
                //  executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("AmexRateCorp");
                executionLog.WriteInExcel("Amex Rate Corp", Status, JIRA, "Corp Master Data");
            }
        }
コード例 #3
0
        public void verifyEmployeeAnotherEmailPhoneAddressBtn()
        {
            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_EmployeeHelper = new Agents_EmployeesHelper(GetWebDriver());

            // VARIABLE
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("VerifyEmployeeAnotherEmailPhoneAddressBtn", "Redirect To Employee page");
                VisitOffice("employees");

                executionLog.Log("VerifyEmployeeAnotherEmailPhoneAddressBtn", "Click On Create Button");
                agent_EmployeeHelper.ClickElement("Create");

                executionLog.Log("VerifyEmployeeAnotherEmailPhoneAddressBtn", "Click On Add Email button");
                agent_EmployeeHelper.ClickElement("AddEmail");

                executionLog.Log("VerifyEmployeeAnotherEmailPhoneAddressBtn", "Verify Add Email button is clickable");
                agent_EmployeeHelper.IsElementVisible("//select[@id='EmployeeElectronicAddress1EmailImWebType']");

                executionLog.Log("VerifyEmployeeAnotherEmailPhoneAddressBtn", "Click On Add Phone Button");
                agent_EmployeeHelper.ClickElement("AddPhone");

                executionLog.Log("VerifyEmployeeAnotherEmailPhoneAddressBtn", "Verify Add Phone button is clickable");
                agent_EmployeeHelper.IsElementVisible("//select[@id='EmployeePhone1PhoneType']");

                executionLog.Log("VerifyEmployeeAnotherEmailPhoneAddressBtn", "Click On Add Address Button");
                agent_EmployeeHelper.ClickElement("AddAddress");

                executionLog.Log("VerifyEmployeeAnotherEmailPhoneAddressBtn", "Verify Add Address button is clickable");
                agent_EmployeeHelper.IsElementVisible("//select[@id='EmployeeAddress1Type']");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyEmployeeAnotherEmailPhoneAddressBtn");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Employee Another Email Phone Address Btn");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Employee Another Email Phone Address Btn", "Bug", "Medium", "Employees page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Employee Another Email Phone Address Btn");
                        TakeScreenshot("VerifyEmployeeAnotherEmailPhoneAddressBtn");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyEmployeeAnotherEmailPhoneAddressBtn.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyEmployeeAnotherEmailPhoneAddressBtn");
                        string id            = loginHelper.getIssueID("Verify Employee Another Email Phone Address Btn");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyEmployeeAnotherEmailPhoneAddressBtn.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Employee Another Email Phone Address Btn"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Employee Another Email Phone Address Btn");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyEmployeeAnotherEmailPhoneAddressBtn");
                executionLog.WriteInExcel("Verify Employee Another Email Phone Address Btn", Status, JIRA, "Office Employees");
            }
        }
コード例 #4
0
        public void employeeAgentNS()
        {
            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 agents_EmployeesHelper = new Agents_EmployeesHelper(GetWebDriver());

            // VARIABLE
            var    name      = "TestEmployee" + GetRandomNumber();
            var    username1 = "testinguser" + RandomNumber(111, 99999);
            String Status    = "Pass";
            String JIRA      = "";

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

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

                executionLog.Log("EmployeeAgentNS", "Redirect to Employee page");
                VisitOffice("employees");
                agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("EmployeeAgentNS", "Click On Create Employee Btn");
                agents_EmployeesHelper.ClickElement("Create");
                agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("EmployeeAgentNS", "Select Salutation");
                agents_EmployeesHelper.Select("SelectSalutation", "Mr");

                executionLog.Log("EmployeeAgentNS", "Enter FirstNAME");
                agents_EmployeesHelper.TypeText("FirstNAME", "Test Agent");

                executionLog.Log("EmployeeAgentNS", "Enter LastName");
                agents_EmployeesHelper.TypeText("LastName", "Tester");

                executionLog.Log("EmployeeAgentNS", "Enter Date Of Birth");
                agents_EmployeesHelper.TypeText("BirthDay", "02/03/1991");

                executionLog.Log("EmployeeAgentNS", "Select eAddressType");
                agents_EmployeesHelper.Select("eAddressType", "E-Mail");

                executionLog.Log("EmployeeAgentNS", "Select eAddressLebel");
                agents_EmployeesHelper.Select("eAddressLebel", "Work");

                executionLog.Log("EmployeeAgentNS", "Enter eAddressType");
                agents_EmployeesHelper.TypeText("eAddress", "*****@*****.**");

                executionLog.Log("EmployeeAgentNS", "Select SelectPhoneType");
                agents_EmployeesHelper.Select("SelectPhoneType", "Work");

                executionLog.Log("EmployeeAgentNS", "Enter PhoneNumber");
                agents_EmployeesHelper.TypeText("PhoneNumber", "121212121");

                executionLog.Log("EmployeeAgentNS", "Select Address Type");
                agents_EmployeesHelper.Select("AddressType", "Office");

                executionLog.Log("EmployeeAgentNS", "Enter AddressLine1");
                agents_EmployeesHelper.TypeText("AddressLine1", "FC 89");

                executionLog.Log("EmployeeAgentNS", "Enter Postal Code");
                agents_EmployeesHelper.TypeText("PostalCode", "60601");
                agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("EditCorpEmployee", "Enter Username");
                agents_EmployeesHelper.TypeText("UserName", username1);

                executionLog.Log("EditCorpEmployee", "Select Avatar");
                agents_EmployeesHelper.ClickElement("AdminUserAvatar");

                executionLog.Log("EditCorpEmployee", "Deselect Auto Generate Password check box");
                agents_EmployeesHelper.ClickElement("AutoGenPswdChkBox");

                executionLog.Log("EditCorpEmployee", "Enter Password");
                agents_EmployeesHelper.TypeText("Password", "123456789");

                agents_EmployeesHelper.ClickElement("SaveEmployee");
                agents_EmployeesHelper.WaitForText("The employee is successfully added", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";
                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("EmployeeAgentNS");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Employee Agent NS");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Employee Agent NS", "Bug", "Medium", "Employee page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Employee Agent NS");
                        TakeScreenshot("EmployeeAgentNS");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\EmployeeAgentNS.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("EmployeeAgentNS");
                        string id            = loginHelper.getIssueID("Employee Agent NS");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\EmployeeAgentNS.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Employee Agent NS"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Employee Agent NS");
                //    executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("EmployeeAgentNS");
                executionLog.WriteInExcel("Employee Agent NS", Status, JIRA, "Agent Portal");
            }
        }
コード例 #5
0
        public void createAgentsFromExcelSheet()
        {
            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 agents_EmployeesHelper          = new Agents_EmployeesHelper(GetWebDriver());
            var agent_1099SalesAgentHelper      = new Agent_1099SalesAgentHelper(GetWebDriver());
            var agents_PartnerAgentsHelper      = new Agents_PartnerAgentsHelper(GetWebDriver());
            var agents_PartnerAssociationHelper = new Agents_PartnerAssociationHelper(GetWebDriver());


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

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

            executionLog.Log("CreateAgentsFromExcelSheet", "Read Data from Excel File and Create Agents");

            Excel.Application xlApp;
            Excel.Workbook    xlWorkBook;
            Excel.Worksheet   xlWorkSheet;
            Excel.Range       xlrange;

            string xlString;
            string xlString1;
            double xlDouble;
            int    xlRowCnt = 0;
            int    xlColCnt = 0;

            xlApp = new Excel.Application();
            //Open Excel file
            var locFile = GetPathToFile() + "OfficeAgents.xlsx";

            //var updated_path = locFile.Replace("Files", "bin");
            xlWorkBook  = xlApp.Workbooks.Open(locFile);
            xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);

            //This gives the used cells in the sheet
            xlrange = xlWorkSheet.UsedRange;
            Console.WriteLine("Row count is  " + xlrange.Rows.Count);

            for (xlRowCnt = 2; xlRowCnt <= xlrange.Rows.Count; xlRowCnt++)
            {
                // Find type of Agent
                xlString = (string)(xlrange.Cells[xlRowCnt, 1] as Excel.Range).Value2;
                if (xlString == "Employee")
                {
                    GetWebDriver().Navigate().GoToUrl("https://www.mypegasuscrm.com/newthemecorp/" + username[0] + "/employees/create");
                    agents_EmployeesHelper.WaitForWorkAround(3000);

                    //Employee First Name
                    xlString = (string)(xlrange.Cells[xlRowCnt, 2] as Excel.Range).Value2;
                    agents_EmployeesHelper.TypeText("FirstNAME", xlString);

                    //Employee Last Name
                    xlString = (string)(xlrange.Cells[xlRowCnt, 3] as Excel.Range).Value2;
                    agents_EmployeesHelper.TypeText("LastName", xlString);

                    //Employee Birthday
                    xlString = (string)(xlrange.Cells[xlRowCnt, 4] as Excel.Range).Value2;
                    agents_EmployeesHelper.TypeText("BirthDay", xlString);

                    //Employee eAddress Type
                    xlString = (string)(xlrange.Cells[xlRowCnt, 6] as Excel.Range).Value2;
                    agents_EmployeesHelper.SelectByText("eAddressType", xlString);
                    agents_EmployeesHelper.WaitForWorkAround(1000);

                    //Employee eAddress Label
                    xlString = (string)(xlrange.Cells[xlRowCnt, 7] as Excel.Range).Value2;
                    agents_EmployeesHelper.SelectByText("eAddressLebel", xlString);

                    //Employee eAddress
                    xlString = (string)(xlrange.Cells[xlRowCnt, 8] as Excel.Range).Value2;
                    agents_EmployeesHelper.TypeText("eAddress", xlString);

                    //Employee Username
                    xlString = (string)(xlrange.Cells[xlRowCnt, 9] as Excel.Range).Value2;
                    agents_EmployeesHelper.TypeText("UserName", xlString);

                    //Employee Password
                    agents_EmployeesHelper.ClickElement("AutoGenPswdChkBox");
                    agents_EmployeesHelper.WaitForWorkAround(1000);
                    try
                    {
                        xlDouble = (double)(xlrange.Cells[xlRowCnt, 10] as Excel.Range).Value2;
                        xlString = "" + xlDouble;
                        agents_EmployeesHelper.TypeText("Password", xlString);
                    }
                    catch (Microsoft.CSharp.RuntimeBinder.RuntimeBinderException)
                    {
                        xlString = (string)(xlrange.Cells[xlRowCnt, 10] as Excel.Range).Value2;
                        agents_EmployeesHelper.TypeText("Password", xlString);
                    }

                    //Employee Avatar
                    xlString = (string)(xlrange.Cells[xlRowCnt, 11] as Excel.Range).Value2;
                    int num = agents_EmployeesHelper.XpathCount("//form[@id='EmployeeCreateEmployeeForm']/div[3]/div[5]/div/div/div[2]/div/div[3]/ul/li");
                    Console.WriteLine("num=" + num);
                    for (int i = 1; i <= num; i++)
                    {
                        string name = agents_EmployeesHelper.GetText("//form[@id='EmployeeCreateEmployeeForm']/div[3]/div[5]/div/div/div[2]/div/div[3]/ul/li[" + i + "]/label/span");
                        if (name == xlString)
                        {
                            agents_EmployeesHelper.Click("//form[@id='EmployeeCreateEmployeeForm']/div[3]/div[5]/div/div/div[2]/div/div[3]/ul/li[" + i + "]/input");
                            agents_EmployeesHelper.WaitForWorkAround(1000);
                            break;
                        }
                        else
                        {
                            continue;
                        }
                    }

                    //Click on Save
                    agents_EmployeesHelper.ClickElement("SaveEmployee");
                    agents_EmployeesHelper.WaitForWorkAround(3000);
                    if (GetWebDriver().PageSource.Contains("This username already taken") == true)
                    {
                        continue;
                    }
                }

                else if (xlString == "Sales Agent")
                {
                    GetWebDriver().Navigate().GoToUrl("https://www.mypegasuscrm.com/newthemecorp/" + username[0] + "/sales_agents/create");
                    agent_1099SalesAgentHelper.WaitForWorkAround(3000);

                    //1099 Sales Agent First Name
                    xlString = (string)(xlrange.Cells[xlRowCnt, 2] as Excel.Range).Value2;
                    agent_1099SalesAgentHelper.TypeText("FirstNAME", xlString);

                    //1099 Sales Agent Last Name
                    xlString = (string)(xlrange.Cells[xlRowCnt, 3] as Excel.Range).Value2;
                    agent_1099SalesAgentHelper.TypeText("LastName", xlString);

                    //1099 Sales Agent Birthday
                    xlString = (string)(xlrange.Cells[xlRowCnt, 4] as Excel.Range).Value2;
                    agent_1099SalesAgentHelper.TypeText("BirthDay", xlString);

                    //1099 Sales Agent eAddress Type
                    xlString = (string)(xlrange.Cells[xlRowCnt, 6] as Excel.Range).Value2;
                    agent_1099SalesAgentHelper.SelectByText("eAddressType", xlString);
                    agent_1099SalesAgentHelper.WaitForWorkAround(1000);

                    //1099 Sales Agent eAddress Label
                    xlString = (string)(xlrange.Cells[xlRowCnt, 7] as Excel.Range).Value2;
                    agent_1099SalesAgentHelper.SelectByText("eAddressLebel", xlString);

                    //1099 Sales Agent eAddress
                    xlString = (string)(xlrange.Cells[xlRowCnt, 8] as Excel.Range).Value2;
                    agent_1099SalesAgentHelper.TypeText("eAddress", xlString);

                    //1099 Sales Agent Username
                    xlString = (string)(xlrange.Cells[xlRowCnt, 9] as Excel.Range).Value2;
                    agent_1099SalesAgentHelper.TypeText("UserName", xlString);

                    //1099 Sales Agent Password
                    agent_1099SalesAgentHelper.ClickElement("AutoGenPswd");
                    agent_1099SalesAgentHelper.WaitForWorkAround(1000);
                    try
                    {
                        xlDouble = (double)(xlrange.Cells[xlRowCnt, 10] as Excel.Range).Value2;
                        xlString = "" + xlDouble;
                        agent_1099SalesAgentHelper.TypeText("Password", xlString);
                    }
                    catch (Microsoft.CSharp.RuntimeBinder.RuntimeBinderException)
                    {
                        xlString = (string)(xlrange.Cells[xlRowCnt, 10] as Excel.Range).Value2;
                        agent_1099SalesAgentHelper.TypeText("Password", xlString);
                    }

                    //1099 Sales Agent Avatar
                    xlString = (string)(xlrange.Cells[xlRowCnt, 11] as Excel.Range).Value2;
                    int num = agent_1099SalesAgentHelper.XpathCount("//form[@id='EmployeeCreateSalesUserForm']/div[3]/div[3]/div/div/div[2]/div/div[3]/ul/li");
                    for (int i = 1; i <= num; i++)
                    {
                        string name = agent_1099SalesAgentHelper.GetText("//form[@id='EmployeeCreateSalesUserForm']/div[3]/div[3]/div/div/div[2]/div/div[3]/ul/li[" + i + "]/label/span");
                        if (name == xlString)
                        {
                            agent_1099SalesAgentHelper.Click("//form[@id='EmployeeCreateSalesUserForm']/div[3]/div[3]/div/div/div[2]/div/div[3]/ul/li[" + i + "]/input");
                            break;
                        }
                        else
                        {
                            continue;
                        }
                    }

                    //Click on Save
                    agent_1099SalesAgentHelper.ClickElement("SaveSaleAgent");
                    agent_1099SalesAgentHelper.WaitForWorkAround(3000);
                    if (GetWebDriver().PageSource.Contains("This username already taken") == true)
                    {
                        continue;
                    }
                }

                else if (xlString == "Referral Agent")
                {
                    GetWebDriver().Navigate().GoToUrl("https://www.mypegasuscrm.com/newthemecorp/" + username[0] + "/partners/agent/create");
                    agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                    //Partner Agent First Name
                    xlString = (string)(xlrange.Cells[xlRowCnt, 2] as Excel.Range).Value2;
                    agents_PartnerAgentsHelper.TypeText("FirstName", xlString);

                    //Partner Agent Last Name
                    xlString = (string)(xlrange.Cells[xlRowCnt, 3] as Excel.Range).Value2;
                    agents_PartnerAgentsHelper.TypeText("LastName", xlString);

                    //Partner Agent Birthday
                    xlString = (string)(xlrange.Cells[xlRowCnt, 4] as Excel.Range).Value2;
                    agents_PartnerAgentsHelper.TypeText("BirthDay", xlString);

                    //Partner Agent eAddress Type
                    xlString = (string)(xlrange.Cells[xlRowCnt, 6] as Excel.Range).Value2;
                    agents_PartnerAgentsHelper.SelectByText("eAddressType", xlString);
                    agents_PartnerAgentsHelper.WaitForWorkAround(1000);

                    //Partner Agent eAddress Label
                    xlString = (string)(xlrange.Cells[xlRowCnt, 7] as Excel.Range).Value2;
                    agents_PartnerAgentsHelper.SelectByText("eAddressLebel", xlString);

                    //Partner Agent eAddress
                    xlString = (string)(xlrange.Cells[xlRowCnt, 8] as Excel.Range).Value2;
                    agents_PartnerAgentsHelper.TypeText("eAddress", xlString);

                    //Partner Agent Username
                    xlString = (string)(xlrange.Cells[xlRowCnt, 9] as Excel.Range).Value2;
                    agents_PartnerAgentsHelper.TypeText("UserName", xlString);

                    //Partner Agent Password
                    agents_PartnerAgentsHelper.ClickElement("AutoGenPassword");
                    agents_PartnerAgentsHelper.WaitForWorkAround(1000);
                    try
                    {
                        xlDouble = (double)(xlrange.Cells[xlRowCnt, 10] as Excel.Range).Value2;
                        xlString = "" + xlDouble;
                        agents_PartnerAgentsHelper.TypeText("UserPassword", xlString);
                    }
                    catch (Microsoft.CSharp.RuntimeBinder.RuntimeBinderException)
                    {
                        xlString = (string)(xlrange.Cells[xlRowCnt, 10] as Excel.Range).Value2;
                        agents_PartnerAgentsHelper.TypeText("UserPassword", xlString);
                    }

                    //Partner Agent Avatar
                    xlString = (string)(xlrange.Cells[xlRowCnt, 11] as Excel.Range).Value2;
                    int num = agents_PartnerAgentsHelper.XpathCount("//div[@id='user_data']/div/div[3]/ul/li");
                    for (int i = 1; i <= num; i++)
                    {
                        string name = agents_PartnerAgentsHelper.GetText("//div[@id='user_data']/div/div[3]/ul/li[" + i + "]/label/span");
                        if (name == xlString)
                        {
                            agents_PartnerAgentsHelper.Click("//div[@id='user_data']/div/div[3]/ul/li[" + i + "]/input");
                            break;
                        }
                        else
                        {
                            continue;
                        }
                    }

                    //Click on Save
                    agents_PartnerAgentsHelper.ClickElement("ClickSave");
                    agents_PartnerAgentsHelper.WaitForWorkAround(3000);
                    if (GetWebDriver().PageSource.Contains("This username already taken") == true)
                    {
                        continue;
                    }
                }

                else if (xlString == "Referral Association")
                {
                    GetWebDriver().Navigate().GoToUrl("https://www.mypegasuscrm.com/newthemecorp/" + username[0] + "/partners/association/create");
                    agents_PartnerAssociationHelper.WaitForWorkAround(3000);

                    //Partner Association First Name
                    xlString = (string)(xlrange.Cells[xlRowCnt, 2] as Excel.Range).Value2;
                    agents_PartnerAssociationHelper.TypeText("FirstNAME", xlString);

                    //Partner Association Last Name
                    xlString = (string)(xlrange.Cells[xlRowCnt, 3] as Excel.Range).Value2;
                    agents_PartnerAssociationHelper.TypeText("LastName", xlString);

                    //Partner Association Birthday
                    xlString = (string)(xlrange.Cells[xlRowCnt, 4] as Excel.Range).Value2;
                    agents_PartnerAssociationHelper.TypeText("Birthday", xlString);

                    //Partner Association Name
                    xlString = (string)(xlrange.Cells[xlRowCnt, 5] as Excel.Range).Value2;
                    agents_PartnerAssociationHelper.TypeText("Name", xlString);

                    //Partner Association eAddress Type
                    xlString = (string)(xlrange.Cells[xlRowCnt, 6] as Excel.Range).Value2;
                    agents_PartnerAssociationHelper.SelectByText("eAddressType", xlString);
                    agents_PartnerAssociationHelper.WaitForWorkAround(1000);

                    //Partner Association eAddress Label
                    xlString = (string)(xlrange.Cells[xlRowCnt, 7] as Excel.Range).Value2;
                    agents_PartnerAssociationHelper.SelectByText("eAddressLebel", xlString);

                    //Partner Association eAddress
                    xlString = (string)(xlrange.Cells[xlRowCnt, 8] as Excel.Range).Value2;
                    agents_PartnerAssociationHelper.TypeText("eAddress", xlString);

                    //Partner Association Username
                    xlString = (string)(xlrange.Cells[xlRowCnt, 9] as Excel.Range).Value2;
                    agents_PartnerAssociationHelper.TypeText("UserName", xlString);

                    //Partner Association Password
                    agents_PartnerAssociationHelper.ClickElement("AutoGenPswd");
                    agents_PartnerAssociationHelper.WaitForWorkAround(1000);
                    try
                    {
                        xlDouble = (double)(xlrange.Cells[xlRowCnt, 10] as Excel.Range).Value2;
                        xlString = "" + xlDouble;
                        agents_PartnerAssociationHelper.TypeText("Password", xlString);
                    }
                    catch (Microsoft.CSharp.RuntimeBinder.RuntimeBinderException)
                    {
                        xlString = (string)(xlrange.Cells[xlRowCnt, 10] as Excel.Range).Value2;
                        agents_PartnerAssociationHelper.TypeText("Password", xlString);
                    }

                    //Partner Association Avatar
                    xlString = (string)(xlrange.Cells[xlRowCnt, 11] as Excel.Range).Value2;
                    int num = agents_PartnerAssociationHelper.XpathCount("//form[@id='PartnerAssociationAssociationCreateForm']/div[3]/div[3]/div/div/div[2]/div/div[3]/ul/li");
                    for (int i = 1; i <= num; i++)
                    {
                        string name = agents_PartnerAssociationHelper.GetText("//form[@id='PartnerAssociationAssociationCreateForm']/div[3]/div[3]/div/div/div[2]/div/div[3]/ul/li[" + i + "]/label/span");
                        if (name == xlString)
                        {
                            agents_PartnerAssociationHelper.Click("//form[@id='PartnerAssociationAssociationCreateForm']/div[3]/div[3]/div/div/div[2]/div/div[3]/ul/li[" + i + "]/input");
                            break;
                        }
                        else
                        {
                            continue;
                        }
                    }

                    //Click on Save
                    agents_PartnerAssociationHelper.ClickElement("ClickSaveBTN");
                    agents_PartnerAssociationHelper.WaitForWorkAround(3000);
                    if (GetWebDriver().PageSource.Contains("This username already taken") == true)
                    {
                        continue;
                    }
                }
                else
                {
                    continue;
                }
            }
        }
コード例 #6
0
        public void employeeAgentAdvancedFilterIssue()
        {
            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_EmployeeHelper = new Agents_EmployeesHelper(GetWebDriver());

            // VARIABLE
            var    name   = "TestEmployee" + GetRandomNumber();
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("EmployeeAgentAdvancedFilterIssue", "Redirect To Agent Employee page");
                VisitOffice("employees");

                executionLog.Log("EmployeeAgentAdvancedFilterIssue", "Click on Employee Advance filter");
                agent_EmployeeHelper.ClickElement("AdvanceFilter");

                executionLog.Log("EmployeeAgentAdvancedFilterIssue", "Select results per page");
                agent_EmployeeHelper.Select("ResultsPerPage", "10");

                executionLog.Log("EmployeeAgentAdvancedFilterIssue", "Click on Apply button");
                agent_EmployeeHelper.ClickElement("ApplyButton");
                agent_EmployeeHelper.WaitForWorkAround(4000);

                executionLog.Log("EmployeeAgentAdvancedFilterIssue", "Verify no. of records at bottom of the page.");
                agent_EmployeeHelper.VerifyText("BottomResults", "Showing 1 - 10");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("EmployeeAgentAdvancedFilterIssue");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Employee Agent Advanced Filter Issue");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Employee Agent Advanced Filter Issue", "Bug", "Medium", "Agent Employee page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Employee Agent Advanced Filter Issue");
                        TakeScreenshot("EmployeeAgentAdvancedFilterIssue");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\EmployeeAgentAdvancedFilterIssue.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("EmployeeAgentAdvancedFilterIssue");
                        string id            = loginHelper.getIssueID("Employee Agent Advanced Filter Issue");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\EmployeeAgentAdvancedFilterIssue.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Employee Agent Advanced Filter Issue"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Employee Agent Advanced Filter Issue");
                //  executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("EmployeeAgentAdvancedFilterIssue");
                executionLog.WriteInExcel("Employee Agent Advanced Filter Issue", Status, JIRA, "Agents Portal");
            }
        }
コード例 #7
0
        public void employeeAgentBirthdateOnInfoPage()
        {
            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 agents_EmployeesHelper = new Agents_EmployeesHelper(GetWebDriver());

            // Variable

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

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

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

                executionLog.Log("EmployeeAgentBirthdateOnInfoPage", "Goto Opportinuties");
                VisitOffice("employees");

                executionLog.Log("EmployeeAgentBirthdateOnInfoPage", "Open Employee 1");
                agents_EmployeesHelper.ClickElement("EditEmployee1");
                agents_EmployeesHelper.WaitForWorkAround(5000);

                executionLog.Log("EmployeeAgentBirthdateOnInfoPage", "Select Birth Date");
                agents_EmployeesHelper.TypeText("BirthDay", "11/18/1992");
                agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("EmployeeAgentBirthdateOnInfoPage", "Click On Save Button");
                agents_EmployeesHelper.clickJS("SaveEmployee");
                agents_EmployeesHelper.WaitForWorkAround(9000);

                executionLog.Log("EmployeeAgentBirthdateOnInfoPage", "Open Employee 1");
                agents_EmployeesHelper.ClickElement("EditEmployee1");
                agents_EmployeesHelper.WaitForWorkAround(5000);

                executionLog.Log("EmployeeAgentBirthdateOnInfoPage", "Verify birthdate on Employee I page.");
                agents_EmployeesHelper.IsElementPresent("//div[contains(text(),'11/18/1992')]");
                agents_EmployeesHelper.WaitForWorkAround(5000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("EmployeeAgentBirthdateOnInfoPage");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Employee Agent Birthdate On Info Page");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Employee Agent Birthdate On Info Page", "Bug", "Medium", "Employee page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Employee Agent Birthdate On Info Page");
                        TakeScreenshot("EmployeeAgentBirthdateOnInfoPage");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\EmployeeAgentBirthdateOnInfoPage.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("EmployeeAgentBirthdateOnInfoPage");
                        string id            = loginHelper.getIssueID("Employee Agent Birthdate On Info Page");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\EmployeeAgentBirthdateOnInfoPage.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Employee Agent Birthdate On Info Page"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Employee Agent Birthdate On Info Page");
                // executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("EmployeeAgentBirthdateOnInfoPage");
                executionLog.WriteInExcel("Employee Agent Birthdate On Info Page", Status, JIRA, "Corp Master Data");
            }
        }
コード例 #8
0
        public void agentCodeAndRevenueShareValidation()
        {
            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_Employee = new Agents_EmployeesHelper(GetWebDriver());

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

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

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

                executionLog.Log("AgentCodeAndRevenueShareValidation", "Redirect to the URL");
                VisitOffice("employees");

                executionLog.Log("AgentCodeAndRevenueShareValidation", "Click on any Agent employee.");
                agent_Employee.ClickElement("ClikOnEmployeeAgent");

                executionLog.Log("AgentCodeAndRevenueShareValidation", "Wait for edit icon to be present.");
                agent_Employee.WaitForElementPresent("ClickOnEditRSAC", 10);

                var EditLink = "//table[@id='list2']/tbody/tr[2]";

                if (agent_Employee.IsElementPresent(EditLink))
                {
                    executionLog.Log("AgentCodeAndRevenueShareValidation", "Click Edit revenue share");
                    agent_Employee.ClickElement("ClickOnEditRSAC");

                    executionLog.Log("AgentCodeAndRevenueShareValidation", "Enter Albhabet value in Revenue share");
                    agent_Employee.TypeText("EnterRSInAlphabet", "One");

                    executionLog.Log("AgentCodeAndRevenueShareValidation", "Enter Albhabet in Second Field");
                    agent_Employee.TypeText("EnterEditRSAC", "One");

                    executionLog.Log("AgentCodeAndRevenueShareValidation", "Click Save");
                    agent_Employee.ClickElement("ClickonSaveEditRC");

                    executionLog.Log("AgentCodeAndRevenueShareValidation", "Verify Validation message for valid naumber.");
                    agent_Employee.WaitForText("Please enter a valid number", 10);
                }
                else
                {
                    executionLog.Log("AgentCodeAndRevenueShareValidation", "Click New Agent Code");
                    agent_Employee.ClickElement("AddaNewAgentCodse");

                    executionLog.Log("AgentCodeAndRevenueShareValidation", "Enetr Sales code");
                    agent_Employee.TypeText("SalesCode", "1");

                    executionLog.Log("AgentCodeAndRevenueShareValidation", "Enetr Revenue Share");
                    agent_Employee.TypeText("RevenueSahreAsAgent", "2");

                    executionLog.Log("AgentCodeAndRevenueShareValidation", "Enetr Revenue Share as Manager");
                    agent_Employee.TypeText("RevenueShareAsManager", "2");

                    executionLog.Log("AgentCodeAndRevenueShareValidation", "Click Save button");
                    agent_Employee.ClickElement("ClickSaveBtnRSAC");
                    agent_Employee.WaitForElementPresent("ClickOnEditRSAC", 10);

                    executionLog.Log("AgentCodeAndRevenueShareValidation", "Click Edit revenue share");
                    agent_Employee.ClickElement("ClickOnEditRSAC");

                    executionLog.Log("AgentCodeAndRevenueShareValidation", "Enter Alpha value in first field. ");
                    agent_Employee.TypeText("EnterRSInAlphabet", "One");

                    executionLog.Log("AgentCodeAndRevenueShareValidation", "Enter Alphabet in Second Field");
                    agent_Employee.TypeText("EnterEditRSAC", "One");

                    executionLog.Log("AgentCodeAndRevenueShareValidation", "Click Save");
                    agent_Employee.ClickElement("ClickonSaveEditRC");

                    executionLog.Log("AgentCodeAndRevenueShareValidation", "Verify Validation");
                    agent_Employee.WaitForText("Please enter a valid number", 10);
                }
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("AgentCodeAndRevenueShareValidation");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("AgentCode And Revenue Share Validation");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("AgentCode And Revenue Share Validation", "Bug", "Medium", "Office Agent", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("AgentCode And Revenue Share Validation");
                        TakeScreenshot("AgentCodeAndRevenueShareValidation");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\AgentCodeAndRevenueShareValidation.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("AgentCodeAndRevenueShareValidation");
                        string id            = loginHelper.getIssueID("AgentCode And Revenue Share Validation");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\AgentCodeAndRevenueShareValidation.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("AgentCode And Revenue Share Validation"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("AgentCode And Revenue Share Validation");
                //  executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("AgentCodeAndRevenueShareValidation");
                executionLog.WriteInExcel("AgentCode And Revenue Share Validation", Status, JIRA, "Agents Portal");
            }
        }
コード例 #9
0
        public void agentEmployeeAdvanceFilterResultsPP()
        {
            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 agents_EmployeesHelper = new Agents_EmployeesHelper(GetWebDriver());

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

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

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

                executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Redirect at employee page.");
                VisitOffice("employees");
                agents_EmployeesHelper.WaitForWorkAround(3000);

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

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

                executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Click on Apply button.");
                agents_EmployeesHelper.ClickElement("ApplyButton");
                agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Verify number of records displayed.");
                //agents_EmployeesHelper.VerifyText("BottomResults", "Showing 1 - 10 of");
                agents_EmployeesHelper.ShowResult(10);
                //agents_EmployeesHelper.WaitForWorkAround(3000);

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

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

                executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Click on Apply button.");
                agents_EmployeesHelper.ClickElement("ApplyButton");
                agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Verify number of records displayed.");
                // agents_EmployeesHelper.VerifyText("BottomResults", "Showing 1 - 20 of");
                agents_EmployeesHelper.ShowResult(20);
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                //executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Click on advance filter.");
                //agents_EmployeesHelper.ClickElement("AdvanceFilter");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

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

                //executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Click on ApplyButton button.");
                //agents_EmployeesHelper.ClickElement("ApplyButton");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                //executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Verify number of records displayed.");
                //// agents_EmployeesHelper.VerifyText("BottomResults", "Showing 1 - 50 of");
                //agents_EmployeesHelper.ShowResult(50);
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                //executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Click on advance filter.");
                //agents_EmployeesHelper.ClickElement("AdvanceFilter");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

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

                //executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Click on ApplyButton button.");
                //agents_EmployeesHelper.ClickElement("ApplyButton");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                //executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "Verify number of records displayed.");
                ////agents_EmployeesHelper.VerifyText("BottomResults", "Showing 1 - 100 of");
                //agents_EmployeesHelper.ShowResult(100);
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("AgentEmployeeAdvanceFilterResultsPP", "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("AgentEmployeeAdvanceFilterResultsPP");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Agent Employee Advance Filter ResultsPP");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Agent Employee 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("Agent Employee Advance Filter ResultsPP");
                        TakeScreenshot("AgentEmployeeAdvanceFilterResultsPP");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\AgentEmployeeAdvanceFilterResultsPP.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("AgentEmployeeAdvanceFilterResultsPP");
                        string id            = loginHelper.getIssueID("Agent Employee Advance Filter ResultsPP");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\AgentEmployeeAdvanceFilterResultsPP.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Agent Employee Advance Filter ResultsPP"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Agent Employee Advance Filter ResultsPP");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("AgentEmployeeAdvanceFilterResultsPP");
                executionLog.WriteInExcel("Agent Employee Advance Filter ResultsPP", Status, JIRA, "Opportunities Management");
            }
        }
コード例 #10
0
        public void verifyEmployeeEAddressLabel()
        {
            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_EmployeeHelper = new Agents_EmployeesHelper(GetWebDriver());

            // VARIABLE
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("VerifyEmployeeEAddressLabel", "Redirect To Create Employee page");
                VisitOffice("employees/create");
                agent_EmployeeHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyEmployeeEAddressLabel", "Select eAddress Type >> E-mail");
                agent_EmployeeHelper.SelectByText("eAddressType", "E-Mail");
                agent_EmployeeHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyEmployeeEAddressLabel", "Verify eAddress Label >> Work");
                agent_EmployeeHelper.selectedOption("eAddressLebel", "Work");
                agent_EmployeeHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyEmployeeEAddressLabel", "Select eAddress Type >> IM");
                agent_EmployeeHelper.SelectByText("eAddressType", "IM");
                agent_EmployeeHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyEmployeeEAddressLabel", "Verify eAddress Label >> Google");
                agent_EmployeeHelper.selectedOption("eAddressLebel", "Google");
                agent_EmployeeHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyEmployeeEAddressLabel", "Select eAddress Type >> Social Media");
                agent_EmployeeHelper.SelectByText("eAddressType", "Social Media");
                agent_EmployeeHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyEmployeeEAddressLabel", "Verify eAddress Label >> Facebook");
                agent_EmployeeHelper.selectedOption("eAddressLebel", "Facebook");
                agent_EmployeeHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyEmployeeEAddressLabel", "Select eAddress Type >> Web Links");
                agent_EmployeeHelper.SelectByText("eAddressType", "Web Links");
                agent_EmployeeHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyEmployeeEAddressLabel", "Verify eAddress Label >> Web Link");
                agent_EmployeeHelper.selectedOption("eAddressLebel", "Web Link");
                agent_EmployeeHelper.WaitForWorkAround(1000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyEmployeeEAddressLabel");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Employee EAddress Label");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Employee EAddress Label", "Bug", "Medium", "Employee page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Employee EAddress Label");
                        TakeScreenshot("VerifyEmployeeEAddressLabel");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyEmployeeEAddressLabel.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyEmployeeEAddressLabel");
                        string id            = loginHelper.getIssueID("Verify Employee EAddress Label");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyEmployeeEAddressLabel.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Employee EAddress Label"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Employee EAddress Label");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyEmployeeEAddressLabel");
                executionLog.WriteInExcel("Verify Employee EAddress Label", Status, JIRA, "Office Employees");
            }
        }
コード例 #11
0
        public void verifyTypoInZipCodeAutoCityPopulate()
        {
            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 agents_EmployeesHelper = new Agents_EmployeesHelper(GetWebDriver());
            var agent_PartnerAgentHelper = new Agents_PartnerAgentsHelper(GetWebDriver());
            var agents_PartnerAssociationHelper = new Agents_PartnerAssociationHelper(GetWebDriver());

            // Variable
            String JIRA = "";
            String Status = "Pass";

            try
            {
                //Verify typo on create employee page

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

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

                executionLog.Log("VerifyTypoInZipCodeAutoCityPopulate", "Redirect at Create employee page.");
                VisitOffice("employees/create");
                agents_EmployeesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyTypoInZipCodeAutoCityPopulate", "Enter zip code");
                agents_EmployeesHelper.TypeText("PostalCode", "20001");
                agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyTypoInZipCodeAutoCityPopulate", "Verify City populated");
                agents_EmployeesHelper.VerifyFieldValue("City", "Washington");

                executionLog.Log("VerifyTypoInZipCodeAutoCityPopulate", "Verify City populated");
                agents_EmployeesHelper.selectedOption("State", "DC");

                //Verify typo on create partner agent page

                executionLog.Log("VerifyTypoInZipCodeAutoCityPopulate", "Redirect at Create partner agent page.");
                VisitOffice("partners/agent/create");
                agent_PartnerAgentHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyTypoInZipCodeAutoCityPopulate", "Enter zip code");
                agent_PartnerAgentHelper.TypeText("PostalCode", "20001");
                agent_PartnerAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyTypoInZipCodeAutoCityPopulate", "Verify City populated");
                agent_PartnerAgentHelper.VerifyFieldValue("City", "Washington");

                executionLog.Log("VerifyTypoInZipCodeAutoCityPopulate", "Verify City populated");
                agent_PartnerAgentHelper.selectedOption("State", "DC");

                //Verify typo on edit partner agent page

                executionLog.Log("VerifyTypoInZipCodeAutoCityPopulate", "Redirect at All partner agent page.");
                VisitOffice("partners/agents");
                agent_PartnerAgentHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyTypoInZipCodeAutoCityPopulate", "Edit a partner agent");
                agent_PartnerAgentHelper.ClickElement("FirstEditIcon");
                agent_PartnerAgentHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyTypoInZipCodeAutoCityPopulate", "Enter zip code");
                agent_PartnerAgentHelper.TypeText("PostalCode", "20001");
                agent_PartnerAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyTypoInZipCodeAutoCityPopulate", "Verify City populated");
                agent_PartnerAgentHelper.VerifyFieldValue("City", "Washington");

                executionLog.Log("VerifyTypoInZipCodeAutoCityPopulate", "Verify City populated");
                agent_PartnerAgentHelper.selectedOption("State", "DC");

                //Verify typo on create partner association page

                executionLog.Log("VerifyTypoInZipCodeAutoCityPopulate", "Redirect at Create partner agent page.");
                VisitOffice("partners/association/create");
                agents_PartnerAssociationHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyTypoInZipCodeAutoCityPopulate", "Enter zip code");
                agents_PartnerAssociationHelper.TypeText("PostalCode", "20001");
                agents_PartnerAssociationHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyTypoInZipCodeAutoCityPopulate", "Verify City populated");
                agents_PartnerAssociationHelper.VerifyFieldValue("City", "Washington");

                executionLog.Log("VerifyTypoInZipCodeAutoCityPopulate", "Verify City populated");
                agents_PartnerAssociationHelper.selectedOption("State", "DC");

                //Verify typo on edit partner association page

                executionLog.Log("VerifyTypoInZipCodeAutoCityPopulate", "Redirect at All partner agent page.");
                VisitOffice("partners/associations");
                agents_PartnerAssociationHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyTypoInZipCodeAutoCityPopulate", "Edit a partner agent");
                agents_PartnerAssociationHelper.ClickElement("EditAssociation1");
                agents_PartnerAssociationHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyTypoInZipCodeAutoCityPopulate", "Enter zip code");
                agents_PartnerAssociationHelper.TypeText("PostalCode", "20001");
                agents_PartnerAssociationHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyTypoInZipCodeAutoCityPopulate", "Verify City populated");
                agents_PartnerAssociationHelper.VerifyFieldValue("City", "Washington");

                executionLog.Log("VerifyTypoInZipCodeAutoCityPopulate", "Verify City populated");
                agents_PartnerAssociationHelper.selectedOption("State", "DC");

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

                String counter = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyTypoInZipCodeAutoCityPopulate");
                String Error = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Typo In Zip Code Auto City Populate");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Typo In Zip Code Auto City Populate", "Bug", "Medium", "Partner page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Typo In Zip Code Auto City Populate");
                        TakeScreenshot("VerifyTypoInZipCodeAutoCityPopulate");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var location = directoryName + "\\VerifyTypoInZipCodeAutoCityPopulate.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyTypoInZipCodeAutoCityPopulate");
                        string id = loginHelper.getIssueID("Verify Typo In Zip Code Auto City Populate");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var location = directoryName + "\\VerifyTypoInZipCodeAutoCityPopulate.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Typo In Zip Code Auto City Populate"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Typo In Zip Code Auto City Populate");
             //   executionLog.DeleteFile("Error");
                throw;

            }
            finally
            {
                executionLog.DeleteFile("VerifyTypoInZipCodeAutoCityPopulate");
                executionLog.WriteInExcel("Verify Typo In Zip Code Auto City Populate", Status, JIRA, "Agents Portal");
            }
        }
        public void employeeAdjustmentValidationToSelectAgent()
        {
            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_EmployeeHelper = new Agents_EmployeesHelper(GetWebDriver());

            // VARIABLE
            var    name   = "TestEmployee" + GetRandomNumber();
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("EmployeeAdjustmentValidationToSelectAgent", "Redirect To Employee page");
                VisitOffice("employees");

                executionLog.Log("EmployeeAdjustmentValidationToSelectAgent", "Click on first employee.");
                agent_EmployeeHelper.ClickElement("OpenFirstAgent");

                executionLog.Log("EmployeeAdjustmentValidationToSelectAgent", "Click On Create Button");
                agent_EmployeeHelper.ClickElement("ClickOnCreateButton");

                executionLog.Log("EmployeeAdjustmentValidationToSelectAgent", "Click on Sale Agent.");
                agent_EmployeeHelper.ClickElement("ClickOnSaleAgent");

                executionLog.Log("EmployeeAdjustmentValidationToSelectAgent", "Wait for element to present.");
                agent_EmployeeHelper.WaitForElementPresent("EnterNameAdjustment", 05);

                executionLog.Log("EmployeeAdjustmentValidationToSelectAgent", "Enter Name Adjustment");
                agent_EmployeeHelper.TypeText("EnterNameAdjustment", "Test Validation");

                executionLog.Log("EmployeeAdjustmentValidationToSelectAgent", "Select Adjustment Type");
                agent_EmployeeHelper.Select("SelectAdjustmentType", "Transaction");

                executionLog.Log("EmployeeAdjustmentValidationToSelectAgent", "Select Processor");
                agent_EmployeeHelper.Select("SelectProcessor", "Any");

                executionLog.Log("EmployeeAdjustmentValidationToSelectAgent", "Click Clear Agent Revenue Adjustment");
                agent_EmployeeHelper.ClickElement("ClickClearAgentRAdjustment");

                executionLog.Log("EmployeeAdjustmentValidationToSelectAgent", "Click On Save button");
                agent_EmployeeHelper.ClickElement("ClickOnSaveAdjutment");

                executionLog.Log("EmployeeAdjustmentValidationToSelectAgent", "Verify Alert Select One Sales Agent");
                agent_EmployeeHelper.VerifyAlertText("Select One Sales Agent");
                agent_EmployeeHelper.WaitForWorkAround(2000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("EmployeeAdjustmentValidationToSelectAgent");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Employee Adjustment Validation To SelectAgent");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Employee Adjustment Validation To SelectAgent", "Bug", "Medium", "Employee Agent", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Employee Adjustment Validation To SelectAgent");
                        TakeScreenshot("EmployeeAdjustmentValidationToSelectAgent");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\EmployeeAdjustmentValidationToSelectAgent.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("EmployeeAdjustmentValidationToSelectAgent");
                        string id            = loginHelper.getIssueID("Employee Adjustment Validation To SelectAgent");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\EmployeeAdjustmentValidationToSelectAgent.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Employee Adjustment Validation To SelectAgent"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Employee Adjustment Validation To SelectAgent");
                // executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("EmployeeAdjustmentValidationToSelectAgent");
                executionLog.WriteInExcel("Employee Adjustment Validation To SelectAgent", Status, JIRA, "Agents Portal");
            }
        }
コード例 #13
0
        public void statusFilterForEmployeeAgent()
        {
            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_EmployeeHelper = new Agents_EmployeesHelper(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("StatusFilterForEmployeeAgent", "Login with valid username and password");
                Login(username[0], password[0]);
                Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]);

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

                executionLog.Log("StatusFilterForEmployeeAgent", "Redirect To Employee");
                VisitOffice("employees");

                executionLog.Log("StatusFilterForEmployeeAgent", "Select Status");
                agent_EmployeeHelper.Select("SelectStatus", "Active");
                agent_EmployeeHelper.WaitForWorkAround(3000);

                executionLog.Log("StatusFilterForEmployeeAgent", "Select Status");
                agent_EmployeeHelper.Select("SelectStatus", "Disabled");
                agent_EmployeeHelper.WaitForWorkAround(3000);

                executionLog.Log("StatusFilterForEmployeeAgent", "Select Status");
                agent_EmployeeHelper.Select("SelectStatus", "");
                agent_EmployeeHelper.WaitForWorkAround(3000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            // Variable Random
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Redirect To URL");
                VisitOffice("employees");
                agents_EmployeesHelper.WaitForWorkAround(4000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Verify status column is visible on the page..");
                agents_EmployeesHelper.IsElementPresent("HeadStatus");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Verify role column is visible on the page.");
                agents_EmployeesHelper.IsElementPresent("HeadRole");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Verify department column is visible on the page.");
                agents_EmployeesHelper.IsElementPresent("HeadDepartment");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Verify team column is visible on the page.");
                agents_EmployeesHelper.IsElementPresent("HeadTeam");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Click on advance filter.");
                agents_EmployeesHelper.ClickElement("AdvanceFilter");
                agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Select status in displayed columns.");
                agents_EmployeesHelper.SelectByText("DisplayedCols", "Status");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Click arrow to move column to avail cols.");
                agents_EmployeesHelper.ClickElement("RemoveCols");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Select role in displayed columns.");
                agents_EmployeesHelper.SelectByText("DisplayedCols", "Role");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Click arrow to move column to avail cols");
                agents_EmployeesHelper.ClickElement("RemoveCols");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Select department in displayed columns.");
                agents_EmployeesHelper.SelectByText("DisplayedCols", "Department");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Click arrow to move column to avail cols");
                agents_EmployeesHelper.ClickElement("RemoveCols");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Select team in displayed columns.");
                agents_EmployeesHelper.SelectByText("DisplayedCols", "Team");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Click arrow to move column to avail cols");
                agents_EmployeesHelper.ClickElement("RemoveCols");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Click on Apply button.");
                agents_EmployeesHelper.ClickElement("ApplyButton");
                agents_EmployeesHelper.WaitForWorkAround(4000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Verify status not present on page.");
                agents_EmployeesHelper.IsElementNotPresent("HeadStatus");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Verify role not present on page.");
                agents_EmployeesHelper.IsElementNotPresent("HeadRole");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Verify department not present on page.");
                agents_EmployeesHelper.IsElementNotPresent("HeadDepartment");
                // agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Verify team not present on page.");
                agents_EmployeesHelper.IsElementNotPresent("HeadTeam");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Redirect at leads page.");
                VisitOffice("leads");
                agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Verify page title as leads.");
                VerifyTitle("Leads");

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Redirect To URL");
                VisitOffice("employees");
                agents_EmployeesHelper.WaitForWorkAround(4000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Verify default position of role column.");
                agents_EmployeesHelper.IsElementPresent("HeadRole5");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Verify default position of department column.");
                agents_EmployeesHelper.IsElementPresent("HeadDepartment6");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Redirect at sales agents page.");
                VisitOffice("employees");
                agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Click on advance filter.");
                agents_EmployeesHelper.ClickElement("AdvanceFilter");
                agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Select role in displayed column.");
                agents_EmployeesHelper.SelectByText("DisplayedCols", "Role");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Move role 1 step up.");
                agents_EmployeesHelper.ClickElement("MoveUp");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Move role 1 step up.");
                agents_EmployeesHelper.ClickElement("MoveUp");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Move role 1 step up.");
                agents_EmployeesHelper.ClickElement("MoveUp");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Select department in displayed column.");
                agents_EmployeesHelper.SelectByText("DisplayedCols", "Department");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Move department 1 step down.");
                agents_EmployeesHelper.ClickElement("MoveDown");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Click on Apply button.");
                agents_EmployeesHelper.ClickElement("ApplyButton");
                agents_EmployeesHelper.WaitForWorkAround(4000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Verify changed position of role column.");
                agents_EmployeesHelper.IsElementPresent("HeadRole3");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Verify changed position of department column.");
                agents_EmployeesHelper.IsElementPresent("HeadDepartment7");
                //agents_EmployeesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyAgentEmployeeAdvanceFilerColumnOrder", "Logout from the application.");
                VisitCorp("logout");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyAgentEmployeeAdvanceFilerColumnOrder");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Tickets Advance Filer Column Order");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Tickets Advance Filer Column Order", "Bug", "Medium", "Activities page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Tickets Advance Filer Column Order");
                        TakeScreenshot("VerifyAgentEmployeeAdvanceFilerColumnOrder");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyAgentEmployeeAdvanceFilerColumnOrder.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyAgentEmployeeAdvanceFilerColumnOrder");
                        string id            = loginHelper.getIssueID("Verify Tickets Advance Filer Column Order");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyAgentEmployeeAdvanceFilerColumnOrder.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Tickets Advance Filer Column Order"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Tickets Advance Filer Column Order");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyAgentEmployeeAdvanceFilerColumnOrder");
                executionLog.WriteInExcel("Verify Tickets Advance Filer Column Order", Status, JIRA, "Meetings Management");
            }
        }
コード例 #15
0
        public void revenueAdjustmentSaleManagerEmployeeAddPercentage()
        {
            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_office");
            password = oXMLData.getData("settings/Credentials", "password");

            // Initializing the objects
            var executionLog                    = new ExecutionLog();
            var loginHelper                     = new LoginHelper(GetWebDriver());
            var agents_EmployeesHelper          = new Agents_EmployeesHelper(GetWebDriver());
            var residualIncome_MasterDataHelper = new ResidualIncome_MasterDataHelper(GetWebDriver());

            // VARIABLE
            var name       = "TestEmployee" + GetRandomNumber();
            var Adjustment = "Adjustment" + GetRandomNumber();


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

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

                executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Redirect to employee agents page.");
                VisitOffice("employees");
                agents_EmployeesHelper.WaitForWorkAround(3000);

                var loc = "//table[@id='list1']/tbody/tr[2]";
                agents_EmployeesHelper.WaitForElementPresent(loc, 10);
                if (agents_EmployeesHelper.IsElementPresent(loc))
                {
                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Click On Sale Agent");
                    agents_EmployeesHelper.ClickElement("ClikOnEmployeeAgent");
                    agents_EmployeesHelper.WaitForWorkAround(3000);

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Click On Create btn Adjmnt");
                    agents_EmployeesHelper.ClickElement("ClickOnCreatebtnAdjmnt");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Click on SaleAgent");
                    agents_EmployeesHelper.ClickElement("ClickSaleManager");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Wait for element to present.");
                    agents_EmployeesHelper.WaitForElementPresent("EnterAdjustmentName", 10);

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "EnterAdjustmentName");
                    agents_EmployeesHelper.TypeText("EnterAdjustmentName", Adjustment);

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "SelectAdjustmentFor");
                    agents_EmployeesHelper.Select("SelectAdjustmentFor", "Agent");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "SelectAdjustmentFor");
                    agents_EmployeesHelper.Select("AdjustmentType", "Transaction");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "SelectAdjustmentFor");
                    agents_EmployeesHelper.Select("SelectReportingPeriod", "00");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "SelectProcessor");
                    agents_EmployeesHelper.Select("SelectProcessor", "Any");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "SelectAdjustmentFor");
                    agents_EmployeesHelper.Select("SelectRuleType", "1");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Enter Amount");
                    agents_EmployeesHelper.TypeText("EnterAmount", "20");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "AddRemove");
                    agents_EmployeesHelper.Select("AddRemove", "Add");

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

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Verify message");
                    agents_EmployeesHelper.WaitForText("Master Adjustment Rules Created Successfully.", 10);

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Redirect at adjustment tools page.");
                    VisitOffice("rir/adjustments_tool");
                    agents_EmployeesHelper.WaitForWorkAround(3000);

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Verify page title.");
                    VerifyTitle("Adjustments Tool");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Enter adjustment to be deleted.");
                    residualIncome_MasterDataHelper.TypeText("EnterAdjustmentNameSrch", Adjustment);
                    residualIncome_MasterDataHelper.WaitForWorkAround(3000);

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Click on delete icon.");
                    residualIncome_MasterDataHelper.ClickElement("DeleteAdjtmnt");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Accept alert message.");
                    residualIncome_MasterDataHelper.AcceptAlert();

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Wait for delete success.");
                    residualIncome_MasterDataHelper.WaitForText("Ruleset deleted successfully.", 10);
                }
                else
                {
                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Click On Create Employee Btn");
                    agents_EmployeesHelper.ClickElement("Create");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Select Salutation");
                    agents_EmployeesHelper.Select("SelectSalutation", "Mr");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Enter FirstNAME");
                    agents_EmployeesHelper.TypeText("FirstNAME", "Employee Agent");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Enter LastName");
                    agents_EmployeesHelper.TypeText("LastName", "Tester");

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

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Select eAddressType");
                    agents_EmployeesHelper.Select("eAddressType", "E-Mail");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Select eAddressLebel");
                    agents_EmployeesHelper.Select("eAddressLebel", "Work");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Enter eAddressType");
                    agents_EmployeesHelper.TypeText("eAddress", "*****@*****.**");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Select SelectPhoneType");
                    agents_EmployeesHelper.Select("SelectPhoneType", "Work");
                    agents_EmployeesHelper.WaitForWorkAround(3000);

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Enter PhoneNumber");
                    agents_EmployeesHelper.TypeText("PhoneNumber", "121212121");
                    agents_EmployeesHelper.WaitForWorkAround(3000);

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Select Address Type");
                    agents_EmployeesHelper.Select("AddressType", "Office");
                    agents_EmployeesHelper.WaitForWorkAround(3000);

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Enter AddressLine1");
                    agents_EmployeesHelper.TypeText("AddressLine1", "FC 89");
                    agents_EmployeesHelper.WaitForWorkAround(3000);

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

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Click on save button.");
                    agents_EmployeesHelper.ClickElement("ClickSaveNskin");
                    agents_EmployeesHelper.WaitForWorkAround(3000);

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Wait for success message");
                    agents_EmployeesHelper.WaitForText("The employee is successfully added", 10);

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Enter agent name to search");
                    agents_EmployeesHelper.TypeText("EnterAgentName", "Employee Agent Tester");
                    agents_EmployeesHelper.WaitForWorkAround(3000);

                    agents_EmployeesHelper.Select("SelectStatusAdjtmnt", "");
                    agents_EmployeesHelper.WaitForWorkAround(3000);

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Click On Sale Agent");
                    agents_EmployeesHelper.ClickElement("ClikOnEmployeeAgent");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Click On Create btn Adjmnt");
                    agents_EmployeesHelper.ClickElement("ClickOnCreatebtnAdjmnt");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Click on SaleAgent");
                    agents_EmployeesHelper.ClickElement("ClickSaleManager");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "EnterAdjustmentName");
                    agents_EmployeesHelper.TypeText("EnterAdjustmentName", "Employee Sale Manager");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "SelectAdjustmentFor");
                    agents_EmployeesHelper.Select("SelectAdjustmentFor", "Agent");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "SelectAdjustmentFor");
                    agents_EmployeesHelper.Select("AdjustmentType", "Transaction");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "SelectAdjustmentFor");
                    agents_EmployeesHelper.Select("SelectReportingPeriod", "00");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "SelectProcessor");
                    agents_EmployeesHelper.Select("SelectProcessor", "Any");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "SelectAdjustmentFor");
                    agents_EmployeesHelper.Select("SelectRuleType", "1");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Enter Amount");
                    agents_EmployeesHelper.TypeText("EnterAmount", "20");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "AddRemove");
                    agents_EmployeesHelper.Select("AddRemove", "Add");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "ClickOnSaveBtnAdjustmnet");
                    agents_EmployeesHelper.ClickElement("ClickOnSaveBtnAdjustmnet");
                    agents_EmployeesHelper.WaitForWorkAround(3000);

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Verify Message");
                    agents_EmployeesHelper.VerifyPageText("Master Adjustment Rules Created Successfully.");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Redirect at adjustment tools page.");
                    VisitOffice("rir/adjustments_tool");
                    agents_EmployeesHelper.WaitForWorkAround(3000);

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Verify page title.");
                    VerifyTitle("Adjustments Tool");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Enter adjustment to be deleted.");
                    residualIncome_MasterDataHelper.TypeText("EnterAdjustmentNameSrch", Adjustment);
                    residualIncome_MasterDataHelper.WaitForWorkAround(3000);

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Click on delete icon.");
                    residualIncome_MasterDataHelper.ClickElement("DeleteAdjtmnt");

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Accept alert message.");
                    residualIncome_MasterDataHelper.AcceptAlert();

                    executionLog.Log("RevenueAdjustmentSaleManagerEmployeeAddPercentage", "Wait for delete success.");
                    residualIncome_MasterDataHelper.WaitForText("Ruleset deleted successfully.", 10);
                }
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("RevenueAdjustmentSaleManagerEmployeeAddPercentage");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Revenue Adjustment Sale Manager Employee Add Percentage");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Revenue Adjustment Sale Manager Employee Add Percentage", "Bug", "Medium", "Employee Agent 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 Manager Employee Add Percentage");
                        TakeScreenshot("RevenueAdjustmentSaleManagerEmployeeAddPercentage");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\RevenueAdjustmentSaleManagerEmployeeAddPercentage.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("RevenueAdjustmentSaleManagerEmployeeAddPercentage");
                        string id            = loginHelper.getIssueID("Revenue Adjustment Sale Manager Employee Add Percentage");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\RevenueAdjustmentSaleManagerEmployeeAddPercentage.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Revenue Adjustment Sale Manager Employee Add Percentage"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Revenue Adjustment Sale Manager Employee Add Percentage");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("RevenueAdjustmentSaleManagerEmployeeAddPercentage");
                executionLog.WriteInExcel("Revenue Adjustment Sale Manager Employee Add Percentage", Status, JIRA, "Agent Portal");
            }
        }