Пример #1
0
        public void revenueAdjustmentSaleAgentAddAmount()
        {
            string[] username = null;
            string[] password = null;
            String   JIRA     = "";
            String   Status   = "Pass";

            var oXMLData = new XMLParse();

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

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

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


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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                executionLog.Log("VerifySalesAgentAdvanceFilterColumnOrder", "Redirect To URL");
                VisitOffice("sales_agents");
                agent_1099SalesAgentHelper.WaitForWorkAround(3000);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                executionLog.Log("VerifySalesAgentAdvanceFilterColumnOrder", "Redirect at leads page.");
                VisitOffice("leads");
                agent_1099SalesAgentHelper.WaitForWorkAround(3000);

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

                executionLog.Log("VerifySalesAgentAdvanceFilterColumnOrder", "Redirect To URL");
                VisitOffice("sales_agents");
                agent_1099SalesAgentHelper.WaitForWorkAround(3000);

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

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

                executionLog.Log("VerifySalesAgentAdvanceFilterColumnOrder", "Redirect at sales agents page.");
                VisitOffice("sales_agents");
                agent_1099SalesAgentHelper.WaitForWorkAround(3000);

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

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

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

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

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

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

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

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

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

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

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

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifySalesAgentAdvanceFilterColumnOrder");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Sales Agent Advance Filter Column Order");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Sales 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 Sales Agent Advance Filter Column Order");
                        TakeScreenshot("VerifySalesAgentAdvanceFilterColumnOrder");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifySalesAgentAdvanceFilterColumnOrder.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifySalesAgentAdvanceFilterColumnOrder");
                        string id            = loginHelper.getIssueID("Verify Sales Agent Advance Filter Column Order");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifySalesAgentAdvanceFilterColumnOrder.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Sales Agent Advance Filter Column Order"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Sales Agent Advance Filter Column Order");
                // executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifySalesAgentAdvanceFilterColumnOrder");
                executionLog.WriteInExcel("Verify Sales Agent Advance Filter Column Order", Status, JIRA, "Meetings Management");
            }
        }
Пример #3
0
        public void saleAgentWithUser()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                executionLog.Log("SalesUserIssue", "Go to Create sales user page");
                VisitOffice("sales_agents/create");
                agent_1099SalesAgentHelper.WaitForWorkAround(5000);

                executionLog.Log("SalesUserIssue", "Verify title");
                VerifyTitle("Create a 1099 Sales User");

                executionLog.Log("SalesUserIssue", "Collapse the Contact info section");
                agent_1099SalesAgentHelper.ClickElement("CollapseSignCont.Info");
                agent_1099SalesAgentHelper.WaitForWorkAround(6000);

                executionLog.Log("SalesUserIssue", "Collapse the Details section");
                agent_1099SalesAgentHelper.ClickElement("CollapseDetails");
                agent_1099SalesAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("SalesUserIssue", "Click on 'Save' button");
                agent_1099SalesAgentHelper.ClickJs("SaveSaleAgent");
                agent_1099SalesAgentHelper.WaitForWorkAround(7000);

                executionLog.Log("SalesUserIssue", "Verify title");
                VerifyTitle("Create a 1099 Sales User");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("SalesUserIssue");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Sales User Issue");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Sales User Issue", "Bug", "Medium", "Sales User page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Sales User Issue");
                        TakeScreenshot("Sales User Issue");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\SalesUserIssue.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("SalesUserIssue");
                        string id            = loginHelper.getIssueID("Sales User Issue");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\SalesUserIssue.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Sales User Issue"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Sales User Issue");
                //      executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("SalesUserIssue");
                executionLog.WriteInExcel("Sales User Issue", Status, JIRA, "Agent Portal");
            }
        }
