Esempio n. 1
0
        public void verifyNotesModifiedUpdated()
        {
            string[] username = null;
            string[] password = null;

            XMLParse oXMLData = new XMLParse();

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

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

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

            // Variable
            var    name   = "Note" + RandomNumber(1, 99);
            String JIRA   = "";
            String Status = "Pass";

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

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

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

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

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

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

                executionLog.Log("VerifyNotesModifiedUpdated", "Click on Save  ");
                officeActivities_NotesHelper.ClickElement("Save");
                officeActivities_NotesHelper.WaitForWorkAround(3000);

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

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

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

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

                executionLog.Log("VerifyNotesModifiedUpdated", "Redirect at notes page.");
                VisitOffice("notes");
                officeActivities_NotesHelper.WaitForWorkAround(3000);

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

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

                executionLog.Log("VerifyNotesModifiedUpdated", "Click on searched notes.");
                officeActivities_NotesHelper.ClickElement("ClickOnNotes");
                officeActivities_NotesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyNotesModifiedUpdated", "Verify notes created by credits");
                officeActivities_NotesHelper.VerifyText("CreatedBy", "Howard Tang");

                executionLog.Log("VerifyNotesModifiedUpdated", "Verify notes Modified by credits");
                officeActivities_NotesHelper.VerifyText("ModifiedBy", "Howard Tang");

                executionLog.Log("VerifyNotesModifiedUpdated", "Click on Edit");
                officeActivities_NotesHelper.ClickElement("EditLink");
                officeActivities_NotesHelper.WaitForWorkAround(3000);

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

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

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

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

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

                executionLog.Log("VerifyNotesModifiedUpdated", "Verify notes created by credits");
                officeActivities_NotesHelper.VerifyText("CreatedBy", "Howard Tang");

                executionLog.Log("VerifyNotesModifiedUpdated", "Verify notes Modified by credits");
                officeActivities_NotesHelper.VerifyText("ModifiedBy", "Howard Tang");

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

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

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

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

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

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

                executionLog.Log("VerifyNotesModifiedUpdated", "Wait for delete message. ");
                officeActivities_NotesHelper.WaitForText("Note deleted successfully", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            // Random Variables
            var    editname = "Note" + RandomNumber(1, 99);
            String JIRA     = "";
            String Status   = "Pass";

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

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

                executionLog.Log("EditNoteChangeClient", "Redirect to URL Notes");
                VisitOffice("notes");

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

                executionLog.Log("EditNoteChangeClient", " Click On Edit Icon");
                officeActivities_NotesHelper.ClickElement("Edit");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("EditNoteChangeClient", "Verify page title");
                VerifyTitle("Edit Note");

                executionLog.Log("EditNoteChangeClient", "Enter note subj new");
                officeActivities_NotesHelper.TypeText("Subject", editname);
                officeActivities_NotesHelper.WaitForWorkAround(1000);

                executionLog.Log("EditNoteChangeClient", "Select Module");
                officeActivities_NotesHelper.SelectDropDownByText("//*[@id='NoteParentType']", "Client");
                officeActivities_NotesHelper.WaitForWorkAround(1000);

                executionLog.Log("EditNoteChangeClient", "Click on ClientSelectIcon");
                officeActivities_NotesHelper.ClickElement("SelectClient");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("EditNoteChangeClient", " Click On Client2");
                officeActivities_NotesHelper.ClickElement("ClickONClientNS");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("EditNoteChangeClient", "Edit Note Save Btn");
                officeActivities_NotesHelper.ClickElement("Save");
                officeActivities_NotesHelper.WaitForWorkAround(1000);

                executionLog.Log("EditNoteChangeClient", "Verify note updated successfully");
                officeActivities_NotesHelper.WaitForText("Note Updated Success.", 20);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

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

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

                executionLog.Log("EmailNoteForward", "Redirect to Notes create page");
                VisitOffice("notes/create");
                officeActivities_NotesHelper.WaitForWorkAround(3000);

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

                executionLog.Log("EmailNoteForward", "Enter Subject ");
                officeActivities_NotesHelper.TypeText("Subject", "Email This Note");

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

                executionLog.Log("EmailNoteForward", "Verify Confirmation");
                officeActivities_NotesHelper.WaitForText("Note saved successfully.", 10);

                executionLog.Log("EmailNoteForward", "Search Note");
                officeActivities_NotesHelper.TypeText("EnterSubject", "Email This Note");
                officeActivities_NotesHelper.WaitForWorkAround(3000);

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

                executionLog.Log("EmailNoteForward", "Click on Note");
                officeActivities_NotesHelper.ClickElement("ClickOnNote");

                executionLog.Log("EmailNoteForward", "Wait for locator to be present.");
                officeActivities_NotesHelper.WaitForElementPresent("ClickOnEmail", 10);

                executionLog.Log("EmailNoteForward", "Click On Email This NOte");
                officeActivities_NotesHelper.ClickElement("ClickOnEmail");
                officeActivities_NotesHelper.WaitForWorkAround(3000);

                executionLog.Log("EmailNoteForward", "Verify Page title.");
                VerifyTitle("Compose");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("EmailNoteForward", "Enter Sender name");
                officeActivities_NotesHelper.TypeText("EnterToFiled", "*****@*****.**");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("EmailNoteForward", "Click send Button");
                officeActivities_NotesHelper.ClickElement("ClickSendBtn");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("EmailNoteForward", "Verify Email sent successfully");
                officeActivities_NotesHelper.WaitForText("E-Mail Sent Successfully.", 20);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            var oXMLData = new XMLParse();

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

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


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

            // Variable
            var Subject = "Testtask" + RandomNumber(99, 99999);

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

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

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

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

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

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on a lead");
                office_LeadsHelper.ClickElement("FirstLead");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on Add Note button");
                office_LeadsHelper.ClickElement("AddNote");
                office_LeadsHelper.WaitForWorkAround(3000);
                office_LeadsHelper.SwitchToWindow();

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Enter Subject of note");
                officeActivities_NotesHelper.TypeText("Subject", Subject);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Select Add Task check box");
                officeActivities_NotesHelper.ClickElement("AddTaskChkBox");
                officeActivities_NotesHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Enter Start Date of task");
                officeActivities_TasksHelper.TypeText("StartDate", "2017-10-10");

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Enter End Date of task");
                officeActivities_TasksHelper.TypeText("DueDate", "2017-10-10");

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on Save button");
                officeActivities_NotesHelper.ClickForce("Save");
                //officeActivities_TasksHelper.SwitchToWindow();
                officeActivities_TasksHelper.WaitForWorkAround(3000);
                officeActivities_TasksHelper.SwitchToWindow();
                officeActivities_TasksHelper.WaitForWorkAround(3000);
                office_LeadsHelper.WaitForText("Note successfully Created.", 05);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Select Activity Type >> Tasks");
                office_LeadsHelper.WaitForWorkAround(3000);
                office_LeadsHelper.SelectByText("SelectActivityType", "Tasks");
                office_LeadsHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Search Task by name");
                office_LeadsHelper.TypeText("ActivitySubject", Subject);
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Open task");
                office_LeadsHelper.ClickForce("ClickNotes1");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on Edit button");
                officeActivities_TasksHelper.ClickElement("EditBtn");
                officeActivities_TasksHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Verify Start Time");
                officeActivities_TasksHelper.VerifySelectdOptn("StartHour", "01");
                officeActivities_TasksHelper.VerifySelectdOptn("StartMin", "00");
                officeActivities_TasksHelper.VerifySelectdOptn("StartAMPM", "AM");

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Verify Due Time");
                officeActivities_TasksHelper.VerifySelectdOptn("DueHour", "01");
                officeActivities_TasksHelper.VerifySelectdOptn("DueMin", "15");
                officeActivities_TasksHelper.VerifySelectdOptn("DueAMPM", "AM");

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Go to All merchants page");
                VisitOffice("clients");
                office_LeadsHelper.WaitForWorkAround(3000);

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

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on a merchant");
                office_ClientsHelper.ClickElement("Client1");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on Add Note button");
                office_ClientsHelper.ClickElement("AddNotes");
                office_ClientsHelper.WaitForWorkAround(3000);
                office_ClientsHelper.SwitchToWindow();

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Enter Subject of note");
                officeActivities_NotesHelper.TypeText("Subject", Subject);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Select Add Task check box");
                officeActivities_NotesHelper.ClickElement("AddTaskChkBox");
                officeActivities_NotesHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Enter Start Date of task");
                officeActivities_TasksHelper.TypeText("StartDate", "2017-10-10");

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Enter End Date of task");
                officeActivities_TasksHelper.TypeText("DueDate", "2017-10-10");

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on Save button");
                officeActivities_NotesHelper.ClickForce("Save");
                //officeActivities_TasksHelper.SwitchToWindow();
                officeActivities_TasksHelper.WaitForWorkAround(3000);
                officeActivities_TasksHelper.SwitchToWindow();
                officeActivities_TasksHelper.WaitForWorkAround(3000);
                office_ClientsHelper.WaitForText("Note successfully Created.", 05);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Select Activity Type >> Tasks");
                office_ClientsHelper.WaitForWorkAround(3000);
                office_ClientsHelper.SelectByText("ActivityType", "Tasks");
                office_ClientsHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Search Task by name");
                office_ClientsHelper.TypeText("SearchActivity", Subject);
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Open task");
                office_ClientsHelper.ClickForce("Activity1");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Click on Edit button");
                officeActivities_TasksHelper.ClickElement("EditBtn");
                officeActivities_TasksHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Verify Start Time");
                officeActivities_TasksHelper.VerifySelectdOptn("StartHour", "01");
                officeActivities_TasksHelper.VerifySelectdOptn("StartMin", "00");
                officeActivities_TasksHelper.VerifySelectdOptn("StartAMPM", "AM");

                executionLog.Log("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant", "Verify Due Time");
                officeActivities_TasksHelper.VerifySelectdOptn("DueHour", "01");
                officeActivities_TasksHelper.VerifySelectdOptn("DueMin", "15");
                officeActivities_TasksHelper.VerifySelectdOptn("DueAMPM", "AM");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Start And Due Time Of Task Under Lead And Merchant");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Start And Due Time Of Task Under Lead And Merchant", "Bug", "Medium", "Leads and Merchants page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Start And Due Time Of Task Under Lead And Merchant");
                        TakeScreenshot("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant");
                        string id            = loginHelper.getIssueID("Verify Start And Due Time Of Task Under Lead And Merchant");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Start And Due Time Of Task Under Lead And Merchant"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Start And Due Time Of Task Under Lead And Merchant");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyStartAndDueTimeOfTaskUnderLeadAndMerchant");
                executionLog.WriteInExcel("Verify Start And Due Time Of Task Under Lead And Merchant", Status, JIRA, "Office Leads And Merchants");
            }
        }
