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 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");
            }
        }
        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");
            }
        }
Esempio n. 4
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 createAndMergeLeads()
        {
            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("CreateAndMergeLeads", "Login with valid credential  Username");
                Login(username[0], password[0]);

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

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

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

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

                executionLog.Log("CreateAndMergeLeads", "Enter Last Name");
                office_LeadsHelper.TypeText("LeadLastName", LName);

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

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

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

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

                executionLog.Log("CreateAndMergeLeads", "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("CreateAndMergeLeads", "Click on Duplicate");
                    office_LeadsHelper.ClickOnDisplayed("CraeteLeadDub");
                    office_LeadsHelper.WaitForText("Lead saved successfully.", 10);
                }
                else
                {
                    Console.WriteLine("We are in first else cond as lead is not duplicate !!");
                    executionLog.Log("CreateAndMergeLeads", "Wait for Confirmation");
                    office_LeadsHelper.WaitForText("Lead saved successfully.", 10);

                    executionLog.Log("CreateAndMergeLeads", "Go to Create Lead");
                    VisitOffice("leads/create");

                    executionLog.Log("CreateAndMergeLeads", "Save");
                    office_LeadsHelper.ClickElement("SaveLeadNewSkin");
                    office_LeadsHelper.WaitForWorkAround(2000);

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

                    executionLog.Log("CreateAndMergeLeads", "Enter Last Name");
                    office_LeadsHelper.TypeText("LeadLastName", LName);

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

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

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

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

                    executionLog.Log("CreateAndMergeLeads", "Verify Responsibilties");
                    office_LeadsHelper.SelectByText("Responsibility", "Howard Tang");

                    executionLog.Log("CreateAndMergeLeads", "Save");
                    office_LeadsHelper.ClickElement("SaveLeadNewSkin");
                    office_LeadsHelper.WaitForWorkAround(3000);
                }
                if (office_LeadsHelper.IsElementPresent(loc))
                {
                    Console.WriteLine("We are in second If condition as second lead is duplicate !!");
                    executionLog.Log("CreateAndMergeLeads", "Lead Duplicate Button");

                    office_LeadsHelper.ClickElement("DuplicateRadio");

                    office_LeadsHelper.ClickOnDisplayed("CraeteLeadDub");
                    office_LeadsHelper.WaitForWorkAround(10000);

                    executionLog.Log("CreateAndMergeLeads", "Waig for success message.");
                    office_LeadsHelper.WaitForText("Lead saved successfully. .", 10);

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

                    executionLog.Log("CreateAndMergeLeads", "Click First lead");
                    office_LeadsHelper.ClickElement("ClickOn1stOpp");
                    office_LeadsHelper.WaitForWorkAround(1000);

                    executionLog.Log("CreateAndMergeLeads", "Click 2nd lead");
                    office_LeadsHelper.ClickElement("ClickOn2ndOpp");
                    office_LeadsHelper.WaitForWorkAround(1000);

                    executionLog.Log("CreateAndMergeLeads", "Click on Merge");
                    office_LeadsHelper.ClickElement("ClickOnMergeRecords");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("CreateAndMergeLeads", "Select primary lead.");
                    office_LeadsHelper.ClickElement("LeadCompyRadioBtn");
                    office_LeadsHelper.WaitForWorkAround(1000);

                    executionLog.Log("CreateAndMergeLeads", "Click Merge");
                    office_LeadsHelper.ClickElement("ClickOnMergeBtn");
                    office_LeadsHelper.AcceptAlert();

                    executionLog.Log("CreateAndMergeLeads", "Wait for Confirmation");
                    office_LeadsHelper.WaitForText("Merging Lead(s) Completed Successfully.", 20);
                }
                else
                {
                    Console.WriteLine("We are in second else cond as second lead is not duplicate !!");
                    executionLog.Log("CreateAndMergeLeads", "Wait for Confirmation");
                    office_LeadsHelper.WaitForText("Lead saved successfully.", 10);

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

                    executionLog.Log("CreateAndMergeLeads", "Click on 1st lead");
                    office_LeadsHelper.ClickElement("ClickOn1stOpp");
                    office_LeadsHelper.WaitForWorkAround(1000);

                    executionLog.Log("CreateAndMergeLeads", "Click on 2nd lead");
                    office_LeadsHelper.ClickElement("ClickOn2ndOpp");
                    office_LeadsHelper.WaitForWorkAround(1000);

                    executionLog.Log("CreateAndMergeLeads", "Click on Merge");
                    office_LeadsHelper.ClickElement("ClickOnMergeRecords");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("CreateAndMergeLeads", "Choose Company To Merge");
                    office_LeadsHelper.ClickElement("LeadCompyRadioBtn");
                    office_LeadsHelper.WaitForWorkAround(1000);

                    executionLog.Log("CreateAndMergeLeads", "Click on Merge");
                    office_LeadsHelper.ClickElement("ClickOnMergeBtn");
                    office_LeadsHelper.AcceptAlert();

                    executionLog.Log("CreateAndMergeLeads", "Confirmation");
                    office_LeadsHelper.WaitForText("Merging Lead(s) Completed Successfully.", 10);
                    office_LeadsHelper.WaitForWorkAround(3000);
                }

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

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

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

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

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

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

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

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

                executionLog.Log("CreateAndMergeLeads", "Select All responsibity");
                office_LeadsHelper.SelectDropDownByText("//*[@id='gs_owner']", "All");
                office_LeadsHelper.WaitForWorkAround(4000);

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

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

                executionLog.Log("CreateAndMergeLeads", "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("CreateAndMergeLeads");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("CreateAndMergeLeads");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("CreateAndMergeLeads", "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("CreateAndMergeLeads");
                        TakeScreenshot("CreateAndMergeLeads");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\Create And Merge Leads.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("CreateAndMergeLeads");
                        string id            = loginHelper.getIssueID("CreateAndMergeLeads");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\Create And Merge Leads.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("CreateAndMergeLeads"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("CreateAndMergeLeads");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("CreateAndMergeLeads");
                executionLog.WriteInExcel("CreateAndMergeLeads", Status, JIRA, "Leads Management");
            }
        }
Esempio n. 6
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");
            }
        }
