public void verifyPartnerAgentAddressLine1and2()
        {
            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_PartnerAgentHelper = new Agents_PartnerAgentsHelper(GetWebDriver());

            // Variable
            var    fname     = "Partner" + RandomNumber(111, 99999);
            var    lname     = "Agent" + RandomNumber(111, 99999);
            var    username1 = "testagent" + RandomNumber(100, 999);
            String JIRA      = "";
            String Status    = "Pass";

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

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

                executionLog.Log("VerifyPartnerAgentAddressLine1and2", "Redirect to the URL");
                VisitOffice("partners/agents");
                agent_PartnerAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAddressLine1and2", "Click on Create button");
                agent_PartnerAgentHelper.ClickElement("Create");
                agent_PartnerAgentHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyPartnerAgentAddressLine1and2", "Enter First Name");
                agent_PartnerAgentHelper.TypeText("FirstName", fname);

                executionLog.Log("VerifyPartnerAgentAddressLine1and2", "Enter Last Name");
                agent_PartnerAgentHelper.TypeText("LastName", lname);

                executionLog.Log("VerifyPartnerAgentAddressLine1and2", "Select eAddress type");
                agent_PartnerAgentHelper.Select("eAddressType", "E-Mail");

                executionLog.Log("VerifyPartnerAgentAddressLine1and2", "Enter eAddress");
                agent_PartnerAgentHelper.TypeText("eAddress", "*****@*****.**");

                executionLog.Log("VerifyPartnerAgentAddressLine1and2", "Select Address type");
                agent_PartnerAgentHelper.Select("AddressType", "Office");

                executionLog.Log("VerifyPartnerAgentAddressLine1and2", "Enter Address Line1");
                agent_PartnerAgentHelper.TypeText("AddressLine1", "Add1");

                executionLog.Log("VerifyPartnerAgentAddressLine1and2", "Enter Address Line2");
                agent_PartnerAgentHelper.TypeText("AddressLine2", "Add2");

                executionLog.Log("VerifyPartnerAgentAddressLine1and2", "Enter Postal Code");
                agent_PartnerAgentHelper.TypeText("PostalCode", "20001");
                agent_PartnerAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAddressLine1and2", "Enter Username");
                agent_PartnerAgentHelper.TypeText("UserName", username1);

                executionLog.Log("VerifyPartnerAgentAddressLine1and2", "Click Partner User Avatar check box");
                agent_PartnerAgentHelper.ClickElement("ParnterUserAvatar");

                executionLog.Log("VerifyPartnerAgentAddressLine1and2", "Click Save button");
                agent_PartnerAgentHelper.ClickElement("ClickSave");
                agent_PartnerAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAddressLine1and2", "Redirect to All Partner Agents page");
                VisitOffice("partners/agents");
                agent_PartnerAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAddressLine1and2", "Click Advanced Filter button");
                agent_PartnerAgentHelper.ClickElement("AdvanceFilter");
                agent_PartnerAgentHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyPartnerAgentAddressLine1and2", "Select Address Line1 from Available Columns");
                agent_PartnerAgentHelper.Select("AvailableCols", "address_line_1");

                executionLog.Log("VerifyPartnerAgentAddressLine1and2", "Move Address Line1 to Display Columns");
                agent_PartnerAgentHelper.ClickElement("AddCols");

                executionLog.Log("VerifyPartnerAgentAddressLine1and2", "Select Address Line2 from Available Columns");
                agent_PartnerAgentHelper.Select("AvailableCols", "address_line_2");

                executionLog.Log("VerifyPartnerAgentAddressLine1and2", "Move Address Line2 to Display Columns");
                agent_PartnerAgentHelper.ClickElement("AddCols");

                executionLog.Log("VerifyPartnerAgentAddressLine1and2", "Move Address Line2 to Display Columns");
                agent_PartnerAgentHelper.ClickElement("ApplyButton");
                agent_PartnerAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAddressLine1and2", "Search Agent");
                agent_PartnerAgentHelper.TypeText("SearchAgent", fname + " " + lname);

                executionLog.Log("VerifyPartnerAgentAddressLine1and2", "Verify Address Line 1");
                agent_PartnerAgentHelper.VerifyText("SixthRowHead", "Address1");
                Console.WriteLine("Address Line1 is present");

                executionLog.Log("VerifyPartnerAgentAddressLine1and2", "Verify Address Line 2");
                agent_PartnerAgentHelper.VerifyText("SeventhRowHead", "Address2");
                Console.WriteLine("Address Line2 is present");
            }
            catch (Exception e)
            {
            }
        }
Ejemplo n.º 2
0
        public void verifyBirthdayOfPartnerAgentOnUsersPage()
        {
            string[] username = null;
            string[] password = null;

            XMLParse oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog             = new ExecutionLog();
            var loginHelper              = new LoginHelper(GetWebDriver());
            var agent_PartnerAgentHelper = new Agents_PartnerAgentsHelper(GetWebDriver());
            var office_UserHelper        = new Office_UserHelper(GetWebDriver());

            // Variable
            var    name   = "TestAgent" + GetRandomNumber();
            var    user   = "******" + RandomNumber(111, 99999);
            String JIRA   = "";
            String Status = "Pass";


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

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

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Go to Partner Agent page.");
                VisitOffice("partners/agents");

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Verify page title.");
                VerifyTitle("Partner Agents");

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Click On Create");
                agent_PartnerAgentHelper.ClickElement("Create");
                agent_PartnerAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Select Salutation");
                agent_PartnerAgentHelper.Select("SelectSalutation", "Mr");

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Enter FirstNAME");
                agent_PartnerAgentHelper.TypeText("FirstName", name);

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Enter LastName");
                agent_PartnerAgentHelper.TypeText("LastName", "Tester");

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Enter DBAName");
                agent_PartnerAgentHelper.TypeText("DBAName", "Test DBA");

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Enter LinkedInUrl");
                agent_PartnerAgentHelper.TypeText("LinkedInUrl", "LinkedIn.con");

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Enter FaceBook Url");
                agent_PartnerAgentHelper.TypeText("FaceBookUrl", "Facebook.com");

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Enter TwitterURL");
                agent_PartnerAgentHelper.TypeText("TwitterURL", "Twitter.com");

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Select language.");
                agent_PartnerAgentHelper.Select("SelectLanguage", "English");

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Select eAddressType");
                agent_PartnerAgentHelper.Select("eAddressType", "E-Mail");

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Select eAddressLebel");
                agent_PartnerAgentHelper.Select("eAddressLebel", "Work");

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Enter eAddressType");
                var Email = "P.Agent" + GetRandomNumber() + "@yopmail.com";
                agent_PartnerAgentHelper.TypeText("eAddress", Email);

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Select SelectPhoneType");
                agent_PartnerAgentHelper.Select("SelectPhoneType", "Work");

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Enter PhoneNumber");
                agent_PartnerAgentHelper.TypeText("PhoneNumber", "1212121212");

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Select Address Type  ");
                agent_PartnerAgentHelper.Select("AddressType", "Office");

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Enter AddressLine1");
                agent_PartnerAgentHelper.TypeText("AddressLine1", "FC 89");

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Enter Postal code");
                agent_PartnerAgentHelper.TypeText("PostalCode", "60601");
                agent_PartnerAgentHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Select User Account Check Box");
                agent_PartnerAgentHelper.ClickJava("UserAccChkBox");

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Enter Username");
                agent_PartnerAgentHelper.TypeText("UserName", user);

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Select PartnerUser Avatar Check Box");
                agent_PartnerAgentHelper.ClickElement("ParnterUserAvatar");

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Click Save Agent btn");
                agent_PartnerAgentHelper.ClickElement("ClickSave");
                agent_PartnerAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Go to All Users page");
                VisitOffice("users");
                office_UserHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Select User Type >> Partner Agent");
                office_UserHelper.SelectByText("SelectUserType", "Partner Agent");
                office_UserHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Enter partner user name");
                office_UserHelper.TypeText("SearchUser", name);
                office_UserHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Open partner agent");
                office_UserHelper.ClickElement("User1");
                office_UserHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyBirthdayOfPartnerAgentOnUsersPage", "Verify birthday is not as 01-Jan-1970");
                var text = office_UserHelper.GetText("//*[@id='page-wrapper']/div[5]/div/div[1]/div[1]/div[2]/div/div[2]/div[2]/div[2]");
                Assert.IsFalse(text.Contains("01-Jan-1970"));
                office_UserHelper.WaitForWorkAround(3000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyBirthdayOfPartnerAgentOnUsersPage");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Birthday Of Partner Agent On Users Page");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Birthday Of Partner Agent On Users Page", "Bug", "Medium", "Partner Agents", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Birthday Of Partner Agent On Users Page");
                        TakeScreenshot("VerifyBirthdayOfPartnerAgentOnUsersPage");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyBirthdayOfPartnerAgentOnUsersPage.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyBirthdayOfPartnerAgentOnUsersPage");
                        string id            = loginHelper.getIssueID("Verify Birthday Of Partner Agent On Users Page");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyBirthdayOfPartnerAgentOnUsersPage.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Birthday Of Partner Agent On Users Page"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Birthday Of Partner Agent On Users Page");
                //  executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyBirthdayOfPartnerAgentOnUsersPage");
                executionLog.WriteInExcel("Verify Birthday Of Partner Agent On Users Page", Status, JIRA, "Agents Portal");
            }
        }