Esempio n. 6
0
        public void verifyOpportunityStatusOfNoteUnderOpportunityHistory()
        {
            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_OpportunitiesHelper   = new Office_OpportunitiesHelper(GetWebDriver());
            var officeActivities_NotesHelper = new OfficeActivities_NotesHelper(GetWebDriver());

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

            // Variable
            var Subject = "Testnote" + RandomNumber(99, 99999);

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

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

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

                executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Go to All tickets page");
                VisitOffice("opportunities");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

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

                executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Click on an opportunity");
                office_OpportunitiesHelper.ClickElement("Opportunities1");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Observe Status of opportunity");
                var status = office_OpportunitiesHelper.GetText("//div[@id='status']");

                executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Click on Add Note button");
                office_OpportunitiesHelper.ClickElement("AddNote");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Enter Subject of note");
                officeActivities_NotesHelper.TypeText("Subject", Subject);

                executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Click on Save button");
                officeActivities_NotesHelper.ClickForce("OpporSaveBtn");
                office_OpportunitiesHelper.WaitForWorkAround(3000);
                office_OpportunitiesHelper.WaitForText("Note successfully Created.", 05);

                executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Select Activity Type >> Notes");
                office_OpportunitiesHelper.SelectByText("ActvtyType", "Notes");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Search Note by name");
                office_OpportunitiesHelper.TypeText("ActivitySubject", Subject);
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyOpportunityStatusOfNoteUnderOpportunityHistory", "Verify Opportunity Status is appearing");
                office_OpportunitiesHelper.VerifyText("ActvtyStatus1", status);
                Console.WriteLine("Opportunity Status is appearing in front of note under Opportunity History ");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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


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

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

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

                executionLog.Log("EmailNoteWithRelatedTo", "Redirect To notes");
                VisitOffice("notes");

                executionLog.Log("EmailNoteWithRelatedTo", "Click on Create ");
                officeActivities_NotesHelper.ClickElement("Create");
                officeActivities_NotesHelper.WaitForWorkAround(3000);

                executionLog.Log("EmailNoteWithRelatedTo", "Enter Note Subject");
                officeActivities_NotesHelper.TypeText("Subject", Subject);

                executionLog.Log("EmailNoteWithRelatedTo", "Select Client");
                officeActivities_NotesHelper.SelectDropDownByText("//*[@id='NoteParentType']", "Client");

                executionLog.Log("EmailNoteWithRelatedTo", "ClickIconToSelectClient");
                officeActivities_NotesHelper.ClickElement("SelectClient");
                officeActivities_NotesHelper.WaitForWorkAround(3000);

                executionLog.Log("EmailNoteWithRelatedTo", "Click On Client");
                officeActivities_NotesHelper.ClickElement("ClickONClientNS");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("EmailNoteWithRelatedTo", "Click on Save button");
                officeActivities_NotesHelper.ClickElement("Save");
                officeActivities_NotesHelper.WaitForWorkAround(6000);

                executionLog.Log("EmailNoteWithRelatedTo", "Click On Notes");
                officeActivities_NotesHelper.ClickElement("ClickOnNotes");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("EmailNoteWithRelatedTo", "Click on Email Note");
                officeActivities_NotesHelper.ClickElement("EmailNote");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("EmailNoteWithRelatedTo", "Verify selected client.");
                officeActivities_NotesHelper.VerifyText("VerifySelectedClient", "Client");

                executionLog.Log("AddNotesAdmin", "Redirect at notes page.");
                VisitOffice("notes");

                executionLog.Log("AddNotesAdmin", "Redirect at notes page.");
                officeActivities_NotesHelper.WaitForElementPresent("EnterSubject", 10);

                executionLog.Log("AddNotesAdmin", "Search subject by note");
                officeActivities_NotesHelper.TypeText("EnterSubject", Subject);
                officeActivities_NotesHelper.WaitForWorkAround(2000);

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

                executionLog.Log("AddNotesAdmin", "Search subject by note");
                officeActivities_NotesHelper.ClickElement("SelectNote1");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("AddNotesAdmin", "Click on delete note.");
                officeActivities_NotesHelper.ClickElement("DeleteNote");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

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

                executionLog.Log("AddNotesAdmin", "Wait for delete text");
                officeActivities_NotesHelper.WaitForText("Note deleted successfully.", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";
                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("EmailNoteWithRelatedTo");
                String Error       = executionLog.GetAllTextFile("Error");

                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Email Note With Related To");
                Console.WriteLine("Stepp 2 after existing");
                if (!result)
                {
                    if (Int16.Parse(counter) < 15)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssueTest("Email Note With Related To", "Bug", "Medium", "Email note page", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Email Note With Related To");
                        TakeScreenshot("EmailNoteWithRelatedTo");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\EmailNoteWithRelatedTo.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 15)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("EmailNoteWithRelatedTo");
                        string id            = loginHelper.getIssueID("Email Note With Related To");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\EmailNoteWithRelatedTo.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Email Note With Related To"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Email Note With Related To");
                //  executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("EmailNoteWithRelatedTo");
                executionLog.WriteInExcel("Email Note With Related To", Status, JIRA, "Email Actitvities");
            }
        }
