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

            var oXMLData = new XMLParse();

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

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

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

            // 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("VerifyingIssuesOnPartnerAssoPage", "Login with valid credentials");
                Login("aslamassociate", "123456");
                Console.WriteLine("Logged in as: aslamassociate / 123456");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Redirect to All leads");
                office_LeadsHelper.ClickElement("LeadTab");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Click on create button.");
                office_LeadsHelper.ClickElement("CreateIcon");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Verify page title.");
                VerifyTitle("Create a Lead");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Enter First Name");
                office_LeadsHelper.TypeText("FirstNameLead", FName);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Enter Last Name");
                office_LeadsHelper.TypeText("LastName", LName);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Enter Company DBA");
                office_LeadsHelper.TypeText("CompanyName", CDBA);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Click on Assignments");
                office_LeadsHelper.ClickElement("Assignments");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Wait for element to be visible.");
                office_LeadsHelper.WaitForElementPresent("LeadStatus", 10);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Select Status");
                office_LeadsHelper.SelectByText("LeadStatus", "New");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Select Responsibilities");
                office_LeadsHelper.SelectByText("Responsibility", "Howard Tang");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Select source.");
                office_LeadsHelper.SelectByText("SelectSource", "Email");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Enter Zip code");
                office_LeadsHelper.TypeText("LeadZip", "60601");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Enter address line1");
                office_LeadsHelper.TypeText("AddressLine1", "test line 1");
                //office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Enter address line2");
                office_LeadsHelper.TypeText("AddressLine2", "line 2");
                //office_LeadsHelper.WaitForWorkAround(3000);

                //executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Wait for locator to be present.");
                //office_LeadsHelper.IsElementVisible("//*[@id='LeadDetailSameAsLocation']");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Click on same as location checkbox.");
                office_LeadsHelper.Click("//*[@id='LeadDetailSameAsLocation']");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Click on Save");
                office_LeadsHelper.ClickElement("SaveLeadNewSkin");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Wait for creation success text.");
                office_LeadsHelper.WaitForText("Lead saved successfully.", 10);
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Search lead usnig company name.");
                office_LeadsHelper.TypeText("CompanySearch", CDBA);
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Click on edit icon to edit lead.");
                office_LeadsHelper.ClickElement("EditLeadPartner");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Verify page title as edit a lead");
                VerifyTitle("Edit a Lead");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Verify mailing address line 1 address copied.");
                office_LeadsHelper.verifyAddress1();
                //office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Verify mailing line 2 copied address.");
                office_LeadsHelper.verifyAddress2();
                //office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Click on Save");
                office_LeadsHelper.ClickElement("SaveLeadNewSkin");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Wait for updation success text.");
                office_LeadsHelper.WaitForText("Lead updated successfully.", 10);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Verify Lead created by credits.");
                office_LeadsHelper.VerifyText("CreatedBy", "Aslam Associate");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Verify Lead modified by credits");
                office_LeadsHelper.VerifyText("ModifiedBy", "Aslam Associate");

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

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

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Verify page Tilte");
                VerifyTitle("Dashboard");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Redirect at leads page.");
                VisitOffice("leads");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Verify page titles.");
                VerifyTitle("Leads");

                //executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Login with valid credential  Username");
                //office_LeadsHelper.WaitForElementPresent("CheckDocToDel", 10);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Search lead");
                office_LeadsHelper.TypeText("SearchCompany", CDBA);
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Select first lead");
                office_LeadsHelper.ClickElement("CheckDocToDel");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Click on delete button.");
                office_LeadsHelper.ClickElement("DeleteLead");
                office_LeadsHelper.AcceptAlert();

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

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Redirect at leads recycle bin page.");
                VisitOffice("leads/recyclebin");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Verify page title.");
                VerifyTitle("Recycled Leads");

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Click on delete icon");
                office_LeadsHelper.ClickElement("DeleteLeadPer");
                office_LeadsHelper.AcceptAlert();

                executionLog.Log("VerifyingIssuesOnPartnerAssoPage", "Wait for confirmation.");
                office_LeadsHelper.WaitForText("Lead Permanently Deleted.", 10);

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

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

            // VARIABLE
            var    CDBA   = "Client" + RandomNumber(3323, 99999);
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("AddressStateIssues", "ClickOnCreateClient");
                VisitOffice("clients/create");

                executionLog.Log("AddressStateIssues", "Enter Client Dba Name");
                office_ClientsHelper.TypeText("ClientDBAName", CDBA);

                executionLog.Log("AddressStateIssues", "Select client status");
                office_ClientsHelper.SelectByText("ClientStatus", "New");

                executionLog.Log("AddressStateIssues", "Select Client Res[onsibility.");
                office_ClientsHelper.SelectByText("ClientResponsibility", "Howard Tang");

                executionLog.Log("AddressStateIssues", "Click on next button");
                office_ClientsHelper.ClickElement("Next");
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("AddressStateIssues", "Wait for confirmation message.");
                office_ClientsHelper.WaitForText("Client saved successfully. ", 10);

                executionLog.Log("AddressStateIssues", "ClickOnContactTab");
                office_ClientsHelper.ClickElement("ClickOnContactTab");
                office_ClientsHelper.WaitForWorkAround(1000);

                executionLog.Log("AddressStateIssues", "Select Mailing Country");
                office_ClientsHelper.Select("ContactCountry", "Canada");
                office_ClientsHelper.WaitForWorkAround(4000);

                executionLog.Log("AddressStateIssues", "SelectComapnyState");
                office_ClientsHelper.Select("ContactState", "AB");
                office_ClientsHelper.WaitForWorkAround(4000);

                executionLog.Log("AddressStateIssues", "Redirect at clients page.");
                VisitOffice("clients");

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

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

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

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

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

                executionLog.Log("AddressStateIssues", "Redirect To client recycle bin page. ");
                VisitOffice("clients/recyclebin");

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

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

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

                executionLog.Log("AddressStateIssues", "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("AddressStateIssues");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Address State Issues");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Address State Issues", "Bug", "Medium", "Create Client page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Address State Issues");
                        TakeScreenshot("AddressStateIssues");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\AddressStateIssues.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("AddressStateIssues");
                        string id            = loginHelper.getIssueID("Address State Issues");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\AddressStateIssues.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Address State Issues"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Address State Issues");
                //    executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("AddressStateIssues");
                executionLog.WriteInExcel("Address State Issues", Status, JIRA, "Leads Management");
            }
        }
        public void activitiesMeetingsManagement()
        {
            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 officeActivities_MeetingHelper = new OfficeActivities_MeetingHelper(GetWebDriver());
            var office_ClientsHelper           = new Office_ClientsHelper(GetWebDriver());
            var office_LeadsHelper             = new Office_LeadsHelper(GetWebDriver());
            var office_OpportunitiesHelper     = new Office_OpportunitiesHelper(GetWebDriver());
            var ticket_CreateATicketHelper     = new OfficeTickets_CreateTicketsHelper(GetWebDriver());

            // Random Variables.
            var    Subject = "Meeting" + GetRandomNumber();
            var    file    = GetPathToFile() + "2.pdf";
            String JIRA    = "";
            String Status  = "Pass";

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

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

                executionLog.Log("ActivitiesMeetingsManagement", "Go to create meetings page");
                VisitOffice("meetings/create");
                officeActivities_MeetingHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesMeetingsManagement", "Verify page title.");
                VerifyTitle("Create a Meeting");

                executionLog.Log("ActivitiesMeetingsManagement", "Click On Save button");
                officeActivities_MeetingHelper.ClickElement("Save");

                executionLog.Log("ActivitiesMeetingsManagement", "Verify validation text for mandatoryness.");
                officeActivities_MeetingHelper.VerifyText("NameError", "This field is required.");

                executionLog.Log("ActivitiesMeetingsManagement", "Verify validation text for mandatoryness.");
                officeActivities_MeetingHelper.VerifyText("StartDateError", "This field is required.");

                executionLog.Log("ActivitiesMeetingsManagement", "Verify validation text for mandatoryness.");
                officeActivities_MeetingHelper.VerifyText("ParentError", "This field is required.");

                executionLog.Log("ActivitiesMeetingsManagement", "Enter Subject for the meeting");
                officeActivities_MeetingHelper.TypeText("Subject", Subject);

                executionLog.Log("ActivitiesMeetingsManagement", "Enter location of meeting.");
                officeActivities_MeetingHelper.TypeText("Location", "Test Location");

                executionLog.Log("ActivitiesMeetingsManagement", "Enter start date.");
                officeActivities_MeetingHelper.TypeText("StartDate", "12/30/2016");

                executionLog.Log("ActivitiesMeetingsManagement", "Enter End Date.");
                officeActivities_MeetingHelper.TypeText("EndDate", "12/22/2016");

                executionLog.Log("ActivitiesMeetingsManagement", "Select Related To");
                officeActivities_MeetingHelper.SelectByText("RelatedTo", "Client");

                executionLog.Log("ActivitiesMeetingsManagement", "Click On find list icon");
                officeActivities_MeetingHelper.ClickElement("FindListIcon");
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click on client for which meeting is created.");
                officeActivities_MeetingHelper.ClickElement("ClickOnClientMeeting");
                officeActivities_MeetingHelper.WaitForWorkAround(1000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click On Save button");
                officeActivities_MeetingHelper.ClickElement("Save");

                executionLog.Log("ActivitiesMeetingsManagement", "Click On Save button");
                officeActivities_MeetingHelper.VerifyAlertText("Start Date & Time should lesser than or equal to Due Date & Time.");
                officeActivities_MeetingHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click On Save button");
                officeActivities_MeetingHelper.AcceptAlert();

                executionLog.Log("ActivitiesMeetingsManagement", "Enter start date");
                officeActivities_MeetingHelper.TypeText("StartDate", "12/22/2016");

                executionLog.Log("ActivitiesMeetingsManagement", "Enter End Date.");
                officeActivities_MeetingHelper.TypeText("EndDate", "12/30/2016");

                executionLog.Log("ActivitiesMeetingsManagement", "Click On Save button");
                officeActivities_MeetingHelper.ClickElement("Save");

                executionLog.Log("ActivitiesMeetingsManagement", "verify page text");
                officeActivities_MeetingHelper.WaitForText("Meeting saved successfully.", 10);

                executionLog.Log("ActivitiesMeetingsManagement", "Redirect at clients page.");
                VisitOffice("clients");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click on any client.");
                office_ClientsHelper.ClickElement("Client1");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesMeetingsManagement", "Select actitivity type as meetings.");
                office_ClientsHelper.Select("SelectActivityType", "Meetings");
                office_ClientsHelper.WaitForWorkAround(1000);

                executionLog.Log("ActivitiesMeetingsManagement", "Enter ticket name to be search.");
                office_ClientsHelper.TypeText("ActivitySubject", Subject);
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesMeetingsManagement", "Verify created meeting present on client page.");
                office_ClientsHelper.IsElementPresent("OpenFirstActivity");

                executionLog.Log("ActivitiesMeetingsManagement", "Redirect at meetings page.");
                VisitOffice("meetings");
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesMeetingsManagement", "Search meeting by subject");
                officeActivities_MeetingHelper.TypeText("SearchSubject", Subject);
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesMeetingsManagement", "select all in  owner fiedld");
                officeActivities_MeetingHelper.SelectByText("Owner", "All");
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click on Edit");
                officeActivities_MeetingHelper.ClickElement("Edit");
                officeActivities_MeetingHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesMeetingsManagement", "Verify page title.");
                VerifyTitle("Edit Meeting");

                executionLog.Log("ActivitiesMeetingsManagement", "Select meeting parent as lead");
                officeActivities_MeetingHelper.SelectByText("RelatedTo", "Lead");
                officeActivities_MeetingHelper.WaitForWorkAround(1000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click On find list icon");
                officeActivities_MeetingHelper.ClickElement("FindListIcon");
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click on lead for which meeting is created.");
                officeActivities_MeetingHelper.ClickElement("ClickOnClientMeeting");
                officeActivities_MeetingHelper.WaitForWorkAround(1000);

                executionLog.Log("ActivitiesMeetingsManagement", "Edit end Date");
                officeActivities_MeetingHelper.TypeText("EndDate", "1/1/2017");

                executionLog.Log("ActivitiesMeetingsManagement", "Click On Save button");
                officeActivities_MeetingHelper.ClickElement("Save");

                executionLog.Log("ActivitiesMeetingsManagement", "Wait for updation success.");
                officeActivities_MeetingHelper.WaitForText("Meeting updated successfully.", 10);

                executionLog.Log("ActivitiesMeetingsManagement", "Redirect at leads page.");
                VisitOffice("leads");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click On any lead.");
                office_LeadsHelper.ClickElement("ClickAnyLead");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesMeetingsManagement", "Select actitivity type as meetings.");
                office_LeadsHelper.Select("SelectActivityType", "Meetings");
                office_LeadsHelper.WaitForWorkAround(1000);

                executionLog.Log("ActivitiesMeetingsManagement", "Enter meeting name to be search.");
                office_LeadsHelper.TypeText("ActivitySubject", Subject);
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesMeetingsManagement", "Verify created meeting present on leads page.");
                office_LeadsHelper.IsElementPresent("ClickNotes1");

                executionLog.Log("ActivitiesMeetingsManagement", "Redirect at meetings page.");
                VisitOffice("meetings");
                officeActivities_MeetingHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesMeetingsManagement", "Search meeting by subject");
                officeActivities_MeetingHelper.TypeText("SearchSubject", Subject);
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesMeetingsManagement", "select all in  owner fiedld");
                officeActivities_MeetingHelper.SelectByText("Owner", "All");
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click on Edit");
                officeActivities_MeetingHelper.ClickElement("Edit");
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesMeetingsManagement", "Verify page title.");
                VerifyTitle("Edit Meeting");

                executionLog.Log("ActivitiesMeetingsManagement", "Select parent type to opportunity");
                officeActivities_MeetingHelper.SelectByText("RelatedTo", "Opportunity");
                officeActivities_MeetingHelper.WaitForWorkAround(1000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click On find list icon");
                officeActivities_MeetingHelper.ClickElement("FindListIcon");
                officeActivities_MeetingHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click on opportunity for which meeting is created.");
                officeActivities_MeetingHelper.ClickElement("ClickOnClientMeeting");
                officeActivities_MeetingHelper.WaitForWorkAround(1000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click On Save button");
                officeActivities_MeetingHelper.ClickElement("Save");

                executionLog.Log("ActivitiesMeetingsManagement", "Wait for updation success message.");
                officeActivities_MeetingHelper.WaitForText("Meeting updated successfully.", 10);

                executionLog.Log("ActivitiesMeetingsManagement", "Redirect at opportunities page.");
                VisitOffice("opportunities");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click On any opportunity.");
                office_OpportunitiesHelper.ClickElement("Opportunities1");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesMeetingsManagement", "Select actitivity type as meetings");
                office_LeadsHelper.Select("SelectActivityType", "Meetings");
                office_OpportunitiesHelper.WaitForWorkAround(1000);

                executionLog.Log("ActivitiesMeetingsManagement", "Enter meeting name to be search.");
                office_OpportunitiesHelper.TypeText("ActivitySubject", Subject);
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesMeetingsManagement", "Verify created opportunity present on opportunity page");
                office_OpportunitiesHelper.IsElementPresent("OpenOpportunity");

                executionLog.Log("ActivitiesMeetingsManagement", "Redirect at meetings page.");
                VisitOffice("meetings");
                officeActivities_MeetingHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesMeetingsManagement", "Search meeting by subject");
                officeActivities_MeetingHelper.TypeText("SearchSubject", Subject);
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesMeetingsManagement", "select all in  owner fiedld");
                officeActivities_MeetingHelper.SelectByText("Owner", "All");
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click on Edit");
                officeActivities_MeetingHelper.ClickElement("Edit");
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesMeetingsManagement", "Verify page title.");
                VerifyTitle("Edit Meeting");

                executionLog.Log("ActivitiesMeetingsManagement", "Select parent type for meeting.");
                officeActivities_MeetingHelper.SelectByText("RelatedTo", "Ticket");
                officeActivities_MeetingHelper.WaitForWorkAround(1000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click On find list icon");
                officeActivities_MeetingHelper.ClickElement("FindListIcon");
                officeActivities_MeetingHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click on ticket for which meeting is created.");
                officeActivities_MeetingHelper.ClickElement("ClickOnClientMeeting");
                officeActivities_MeetingHelper.WaitForWorkAround(1000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click On Save button");
                officeActivities_MeetingHelper.ClickElement("Save");

                executionLog.Log("ActivitiesMeetingsManagement", "Wait for success message.");
                officeActivities_MeetingHelper.WaitForText("Meeting updated successfully.", 10);

                executionLog.Log("ActivitiesMeetingsManagement", "Redirect at tickets page.");
                VisitOffice("tickets");

                executionLog.Log("ActivitiesMeetingsManagement", "Click On any ticket.");
                ticket_CreateATicketHelper.ClickElement("Ticket1");

                executionLog.Log("ActivitiesMeetingsManagement", "Select actitivity type as meetings");
                office_LeadsHelper.Select("SelectActivityType", "Meetings");

                executionLog.Log("ActivitiesMeetingsManagement", "Enter ticket name to be search.");
                office_OpportunitiesHelper.TypeText("ActivitySubject", Subject);
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click on ticket to view details");
                ticket_CreateATicketHelper.IsElementPresent("OpenTicket");

                executionLog.Log("ActivitiesMeetingsManagement", "Redirect at meetings page.");
                VisitOffice("meetings");

                executionLog.Log("ActivitiesMeetingsManagement", "Search meeting by subject");
                officeActivities_MeetingHelper.TypeText("SearchSubject", Subject);
                officeActivities_MeetingHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesMeetingsManagement", "select all in  owner fiedld");
                officeActivities_MeetingHelper.SelectByText("Owner", "All");
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click on the meeting");
                officeActivities_MeetingHelper.ClickElement("ClickOnAnyMeeting");

                executionLog.Log("ActivitiesMeetingsManagement", "Click On Cance meeting.");
                officeActivities_MeetingHelper.ClickElement("CancelMeeting");
                officeActivities_MeetingHelper.AcceptAlert();

                executionLog.Log("ActivitiesMeetingsManagement", "Redirect at recycle bin.");
                VisitOffice("meetings/recyclebin");

                executionLog.Log("ActivitiesMeetingsManagement", "Verify page title");
                VerifyTitle("Recycled Meeting");

                executionLog.Log("ActivitiesMeetingsManagement", "Search meeting by name.");
                officeActivities_MeetingHelper.TypeText("SearchSubject", Subject);
                officeActivities_MeetingHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesMeetingsManagement", "select all in  owner fiedld");
                officeActivities_MeetingHelper.SelectByText("OwnerField", "All");
                officeActivities_MeetingHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesMeetingsManagement", "Wait for delete icon to be present.");
                officeActivities_MeetingHelper.WaitForElementPresent("DeleteMeetingPermanently", 10);

                executionLog.Log("ActivitiesMeetingsManagement", "Click On delete icon");
                officeActivities_MeetingHelper.ClickElement("DeleteMeetingPermanently");

                executionLog.Log("ActivitiesMeetingsManagement", "Accept alert message.");
                officeActivities_MeetingHelper.AcceptAlert();

                executionLog.Log("ActivitiesMeetingsManagement", "Verify text.");
                officeActivities_MeetingHelper.WaitForText("Meeting Permanently Deleted.", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("ActivitiesMeetingsManagement");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Activities Meetings Management");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Activities Meetings Management", "Bug", "Medium", "Meeting page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Activities Meetings Management");
                        TakeScreenshot("ActivitiesMeetingsManagement");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\ActivitiesMeetingsManagement.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("ActivitiesMeetingsManagement");
                        string id            = loginHelper.getIssueID("Activities Meetings Management");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\ActivitiesMeetingsManagement.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Activities Meetings Management"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Activities Meetings Management");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("ActivitiesMeetingsManagement");
                executionLog.WriteInExcel("Activities Meetings Management", Status, JIRA, "Office Activities");
            }
        }
示例#4
0
        public void showMeetingOnCalender()
        {
            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    Path   = GetPathToFile() + "1.pdf";
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("ShowMeetingOnCalender", "Click on Clients in Topmenu");
                VisitOffice("leads");

                executionLog.Log("ShowMeetingOnCalender", "Click On Opp Check Box");
                office_LeadsHelper.ClickElement("ClickAnyLead");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("ShowMeetingOnCalender", "Click on Email");
                office_LeadsHelper.ClickElement("ClickOnAddMeeting");

                executionLog.Log("SendEmailNoteMultipleCC", "Wait for element to present.");
                office_LeadsHelper.WaitForElementPresent("EnterSubjectMeeting", 20);

                executionLog.Log("ShowMeetingOnCalender", "Enter meeting subject");
                office_LeadsHelper.TypeText("EnterSubjectMeeting", "Test Meeting");

                executionLog.Log("ShowMeetingOnCalender", "Click On Start Date");
                office_LeadsHelper.ClickElement("ClickOnStartDate");

                executionLog.Log("ShowMeetingOnCalender", "Click On Start Date");
                office_LeadsHelper.ClickElement("SelectDate");
                office_LeadsHelper.WaitForWorkAround(1000);

                executionLog.Log("ShowMeetingOnCalender", "Upload file");
                office_LeadsHelper.UploadFile("//*[@id='DocumentFile']", Path);
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("ShowMeetingOnCalender", "Click on Send Email button");
                office_LeadsHelper.ClickElement("ClickOnSaveMeeting");

                executionLog.Log("ShowMeetingOnCalender", "Wait for success message.");
                office_LeadsHelper.WaitForText("Meeting saved successfully.", 10);

                executionLog.Log("ShowMeetingOnCalender", "Select Activity type as meeting");
                office_LeadsHelper.Select("SelectActivityType", "Meetings");

                executionLog.Log("ShowMeetingOnCalender", "Click on meeting");
                office_LeadsHelper.PressEnter("ClickNotes1");

                executionLog.Log("ShowMeetingOnCalender", "Click on cancel meeting button");
                office_LeadsHelper.ClickElement("CancelMeeting");

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

                executionLog.Log("ShowMeetingOnCalender", "Wait for success message.");
                office_LeadsHelper.WaitForText("Meeting successfully deleted.", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            var oXMLData = new XMLParse();

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

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

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

            // Variable
            var    name   = "Lead" + RandomNumber(99, 99999);
            var    CDBA   = "DBA" + RandomNumber(99, 99999);
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("VerifyQuickLookLabelsForLeads", "Redirect at Create Lead");
                VisitOffice("leads/create");

                executionLog.Log("VerifyQuickLookLabelsForLeads", "Click on Save");
                office_LeadsHelper.ClickElement("SaveLeadNewSkin");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForLeads", "Enter First Name");
                office_LeadsHelper.TypeText("FirstNameLead", "LeadFirst");

                executionLog.Log("VerifyQuickLookLabelsForLeads", "Enter Last Name");
                office_LeadsHelper.TypeText("LeadLastName", "LeadLast");

                executionLog.Log("VerifyQuickLookLabelsForLeads", "Enter Lead Company DBA Name");
                office_LeadsHelper.TypeText("CompanyName", CDBA);

                executionLog.Log("VerifyQuickLookLabelsForLeads", "Wait for element to be visible.");
                office_LeadsHelper.WaitForElementPresent("LeadStatus", 10);

                executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Lead Status");
                office_LeadsHelper.SelectByText("LeadStatus", "New");

                executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Responsibilities");
                office_LeadsHelper.SelectByText("Responsibility", "Howard Tang");

                executionLog.Log("VerifyQuickLookLabelsForLeads", "Click on Save");
                office_LeadsHelper.ClickElement("SaveLeadNewSkin");
                office_LeadsHelper.WaitForWorkAround(7000);


                var loc = "//h3[text()='Existing Leads']";
                if (office_LeadsHelper.IsElementPresent(loc))
                {
                    Console.WriteLine("We are in first If cond as lead is duplicate !!");
                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Click on Duplicate");
                    office_LeadsHelper.ClickJS("CraeteLeadDub");
                    office_LeadsHelper.WaitForText("Lead saved successfully.", 10);
                }
                else
                {
                    Console.WriteLine("We are in first else cond as lead is not duplicate !!");
                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Wait for Confirmation");
                    office_LeadsHelper.WaitForText("Lead saved successfully.", 10);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for Leads type.");
                    office_LeadsHelper.VerifyText("ClientType", "Click to edit");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for status.");
                    office_LeadsHelper.VerifyText("Status", "New");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for source.");
                    office_LeadsHelper.VerifyText("Source", "Select");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for category");
                    office_LeadsHelper.VerifyText("Category", "Click to edit");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for responsibility");
                    office_LeadsHelper.VerifyText("Responsibilityl", "Howard Tang");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for account manager.");
                    office_LeadsHelper.VerifyText("AccountManager", "Select");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for partner agent.");
                    office_LeadsHelper.VerifyText("PartnerAgentl", "Select");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Save Button");
                    office_LeadsHelper.VerifyText("PartnerAssociationl", "Select");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Save Button");
                    office_LeadsHelper.VerifyText("SalesManager", "Select");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Click on company details tab.");
                    office_LeadsHelper.ClickElement("CompanyDetails");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Click on assignments.");
                    office_LeadsHelper.ClickElement("EditAssignment");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Wait for locator to be present.");
                    office_LeadsHelper.WaitForElementPresent("Clientt", 10);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Leads type.");
                    office_LeadsHelper.Select("Clientt", "Processing");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Leads refferal source.");
                    office_LeadsHelper.Select("SelectSource", "Campaign");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Leads category.");
                    office_LeadsHelper.SelectByText("SelectCat", "test");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select account manager.");
                    office_LeadsHelper.SelectByText("SelectAcc.Mgr", "Howard Tang");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Leads user group.");
                    office_LeadsHelper.Select("Ugroup", "81");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select sales manager.");
                    office_LeadsHelper.SelectByText("SelectSaleManager", "Howard Tang");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Leads responsibility");
                    office_LeadsHelper.SelectByText("Responsibility", "Howard Tang");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select partner agent.");
                    office_LeadsHelper.SelectByText("PartnerAgent", "Mark Matthews");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select partner association.");
                    office_LeadsHelper.SelectByText("PartnerAssociation", "AslamP.Association.");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "click on save Leads");
                    office_LeadsHelper.ClickElement("SaveLead");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "click on info tab.");
                    office_LeadsHelper.ClickElement("InfoTab");

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Wait for locator to be present.");
                    office_LeadsHelper.WaitForElementPresent("ClientsType", 10);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for Leads type.");
                    office_LeadsHelper.VerifyText("ClientsType", "Processing");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for status.");
                    office_LeadsHelper.VerifyText("Status", "New");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for source.");
                    office_LeadsHelper.VerifyText("Source", "Campaign");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for category.");
                    office_LeadsHelper.VerifyText("Category", "test");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for responsibility.");
                    office_LeadsHelper.VerifyText("Responsibilityl", "Howard Tang");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for account manager.");
                    office_LeadsHelper.VerifyText("AccountManager", "Howard Tang");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for partner agent.");
                    office_LeadsHelper.VerifyText("PartnerAgentl", "Mark Matthews");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for partner association.");
                    office_LeadsHelper.VerifyText("PartnerAssociationl", "AslamP.Association.");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for partner association.");
                    office_LeadsHelper.VerifyText("SalesManager", "Howard Tang");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Redirect To leads page. ");
                    VisitOffice("leads");

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Enter Company Name");
                    office_LeadsHelper.TypeText("CompanySearch", CDBA);
                    office_LeadsHelper.WaitForWorkAround(2000);

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

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

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

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

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Redirect To leads recycle bin page. ");
                    VisitOffice("leads/recyclebin");

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Enter Company Name");
                    office_LeadsHelper.TypeText("SearchLeadRbin", CDBA);
                    office_LeadsHelper.WaitForWorkAround(2000);

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

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

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

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

            var oXMLData = new XMLParse();

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

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

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

            // 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("PartAgentLeadsCreditsIssue", "Login with valid credential  Username");
                Login(username[0], password[0]);
                Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]);
                //office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("PartAgentLeadsCreditsIssue", "Redirect to Create Lead page.");
                VisitOffice("leads/create");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("PartAgentLeadsCreditsIssue", "Verify page title.");
                VerifyTitle("Create a Lead");

                executionLog.Log("PartAgentLeadsCreditsIssue", "Enter First Name");
                office_LeadsHelper.TypeText("FirstNameLead", FName);

                executionLog.Log("PartAgentLeadsCreditsIssue", "Enter Last Name");
                office_LeadsHelper.TypeText("LastName", LName);

                executionLog.Log("PartAgentLeadsCreditsIssue", "Enter Company DBA");
                office_LeadsHelper.TypeText("CompanyName", CDBA);

                executionLog.Log("PartAgentLeadsCreditsIssue", "Select Status");
                office_LeadsHelper.SelectByText("LeadStatus", "New");

                executionLog.Log("PartAgentLeadsCreditsIssue", "Select lead Responsibility");
                office_LeadsHelper.SelectByText("Responsibility", "Howard Tang");

                executionLog.Log("PartAgentLeadsCreditsIssue", "Click on Save");
                office_LeadsHelper.ClickElement("SaveLeadNewSkin");

                executionLog.Log("PartAgentLeadsCreditsIssue", "Wait for creation success text.");
                office_LeadsHelper.WaitForText("Lead saved successfully.", 10);

                executionLog.Log("PartAgentLeadsCreditsIssue", "Verify Lead created by credits.");
                office_LeadsHelper.VerifyText("CreatedBy", "Howard Tang");

                executionLog.Log("PartAgentLeadsCreditsIssue", "Verify Lead modified by credits");
                office_LeadsHelper.VerifyText("ModifiedBy", "Howard Tang");

                VisitOffice("leads");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("PartAgentLeadsCreditsIssue", "Select first lead");
                office_LeadsHelper.ClickElement("CheckDocToDel");

                executionLog.Log("PartAgentLeadsCreditsIssue", "Click on delete button.");
                office_LeadsHelper.ClickElement("DeleteLead");
                office_LeadsHelper.AcceptAlert();

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

                executionLog.Log("PartAgentLeadsCreditsIssue", "Redirect at leads recycle bin page.");
                VisitOffice("leads/recyclebin");

                executionLog.Log("PartAgentLeadsCreditsIssue", "Verify page title.");
                VerifyTitle("Recycled Leads");

                executionLog.Log("PartAgentLeadsCreditsIssue", "Click on delete icon");
                office_LeadsHelper.ClickElement("DeleteLeadPer");
                office_LeadsHelper.AcceptAlert();

                executionLog.Log("PartAgentLeadsCreditsIssue", "Wait for confirmation.");
                office_LeadsHelper.WaitForText("Lead Permanently Deleted.", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            // Variable
            var Subject   = "Subject" + RandomNumber(1, 999);
            var FirstName = "LeadQA" + RandomNumber(1, 50);

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

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

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

                executionLog.Log("LeadsNotesUrlChange", "Go to All Leads");
                VisitOffice("leads");
                office_LeadsHelper.WaitForWorkAround(3000);

                //office_LeadsHelper.TypeText("SearchLName", "Aslam Lead");
                //office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsNotesUrlChange", "Click On Advanced Filter");
                office_LeadsHelper.ClickElement("AdvanceFilter");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsNotesUrlChange", "Click On Show Activities");
                office_LeadsHelper.ClickElement("ShowActivities");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsNotesUrlChange", "Click On Client with notes");
                office_LeadsHelper.ClickElement("LeadWithNote");
                //office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsNotesUrlChange", "Click On Apply Filter");
                office_LeadsHelper.ClickElement("Apply");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsNotesUrlChange", "Click On Any Lead");
                office_LeadsHelper.ClickElement("ClickAnyLead");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsNotesUrlChange", "Select Activity >> Notes");
                office_LeadsHelper.Select("SelectActivityType", "Notes");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsNotesUrlChange", "select all in created by field");
                officeActivities_NotesHelper.SelectByText("CreatedbyField", "All");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsNotesUrlChange", "Click On Notes");
                office_LeadsHelper.PressEnter("ClickNotes1");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsNotesUrlChange", "Change the url with the url number of another office");
                VisitOffice("notes/view/765589");

                executionLog.Log("LeadsNotesUrlChange", "Verify Validation");
                officeActivities_NotesHelper.WaitForText("You don't have privileges to view this note.", 10);
                //officeActivities_NotesHelper.WaitForWorkAround(2000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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


            var oXMLData = new XMLParse();

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

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



            // Initializing the objects
            var executionLog                        = new ExecutionLog();
            var loginHelper                         = new LoginHelper(GetWebDriver());
            var corp_Office_OfficeHelper            = new CorpOffice_OfficeHelper(GetWebDriver());
            var yopmail_Helper                      = new YopMailHelper(GetWebDriver());
            var office_LeadsHelper                  = new Office_LeadsHelper(GetWebDriver());
            var office_FieldDictionary_FieldsHelper = new Office_FieldDictionary_FieldsHelper(GetWebDriver());


            //  Variable random

            String JIRA       = "";
            String Status     = "Pass";
            var    officename = "Office" + RandomNumber(1, 999999999);
            var    username1  = "user" + RandomNumber(1, 9999);

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

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Verify Page title");
                VerifyTitle("Dashboard");
                Console.WriteLine("Redirected to Dashboard");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Create Office");
                VisitCorp("offices");
                Console.WriteLine("Redirected to All Office page");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Click on Create button");
                corp_Office_OfficeHelper.ClickElement("Create");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Verify page title");
                VerifyTitle("Create an Office");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter Office name");
                corp_Office_OfficeHelper.TypeText("Name", officename);

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter Address Line 1");
                corp_Office_OfficeHelper.TypeText("AddressLine1", "Add 1");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter Zip Code");
                corp_Office_OfficeHelper.TypeText("ZIpCode", "20001");
                corp_Office_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Deselect Auto generate password check box");
                corp_Office_OfficeHelper.ClickElement("AutoGenPassword");
                corp_Office_OfficeHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter Username");
                corp_Office_OfficeHelper.TypeText("PrimaryUserName", username1);

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter Password");
                corp_Office_OfficeHelper.TypeText("PrimaryPassword", "123456");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter First Name");
                corp_Office_OfficeHelper.TypeText("FirstName", "Test");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter Last Name");
                corp_Office_OfficeHelper.TypeText("LastName", "User");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Select eAddress label");
                corp_Office_OfficeHelper.Select("EaddressLabel", "Home");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter eAddress");
                corp_Office_OfficeHelper.TypeText("eAddress", "*****@*****.**");
                Console.WriteLine("Entered eAddress");


                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Click on Save");
                try
                {
                    corp_Office_OfficeHelper.ClickElement("Save");
                }
                catch (OpenQA.Selenium.WebDriverException)
                { }

                Console.WriteLine("Office Created");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Go to yopmail.com");
                GetWebDriver().Navigate().GoToUrl("http://www.yopmail.com/en/");
                Console.WriteLine("Redirected to yopmail.com");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter eAddress in yopmail");
                yopmail_Helper.TypeText("Yopmail", "aslam.pegasus");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Check Inbox");
                yopmail_Helper.ClickElement("YopmailClick");

                yopmail_Helper.switchFrame("ifmail");

                yopmail_Helper.VerifyText("MailSecondPoint", username1);

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Click on Office Link");
                yopmail_Helper.ClickElement("OfficeLink");
                corp_Office_OfficeHelper.SwitchToWindow();

                yopmail_Helper.WaitForWorkAround(5000);

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Click on Profile Icon");
                corp_Office_OfficeHelper.ClickElement("ProfileIcon");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Click on Logout");
                corp_Office_OfficeHelper.ClickElement("Logout");
                Console.WriteLine("Redirected to Login Screen");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter Username");
                loginHelper.TypeText("Login/Username", username1);

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Enter Last Name");
                loginHelper.TypeText("Login/Password", "123456");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Verify Office");
                loginHelper.ClickElement("Login/Enter");
                Console.WriteLine("Logged into new office");

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

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Redirect at create Leads page");
                GetWebDriver().Navigate().GoToUrl("https://www.mypegasuscrm.com/newthemecorp/" + username1 + "/leads/create");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Verify Company Name field appearing");
                office_LeadsHelper.verifyElementPresent("CompanyName");

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Redirect at Field Properties");
                GetWebDriver().Navigate().GoToUrl("https://www.mypegasuscrm.com/newthemecorp/" + username1 + "/fields");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Select Module");
                office_FieldDictionary_FieldsHelper.SelectByText("FSModule", "Clients");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyFieldsInheritedForNewOffice", "Verify fields available");
                Assert.IsFalse(GetWebDriver().PageSource.Contains("No Fields Available."));
                //office_LeadsHelper.WaitForWorkAround(3000);
            }

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

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyFieldsInheritedForNewOffice");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Fields Inherited For New Office");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Fields Inherited For New Office", "Bug", "Medium", "Employee page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Fields Inherited For New Office");
                        TakeScreenshot("VerifyFieldsInheritedForNewOffice");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyFieldsInheritedForNewOffice.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyFieldsInheritedForNewOffice");
                        string id            = loginHelper.getIssueID("Verify Fields Inherited For New Office");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyFieldsInheritedForNewOffice.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Fields Inherited For New Office"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Fields Inherited For New Office");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyFieldsInheritedForNewOffice");
                executionLog.WriteInExcel("Verify Fields Inherited For New Office", Status, JIRA, "Corp Employees");
            }
        }
