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

            var oXMLData = new XMLParse();

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

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

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

            // Variable
            var    FirstName = "Test" + RandomNumber(1111, 99999);
            var    Company   = "Lead COmp" + RandomNumber(221212, 999999);
            String JIRA      = "";
            String Status    = "Pass";

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

                executionLog.Log("LeadeAddressLabelAutoUpdate", "Verify Page title");
                VerifyTitle("Dashboard");
                office_LeadsHelper.WaitForWorkAround(5000);

                executionLog.Log("LeadeAddressLabelAutoUpdate", "Visit Lead");
                VisitOffice("leads");
                office_LeadsHelper.WaitForWorkAround(5000);

                executionLog.Log("LeadeAddressLabelAutoUpdate", "Open any lead.");
                office_LeadsHelper.ClickElement("Lead1");
                office_LeadsHelper.WaitForWorkAround(5000);

                executionLog.Log("LeadeAddressLabelAutoUpdate", "Click on Company detail");
                office_LeadsHelper.ClickElement("CompanyDetails");
                office_LeadsHelper.WaitForWorkAround(5000);

                executionLog.Log("LeadeAddressLabelAutoUpdate", "Select eAddress Type as IM.");
                office_LeadsHelper.SelectByText("eAddressType", "IM");

                executionLog.Log("LeadeAddressLabelAutoUpdate", "Click on Save button.");
                office_LeadsHelper.ClickElement("SaveLeadButton");

                executionLog.Log("LeadeAddressLabelAutoUpdate", "Verify selected eAddress type is IM");
                office_LeadsHelper.VerifySelectedOption("//*[@id='LeadElectronicAddress0ElectronicContentType']", "IM");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            var oXMLData = new XMLParse();

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

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

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

            // Variable

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

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

                executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Verify Page title");
                VerifyTitle("Dashboard");
                Console.WriteLine("Redirected at Dashboard screen.");
                office_LeadsHelper.WaitForWorkAround(6000);

                executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Goto Leads page.");
                VisitOffice("leads");
                office_LeadsHelper.WaitForWorkAround(6000);

                executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Open Advance filter.");
                office_LeadsHelper.ClickElement("AdvanceFilter");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Select Result Page per 10.");
                office_LeadsHelper.SelectByText("ResultsPerPage", "10");

                executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Click on apply button.");
                office_LeadsHelper.ClickJS("Apply");

                executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Open Advance filter.");
                office_LeadsHelper.ClickElement("AdvanceFilter");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Open Reset button.");
                office_LeadsHelper.ClickElement("ResetAdvFilter");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Open Advance filter.");
                office_LeadsHelper.ClickElement("AdvanceFilter");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Verify default value 100 in Result Per page dropdown.");
                office_LeadsHelper.VerifySelectedOption("//*[@id='pageresults']", "100");
            }


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

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("verifyDefaultValueOfPerPageDropdown");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("verify Default Value Of PerPageDropdown");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("verify Default Value Of PerPage Dropdown", "Bug", "Medium", "Amex page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("verify Default Value Of PerPage Dropdown");
                        TakeScreenshot("verifyDefaultValueOfPerPageDropdown");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\verifyDefaultValueOfPerPageDropdown.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("verifyDefaultValueOfPerPageDropdown");
                        string id            = loginHelper.getIssueID("verify Default Value Of Per Page Dropdown");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\verifyDefaultValueOfPerPageDropdown.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("verify Default Value Of PerPage Dropdown"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("verify Default Value Of Per Page Dropdown");
                // executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("verify Default Value Of PerPage Dropdown");
                executionLog.WriteInExcel("verify Default Value Of Per Page Dropdown", Status, JIRA, "Office Lead");
            }
        }