Esempio n. 8
0
        public void verifyValidationForMsgFile()
        {
            string[] username = null;
            string[] password = null;

            XMLParse 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 officeActivities_NotesHelper = new OfficeActivities_NotesHelper(GetWebDriver());

            // Variable
            var    file    = GetPathToFile() + "test.msg";
            var    Subject = "Subject" + RandomNumber(1, 999);
            String JIRA    = "";
            String Status  = "Pass";

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

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

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

                executionLog.Log("VerifyValidationForMsgFile", " Goto create notes page.");
                VisitOffice("notes/create");

                executionLog.Log("VerifyValidationForMsgFile", " verify title");
                VerifyTitle("Create a New Note");

                executionLog.Log("VerifyValidationForMsgFile", " Enter Subject");
                officeActivities_NotesHelper.TypeText("Subject", Subject);

                executionLog.Log("VerifyValidationForMsgFile", "Click status");
                officeActivities_NotesHelper.Select("Status", "Active");

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

                executionLog.Log("VerifyValidationForMsgFile", " Click on Save  ");
                officeActivities_NotesHelper.WaitForText("Note saved successfully.", 10);

                executionLog.Log("VerifyValidationForMsgFile", "Redirect at notes page.");
                VisitOffice("notes");

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

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

                executionLog.Log("VerifyValidationForMsgFile", "Click on add attachment.");
                officeActivities_NotesHelper.ClickElement("AddAttEdit");

                executionLog.Log("VerifyValidationForMsgFile", "Wait for locator to be present.");
                officeActivities_NotesHelper.WaitForElementPresent("SubjectAttachment", 10);

                executionLog.Log("VerifyValidationForMsgFile", "Enter attachment subject.");
                officeActivities_NotesHelper.TypeText("SubjectAttachment", "test");

                executionLog.Log("VerifyValidationForMsgFile", "Upload a file with extension .msg");
                officeActivities_NotesHelper.Upload("BrowseAttachment", file);

                executionLog.Log("VerifyValidationForMsgFile", "Click on save button.");
                officeActivities_NotesHelper.ClickElement("SaveAttach");

                executionLog.Log("VerifyValidationForMsgFile", "Wait for invalid file text.");
                officeActivities_NotesHelper.WaitForText("Please upload a valid file.", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            // Random Variables
            var    DocName = "Notes Meeting Exe" + GetRandomNumber();
            var    ExeFile = GetPathToFile() + "chrome.exe";
            String JIRA    = "";
            String Status  = "Pass";

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

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

                executionLog.Log("VerifyNoteWithExeForMeetingNotAdded", "Click to open client inf");
                VisitOffice("meetings");

                executionLog.Log("VerifyNoteWithExeForMeetingNotAdded", "Click On Meeting");
                officeActivities_MeetingHelper.ClickElement("ClickOnAnyMeeting");
                officeActivities_MeetingHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyNoteWithExeForMeetingNotAdded", "Click On Add Document Btn");
                officeActivities_MeetingHelper.ClickElement("ClickOnNoteMeeting");
                officeActivities_MeetingHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyNoteWithExeForMeetingNotAdded", "Enter Doc Name");
                officeActivities_MeetingHelper.TypeText("EnterSubNote", DocName);

                executionLog.Log("VerifyNoteWithExeForMeetingNotAdded", "Uplaod exe file");
                officeActivities_MeetingHelper.Upload("DocumentFileNotesMeet", ExeFile);
                officeActivities_MeetingHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyNoteWithExeForMeetingNotAdded", "Click Save Of Doc Pop Up");
                officeActivities_MeetingHelper.ClickElement("SaveNoteMeeting");

                executionLog.Log("VerifyNoteWithExeForMeetingNotAdded", "Verify Confirmation");
                officeActivities_MeetingHelper.WaitForText("Note successfully Created.", 10);

                executionLog.Log("VerifyNoteWithExeForMeetingNotAdded", "Redirect To  Notes Activities");
                VisitOffice("notes");
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyNoteWithExeForMeetingNotAdded", "Search Document");
                officeActivities_NotesHelper.TypeText("EnterSubject", DocName);
                officeActivities_NotesHelper.WaitForWorkAround(3000);

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

                officeActivities_NotesHelper.ClickElement("ClickOnNote");
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyNoteWithExeForMeetingNotAdded", "Verify Added Document not Present");
                officeActivities_NotesHelper.VerifyText("VerifyNoAttachment", "No Data Available.");
                officeActivities_NotesHelper.WaitForWorkAround(3000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyNoteWithExeForMeetingNotAdded");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Note With Exe For Meeting Not Added");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("VerifyNoteWithExeForMeetingNotAdded", "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("Verify Note With Exe For Meeting Not Added");
                        TakeScreenshot("VerifyNoteWithExeForMeetingNotAdded");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyNoteWithExeForMeetingNotAdded.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyNoteWithExeForMeetingNotAdded");
                        string id            = loginHelper.getIssueID("Verify Note With Exe For Meeting Not Added");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyNoteWithExeForMeetingNotAdded.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Note With Exe For Meeting Not Added"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Note With Exe For Meeting Not Added");
                //  executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyNoteWithExeForMeetingNotAdded");
                executionLog.WriteInExcel("Verify Note With Exe For Meeting Not Added", Status, JIRA, "Office Activities");
            }
        }