Esempio n. 7
0
        public void verifyLeadToMerchantCoversion()
        {
            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 name    = "TestEmployee" + GetRandomNumber();
            var Company = "My Company" + RandomNumber(1, 999);
            var LocDub  = "//button[text()='Create Duplicate']";

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

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

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

                executionLog.Log("VerifyLeadToMerchantCoversion", "Redirect To create lead page");
                VisitOffice("leads/create");
                office_LeadsHelper.WaitForWorkAround(3000);

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

                executionLog.Log("VerifyLeadToMerchantCoversion", "Enter Last Name");
                office_LeadsHelper.TypeText("LastName", "Tester");

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

                executionLog.Log("VerifyLeadToMerchantCoversion", "Select Lead Status");
                office_LeadsHelper.Select("LeadStatus", "New");
                office_LeadsHelper.WaitForWorkAround(3000);

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

                executionLog.Log("VerifyLeadToMerchantCoversion", "Click on Save");
                office_LeadsHelper.ClickElement("Save");
                office_LeadsHelper.WaitForWorkAround(5000);

                if (office_LeadsHelper.IsElementPresent(LocDub))
                {
                    office_LeadsHelper.Click(LocDub);
                }

                executionLog.Log("VerifyLeadToMerchantCoversion", "Click on Convert");
                office_LeadsHelper.ClickElement("ClickConvert");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyLeadToMerchantCoversion", "Click on Meeting check box");
                office_LeadsHelper.ClickElement("MeetingChkBx");

                executionLog.Log("VerifyLeadToMerchantCoversion", "Click on Tasks check box");
                office_LeadsHelper.ClickElement("TasksChkBx");

                executionLog.Log("VerifyLeadToMerchantCoversion", "Click on Emails check box");
                office_LeadsHelper.ClickElement("EmailChkBx");

                executionLog.Log("VerifyLeadToMerchantCoversion", "Click on Calls check box");
                office_LeadsHelper.ClickElement("CallsChkBx");

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

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

                executionLog.Log("VerifyLeadToMerchantCoversion", "Verify 500 Error not occurred");
                Assert.IsFalse(GetWebDriver().PageSource.Contains("Internal Server Error"));

                executionLog.Log("VerifyLeadToMerchantCoversion", "Redirect To create lead page");
                VisitOffice("leads/recyclebin");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyLeadToMerchantCoversion", "Search lead in recycle bin");
                office_LeadsHelper.TypeText("SearchLeadRbin", Company);
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyLeadToMerchantCoversion", "Select All responsibity");
                office_LeadsHelper.SelectDropDownByText("//*[@id='gs_owner']", "All");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyLeadToMerchantCoversion", "Click on delete icon");
                office_LeadsHelper.ClickElement("DeleteRbin");

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

                executionLog.Log("VerifyLeadToMerchantCoversion", "Verify  delete 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("VerifyLeadToMerchantCoversion");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Lead To Merchant Coversion");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Lead To Merchant Coversion", "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 Lead To Merchant Coversion");
                        TakeScreenshot("VerifyLeadToMerchantCoversion");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyLeadToMerchantCoversion.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyLeadToMerchantCoversion");
                        string id            = loginHelper.getIssueID("Verify Lead To Merchant Coversion");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyLeadToMerchantCoversion.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Lead To Merchant Coversion"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Lead To Merchant Coversion");
                //    executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyLeadToMerchantCoversion");
                executionLog.WriteInExcel("Verify Lead To Merchant Coversion", Status, JIRA, "Leads Management");
            }
        }