示例#9
0
        public void mergeLeadSelectAnyAndCancel()
        {
            string[] username = null;
            string[] password = null;

            XMLParse oXMLData = new XMLParse();

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

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

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

            // Random Variable.
            var    File   = GetPathToFile() + "leadsamples.csv";
            String JIRA   = "";
            String Status = "Pass";


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

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

                executionLog.Log("MergeLeadSelectAnyAndCancel", "Redirect at lead import page.");
                VisitOffice("leads/import");

                executionLog.Log("MergeLeadSelectAnyAndCancel", "Upload a csv file.");
                office_LeadsHelper.Upload("BrowseFile", File);

                executionLog.Log("MergeLeadSelectAnyAndCancel", "Click on import button");
                office_LeadsHelper.ClickElement("LeadImport");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("MergeLeadSelectAnyAndCancel", "Select primary record");
                office_LeadsHelper.ClickElement("LeadCompyRadioBtn");

                executionLog.Log("MergeLeadSelectAnyAndCancel", "Scroll to merge button.");
                office_LeadsHelper.ScrollDown("//div[@class='row']/div/a[@title='Merge']");

                executionLog.Log("MergeLeadSelectAnyAndCancel", "Click on merge button");
                office_LeadsHelper.ClickElement("ClickOnMergeBtn");

                executionLog.Log("MergeLeadSelectAnyAndCancel", "Click cancel to decline alert.");
                office_LeadsHelper.DeclineAlert();

                executionLog.Log("MergeLeadSelectAnyAndCancel", "Click on merge button");
                office_LeadsHelper.ClickElement("ClickOnMergeBtn");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("MergeLeadSelectAnyAndCancel");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Merge Lead Select Any And Cancel");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Merge Lead Select Any And Cancel", "Bug", "Medium", "Leads page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Merge Lead Select Any And Cancel");
                        TakeScreenshot("MergeLeadSelectAnyAndCancel");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\MergeLeadSelectAnyAndCancel.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("MergeLeadSelectAnyAndCancel");
                        string id            = loginHelper.getIssueID("Merge Lead Select Any And Cancel");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\MergeLeadSelectAnyAndCancel.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Merge Lead Select Any And Cancel"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Merge Lead Select Any And Cancel");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("MergeLeadSelectAnyAndCancel");
                executionLog.WriteInExcel("Merge Lead Select Any And Cancel", Status, JIRA, "Leads Management");
            }
        }