Esempio n. 10
0
        public void activitiesNotesManagement()
        {
            string[] username = null;
            string[] password = null;

            XMLParse oXMLData = new XMLParse();

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

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

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

            // Variable
            var    name   = "Note" + RandomNumber(1, 99);
            String JIRA   = "";
            String Status = "Pass";

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                executionLog.Log("OpportunitiesnNotesUrlChange", "Goto  Opportunities");
                VisitOffice("opportunities");

                executionLog.Log("OpportunitiesnNotesUrlChange", "Click On Any Opportunities tab");
                office_OpportunitiesHelper.ClickElement("OpenOpportunity");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("OpportunitiesnNotesUrlChange", "Click Add Note button");
                office_OpportunitiesHelper.ClickElement("AddNote");
                office_OpportunitiesHelper.WaitForWorkAround(10000);

                executionLog.Log("OpportunitiesnNotesUrlChange", "Enter Note Subject");
                officeActivities_NotesHelper.TypeText("Subject", Subject);
                office_OpportunitiesHelper.WaitForWorkAround(10000);

                executionLog.Log("OpportunitiesnNotesUrlChange", "Click Save");
                officeActivities_NotesHelper.ClickElement("SaveNoteoppo");
                officeActivities_NotesHelper.WaitForWorkAround(2000);

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

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

                executionLog.Log("OpportunitiesnNotesUrlChange", "Click On Notes ");
                officeActivities_NotesHelper.ClickForce("ClickNotes1");
                officeActivities_NotesHelper.WaitForWorkAround(4000);

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

                executionLog.Log("OpportunitiesnNotesUrlChange", "Verify Validation");
                officeActivities_NotesHelper.WaitForText("You don't have privileges to view this note.", 10);
                officeActivities_NotesHelper.WaitForWorkAround(2000);

                executionLog.Log("OpportunitiesnNotesUrlChange", "Redirect at notes page.");
                VisitOffice("notes");

                executionLog.Log("OpportunitiesnNotesUrlChange", "Search subject by note");
                officeActivities_NotesHelper.TypeText("EnterSubject", Subject);
                officeActivities_NotesHelper.WaitForWorkAround(2000);

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

                executionLog.Log("OpportunitiesnNotesUrlChange", "Search subject by note");
                officeActivities_NotesHelper.ClickElement("SelectNote1");

                executionLog.Log("OpportunitiesnNotesUrlChange", "Click on delete note.");
                officeActivities_NotesHelper.ClickElement("DeleteNote");

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

                executionLog.Log("OpportunitiesnNotesUrlChange", "Wait for delete text");
                officeActivities_NotesHelper.WaitForText("Note deleted successfully.", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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