Esempio n. 8
0
        public void getDeafultRatesAndFeesLead()
        {
            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    name   = "TestEmployee" + GetRandomNumber();
            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("GetDeafultRatesAndFeesLead", "Login with valid username and password");
                Login(username[0], password[0]);
                Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]);

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

                executionLog.Log("GetDeafultRatesAndFeesLead", "Redirect at create leads page.");
                VisitOffice("leads/create");

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

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

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

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

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

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

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

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

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

                executionLog.Log("GetDeafultRatesAndFeesLead", "Click on rate and fee tab");
                office_LeadsHelper.ClickElement("ClickOnRateFees");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("GetDeafultRatesAndFeesLead", " Select Processor RF");
                office_LeadsHelper.Select("SelectProcessorRFL", "First Data Omaha");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("GetDeafultRatesAndFeesLead", " Seleect Merchant RF");
                office_LeadsHelper.Select("SeleectMerchantRFL", "Test201603110126447213");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("GetDeafultRatesAndFeesLead", " Select Accepting method.");
                office_LeadsHelper.Select("LeadAcceptingMethod", "Manually Swiped");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("GetDeafultRatesAndFeesLead", "Click On Get Default Rates");
                office_LeadsHelper.ClickElement("ClickOnGetDefaultRatesL");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("GetDeafultRatesAndFeesLead", "Accept ALERT");
                office_LeadsHelper.AcceptAlert();
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("GetDeafultRatesAndFeesLead", "Verify populated field");
                office_LeadsHelper.IsElementPresent("VerifyPopulatedFiedlL");
                office_LeadsHelper.WaitForWorkAround(3000);

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

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

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

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

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

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

                executionLog.Log("GetDeafultRatesAndFeesLead", "Verify title as recycled leads.");
                VerifyTitle("Recycled Leads");

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

                executionLog.Log("GetDeafultRatesAndFeesLead", "Verify permanently delete confoirmation 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("GetDeafultRatesAndFeesLead");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Get Deafult Rates And Fees Lead");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Get Deafult Rates And Fees Lead", "Bug", "Medium", "Create Lead page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Get Deafult Rates And Fees Lead");
                        TakeScreenshot("GetDeafultRatesAndFeesLead");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\GetDeafultRatesAndFeesLead.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("GetDeafultRatesAndFeesLead");
                        string id            = loginHelper.getIssueID("Get Deafult Rates And Fees Lead");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\GetDeafultRatesAndFeesLead.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Get Deafult Rates And Fees Lead"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Get Deafult Rates And Fees Lead");
                //    executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("GetDeafultRatesAndFeesLead");
                executionLog.WriteInExcel("Get Deafult Rates And Fees Lead", Status, JIRA, "Leads Management");
            }
        }