示例#10
0
        public void leadZipCode()
        {
            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    CompanyNameLead = "Lead" + GetRandomNumber();
            var    FirstName       = "Lead" + GetRandomNumber();
            var    Number          = "12345678" + GetRandomNumber();
            String JIRA            = "";
            String Status          = "Pass";

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

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

                executionLog.Log("LeadZipCode", "Redirect To Lead");
                VisitOffice("leads/create");
                Office_LeadsHelper.WaitForWorkAround(5000);

                executionLog.Log("LeadSave", "Verify page title. ");
                VerifyTitle("Create a Lead");

                executionLog.Log("LeadZipCode", "Click on Comapy Detail");
                Office_LeadsHelper.TypeText("CompanyName", CompanyNameLead);

                executionLog.Log("LeadZipCode", "Select Salutation");
                Office_LeadsHelper.Select("Salutaion", "Mr");

                executionLog.Log("LeadZipCode", "Enter First Name");
                Office_LeadsHelper.TypeText("FirstNameLead", FirstName);

                executionLog.Log("LeadZipCode", "Enter Last Name");
                Office_LeadsHelper.TypeText("LastName", "Tester");

                executionLog.Log("LeadZipCode", "Select the Status");
                Office_LeadsHelper.SelectByText("LeadStatus", "Marketing");

                executionLog.Log("LeadZipCode", "Select the Responsbility");
                Office_LeadsHelper.SelectByText("Responsibility", "Howard Tang");

                executionLog.Log("LeadZipCode", "Click on Save Button button");
                Office_LeadsHelper.ClickElement("SaveLeadButton");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("LeadZipCode");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Lead Zip Code");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Lead Zip Code", "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 Zip Code");
                        TakeScreenshot("LeadZipCode");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\LeadZipCode.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("LeadZipCode");
                        string id            = loginHelper.getIssueID("Lead Zip Code");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\LeadZipCode.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Lead Zip Code"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Lead Zip Code");
                //    executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("LeadZipCode");
                executionLog.WriteInExcel("Lead Zip Code", Status, JIRA, "Leads Management");
            }
        }
        public void verifyModifiedMovementIssue()
        {
            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("VerifyModifiedMovementIssue", "Login with valid username and password");
                Login(username[0], password[0]);
                Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]);

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

                executionLog.Log("VerifyModifiedMovementIssue", "Redirect To URL");
                VisitOffice("leads");
                office_LeadsHelper.WaitForWorkAround(5000);

                executionLog.Log("VerifyModifiedMovementIssue", "Verify page title.");
                VerifyTitle("Leads");

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

                executionLog.Log("VerifyModifiedMovementIssue", "Select 'Modified' in displayed columns.");
                office_LeadsHelper.SelectByText("DisplayedCols", "Modified");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyModifiedMovementIssue", "Move column to available columns");
                office_LeadsHelper.ClickElement("RemoveCols");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyModifiedMovementIssue", "Click on apply button.");
                office_LeadsHelper.ClickElement("Apply");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyModifiedMovementIssue", "Verify unexpected error message not present on the page.");
                office_LeadsHelper.VerifyTextNot("OOPS you are trying to access a non existing page on the website.");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyModifiedMovementIssue", "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("VerifyModifiedMovementIssue");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Modified Movement Issue");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Modified Movement Issue", "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("Verify Modified Movement Issue");
                        TakeScreenshot("VerifyModifiedMovementIssue");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyModifiedMovementIssue.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyModifiedMovementIssue");
                        string id            = loginHelper.getIssueID("Verify Modified Movement Issue");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyModifiedMovementIssue.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Modified Movement Issue"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Modified Movement Issue");
                //      executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyModifiedMovementIssue");
                executionLog.WriteInExcel("Verify Modified Movement Issue", Status, JIRA, "Opportunities Management");
            }
        }
        public void leadsAdvanceFilterResultsPP()
        {
            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    DocName = "Test Exe" + GetRandomNumber();
            var    fileUpl = GetPathToFile() + "chrome.exe";
            String JIRA    = "";
            String Status  = "Pass";

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

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

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Redirect To URL");
                VisitOffice("leads");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Verify page title.");
                VerifyTitle("Leads");

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

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

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Click on apply button.");
                office_LeadsHelper.ClickElement("Apply");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Verify number of records displayed.");
                office_LeadsHelper.VerifyText("No.ofResults", "Showing 1 - 10 of");
                //office_LeadsHelper.WaitForWorkAround(3000);

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

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

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Click on apply button.");
                office_LeadsHelper.ClickElement("Apply");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Verify number of records displayed.");
                office_LeadsHelper.VerifyText("No.ofResults", "Showing 1 - 20 of");
                //office_LeadsHelper.WaitForWorkAround(3000);

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

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

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Click on apply button.");
                office_LeadsHelper.ClickElement("Apply");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Verify number of records displayed.");
                office_LeadsHelper.VerifyText("No.ofResults", "Showing 1 - 50 of");
                //office_LeadsHelper.WaitForWorkAround(3000);

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

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

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Click on apply button.");
                office_LeadsHelper.ClickElement("Apply");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterResultsPP", "Verify number of records displayed.");
                office_LeadsHelper.VerifyText("No.ofResults", "Showing 1 - 100 of");
                //office_LeadsHelper.WaitForWorkAround(3000);

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

            XMLParse oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var officeActivities_DocumentsHelper = new OfficeActivities_DocumentHelper(GetWebDriver());
            var office_ClientsHelper             = new Office_ClientsHelper(GetWebDriver());
            var office_LeadsHelper         = new Office_LeadsHelper(GetWebDriver());
            var office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver());
            var ticket_CreateATicketHelper = new OfficeTickets_CreateTicketsHelper(GetWebDriver());

            // Variable
            var    name        = "Doc" + RandomNumber(1, 9999);
            var    email       = "Test" + GetRandomNumber() + "@gmail.com";
            String ValidFile   = GetPathToFile() + "index.jpg";
            String InvalidFile = GetPathToFile() + "chrome.exe";
            String JIRA        = "";
            String Status      = "Pass";


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

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

                executionLog.Log("ActivitiesDocumentManagement2", "Click On  Admin");
                VisitOffice("admin");

                executionLog.Log("ActivitiesDocumentManagement2", "Redirect to create document page");
                VisitOffice("documents/create");

                executionLog.Log("ActivitiesDocumentManagement2", "verify title");
                VerifyTitle("Create a New Document");

                executionLog.Log("ActivitiesDocumentManagement2", "Click on Save button");
                officeActivities_DocumentsHelper.ClickElement("Save");

                executionLog.Log("ActivitiesDocumentManagement2", "Verify validation message for name.");
                officeActivities_DocumentsHelper.VerifyText("NameError", "This field is required.");

                executionLog.Log("ActivitiesDocumentManagement2", "Verify validation message for attachment.");
                officeActivities_DocumentsHelper.VerifyText("AttachmentError", "This field is required.");

                executionLog.Log("ActivitiesDocumentManagement2", "Enter Document name");
                officeActivities_DocumentsHelper.TypeText("Name", name);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on document version");
                officeActivities_DocumentsHelper.ClickElement("DocumentVersion");

                executionLog.Log("ActivitiesDocumentManagement2", "Upload an invalid File ");
                officeActivities_DocumentsHelper.Upload("BrowseAttachment", InvalidFile);

                executionLog.Log("ActivitiesDocumentManagement2", "Verify alert message for invalid file.");
                officeActivities_DocumentsHelper.VerifyAlertText("please select a valid file!");
                officeActivities_DocumentsHelper.AcceptAlert();

                executionLog.Log("ActivitiesDocumentManagement2", "Upload a valid File.");
                officeActivities_DocumentsHelper.Upload("BrowseAttachment", ValidFile);

                executionLog.Log("ActivitiesDocumentManagement2", "Select Assign owner");
                officeActivities_DocumentsHelper.SelectByText("AssignOwner", "Howard Tang");

                executionLog.Log("ActivitiesDocumentManagement2", "Select status");
                officeActivities_DocumentsHelper.Select("Status", "Active");

                executionLog.Log("ActivitiesDocumentManagement2", "Click on Save button");
                officeActivities_DocumentsHelper.ClickElement("Save");

                executionLog.Log("ActivitiesDocumentManagement2", "Wait for success message.");
                officeActivities_DocumentsHelper.WaitForText("Document saved successfully.", 10);

                executionLog.Log("ActivitiesDocumentManagement2", "Search document by name.");
                officeActivities_DocumentsHelper.TypeText("SearchDocumet", name);
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Select All in owner field");
                officeActivities_DocumentsHelper.SelectByText("OwnerField", "All");
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on edit icon.");
                officeActivities_DocumentsHelper.ClickElement("EditDoc");

                executionLog.Log("ActivitiesDocumentManagement2", "Select document related to.");
                officeActivities_DocumentsHelper.Select("ReletedTo", "18");
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on find list icon.");
                officeActivities_DocumentsHelper.ClickElement("Assign");
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on any meeting.");
                officeActivities_DocumentsHelper.ClickElement("AssignUser");
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on Save button");
                officeActivities_DocumentsHelper.ClickElement("Save");

                executionLog.Log("ActivitiesDocumentManagement2", "Wait for success message.");
                officeActivities_DocumentsHelper.WaitForText("Document updated successfully.", 10);

                executionLog.Log("ActivitiesDocumentManagement2", "Redirect at meetings page.");
                VisitOffice("meetings");

                executionLog.Log("ActivitiesDocumentManagement2", "Wait for locator to be present.");
                officeActivities_DocumentsHelper.WaitForElementPresent("ClickOnAnyMeeting", 10);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on any meeting.");
                office_ClientsHelper.ClickElement("ClickOnAnyMeeting");
                office_ClientsHelper.WaitForWorkAround(3000);

                VisitOffice("documents");
                office_ClientsHelper.WaitForWorkAround(3000);

                VerifyTitle("Documents");

                executionLog.Log("ActivitiesDocumentManagement2", "Search document by name.");
                officeActivities_DocumentsHelper.TypeText("SearchDocumet", name);
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Select All in owner field");
                officeActivities_DocumentsHelper.SelectByText("OwnerField", "All");
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on edit icon.");
                officeActivities_DocumentsHelper.ClickElement("EditDoc");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Select document related to.");
                officeActivities_DocumentsHelper.SelectByText("ReletedTo", "Client");
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on find list icon.");
                officeActivities_DocumentsHelper.ClickElement("Assign");
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on any task.");
                officeActivities_DocumentsHelper.ClickElement("AssignUser");
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on Save button");
                officeActivities_DocumentsHelper.ClickElement("Save");

                executionLog.Log("ActivitiesDocumentManagement2", "Wait for success message.");
                officeActivities_DocumentsHelper.WaitForText("Document updated successfully.", 10);

                executionLog.Log("ActivitiesDocumentManagement2", "Redirect at tasks page.");
                VisitOffice("tasks");

                executionLog.Log("ActivitiesDocumentManagement2", "Wait for locator to be present.");
                officeActivities_DocumentsHelper.WaitForElementPresent("OpenTask", 10);

                VisitOffice("documents");
                office_ClientsHelper.WaitForWorkAround(3000);

                VerifyTitle("Documents");

                executionLog.Log("ActivitiesDocumentManagement2", "Search document by name.");
                officeActivities_DocumentsHelper.TypeText("SearchDocumet", name);
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Select All in owner field");
                officeActivities_DocumentsHelper.SelectByText("OwnerField", "All");
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on edit icon.");
                officeActivities_DocumentsHelper.ClickElement("EditDoc");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on add new version.");
                officeActivities_DocumentsHelper.ClickElement("NewVersion");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Upload a valid File.");
                officeActivities_DocumentsHelper.Upload("BrowseAttachment", ValidFile);
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Write a comment about version.");
                officeActivities_DocumentsHelper.TypeText("DocCommnet", "This is newly added version.");

                executionLog.Log("ActivitiesDocumentManagement2", "Click on save button.");
                officeActivities_DocumentsHelper.ClickElement("AddVersionSave");

                executionLog.Log("ActivitiesDocumentManagement2", "Wait for success message.");
                officeActivities_DocumentsHelper.WaitForText("New Version File Uploaded successfully.", 10);

                executionLog.Log("ActivitiesDocumentManagement2", "Redirect to document page");
                VisitOffice("documents");

                executionLog.Log("ActivitiesDocumentManagement2", "Wait for locator to be present.");
                officeActivities_DocumentsHelper.WaitForElementPresent("SearchDocumet", 10);

                executionLog.Log("ActivitiesDocumentManagement2", "Search document by name.");
                officeActivities_DocumentsHelper.TypeText("SearchDocumet", name);
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);
                officeActivities_DocumentsHelper.SelectByText("OwnerField", "All");
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on Checkbox");
                officeActivities_DocumentsHelper.ClickElement("CheckDocToDel");

                executionLog.Log("ActivitiesDocumentManagement2", "Click on Delete button");
                officeActivities_DocumentsHelper.ClickElement("DeleteDoc");

                executionLog.Log("ActivitiesDocumentManagement2", "Acccept alert to delete doc.");
                officeActivities_DocumentsHelper.AcceptAlert();
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Wait for success message.");
                officeActivities_DocumentsHelper.WaitForText("Document deleted successfully.", 20);

                executionLog.Log("ActivitiesDocumentManagement2", "Redirect at recyclebin page.");
                VisitOffice("documents/recyclebin");

                executionLog.Log("ActivitiesDocumentManagement2", "Wait for locator to be present.");
                officeActivities_DocumentsHelper.WaitForElementPresent("DeleteRecycle", 10);

                executionLog.Log("ActivitiesDocumentManagement2", "Search document by name.");
                officeActivities_DocumentsHelper.TypeText("SearchDocumet", name);
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);
                officeActivities_DocumentsHelper.SelectByText("OwnerField", "All");
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on delete icon.");
                officeActivities_DocumentsHelper.ClickElement("DeleteRecycle");
                officeActivities_DocumentsHelper.AcceptAlert();
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Wait for success message..");
                officeActivities_DocumentsHelper.WaitForText("Document Permanently Deleted.", 20);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("ActivitiesDocumentManagement2");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Activities Document Management");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Activities Document Management", "Bug", "Medium", "Document page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Activities Document Management");
                        TakeScreenshot("ActivitiesDocumentManagement2");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\ActivitiesDocumentManagement2.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("ActivitiesDocumentManagement2");
                        string id            = loginHelper.getIssueID("Activities Document Management");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\ActivitiesDocumentManagement2.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Activities Document Management"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Activities Document Management");
                //  executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("ActivitiesDocumentManagement2");
                executionLog.WriteInExcel("Activities Document Management", Status, JIRA, "Office Activities");
            }
        }