Ejemplo n.º 3
0
        public void agentCreateField()
        {
            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_PartnerAgentsHelper = new Agents_PartnerAgentsHelper(GetWebDriver());
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("AgentCreateField", "navigate to the Create partner agent page.");
                VisitOffice("partners/agent/create");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("AgentCreateField", "verify title");
                VerifyTitle("Create a Partner Agent");

                executionLog.Log("AgentCreateField", "Click on Create an user checkbox");
                agents_PartnerAgentsHelper.scrollToElement("CreateCheck");
                agents_PartnerAgentsHelper.WaitForWorkAround(1000);

                executionLog.Log("AgentCreateField", "Click on Avatar check box. ");
                agents_PartnerAgentsHelper.ClickElement("CreateCheck");

                executionLog.Log("AgentCreateField", "Verify fields displayed");
                agents_PartnerAgentsHelper.verifyElementPresent("VerifyField");
                agents_PartnerAgentsHelper.WaitForWorkAround(4000);

                executionLog.Log("AgentCreateField", "Verify field is displayed");
                agents_PartnerAgentsHelper.verifyElementPresent("VerifyField");
            }


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

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

            // Variable
            var Sales   = "" + RandomNumber(1, 999);
            var Revenue = "" + RandomNumber(1, 99);

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

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

            executionLog.Log("VerifyValidationForBlankAgentCode", "Redirect to the URL");
            VisitOffice("partners/agents");
            agents_PartnerAgentHelper.WaitForWorkAround(3000);
            Console.WriteLine("Redirected to Partner Agents");

            executionLog.Log("VerifyValidationForBlankAgentCode", "Click on first agent");
            agents_PartnerAgentHelper.ClickElement("OpenAgent");
            agents_PartnerAgentHelper.WaitForWorkAround(6000);
            Console.WriteLine("Waited for given time span");

            executionLog.Log("VerifyValidationForBlankAgentCode", "Click Add a new Agent Code button");
            agents_PartnerAgentHelper.ClickElement("AddNewAgentCode");
            agents_PartnerAgentHelper.WaitForWorkAround(3000);
            Console.WriteLine("Create Agent Code Popup opened");

            executionLog.Log("VerifyValidationForBlankAgentCode", "Enter Sales Code");
            agents_PartnerAgentHelper.TypeText("SalesCode", Sales);

            executionLog.Log("VerifyValidationForBlankAgentCode", "Enter Revenue Share");
            agents_PartnerAgentHelper.TypeText("RevenueShare", Revenue);

            executionLog.Log("VerifyValidationForBlankAgentCode", "Click Save button");
            agents_PartnerAgentHelper.ClickElement("SaveBtn");
            agents_PartnerAgentHelper.WaitForWorkAround(4000);
            Console.WriteLine("Agent Code Created");

            executionLog.Log("VerifyValidationForBlankAgentCode", "Click Edit button");
            agents_PartnerAgentHelper.ClickElement("EditAgentCode1");

            executionLog.Log("VerifyValidationForBlankAgentCode", "Clear Agent Code");
            agents_PartnerAgentHelper.ClearText("AgentCode");
            Console.WriteLine("Cleared Agent Code");

            executionLog.Log("VerifyValidationForBlankAgentCode", "Clear Revenue Share");
            agents_PartnerAgentHelper.ClearText("RevenueShareEdit");
            Console.WriteLine("Cleared Revenue Share");

            executionLog.Log("VerifyValidationForBlankAgentCode", "Click Save button");
            agents_PartnerAgentHelper.ClickElement("SaveAgentCode");

            executionLog.Log("VerifyValidationForBlankAgentCode", "Click Save button");
            agents_PartnerAgentHelper.VerifyTextAvailable("Agent Code: Field is required");
            Console.WriteLine("Validation is appearing for blank Agent Code and Revenue Share");


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

            //}
        }
        public void partnerAgentModifiedIssue()
        {
            string[] username = null;
            string[] password = null;

            XMLParse oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog             = new ExecutionLog();
            var loginHelper              = new LoginHelper(GetWebDriver());
            var agent_PartnerAgentHelper = new Agents_PartnerAgentsHelper(GetWebDriver());

            // Variable
            var    name   = "TestAgent" + RandomNumber(1, 99);
            String JIRA   = "";
            String Status = "Pass";


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

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

                executionLog.Log("PartnerAgentModifiedIssue", "Go to Partner Agent page.");
                VisitOffice("partners/agents");

                executionLog.Log("PartnerAgentModifiedIssue", "Verify page title.");
                VerifyTitle("Partner Agents");

                executionLog.Log("PartnerAgentModifiedIssue", "Click On Create");
                agent_PartnerAgentHelper.ClickElement("Create");
                agent_PartnerAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("PartnerAgentModifiedIssue", "Select Salutation");
                agent_PartnerAgentHelper.Select("SelectSalutation", "Mr");

                executionLog.Log("PartnerAgentModifiedIssue", "Enter FirstNAME");
                agent_PartnerAgentHelper.TypeText("FirstName", "Test Agent");

                executionLog.Log("PartnerAgentModifiedIssue", "Enter LastName");
                agent_PartnerAgentHelper.TypeText("LastName", "Tester");

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

                executionLog.Log("PartnerAgentModifiedIssue", "Enter DBAName");
                agent_PartnerAgentHelper.TypeText("DBAName", "Test DBA");

                executionLog.Log("PartnerAgentModifiedIssue", "Enter LinkedInUrl");
                agent_PartnerAgentHelper.TypeText("LinkedInUrl", "LinkedIn.con");

                executionLog.Log("PartnerAgentModifiedIssue", "Enter FaceBook Url");
                agent_PartnerAgentHelper.TypeText("FaceBookUrl", "Facebook.com");

                executionLog.Log("PartnerAgentModifiedIssue", "Enter TwitterURL");
                agent_PartnerAgentHelper.TypeText("TwitterURL", "Twitter.com");

                executionLog.Log("PartnerAgentModifiedIssue", "Select language.");
                agent_PartnerAgentHelper.Select("SelectLanguage", "English");

                executionLog.Log("PartnerAgentModifiedIssue", "Select eAddressType");
                agent_PartnerAgentHelper.Select("eAddressType", "E-Mail");

                executionLog.Log("PartnerAgentModifiedIssue", "Select eAddressLebel");
                agent_PartnerAgentHelper.Select("eAddressLebel", "Work");

                executionLog.Log("PartnerAgentModifiedIssue", "Enter eAddressType");
                var Email = "P.Agent" + GetRandomNumber() + "@yopmail.com";
                agent_PartnerAgentHelper.TypeText("eAddress", Email);

                executionLog.Log("PartnerAgentModifiedIssue", "Select SelectPhoneType");
                agent_PartnerAgentHelper.Select("SelectPhoneType", "Work");

                executionLog.Log("PartnerAgentModifiedIssue", "Enter PhoneNumber");
                agent_PartnerAgentHelper.TypeText("PhoneNumber", "1212121212");

                executionLog.Log("PartnerAgentModifiedIssue", "Click Save Agent btn");
                agent_PartnerAgentHelper.ClickElement("ClickSave");

                executionLog.Log("PartnerAgentModifiedIssue", "Verify success message. ");
                agent_PartnerAgentHelper.WaitForText("Partner Agent Created Successfully.", 30);

                executionLog.Log("PartnerAgentModifiedIssue", "Verify modified by name for agent");
                agent_PartnerAgentHelper.VerifyText("ModiCredits", "Howard Tang");
                agent_PartnerAgentHelper.WaitForWorkAround(2000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("PartnerAgentModifiedIssue");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Partner Agent Modified Issue");
                if (!result)
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Create Partner Agent And Use rAccount", "Bug", "Medium", "Partner Agents", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Partner Agent Modified Issue");
                        TakeScreenshot("PartnerAgentModifiedIssue");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\PartnerAgentModifiedIssue.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("PartnerAgentModifiedIssue");
                        string id            = loginHelper.getIssueID("Partner Agent Modified Issue");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\PartnerAgentModifiedIssue.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Partner Agent Modified Issue"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Partner Agent Modified Issue");
                executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("PartnerAgentModifiedIssue");
                executionLog.WriteInExcel("Partner Agent Modified Issue", Status, JIRA, "Agents Portal");
            }
        }
Ejemplo n.º 6
0
        public void partnerAgentWithUserNewSkin()
        {
            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_PartnerAgentsHelper = new Agents_PartnerAgentsHelper(GetWebDriver());

            // Variable
            var    name   = "TestAgent" + GetRandomNumber();
            var    Email  = "P.Agent" + RandomNumber(1, 999) + "@yopmail.com";
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("PartnerAgentWithUserNewSkin", "Redirect at create agents page.");
                VisitOffice("partners/agent/create");

                executionLog.Log("PartnerAgentWithUserNewSkin", "Verify title");
                VerifyTitle("Create a Partner Agent");

                executionLog.Log("PartnerAgentWithUserNewSkin", "Select Salutation");
                agents_PartnerAgentsHelper.Select("SelectSalutation", "Mr");

                executionLog.Log("PartnerAgentWithUserNewSkin", "Enter FirstNAME");
                agents_PartnerAgentsHelper.TypeText("FirstName", "Test Agent");

                executionLog.Log("PartnerAgentWithUserNewSkin", "Enter LastName");
                agents_PartnerAgentsHelper.TypeText("LastName", "Tester");

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

                executionLog.Log("PartnerAgentWithUserNewSkin", "Enter DBAName");
                agents_PartnerAgentsHelper.TypeText("DBAName", "Test DBA");

                executionLog.Log("PartnerAgentWithUserNewSkin", "Enter LinkedInUrl");
                agents_PartnerAgentsHelper.TypeText("LinkedInUrl", "LinkedIn.con");

                executionLog.Log("PartnerAgentWithUserNewSkin", "Select eAddressType");
                agents_PartnerAgentsHelper.Select("eAddressType", "E-Mail");

                executionLog.Log("PartnerAgentWithUserNewSkin", "Select eAddressLebel");
                agents_PartnerAgentsHelper.Select("eAddressLebel", "Work");

                executionLog.Log("PartnerAgentWithUserNewSkin", "Enter eAddressType");
                agents_PartnerAgentsHelper.TypeText("eAddress", Email);

                executionLog.Log("PartnerAgentWithUserNewSkin", "Select SelectPhoneType");
                agents_PartnerAgentsHelper.Select("SelectPhoneType", "Work");

                executionLog.Log("PartnerAgentWithUserNewSkin", "Enter PhoneNumber");
                agents_PartnerAgentsHelper.TypeText("PhoneNumber", "1212121212");

                executionLog.Log("PartnerAgentWithUserNewSkin", "Select Address Type  ");
                agents_PartnerAgentsHelper.Select("AddressType", "Office");

                executionLog.Log("PartnerAgentWithUserNewSkin", "Enter AddressLine1");
                agents_PartnerAgentsHelper.TypeText("AddressLine1", "FC 89");

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

                executionLog.Log("PartnerAgentWithUserNewSkin", "Click On create user Checkbox");
                agents_PartnerAgentsHelper.ClickViaJavaScript("//input[@id='UserCreateUser' and @type='checkbox']");
                agents_PartnerAgentsHelper.WaitForWorkAround(2000);

                executionLog.Log("PartnerAgentWithUserNewSkin", "Enter UserName");
                agents_PartnerAgentsHelper.TypeText("UserName", name);

                executionLog.Log("PartnerAgentWithUserNewSkin", "Click On Avatar");
                agents_PartnerAgentsHelper.ClickElement("ClickOnAvatar");

                executionLog.Log("PartnerAgentWithUserNewSkin", "CLICK Save AGENT btn");
                agents_PartnerAgentsHelper.ClickElement("SaveAgent");

                executionLog.Log("PartnerAgentWithUserNewSkin", "Verify message");
                agents_PartnerAgentsHelper.WaitForText("Partner Agent Created Successfully", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("PartnerAgentWithUserNewSkin");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Partner Agent With User New Skin");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Partner Agent With User New Skin", "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("Partner Agent With User New Skin");
                        TakeScreenshot("PartnerAgentWithUserNewSkin");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\PartnerAgentWithUserNewSkin.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("PartnerAgentWithUserNewSkin");
                        string id            = loginHelper.getIssueID("Partner Agent With User New Skin");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\PartnerAgentWithUserNewSkin.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Partner Agent With User New Skin"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Partner Agent With User New Skin");
                //     executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("PartnerAgentWithUserNewSkin");
                executionLog.WriteInExcel("Partner Agent With User New Skin", Status, JIRA, "Partner Portal");
            }
        }