Esempio n. 9
0
        public void activitiesDocumentManagement()
        {
            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() + "leadslist.csv";
            String InvalidFile = GetPathToFile() + "chrome.exe";
            String JIRA        = "";
            String Status      = "Pass";


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

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

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

                executionLog.Log("ActivitiesDocumentManagement", "Redirect to create document page");
                VisitOffice("documents/create");
                officeActivities_DocumentsHelper.WaitForWorkAround(2000);

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

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

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

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

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

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

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

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

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

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

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

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

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

                executionLog.Log("ActivitiesDocumentManagement", "Search document by name.");
                officeActivities_DocumentsHelper.TypeText("SearchDocumet", name);
                officeActivities_DocumentsHelper.WaitForWorkAround(2000);

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

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

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

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

                executionLog.Log("ActivitiesDocumentManagement", "Click on any client.");
                officeActivities_DocumentsHelper.ClickElement("AssignUser");
                //officeActivities_DocumentsHelper.WaitForWorkAround(3000);

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

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

                executionLog.Log("ActivitiesDocumentManagement", "Redirect at clients page.");
                VisitOffice("clients");
                office_ClientsHelper.WaitForWorkAround(2000);

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

                executionLog.Log("ActivitiesDocumentManagement", "Select actitivity type as documents.");
                office_ClientsHelper.SelectByText("SelectActivityType", "Documents");

                executionLog.Log("ActivitiesDocumentManagement", "Enter document name to be search.");
                office_ClientsHelper.TypeText("ActivitySubject", name);
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesDocumentManagement", "Select All in created by field");
                office_ClientsHelper.SelectByText("CreatedByField", "All");
                office_ClientsHelper.WaitForWorkAround(2000);

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

                executionLog.Log("ActivitiesDocumentManagement", "Redirect to document page");
                VisitOffice("documents");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement", "Search document by name.");
                officeActivities_DocumentsHelper.TypeText("SearchDocumet", name);
                officeActivities_DocumentsHelper.WaitForWorkAround(2000);

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

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

                executionLog.Log("ActivitiesDocumentManagement", "Select document related to.");
                officeActivities_DocumentsHelper.Select("ReletedTo", "14");
                //officeActivities_DocumentsHelper.WaitForWorkAround(3000);

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

                executionLog.Log("ActivitiesDocumentManagement", "Click on any lead.");
                officeActivities_DocumentsHelper.ClickElement("AssignUser");
                //officeActivities_DocumentsHelper.WaitForWorkAround(3000);

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

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

                executionLog.Log("ActivitiesDocumentManagement", "Redirect at leads page.");
                VisitOffice("leads");
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesDocumentManagement", "Click On any lead.");
                office_LeadsHelper.ClickElement("ClickAnyLead");
                office_ClientsHelper.WaitForWorkAround(2000);

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

                executionLog.Log("ActivitiesDocumentManagement", "Enter document name to be search.");
                office_LeadsHelper.TypeText("ActivitySubject", name);
                office_LeadsHelper.WaitForWorkAround(2000);

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

                executionLog.Log("ActivitiesDocumentManagement", "Redirect to document page");
                VisitOffice("documents");
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesDocumentManagement", "Search document by name.");
                officeActivities_DocumentsHelper.TypeText("SearchDocumet", name);
                officeActivities_DocumentsHelper.WaitForWorkAround(2000);

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

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

                executionLog.Log("ActivitiesDocumentManagement", "Select document parent/related to.");
                officeActivities_DocumentsHelper.Select("ReletedTo", "15");
                //officeActivities_DocumentsHelper.WaitForWorkAround(3000);

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

                executionLog.Log("ActivitiesDocumentManagement", "Click on any opportunity.");
                officeActivities_DocumentsHelper.ClickElement("AssignUser");
                //officeActivities_DocumentsHelper.WaitForWorkAround(3000);

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

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

                executionLog.Log("ActivitiesDocumentManagement", "Redirect at opportunities page.");
                VisitOffice("opportunities");
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesDocumentManagement", "Click On any opportunity.");
                office_OpportunitiesHelper.ClickElement("Opportunities1");
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesDocumentManagement", "Select actitivity type as documents");
                office_LeadsHelper.Select("SelectActivityType", "Documents");

                executionLog.Log("ActivitiesDocumentManagement", "Enter documents name to be search.");
                office_OpportunitiesHelper.TypeText("ActivitySubject", name);
                office_LeadsHelper.WaitForWorkAround(3000);

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

                executionLog.Log("ActivitiesDocumentManagement", "Redirect to document page");
                VisitOffice("documents");
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesDocumentManagement", "Search document by name.");
                officeActivities_DocumentsHelper.TypeText("SearchDocumet", name);
                officeActivities_DocumentsHelper.WaitForWorkAround(2000);

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

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

                executionLog.Log("ActivitiesDocumentManagement", "Select document related to.");
                officeActivities_DocumentsHelper.Select("ReletedTo", "36");
                //officeActivities_DocumentsHelper.WaitForWorkAround(3000);

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

                executionLog.Log("ActivitiesDocumentManagement", "Click on any ticket.");
                officeActivities_DocumentsHelper.ClickElement("AssignUser");
                //officeActivities_DocumentsHelper.WaitForWorkAround(3000);

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

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

                executionLog.Log("ActivitiesDocumentManagement", "Redirect at tickets page.");
                VisitOffice("tickets");
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesDocumentManagement", "Click On any ticket.");
                ticket_CreateATicketHelper.ClickElement("Ticket1");
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesDocumentManagement", "Select actitivity type as documents");
                office_LeadsHelper.Select("SelectActivityType", "Documents");

                executionLog.Log("ActivitiesDocumentManagement", "Enter document name to be search.");
                office_OpportunitiesHelper.TypeText("ActivitySubject", name);
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement", "Verify created document present on ticket page.");
                ticket_CreateATicketHelper.IsElementPresent("OpenTicket");

                executionLog.Log("ActivitiesDocumentManagement", "Redirect to document page");
                VisitOffice("documents");
                office_ClientsHelper.WaitForWorkAround(2000);

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

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

                executionLog.Log("ActivitiesDocumentManagement", "Click on Checkbox");
                officeActivities_DocumentsHelper.ClickElement("CheckDocToDel");
                //officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement", "Click on Delete button");
                officeActivities_DocumentsHelper.ClickElement("DeleteDoc");
                //officeActivities_DocumentsHelper.WaitForWorkAround(3000);

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

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

                executionLog.Log("ActivitiesDocumentManagement", "Redirect at recyclebin page.");
                VisitOffice("documents/recyclebin");
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesDocumentManagement", "Verify page title.");
                VerifyTitle("Recycled Document");

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

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

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("ActivitiesDocumentManagement");
                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("ActivitiesDocumentManagement");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\ActivitiesDocumentManagement.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("ActivitiesDocumentManagement");
                        string id            = loginHelper.getIssueID("Activities Document Management");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\ActivitiesDocumentManagement.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("ActivitiesDocumentManagement");
                executionLog.WriteInExcel("Activities Document Management", Status, JIRA, "Office Activities");
            }
        }
        public void verifyLeadPDFTabError()
        {
            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 officeActivities_DocumentHelper = new OfficeActivities_DocumentHelper(GetWebDriver());
            var officeActivities_CallsHelper    = new OfficeActivities_CallsHelper(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);
            var    doc    = "Docname" + RandomNumber(99, 9999);
            var    file   = GetPathToFile() + "Up.jpg";
            String JIRA   = "";
            String Status = "Pass";

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

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

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

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

                executionLog.Log("VerifyLeadPDFTabError", "Enter Last Name");
                office_LeadsHelper.TypeText("LeadLastName", LName);

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

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

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

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

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

                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("VerifyLeadPDFTabError", "Click on Duplicate");
                    office_LeadsHelper.ClickOnDisplayed("CraeteLeadDub");
                    office_LeadsHelper.WaitForText("Lead saved successfully.", 10);

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

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

                    executionLog.Log("VerifyLeadPDFTabError", "Dearch lead by company name.");
                    office_LeadsHelper.TypeText("CompanySearch", CDBA);
                    office_LeadsHelper.WaitForWorkAround(2000);

                    executionLog.Log("VerifyLeadPDFTabError", "Click to view searched lead.");
                    office_LeadsHelper.ClickElement("Lead1");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyLeadPDFTabError", "Go to PDF Tab");
                    office_LeadsHelper.ClickElement("PDFTab");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyLeadPDFTabError", "Click on Add Document");
                    office_LeadsHelper.ClickElement("AddDocument");
                    office_LeadsHelper.WaitForWorkAround(1000);

                    executionLog.Log("VerifyLeadPDFTabError", "Enter document name");
                    officeActivities_DocumentHelper.TypeText("Name", doc);

                    executionLog.Log("VerifyLeadPDFTabError", "Upload file");
                    officeActivities_DocumentHelper.Upload("Attachment", file);
                    officeActivities_DocumentHelper.WaitForWorkAround(1000);

                    executionLog.Log("VerifyLeadPDFTabError", "Click Save button");
                    officeActivities_DocumentHelper.ClickElement("ClientPopupSave");
                    officeActivities_DocumentHelper.WaitForWorkAround(2000);

                    executionLog.Log("VerifyLeadPDFTabError", "Verify 500 Error not occured");
                    office_LeadsHelper.verifyElementPresent("AddDocument");

                    executionLog.Log("VerifyLeadPDFTabError", "Click on Log a Call");
                    office_LeadsHelper.ClickElement("LogACall");
                    office_LeadsHelper.WaitForWorkAround(1000);

                    executionLog.Log("VerifyLeadPDFTabError", "Enter from name");
                    officeActivities_CallsHelper.TypeText("CallFromName", "test1");

                    executionLog.Log("VerifyLeadPDFTabError", "Enter to name");
                    officeActivities_CallsHelper.TypeText("CallToName", "test2");

                    executionLog.Log("VerifyLeadPDFTabError", "Enter from number");
                    officeActivities_CallsHelper.TypeText("FromNumber", "4584698569");

                    executionLog.Log("VerifyLeadPDFTabError", "Enter to number");
                    officeActivities_CallsHelper.TypeText("CallTONumber", "6984589652");

                    executionLog.Log("VerifyLeadPDFTabError", "Click on Save button");
                    officeActivities_CallsHelper.ClickElement("PopupSave");
                    officeActivities_CallsHelper.WaitForWorkAround(2000);

                    executionLog.Log("VerifyLeadPDFTabError", "Verify 500 Error not occured");
                    office_LeadsHelper.verifyElementPresent("AddDocument");
                }
                else
                {
                    Console.WriteLine("We are in first else cond as lead is not duplicate !!");
                    executionLog.Log("VerifyLeadPDFTabError", "Wait for Confirmation");
                    office_LeadsHelper.WaitForText("Lead saved successfully.", 10);

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

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

                    executionLog.Log("VerifyLeadPDFTabError", "Dearch lead by company name.");
                    office_LeadsHelper.TypeText("CompanySearch", CDBA);
                    office_LeadsHelper.WaitForWorkAround(2000);

                    executionLog.Log("VerifyLeadPDFTabError", "Click to view searched lead.");
                    office_LeadsHelper.ClickElement("Lead1");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyLeadPDFTabError", "Go to PDF Tab");
                    office_LeadsHelper.ClickElement("PDFTab");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyLeadPDFTabError", "Click on Add Document");
                    office_LeadsHelper.ClickElement("AddDocument");
                    office_LeadsHelper.WaitForWorkAround(1000);

                    executionLog.Log("VerifyLeadPDFTabError", "Enter document name");
                    officeActivities_DocumentHelper.TypeText("Name", doc);

                    executionLog.Log("VerifyLeadPDFTabError", "Upload file");
                    officeActivities_DocumentHelper.Upload("Attachment", file);
                    officeActivities_DocumentHelper.WaitForWorkAround(1000);

                    executionLog.Log("VerifyLeadPDFTabError", "Click Save button");
                    officeActivities_DocumentHelper.ClickElement("ClientPopupSave");
                    officeActivities_DocumentHelper.WaitForWorkAround(2000);

                    executionLog.Log("VerifyLeadPDFTabError", "Verify 500 Error not occured");
                    office_LeadsHelper.verifyElementPresent("AddDocument");

                    executionLog.Log("VerifyLeadPDFTabError", "Click on Log a Call");
                    office_LeadsHelper.ClickElement("LogACall");
                    office_LeadsHelper.WaitForWorkAround(1000);

                    executionLog.Log("VerifyLeadPDFTabError", "Enter from name");
                    officeActivities_CallsHelper.TypeText("CallFromName", "test1");

                    executionLog.Log("VerifyLeadPDFTabError", "Enter to name");
                    officeActivities_CallsHelper.TypeText("CallToName", "test2");

                    executionLog.Log("VerifyLeadPDFTabError", "Enter from number");
                    officeActivities_CallsHelper.TypeText("FromNumber", "4584698569");

                    executionLog.Log("VerifyLeadPDFTabError", "Enter to number");
                    officeActivities_CallsHelper.TypeText("CallTONumber", "6984589652");

                    executionLog.Log("VerifyLeadPDFTabError", "Click on Save button");
                    officeActivities_CallsHelper.ClickElement("PopupSave");
                    officeActivities_CallsHelper.WaitForWorkAround(2000);

                    executionLog.Log("VerifyLeadPDFTabError", "Verify 500 Error not occured");
                    office_LeadsHelper.verifyElementPresent("AddDocument");
                }
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

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

                executionLog.Log("CreateLeadWithRequiredFieldNewSkin", "Click On Create");
                VisitOffice("leads/create");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadWithRequiredFieldNewSkin", "Select Salutation");
                office_LeadsHelper.Select("Salutaion", "Mr");

                executionLog.Log("CreateLeadWithRequiredFieldNewSkin", "Enter First Name");
                office_LeadsHelper.TypeText("FirstNameLead", FirstName);

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

                executionLog.Log("CreateLeadWithRequiredFieldNewSkin", "Enter Company Name ");
                office_LeadsHelper.TypeText("CompanyName", Company);

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

                executionLog.Log("CreateLeadWithRequiredFieldNewSkin", "Select Responsibity");
                office_LeadsHelper.SelectByText("Responsibility", "Howard Tang");

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

                executionLog.Log("CreateLeadWithRequiredFieldNewSkin", "Verify Save button working");
                VerifyTitle("Details");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadWithRequiredFieldNewSkin", "Redirect to leads page.");
                VisitOffice("leads");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadWithRequiredFieldNewSkin", "Enter Company Name in search field ");
                office_LeadsHelper.TypeText("CompanySearch", Company);
                office_LeadsHelper.WaitForWorkAround(5000);

                office_LeadsHelper.ClickElement("Lead1");
                office_LeadsHelper.WaitForWorkAround(5000);

                office_LeadsHelper.IsElementPresent("//div[contains(text(),'Mr')]");
            }


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

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("CreateLeadWithRequiredFieldNewSkin");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Create Lead With Required Field NewSkin");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Create Lead With Required Field NewSkin", "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 With Required Field NewSkin");
                        TakeScreenshot("CreateLeadWithRequiredFieldNewSkin");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\CreateLeadWithRequiredFieldNewSkin.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("CreateLeadWithRequiredFieldNewSkin");
                        string id            = loginHelper.getIssueID("Create Lead With Required Field NewSkin");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\CreateLeadWithRequiredFieldNewSkin.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Create Lead With Required Field NewSkin"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Create Lead With Required Field NewSkin");
                // executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("CreateLeadWithRequiredFieldNewSkin");
                executionLog.WriteInExcel("Create Lead With Required Field NewSkin", Status, JIRA, "Leads Management");
            }
        }