示例#14
0
        public void leadsEmailUrlChange()
        {
            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 officeActivities_EmailHelper = new OfficeActivities_EmailsHelper(GetWebDriver());
            var office_LeadsHelper           = new Office_LeadsHelper(GetWebDriver());

            // Variable
            var    FirstName = "Test" + GetRandomNumber();
            var    LastName  = "Tester" + GetRandomNumber();
            var    Number    = "12345678" + GetRandomNumber();
            var    SendTo    = "Test" + GetRandomNumber() + "@yopmail.com";
            String JIRA      = "";
            String Status    = "Pass";

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

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

                executionLog.Log("LeadsEmailUrlChange", "Go to Leads page");
                VisitOffice("leads");
                officeActivities_EmailHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsEmailUrlChange", "Click On Any Lead");
                office_LeadsHelper.ClickElement("ClickAnyLead");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsEmailUrlChange", "Click On Send Email");
                office_LeadsHelper.ClickElement("SendEmail");
                officeActivities_EmailHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsEmailUrlChange", "Enter Email Id");
                officeActivities_EmailHelper.TypeText("Sendto", SendTo);
                officeActivities_EmailHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsEmailUrlChange", "Enter  Subject");
                officeActivities_EmailHelper.TypeText("EmailName", "Email Subject");
                officeActivities_EmailHelper.WaitForWorkAround(1000);

                executionLog.Log("LeadsEmailUrlChange", "Click on Send button");
                officeActivities_EmailHelper.ClickElement("SendEmailActivity");
                officeActivities_EmailHelper.WaitForWorkAround(2000);

                //executionLog.Log("LeadsEmailUrlChange", "Wait for element to present.");
                //officeActivities_EmailHelper.WaitForText("Description", 10);

                executionLog.Log("LeadsEmailUrlChange", "Select Activity >> Emails");
                officeActivities_EmailHelper.Select("SelectActivityType", "E-Mails");
                officeActivities_EmailHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsEmailUrlChange", "Click On E-mail");
                officeActivities_EmailHelper.PressEnter("ClickOnNoteOppSubj");
                officeActivities_EmailHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsEmailUrlChange", "Change the url with the url number of another office");
                VisitOffice("mails/view/57");
                officeActivities_EmailHelper.WaitForWorkAround(4000);

                executionLog.Log("LeadsEmailUrlChange", "Verify Validation");
                officeActivities_EmailHelper.WaitForText("You don't have privileges to view this E-Mail.", 10);
                officeActivities_EmailHelper.WaitForWorkAround(1000);

                executionLog.Log("LeadsEmailUrlChange", "Redirect to URL");
                VisitOffice("mails/sent");
                officeActivities_EmailHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsEmailUrlChange", "Verify page title");
                VerifyTitle("Sent");
                //officeActivities_EmailHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsEmailUrlChange", "Enter Send to in search ");
                officeActivities_EmailHelper.TypeText("SearchMailInput", SendTo);
                officeActivities_EmailHelper.WaitForWorkAround(1000);

                executionLog.Log("LeadsEmailUrlChange", "Click on search btn");
                officeActivities_EmailHelper.ClickElement("SearchBtn");
                officeActivities_EmailHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsEmailUrlChange", "Select searched email.");
                officeActivities_EmailHelper.ClickJS("CheckBox1");
                officeActivities_EmailHelper.WaitForWorkAround(1000);

                executionLog.Log("LeadsEmailUrlChange", "Click on delete btn");
                officeActivities_EmailHelper.ClickElement("Delete");
                officeActivities_EmailHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsEmailUrlChange", "Verify Email Deleted successfully");
                officeActivities_EmailHelper.WaitForText("E-Mail has been moved to the Recycle Bin.", 05);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("LeadsEmailUrlChange");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Leads Email Url Change");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Leads Email Url Change", "Bug", "Medium", "Leads page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Leads Email Url Change");
                        TakeScreenshot("LeadsEmailUrlChange");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\LeadsEmailUrlChange.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("LeadsEmailUrlChange");
                        string id            = loginHelper.getIssueID("Leads Email Url Change");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\LeadsEmailUrlChange.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Leads Email Url Change"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Leads Email Url Change");
                //  executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("LeadsEmailUrlChange");
                executionLog.WriteInExcel("Leads Email Url Change", Status, JIRA, "Leads Email");
            }
        }