Ejemplo n.º 7
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;
                }
            }
        }
Ejemplo n.º 8
0
        public void viewRevenueAdjustmentPartnerAgentAddFlatAmount()
        {
            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");
            String JIRA   = "";
            String Status = "Pass";

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

            // Variable random
            var name       = "PAgent" + RandomNumber(1, 999);
            var Email      = "Part" + RandomNumber(1, 999) + "@yopmail.com";
            var Adjustment = "Adjustment" + GetRandomNumber();


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

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

                executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Redirect at Partner Agent page.");
                VisitOffice("partners/agents");
                agents_PartnerAgentsHelper.WaitForWorkAround(5000);

                executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Select status of agent..");
                agents_PartnerAgentsHelper.Select("SelectStatusAdjtmnt", "");

                executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Search the 'Partner Agent Tester");
                agents_PartnerAgentsHelper.TypeText("SearchAgent", "Partner Agent Tester");
                agents_PartnerAgentsHelper.WaitForWorkAround(5000);

                var loc = "//table[@id='list1']/tbody/tr[2]/td[@title='Partner Agent Tester']";
                agents_PartnerAgentsHelper.WaitForElementPresent(loc, 10);
                if (agents_PartnerAgentsHelper.IsElementPresent(loc))
                {
                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Click On Partner Agent");
                    agents_PartnerAgentsHelper.ClickElement("ClikOnPartnerAgent");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Click On Create btn Adjmnt");
                    agents_PartnerAgentsHelper.ClickElement("ClickOnCreatebtnAdjmnt");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Enter Adjustment Name");
                    agents_PartnerAgentsHelper.TypeText("EnterAdjustmentName", Adjustment);

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Select Adjustment For");
                    agents_PartnerAgentsHelper.Select("SelectAdjustmentFor", "Agent");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "select type");
                    agents_PartnerAgentsHelper.Select("AdjustmentType", "Transaction");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "select period");
                    agents_PartnerAgentsHelper.Select("SelectReportingPeriod", "00");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Select Processor");
                    agents_PartnerAgentsHelper.Select("SelectProcessor", "Any");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "select rule");
                    agents_PartnerAgentsHelper.Select("SelectRuleType", "1");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Enter Amount");
                    agents_PartnerAgentsHelper.TypeText("EnterAmount", "20");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Select AddRemove");
                    agents_PartnerAgentsHelper.Select("AddRemove", "Add");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "ClickOnSaveBtnAdjustmnet");
                    agents_PartnerAgentsHelper.ClickElement("ClickOnSaveBtnAdjustmnet");
                    agents_PartnerAgentsHelper.WaitForWorkAround(3000);

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

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Redirect at adjustment tools page.");
                    VisitOffice("rir/adjustments_tool");

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

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

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

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

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

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Select Salutation");
                    agents_PartnerAgentsHelper.Select("SelectSalutation", "Mr");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Enter FirstNAME");
                    agents_PartnerAgentsHelper.TypeText("FirstName", "Partner Agent");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Enter LastName");
                    agents_PartnerAgentsHelper.TypeText("LastName", "Tester");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Enter Date Of Birth");
                    agents_PartnerAgentsHelper.TypeText("BirthDay", "12/16/1991");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Enter DBAName");
                    agents_PartnerAgentsHelper.TypeText("DBAName", "Test DBA");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Enter LinkedInUrl");
                    agents_PartnerAgentsHelper.TypeText("LinkedInUrl", "LinkedIn.con");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Enter FaceBook Url");
                    agents_PartnerAgentsHelper.TypeText("FaceBookUrl", "Facebook.com");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Enter TwitterURL");
                    agents_PartnerAgentsHelper.TypeText("TwitterURL", "Twitter.com");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Select DBAName");
                    agents_PartnerAgentsHelper.Select("SelectLanguage", "English");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Select eAddressType");
                    agents_PartnerAgentsHelper.Select("eAddressType", "E-Mail");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Select eAddressLebel");
                    agents_PartnerAgentsHelper.Select("eAddressLebel", "Work");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Enter eAddressType");
                    agents_PartnerAgentsHelper.TypeText("eAddress", Email);

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Enter SelectPhoneType");
                    agents_PartnerAgentsHelper.Select("SelectPhoneType", "Work");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Enter PhoneNumber");
                    agents_PartnerAgentsHelper.TypeText("PhoneNumber", "1212121212");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Enter Address Type    ");
                    agents_PartnerAgentsHelper.Select("AddressType", "Office");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Enter AddressLine1");
                    agents_PartnerAgentsHelper.TypeText("AddressLine1", "FC 89");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Enter Postal Code");
                    agents_PartnerAgentsHelper.TypeText("PostalCode", "60601");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Click On Checkbox");
                    agents_PartnerAgentsHelper.ClickElement("ClickONcheckBox");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Enter UserName");
                    agents_PartnerAgentsHelper.TypeText("UserName", name);

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Click On Avatar");
                    agents_PartnerAgentsHelper.ClickElement("ClickOnAvatar");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "CLICK Save AGENT btn");
                    agents_PartnerAgentsHelper.ClickElement("SaveAgent");
                    agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Click On Create adjustment button");
                    agents_PartnerAgentsHelper.scrollToElement("ClickOnCreatebtnAdjmnt");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Click On Create btn Adjmnt");
                    agents_PartnerAgentsHelper.ClickElement("ClickOnCreatebtnAdjmnt");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Enter Adjustment Name");
                    agents_PartnerAgentsHelper.TypeText("EnterAdjustmentName", Adjustment);

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Select Adjustment For");
                    agents_PartnerAgentsHelper.Select("SelectAdjustmentFor", "Agent");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "select type");
                    agents_PartnerAgentsHelper.Select("AdjustmentType", "Transaction");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "select period");
                    agents_PartnerAgentsHelper.Select("SelectReportingPeriod", "00");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Select Processor");
                    agents_PartnerAgentsHelper.Select("SelectProcessor", "Any");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Select Adjustment For");
                    agents_PartnerAgentsHelper.Select("SelectRuleType", "0");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Enter Amount");
                    agents_PartnerAgentsHelper.TypeText("EnterAmount", "200");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Select AddRemove");
                    agents_PartnerAgentsHelper.Select("AddRemove", "Add");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Click On Save Btn");
                    agents_PartnerAgentsHelper.ClickElement("SaveAdjustment");
                    agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Verify message");
                    agents_PartnerAgentsHelper.VerifyPageText("Master Adjustment Rules Created Successfully.");

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "Redirect at adjustment tools page.");
                    VisitOffice("rir/adjustments_tool");

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

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

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

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

                    executionLog.Log("ViewRevenueAdjustmentPartnerAgentAddFlatAmount", "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("ViewRevenueAdjustmentPartnerAgentAddFlatAmount");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("View Revenue Adjustment Partner Agent Add Flat Amount");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("View Revenue Adjustment Partner Agent Add Flat Amount", "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("View Revenue Adjustment Partner Agent Add Flat Amount");
                        TakeScreenshot("ViewRevenueAdjustmentPartnerAgentAddFlatAmount");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\ViewRevenueAdjustmentPartnerAgentAddFlatAmount.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("ViewRevenueAdjustmentPartnerAgentAddFlatAmount");
                        string id            = loginHelper.getIssueID("View Revenue Adjustment Partner Agent Add Flat Amount");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\ViewRevenueAdjustmentPartnerAgentAddFlatAmount.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("View Revenue Adjustment Partner Agent Add Flat Amount"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("View Revenue Adjustment Partner Agent Add Flat Amount");
                //    executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("ViewRevenueAdjustmentPartnerAgentAddFlatAmount");
                executionLog.WriteInExcel("View Revenue Adjustment Partner Agent Add Flat Amount", Status, JIRA, "Agent Portal");
            }
        }
        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 partnerAgenteAddressLabelIssue()
        {
            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_PartnerAgentHelper = new Agents_PartnerAgentsHelper(GetWebDriver());

            // Variable
            var    name      = "TestAgent" + GetRandomNumber();
            var    username1 = "testuser" + RandomNumber(111, 5555);
            String JIRA      = "";
            String Status    = "Pass";

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

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

                executionLog.Log("PartnerAgenteAddressLabelIssue", "Redirect to the URL");
                VisitOffice("partners/agents");
                agent_PartnerAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("PartnerAgenteAddressLabelIssue", "Click on any agent.");
                agent_PartnerAgentHelper.ClickElement("OpenAgent");
                agent_PartnerAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("PartnerAgenteAddressLabelIssue", "Click Edit button");
                agent_PartnerAgentHelper.ClickElement("EditAgentDetails");
                agent_PartnerAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("PartnerAgenteAddressLabelIssue", "Select eAddress type");
                agent_PartnerAgentHelper.SelectByText("eAddressType", "Web Links");

                executionLog.Log("PartnerAgenteAddressLabelIssue", "Enter eAddress");
                agent_PartnerAgentHelper.TypeText("eAddress", "*****@*****.**");

                executionLog.Log("PartnerAgentBirthDateVerifySave", "Enter Username");
                agent_PartnerAgentHelper.TypeText("UserName", username1);

                executionLog.Log("PartnerAgentBirthDateVerifySave", "Select Avatar Check Box");
                agent_PartnerAgentHelper.ClickElement("ParnterUserAvatar");

                executionLog.Log("PartnerAgenteAddressLabelIssue", "Click Save button");
                agent_PartnerAgentHelper.ClickElement("ClickSave");
                agent_PartnerAgentHelper.WaitForWorkAround(4000);

                executionLog.Log("PartnerAgenteAddressLabelIssue", "Click Edit button Again");
                agent_PartnerAgentHelper.ClickElement("EditAgentDetails");
                agent_PartnerAgentHelper.WaitForWorkAround(4000);

                executionLog.Log("PartnerAgenteAddressLabelIssue", "Verify eAddress Label as weblink.");
                agent_PartnerAgentHelper.VerifyText("eAddressLebel", "Web Link");
                agent_PartnerAgentHelper.WaitForWorkAround(4000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("PartnerAgenteAddressLabelIssue");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Partner Agent eAddress Label Issue");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Partner Agent eAddress Label Issue", "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("Partner Agent eAddress Label Issue");
                        TakeScreenshot("PartnerAgenteAddressLabelIssue");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\PartnerAgenteAddressLabelIssue.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("PartnerAgenteAddressLabelIssue");
                        string id            = loginHelper.getIssueID("Partner Agent eAddress Label Issue");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\PartnerAgenteAddressLabelIssue.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Partner Agent eAddress Label Issue"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Partner Agent eAddress Label Issue");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("PartnerAgenteAddressLabelIssue");
                executionLog.WriteInExcel("Partner Agent eAddress Label Issue", Status, JIRA, "Agents Portal");
            }
        }
        public void verifyPrimaryRadioBtnForDifferentEAddressTypePartnerAgent()
        {
            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_PartnerAgentsHelper = new Agents_PartnerAgentsHelper(GetWebDriver());

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

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

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

                executionLog.Log("VerifyPrimaryRadioBtnForDifferentEAddressTypePartnerAgent", "Redirect To Create Partner Agent page");
                VisitOffice("partners/agent/create");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

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

                executionLog.Log("VerifyPrimaryRadioBtnForDifferentEAddressTypePartnerAgent", "Verify Primary radio button present");
                agents_PartnerAgentsHelper.IsElementPresent("//input[@name='data[PartnerAgentElectronicAddress][0][primary]']");

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

                executionLog.Log("VerifyPrimaryRadioBtnForDifferentEAddressTypePartnerAgent", "Verify Primary radio button present");
                agents_PartnerAgentsHelper.IsElementPresent("//input[@name='data[PartnerAgentElectronicAddress][0][primary]']");

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

                executionLog.Log("VerifyPrimaryRadioBtnForDifferentEAddressTypePartnerAgent", "Verify Primary radio button present");
                agents_PartnerAgentsHelper.IsElementPresent("//input[@name='data[PartnerAgentElectronicAddress][0][primary]']");

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

                executionLog.Log("VerifyPrimaryRadioBtnForDifferentEAddressTypePartnerAgent", "Verify Primary radio button present");
                agents_PartnerAgentsHelper.IsElementPresent("//input[@name='data[PartnerAgentElectronicAddress][0][primary]']");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyPrimaryRadioBtnForDifferentEAddressTypePartnerAgent");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Primary Radio Btn For Different EAddress Type Partner Agent");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Primary Radio Btn For Different EAddress Type Partner Agent", "Bug", "Medium", "Partner Agent page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Primary Radio Btn For Different EAddress Type Partner Agent");
                        TakeScreenshot("VerifyPrimaryRadioBtnForDifferentEAddressTypePartnerAgent");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyPrimaryRadioBtnForDifferentEAddressTypePartnerAgent.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyPrimaryRadioBtnForDifferentEAddressTypePartnerAgent");
                        string id            = loginHelper.getIssueID("Verify Primary Radio Btn For Different EAddress Type Partner Agent");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyPrimaryRadioBtnForDifferentEAddressTypePartnerAgent.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Primary Radio Btn For Different EAddress Type Partner Agent"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Primary Radio Btn For Different EAddress Type Partner Agent");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyPrimaryRadioBtnForDifferentEAddressTypePartnerAgent");
                executionLog.WriteInExcel("Verify Primary Radio Btn For Different EAddress Type Partner Agent", Status, JIRA, "Office Partner Agent");
            }
        }
        public void verifyPartnerAgentAdvanceFilterColumnOrder()
        {
            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_PartnerAgentsHelper = new Agents_PartnerAgentsHelper(GetWebDriver());

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

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

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Verify Page title as dash board");
                VerifyTitle("Dashboard");
                Console.WriteLine("Redirected at Dashboard screen.");

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Redirect To partner agents page.");
                VisitOffice("partners/agents");
                agents_PartnerAgentsHelper.WaitForWorkAround(5000);

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Verify page title as partner agents");
                VerifyTitle("Partner Agents");

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

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Verify E-Mail column is visible on the page.");
                agents_PartnerAgentsHelper.IsElementPresent("HeadEmail");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Verify Phone column is visible on the page.");
                agents_PartnerAgentsHelper.IsElementPresent("HeadPhone");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Verify Modified column is visible on the page.");
                agents_PartnerAgentsHelper.IsElementPresent("HeadModified");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Click on advance filter button.");
                agents_PartnerAgentsHelper.ClickElement("AdvanceFilter");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Select status in displayed columns.");
                agents_PartnerAgentsHelper.SelectByText("DisplayedCols", "Status");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Click arrow to move column to avail cols.");
                agents_PartnerAgentsHelper.ClickElement("RemoveCols");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Select E-Mail in displayed columns.");
                agents_PartnerAgentsHelper.SelectByText("DisplayedCols", "E-Mail");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Click arrow to move column to avail cols");
                agents_PartnerAgentsHelper.ClickElement("RemoveCols");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Select Phone in displayed columns.");
                agents_PartnerAgentsHelper.SelectByText("DisplayedCols", "Phone");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Click arrow to move column to avail cols");
                agents_PartnerAgentsHelper.ClickElement("RemoveCols");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Select Modified in displayed columns.");
                agents_PartnerAgentsHelper.SelectByText("DisplayedCols", "Modified");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Click arrow to move column to avail cols");
                agents_PartnerAgentsHelper.ClickElement("RemoveCols");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

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

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Verify status column not present on page.");
                agents_PartnerAgentsHelper.IsElementNotPresent("HeadStatus");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Verify E-Mail column not present on page.");
                agents_PartnerAgentsHelper.IsElementNotPresent("HeadEmail");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Verify Phone column not present on page.");
                agents_PartnerAgentsHelper.IsElementNotPresent("HeadPhone");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Verify Modified column not present on page.");
                agents_PartnerAgentsHelper.IsElementNotPresent("HeadModified");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Redirect at partner agents page.");
                VisitOffice("partners/agents");
                agents_PartnerAgentsHelper.WaitForWorkAround(5000);

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Verify page title as partner agents.");
                VerifyTitle("Partner Agents");

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Verify default position of E-Mail column.");
                agents_PartnerAgentsHelper.IsElementPresent("HeadEmail3");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Verify default position of Phone column.");
                agents_PartnerAgentsHelper.IsElementPresent("HeadPhone4");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Redirect at partner agents page.");
                VisitOffice("partners/agents");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Click on advance filter button.");
                agents_PartnerAgentsHelper.ClickElement("AdvanceFilter");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Select E-Mail in displayed column.");
                agents_PartnerAgentsHelper.SelectByText("DisplayedCols", "E-Mail");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Move email 1 step up.");
                agents_PartnerAgentsHelper.ClickElement("MoveUp");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Move email 1 step up.");
                agents_PartnerAgentsHelper.ClickElement("MoveUp");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Select Phone in displayed column.");
                agents_PartnerAgentsHelper.SelectByText("DisplayedCols", "Phone");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Move phone 1 step down.");
                agents_PartnerAgentsHelper.ClickElement("MoveDown");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

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

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Verify changed position of E-Mail column.");
                agents_PartnerAgentsHelper.IsElementPresent("HeadEmail2");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "Verify changed position of Phone column.");
                agents_PartnerAgentsHelper.IsElementPresent("HeadPhone5");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentAdvanceFilterColumnOrder", "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("VerifyPartnerAgentAdvanceFilterColumnOrder");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Partner Agent Advance Filter Column Order");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Partner Agent Advance Filter Column Order", "Bug", "Medium", "Activities page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Partner Agent Advance Filter Column Order");
                        TakeScreenshot("VerifyPartnerAgentAdvanceFilterColumnOrder");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyPartnerAgentAdvanceFilterColumnOrder.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyPartnerAgentAdvanceFilterColumnOrder");
                        string id            = loginHelper.getIssueID("Verify Partner Agent Advance Filter Column Order");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyPartnerAgentAdvanceFilterColumnOrder.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Partner Agent Advance Filter Column Order"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Partner Agent Advance Filter Column Order");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyPartnerAgentAdvanceFilterColumnOrder");
                executionLog.WriteInExcel("Verify Partner Agent Advance Filter Column Order", Status, JIRA, "Meetings Management");
            }
        }