Пример #6
0
        public void saleAgent1()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

            // Initializing the objects5
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var agent_1099SalesAgentHelper = new Agent_1099SalesAgentHelper(GetWebDriver());
            var office_LeadsHelper         = new Office_LeadsHelper(GetWebDriver());
            var office_ClientsHelper       = new Office_ClientsHelper(GetWebDriver());

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

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

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

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

                executionLog.Log("SaleAgent1", "Redirect at Create Lead");
                VisitOffice("leads/create");
                agent_1099SalesAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("SaleAgent1", "Click on Save");
                agent_1099SalesAgentHelper.ClickElement("ClickSaveBtn");

                executionLog.Log("SaleAgent1", "Enter First Name");
                agent_1099SalesAgentHelper.TypeText("EnterFirstName", FName);

                executionLog.Log("SaleAgent1", "Enter Last Name");
                agent_1099SalesAgentHelper.TypeText("EnterLastName", LName);

                executionLog.Log("SaleAgent1", "Company DBA Name");
                agent_1099SalesAgentHelper.TypeText("LeadCompanyName", CDBA);

                executionLog.Log("SaleAgent1", "Select Lead Status");
                agent_1099SalesAgentHelper.SelectByText("SelectLeadStatus", "New");

                executionLog.Log("SaleAgent1", "Select Responsibilities");
                agent_1099SalesAgentHelper.SelectByText("SelectResponsibities", "Howard Tang");

                executionLog.Log("SaleAgent1", "Click Save button");
                agent_1099SalesAgentHelper.ClickElement("ClickSaveBtn");
                agent_1099SalesAgentHelper.WaitForWorkAround(3000);

                var loc = "//h3[text()='Existing Leads']";
                if (agent_1099SalesAgentHelper.IsElementPresent(loc))
                {
                    executionLog.Log("SaleAgent1", "Lead Dublicate button");
                    agent_1099SalesAgentHelper.ClickOnDisplayed("CraeteLeadDub");
                    agent_1099SalesAgentHelper.WaitForText("Lead saved successfully.", 10);
                }

                else
                {
                    executionLog.Log("SaleAgent1", "Lead Saved confirmation");
                    agent_1099SalesAgentHelper.WaitForText("Lead saved successfully.", 10);

                    executionLog.Log("SaleAgent1", "Redirect at Create Lead");
                    VisitOffice("leads/create");
                    agent_1099SalesAgentHelper.WaitForWorkAround(3000);

                    executionLog.Log("SaleAgent1", "Click on Cancel");
                    agent_1099SalesAgentHelper.ClickElement("CancelOpp");
                    agent_1099SalesAgentHelper.WaitForWorkAround(3000);

                    executionLog.Log("SaleAgent1", "Verify page title.");
                    agent_1099SalesAgentHelper.VerifyText("VerifyTextPresentLead", "Leads");

                    executionLog.Log("SaleAgent1", "Redirect at Create Lead");
                    VisitOffice("leads/create");
                    agent_1099SalesAgentHelper.WaitForWorkAround(3000);

                    executionLog.Log("SaleAgent1", "Click Save button");
                    agent_1099SalesAgentHelper.ClickElement("ClickSaveBtn");
                    //agent_1099SalesAgentHelper.WaitForWorkAround(3000);

                    executionLog.Log("SaleAgent1", "Enter First Name");
                    agent_1099SalesAgentHelper.TypeText("EnterFirstName", FName);

                    executionLog.Log("SaleAgent1", "Enter Last Name");
                    agent_1099SalesAgentHelper.TypeText("EnterLastName", LName);

                    executionLog.Log("SaleAgent1", "Lead Company DBA Name");
                    agent_1099SalesAgentHelper.TypeText("LeadCompanyName", CDBA);

                    executionLog.Log("SaleAgent1", "Select Lead Status");
                    agent_1099SalesAgentHelper.SelectByText("SelectLeadStatus", "New");

                    executionLog.Log("SaleAgent1", "Select Responsibities");
                    agent_1099SalesAgentHelper.SelectByText("SelectResponsibities", "Howard Tang");

                    executionLog.Log("SaleAgent1", "Click Save button");
                    agent_1099SalesAgentHelper.ClickElement("ClickSaveBtn");
                    agent_1099SalesAgentHelper.WaitForWorkAround(3000);
                }
                if (agent_1099SalesAgentHelper.IsElementPresent(loc))
                {
                    executionLog.Log("SaleAgent1", "Click on Lead Dublicate button");
                    agent_1099SalesAgentHelper.ClickOnDisplayed("CraeteLeadDub");
                    agent_1099SalesAgentHelper.WaitForWorkAround(4000);

                    executionLog.Log("SaleAgent1", "Goto Lead Page");
                    VisitOffice("leads");
                    agent_1099SalesAgentHelper.WaitForWorkAround(4000);

                    executionLog.Log("SaleAgent1", "Select First Lead");
                    agent_1099SalesAgentHelper.ClickElement("ClickOn1stOpp");

                    executionLog.Log("SaleAgent1", "Select Second Lead");
                    agent_1099SalesAgentHelper.ClickElement("ClickOn2ndOpp");

                    executionLog.Log("SaleAgent1", "Click on Merge");
                    agent_1099SalesAgentHelper.ClickElement("ClickOnMergeRecords");
                    agent_1099SalesAgentHelper.WaitForWorkAround(3000);

                    executionLog.Log("SaleAgent1", "Click on Lead Company Radio Button");
                    agent_1099SalesAgentHelper.ClickElement("LeadCompyRadioBtn");
                    agent_1099SalesAgentHelper.WaitForWorkAround(1000);

                    executionLog.Log("SaleAgent1", "Click Merge Button");
                    agent_1099SalesAgentHelper.ClickElement("ClickOnMergeBtn");
                    agent_1099SalesAgentHelper.AcceptAlert();

                    executionLog.Log("SaleAgent1", "Confirmation Merge Successfull");
                    agent_1099SalesAgentHelper.WaitForText("Merging Lead(s) Completed Successfully.", 10);

                    executionLog.Log("SaleAgent1", "Redirect To leads page. ");
                    VisitOffice("leads");
                    office_LeadsHelper.WaitForWorkAround(3000);

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

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

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

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

                    executionLog.Log("SaleAgent1", "Redirect To leads recycle bin page. ");
                    VisitOffice("leads/recyclebin");
                    office_LeadsHelper.WaitForWorkAround(3000);

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

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

                    executionLog.Log("SaleAgent1", "Wait for success message.");
                    office_LeadsHelper.WaitForText("Lead Permanently Deleted.", 10);
                }
                else
                {
                    executionLog.Log("SaleAgent1", "Lead Saved Successfully");
                    agent_1099SalesAgentHelper.WaitForText("Lead saved successfully.", 10);

                    executionLog.Log("SaleAgent1", "Go to lead");
                    VisitOffice("leads");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("SaleAgent1", "Select First Lead");
                    agent_1099SalesAgentHelper.ClickElement("ClickOn1stOpp");

                    executionLog.Log("SaleAgent1", "Select Second Lead");
                    agent_1099SalesAgentHelper.ClickElement("ClickOn2ndOpp");

                    executionLog.Log("SaleAgent1", "Click Merge Record");
                    agent_1099SalesAgentHelper.ClickElement("ClickOnMergeRecords");
                    agent_1099SalesAgentHelper.WaitForWorkAround(3000);

                    executionLog.Log("SaleAgent1", "Select Lead Company Radio Button");
                    agent_1099SalesAgentHelper.ClickElement("LeadCompyRadioBtn");
                    agent_1099SalesAgentHelper.WaitForWorkAround(1000);

                    executionLog.Log("SaleAgent1", "Click Merge Button Pop up");
                    agent_1099SalesAgentHelper.ClickElement("ClickOnMergeBtn");
                    agent_1099SalesAgentHelper.AcceptAlert();

                    executionLog.Log("SaleAgent1", "Confirmation Merge Successfull");
                    agent_1099SalesAgentHelper.WaitForText("Merging Lead(s) Completed Successfully.", 10);

                    executionLog.Log("SaleAgent1", "Redirect To leads page. ");
                    VisitOffice("leads");
                    office_LeadsHelper.WaitForWorkAround(3000);

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

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

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

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

                    executionLog.Log("SaleAgent1", "Redirect To leads recycle bin page. ");
                    VisitOffice("leads/recyclebin");
                    office_LeadsHelper.WaitForWorkAround(3000);

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

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

                    executionLog.Log("SaleAgent1", "Wait for success message.");
                    office_LeadsHelper.WaitForText("Lead Permanently Deleted.", 10);
                }

                executionLog.Log("SaleAgent1", "Goto Create Client");
                VisitOffice("clients/create");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("SaleAgent1", "Click on Save Button");
                agent_1099SalesAgentHelper.ClickElement("ClickSaveBtn");

                executionLog.Log("SaleAgent1", "Enter DBA name.");
                agent_1099SalesAgentHelper.TypeText("ClientCompDBA", FName);

                //executionLog.Log("SaleAgent1", "Enter Client Bussiness Legal Name.");
                //office_ClientsHelper.TypeText("BussinessLegalName", "LegalCli");

                executionLog.Log("SaleAgent1", "Client Status");
                agent_1099SalesAgentHelper.SelectByText("ClientStatus", "New");

                executionLog.Log("SaleAgent1", "Select Client Responsibility");
                agent_1099SalesAgentHelper.SelectByText("SelectClientResponsibility", "Aslam Sales");

                executionLog.Log("SaleAgent1", "Click on Save Button");
                agent_1099SalesAgentHelper.ClickElement("ClickSaveBtn");
                agent_1099SalesAgentHelper.WaitForWorkAround(2000);

                executionLog.Log("SaleAgent1", "Confirmation for the save");
                agent_1099SalesAgentHelper.WaitForText("Client saved successfully.", 10);

                executionLog.Log("SaleAgent1", "Visit Craete Client");
                VisitOffice("clients/create");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("SaleAgent1", "Click on Cancel");
                agent_1099SalesAgentHelper.ClickElement("CancelOpp");
                agent_1099SalesAgentHelper.WaitForWorkAround(3000);

                //executionLog.Log("SaleAgent1", "Verify text on page.");
                //agent_1099SalesAgentHelper.VerifyText("VerifyTextPresentClient", "Clients");

                executionLog.Log("SaleAgent1", "Visit Craete Client");
                VisitOffice("clients/create");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("SaleAgent1", "Click on Save");
                agent_1099SalesAgentHelper.ClickElement("ClickSaveBtn");

                executionLog.Log("SaleAgent1", "Client Company DBA Name");
                agent_1099SalesAgentHelper.TypeText("ClientCompDBA", FName);

                //executionLog.Log("SaleAgent1", "Enter Client Bussiness Legal Name.");
                //office_ClientsHelper.TypeText("BussinessLegalName", "LegalCli");

                executionLog.Log("SaleAgent1", "Select Status");
                agent_1099SalesAgentHelper.SelectByText("ClientStatus", "New");

                executionLog.Log("SaleAgent1", "Select Responsibilties");
                agent_1099SalesAgentHelper.SelectByText("SelectClientResponsibility", "Aslam Sales");

                executionLog.Log("SaleAgent1", "Click on Save");
                agent_1099SalesAgentHelper.ClickElement("ClickSaveBtn");
                agent_1099SalesAgentHelper.WaitForWorkAround(2000);

                executionLog.Log("SaleAgent1", "Wait for Confirmation");
                agent_1099SalesAgentHelper.WaitForText("Client saved successfully.", 10);

                executionLog.Log("SaleAgent1", "Visit Client");
                VisitOffice("clients");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("SaleAgent1", "Select first client.");
                agent_1099SalesAgentHelper.ClickElement("ClickOn1stOpp");

                executionLog.Log("SaleAgent1", "Select second client.");
                agent_1099SalesAgentHelper.ClickElement("ClickOn2ndOpp");

                executionLog.Log("SaleAgent1", "Click on merge records.");
                agent_1099SalesAgentHelper.ClickElement("ClickOnMergeRecords");
                agent_1099SalesAgentHelper.WaitForWorkAround(3000);

                executionLog.Log("SaleAgent1", "Radio select company to merge");
                agent_1099SalesAgentHelper.ClickElement("ClientCompToMrge");
                agent_1099SalesAgentHelper.WaitForWorkAround(1000);

                executionLog.Log("SaleAgent1", "Click On Merge");
                agent_1099SalesAgentHelper.ClickElement("ClickOnMergeBtn");
                agent_1099SalesAgentHelper.AcceptAlert();

                executionLog.Log("SaleAgent1", "Wait For Confirmation");
                agent_1099SalesAgentHelper.WaitForText("Merging Client(s) Completed Successfully.", 10);

                executionLog.Log("SaleAgent1", "Redirect To clients page. ");
                VisitOffice("clients");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("SaleAgent1", "Enter Company Name");
                office_ClientsHelper.TypeText("SearchClient", FName);
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("SaleAgent1", "Select client by check box");
                office_ClientsHelper.ClickElement("ClickOn1stOpp");
                //office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("SaleAgent1", "Click on delete client");
                office_ClientsHelper.ClickElement("DeleteClient");

                executionLog.Log("SaleAgent1", "Accept alert message.");
                office_ClientsHelper.AcceptAlert();

                executionLog.Log("SaleAgent1", "Redirect To client recycle bin page. ");
                VisitOffice("clients/recyclebin");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("SaleAgent1", "Enter Company Name");
                office_ClientsHelper.TypeText("SearchClient", FName);
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("SaleAgent1", "Click on delete client");
                office_ClientsHelper.ClickElement("DeleteRbin");

                executionLog.Log("SaleAgent1", "Accept alert message.");
                office_ClientsHelper.AcceptAlert();

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

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("SaleAgent1");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("SaleAgent1");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("SaleAgent1", "Bug", "Medium", "Client/Laead Page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("SaleAgent1");
                        TakeScreenshot("SaleAgent1");
                        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("SaleAgent1");
                        string id            = loginHelper.getIssueID("SaleAgent1");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\SaleAgent1.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("SaleAgent1"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("SaleAgent1");
                //  executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("SaleAgent1");
                executionLog.WriteInExcel("SaleAgent1", Status, JIRA, "SaleAgent Portal");
            }
        }