示例#15
0
        public void leadsAdvanceFilterActivities()
        {
            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    DocName = "Test Exe" + GetRandomNumber();
            var    fileUpl = GetPathToFile() + "chrome.exe";
            String JIRA    = "";
            String Status  = "Pass";

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

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


                // Verify leads with notes.

                executionLog.Log("LeadsAdvanceFilterActivities", "Redirect To URL");
                VisitOffice("leads");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Verify page title.");
                VerifyTitle("Leads");

                executionLog.Log("LeadsAdvanceFilterActivities", "Click on advance filter.");
                office_LeadsHelper.ClickForce("AdvanceFilter");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Click on show activiities button.");
                office_LeadsHelper.ClickForce("ShowActivities");
                office_LeadsHelper.WaitForWorkAround(1000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Selct leads activity type.");
                office_LeadsHelper.ClickForce("LeadWithNote");
                //office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Click on apply button.");
                office_LeadsHelper.ClickForce("Apply");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Click on any leads.");
                office_LeadsHelper.ClickForce("ClickAnyLead");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Select actitivity type as notes.");
                office_LeadsHelper.SelectByText("SelectActivityType", "Notes");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Verify notes present for leads.");
                //office_LeadsHelper.IsElementVisible("LeadNotees.");


                // Verify leads with Open meetings.

                executionLog.Log("LeadsAdvanceFilterActivities", "Redirect To URL");
                VisitOffice("leads");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Verify page title.");
                VerifyTitle("Leads");

                executionLog.Log("LeadsAdvanceFilterActivities", "Click on advance filter.");
                office_LeadsHelper.ClickForce("AdvanceFilter");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Click on show activiities button.");
                office_LeadsHelper.ClickForce("ShowActivities");
                office_LeadsHelper.WaitForWorkAround(1000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Selct leads activity type.");
                office_LeadsHelper.ClickForce("LeadOpenMeet");
                //office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Click on apply button.");
                office_LeadsHelper.ClickForce("Apply");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Click on any leads.");
                office_LeadsHelper.ClickForce("ClickAnyLead");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Select actitivity type as meetings.");
                office_LeadsHelper.SelectByText("SelectActivityType", "Meetings");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Verify meeting present for leads.");
                //office_LeadsHelper.IsElementVisible("LeadsMeetings.");


                // Verify leads with Open tasks.

                executionLog.Log("LeadsAdvanceFilterActivities", "Redirect To URL");
                VisitOffice("leads");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Verify page title.");
                VerifyTitle("Leads");

                executionLog.Log("LeadsAdvanceFilterActivities", "Click on advance filter.");
                office_LeadsHelper.ClickForce("AdvanceFilter");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Click on show activiities button.");
                office_LeadsHelper.ClickForce("ShowActivities");
                office_LeadsHelper.WaitForWorkAround(1000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Selct leads activity type.");
                office_LeadsHelper.ClickForce("LeadsWithOpenTaks");
                //office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Click on apply button.");
                office_LeadsHelper.ClickForce("Apply");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Click on any leads.");
                office_LeadsHelper.ClickForce("ClickAnyLead");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Select actitivity type as tasks.");
                office_LeadsHelper.SelectByText("SelectActivityType", "Tasks");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Verify task present for leads.");
                //  office_LeadsHelper.IsElementVisible("LeadsTasks.");


                // Verify leads with documents.

                executionLog.Log("LeadsAdvanceFilterActivities", "Redirect To URL");
                VisitOffice("leads");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Verify page title.");
                VerifyTitle("Leads");

                executionLog.Log("LeadsAdvanceFilterActivities", "Click on advance filter.");
                office_LeadsHelper.ClickForce("AdvanceFilter");
                office_LeadsHelper.WaitForWorkAround(1000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Click on show activiities button.");
                office_LeadsHelper.ClickForce("ShowActivities");
                office_LeadsHelper.WaitForWorkAround(1000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Selct leads activity type.");
                office_LeadsHelper.ClickForce("LeadsWithDocs");
                //office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Click on apply button.");
                office_LeadsHelper.ClickForce("Apply");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Click on any leads.");
                office_LeadsHelper.ClickForce("ClickAnyLead");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Select actitivity type as documents.");
                office_LeadsHelper.SelectByText("SelectActivityType", "Documents");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Verify document present for lead.");
                // office_LeadsHelper.IsElementVisible("LeadsDOcs.");


                // Verify leads with E-Mails.

                executionLog.Log("LeadsAdvanceFilterActivities", "Redirect To URL");
                VisitOffice("leads");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Verify page title.");
                VerifyTitle("Leads");

                executionLog.Log("LeadsAdvanceFilterActivities", "Click on advance filter.");
                office_LeadsHelper.ClickForce("AdvanceFilter");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Click on show activiities button.");
                office_LeadsHelper.ClickForce("ShowActivities");
                office_LeadsHelper.WaitForWorkAround(1000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Selct leads activity type.");
                office_LeadsHelper.ClickForce("LeadsWithEmails");
                //office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Click on apply button.");
                office_LeadsHelper.ClickForce("Apply");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Click on any lead.");
                office_LeadsHelper.ClickForce("ClickAnyLead");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Select actitivity type as emails.");
                office_LeadsHelper.SelectByText("SelectActivityType", "E-Mails");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsAdvanceFilterActivities", "Verify email present for leads.");
                // office_LeadsHelper.IsElementVisible("LEadsEmails.");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("LeadsAdvanceFilterActivities");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Leads Advance Filter Activities");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Leads Advance Filter Activities", "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("Leads Advance Filter Activities");
                        TakeScreenshot("LeadsAdvanceFilterActivities");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\LeadsAdvanceFilterActivities.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("LeadsAdvanceFilterActivities");
                        string id            = loginHelper.getIssueID("Leads Advance Filter Activities");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\LeadsAdvanceFilterActivities.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Leads Advance Filter Activities"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Leads Advance Filter Activities");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("LeadsAdvanceFilterActivities");
                executionLog.WriteInExcel("Leads Advance Filter Activities", Status, JIRA, "Opportunities Management");
            }
        }
示例#16
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");
            }
        }
        public void leadAndClientManagement()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

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

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

            // 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("LeadAndClientManagement", "Login with valid credential  Username");
                Login(username[0], password[0]);

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

                executionLog.Log("LeadAndClientManagement", "Visit  Lead");
                VisitOffice("leads/create");

                executionLog.Log("LeadAndClientManagement", "Enter First Name");
                office_LeadsHelper.TypeText("FirstNameLead", FName);

                executionLog.Log("LeadAndClientManagement", "Enter Last Name");
                office_LeadsHelper.TypeText("LastName", LName);

                executionLog.Log("LeadAndClientManagement", "Enter Company DBA");
                office_LeadsHelper.TypeText("CompanyName", CDBA);

                executionLog.Log("LeadAndClientManagement", "Click on Assignments");
                office_LeadsHelper.ClickElement("Assignments");

                executionLog.Log("LeadAndClientManagement", "Wait for element to be visible.");
                office_LeadsHelper.WaitForElementPresent("LeadStatus", 10);

                executionLog.Log("LeadAndClientManagement", "Select Status");
                office_LeadsHelper.SelectByText("LeadStatus", "New");

                executionLog.Log("LeadAndClientManagement", "Select Responsibities");
                office_LeadsHelper.SelectByText("Responsibility", "Howard Tang");

                executionLog.Log("LeadAndClientManagement", "Click on Save");
                office_LeadsHelper.ClickElement("SaveLeadNewSkin");

                executionLog.Log("LeadAndClientManagement", "Wait for Confirmation");
                office_LeadsHelper.WaitForText("Lead saved successfully.", 10);

                executionLog.Log("LeadAndClientManagement", "Click on Convert");
                office_LeadsHelper.ClickElement("ClickOnConvert");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadAndClientManagement", "Click Save on Pop Up");
                office_LeadsHelper.ClickOnDisplayed("ClickonPopUpSave");

                executionLog.Log("LeadAndClientManagement", "Verify confirmation");
                office_LeadsHelper.WaitForText("Lead is converted and moved to recyclebin.", 10);

                executionLog.Log("LeadAndClientManagement", "Visit Lead");
                VisitOffice("leads");

                executionLog.Log("LeadAndClientManagement", "Click Export");
                office_LeadsHelper.ClickElement("ClickOnExport");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadAndClientManagement", "Click Export As CSV");
                office_LeadsHelper.ClickElement("ExportAsCSVlEAD");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadAndClientManagement", "Goto Lead");
                VisitOffice("leads");

                executionLog.Log("LeadAndClientManagement", "Click on Export");
                office_LeadsHelper.ClickElement("ClickOnExport");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadAndClientManagement", "Click on Export as excel");
                office_LeadsHelper.ClickElement("ExportAsExcelLead");
                office_LeadsHelper.WaitForWorkAround(5000);

                executionLog.Log("LeadAndClientManagement", "Redirect To leads page. ");
                VisitOffice("leads");

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

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

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

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

                executionLog.Log("LeadAndClientManagement", "Goto Client");
                VisitOffice("clients");

                executionLog.Log("LeadAndClientManagement", "Click on Export");
                office_ClientsHelper.ClickElement("SpanTextExport");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadAndClientManagement", "Click export AS Excel");
                office_ClientsHelper.ClickElement("ExportAsExcelLead");

                executionLog.Log("LeadAndClientManagement", "Go to create a Lead");
                VisitOffice("leads/create");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadAndClientManagement", "Enter First Name");
                office_LeadsHelper.TypeText("FirstNameLead", FName);

                executionLog.Log("LeadAndClientManagement", "Enter Last Name");
                office_LeadsHelper.TypeText("LastName", LName);

                executionLog.Log("LeadAndClientManagement", "Enter Company DBA Name");
                office_LeadsHelper.TypeText("CompanyName", CDBA);

                executionLog.Log("LeadAndClientManagement", "Click on Assignments");
                office_LeadsHelper.ClickElement("Assignments");

                executionLog.Log("LeadAndClientManagement", "Wait for element to be visible.");
                office_LeadsHelper.WaitForElementPresent("LeadStatus", 10);

                executionLog.Log("LeadAndClientManagement", "Select Status");
                office_LeadsHelper.SelectByText("LeadStatus", "New");

                executionLog.Log("LeadAndClientManagement", "Responsibilities");
                office_LeadsHelper.SelectByText("Responsibility", "Howard Tang");

                executionLog.Log("LeadAndClientManagement", "Click Save Button");
                office_LeadsHelper.ClickElement("SaveLeadNewSkin");

                executionLog.Log("LeadAndClientManagement", "Wait for Confirmation");
                office_LeadsHelper.WaitForText("Lead saved successfully.", 10);

                executionLog.Log("LeadAndClientManagement", "Click on Convert");
                office_LeadsHelper.ClickElement("ClickConvert");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadAndClientManagement", "Click on Convert");
                office_LeadsHelper.ClickElement("CancelConvert");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadAndClientManagement", "Click on Convert");
                office_LeadsHelper.ClickElement("ClickConvert");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadAndClientManagement", "Click on No");
                office_LeadsHelper.ClickDisplayed("//*[@id='LeadConversionDelete0']");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadAndClientManagement", "Click on Save");
                office_LeadsHelper.ClickOnDisplayed("ClickonPopUpSave");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadAndClientManagement", "Confirmation");
                office_LeadsHelper.VerifyPageText("Lead is converted successfully.");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadAndClientManagement", "Go to create a Lead");
                VisitOffice("leads/create");

                executionLog.Log("LeadAndClientManagement", "Enter First Name");
                office_LeadsHelper.TypeText("FirstNameLead", FName);

                executionLog.Log("LeadAndClientManagement", "Enter Last Name");
                office_LeadsHelper.TypeText("LastName", LName);

                executionLog.Log("LeadAndClientManagement", "Enter Company DBA Name");
                office_LeadsHelper.TypeText("CompanyName", CDBA);

                executionLog.Log("LeadAndClientManagement", "Click on Assignments");
                office_LeadsHelper.ClickElement("Assignments");

                executionLog.Log("LeadAndClientManagement", "Wait for element to be visible.");
                office_LeadsHelper.WaitForElementPresent("LeadStatus", 10);

                executionLog.Log("LeadAndClientManagement", "Select Status");
                office_LeadsHelper.SelectByText("LeadStatus", "New");

                executionLog.Log("LeadAndClientManagement", "Select Responsibility");
                office_LeadsHelper.SelectByText("LeadResponsibility", "Howard Tang");

                executionLog.Log("LeadAndClientManagement", "Click onSave Button");
                office_LeadsHelper.ClickElement("SaveLeadNewSkin");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadAndClientManagement", "Click on Create duplicate lead");
                office_LeadsHelper.ClickElement("CreateDuplicate");

                executionLog.Log("LeadAndClientManagement", "Verify Confirmation");
                office_LeadsHelper.WaitForText("Lead saved successfully.", 10);

                executionLog.Log("LeadAndClientManagement", "Go to Lead");
                VisitOffice("leads");

                executionLog.Log("LeadAndClientManagement", "Click on First Lead To check");
                office_LeadsHelper.ClickElement("CheckDocToDel");

                executionLog.Log("LeadAndClientManagement", "Click on Delete button.");
                office_LeadsHelper.ClickElement("ClickDelLeadbutton");
                office_LeadsHelper.AcceptAlert();

                executionLog.Log("LeadAndClientManagement", "Verify Confirmation");
                office_LeadsHelper.WaitForText("1 records deleted successfully", 10);

                executionLog.Log("LeadAndClientManagement", "Goto leads/recyclebin ");
                VisitOffice("leads/recyclebin");

                executionLog.Log("LeadAndClientManagement", "Click Restore");
                office_LeadsHelper.ClickElement("ClickOnRestoreLeadIcon");

                executionLog.Log("LeadAndClientManagement", "Verify Confirmation");
                office_LeadsHelper.WaitForText("Lead Restored Successfully.", 10);

                executionLog.Log("LeadAndClientManagement", "Redirect To leads page. ");
                VisitOffice("leads");

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

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

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

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

                executionLog.Log("LeadAndClientManagement", "Redirect To leads page. ");
                VisitOffice("leads");

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

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

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

                executionLog.Log("LeadAndClientManagement", "Wait for success message.");
                office_LeadsHelper.WaitForText("1 records deleted successfully", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("LeadAndClientManagement");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("LeadAndClientManagement");
                if (!result)
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("LeadAndClientManagement", "Bug", "Medium", "Leads page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("LeadAndClientManagement");
                        TakeScreenshot("LeadAndClientManagement");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\LeadAndClientManagement.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("LeadAndClientManagement");
                        string id            = loginHelper.getIssueID("LeadAndClientManagement");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\LeadAndClientManagement.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("LeadAndClientManagement"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("LeadAndClientManagement");
                executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("LeadAndClientManagement");
                executionLog.WriteInExcel("LeadAndClientManagement", Status, JIRA, "Lead Management");
            }
        }
        public void verifyModifiedByCredentialsforLead()
        {
            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(1, 99);
            var    LastName  = "Tester" + RandomNumber(1, 99);
            var    Number    = "12345678" + RandomNumber(10, 99);
            String JIRA      = "";
            String Status    = "Pass";

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

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

                executionLog.Log("VerifyModifiedByCredentialsforLead", "Click on Leads in Topmenu");
                VisitOffice("leads");

                executionLog.Log("VerifyModifiedByCredentialsforLead", "Verify Page title");
                VerifyTitle("Leads");

                executionLog.Log("VerifyModifiedByCredentialsforLead", "Click On Any Lead");
                office_LeadsHelper.ClickElement("ClickAnyLead");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyModifiedByCredentialsforLead", "Click On Convert lead button");
                office_LeadsHelper.ClickElement("ClickConvert");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyModifiedByCredentialsforLead", "Click on save button");
                office_LeadsHelper.ClickElement("SaveConvertLead");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyModifiedByCredentialsforLead", "Verify Success text for lead conversion.");
                office_LeadsHelper.VerifyPageText("Lead is converted and moved to recyclebin.");

                executionLog.Log("VerifyModifiedByCredentialsforLead", "");
                office_LeadsHelper.VerifyPageText("Clients");

                executionLog.Log("VerifyModifiedByCredentialsforLead", "Verify Modified by name.");
                office_LeadsHelper.VerifyText("Editedby", "By Howard Tang");
                office_LeadsHelper.WaitForWorkAround(2000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyModifiedByCredentialsforLead");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Modified By Credentials for Lead");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Modified By Credentials for Lead", "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("Verify Modified By Credentials for Lead");
                        TakeScreenshot("VerifyModifiedByCredentialsforLead");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyModifiedByCredentialsforLead.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("Verify Modified By Credentials for Lead");
                        string id            = loginHelper.getIssueID("Verify Modified By Credentials for Lead");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyModifiedByCredentialsforLead.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Modified By Credentials for Lead"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Modified By Credentials for Lead");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyModifiedByCredentialsforLead");
                executionLog.WriteInExcel("Verify Modified By Credentials for Lead", Status, JIRA, "Leads Management");
            }
        }
        public void verifyIconAndLabelForLeads()
        {
            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("VerifyIconAndLabelForLeads", "Login with valid username and password");
                Login(username[0], password[0]);
                Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]);

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

                executionLog.Log("VerifyIconAndLabelForLeads", "Visit Leads page.");
                VisitOffice("leads");

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify page title.");
                VerifyTitle("Leads");

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify page title.");
                VerifyTitle("Leads");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify delete icon available.");
                office_LeadsHelper.IsElementPresent("DeleteIcon");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify delete label available.");
                office_LeadsHelper.IsElementPresent("DeleteLabel");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Click on delete button.");
                office_LeadsHelper.ClickElement("DeleteLabel");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Decline alert message.");
                office_LeadsHelper.DeclineAlert();
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify bulk update icon.");
                office_LeadsHelper.IsElementPresent("BUlkUpdateIcon");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify bulk update label.");
                office_LeadsHelper.IsElementPresent("BulkUpdateLabel");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Click on bulk update button.");
                office_LeadsHelper.ClickForce("BulkUpdateLabel");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Click on sales manager.");
                office_LeadsHelper.ClickElement("ChangeSaleManager");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify alert text on the page.");
                office_LeadsHelper.VerifyAlertText("Please select atleast one record to proceed.");

                executionLog.Log("VerifyIconAndLabelForLeads", "Accept alert message.");
                office_LeadsHelper.AcceptAlert();
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify advance filter icon.");
                office_LeadsHelper.IsElementPresent("AdvanceFilIcon");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify advanced filter label.");
                office_LeadsHelper.IsElementPresent("AdvancefiltLabel");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify page text.");
                office_LeadsHelper.VerifyPageText("Tracking Fields");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify create leads icon.");
                office_LeadsHelper.IsElementPresent("CreateIcon");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify create leads label.");
                office_LeadsHelper.IsElementPresent("CreateLabel");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Click on create button.");
                office_LeadsHelper.ClickElement("CreateLabel");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify page title as create leads.");
                VerifyTitle("Create a Lead");

                executionLog.Log("VerifyIconAndLabelForLeads", "Visit opportunitities page.");
                VisitOffice("leads");

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify page title");
                VerifyTitle("Leads");

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify import icon present.");
                office_LeadsHelper.IsElementPresent("ImportIcon");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify import label present.");
                office_LeadsHelper.IsElementPresent("ImportLabel");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Click on import button.");
                office_LeadsHelper.ClickElement("ImportLabel");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify browse button present on page.");
                office_LeadsHelper.IsElementPresent("BrowseFile");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Visit opportunitities page.");
                VisitOffice("leads");

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify page title");
                VerifyTitle("Leads");

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify import icon present.");
                office_LeadsHelper.IsElementPresent("VcardIcon");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify import label present.");
                office_LeadsHelper.IsElementPresent("VcardLabel");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Click on import button.");
                office_LeadsHelper.ClickForce("VcardLabel");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify browse button present on page.");
                office_LeadsHelper.IsElementPresent("BrowseFile");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Visit Leads page.");
                VisitOffice("leads");

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify page title..");
                VerifyTitle("Leads");

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify merge icon present on page.");
                office_LeadsHelper.IsElementPresent("MergeIcon");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify merge label present on page.");
                office_LeadsHelper.IsElementPresent("MergeLabel");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Click on merge button.");
                office_LeadsHelper.ClickElement("MergeLabel");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify alert text on the page.");
                office_LeadsHelper.VerifyAlertText("Please select 2 or more leads you wish to merge");

                executionLog.Log("VerifyIconAndLabelForLeads", "Accept alert message.");
                office_LeadsHelper.AcceptAlert();
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify export icon present on page.");
                office_LeadsHelper.IsElementPresent("ExportIcon");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Click on Export Icon");
                office_LeadsHelper.ClickJS("ExportIcon");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify the export label present");
                office_LeadsHelper.IsElementPresent("ExportLabel");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify export as csv present on page.");
                office_LeadsHelper.IsElementPresent("ExportCsv");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify the ");
                office_LeadsHelper.IsElementPresent("ExportExcel");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Click on export label present");
                office_LeadsHelper.ClickElement("ExportLabel");

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify recycle bin icon on the page.");
                office_LeadsHelper.IsElementPresent("RecycleBinIcon");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Click on recycle bin Icon");
                office_LeadsHelper.ClickJS("RecycleBinIcon");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify page title as recycled Leads.");
                office_LeadsHelper.VerifyPageText("Recycled Leads");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Visit Leads page.");
                VisitOffice("leads");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify page title..");
                VerifyTitle("Leads");

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify all Leads button present on page.");
                office_LeadsHelper.IsElementPresent("AllLeads");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify my Leads button present on page.");
                office_LeadsHelper.IsElementPresent("MyLeads");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify my team's Leads button present on page.");
                office_LeadsHelper.IsElementPresent("MyTeamLeads");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify my saved filters button present on page.");
                office_LeadsHelper.IsElementPresent("MySavedFilters");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "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("VerifyIconAndLabelForLeads");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Icon And Label For Leads");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Icon And Label For Leads", "Bug", "Medium", "Leads page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Icon And Label For Leads");
                        TakeScreenshot("VerifyIconAndLabelForLeads");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyIconAndLabelForLeads.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyIconAndLabelForLeads");
                        string id            = loginHelper.getIssueID("Verify Icon And Label For Leads");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyIconAndLabelForLeads.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Icon And Label For Leads"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Icon And Label For Leads");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyIconAndLabelForLeads");
                executionLog.WriteInExcel("Verify Icon And Label For Leads", Status, JIRA, "Leads Management");
            }
        }
        public void clientZipCodeAutoPopulationIssue()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

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

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

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

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

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

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Visit Craete Client");
                VisitOffice("clients/create");
                office_ClientsHelper.WaitForWorkAround(4000);

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Click Cancel");
                office_ClientsHelper.ClickForce("CancelOpp");
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Visit Craete Client");
                VisitOffice("clients/create");
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Enter Client Dba Name");
                office_ClientsHelper.TypeText("ClientDBAName", "Client DBA");

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Select client status");
                office_ClientsHelper.SelectByText("ClientStatus", "New");

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Select Client Res[onsibility.");
                office_ClientsHelper.SelectByText("ClientResponsibility", "Howard Tang");

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Click on next button");
                office_ClientsHelper.ClickElement("Next");
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Wait for confirmation message.");
                office_ClientsHelper.WaitForText("Client saved successfully. ", 10);

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Wait for element to be visible.");
                office_ClientsHelper.WaitForElementPresent("CompanyDetails", 10);

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Goto Company details tab.");
                office_ClientsHelper.ClickElement("CompanyDetails");

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Client Company DBA Name");
                office_ClientsHelper.TypeText("ClientDBAName", DBA);

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Enter Client federal tax id.");
                office_ClientsHelper.TypeText("FederalTaxID", "111122222");

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

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Select Status");
                office_ClientsHelper.SelectByText("ClientStatus", "New");

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Select Responsibilties");
                office_ClientsHelper.SelectByText("ClientResponsibility", "Howard Tang");

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Enter company details zipcode.");
                office_ClientsHelper.TypeText("ZipCodeMailingAddress", "60601");
                office_ClientsHelper.WaitForWorkAround(5000);

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Click on contact tab");
                office_ClientsHelper.ClickElement("ClickOnContactTab");

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Enter the Conatct Title");
                office_ClientsHelper.TypeText("ContactTitle", "(785) 786-8768");

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Click on owner tab.");
                office_ClientsHelper.ClickForce("OwnerTab");
                office_ClientsHelper.WaitForWorkAround(5000);

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Enter zip code.");
                office_ClientsHelper.TypeText("OwnerZipCode", "60601");
                office_ClientsHelper.WaitForWorkAround(5000);

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Click on save button.");
                office_ClientsHelper.ClickElement("OwnerSave");

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Wait for confirmation message.");
                office_ClientsHelper.WaitForText("Client data updated successfully. ", 10);

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Visit Client page.");
                VisitOffice("clients");

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Verify page title.");
                VerifyTitle();

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Enter created client company name.");
                office_ClientsHelper.TypeText("SearchClient", DBA);
                office_ClientsHelper.WaitForWorkAround(6000);

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Click on searched company name.");
                office_ClientsHelper.ClickElement("Client1");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Click on comapany details tab.");
                office_ClientsHelper.ClickElement("CompanyDetails");
                office_ClientsHelper.WaitForWorkAround(5000);

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Verify all field populated automatically on entering a valid zip code.");
                office_ClientsHelper.VerifyAutoPopulation();

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Click on save button.");
                office_ClientsHelper.ClickElement("Save");
                office_ClientsHelper.WaitForWorkAround(4000);

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Redirect at clients page.");
                VisitOffice("clients");

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Enter Company Name");
                office_ClientsHelper.TypeText("SearchClient", DBA);
                office_ClientsHelper.WaitForWorkAround(5000);

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

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

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

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

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Redirect To client recycle bin page. ");
                VisitOffice("clients/recyclebin");

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Enter Company Name");
                office_ClientsHelper.TypeText("SearchClient", DBA);
                office_ClientsHelper.WaitForWorkAround(2000);
                office_ClientsHelper.selectOwner("//*[@id='gs_first_name']");
                office_ClientsHelper.WaitForWorkAround(4000);

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

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

                executionLog.Log("ClientZipCodeAutoPopulationIssue", "Wait for success message.");
                office_ClientsHelper.WaitForText("Client Permanently Deleted.", 10);

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

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

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

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

                executionLog.Log("CreateLeadErrrorMessage", "Go to create lead page");
                VisitOffice("leads/create");

                executionLog.Log("CreateLeadErrrorMessage", "Verify title");
                VerifyTitle("Create a Lead");

                loginHelper.Click("//button[@title='Save']");
                loginHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadErrrorMessage", "Verify no error message displayed");
                loginHelper.VerifyAlertNotPresent();
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("CreateLeadErrrorMessage");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Create Lead Errror Message");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Create Lead Errror Message", "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("Create Lead Errror Message");
                        TakeScreenshot("CreateLeadErrrorMessage");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\CreateLeadErrrorMessage.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("CreateLeadErrrorMessage");
                        string id            = loginHelper.getIssueID("Create Lead Errror Message");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\CreateLeadErrrorMessage.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Create Lead Errror Message"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Create Lead Errror Message");
                //  executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("CreateLeadErrrorMessage");
                executionLog.WriteInExcel("Create Lead Errror Message", Status, JIRA, "Leads Management");
            }
        }