Ejemplo n.º 13
0
        public void partnerAgentsAdvanceFilterResultsPP()
        {
            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_PartnerAgentsHelper = new Agents_PartnerAgentsHelper(GetWebDriver());

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

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

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

                executionLog.Log("PartnerAgentsAdvanceFilterResultsPP", "Redirect at employee page.");
                VisitOffice("partners/agents");
                agents_PartnerAgentsHelper.WaitForWorkAround(5000);

                executionLog.Log("PartnerAgentsAdvanceFilterResultsPP", "Verify page title.");
                VerifyTitle("Partner Agents");

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

                executionLog.Log("PartnerAgentsAdvanceFilterResultsPP", "Select number of records to 10.");
                agents_PartnerAgentsHelper.SelectByText("ResultsPerPage", "10");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

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

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

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

                executionLog.Log("PartnerAgentsAdvanceFilterResultsPP", "Select number of records to 20.");
                agents_PartnerAgentsHelper.SelectByText("ResultsPerPage", "20");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

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

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

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

                executionLog.Log("PartnerAgentsAdvanceFilterResultsPP", "Select number of records to 50.");
                agents_PartnerAgentsHelper.SelectByText("ResultsPerPage", "50");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("PartnerAgentsAdvanceFilterResultsPP", "Click on ApplyButton button.");
                agents_PartnerAgentsHelper.ClickElement("ApplyButton");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

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

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

                executionLog.Log("PartnerAgentsAdvanceFilterResultsPP", "Select number of records to 100.");
                agents_PartnerAgentsHelper.SelectByText("ResultsPerPage", "100");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("PartnerAgentsAdvanceFilterResultsPP", "Click on ApplyButton button.");
                agents_PartnerAgentsHelper.ClickElement("ApplyButton");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

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

                executionLog.Log("PartnerAgentsAdvanceFilterResultsPP", "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("PartnerAgentsAdvanceFilterResultsPP");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Partner Agents Advance Filter ResultsPP");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Partner Agents 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("Partner Agents Advance Filter ResultsPP");
                        TakeScreenshot("PartnerAgentsAdvanceFilterResultsPP");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\PartnerAgentsAdvanceFilterResultsPP.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("PartnerAgentsAdvanceFilterResultsPP");
                        string id            = loginHelper.getIssueID("Partner Agents Advance Filter ResultsPP");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\PartnerAgentsAdvanceFilterResultsPP.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Partner Agents Advance Filter ResultsPP"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Partner Agents Advance Filter ResultsPP");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("PartnerAgentsAdvanceFilterResultsPP");
                executionLog.WriteInExcel("Partner Agents Advance Filter ResultsPP", Status, JIRA, "Opportunities Management");
            }
        }