Пример #7
0
        public void salesAgentsAdvanceFilterResultsPP()
        {
            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_1099SalesAgentHelper = new Agent_1099SalesAgentHelper(GetWebDriver());

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

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

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

                executionLog.Log("SalesAgentsAdvanceFilterResultsPP", "Redirect at employee page.");
                VisitOffice("sales_agents");
                agent_1099SalesAgentHelper.WaitForWorkAround(3000);

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

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

                executionLog.Log("SalesAgentsAdvanceFilterResultsPP", "Click on Apply button.");
                agent_1099SalesAgentHelper.ClickElement("ApplyButton");
                agent_1099SalesAgentHelper.WaitForWorkAround(3000);
                agent_1099SalesAgentHelper.WaitForElementPresent("BottomResults", 05);

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

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

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

                executionLog.Log("SalesAgentsAdvanceFilterResultsPP", "Click on Apply button.");
                agent_1099SalesAgentHelper.ClickElement("ApplyButton");
                agent_1099SalesAgentHelper.WaitForWorkAround(3000);
                agent_1099SalesAgentHelper.WaitForElementPresent("BottomResults", 05);

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

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

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

                executionLog.Log("SalesAgentsAdvanceFilterResultsPP", "Click on ApplyButton button.");
                agent_1099SalesAgentHelper.ClickElement("ApplyButton");
                agent_1099SalesAgentHelper.WaitForWorkAround(3000);
                agent_1099SalesAgentHelper.WaitForElementPresent("BottomResults", 05);

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

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

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

                executionLog.Log("SalesAgentsAdvanceFilterResultsPP", "Click on ApplyButton button.");
                agent_1099SalesAgentHelper.ClickElement("ApplyButton");
                agent_1099SalesAgentHelper.WaitForWorkAround(3000);
                agent_1099SalesAgentHelper.WaitForElementPresent("BottomResults", 05);

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

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

            var oXMLData = new XMLParse();

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            var oXMLData = new XMLParse();

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

            var oXMLData = new XMLParse();

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

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

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

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

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

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

                executionLog.Log("SaleAgentURLChange", "Redirect To Sale Agent");
                VisitOffice("sales_agents");

                executionLog.Log("SaleAgentURLChange", "Click on Any Sale Agent");
                agent_1099SaleAagentHelper.ClickElement("ClickOnAgent1099");

                executionLog.Log("SaleAgentURLChange", "Change Url Number");
                VisitOffice("sales_agents/view/178");
                agent_1099SaleAagentHelper.WaitForWorkAround(4000);

                executionLog.Log("SaleAgentURLChange", "Verify Validation");
                agent_1099SaleAagentHelper.WaitForText("You don't have privilege.", 05);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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