示例#22
0
        public void leadSave()
        {
            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    Company = "My Company" + GetRandomNumber();
            var    name    = "TestEmployee" + GetRandomNumber();
            String JIRA    = "";
            String Status  = "Pass";

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

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

                executionLog.Log("LeadSave", "Redirect To ");
                VisitOffice("leads/create");

                executionLog.Log("LeadSave", "Verify page title. ");
                VerifyTitle("Create a Lead");
                Office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadSave", "Click on Assignments");
                Office_LeadsHelper.ClickElement("Assignments");

                executionLog.Log("LeadSave", "Wait for element to be visible.");
                Office_LeadsHelper.WaitForElementPresent("LeadStatus", 10);

                executionLog.Log("LeadSave", "Select Lead Status");
                Office_LeadsHelper.Select("LeadStatus", "New");

                executionLog.Log("LeadSave", "LeadResponsibility");
                Office_LeadsHelper.SelectByText("Responsibility", "Howard Tang");

                executionLog.Log("LeadSave", "Enter First Name ");
                Office_LeadsHelper.TypeText("FirstNameLead", "Test Lead");

                executionLog.Log("LeadSave", "Enter Last Name");
                Office_LeadsHelper.TypeText("LastName", "Tester");

                executionLog.Log("LeadSave", "Enter Company Name");
                Office_LeadsHelper.TypeText("CompanyName", Company);

                executionLog.Log("LeadSave", "Click on Save");
                Office_LeadsHelper.ClickElement("SaveLeadButton");
                Office_LeadsHelper.WaitForWorkAround(1000);

                var LocDub = "//button[text()='Create Duplicate']";
                if (Office_LeadsHelper.IsElementPresent(LocDub))
                {
                    Office_LeadsHelper.WaitForWorkAround(4000);

                    executionLog.Log("LeadSave", "Click on duplicate btn");
                    Office_LeadsHelper.Click(LocDub);
                    Office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("LeadSave", "Verify text.");
                    Office_LeadsHelper.WaitForText("Lead saved successfully.", 10);
                    Office_LeadsHelper.WaitForWorkAround(1000);

                    executionLog.Log("LeadSave", "Redirect To create lead page. ");
                    VisitOffice("leads");

                    executionLog.Log("LeadSave", "Enter Company Name");
                    Office_LeadsHelper.TypeText("CompanySearch", Company);
                    Office_LeadsHelper.WaitForWorkAround(2000);

                    executionLog.Log("LeadSave", "Select lead by check box");
                    Office_LeadsHelper.ClickElement("CheckDocToDel");
                    Office_LeadsHelper.WaitForWorkAround(2000);

                    executionLog.Log("LeadSave", "Click on delete lead");
                    Office_LeadsHelper.ClickElement("DeleteLead");

                    executionLog.Log("LeadSave", "Accept alert message.");
                    Office_LeadsHelper.AcceptAlert();

                    executionLog.Log("LeadSave", "Wait for success message.");
                    Office_LeadsHelper.WaitForText("1 records deleted successfully", 10);
                }
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("LeadSave");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Lead Save");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Lead Save", "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 Save");
                        TakeScreenshot("LeadSave");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\LeadSave.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("LeadSave");
                        string id            = loginHelper.getIssueID("Lead Save");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\LeadSave.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Lead Save"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Lead Save");
                //      executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("LeadSave");
                executionLog.WriteInExcel("Lead Save", Status, JIRA, "Leads Management");
            }
        }
        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");
            }
        }