Ejemplo n.º 14
0
        public void editPartnerAgentNewSkin()
        {
            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_PartnerAgentsHelper = new Agents_PartnerAgentsHelper(GetWebDriver());

            // Variable
            var    Email  = "P.Agent" + RandomNumber(1, 999) + "@yopmail.com";
            var    name   = "TestAgent" + GetRandomNumber();
            String Status = "Pass";
            String JIRA   = "";

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

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

                executionLog.Log("EditPartnerAgentNewSkin", "Redirect at Partner Agent page.");
                VisitOffice("partners/agents");

                executionLog.Log("EditPartnerAgentNewSkin", "Search Partner Agent");
                agents_PartnerAgentsHelper.TypeText("SearchAgent", "Test Agent Tester");
                agents_PartnerAgentsHelper.WaitForWorkAround(2000);

                var Loc = "//table[@id='list1']/tbody/tr[2]/td[8]/a";
                if (agents_PartnerAgentsHelper.IsElementPresent(Loc))
                {
                    executionLog.Log("EditPartnerAgentNewSkin", "Click On Edit");
                    agents_PartnerAgentsHelper.ClickElement("EditAgent");

                    executionLog.Log("EditPartnerAgentNewSkin", "Enter LastName");
                    agents_PartnerAgentsHelper.TypeText("LastName", "Tester");

                    executionLog.Log("EditPartnerAgentNewSkin", "Enter DBAName");
                    agents_PartnerAgentsHelper.TypeText("DBAName", "Test DBA");

                    executionLog.Log("EditPartnerAgentNewSkin", "Select eAddressType");
                    agents_PartnerAgentsHelper.Select("eAddressType", "E-Mail");

                    executionLog.Log("EditPartnerAgentNewSkin", "Select eAddressLebel");
                    agents_PartnerAgentsHelper.Select("eAddressLebel", "Work");

                    executionLog.Log("EditPartnerAgentNewSkin", "Select SelectPhoneType");
                    agents_PartnerAgentsHelper.Select("SelectPhoneType", "Work");

                    executionLog.Log("EditPartnerAgentNewSkin", "Enter PhoneNumber");
                    agents_PartnerAgentsHelper.TypeText("PhoneNumber", "1212121212");

                    executionLog.Log("EditPartnerAgentNewSkin", "Select Address Type    ");
                    agents_PartnerAgentsHelper.Select("AddressType", "Office");

                    executionLog.Log("EditPartnerAgentNewSkin", "Enter AddressLine1");
                    agents_PartnerAgentsHelper.TypeText("AddressLine1", "FC 89");

                    executionLog.Log("EditPartnerAgentNewSkin", "Enter Postal code");
                    agents_PartnerAgentsHelper.TypeText("PostalCode", "60601");
                    agents_PartnerAgentsHelper.WaitForWorkAround(2000);

                    executionLog.Log("EditPartnerAgentNewSkin", "Click on Save button.");
                    agents_PartnerAgentsHelper.ClickElement("SaveAgent");
                    agents_PartnerAgentsHelper.WaitForWorkAround(4000);
                }
                else
                {
                    executionLog.Log("EditPartnerAgentNewSkin", "Click On Create");
                    agents_PartnerAgentsHelper.ClickElement("Create");

                    executionLog.Log("EditPartnerAgentNewSkin", "Select Salutation");
                    agents_PartnerAgentsHelper.Select("SelectSalutation", "Mr");

                    executionLog.Log("EditPartnerAgentNewSkin", "Enter FirstNAME");
                    agents_PartnerAgentsHelper.TypeText("FirstName", "Test Agent");

                    executionLog.Log("EditPartnerAgentNewSkin", "Enter LastName");
                    agents_PartnerAgentsHelper.TypeText("LastName", "Tester");

                    executionLog.Log("EditPartnerAgentNewSkin", "Enter DBAName");
                    agents_PartnerAgentsHelper.TypeText("DBAName", "Test DBA");

                    executionLog.Log("EditPartnerAgentNewSkin", "Enter LinkedInUrl");
                    agents_PartnerAgentsHelper.TypeText("LinkedInUrl", "LinkedIn.con");

                    executionLog.Log("EditPartnerAgentNewSkin", "Enter FaceBook Url");
                    agents_PartnerAgentsHelper.TypeText("FaceBookUrl", "Facebook.com");

                    executionLog.Log("EditPartnerAgentNewSkin", "Enter TwitterURL");
                    agents_PartnerAgentsHelper.TypeText("TwitterURL", "Twitter.com");

                    executionLog.Log("EditPartnerAgentNewSkin", "Select DBAName");
                    agents_PartnerAgentsHelper.Select("SelectLanguage", "English");

                    executionLog.Log("EditPartnerAgentNewSkin", "Select eAddressType");
                    agents_PartnerAgentsHelper.Select("eAddressType", "E-Mail");

                    executionLog.Log("EditPartnerAgentNewSkin", "Select eAddressLebel");
                    agents_PartnerAgentsHelper.Select("eAddressLebel", "Work");

                    executionLog.Log("EditPartnerAgentNewSkin", "Enter eAddressType");
                    agents_PartnerAgentsHelper.TypeText("eAddress", Email);

                    executionLog.Log("EditPartnerAgentNewSkin", "Select SelectPhoneType");
                    agents_PartnerAgentsHelper.Select("SelectPhoneType", "Work");

                    executionLog.Log("EditPartnerAgentNewSkin", "Enter PhoneNumber");
                    agents_PartnerAgentsHelper.TypeText("PhoneNumber", "1212121212");

                    executionLog.Log("EditPartnerAgentNewSkin", "Select Address Type    ");
                    agents_PartnerAgentsHelper.Select("AddressType", "Office");

                    executionLog.Log("EditPartnerAgentNewSkin", "Enter AddressLine1");
                    agents_PartnerAgentsHelper.TypeText("AddressLine1", "FC 89");

                    executionLog.Log("EditPartnerAgentNewSkin", "Enter Postal code.");
                    agents_PartnerAgentsHelper.TypeText("PostalCode", "60601");
                    agents_PartnerAgentsHelper.WaitForWorkAround(2000);

                    executionLog.Log("EditPartnerAgentNewSkin", "Click Save AGENT btn");
                    agents_PartnerAgentsHelper.ClickElement("SaveAgent");
                    agents_PartnerAgentsHelper.WaitForWorkAround(2000);
                }
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";
                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("EditPartnerAgentNewSkin");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Edit Partner Agent New Skin");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Edit Partner Agent New Skin", "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("Edit Partner Agent New Skin");
                        TakeScreenshot("EditPartnerAgentNewSkin");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\EditPartnerAgentNewSkin.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("EditPartnerAgentNewSkin");
                        string id            = loginHelper.getIssueID("Edit Partner Agent New Skin");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\EditPartnerAgentNewSkin.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Edit Partner Agent New Skin"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Edit Partner Agent New Skin");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("EditPartnerAgentNewSkin");
                executionLog.WriteInExcel("Edit Partner Agent New Skin", Status, JIRA, "Partner Portal");
            }
        }
