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

            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var    executionLog         = new ExecutionLog();
            var    loginHelper          = new LoginHelper(GetWebDriver());
            var    office_ClientsHelper = new Office_ClientsHelper(GetWebDriver());
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("ClientTextTab", "Go to client page");
                VisitOffice("clients");

                executionLog.Log("ClientTextTab", "Verify title");
                VerifyTitle();

                executionLog.Log("ClientTextTab", "Open a client");
                office_ClientsHelper.ClickElement("Client1");

                executionLog.Log("ClientTextTab", "Verify title");
                VerifyTitle(" Details");

                executionLog.Log("ClientTextTab", "Click on 'Owner' tab");
                office_ClientsHelper.ClickElement("OwnerTab");

                executionLog.Log("ClientTextTab", "Verify title");
                VerifyTitle(" Owners");

                executionLog.Log("ClientTextTab", "Verify text displayed properly");
                office_ClientsHelper.verifyElementVisible("TextOwnwerInfo");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            var oXMLData = new XMLParse();

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

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

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

            // Variable

            var    Subject = "Subject" + RandomNumber(1, 999);
            String JIRA    = "";
            String Status  = "Pass";

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

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

                executionLog.Log("ClientNotesUrlChange", "Go to Clients");
                VisitOffice("clients");
                office_ClientsHelper.WaitForWorkAround(3000);

                //executionLog.Log("ClientNotesUrlChange", "Search client by company name.");
                //office_ClientsHelper.TypeText("SearchClient", "Chy");
                //officeActivities_NotesHelper.WaitForWorkAround(6000);

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

                executionLog.Log("ClientNotesUrlChange", "Click On Show Activities");
                office_ClientsHelper.ClickElement("ShowClientActivity");
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("ClientNotesUrlChange", "Click On Client with notes");
                office_ClientsHelper.ClickElement("ClientWithNotes");
                //office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("ClientNotesUrlChange", "Click On Apply Filter");
                office_ClientsHelper.ClickElement("Apply");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ClientNotesUrlChange", "Click On Any Client");
                office_ClientsHelper.ClickElement("ClickOnAnyClient");
                office_ClientsHelper.WaitForWorkAround(3000);

                //VerifyTitle("Chy Company - Details");

                office_ClientsHelper.SelectByText("SelectActivityType", "Notes");
                office_ClientsHelper.WaitForWorkAround(2000);

                office_ClientsHelper.SelectByText("CreatedByField", "All");
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("ClientNotesUrlChange", "Click On Notes ");
                officeActivities_NotesHelper.ClickViaJavaScript("//table[@id='list1']//td[14]/a");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("ClientNotesUrlChange", "Change the url with the url number of another office");
                VisitOffice("notes/view/765513");
                officeActivities_NotesHelper.WaitForWorkAround(3000);

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

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

            var oXMLData = new XMLParse();

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

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

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

            var    DBA    = "Client" + RandomNumber(3333, 99999);
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("ClientMerchantIssue2", "Go to create a client page");
                VisitOffice("clients/create");

                executionLog.Log("ClientMerchantIssue2", "Verify title");
                VerifyTitle("Create a Client");

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

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

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

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

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

                executionLog.Log("ClientMerchantIssue2", "Click on 'CustomerRelation' tab");
                office_ClientsHelper.ClickElement("CustomerRelationship");

                executionLog.Log("ClientMerchantIssue2", "Verify CustomerRelation tab is present");
                office_ClientsHelper.verifyElementPresent("CustomerRelationHighlighted");

                executionLog.Log("ClientMerchantIssue2", "Verify Terminals tab not present");
                office_ClientsHelper.verifyElementNotPresent("TerminalsHighlighted");

                executionLog.Log("ClientMerchantIssue2", "Click on Terminals tab");
                office_ClientsHelper.ClickElement("TerminalsandEquipments");

                executionLog.Log("ClientMerchantIssue2", "Verify Terminals tab is present");
                office_ClientsHelper.verifyElementPresent("TerminalsHighlighted");

                executionLog.Log("ClientMerchantIssue2", "Verify Products tab not present");
                office_ClientsHelper.verifyElementNotPresent("ProductsHighlighted");

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

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

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

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

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

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

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

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

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

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

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

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

            var oXMLData = new XMLParse();

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

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

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

            // VARIABLE
            var    name   = "TestEmployee" + GetRandomNumber();
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("ClientCompanyMissingField", "Redirect To client page");
                VisitOffice("clients");
                office_ClientsHelper.WaitForWorkAround(4000);

                executionLog.Log("ClientCompanyMissingField", "Verify title");
                VerifyTitle();

                executionLog.Log("ClientCompanyMissingField", "Open client");
                office_ClientsHelper.ClickElement("Client1");
                office_ClientsHelper.WaitForWorkAround(4000);

                executionLog.Log("ClientCompanyMissingField", "Click on Contact details tab.");
                office_ClientsHelper.ClickElement("ContactDetails");
                office_ClientsHelper.WaitForWorkAround(6000);

                executionLog.Log("ClientCompanyMissingField", "Verify zip code present on page.");
                office_ClientsHelper.verifyElementVisible("ZipField");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("ClientCompanyMissingField");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Client Company Missing Field");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Client Company Missing Field", "Bug", "Medium", "Client page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Client Company Missing Field");
                        TakeScreenshot("ClientCompanyMissingField");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\ClientCompanyMissingField.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("ClientCompanyMissingField");
                        string id            = loginHelper.getIssueID("Client Company Missing Field");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\ClientCompanyMissingField.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Client Company Missing Field"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Client Company Missing Field");
                //    executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("ClientCompanyMissingField");
                executionLog.WriteInExcel("Client Company Missing Field", Status, JIRA, "Client Management");
            }
        }