示例#24
0
        public void zipCodeError()
        {
            string[] username = null;
            string[] password = null;
            string[] log      = null;
            var      oXMLData = new XMLParse();

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

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

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

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



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

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

                executionLog.Log("ZipCodeError", "Go to Create Opportunity page");
                VisitOffice("opportunities/create");

                executionLog.Log("ZipCodeError", "Verify title");
                VerifyTitle("Create an Opportunity");

                executionLog.Log("ZipCodeError", "Enter zip code");
                office_OpportunitiesHelper.TypeText("ZipCode", "60601");

                executionLog.Log("ZipCodeError", "Click On anywhere");
                office_OpportunitiesHelper.ClickElement("V");


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

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


            try
            {
                executionLog.Log("RememberMeLoginPage", "EnterUserName");
                office_LeadsHelper.TypeText("EnterUserName", "AslamKhan");

                executionLog.Log("RememberMeLoginPage", "EnterPassword");
                office_LeadsHelper.TypeText("EnterPassword", "1qaz!QAZ");

                executionLog.Log("RememberMeLoginPage", "Click on Remmenbar me");
                office_LeadsHelper.ClickElement("ClickOnRememberMe");

                executionLog.Log("RememberMeLoginPage", "Click on login button");
                office_LeadsHelper.ClickElement("LoginBtnRem");

                executionLog.Log("RememberMeLoginPage", "Redirect To leads");
                VisitOffice("leads");

                executionLog.Log("RememberMeLoginPage", "Logout");
                VisitOffice("logout");

                executionLog.Log("RememberMeLoginPage", "Redirect To lead");
                VisitOffice("leads");

                executionLog.Log("RememberMeLoginPage", "Enter user name.");
                office_LeadsHelper.TypeText("EnterUserName", "AslamKhan");

                executionLog.Log("RememberMeLoginPage", "EnterPassword");
                office_LeadsHelper.TypeText("EnterPassword", "1qaz!QAZ");

                executionLog.Log("RememberMeLoginPage", "Click on remember me");
                office_LeadsHelper.ClickElement("ClickOnRememberMe");

                executionLog.Log("RememberMeLoginPage", "Click on login button");
                office_LeadsHelper.ClickElement("LoginBtnRem");
                office_LeadsHelper.WaitForWorkAround(4000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("RememberMeLoginPage");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Remember Me Login Page");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Remember Me Login Page", "Bug", "Medium", "Login page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Remember Me Login Page");
                        TakeScreenshot("RememberMeLoginPage");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\RememberMeLoginPage.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("RememberMeLoginPage");
                        string id            = loginHelper.getIssueID("Remember Me Login Page");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\RememberMeLoginPage.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Remember Me Login Page"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Remember Me Login Page");
                //     executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("RememberMeLoginPage");
                executionLog.WriteInExcel("Remember Me Login Page", Status, JIRA, "Office");
            }
        }