Ejemplo n.º 15
0
        public void partnerPortal()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

            //Initializing the objects5
            ExecutionLog executionLog = new ExecutionLog();
            var          loginHelper  = new LoginHelper(GetWebDriver());
            var          agents_PartnerAgentsHelper = new Agents_PartnerAgentsHelper(GetWebDriver());
            var          office_UserHelper          = new Office_UserHelper(GetWebDriver());

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

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

            try
            {
                executionLog.Log("PartnerPortal", "Login to office");
                Login(username[0], password[0]);

                executionLog.Log("PartnerPortal", "Redirect to dashboard");
                VerifyTitle("Dashboard");
                Console.WriteLine("Redirected at Dashboard screen.");

                VisitOffice("partners/agents");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                executionLog.Log("PartnerPortal", "Search the existed agent");
                agents_PartnerAgentsHelper.TypeText("AgentName", "QApartner Agent");
                agents_PartnerAgentsHelper.WaitForWorkAround(2000);

                var loc1 = "//table[@id='list1']//tr[2]//td[8]/a";
                if (agents_PartnerAgentsHelper.IsElementPresent(loc1))
                {
                    executionLog.Log("PartnerPortal", "Logout from the application");
                    VisitOffice("logout");

                    executionLog.Log("PartnerPortal", "Login to the application");
                    Login("MyPartnerAgent", "1qaz!QAZ");
                    agents_PartnerAgentsHelper.WaitForWorkAround(2000);

                    executionLog.Log("PartnerPortal", "Verify text partner agent");
                    agents_PartnerAgentsHelper.VerifyText("VerifyHeadingPartnerAgnet", "Partner Agents");

                    executionLog.Log("PartnerPortal", "Navigate to lead page");
                    VisitOffice("partners/lead_create");

                    executionLog.Log("PartnerPortal", "Clicl on save button");
                    agents_PartnerAgentsHelper.ClickElement("ClickSaveBtn");
                    //agents_PartnerAgentsHelper.WaitForWorkAround(2000);

                    executionLog.Log("PartnerPortal", "Enter the first name");
                    agents_PartnerAgentsHelper.TypeText("EnterFirstName", FName);

                    executionLog.Log("PartnerPortal", "Enter the last name");
                    agents_PartnerAgentsHelper.TypeText("EnterLastName", LName);

                    executionLog.Log("PartnerPortal", "Enter the company name");
                    agents_PartnerAgentsHelper.TypeText("LeadCompanyName", CDBA);

                    executionLog.Log("PartnerPortal", "Select lead status");
                    agents_PartnerAgentsHelper.SelectByText("SelectLeadStatus", "New");

                    executionLog.Log("PartnerPortal", "Select lead source");
                    agents_PartnerAgentsHelper.SelectByText("SelectSourcePLead", "Email");

                    executionLog.Log("PartnerPortal", "Select lead responsibility");
                    agents_PartnerAgentsHelper.SelectByText("SelectResponsibities", "Howard Tang");

                    executionLog.Log("PartnerPortal", "Click on the save button");
                    agents_PartnerAgentsHelper.ClickElement("ClickSaveBtn");
                    agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                    var loc = "//h3[text()='Existing Leads']";
                    if (agents_PartnerAgentsHelper.IsElementPresent(loc))
                    {
                        executionLog.Log("PartnerPortal", "Click on lead duplicate");
                        agents_PartnerAgentsHelper.ClickOnDisplayed("CraeteLeadDub");
                        agents_PartnerAgentsHelper.WaitForText("Lead saved successfully.", 10);
                    }

                    else
                    {
                        executionLog.Log("PartnerPortal", "Verify Page text");
                        agents_PartnerAgentsHelper.WaitForText("Lead saved successfully.", 10);

                        executionLog.Log("PartnerPortal", "Click edit lead");
                        agents_PartnerAgentsHelper.ClickElement("ClickEditTask");

                        executionLog.Log("PartnerPortal", "Click on save button");
                        agents_PartnerAgentsHelper.ClickElement("ClickSaveBtn");
                        agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                        executionLog.Log("PartnerPortal", "Wait for confirmation.");
                        agents_PartnerAgentsHelper.WaitForText("Lead updated successfully.", 10);
                    }
                }
                else
                {
                    executionLog.Log("PartnerAgentWithUser", "Redirect to the URL");
                    VisitOffice("partners/agent/create");
                    agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                    executionLog.Log("PartnerAgentWithUser", "Verify page title.");
                    VerifyTitle("Create a Partner Agent");

                    executionLog.Log("PartnerAgentWithUser", "Select Salutation");
                    agents_PartnerAgentsHelper.Select("SelectSalutation", "Mr");

                    executionLog.Log("PartnerAgentWithUser", "Enter FirstNAME");
                    agents_PartnerAgentsHelper.TypeText("FirstName", "QApartner");

                    executionLog.Log("PartnerAgentWithUser", "Enter LastName");
                    agents_PartnerAgentsHelper.TypeText("LastName", "Agent");

                    executionLog.Log("PartnerAgentWithUser", "Enter DBAName");
                    agents_PartnerAgentsHelper.TypeText("DBAName", "Qa Partner Infotech");

                    executionLog.Log("PartnerAgentWithUser", "Select eAddressType");
                    agents_PartnerAgentsHelper.Select("eAddressType", "E-Mail");

                    executionLog.Log("PartnerAgentWithUser", "Select eAddressLebel");
                    agents_PartnerAgentsHelper.Select("eAddressLebel", "Work");

                    executionLog.Log("PartnerAgentWithUser", "Enter eAddressType");
                    agents_PartnerAgentsHelper.TypeText("eAddress", "*****@*****.**");

                    executionLog.Log("PartnerAgentWithUser", "Select SelectPhoneType");
                    agents_PartnerAgentsHelper.Select("SelectPhoneType", "Work");

                    executionLog.Log("PartnerAgentWithUser", "Select Address Type  ");
                    agents_PartnerAgentsHelper.Select("AddressType", "Office");

                    executionLog.Log("PartnerAgentWithUser", "Enter AddressLine1");
                    agents_PartnerAgentsHelper.TypeText("AddressLine1", "FC 89");

                    executionLog.Log("PartnerAgentWithUser", "Enter Zip code");
                    agents_PartnerAgentsHelper.TypeText("PostalCode", "60601");
                    agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                    executionLog.Log("PartnerAgentWithUser", "Click On Checkbox");
                    agents_PartnerAgentsHelper.ClickViaJavaScript("//*[@id='UserCreateUser']");

                    executionLog.Log("PartnerAgentWithUser", "Enter UserName");
                    agents_PartnerAgentsHelper.TypeText("UserName", "MyPartnerAgent");

                    executionLog.Log("PartnerAgentWithUser", "Click on auto generate pasword");
                    agents_PartnerAgentsHelper.ClickElement("AutoGenPassword");
                    agents_PartnerAgentsHelper.WaitForWorkAround(1000);

                    executionLog.Log("PartnerAgentWithUser", "Enter the password");
                    agents_PartnerAgentsHelper.TypeText("UserPassword", "1qaz!QAZ");

                    executionLog.Log("PartnerAgentWithUser", "Click On Avatar");
                    agents_PartnerAgentsHelper.ClickElement("ClickOnAvatar");
                    agents_PartnerAgentsHelper.WaitForWorkAround(1000);

                    executionLog.Log("PartnerAgentWithUser", "CLICK Save AGENT btn");
                    agents_PartnerAgentsHelper.ClickElement("SaveAgent");
                    agents_PartnerAgentsHelper.WaitForWorkAround(4000);

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

                    GetWebDriver().Navigate().GoToUrl("http://www.yopmail.com");
                    agents_PartnerAgentsHelper.WaitForWorkAround(5000);

                    executionLog.Log("PartnerPortal", "Enter the email");
                    agents_PartnerAgentsHelper.TypeText("LoginName", "*****@*****.**");

                    executionLog.Log("PartnerPortal", "Click on check inbox");
                    agents_PartnerAgentsHelper.ClickElement("CheckInbox");
                    agents_PartnerAgentsHelper.WaitForWorkAround(5000);

                    executionLog.Log("PartnerPortal", "click on url to active the account");
                    agents_PartnerAgentsHelper.ClickElement("ActivateUrl");
                    agents_PartnerAgentsHelper.WaitForWorkAround(5000);

                    executionLog.Log("PartnerPortal", "Login to the application");
                    Login("MyPartnerAgent", "1qaz!QAZ");
                    agents_PartnerAgentsHelper.WaitForWorkAround(2000);

                    executionLog.Log("PartnerPortal", "Verify text partner agent");
                    agents_PartnerAgentsHelper.VerifyText("VerifyHeadingPartnerAgnet", "Partner Agents");

                    executionLog.Log("PartnerPortal", "Navigate to lead page");
                    VisitOffice("partners/lead_create");

                    executionLog.Log("PartnerPortal", "Clicl on save button");
                    agents_PartnerAgentsHelper.ClickElement("ClickSaveBtn");
                    agents_PartnerAgentsHelper.WaitForWorkAround(2000);

                    executionLog.Log("PartnerPortal", "Enter the first name");
                    agents_PartnerAgentsHelper.TypeText("EnterFirstName", FName);

                    executionLog.Log("PartnerPortal", "Enter the last name");
                    agents_PartnerAgentsHelper.TypeText("EnterLastName", LName);

                    executionLog.Log("PartnerPortal", "Enter the company name");
                    agents_PartnerAgentsHelper.TypeText("LeadCompanyName", CDBA);

                    executionLog.Log("PartnerPortal", "Select lead status");
                    agents_PartnerAgentsHelper.SelectByText("SelectLeadStatus", "New");

                    executionLog.Log("PartnerPortal", "Select lead source");
                    agents_PartnerAgentsHelper.SelectByText("SelectSourcePLead", "Email");

                    executionLog.Log("PartnerPortal", "Select lead responsibility");
                    agents_PartnerAgentsHelper.SelectByText("SelectResponsibities", "Howard Tang");

                    executionLog.Log("PartnerPortal", "Click on the save button");
                    agents_PartnerAgentsHelper.ClickElement("ClickSaveBtn");
                    agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                    var loc = "//h3[text()='Existing Leads']";
                    if (agents_PartnerAgentsHelper.IsElementPresent(loc))
                    {
                        executionLog.Log("PartnerPortal", "Click on lead duplicate");
                        agents_PartnerAgentsHelper.ClickOnDisplayed("CraeteLeadDub");
                        agents_PartnerAgentsHelper.WaitForText("Lead saved successfully.", 10);
                    }

                    else
                    {
                        executionLog.Log("PartnerPortal", "Verify Page text");
                        agents_PartnerAgentsHelper.WaitForText("Lead saved successfully.", 10);

                        executionLog.Log("PartnerPortal", "Click edit lead");
                        agents_PartnerAgentsHelper.ClickElement("ClickEditTask");

                        executionLog.Log("PartnerPortal", "Click on save button");
                        agents_PartnerAgentsHelper.ClickElement("ClickSaveBtn");
                        agents_PartnerAgentsHelper.WaitForWorkAround(3000);

                        executionLog.Log("PartnerPortal", "Wait for confirmation.");
                        agents_PartnerAgentsHelper.WaitForText("Lead updated successfully.", 10);
                    }
                }
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            // Variable
            var    name      = "TestAgent" + GetRandomNumber();
            var    username1 = "testuser" + RandomNumber(111, 99999);
            String JIRA      = "";
            String Status    = "Pass";

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

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

                executionLog.Log("PartnerAgentWithoutUserSuccessConfirm", "Redirect to the URL");
                VisitOffice("partners/agent/create");

                executionLog.Log("PartnerAgentWithoutUserSuccessConfirm", "Verify page title.");
                VerifyTitle("Create a Partner Agent");

                executionLog.Log("PartnerAgentWithoutUserSuccessConfirm", "Select Salutation");
                agent_PartnerAgentHelper.Select("SelectSalutation", "Mr");

                executionLog.Log("PartnerAgentWithoutUserSuccessConfirm", "Enter FirstNAME");
                agent_PartnerAgentHelper.TypeText("FirstName", "Test Agent");

                executionLog.Log("PartnerAgentWithoutUserSuccessConfirm", "Enter LastName");
                agent_PartnerAgentHelper.TypeText("LastName", "Tester");

                executionLog.Log("PartnerAgentWithoutUserSuccessConfirm", "Enter Date Of Birth");
                agent_PartnerAgentHelper.TypeText("BirthDay", "02/01/1991");

                executionLog.Log("PartnerAgentWithoutUserSuccessConfirm", "Enter DBAName");
                agent_PartnerAgentHelper.TypeText("DBAName", "Test DBA");

                executionLog.Log("PartnerAgentWithoutUserSuccessConfirm", "Select Language");
                agent_PartnerAgentHelper.Select("SelectLanguage", "English");

                executionLog.Log("PartnerAgentWithoutUserSuccessConfirm", "Select eAddressType");
                agent_PartnerAgentHelper.Select("eAddressType", "E-Mail");

                executionLog.Log("PartnerAgentWithoutUserSuccessConfirm", "Select eAddressLebel");
                agent_PartnerAgentHelper.Select("eAddressLebel", "Work");

                executionLog.Log("PartnerAgentWithoutUserSuccessConfirm", "Select eAddress");
                agent_PartnerAgentHelper.TypeText("eAddress", "*****@*****.**");

                executionLog.Log("PartnerAgentWithoutUserSuccessConfirm", "Select SelectPhoneType");
                agent_PartnerAgentHelper.Select("SelectPhoneType", "Work");

                executionLog.Log("PartnerAgentWithoutUserSuccessConfirm", "Select Address Type  ");
                agent_PartnerAgentHelper.Select("AddressType", "Office");

                executionLog.Log("PartnerAgentWithoutUserSuccessConfirm", "Enter AddressLine1");
                agent_PartnerAgentHelper.TypeText("AddressLine1", "FC 89");

                executionLog.Log("PartnerAgentWithoutUserSuccessConfirm", "Enter PhoneNumber");
                agent_PartnerAgentHelper.TypeText("PostalCode", "60601");
                agent_PartnerAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("PartnerAgentBirthDateVerifySave", "Select User Account Check Box");
                agent_PartnerAgentHelper.ClickElement("UserAccChkBox");
                agent_PartnerAgentHelper.WaitForWorkAround(1000);

                executionLog.Log("PartnerAgentBirthDateVerifySave", "Enter Username");
                agent_PartnerAgentHelper.TypeText("UserName", username1);

                executionLog.Log("PartnerAgentBirthDateVerifySave", "Select Avatar Check Box");
                agent_PartnerAgentHelper.ClickElement("ParnterUserAvatar");

                executionLog.Log("PartnerAgentWithoutUserSuccessConfirm", "CLICK Save AGENT btn");
                agent_PartnerAgentHelper.ClickElement("SaveAgent");

                executionLog.Log("PartnerAgentWithoutUserSuccessConfirm", "Verify Text");
                agent_PartnerAgentHelper.WaitForText("Partner Agent Created Successfully.", 10);

                executionLog.Log("PartnerAgentWithoutUserSuccessConfirm", "Click on Edit Partner agent");
                agent_PartnerAgentHelper.ClickElement("EditAgentDetails");
                agent_PartnerAgentHelper.WaitForWorkAround(1000);

                executionLog.Log("PartnerAgentBirthDateVerifySave", "Enter Username");
                agent_PartnerAgentHelper.TypeText("UserName", username1);

                executionLog.Log("PartnerAgentBirthDateVerifySave", "Select Avatar Check Box");
                agent_PartnerAgentHelper.ClickElement("ParnterUserAvatar");

                executionLog.Log("PartnerAgentWithoutUserSuccessConfirm", "Click Save");
                agent_PartnerAgentHelper.ClickElement("SaveAgent");

                executionLog.Log("PartnerAgentWithoutUserSuccessConfirm", "Verify Confirmation");
                agent_PartnerAgentHelper.WaitForText("Partner Agent Updated Successfully.", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";
                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("PartnerAgentWithoutUserSuccessConfirm");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("PartnerAgent Without User Success Confirm");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("PartnerAgent Without User Success Confirm", "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("PartnerAgent Without User Success Confirm");
                        TakeScreenshot("PartnerAgentWithoutUserSuccessConfirm");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\PartnerAgentWithoutUserSuccessConfirm.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("PartnerAgentWithoutUserSuccessConfirm");
                        string id            = loginHelper.getIssueID("PartnerAgent Without User Success Confirm");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\PartnerAgentWithoutUserSuccessConfirm.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("PartnerAgent Without User Success Confirm"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("PartnerAgent Without User Success Confirm");
                //       executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("PartnerAgentWithoutUserSuccessConfirm");
                executionLog.WriteInExcel("PartnerAgent Without User Success Confirm", Status, JIRA, "Agents Portal");
            }
        }
Ejemplo n.º 17
0
        public void disabledPartnerAgentIssue()
        {
            string[] username = null;
            string[] password = null;

            XMLParse oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var    executionLog               = new ExecutionLog();
            var    loginHelper                = new LoginHelper(GetWebDriver());
            var    agent_AllAgentHelper       = new Agents_PartnerAgentsHelper(GetWebDriver());
            var    office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver());
            String JIRA   = "";
            String Status = "Pass";


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

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

                executionLog.Log("DisabledPartnerAgentIssue", "Redirect at partner agents page.");
                VisitOffice("partners/agents");
                agent_AllAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("DisabledPartnerAgentIssue", "Verify Page title");
                VerifyTitle("Partner Agents");

                executionLog.Log("DisabledPartnerAgentIssue", "Search mark matthews");
                agent_AllAgentHelper.TypeText("AgentName", "Mark Menu");
                agent_AllAgentHelper.WaitForWorkAround(2000);

                executionLog.Log("DisabledPartnerAgentIssue", "Check the active agent");
                agent_AllAgentHelper.CheckAndClick("InActiveIcon");
                agent_AllAgentHelper.WaitForWorkAround(4000);

                executionLog.Log("DisabledPartnerAgentIssue", "Redirect at create opportunities page.");
                VisitOffice("opportunities/create");

                executionLog.Log("DisabledPartnerAgentIssue", "Wait for locator to be present.");
                office_OpportunitiesHelper.WaitForElementPresent("Responsibility", 10);

                executionLog.Log("DisabledPartnerAgentIssue", "Verify disabled Partner agent not present for selection.");
                office_OpportunitiesHelper.PAgentNotAvail();

                executionLog.Log("DisabledPartnerAgentIssue", "Redirect at partner agents page.");
                VisitOffice("partners/agents");
                agent_AllAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("DisabledPartnerAgentIssue", "Verify Page title");
                VerifyTitle("Partner Agents");

                executionLog.Log("DisabledPartnerAgentIssue", "Enter partner name to be search");
                agent_AllAgentHelper.TypeText("AgentName", "Mark Menu");
                agent_AllAgentHelper.WaitForWorkAround(2000);

                executionLog.Log("DisabledPartnerAgentIssue", "Verify partner status as inactive.");
                agent_AllAgentHelper.VerifyText("VerifyStatus", "Inactive");
                //agent_AllAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("DisabledPartnerAgentIssue", "Click to make partner agent active.");
                agent_AllAgentHelper.ClickJava("MakeActiveIcon");
                agent_AllAgentHelper.WaitForWorkAround(1000);
                agent_AllAgentHelper.AcceptAlert();

                executionLog.Log("DisabledPartnerAgentIssue", "Wait for success text.");
                agent_AllAgentHelper.WaitForText("Partner Agent is Activated.", 10);
                //agent_AllAgentHelper.WaitForWorkAround(3000);

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

            // Variable
            var name = "TestAgent" + GetRandomNumber();

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

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

                executionLog.Log("RevenueShareButtonForPartnerAgent", "Redirect at partner agent page.");
                VisitOffice("partners/agents");

                executionLog.Log("RevenueShareButtonForPartnerAgent", "Click On Revenue Share");
                agents_PartnerAgentsHelper.ClickElement("RevenueSahrnepartneragent");
                agents_PartnerAgentsHelper.WaitForWorkAround(2000);

                executionLog.Log("RevenueShareButtonForPartnerAgent", "Verify partner agent available");
                agents_PartnerAgentsHelper.VerifyPageText("Partner Agents");
                agents_PartnerAgentsHelper.WaitForWorkAround(3000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("RevenueShareButtonForPartnerAgent");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Revenue Share Button For Partner Agent");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Revenue Share Button For Partner Agent", "Bug", "Medium", "Partner 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 Share Button For Partner Agent");
                        TakeScreenshot("RevenueShareButtonForPartnerAgent");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\RevenueShareButtonForPartnerAgent.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("RevenueShareButtonForPartnerAgent");
                        string id            = loginHelper.getIssueID("Revenue Share Button For Partner Agent");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\RevenueShareButtonForPartnerAgent.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Revenue Share Button For Partner Agent"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Revenue Share Button For Partner Agent");
                //  executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("RevenueShareButtonForPartnerAgent");
                executionLog.WriteInExcel("Revenue Share Button For Partner Agent", Status, JIRA, "Agent Portal");
            }
        }
        public void validationForAdjustmentRuleForPartnerAgent()
        {
            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_PartnerAgentHelper        = new Agents_PartnerAgentsHelper(GetWebDriver());
            var residualIncome_MasterDataHelper = new ResidualIncome_MasterDataHelper(GetWebDriver());

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

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

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

                executionLog.Log("ValidationForAdjustmentRuleForPartnerAgent", "Redirect to the URL");
                VisitOffice("partners/agents");
                agent_PartnerAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("ValidationForAdjustmentRuleForPartnerAgent", "Click on any agent.");
                agent_PartnerAgentHelper.ClickElement("OpenAgent");
                agent_PartnerAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("ValidationForAdjustmentRuleForPartnerAgent", "Click create adjustment button");
                agent_PartnerAgentHelper.ClickElement("CreateRevenueAdjstmnt");
                agent_PartnerAgentHelper.WaitForWorkAround(2000);

                executionLog.Log("ValidationForAdjustmentRuleForPartnerAgent", "Enter Adjustment name.");
                agent_PartnerAgentHelper.TypeText("EnterAdjustmentName", Adjustment);

                executionLog.Log("ValidationForAdjustmentRuleForPartnerAgent", "Select Adjustment for");
                agent_PartnerAgentHelper.Select("SelectAdjustmentFor", "Agent");

                executionLog.Log("ValidationForAdjustmentRuleForPartnerAgent", "Select Adjustment type");
                agent_PartnerAgentHelper.Select("AdjustmentType", "Transaction");

                executionLog.Log("ValidationForAdjustmentRuleForPartnerAgent", "Select reporting period.");
                agent_PartnerAgentHelper.Select("SelectReportingPeriod", "00");

                executionLog.Log("ValidationForAdjustmentRuleForPartnerAgent", "Select processor");
                agent_PartnerAgentHelper.Select("SelectProcessor", "Any");

                executionLog.Log("ValidationForAdjustmentRuleForPartnerAgent", "Select rule type.");
                agent_PartnerAgentHelper.Select("SelectRuleType", "1");

                executionLog.Log("ValidationForAdjustmentRuleForPartnerAgent", "Enter Amount");
                agent_PartnerAgentHelper.TypeText("EnterAmount", "50");

                executionLog.Log("ValidationForAdjustmentRuleForPartnerAgent", "Select add or remove ");
                agent_PartnerAgentHelper.Select("AddRemove", "Add");

                executionLog.Log("ValidationForAdjustmentRuleForPartnerAgent", "Save Adjustment ");
                agent_PartnerAgentHelper.ClickElement("SaveAdjustment");
                agent_PartnerAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("ValidationForAdjustmentRuleForPartnerAgent", "Verify success message for MAster adjustment. ");
                agent_PartnerAgentHelper.VerifyPageText("Master Adjustment Rules Created Successfully.");

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

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

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

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

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

                executionLog.Log("ValidationForAdjustmentRuleForPartnerAgent", "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("ValidationForAdjustmentRuleForPartnerAgent");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Validation For Adjustment Rule For Partner Agent");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Validation For Adjustment Rule For Partner Agent", "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("Validation For Adjustment Rule For Partner Agent");
                        TakeScreenshot("ValidationForAdjustmentRuleForPartnerAgent");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\ValidationForAdjustmentRuleForPartnerAgent.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("ValidationForAdjustmentRuleForPartnerAgent");
                        string id            = loginHelper.getIssueID("Validation For Adjustment Rule For Partner Agent");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\ValidationForAdjustmentRuleForPartnerAgent.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Validation For Adjustment Rule For Partner Agent"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Validation For Adjustment Rule For Partner Agent");
                //    executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("ValidationForAdjustmentRuleForPartnerAgent");
                executionLog.WriteInExcel("Validation For Adjustment Rule For Partner Agent", Status, JIRA, "Agents Portal");
            }
        }
        public void partnerAgenteAddressAutoPopulationIssue()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog             = new ExecutionLog();
            var loginHelper              = new LoginHelper(GetWebDriver());
            var agent_PartnerAgentHelper = new Agents_PartnerAgentsHelper(GetWebDriver());

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

            try
            {
                executionLog.Log("PartnerAgenteAddressAutoPopulationIssue", "Login with valid username and password");
                Login("Tester.test", "1qaz!QAZ");

                executionLog.Log("PartnerAgenteAddressAutoPopulationIssue", "Wait for locator to present.");
                agent_PartnerAgentHelper.WaitForElementPresent("EditP.Agent", 10);

                executionLog.Log("PartnerAgenteAddressAutoPopulationIssue", "Click on edit button.");
                agent_PartnerAgentHelper.ClickElement("EditP.Agent");
                agent_PartnerAgentHelper.WaitForWorkAround(2000);

                executionLog.Log("PartnerAgenteAddressAutoPopulationIssue", "Select eaddress type as weblink.");
                agent_PartnerAgentHelper.Select("PAddressType", "Web Links");
                agent_PartnerAgentHelper.WaitForWorkAround(2000);

                executionLog.Log("PartnerAgenteAddressAutoPopulationIssue", "Click on save button");
                agent_PartnerAgentHelper.ClickElement("SaveAgent");
                agent_PartnerAgentHelper.WaitForWorkAround(2000);

                executionLog.Log("PartnerAgenteAddressAutoPopulationIssue", "Click on edit icon.");
                agent_PartnerAgentHelper.ClickElement("EditP.Agent");
                agent_PartnerAgentHelper.WaitForWorkAround(2000);

                executionLog.Log("PartnerAgenteAddressAutoPopulationIssue", "Verify eAddress label as web link");
                agent_PartnerAgentHelper.VerifyLabel("VerifySelectedLabel");
                agent_PartnerAgentHelper.WaitForWorkAround(2000);

                executionLog.Log("PartnerAgenteAddressAutoPopulationIssue", "Click on save button");
                agent_PartnerAgentHelper.ClickElement("SaveAgent");
                agent_PartnerAgentHelper.WaitForWorkAround(2000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("PartnerAgenteAddressAutoPopulationIssue");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Partner Agent eAddress Auto Population Issue");
                if (!result)
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Partner Agent eAddress Auto Population Issue", "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("Partner Agent eAddress Auto Population Issue");
                        TakeScreenshot("PartnerAgenteAddressAutoPopulationIssue");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\PartnerAgenteAddressAutoPopulationIssue.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("PartnerAgenteAddressAutoPopulationIssue");
                        string id            = loginHelper.getIssueID("Partner Agent eAddress Auto Population Issue");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\PartnerAgenteAddressAutoPopulationIssue.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Partner Agent eAddress Auto Population Issue"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Partner Agent eAddress Auto Population Issue");
                executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("PartnerAgenteAddressAutoPopulationIssue");
                executionLog.WriteInExcel("Partner Agent eAddress Auto Population Issue", Status, JIRA, "Agents Portal");
            }
        }
        public void verifyPartnerAgentCreatedAndModifiedByCredits()
        {
            string[] username = null;
            string[] password = null;

            XMLParse oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog             = new ExecutionLog();
            var loginHelper              = new LoginHelper(GetWebDriver());
            var agent_PartnerAgentHelper = new Agents_PartnerAgentsHelper(GetWebDriver());

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

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

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

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Go to Partner Agent page.");
                VisitOffice("partners/agents");
                agent_PartnerAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Verify page title.");
                VerifyTitle("Partner Agents");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Click On Create button");
                agent_PartnerAgentHelper.ClickElement("Create");
                agent_PartnerAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Verify page title..");
                VerifyTitle("Create a Partner Agent");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Click on save button.");
                agent_PartnerAgentHelper.ClickElement("ClickSave");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Verify validation for first name");
                agent_PartnerAgentHelper.VerifyText("FirstNameError", "This field is required.");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Verify validation for last name");
                agent_PartnerAgentHelper.VerifyText("LastNameError", "This field is required.");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Verify validation for e address type");
                agent_PartnerAgentHelper.VerifyText("AddressTypeError", "This field is required.");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Verify validation for eAddress label ");
                agent_PartnerAgentHelper.VerifyText("AddressLabelError", "This field is required.");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Verify validation for  eaddress");
                agent_PartnerAgentHelper.VerifyText("EaddressError", "This field is required.");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Enter an invalid eAddress");
                agent_PartnerAgentHelper.TypeText("eAddress", "1221313");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Verify validation for invalid eAddress.");
                agent_PartnerAgentHelper.VerifyText("EaddressError", "Please enter a valid email address.");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Enter an invalid eAddress.");
                agent_PartnerAgentHelper.TypeText("eAddress", "asssas");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Verify validation for invalid eaddress");
                agent_PartnerAgentHelper.VerifyText("EaddressError", "Please enter a valid email address.");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Click on cancel button.");
                agent_PartnerAgentHelper.ClickElement("Cancel");
                agent_PartnerAgentHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Verify page title");
                VerifyTitle("Partner Agents");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Click On Create button");
                agent_PartnerAgentHelper.ClickElement("Create");
                agent_PartnerAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Verify page title..");
                VerifyTitle("Create a Partner Agent");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Select Salutation for agent");
                agent_PartnerAgentHelper.Select("SelectSalutation", "Mr");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Enter agent FirstNAME");
                agent_PartnerAgentHelper.TypeText("FirstName", "Test Agent");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Enter agent LastName");
                agent_PartnerAgentHelper.TypeText("LastName", "Tester");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Enter agent Date Of Birth");
                agent_PartnerAgentHelper.TypeText("BirthDay", "08/08/1992");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Enter agent agent DBAName");
                agent_PartnerAgentHelper.TypeText("DBAName", "Test DBA");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Enter agent LinkedInUrl");
                agent_PartnerAgentHelper.TypeText("LinkedInUrl", "LinkedIn.con");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Enter agent FaceBook Url");
                agent_PartnerAgentHelper.TypeText("FaceBookUrl", "Facebook.com");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Enter agent TwitterURL");
                agent_PartnerAgentHelper.TypeText("TwitterURL", "Twitter.com");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Select agent language.");
                agent_PartnerAgentHelper.Select("SelectLanguage", "English");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Select agent eAddressType");
                agent_PartnerAgentHelper.Select("eAddressType", "E-Mail");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Select agent eAddressLebel");
                agent_PartnerAgentHelper.Select("eAddressLebel", "Work");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Enter agent eAddressType");
                var Email = "P.Agent" + GetRandomNumber() + "@yopmail.com";
                agent_PartnerAgentHelper.TypeText("eAddress", Email);

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Select agent phone type.");
                agent_PartnerAgentHelper.Select("SelectPhoneType", "Work");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Enter agent PhoneNumber");
                agent_PartnerAgentHelper.TypeText("PhoneNumber", "1212121212");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Select agent Address Type  ");
                agent_PartnerAgentHelper.Select("AddressType", "Office");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Enter agent AddressLine1");
                agent_PartnerAgentHelper.TypeText("AddressLine1", "FC 89");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Enter agent Postal code");
                agent_PartnerAgentHelper.TypeText("PostalCode", "60601");
                agent_PartnerAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Click On Checkbox create user");
                agent_PartnerAgentHelper.ClickViaJavaScript("//*[@id='UserCreateUser']");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Enter agent UserName");
                agent_PartnerAgentHelper.TypeText("UserName", name);

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Click On Avatar");
                agent_PartnerAgentHelper.ClickElement("ClickOnAvatar");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Click on save button.");
                agent_PartnerAgentHelper.ClickElement("ClickSave");
                agent_PartnerAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Verify agent created by credits.");
                agent_PartnerAgentHelper.VerifyText("CreatedBy", "Howard Tang");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Verify agent modified by credits.");
                agent_PartnerAgentHelper.VerifyText("ModiCredits", "Howard Tang");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Click on edit  button.");
                agent_PartnerAgentHelper.ClickElement("EditLink");
                agent_PartnerAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Verify page title.");
                VerifyTitle("Edit Partner Agent");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Enter agent LastName");
                agent_PartnerAgentHelper.TypeText("LastName", "Tester");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Enter agent Date Of Birth");
                agent_PartnerAgentHelper.TypeText("BirthDay", "08/08/1993");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Enter agent DBAName");
                agent_PartnerAgentHelper.TypeText("DBAName", "Test DBA");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Enter agent LinkedInUrl");
                agent_PartnerAgentHelper.TypeText("LinkedInUrl", "LinkedIn.con");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Enter agent FaceBook Url");
                agent_PartnerAgentHelper.TypeText("FaceBookUrl", "Facebook.com");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Enter agent TwitterURL");
                agent_PartnerAgentHelper.TypeText("TwitterURL", "Twitter.com");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Select agent language.");
                agent_PartnerAgentHelper.Select("SelectLanguage", "English");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Click on save button.");
                agent_PartnerAgentHelper.ClickElement("ClickSave");
                agent_PartnerAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Verify agent created by credits");
                agent_PartnerAgentHelper.VerifyText("CreatedBy", "Howard Tang");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "Verify agent modified by credits");
                agent_PartnerAgentHelper.VerifyText("ModiCredits", "Howard Tang");

                executionLog.Log("VerifyPartnerAgentCreatedAndModifiedByCredits", "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("VerifyTicketsCreatedAndModifiedByCredits");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Tickets Created And Modified By Credits");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Tickets Created And Modified By Credits", "Bug", "Medium", "Ticket 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 Created And Modified By Credits");
                        TakeScreenshot("VerifyTicketsCreatedAndModifiedByCredits");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyTicketsCreatedAndModifiedByCredits.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyTicketsCreatedAndModifiedByCredits");
                        string id            = loginHelper.getIssueID("Verify Tickets Created And Modified By Credits");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyTicketsCreatedAndModifiedByCredits.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Tickets Created And Modified By Credits"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Tickets Created And Modified By Credits");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyTicketsCreatedAndModifiedByCredits");
                executionLog.WriteInExcel("Verify Tickets Created And Modified By Credits", Status, JIRA, "Office tickets");
            }
        }