Beispiel #6
0
        public void setFieldToDecimal()
        {
            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
            ExecutionLog executionLog         = new ExecutionLog();
            LoginHelper  loginHelper          = new LoginHelper(GetWebDriver());
            var          validate             = new AdminSetFormatFieldsHelper(GetWebDriver());
            var          office_ClientsHelper = new Office_ClientsHelper(GetWebDriver());

            //Random Variable
            String JIRA    = "";
            String Status  = "Pass";
            var    DBAName = "DBA@Company" + RandomNumber(1, 999);

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

                //executionLog.Log("AdminSetValidationDecimal", "Wait");
                //validate.WaitForWorkAround(4000);

                executionLog.Log("AdminSetValidationDecimal", "Verify Title Dashboard");
                VerifyTitle("Dashboard");

                //VisitOffice("clients");
                //validate.WaitForWorkAround(3000);

                //executionLog.Log("AdminSetValidationDecimal", "Click CompanySearchBar");
                //validate.ClickElement("CompanySearchBar");

                //executionLog.Log("AdminSetValidationDecimal", "Ttype Text Client's name");
                //validate.TypeText("CompanySearchBar", "Client's name");

                //executionLog.Log("AdminSetValidationDecimal", "Click FirstClient");
                //validate.ClickElement("FirstClient");

                //executionLog.Log("AdminSetValidationDecimal", "Click Contacts");
                //validate.ClickElement("Contacts");

                //executionLog.Log("AdminSetValidationDecimal", "Wait");
                //validate.WaitForElementPresent("Title", 2);

                //executionLog.Log("AdminSetValidationDecimal", "Click Save");
                //validate.ClickElement("Save");

                //executionLog.Log("AdminSetValidationDecimal", "Visit admin office");
                //VisitOffice("admin");

                //executionLog.Log("AdminSetValidationDecimal", "Wait");
                //validate.WaitForWorkAround(2000);

                VisitOffice("fields");
                validate.WaitForWorkAround(3000);

                validate.SelectByText("Module", "Clients");
                validate.WaitForWorkAround(2000);

                executionLog.Log("AdminSetValidationDecimal", "Select Processor as First Data North");
                validate.SelectByText("Processor", "First Data North");
                validate.WaitForWorkAround(2000);

                executionLog.Log("AdminSetValidationDecimal", "Select Tab as Contacts");
                validate.SelectByText("Tab", "Contacts");
                validate.WaitForWorkAround(2000);

                executionLog.Log("AdminSetValidationDecimal", "Select Section as Contacts");
                validate.SelectByText("Section", "Contacts");
                validate.WaitForWorkAround(2000);

                executionLog.Log("AdminSetValidationDecimal", "Click Search");
                validate.ClickElement("Search");
                validate.WaitForWorkAround(3000);

                executionLog.Log("AdminSetValidationDecimal", "Type title");
                validate.TypeText("filter", "Title");
                validate.WaitForWorkAround(3000);

                executionLog.Log("AdminSetValidationDecimal", "Click TitleField");
                validate.ClickElement("ContactTitle");
                validate.WaitForWorkAround(4000);

                executionLog.Log("AdminSetValidationDecimal", "Click ApplyDataTypeValidation");
                validate.checkAndClick("ProcApplyDataTypeValidation");
                validate.WaitForWorkAround(2000);

                executionLog.Log("AdminSetValidationDecimal", "Select data type as decimal.");
                validate.SelectByText("ProcFieldDataType", "Decimal");
                validate.WaitForWorkAround(2000);

                executionLog.Log("AdminSetValidationDecimal", "Click SaveFieldManager");
                validate.ClickElement("SaveFieldManager");
                validate.WaitForWorkAround(3000);

                executionLog.Log("AdminSetValidationDecimal", "Redirect at Create Client");
                VisitOffice("clients/create");
                validate.WaitForWorkAround(3000);

                executionLog.Log("AdminSetValidationDecimal", "Select Processor");
                office_ClientsHelper.SelectByText("CreateProc", "First Data North");

                executionLog.Log("AdminSetValidationDecimal", "Enter Client Dba Name");
                office_ClientsHelper.TypeText("ClientDBAName", DBAName);

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

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

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

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

                executionLog.Log("AdminSetValidationDecimal", "Click On Contact Tab Clinet");
                office_ClientsHelper.ClickElement("ContactDetails");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("AdminSetValidationDecimal", "Wait ");
                validate.WaitForElementPresent("Title", 1);
                validate.WaitForWorkAround(2000);

                executionLog.Log("AdminSetValidationDecimal", "Redirect To clients page. ");
                VisitOffice("clients");
                office_ClientsHelper.WaitForWorkAround(3000);

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

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

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

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

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

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

                executionLog.Log("AdminSetValidationDecimal", "Enter Company Name");
                office_ClientsHelper.TypeText("SearchClient", DBAName);
                office_ClientsHelper.WaitForWorkAround(3000);

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

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

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

                VisitOffice("fields");
                validate.WaitForWorkAround(3000);

                validate.SelectByText("Module", "Clients");
                validate.WaitForWorkAround(2000);

                executionLog.Log("AdminSetValidationDecimal", "Select Processor as First Data North");
                validate.SelectByText("Processor", "First Data North");
                validate.WaitForWorkAround(2000);

                executionLog.Log("AdminSetValidationDecimal", "Select Tab as Contacts");
                validate.SelectByText("Tab", "Contacts");
                validate.WaitForWorkAround(2000);

                executionLog.Log("AdminSetValidationDecimal", "Select Section as Contacts");
                validate.SelectByText("Section", "Contacts");
                validate.WaitForWorkAround(2000);

                executionLog.Log("AdminSetValidationDecimal", "Click Search");
                validate.ClickElement("Search");
                validate.WaitForWorkAround(3000);

                executionLog.Log("AdminSetValidationDecimal", "Type title");
                validate.TypeText("filter", "Title");
                validate.WaitForWorkAround(3000);

                executionLog.Log("AdminSetValidationDecimal", "Click TitleField");
                validate.ClickElement("ContactTitle");
                validate.WaitForWorkAround(4000);

                executionLog.Log("AdminSetValidationDecimal", "Click ApplyDataTypeValidation");
                validate.checkAndClick("ProcApplyDataTypeValidation");
                validate.WaitForWorkAround(2000);

                executionLog.Log("AdminSetValidationDecimal", "Click SaveFieldManager");
                validate.ClickElement("SaveFieldManager");
                validate.WaitForWorkAround(3000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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


            var DBA  = "ClientDBA" + RandomNumber(1, 500);
            var Code = "" + RandomNumber(1, 999);

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

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

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

                executionLog.Log("TSYSOwnerIdentificationType", "Go to All Processors");
                VisitOffice("processor_types");
                all_ProcessorsHelper.WaitForWorkAround(2000);

                executionLog.Log("TSYSOwnerIdentificationType", "Enter Processor Name In Search field");
                all_ProcessorsHelper.TypeText("SearchProcName", "TSYS");
                all_ProcessorsHelper.WaitForWorkAround(3000);

                var loc = "//table[@id='list1']/tbody[1]/tr[2]/td[@title='TSYS']";

                if (all_ProcessorsHelper.IsElementPresent(loc))
                {
                    Console.WriteLine("TSYS Processor found");
                    executionLog.Log("TSYSOwnerIdentificationType", "Go to All Merchants");
                    VisitOffice("clients");
                    office_ClientsHelper.WaitForWorkAround(2000);

                    executionLog.Log("TSYSOwnerIdentificationType", "Click on First Client");
                    office_ClientsHelper.ClickElement("Client1");
                    office_ClientsHelper.WaitForWorkAround(3000);

                    executionLog.Log("TSYSOwnerIdentificationType", "Go to Company Details Tab");
                    office_ClientsHelper.ClickElement("CompanyDetailsTab");
                    office_ClientsHelper.WaitForWorkAround(2000);

                    executionLog.Log("TSYSOwnerIdentificationType", "Select TSYS Processor");
                    office_ClientsHelper.Select("Processor", "TSYS");
                    office_ClientsHelper.WaitForWorkAround(3000);

                    executionLog.Log("TSYSOwnerIdentificationType", "Go to Owners Tab");
                    office_ClientsHelper.ClickElement("OwnerTab");
                    office_ClientsHelper.WaitForWorkAround(3000);

                    executionLog.Log("TSYSOwnerIdentificationType", "Click on Owner Identification drop down");
                    office_ClientsHelper.ClickElement("OwnerIdentificationType");

                    executionLog.Log("TSYSOwnerIdentificationType", "Verify options under drop down");
                    office_ClientsHelper.IsElementVisible("//option[@value='Driver&#039;s License']");
                    Console.WriteLine("Driver's Licence option present");
                    office_ClientsHelper.IsElementVisible("//option[@value='State ID']");
                    Console.WriteLine("State ID option present");
                    office_ClientsHelper.IsElementVisible("//option[@value='Passport']");
                    Console.WriteLine("Passport option present");
                    office_ClientsHelper.IsElementVisible("//option[@value='Miltary ID']");
                    Console.WriteLine("Miltary ID option present");
                }

                else
                {
                    Console.WriteLine("TSYS Processor not found. Hence creating one");
                    executionLog.Log("TSYSOwnerIdentificationType", "Click on Create button");
                    all_ProcessorsHelper.ClickElement("Create");
                    all_ProcessorsHelper.WaitForWorkAround(2000);

                    executionLog.Log("TSYSOwnerIdentificationType", "Enter Processor Name");
                    all_ProcessorsHelper.TypeText("ProcName", "TSYS");

                    executionLog.Log("TSYSOwnerIdentificationType", "Select Processor to fetch field from");
                    all_ProcessorsHelper.Select("FetchField", "TSYS");

                    executionLog.Log("TSYSOwnerIdentificationType", "Enter Processor Code");
                    all_ProcessorsHelper.TypeText("ProcCode", Code);

                    executionLog.Log("TSYSOwnerIdentificationType", "Click on Create button");
                    all_ProcessorsHelper.ClickElement("SaveBtn");
                    all_ProcessorsHelper.WaitForWorkAround(3000);

                    executionLog.Log("TSYSOwnerIdentificationType", "Go to All Merchants");
                    VisitOffice("clients");
                    office_ClientsHelper.WaitForWorkAround(2000);

                    executionLog.Log("TSYSOwnerIdentificationType", "Click on First Client");
                    office_ClientsHelper.ClickElement("Client1");
                    office_ClientsHelper.WaitForWorkAround(3000);

                    executionLog.Log("TSYSOwnerIdentificationType", "Go to Company Details Tab");
                    office_ClientsHelper.ClickElement("CompanyDetailsTab");
                    office_ClientsHelper.WaitForWorkAround(2000);

                    executionLog.Log("TSYSOwnerIdentificationType", "Select TSYS Processor");
                    office_ClientsHelper.Select("Processor", "TSYS");
                    office_ClientsHelper.WaitForWorkAround(3000);

                    executionLog.Log("TSYSOwnerIdentificationType", "Go to Owners Tab");
                    office_ClientsHelper.ClickElement("OwnerTab");
                    office_ClientsHelper.WaitForWorkAround(3000);

                    executionLog.Log("TSYSOwnerIdentificationType", "Click on Owner Identification drop down");
                    office_ClientsHelper.ClickElement("OwnerIdentificationType");

                    executionLog.Log("TSYSOwnerIdentificationType", "Verify options under drop down");
                    office_ClientsHelper.IsElementVisible("//option[@value='Driver&#039;s License']");
                    Console.WriteLine("Driver's Licence option present");
                    office_ClientsHelper.IsElementVisible("//option[@value='State ID']");
                    Console.WriteLine("State ID option present");
                    office_ClientsHelper.IsElementVisible("//option[@value='Passport']");
                    Console.WriteLine("Passport option present");
                    office_ClientsHelper.IsElementVisible("//option[@value='Miltary ID']");
                    Console.WriteLine("Miltary ID option present");
                }
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            var oXMLData = new XMLParse();

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

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

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

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

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

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

                executionLog.Log("VerifyQuickLookLabelsForClients", "Goto Create Client");
                VisitOffice("clients/create");
                office_ClientsHelper.WaitForWorkAround(2000);

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

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

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

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

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

                executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for client type.");
                office_ClientsHelper.VerifyText("ClientType", "Click to edit");
                //office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for status.");
                office_ClientsHelper.VerifyText("Status1", "New");
                //office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for source.");
                office_ClientsHelper.VerifyText("Source", "Select");
                //office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for category");
                office_ClientsHelper.VerifyText("Category", "Select");
                //office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for responsibility");
                office_ClientsHelper.VerifyText("Responsibilityl", "Howard Tang");
                //office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for account manager.");
                office_ClientsHelper.VerifyText("AccountManager", "Select");
                //office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for partner agent.");
                office_ClientsHelper.VerifyText("PartnerAgentl", "Select");
                //office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForClients", "Save Button");
                office_ClientsHelper.VerifyText("PartnerAssociationl", "Select Partner Association");
                //office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForClients", "Save Button");
                office_ClientsHelper.VerifyText("SalesManager", "Select");
                //office_ClientsHelper.WaitForWorkAround(3000);

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

                executionLog.Log("VerifyQuickLookLabelsForClients", "Enter the Ferderal tax id");
                office_ClientsHelper.TypeText("FederalTaxID", "123432232");
                //office_ClientsHelper.WaitForWorkAround(3000);

                //executionLog.Log("VerifyQuickLookLabelsForClients", "Click on assignments.");
                //office_ClientsHelper.ClickElement("EditAssignments");
                //office_ClientsHelper.WaitForWorkAround(3000);

                //executionLog.Log("VerifyQuickLookLabelsForClients", "Wait for locator to be present.");
                //office_ClientsHelper.WaitForElementPresent("Clientt", 10);

                executionLog.Log("VerifyQuickLookLabelsForClients", "Select client type.");
                office_ClientsHelper.Select("SelectClientT", "Processing");
                //office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForClients", "Select client refferal source.");
                office_ClientsHelper.Select("SelectSource", "Campaign");
                //office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForClients", "Select client category.");
                office_ClientsHelper.SelectByText("SelectCategory", "Other");
                //office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForClients", "Select account manager.");
                office_ClientsHelper.SelectByText("SelectAcc.Mger", "Howard Tang");
                //office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForClients", "Select client user group.");
                office_ClientsHelper.SelectByText("Ugroup", "Primary Group");
                //office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForClients", "Select sales manager.");
                office_ClientsHelper.SelectByText("SelectSalesManager", "Howard Tang");
                //office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForClients", "Select client responsibility");
                office_ClientsHelper.SelectByText("ClientResponsibility", "Howard Tang");
                //office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForClients", "Select partner agent.");
                office_ClientsHelper.SelectByText("ClientPartnerAgent", "Mark Menu");
                //office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForClients", "Select partner association.");
                office_ClientsHelper.SelectByText("ClientPartnerAssociation", "Aslam Associate");
                //office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForClients", "click on save client");
                office_ClientsHelper.ClickElement("SaveButtonByTitle");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForClients", "click on info tab.");
                office_ClientsHelper.ClickElement("InfoTab");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for client type.");
                office_ClientsHelper.VerifyText("ClientType", "Processing");
                //office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for status.");
                office_ClientsHelper.VerifyText("Status1", "New");
                //office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for source.");
                office_ClientsHelper.VerifyText("Source", "Campaign");
                //office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for category.");
                office_ClientsHelper.VerifyText("Category", "Other");
                office_ClientsHelper.WaitForWorkAround(3000);

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

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

                executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for partner agent.");
                office_ClientsHelper.VerifyText("PartnerAgentl", "Mark Menu");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForClients", "Verify label for partner association.");
                office_ClientsHelper.VerifyText("PartnerAssociationl", "Aslam Associate");
                office_ClientsHelper.WaitForWorkAround(3000);

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

                executionLog.Log("VerifyQuickLookLabelsForClients", "Redirect To clients page. ");
                VisitOffice("clients");
                office_ClientsHelper.WaitForWorkAround(3000);

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

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

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

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

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

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

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

                executionLog.Log("VerifyQuickLookLabelsForClients", "Selcet All in responsibility field");
                office_ClientsHelper.SelectByText("ClientResponsibityRecycle", "All");
                office_ClientsHelper.WaitForWorkAround(2000);

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

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

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

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

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

            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog         = new ExecutionLog();
            var loginHelper          = new LoginHelper(GetWebDriver());
            var office_ClientsHelper = new Office_ClientsHelper(GetWebDriver());
            int rand = RandomNumber(10, 1000);



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

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

                executionLog.Log("SaveLocation", "Go to Client page");
                VisitOffice("clients");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("SaveLocation", "Open a client");
                office_ClientsHelper.ClickElement("Client1");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("SaveLocation", "Click on Company detials");
                office_ClientsHelper.ClickElement("CompanyDetails");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("SaveLocation", "Enter the Dba name");
                office_ClientsHelper.TypeText("ClientDBAName", "test@001");

                executionLog.Log("SaveLocation", "Enter the ferderal tax id");
                office_ClientsHelper.TypeText("FederalTaxID", "776666533");

                executionLog.Log("SaveLocation", "CLick on Save button");
                office_ClientsHelper.ClickElement("CDSave");

                executionLog.Log("SaveLocation", "Wait for text");
                office_ClientsHelper.WaitForText("Client data updated successfully.", 10);

                executionLog.Log("SaveLocation", "Go to Client page");
                VisitOffice("clients");

                executionLog.Log("SaveLocation", "Verify title");
                VerifyTitle();

                executionLog.Log("SaveLocation", "Open a client");
                office_ClientsHelper.ClickElement("Client1");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("SaveLocation", "Click on Company detials");
                office_ClientsHelper.ClickElement("CompanyDetails");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("SaveLocation", "Verify the text");
                office_ClientsHelper.VerifyPageText("More Company Details");

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

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

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

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

            // Variables
            string VerifyInactive = "//table[@id='list1']/tbody/tr[2]/td/a/i[contains(@class,'thumbs-o-up')]";
            string text           = "//table[@id='list1']/tbody/tr[2]/td/a[contains(@href,'view')]";
            String JIRA           = "";
            String Status         = "Pass";


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

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

                executionLog.Log("ClientPDFInactive", "Visit to PDF template page");
                VisitOffice("pdf_templates");

                executionLog.Log("ClientPDFInactive", "Verify title");
                VerifyTitle("PDF Templates");

                string PdfName = pDFTemplate_PDFTemplateHelper.GetText(text);
                if (!pDFTemplate_PDFTemplateHelper.IsElementPresent(VerifyInactive))
                {
                    executionLog.Log("ClientPDFInactive", "Make inactive pDF");
                    pDFTemplate_PDFTemplateHelper.ClickElement("InActivateSign");

                    executionLog.Log("ClientPDFInactive", "Accept alert message.");
                    pDFTemplate_PDFTemplateHelper.AcceptAlert();
                    pDFTemplate_PDFTemplateHelper.WaitForWorkAround(3000);
                }

                executionLog.Log("ClientPDFInactive", "Go to client page");
                VisitOffice("clients");

                executionLog.Log("ClientPDFInactive", "verify title");
                VerifyTitle();

                executionLog.Log("ClientPDFInactive", "Open client");
                office_ClientsHelper.ClickElement("Client1");

                executionLog.Log("ClientPDFInactive", "verify title");
                VerifyTitle(" - Details");

                executionLog.Log("ClientPDFInactive", "click on pdf tab");
                office_ClientsHelper.ClickElement("PDFTab");

                executionLog.Log("ClientPDFInactive", "verify title");
                VerifyTitle(" - Pdfs");

                executionLog.Log("ClientPDFInactive", "verify pdf not available");
                office_ClientsHelper.VerifyTextNotPresent(PdfName + ".pdf");

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

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

            var oXMLData = new XMLParse();

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

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


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

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

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

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

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

                executionLog.Log("ClientSSNIssue", "Go to client page");
                VisitOffice("clients");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ClientSSNIssue", "Verify title");
                VerifyTitle("Clients");

                executionLog.Log("ClientSSNIssue", "Open a client");
                office_ClientsHelper.ClickElement("Client1");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ClientSSNIssue", "Click on 'Owner' tab");
                office_ClientsHelper.ClickForce("OwnerTab");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ClientSSNIssue", "Enter the title of owner");
                office_ClientsHelper.TypeText("TitleOwner", "President");

                executionLog.Log("ClientSSNIssue", "Enter SSN");
                office_ClientsHelper.TypeText("SSN", "877656756");

                executionLog.Log("ClientSSNIssue", "Click on Save button");
                office_ClientsHelper.ClickElement("OwnerSave");

                executionLog.Log("ClientSSNIssue", "Wait for success message");
                office_ClientsHelper.WaitForText("Client data updated successfully.", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            var oXMLData = new XMLParse();

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

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

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

            // Variable
            var    FirstName = "Fname" + RandomNumber(1, 999);
            var    LastName  = "Lname" + RandomNumber(1, 999);
            var    Number    = "123" + RandomNumber(1, 9999);
            var    DBAName   = "DBA" + RandomNumber(1, 999);
            String JIRA      = "";
            String Status    = "Pass";

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

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

                executionLog.Log("DeleteClientUserRefresh", "Go to create clients page.");
                VisitOffice("clients/create");
                office_ClientsHelper.WaitForWorkAround(1000);

                executionLog.Log("DeleteClientUserRefresh", "Enter Client Dba Name");
                office_ClientsHelper.TypeText("ClientDBAName", DBAName);

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

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

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

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

                executionLog.Log("DeleteClientUserRefresh", "Click on Owner Tab");
                office_ClientsHelper.ClickElement("OwnerTab");
                office_ClientsHelper.WaitForWorkAround(5000);

                executionLog.Log("DeleteClientUserRefresh", "Enter First Name");
                office_ClientsHelper.TypeText("OwnerFirstName", "Test");

                executionLog.Log("DeleteClientUserRefresh", "Enter Last Name");
                office_ClientsHelper.TypeText("OwnerLastName", "Tester");

                executionLog.Log("DeleteClientUserRefresh", "Enter the title");
                office_ClientsHelper.TypeText("TitleOwner", "President");

                executionLog.Log("DeleteClientUserRefresh", "Select Phone Type");
                office_ClientsHelper.SelectByText("OwnerPhoneType", "Emergency");

                executionLog.Log("DeleteClientUserRefresh", "Enter Owner phone no.");
                office_ClientsHelper.TypeText("OwnerPhoneNumber", "1234567890");

                executionLog.Log("DeleteClientUserRefresh", "Select Phone Type");
                //       office_ClientsHelper.SelectByText("OwnerAddressType", "Home");

                executionLog.Log("DeleteClientUserRefresh", "Enter Owner Zip code.");
                //         office_ClientsHelper.TypeText("OwnerZipCode", "60601");

                executionLog.Log("DeleteClientUserRefresh", "Select owner eAddress label.");
                office_ClientsHelper.SelectByText("OwnereAddressType", "E-Mail");

                executionLog.Log("DeleteClientUserRefresh", "Select owner eAddress label.");
                office_ClientsHelper.SelectByText("OwnerEAddressLabel", "Home");

                executionLog.Log("DeleteClientUserRefresh", "Enter Owner eAddress");
                office_ClientsHelper.TypeText("OwnereAddressEnter", "*****@*****.**");

                executionLog.Log("DeleteClientUserRefresh", "Click On Save Btn");
                office_ClientsHelper.ClickElement("SaveButtonByTitle");
                office_ClientsHelper.WaitForWorkAround(2000);

                office_ClientsHelper.WaitForText("Client data updated successfully.", 10);

                executionLog.Log("DeleteClientUserRefresh", "Go tO Client");
                VisitOffice("users/client_users");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("DeleteClientUserRefresh", "Click on create Client User");
                office_ClientUsersHelper.ClickElement("CreateClientUser");
                office_ClientUsersHelper.WaitForWorkAround(2000);

                executionLog.Log("DeleteClientUserRefresh", "Enter DBA Name");
                office_ClientUsersHelper.TypeText("EnterCompanyNameCU", DBAName);

                executionLog.Log("DeleteClientUserRefresh", "Click on Search Button");
                office_ClientUsersHelper.ClickElement("ClickOnSearchButton");
                office_ClientUsersHelper.WaitForWorkAround(4000);

                executionLog.Log("DeleteClientUserRefresh", "Click on client company name");
                office_ClientUsersHelper.ClickElement("ClickDbaname");
                office_ClientUsersHelper.WaitForWorkAround(1000);

                executionLog.Log("DeleteClientUserRefresh", "Client User button");
                office_ClientUsersHelper.ClickElement("CreateClientUser1");

                executionLog.Log("DeleteClientUserRefresh", "Accept alert message.");
                office_ClientsHelper.AcceptAlert();
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("DeleteClientUserRefresh", "Close pop up");
                office_ClientUsersHelper.ClickElement("ClikCloseCUPOP");
                office_ClientUsersHelper.WaitForWorkAround(2000);

                executionLog.Log("DeleteClientUserRefresh", "Click Refresh");
                office_ClientUsersHelper.ClickElement("ClickRefreshCU");
                office_ClientUsersHelper.WaitForWorkAround(2000);

                executionLog.Log("DeleteClientUserRefresh", "Search DBA");
                office_ClientUsersHelper.TypeText("SearchClientUSER", DBAName);
                office_ClientUsersHelper.WaitForWorkAround(2000);

                executionLog.Log("DeleteClientUserRefresh", "Create Client");
                office_ClientUsersHelper.ClickElement("ClickOnTheClientUser");
                office_ClientUsersHelper.WaitForWorkAround(1000);

                executionLog.Log("DeleteClientUserRefresh", "Click on  Delete User");
                office_ClientUsersHelper.ClickElement("ClickOnDeleteUser");

                executionLog.Log("DeleteClientUserRefresh", "Accept alert message.");
                office_ClientUsersHelper.AcceptAlert();

                executionLog.Log("DeleteClientUserRefresh", "Wait for success message.");
                office_ClientUsersHelper.WaitForText("Client Users", 10);
                office_ClientUsersHelper.WaitForWorkAround(5000);

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

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

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

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

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

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

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

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

                executionLog.Log("DeleteClientUserRefresh", "Select All in responsibilty");
                office_ClientsHelper.SelectByText("ClientResponsibityRecycle", "All");
                office_ClientsHelper.WaitForWorkAround(2000);

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

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

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

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

            var oXMLData = new XMLParse();

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            var oXMLData = new XMLParse();

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            XMLParse oXMLData = new XMLParse();

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

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

            //Initializing the objects
            var    executionLog         = new ExecutionLog();
            var    loginHelper          = new LoginHelper(GetWebDriver());
            var    office_ClientsHelper = new Office_ClientsHelper(GetWebDriver());
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("PDFEmailFromClient", "Redirect To Client");
                VisitOffice("clients");

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

                executionLog.Log("PDFEmailFromClient", "Click On PDF Tabs");
                office_ClientsHelper.ClickElement("PDFTab");

                executionLog.Log("PDFEmailFromClient", "Wait for element to present.");
                office_ClientsHelper.WaitForElementPresent("ClickeMAILtOsEND", 10);

                executionLog.Log("PDFEmailFromClient", "Click on Share Link");
                office_ClientsHelper.ClickElement("ClickeMAILtOsEND");

                executionLog.Log("PDFEmailFromClient", "Wait for element to present.");
                office_ClientsHelper.WaitForElementPresent("EmterEmailAddressPDF", 10);

                executionLog.Log("PDFEmailFromClient", "Enter sender email address.");
                office_ClientsHelper.TypeText("EmterEmailAddressPDF", "*****@*****.**");

                executionLog.Log("PDFEmailFromClient", "Enter Reciepent Name");
                office_ClientsHelper.TypeText("RecipinetName", "Test Recipinet");

                executionLog.Log("PDFEmailFromClient", "Click on Share Agreement ");
                office_ClientsHelper.ClickViaJavaScript("//button[@title='Confirm Options and Continue']");
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("PDFEmailFromClient", "Click on Accept To Share");
                office_ClientsHelper.ClickElement("ClickOnSendPDFEmail");
                office_ClientsHelper.WaitForWorkAround(1000);

                executionLog.Log("PDFEmailFromClient", "Verify the message");
                office_ClientsHelper.WaitForText("E-Mail Sent Successfully.", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            XMLParse oXMLData = new XMLParse();

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

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

            //Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var office_FieldDictionary_TabsHelper = new Office_FieldDictionary_TabsHelper(GetWebDriver());
            var office_ClientHelper = new Office_ClientsHelper(GetWebDriver());

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

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

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

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

                executionLog.Log("CreateClientTabsMasterData", "Redirect To URL");
                VisitOffice("tabs");

                executionLog.Log("CreateClientTabsMasterData", "Verify title");
                VerifyTitle("Tabs Management");

                executionLog.Log("CreateClientTabsMasterData", "Select lead");
                office_FieldDictionary_TabsHelper.Select("TabsIn", "20");

                executionLog.Log("CreateClientTabsMasterData", "Click Create Btn");
                office_FieldDictionary_TabsHelper.ClickElement("Create");
                office_FieldDictionary_TabsHelper.WaitForWorkAround(1000);

                executionLog.Log("CreateClientTabsMasterData", "Enter Name");
                office_FieldDictionary_TabsHelper.TypeText("Name", name);

                executionLog.Log("CreateClientTabsMasterData", "Click on save button");
                office_FieldDictionary_TabsHelper.ClickElement("Save");

                executionLog.Log("CreateClientTabsMasterData", "Wait for text");
                office_FieldDictionary_TabsHelper.WaitForText("Tab Created Successfully", 30);

                executionLog.Log("CreateClientTabsMasterData", "Click On  Admin");
                VisitOffice("clients");

                executionLog.Log("CreateClientTabsMasterData", "Verify title");
                VerifyTitle();

                executionLog.Log("CreateClientTabsMasterData", "Click On Any Client");
                office_ClientHelper.ClickElement("Client1");

                executionLog.Log("CreateClientTabsMasterData", "Verify title");
                VerifyTitle("- Details");

                executionLog.Log("CreateClientTabsMasterData", "Verify text present");
                office_FieldDictionary_TabsHelper.WaitForText(name, 30);

                executionLog.Log("CreateClientTabsMasterData", "Redirect To URL");
                VisitOffice("tabs");

                executionLog.Log("CreateClientTabsMasterData", "Verify title");
                VerifyTitle("Tabs Management");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            oXMLData.LoadXML("../../Config/ApplicationSettings.xml");
            String JIRA   = "";
            String Status = "Pass";

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

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

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

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

                executionLog.Log("VerifyRecycleBin", "Go to Client export page");
                VisitOffice("clients/export");

                executionLog.Log("VerifyRecycleBin", "Verify Title");
                VerifyTitle("Client");

                executionLog.Log("VerifyRecycleBin", "Mouse hover on the tickets.");
                office_ClientsHelper.MouseOverAndWait("TicHover", 5);

                executionLog.Log("VerifyRecycleBin", "Click on All ticket button");
                office_ClientsHelper.ClickForce("AllTicketBtn");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyRecycleBin", "Verify 'RecycleBin' not available");
                office_ClientsHelper.VerifyTextNotPresent("RecycleBin");

                executionLog.Log("VerifyRecycleBin", "Verify Recycle Bin available");
                office_ClientsHelper.VerifyPageText("Recycle Bin");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            var oXMLData = new XMLParse();

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

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

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

            // Variable
            var DBA   = "Dba" + RandomNumber(99, 999);
            var DBAQA = "QADBA" + RandomNumber(100, 999);

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

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

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

                executionLog.Log("Client", "Goto Create Client");
                VisitOffice("clients/create");

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

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

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

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

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

                executionLog.Log("Client", "Visit Craete Client");
                VisitOffice("clients/create");

                executionLog.Log("Client", "Click Cancel");
                office_ClientsHelper.ClickElement("CancelOpp");

                executionLog.Log("Client", "Enter Comp");
                office_ClientsHelper.VerifyText("VerifyTextPresentClient", "Merchants");

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

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

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

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

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

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

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

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

                executionLog.Log("Client", "Visit Client");
                VisitOffice("clients");
                office_ClientsHelper.WaitForWorkAround(4000);

                executionLog.Log("Client", "Check mark the first");
                office_ClientsHelper.ClickElement("ClickOn1stOpp");
                office_ClientsHelper.WaitForWorkAround(1000);

                executionLog.Log("Client", "CheckMark Second");
                office_ClientsHelper.ClickElement("ClickOn2ndOpp");
                office_ClientsHelper.WaitForWorkAround(1000);

                executionLog.Log("Client", "Click Merege");
                office_ClientsHelper.ClickElement("ClickOnMergeRecords");
                office_ClientsHelper.WaitForWorkAround(3000);

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

                executionLog.Log("Client", "Click On Merge");
                office_ClientsHelper.ClickElement("ClickOnMergeBtn");
                office_ClientsHelper.AcceptAlert();

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

                executionLog.Log("Client", "Redirect To clients page. ");
                VisitOffice("clients");
                office_ClientsHelper.WaitForWorkAround(4000);

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

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

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

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

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

                executionLog.Log("Client", "Redirect To client recycle bin page. ");
                VisitOffice("clients/recyclebin");
                office_ClientsHelper.WaitForWorkAround(4000);

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

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

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

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

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

            var oXMLData = new XMLParse();

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

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

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

            // Variable

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

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

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

                executionLog.Log("ELabelAddressIssue", "Goto Merchant.");
                VisitOffice("clients");
                office_ClientsHelper.WaitForWorkAround(5000);

                executionLog.Log("ELabelAddressIssue", "Open First Merchant");
                office_ClientsHelper.ClickElement("Open1stMerchant");
                office_ClientsHelper.WaitForWorkAround(5000);

                executionLog.Log("ELabelAddressIssue", "Click on  Contact Tab.");
                office_ClientsHelper.ClickForce("ClickOnContactTab");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ELabelAddressIssue", "Click on Add Another Button.");
                office_ClientsHelper.ClickForce("AddAnotherContact");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ELabelAddressIssue", "Click on Add Another Button.");
                office_ClientsHelper.ClickForce("ContactTab2");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ELabelAddressIssue", "Select Address Type.");
                office_ClientsHelper.scrollToElement("eAddressType2");
                office_ClientsHelper.WaitForWorkAround(3000);
                office_ClientsHelper.SelectByText("eAddressType2", "IM");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ELabelAddressIssue", "Verify eAddress Label");
                office_ClientsHelper.verifyselectedOptn("eAddressLabelDrpDwn", "Google");
                office_ClientsHelper.WaitForWorkAround(1000);

                executionLog.Log("ELabelAddressIssue", "Select Address Type.");
                office_ClientsHelper.SelectByText("eAddressType2", "Social Media");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ELabelAddressIssue", "Verify eAddress Label");
                office_ClientsHelper.verifyselectedOptn("eAddressLabelDrpDwn", "Facebook");
                office_ClientsHelper.WaitForWorkAround(1000);

                executionLog.Log("ELabelAddressIssue", "Select Address Type.");
                office_ClientsHelper.SelectByText("eAddressType2", "Web Links");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ELabelAddressIssue", "Verify eAddress Label");
                office_ClientsHelper.verifyselectedOptn("eAddressLabelDrpDwn", "Web Link");
                office_ClientsHelper.WaitForWorkAround(1000);
            }

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

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

            var oXMLData = new XMLParse();

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            var oXMLData = new XMLParse();

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

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

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

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

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

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

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

                executionLog.Log("VerifyCallsAndTicketsOptionInClientActivityType", "Open any merchant");
                office_ClientsHelper.ClickElement("Client1");
                office_ClientsHelper.WaitForWorkAround(4000);

                executionLog.Log("VerifyCallsAndTicketsOptionInClientActivityType", "Click on Client History button");
                office_ClientsHelper.ClickElement("ClientHistory");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyCallsAndTicketsOptionInClientActivityType", "Verify Calls and Tickets option present");
                office_ClientsHelper.VerifyText("ActivityType", "Calls");
                office_ClientsHelper.VerifyText("ActivityType", "Tickets");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyCallsAndTicketsOptionInClientActivityType");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Calls And Tickets Option In Client Activity Type");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Calls And Tickets Option In Client Activity Type", "Bug", "Medium", "Office Merchant page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Calls And Tickets Option In Client Activity Type");
                        TakeScreenshot("VerifyCallsAndTicketsOptionInClientActivityType");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyCallsAndTicketsOptionInClientActivityType.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyCallsAndTicketsOptionInClientActivityType");
                        string id            = loginHelper.getIssueID("Verify Calls And Tickets Option In Client Activity Type");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyCallsAndTicketsOptionInClientActivityType.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Calls And Tickets Option In Client Activity Type"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Calls And Tickets Option In Client Activity Type");
                //    executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyCallsAndTicketsOptionInClientActivityType");
                executionLog.WriteInExcel("Verify Calls And Tickets Option In Client Activity Type", Status, JIRA, "Office Merchants");
            }
        }
        public void clientTaskUrlChange()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

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

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

            // Random variable.
            var Subject = "Subject" + RandomNumber(1, 999);

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

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

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

                executionLog.Log("ClientTaskUrlChange", "Goto User Agent >> Leads");
                VisitOffice("clients");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ClientTaskUrlChange", "Click On Any Client");
                office_ClientsHelper.ClickElement("ClickOnAnyClient");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ClientTaskUrlChange", "Click On Add Document");
                office_ClientsHelper.ClickElement("AddTask");
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("ClientTaskUrlChange", "Enter Task Name");
                officeActivities_TasksHelper.TypeText("TaskSubject", Subject);

                executionLog.Log("ClientTaskUrlChange", "Enter Start Date");
                officeActivities_TasksHelper.TypeText("TaskStartDate", "17/11/2017");

                executionLog.Log("ClientTaskUrlChange", "Enter Start Date");
                officeActivities_TasksHelper.TypeText("TaskDueDate", "17/11/2017");

                executionLog.Log("ClientTaskUrlChange", "Click Save");
                officeActivities_TasksHelper.ClickElement("TaskSave");
                officeActivities_TasksHelper.WaitForWorkAround(2000);

                executionLog.Log("ClientTaskUrlChange", "Select Activity >> Tasks");
                officeActivities_TasksHelper.Select("TaskActivity", "Tasks");
                officeActivities_TasksHelper.WaitForWorkAround(1000);

                executionLog.Log("ClientTaskUrlChange", "Click On Subject");
                officeActivities_TasksHelper.PressEnter("OpenTaskClient");
                officeActivities_TasksHelper.WaitForWorkAround(2000);

                executionLog.Log("ClientTaskUrlChange", "Change the url with the url number of another office");
                VisitOffice("tasks/view/41");
                officeActivities_TasksHelper.WaitForWorkAround(2000);

                executionLog.Log("ClientTaskUrlChange", "Verify Validation");
                officeActivities_TasksHelper.WaitForText("You don't have privileges to view this task.", 10);
                officeActivities_TasksHelper.WaitForWorkAround(1000);

                executionLog.Log("ClientNotesUrlChange", "Redirect at tasks page.");
                VisitOffice("tasks");
                officeActivities_TasksHelper.WaitForWorkAround(3000);

                executionLog.Log("ClientNotesUrlChange", "Search subject by task");
                officeActivities_TasksHelper.TypeText("EnterSubject", Subject);
                officeActivities_TasksHelper.WaitForWorkAround(2000);

                executionLog.Log("ClientNotesUrlChange", "Click on first tasks");
                officeActivities_TasksHelper.ClickElement("CheckBox1");

                executionLog.Log("ClientNotesUrlChange", "Click on delete btn.");
                officeActivities_TasksHelper.ClickElement("DeleteTask");

                executionLog.Log("ClientNotesUrlChange", "Accept alert message.");
                officeActivities_TasksHelper.AcceptAlert();

                executionLog.Log("ClientNotesUrlChange", "Wait for delete text");
                officeActivities_TasksHelper.WaitForText("Task deleted successfully.", 10);
            }

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

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

            var oXMLData = new XMLParse();

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

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

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

            // VARIABLE
            var    DBA    = "Client" + RandomNumber(111, 9999);
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("GetDefaultRatesAndFeesClient", "Redirect at create client page.");
                VisitOffice("clients/create");

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

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

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

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

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

                executionLog.Log("GetDefaultRatesAndFeesClient", "Click on rates and fee tab.");
                office_ClientsHelper.ClickElement("RatesAndFee");
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("GetDefaultRatesAndFeesClient", " SelectProcessorRF");
                office_ClientsHelper.Select("SelectProcessorRF", "First Data Omaha");
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("GetDefaultRatesAndFeesClient", " Select Merchant RF");
                office_ClientsHelper.Select("SeleectMerchantRF", "TestMerchant201603290147173188");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("GetDefaultRatesAndFeesClient", " SelectProcessorRF");
                office_ClientsHelper.Select("MethodOfAcceptingRF", "Manually swiped");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("GetDefaultRatesAndFeesClient", "Click On Get Default Rates");
                office_ClientsHelper.ClickElement("ClickOnGetDefaultRates");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("GetDefaultRatesAndFeesClient", "Accept alert message.");
                office_ClientsHelper.AcceptAlert();
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("GetDefaultRatesAndFeesClient", "Verify");
                office_ClientsHelper.IsElementPresent("VerifyPopulatedFiedl");
                office_ClientsHelper.WaitForWorkAround(4000);

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

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

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

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

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

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

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

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

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

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

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

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

            var oXMLData = new XMLParse();

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

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

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

            // VARIABLE
            var    DBA    = "Client" + RandomNumber(111, 99999);
            var    Title  = "Tester" + RandomNumber(11, 100);
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("ClientVerifyCanadaCountry", "Redirect to Create Merchant page");
                VisitOffice("clients/create");
                office_ClientsHelper.WaitForWorkAround(3000);

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

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

                executionLog.Log("ClientVerifyCanadaCountry", "Select Client Responsibility.");
                office_ClientsHelper.SelectByText("ClientResponsibility", "Howard Tang");

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

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

                executionLog.Log("ClientVerifyCanadaCountry", "Goto Company details tab.");
                office_ClientsHelper.ClickElement("CompanyDetails");
                office_ClientsHelper.WaitForWorkAround(3000);

                office_ClientsHelper.TypeText("FederalTaxID", "123432232");
                //office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ClientVerifyCanadaCountry", "Select Mailing Country");
                office_ClientsHelper.SelectByText("MailingCountry", "Canada");
                //office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("ClientVerifyCanadaCountry", "Select Location counrty");
                office_ClientsHelper.SelectByText("LocationCountry", "Canada");
                //office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("ClientVerifyCanadaCountry", "Click On Contact Tab");
                office_ClientsHelper.ClickElement("ContactDetails");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ClientVerifyCanadaCountry", "Enter the Contact Title");
                office_ClientsHelper.TypeText("ContactTitle", Title);

                executionLog.Log("ClientVerifyCanadaCountry", "SelectAddressCountry");
                office_ClientsHelper.SelectByText("ContactAddressCountry", "Canada");
                //office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("ClientVerifyCanadaCountry", "Clkck on Owner tab");
                office_ClientsHelper.ClickForce("OwnerTab");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ClientVerifyCanadaCountry", "Select Owner Address country");
                office_ClientsHelper.SelectByText("OwnerAddressCountry", "Canada");
                //office_ClientsHelper.WaitForWorkAround(2000);

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

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

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

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

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

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

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

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

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

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

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

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

            var oXMLData = new XMLParse();

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            XMLParse oXMLData = new XMLParse();

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

            username  = oXMLData.getData("settings/Credentials", "username_corp");
            username1 = 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 corp_MerchantHelper          = new Corp_MerchantHelper(GetWebDriver());
            var office_clientsHelper         = new Office_ClientsHelper(GetWebDriver());
            var myprofilepagehelper          = new MyProfilePageHelper(GetWebDriver());
            var officeActivities_Taskshelper = new OfficeActivities_TasksHelper(GetWebDriver());
            var officeActivities_NotesHelper = new OfficeActivities_NotesHelper(GetWebDriver());

            // variables
            String JIRA     = "";
            String Status   = "Pass";
            var    subject  = "TestTask" + RandomNumber(1, 999999);
            var    subject1 = "TestNote" + RandomNumber(1, 999999);

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

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

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Redirect at My Profile page.");
                VisitOffice("myprofile");

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Click on Edit profile Button.");
                myprofilepagehelper.ClickElement("EditProfileBtn");
                myprofilepagehelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Get First Name of User");
                var name = myprofilepagehelper.GetValue("//input[@id='EmployeeFirstName']");

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Redirect at merchants page.");
                VisitOffice("clients");
                office_clientsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Click on a client");
                var clientname = office_clientsHelper.GetText("//table[@id='list1']/tbody/tr[2]/td[15]/a");
                office_clientsHelper.ClickElement("Client1");
                office_clientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Click on New Task");
                office_clientsHelper.ClickElement("AddTask");

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Enter Subject");
                officeActivities_Taskshelper.TypeText("Subject", subject);

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Enter Start Date");
                officeActivities_Taskshelper.TypeText("StartDate", "27/11/2017");

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Enter Due Date");
                officeActivities_Taskshelper.TypeText("DueDate", "28/11/2017");

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Click on Save button");
                officeActivities_Taskshelper.ClickElement("Save");
                officeActivities_Taskshelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Click on Add Note button");
                office_clientsHelper.ClickElement("AddNotes");
                office_clientsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Change to current window");
                office_clientsHelper.SwitchToWindow();

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Enter Subject");
                officeActivities_NotesHelper.TypeText("Subject", subject1);

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Click on Add Note button");
                officeActivities_NotesHelper.ClickElement("Save");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Change to current window");
                office_clientsHelper.SwitchToWindow();

                //executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Logout");
                //Logout();

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Click on Profile Icon");
                office_clientsHelper.ClickElement("ProfileIcon");

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Click on Logout");
                office_clientsHelper.ClickElement("Logout");
                office_clientsHelper.WaitForWorkAround(3000);
                Console.WriteLine("Redirected to Login Screen");

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Login to corporate portal with valid username and password");
                Login(username[0], password[0]);
                Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]);

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

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Redirect at merchants page.");
                VisitCorp("merchants");
                corp_MerchantHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Enter client name in search box");
                corp_MerchantHelper.TypeText("EnterClinentToSearch", clientname);
                corp_MerchantHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Click on Merchant");
                corp_MerchantHelper.ClickElement("ClickOnMerchant");
                corp_MerchantHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Select Activity Type to Tasks");
                corp_MerchantHelper.Select("SelectActivityType", "Tasks");
                corp_MerchantHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Enter task subject name");
                corp_MerchantHelper.TypeText("SearchActivityName", subject);
                corp_MerchantHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Click on task");
                corp_MerchantHelper.ClickElement("ClickOnActivityAny");
                corp_MerchantHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Verify Created By name is appearing");
                corp_MerchantHelper.VerifyText("CreatedOnText", name);
                Console.WriteLine("Creator Name of Task is " + name);

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Redirect at merchants page.");
                VisitCorp("merchants");
                corp_MerchantHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Enter client name in search box");
                corp_MerchantHelper.TypeText("EnterClinentToSearch", clientname);
                corp_MerchantHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Click on Merchant");
                corp_MerchantHelper.ClickElement("ClickOnMerchant");
                corp_MerchantHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Select Activity Type to Notes");
                corp_MerchantHelper.Select("SelectActivityType", "Notes");
                corp_MerchantHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Enter note subject name");
                corp_MerchantHelper.TypeText("SearchActivityName", subject1);
                corp_MerchantHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Click on note");
                corp_MerchantHelper.ClickElement("ClickOnActivityAny");
                corp_MerchantHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyCreatorNameOfTaskAndNoteInMerchant", "Verify Created By name is appearing");
                corp_MerchantHelper.VerifyText("CreatedOnText", name);
                Console.WriteLine("Creator Name of Task is " + name);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyCreatorNameOfTaskAndNoteInMerchant");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Creator Name Of Task And Note In Merchant");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Creator Name Of Task And Note In Merchant", "Bug", "Medium", "Merchant corp", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Creator Name Of Task And Note In Merchant");
                        TakeScreenshot("VerifyCreatorNameOfTaskAndNoteInMerchant");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyCreatorNameOfTaskAndNoteInMerchant.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyCreatorNameOfTaskAndNoteInMerchant");
                        string id            = loginHelper.getIssueID("Verify Creator Name Of Task And Note In Merchant");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyCreatorNameOfTaskAndNoteInMerchant.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Creator Name Of Task And Note In Merchant"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Creator Name Of Task And Note In Merchant");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyCreatorNameOfTaskAndNoteInMerchant");
                executionLog.WriteInExcel("Verify Creator Name Of Task And Note In Merchant", Status, JIRA, "Corp Merchant");
            }
        }
        public void verifyCompanyNameOfMerchantOwnerContact()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

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

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


            var DBA       = "ClientDBA" + RandomNumber(111, 999999);
            var ownername = "Owner" + DBA;

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

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

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

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Redirect at Create merchant page");
                VisitOffice("clients/create");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Enter DBA name");
                office_ClientsHelper.TypeText("ClientDBAName", DBA);

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Select the client status");
                office_ClientsHelper.SelectByText("Status", "New");

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "select the responsibity");
                office_ClientsHelper.SelectByText("Responsibility", "Howard Tang");

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Click on save btn");
                office_ClientsHelper.ClickElement("Save");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Go to Owners tab");
                office_ClientsHelper.ClickElement("OwnerTab");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Enter Title");
                office_ClientsHelper.TypeText("TitleOwner", "Title");

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Enter Owner First Name");
                office_ClientsHelper.TypeText("OwnerFirstName", ownername);

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Enter Owner Last Name");
                office_ClientsHelper.TypeText("OwnerLastName", "Owner");

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Click on Save button");
                office_ClientsHelper.ClickElement("OwnerSave");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Redirect at All Contacts page");
                VisitOffice("contacts");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Search Contact Name");
                office_ContactsHelper.TypeText("SearchName", ownername);
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Verify Company name");
                office_ContactsHelper.VerifyText("FirstCompName", DBA);

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

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Search the company Name");
                office_ClientsHelper.TypeText("SearchClient", DBA);
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Click on check box");
                office_ClientsHelper.ClickElement("ClickOnCheckBox");

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Delete the client");
                office_ClientsHelper.ClickJS("DeleteClient");
                office_ClientsHelper.AcceptAlert();
                office_ClientsHelper.WaitForWorkAround(3000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyCompanyNameOfMerchantOwnerContact");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Company Name Of Merchant Owner Contact");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Company Name Of Merchant Owner Contact", "Bug", "Medium", "Office Merchant page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Company Name Of Merchant Owner Contact");
                        TakeScreenshot("VerifyCompanyNameOfMerchantOwnerContact");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyCompanyNameOfMerchantOwnerContact.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyCompanyNameOfMerchantOwnerContact");
                        string id            = loginHelper.getIssueID("Verify Company Name Of Merchant Owner Contact");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyCompanyNameOfMerchantOwnerContact.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Company Name Of Merchant Owner Contact"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Company Name Of Merchant Owner Contact");
                //    executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyCompanyNameOfMerchantOwnerContact");
                executionLog.WriteInExcel("Verify Company Name Of Merchant Owner Contact", Status, JIRA, "Office Merchants");
            }
        }
        //   [TestCategory("All")]
        // [TestCategory("NewSkin")]
        public void clientLocationToMailingAddressCopyIssue()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

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

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

            // Variable
            var DBA = "Dba" + RandomNumber(99, 99999);

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

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

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

            executionLog.Log("ClientLocationToMailingAddressCopyIssue", "Goto Create Client");
            VisitOffice("clients/create");

            executionLog.Log("ClientLocationToMailingAddressCopyIssue", "Click on Assignments");
            office_ClientsHelper.ClickElement("Assignments");

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

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

            executionLog.Log("ClientLocationToMailingAddressCopyIssue", "Enter Comp DBA name.");
            office_ClientsHelper.TypeText("ClientDBAName", DBA);

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

            executionLog.Log("ClientLocationToMailingAddressCopyIssue", "Client Status");
            office_ClientsHelper.SelectByText("ClientStatus", "New");

            executionLog.Log("ClientLocationToMailingAddressCopyIssue", "Select Client Responsibility");
            office_ClientsHelper.SelectByText("ClientResponsibility", "Howard Tang");

            executionLog.Log("ClientLocationToMailingAddressCopyIssue", "Enter location zip code.");
            office_ClientsHelper.TypeText("ZipCodeLocationAddress", "60601");
            office_ClientsHelper.WaitForWorkAround(3000);

            executionLog.Log("ClientLocationToMailingAddressCopyIssue", "Select Client Responsibility");
            office_ClientsHelper.TypeText("AddressLine1LocationAddress", "TestLocation");
            office_ClientsHelper.WaitForWorkAround(3000);

            executionLog.Log("ClientLocationToMailingAddressCopyIssue", "Select Client Responsibility");
            office_ClientsHelper.TypeText("AddressLine2", "test2");
            office_ClientsHelper.WaitForWorkAround(3000);

            executionLog.Log("ClientLocationToMailingAddressCopyIssue", "Select Client Responsibility");
            office_ClientsHelper.ClickViaJavaScript("//*[@id='ClientDetail0SameAsLocation']");
            office_ClientsHelper.WaitForWorkAround(3000);



            executionLog.Log("ClientLocationToMailingAddressCopyIssue", "Select Client Responsibility");
            office_ClientsHelper.VerifyText("AddressLine1MailingAddress", "TestLocation");
            office_ClientsHelper.WaitForWorkAround(3000);

            executionLog.Log("ClientLocationToMailingAddressCopyIssue", "Select Client Responsibility");
            office_ClientsHelper.VerifyText("AddressLine2Mail", "test2");
            office_ClientsHelper.WaitForWorkAround(3000);
        }
Beispiel #29
0
        public void lastActivityBy()
        {
            string[] username = null;
            string[] password = null;
            string[] log      = null;
            var      oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var    executionLog         = new ExecutionLog();
            var    loginHelper          = new LoginHelper(GetWebDriver());
            var    office_ClientsHelper = new Office_ClientsHelper(GetWebDriver());
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("LastActivityBy", "Go to client page");
                VisitOffice("clients");

                executionLog.Log("LastActivityBy", "Verify title");
                VerifyTitle();

                executionLog.Log("LastActivityBy", "Click on Advance filter");
                office_ClientsHelper.ClickElement("AdvanceFilter");

                executionLog.Log("LastActivityBy", "Click on Last activity by option");
                office_ClientsHelper.ClickElement("LastByActivity");

                executionLog.Log("LastActivityBy", "Click on Arrow icon");
                office_ClientsHelper.ClickElement("AddArrow");

                executionLog.Log("LastActivityBy", "Click on Apply");
                office_ClientsHelper.ClickElement("Apply");

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

            XMLParse oXMLData = new XMLParse();

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                VerifyTitle("Documents");

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

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

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

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

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

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

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

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

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

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

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

                VerifyTitle("Documents");

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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