Esempio n. 12
0
        public void activitiesNotesManagement()
        {
            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_NotesHelper = new OfficeActivities_NotesHelper(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   = "Note" + RandomNumber(1, 99);
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("ActivitiesNotesManagement", "Redirect at admin page.");
                VisitOffice("admin");

                executionLog.Log("ActivitiesNotesManagement", "Go to notes page");
                VisitOffice("notes");
                officeActivities_NotesHelper.WaitForWorkAround(3000);

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

                executionLog.Log("ActivitiesNotesManagement", " Click On Create");
                officeActivities_NotesHelper.ClickElement("Create");
                officeActivities_NotesHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesNotesManagement", "Verify page title");
                VerifyTitle("Create a New Note");

                executionLog.Log("ActivitiesNotesManagement", "Click on Save  ");
                officeActivities_NotesHelper.ClickElement("Save");

                executionLog.Log("ActivitiesNotesManagement", "Verify validation text for subject.");
                officeActivities_NotesHelper.VerifyText("SubjectError", "This field is required.");

                executionLog.Log("ActivitiesNotesManagement", "Enter note subject.");
                officeActivities_NotesHelper.TypeText("Subject", name);

                executionLog.Log("ActivitiesNotesManagement", "Click on save.");
                officeActivities_NotesHelper.ClickElement("Save");

                executionLog.Log("ActivitiesNotesManagement", "Wait for success text");
                officeActivities_NotesHelper.WaitForText("Note saved successfully. ", 10);
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesNotesManagement", "Enter Subject in Search field");
                officeActivities_NotesHelper.TypeText("EnterSubject", name);
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesNotesManagement", "Select All in created by field");
                officeActivities_NotesHelper.SelectByText("CreatedbyField", "All");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesNotesManagement", "Click on Edit");
                officeActivities_NotesHelper.ClickElement("Edit");
                VerifyTitle("Edit Note");

                executionLog.Log("ActivitiesNotesManagement", "Select note parent");
                officeActivities_NotesHelper.Select("NoteParent", "20");

                executionLog.Log("ActivitiesNotesManagement", "Click on find list icon.");
                officeActivities_NotesHelper.ClickElement("SelectClient");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesNotesManagement", " Click On any client.");
                officeActivities_NotesHelper.ClickElement("ClickONClientNS");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesNotesManagement", "Click on save button.");
                officeActivities_NotesHelper.ClickElement("Save");

                executionLog.Log("ActivitiesNotesManagement", "Verify note updated successfully");
                officeActivities_NotesHelper.WaitForText("Note Updated Success.", 10);

                executionLog.Log("ActivitiesNotesManagement", "Redirect at clients page.");
                VisitOffice("clients");
                officeActivities_NotesHelper.WaitForWorkAround(3000);

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

                executionLog.Log("ActivitiesNotesManagement", "Select actitivity type as notes.");
                office_ClientsHelper.Select("SelectActivityType", "Notes");

                executionLog.Log("ActivitiesNotesManagement", "Enter note name to be search.");
                office_ClientsHelper.TypeText("ActivitySubject", name);
                office_ClientsHelper.WaitForWorkAround(2000);

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

                executionLog.Log("ActivitiesNotesManagement", "Go to note page");
                VisitOffice("notes");
                officeActivities_NotesHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesNotesManagement", "Verify page title");
                VerifyTitle("Notes");
                //officeActivities_NotesHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesNotesManagement", "Enter Subject in Search field");
                officeActivities_NotesHelper.TypeText("EnterSubject", name);
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesNotesManagement", "Select All in created by field");
                officeActivities_NotesHelper.SelectByText("CreatedbyField", "All");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesNotesManagement", "Click on Edit");
                officeActivities_NotesHelper.ClickElement("Edit");
                officeActivities_NotesHelper.WaitForWorkAround(3000);
                VerifyTitle("Edit Note");


                executionLog.Log("ActivitiesNotesManagement", "Select note parent as lead.");
                officeActivities_NotesHelper.Select("NoteParent", "14");

                executionLog.Log("ActivitiesNotesManagement", "Click on find list icon.");
                officeActivities_NotesHelper.ClickElement("SelectClient");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesNotesManagement", " Click On any opportunity");
                officeActivities_NotesHelper.ClickElement("ClickONClientNS");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesNotesManagement", "Click on save button.");
                officeActivities_NotesHelper.ClickElement("Save");

                executionLog.Log("ActivitiesNotesManagement", "Verify note updated successfully");
                officeActivities_NotesHelper.WaitForText("Note Updated Success.", 10);

                executionLog.Log("ActivitiesNotesManagement", "Redirect at leads page.");
                VisitOffice("leads");
                officeActivities_NotesHelper.WaitForWorkAround(3000);

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

                executionLog.Log("ActivitiesNotesManagement", "Select actitivity type as notes.");
                office_LeadsHelper.Select("SelectActivityType", "Notes");

                executionLog.Log("ActivitiesNotesManagement", "Enter note name to be search.");
                office_LeadsHelper.TypeText("ActivitySubject", name);
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesNotesManagement", "Select All in created by field");
                office_LeadsHelper.SelectByText("CreatedByField", "All");
                office_LeadsHelper.WaitForWorkAround(2000);

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

                executionLog.Log("ActivitiesNotesManagement", "Go to note page");
                VisitOffice("notes");
                officeActivities_NotesHelper.WaitForWorkAround(3000);

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

                executionLog.Log("ActivitiesNotesManagement", "Enter Subject in Search field");
                officeActivities_NotesHelper.TypeText("EnterSubject", name);
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesNotesManagement", "Select All in created by field");
                officeActivities_NotesHelper.SelectByText("CreatedbyField", "All");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesNotesManagement", "Click on Edit");
                officeActivities_NotesHelper.ClickElement("Edit");
                VerifyTitle("Edit Note");

                executionLog.Log("ActivitiesNotesManagement", "Select note parent as opportunity.");
                officeActivities_NotesHelper.Select("NoteParent", "15");

                executionLog.Log("ActivitiesNotesManagement", "Click on findlist icon.");
                officeActivities_NotesHelper.ClickElement("SelectClient");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesNotesManagement", " Click On any opportunity");
                officeActivities_NotesHelper.ClickElement("ClickONClientNS");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesNotesManagement", "Edit on Save Btn");
                officeActivities_NotesHelper.ClickElement("Save");

                executionLog.Log("ActivitiesNotesManagement", "Verify note updated successfully");
                officeActivities_NotesHelper.WaitForText("Note Updated Success.", 10);

                executionLog.Log("ActivitiesNotesManagement", "Redirect at opportunities page.");
                VisitOffice("opportunities");
                officeActivities_NotesHelper.WaitForWorkAround(3000);

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

                executionLog.Log("ActivitiesNotesManagement", "Select actitivity type as notes");
                office_LeadsHelper.Select("SelectActivityType", "Notes");

                executionLog.Log("ActivitiesNotesManagement", "Enter notes name to be search.");
                office_OpportunitiesHelper.TypeText("ActivitySubject", name);
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesNotesManagement", "Select All in created by field");
                office_OpportunitiesHelper.SelectByText("CreateByField", "All");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

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

                executionLog.Log("ActivitiesNotesManagement", "Go to note page");
                VisitOffice("notes");
                officeActivities_NotesHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesNotesManagement", "Verify title");
                VerifyTitle("Notes");

                executionLog.Log("ActivitiesNotesManagement", "Enter Subject in Search field");
                officeActivities_NotesHelper.TypeText("EnterSubject", name);
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesNotesManagement", "Select All in created by field");
                officeActivities_NotesHelper.SelectByText("CreatedbyField", "All");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesNotesManagement", "Click on Edit");
                officeActivities_NotesHelper.ClickElement("Edit");
                VerifyTitle("Edit Note");

                executionLog.Log("ActivitiesNotesManagement", "Select note parent as tickets.");
                officeActivities_NotesHelper.Select("NoteParent", "36");

                executionLog.Log("ActivitiesNotesManagement", "Click on find list icon.");
                officeActivities_NotesHelper.ClickElement("SelectClient");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesNotesManagement", " Click On any ticket.");
                officeActivities_NotesHelper.ClickElement("ClickONClientNS");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesNotesManagement", "Edit on Save Btn");
                officeActivities_NotesHelper.ClickElement("Save");

                executionLog.Log("ActivitiesNotesManagement", "Verify note updated successfully");
                officeActivities_NotesHelper.WaitForText("Note Updated Success.", 10);

                executionLog.Log("ActivitiesNotesManagement", "Redirect at tickets page.");
                VisitOffice("tickets");
                officeActivities_NotesHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesNotesManagement", "Click On any ticket.");
                ticket_CreateATicketHelper.ClickElement("Ticket1");
                officeActivities_NotesHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesNotesManagement", "Select actitivity type as notes");
                office_LeadsHelper.Select("SelectActivityType", "Notes");

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

                executionLog.Log("ActivitiesNotesManagement", "Select All in created by field");
                office_OpportunitiesHelper.SelectByText("CreateByField", "All");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesNotesManagement", "Verify created note present on ticket page.");
                ticket_CreateATicketHelper.IsElementPresent("OpenTicket");

                executionLog.Log("ActivitiesNotesManagement", "Go to note page");
                VisitOffice("notes");
                officeActivities_NotesHelper.WaitForWorkAround(3000);

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

                executionLog.Log("ActivitiesNotesManagement", "Enter Subject in Search field");
                officeActivities_NotesHelper.TypeText("EnterSubject", name);
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesNotesManagement", "Select All in created by field");
                officeActivities_NotesHelper.SelectByText("CreatedbyField", "All");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesNotesManagement", "Select First Note");
                officeActivities_NotesHelper.ClickElement("SelectNote1");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesNotesManagement", "Click Delete btn  ");
                officeActivities_NotesHelper.ClickElement("DeleteNote");

                executionLog.Log("ActivitiesNotesManagement", "Accept alert message. ");
                officeActivities_NotesHelper.AcceptAlert();

                executionLog.Log("ActivitiesNotesManagement", "Wait for delete message. ");
                officeActivities_NotesHelper.WaitForText("Note deleted successfully", 10);

                executionLog.Log("ActivitiesNotesManagement", "Redirect to recycle bin");
                VisitOffice("notes/recyclebin");
                officeActivities_NotesHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesNotesManagement", "Enter Subject in Search field");
                officeActivities_NotesHelper.TypeText("EnterSubject", name);
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesNotesManagement", "Select All in created by field");
                officeActivities_NotesHelper.SelectByText("CreatedbyField", "All");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesNotesManagement", "Click on delete icon.");
                officeActivities_NotesHelper.ClickElement("DeleteNoteRBin");
                //officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesNotesManagement", "Accept alert message.");
                officeActivities_NotesHelper.AcceptAlert();
                //officeActivities_NotesHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesNotesManagement", "Wait for success message.");
                officeActivities_NotesHelper.WaitForText("Note Permanently Deleted.", 5);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

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

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

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

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

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

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

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

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

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

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

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

                    executionLog.Log("LeadPhoneUpdate", "Click on duplicate btn");
                    office_LeadsHelper.Click(LocDub);
                    office_LeadsHelper.WaitForWorkAround(1000);

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

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

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

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

                    executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Click on save button.");
                    office_LeadsHelper.ClickElement("SaveLead");

                    executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Click on info tab.");
                    office_LeadsHelper.ClickElement("InfoTab");

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

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

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

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

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

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

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

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

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

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

                    executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Wait for confirmation.");
                    office_LeadsHelper.WaitForText("Lead Permanently Deleted.", 10);
                }
                else
                {
                    executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Wait for Confirmation");
                    office_LeadsHelper.WaitForText("Lead saved successfully.", 10);

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

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

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

                    executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Click on save button.");
                    office_LeadsHelper.ClickElement("SaveLeadButton");
                    office_LeadsHelper.WaitForWorkAround(5000);

                    executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Click on info tab.");
                    office_LeadsHelper.ClickElement("InfoTab");
                    office_LeadsHelper.WaitForWorkAround(3000);

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

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

                    executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "Redirect at leads page.");
                    VisitOffice("leads");
                    office_LeadsHelper.WaitForWorkAround(5000);

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

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

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

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

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

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

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

                    executionLog.Log("VerifyLeadsCreatedAndModifiedByCredentials", "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("VerifyLeadsCreatedAndModifiedByCredentials");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("VerifyLeadsCreatedAndModifiedByCredentials");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("VerifyLeadsCreatedAndModifiedByCredentials", "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("VerifyLeadsCreatedAndModifiedByCredentials");
                        TakeScreenshot("VerifyLeadsCreatedAndModifiedByCredentials");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyLeadsCreatedAndModifiedByCredentials.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyLeadsCreatedAndModifiedByCredentials");
                        string id            = loginHelper.getIssueID("VerifyLeadsCreatedAndModifiedByCredentials");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyLeadsCreatedAndModifiedByCredentials.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("VerifyLeadsCreatedAndModifiedByCredentials"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("VerifyLeadsCreatedAndModifiedByCredentials");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyLeadsCreatedAndModifiedByCredentials");
                executionLog.WriteInExcel("VerifyLeadsCreatedAndModifiedByCredentials", Status, JIRA, "Lead Management");
            }
        }