示例#26
0
        public void createLeadsSectionMasterData()
        {
            string[] username = null;
            string[] password = null;

            XMLParse oXMLData = new XMLParse();

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

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

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

            // Variable
            String name   = "Test" + GetRandomNumber();
            String num    = "Test" + GetRandomNumber();
            String JIRA   = "";
            String Status = "Pass";

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

                executionLog.Log("CreateLeadsSectionMasterData", "Verify Page title");
                VerifyTitle("Dashboard");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadsSectionMasterData", "Click On  Admin");
                VisitOffice("admin");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadsSectionMasterData", "Redirect To URL");
                VisitOffice("sections");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadsSectionMasterData", "Verify title");
                VerifyTitle("Section Management");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadsSectionMasterData", "Select lead");
                office_FieldDictionary_SectionsHelper.Selectbytext("SelectModule", "Leads");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadsSectionMasterData", "Click Create Btn");
                office_FieldDictionary_SectionsHelper.ClickElement("Create");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadsSectionMasterData", "Select TAB");
                office_FieldDictionary_SectionsHelper.Selectbytext("TabName", "Company Details");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(1000);

                executionLog.Log("CreateLeadsSectionMasterData", "Enter section Name");
                office_FieldDictionary_SectionsHelper.TypeText("Name", name);
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadsSectionMasterData", "Click on save button");
                office_FieldDictionary_SectionsHelper.ClickElement("Save");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadsSectionMasterData", "Accept Alert");
                office_FieldDictionary_SectionsHelper.AcceptAlert();
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadsSectionMasterData", "Click On Lead Tab ");
                VisitOffice("leads");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                VerifyTitle("Leads");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadsSectionMasterData", "Click On Any Lead");
                office_LeadsHelper.ClickElement("ClickAnyLead");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadsSectionMasterData", "Verify title");
                VerifyTitle("- Details");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadsSectionMasterData", "Click on Company Details Tab");
                office_LeadsHelper.ClickElement("CompanyDetails");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

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

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

            var oXMLData = new XMLParse();

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

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

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

            // VARIABLE
            var    name    = "TestEmployee" + GetRandomNumber();
            var    Company = "My Company" + RandomNumber(1, 999);
            String JIRA    = "";
            String Status  = "Pass";

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

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

                executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Redirect To create lead page");
                VisitOffice("leads/create");

                executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Click on Assignments");
                office_LeadsHelper.ClickElement("Assignments");

                executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Wait for element to be visible.");
                office_LeadsHelper.WaitForElementPresent("LeadStatus", 10);

                executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Select Lead Status");
                office_LeadsHelper.Select("LeadStatus", "New");

                executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "LeadResponsibility");
                office_LeadsHelper.SelectByText("LeadResponsibility", "Howard Tang");

                executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Click on companu details tab");
                office_LeadsHelper.ClickElement("CompanyDetails");

                executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Enter First Name ");
                office_LeadsHelper.TypeText("FirstNameLead", "Test Lead");

                executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "EnterLastName");
                office_LeadsHelper.TypeText("LastName", "Tester");

                executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Enter Company Nmae");
                office_LeadsHelper.TypeText("CompanyName", Company);

                executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Click on Save");
                office_LeadsHelper.ClickElement("Save");
                office_LeadsHelper.WaitForWorkAround(7000);


                var LocDub = "//button[text()='Create Duplicate']";
                if (office_LeadsHelper.IsElementPresent(LocDub))
                {
                    office_LeadsHelper.Click(LocDub);
                }

                executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Click on Convert");
                office_LeadsHelper.ClickElement("ClickConvert");

                executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Yes Move To Recycle Bin");
                office_LeadsHelper.ClickElement("ClickYes");

                executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Click Convert Save Lead");
                office_LeadsHelper.ClickElement("ConvertSaveLead");
                office_LeadsHelper.WaitForWorkAround(4000);

                executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Verify  messge");
                office_LeadsHelper.VerifyPageText("Lead is converted and moved to recyclebin.");
                office_LeadsHelper.WaitForWorkAround(4000);

                executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Wait for locator to be present.");
                office_ClientsHelper.WaitForElementPresent("CreatedBy", 10);

                executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Verify client created by name.");
                office_ClientsHelper.VerifyText("CreatedBy", "Howard Tang");

                executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Verify  client modified b y name.");
                office_ClientsHelper.VerifyText("ModifiedBy", "Howard Tang");

                executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Redirect To clients page. ");
                VisitOffice("clients");

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

                executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Wait for locator to present.");
                office_ClientsHelper.WaitForElementPresent("ClickOn1stOpp", 10);

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

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

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

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

                executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Redirect To leads recycle bin page. ");
                VisitOffice("leads/recyclebin");

                executionLog.Log("VerifyCreatedModifiedByForConvertedClient", "Enter Company Name");
                office_LeadsHelper.TypeText("SearchLeadRbin", Company);
                office_LeadsHelper.WaitForWorkAround(2000);

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

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

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

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyCreatedModifiedByForConvertedClient");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Created Modified By For Converted Client");
                if (!result)
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Created Modified By For Converted Client", "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("Verify Created Modified By For Converted Client");
                        TakeScreenshot("VerifyCreatedModifiedByForConvertedClient");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyCreatedModifiedByForConvertedClient.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyCreatedModifiedByForConvertedClient");
                        string id            = loginHelper.getIssueID("Verify Created Modified By For Converted Client");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyCreatedModifiedByForConvertedClient.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Created Modified By For Converted Client"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Created Modified By For Converted Client");
                executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyCreatedModifiedByForConvertedClient");
                executionLog.WriteInExcel("Verify Created Modified By For Converted Client", Status, JIRA, "Leads Management");
            }
        }
        public void verifySuccessMessage()
        {
            string[] username = null;
            string[] password = null;
            string[] log      = null;
            var      oXMLData = new XMLParse();

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

            username = oXMLData.getData("settings/Credentials", "username_office");
            password = oXMLData.getData("settings/Credentials", "password");
            log      = oXMLData.getData("settings/URL", "logout");
            String JIRA   = "";
            String Status = "Pass";

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

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

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

                executionLog.Log("VerifySuccessMessage", "Go to Import Leads page");
                VisitOffice("leads/import");

                executionLog.Log("VerifySuccessMessage", "Verify title");
                VerifyTitle("Leads");

                string file = GetPathToFile() + "leadslist.csv";
                executionLog.Log("VerifySuccessMessage", "Uplaod file");
                office_LeadsHelper.UploadFile("//*[@id='vcard_file']", file);

                executionLog.Log("VerifySuccessMessage", "Click on Import button");
                office_LeadsHelper.ClickElement("LeadImport");

                executionLog.Log("VerifySuccessMessage", "Verify success message");
                office_LeadsHelper.WaitForText("Records Imported Successfully.", 10);

                executionLog.Log("VerifySuccessMessage", "Log out from the application");
                VisitOffice("logout");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifySuccessMessage");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Success Message");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Success Message", "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("Verify Success Message");
                        TakeScreenshot("VerifySuccessMessage");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifySuccessMessage.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifySuccessMessage");
                        string id            = loginHelper.getIssueID("Verify Success Message");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifySuccessMessage.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Success Message"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Success Message");
                //     executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifySuccessMessage");
                executionLog.WriteInExcel("Verify Success Message", Status, JIRA, "Leads Management");
            }
        }
        public void bulkUpdatesChangeResponsibiltyForLead()
        {
            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(1, 99);
            var    LastName  = "Tester" + RandomNumber(1, 99);
            var    Number    = "12345678" + RandomNumber(10, 99);
            String JIRA      = "";
            String Status    = "Pass";

            //try
            //{

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

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

            executionLog.Log("BulkUpdatesChangeResponsibiltyForLead", "Visit Leads page");
            VisitOffice("leads");

            executionLog.Log("BulkUpdatesChangeResponsibiltyForLead", "Verify page title.");
            VerifyTitle("Leads");

            executionLog.Log("BulkUpdatesChangeResponsibiltyForLead", "Click On first Check Box");
            office_LeadsHelper.ClickElement("ClickOnCheckBox");

            executionLog.Log("BulkUpdatesChangeResponsibiltyForLead", "Click On Bulk Update");
            office_LeadsHelper.ClickElement("ClickOnBulkUpdate");

            executionLog.Log("BulkUpdatesChangeResponsibiltyForLead", "Change Sale Manager");
            office_LeadsHelper.ClickElement("ChangeSaleManager");
            office_LeadsHelper.WaitForWorkAround(1000);

            executionLog.Log("BulkUpdatesChangeResponsibiltyForLead", "Select Sales MANAGER");
            office_LeadsHelper.SelectByText("SelectSalesManager", "Howard Tang");

            executionLog.Log("BulkUpdatesChangeResponsibiltyForLead", "Click on Update button");
            office_LeadsHelper.ClickOnDisplayed("ClickUpdate");
            office_LeadsHelper.WaitForWorkAround(1000);

            executionLog.Log("BulkUpdatesChangeResponsibiltyForLead", "Accept alert message.");
            office_LeadsHelper.AcceptAlert();
            office_LeadsHelper.WaitForWorkAround(2000);

            executionLog.Log("BulkUpdatesChangeResponsibiltyForLead", "Verify success message");
            office_LeadsHelper.WaitForText("records updated successfully", 30);

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

            //    String counter = executionLog.readLastLine("counter");
            //    String Description = executionLog.GetAllTextFile("BulkUpdatesChangeResponsibiltyForLead");
            //    String Error = executionLog.GetAllTextFile("Error");
            //    Console.WriteLine(Error);
            //    if (counter == "")
            //    {
            //        counter = "0";
            //    }
            //    bool result = loginHelper.CheckExstingIssue("Bulk Updates Change Responsibilty For Lead");
            //    if (!result)
            //    {
            //        if (Int16.Parse(counter) < 9)
            //        {
            //            executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
            //            loginHelper.CreateIssue("BulkUpdates Change Responsibilty For Lead", "Bug", "Medium", "Office leads", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
            //            string id = loginHelper.getIssueID("Bulk Updates Change Responsibilty For Lead");
            //            TakeScreenshot("BulkUpdatesChangeResponsibiltyForLead");
            //            string directoryName = loginHelper.GetnewDirectoryName(GetPath());
            //            var location = directoryName + "\\BulkUpdatesChangeResponsibiltyForLead.png";
            //            loginHelper.AddAttachment(location, id);
            //        }
            //    }
            //    else
            //    {
            //        if (Int16.Parse(counter) < 9)
            //        {
            //            executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
            //            TakeScreenshot("Bulk UpdatesChangeResponsibiltyForLead");
            //            string id = loginHelper.getIssueID("Bulk Updates Change Responsibilty For Lead");
            //            string directoryName = loginHelper.GetnewDirectoryName(GetPath());
            //            var location = directoryName + "\\BulkUpdatesChangeResponsibiltyForLead.png";
            //            loginHelper.AddAttachment(location, id);
            //            loginHelper.AddComment(loginHelper.getIssueID("Bulk Updates Change Responsibilty For Lead"), "This issue is still occurring");
            //        }
            //    }
            //    JIRA = loginHelper.getIssueID("Bulk Updates Change Responsibilty For Lead");
            //    //    executionLog.DeleteFile("Error");
            //    throw;

            //}
            //finally
            //{
            //    executionLog.DeleteFile("BulkUpdatesChangeResponsibiltyForLead");
            //    executionLog.WriteInExcel("Bulk Updates Change Responsibilty For Lead", Status, JIRA, "Leads Management");
            //}
        }
示例#30
0
        public void verifyStartAndDueTimeOfTaskUnderLeadAndMerchant()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

            //Initializing the objects
            var executionLog                 = new ExecutionLog();
            var loginHelper                  = new LoginHelper(GetWebDriver());
            var office_ClientsHelper         = new Office_ClientsHelper(GetWebDriver());
            var office_LeadsHelper           = new Office_LeadsHelper(GetWebDriver());
            var officeActivities_TasksHelper = new OfficeActivities_TasksHelper(GetWebDriver());
            var officeActivities_NotesHelper = new OfficeActivities_NotesHelper(GetWebDriver());


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

            // Variable
            var Subject = "Testtask" + RandomNumber(99, 99999);

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

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

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

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Go to All leads page");
                VisitOffice("leads");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Verify page title.");
                VerifyTitle("Leads");

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on a lead");
                office_LeadsHelper.ClickElement("FirstLead");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on Add Note button");
                office_LeadsHelper.ClickElement("AddNote");
                office_LeadsHelper.WaitForWorkAround(3000);
                office_LeadsHelper.SwitchToWindow();

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Enter Subject of note");
                officeActivities_NotesHelper.TypeText("Subject", Subject);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Select Add Task check box");
                officeActivities_NotesHelper.ClickElement("AddTaskChkBox");
                officeActivities_NotesHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Enter Start Date of task");
                officeActivities_TasksHelper.TypeText("StartDate", "2017-10-10");

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Enter End Date of task");
                officeActivities_TasksHelper.TypeText("DueDate", "2017-10-10");

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on Save button");
                officeActivities_NotesHelper.ClickForce("Save");
                //officeActivities_TasksHelper.SwitchToWindow();
                officeActivities_TasksHelper.WaitForWorkAround(3000);
                officeActivities_TasksHelper.SwitchToWindow();
                officeActivities_TasksHelper.WaitForWorkAround(3000);
                office_LeadsHelper.WaitForText("Note successfully Created.", 05);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Select Activity Type >> Tasks");
                office_LeadsHelper.WaitForWorkAround(3000);
                office_LeadsHelper.SelectByText("SelectActivityType", "Tasks");
                office_LeadsHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Search Task by name");
                office_LeadsHelper.TypeText("ActivitySubject", Subject);
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Open task");
                office_LeadsHelper.ClickForce("ClickNotes1");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on Edit button");
                officeActivities_TasksHelper.ClickElement("EditBtn");
                officeActivities_TasksHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Verify Start Time");
                officeActivities_TasksHelper.VerifySelectdOptn("StartHour", "01");
                officeActivities_TasksHelper.VerifySelectdOptn("StartMin", "00");
                officeActivities_TasksHelper.VerifySelectdOptn("StartAMPM", "AM");

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Verify Due Time");
                officeActivities_TasksHelper.VerifySelectdOptn("DueHour", "01");
                officeActivities_TasksHelper.VerifySelectdOptn("DueMin", "15");
                officeActivities_TasksHelper.VerifySelectdOptn("DueAMPM", "AM");

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Go to All merchants page");
                VisitOffice("clients");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Verify page title.");
                VerifyTitle("Clients");

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on a merchant");
                office_ClientsHelper.ClickElement("Client1");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on Add Note button");
                office_ClientsHelper.ClickElement("AddNotes");
                office_ClientsHelper.WaitForWorkAround(3000);
                office_ClientsHelper.SwitchToWindow();

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Enter Subject of note");
                officeActivities_NotesHelper.TypeText("Subject", Subject);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Select Add Task check box");
                officeActivities_NotesHelper.ClickElement("AddTaskChkBox");
                officeActivities_NotesHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Enter Start Date of task");
                officeActivities_TasksHelper.TypeText("StartDate", "2017-10-10");

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Enter End Date of task");
                officeActivities_TasksHelper.TypeText("DueDate", "2017-10-10");

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on Save button");
                officeActivities_NotesHelper.ClickForce("Save");
                //officeActivities_TasksHelper.SwitchToWindow();
                officeActivities_TasksHelper.WaitForWorkAround(3000);
                officeActivities_TasksHelper.SwitchToWindow();
                officeActivities_TasksHelper.WaitForWorkAround(3000);
                office_ClientsHelper.WaitForText("Note successfully Created.", 05);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Select Activity Type >> Tasks");
                office_ClientsHelper.WaitForWorkAround(3000);
                office_ClientsHelper.SelectByText("ActivityType", "Tasks");
                office_ClientsHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Search Task by name");
                office_ClientsHelper.TypeText("SearchActivity", Subject);
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Open task");
                office_ClientsHelper.ClickForce("Activity1");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on Edit button");
                officeActivities_TasksHelper.ClickElement("EditBtn");
                officeActivities_TasksHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Verify Start Time");
                officeActivities_TasksHelper.VerifySelectdOptn("StartHour", "01");
                officeActivities_TasksHelper.VerifySelectdOptn("StartMin", "00");
                officeActivities_TasksHelper.VerifySelectdOptn("StartAMPM", "AM");

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Verify Due Time");
                officeActivities_TasksHelper.VerifySelectdOptn("DueHour", "01");
                officeActivities_TasksHelper.VerifySelectdOptn("DueMin", "15");
                officeActivities_TasksHelper.VerifySelectdOptn("DueAMPM", "AM");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Start And Due Time Of Task Under Lead And Merchant");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Start And Due Time Of Task Under Lead And Merchant", "Bug", "Medium", "Leads and Merchants page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Start And Due Time Of Task Under Lead And Merchant");
                        TakeScreenshot("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant");
                        string id            = loginHelper.getIssueID("Verify Start And Due Time Of Task Under Lead And Merchant");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Start And Due Time Of Task Under Lead And Merchant"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Start And Due Time Of Task Under Lead And Merchant");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant");
                executionLog.WriteInExcel("Verify Start And Due Time Of Task Under Lead And Merchant", Status, JIRA, "Office Leads And Merchants");
            }
        }