Exemplo n.º 1
0
        public void verifyQuicklookLabelsForCalls()
        {
            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 officeActivities_CallsHelper = new OfficeActivities_CallsHelper(GetWebDriver());

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

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

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

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

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Redirect at calls page.");
                VisitOffice("calls");
                officeActivities_CallsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", " verify title");
                VerifyTitle("Calls");
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Click on create button.");
                officeActivities_CallsHelper.ClickElement("Create");
                officeActivities_CallsHelper.WaitForWorkAround(2000);

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

                executionLog.Log("VerifyQuicklookLabelsForCalls", "verify validation for call type");
                officeActivities_CallsHelper.VerifyText("CallTypeError", "This field is required.");
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "verify validation for call name.");
                officeActivities_CallsHelper.VerifyText("CallNameError", "This field is required.");
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "verify validation for call to.");
                officeActivities_CallsHelper.VerifyText("CallToNameError", "This field is required.");
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "verify validation for from number.");
                officeActivities_CallsHelper.VerifyText("FromNumError", "This field is required.");
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "verify validation for to number.");
                officeActivities_CallsHelper.VerifyText("ToNumError", "This field is required.");
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Select call type");
                officeActivities_CallsHelper.SelectByText("CallType", "Personal");
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Select call related to.");
                officeActivities_CallsHelper.Select("Relatedto", "20");
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Click on find list icon.");
                officeActivities_CallsHelper.ClickElement("Findlist");
                officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Click on searched result.");
                officeActivities_CallsHelper.ClickElement("Client1");
                officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Enter call from name.");
                officeActivities_CallsHelper.TypeText("CallFrom", "Howard Tang");
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Select call category.");
                officeActivities_CallsHelper.SelectByText("Category", "other");
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", " Enter call to name");
                officeActivities_CallsHelper.TypeText("CallToName", "Randy Jackson");
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", " Enter call from number.");
                officeActivities_CallsHelper.TypeText("FromNumber", "1221221122");
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", " Enter call to number.");
                officeActivities_CallsHelper.TypeText("CallTONumber", "1221221122");
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Click on start button.");
                officeActivities_CallsHelper.ClickElement("Start");
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Wait for some time.");
                officeActivities_CallsHelper.WaitForWorkAround(10000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Click on stop button.");
                officeActivities_CallsHelper.ClickElement("Stop");
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Click on save button.");
                officeActivities_CallsHelper.ClickElement("Save");
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Wait for success text.");
                officeActivities_CallsHelper.WaitForText("Call logged successfully.", 10);
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Redirect at calls page.");
                VisitOffice("calls");
                officeActivities_CallsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", " verify title");
                VerifyTitle("Calls");
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Click on any call.");
                officeActivities_CallsHelper.ClickElement("Call1");
                officeActivities_CallsHelper.WaitForWorkAround(4000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Verify label for call owner.");
                officeActivities_CallsHelper.VerifyText("VerifyOwner", "Howard Tang");
                //officeActivities_CallsHelper.WaitForWorkAround(3000);
                //officeActivities_CallsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Verify label for call category.");
                officeActivities_CallsHelper.VerifyText("VerifyCategory", "other");
                //officeActivities_CallsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Click on edit button.");
                officeActivities_CallsHelper.ClickElement("EditLink");
                officeActivities_CallsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Enter call from name.");
                officeActivities_CallsHelper.TypeText("CallFrom", "Howard Tang");
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", " Enter call to name");
                officeActivities_CallsHelper.TypeText("CallToName", "Randy Jackson");
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", " Enter call from number.");
                officeActivities_CallsHelper.TypeText("FromNumber", "1221221122");
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", " Enter call to number.");
                officeActivities_CallsHelper.TypeText("CallTONumber", "1221221122");
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Click on start button.");
                officeActivities_CallsHelper.ClickElement("Start");
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Wait for some time.");
                officeActivities_CallsHelper.WaitForWorkAround(6000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Click on stop button.");
                officeActivities_CallsHelper.ClickElement("Stop");
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

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

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Redirect at calls page.");
                VisitOffice("calls");
                officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", " verify title");
                VerifyTitle("Calls");
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Click on call to be deleted.");
                officeActivities_CallsHelper.ClickElement("Call1");
                officeActivities_CallsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Double click on call owner label");
                officeActivities_CallsHelper.DblClick("VerifyOwner");
                officeActivities_CallsHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Select updated owner for call.");
                officeActivities_CallsHelper.SelectByText("UpdateEmployee", "Howard Tang");
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Click on save button.");
                officeActivities_CallsHelper.ClickElement("SaveText");
                officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Verify label for call owner.");
                officeActivities_CallsHelper.VerifyText("VerifyOwner", "Howard Tang");
                //officeActivities_CallsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Redirect at calls page.");
                VisitOffice("calls");
                officeActivities_CallsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", " verify title");
                VerifyTitle("Calls");
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Click on call to be deleted.");
                officeActivities_CallsHelper.ClickElement("Call1");
                officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Click on delete button.");
                officeActivities_CallsHelper.ClickElement("Delete");
                officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Click on OK to accept alert message.");
                officeActivities_CallsHelper.AcceptAlert();
                //officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuicklookLabelsForCalls", "Wait for text call deleted.");
                officeActivities_CallsHelper.WaitForText("Call successfully deleted.", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

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

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

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

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

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Redirect at calls page.");
                VisitOffice("calls");
                officeActivities_CallsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", " verify title");
                VerifyTitle("Calls");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Click on create button.");
                officeActivities_CallsHelper.ClickElement("Create");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Click on save button.");
                officeActivities_CallsHelper.ClickElement("Save");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "verify validation for call type");
                officeActivities_CallsHelper.VerifyText("CallTypeError", "This field is required.");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "verify validation for call name.");
                officeActivities_CallsHelper.VerifyText("CallNameError", "This field is required.");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "verify validation for call to.");
                officeActivities_CallsHelper.VerifyText("CallToNameError", "This field is required.");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "verify validation for from number.");
                officeActivities_CallsHelper.VerifyText("FromNumError", "This field is required.");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "verify validation for to number.");
                officeActivities_CallsHelper.VerifyText("ToNumError", "This field is required.");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Select call type");
                officeActivities_CallsHelper.Select("CallType", "Personal");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Select call related to.");
                officeActivities_CallsHelper.Select("Relatedto", "20");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Click on find list icon.");
                officeActivities_CallsHelper.ClickElement("Findlist");
                officeActivities_CallsHelper.WaitForWorkAround(4000);

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Click on first client.");
                officeActivities_CallsHelper.ClickElement("Client1");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Enter call from name.");
                officeActivities_CallsHelper.TypeText("CallFrom", "Howard Tang");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", " Enter call to name");
                officeActivities_CallsHelper.TypeText("CallToName", "Randy Jackson");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", " Enter call from number.");
                officeActivities_CallsHelper.TypeText("FromNumber", "1221221122");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", " Enter call to number.");
                officeActivities_CallsHelper.TypeText("CallTONumber", "1221221122");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Click on start button.");
                officeActivities_CallsHelper.ClickElement("Start");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Wait for some time.");
                officeActivities_CallsHelper.WaitForWorkAround(20000);

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Click on stop button.");
                officeActivities_CallsHelper.ClickElement("Stop");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Click on save button.");
                officeActivities_CallsHelper.ClickElement("Save");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Wait for success text.");
                officeActivities_CallsHelper.WaitForText("Call logged successfully.", 10);

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Redirect at calls page.");
                VisitOffice("calls");
                officeActivities_CallsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Verify page title as calls.");
                VerifyTitle("Calls");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Click on created call.");
                officeActivities_CallsHelper.ClickElement("Call1");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Verify call created by credits.");
                officeActivities_CallsHelper.VerifyText("CreatedBy", "Howard Tang");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Verify call modified by credits.");
                officeActivities_CallsHelper.VerifyText("ModifiedBy", "Howard Tang");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Click on edit button.");
                officeActivities_CallsHelper.ClickElement("EditLink");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Select call related to.");
                officeActivities_CallsHelper.Select("Relatedto", "14");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Click on find list icon.");
                officeActivities_CallsHelper.ClickElement("Findlist");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Click on first lead.");
                officeActivities_CallsHelper.ClickElement("Client1");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Enter call from name.");
                officeActivities_CallsHelper.TypeText("CallFrom", "Howard Tang");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", " Enter call to name");
                officeActivities_CallsHelper.TypeText("CallToName", "Randy Jackson");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", " Enter call from number.");
                officeActivities_CallsHelper.TypeText("FromNumber", "1221221122");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", " Enter call to number.");
                officeActivities_CallsHelper.TypeText("CallTONumber", "1221221122");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Click on start button.");
                officeActivities_CallsHelper.ClickElement("Start");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Wait for some time.");
                officeActivities_CallsHelper.WaitForWorkAround(20000);

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Click on stop button.");
                officeActivities_CallsHelper.ClickElement("Stop");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Click on save button.");
                officeActivities_CallsHelper.ClickElement("Save");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Wait for updation success message.");
                officeActivities_CallsHelper.WaitForText("Updated Successfully.", 10);

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Redirect at calls page.");
                VisitOffice("calls");
                officeActivities_CallsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Verify page title as calls.");
                VerifyTitle("Calls");
                officeActivities_CallsHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Click on created call.");
                officeActivities_CallsHelper.ClickElement("Call1");
                officeActivities_CallsHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Verify call created by credits.");
                officeActivities_CallsHelper.VerifyText("CreatedBy", "Howard Tang");
                officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Verify call modified by credits.");
                officeActivities_CallsHelper.VerifyText("ModifiedBy", "Howard Tang");
                officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Redirect at calls page.");
                VisitOffice("calls");
                officeActivities_CallsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", " verify title");
                VerifyTitle("Calls");
                officeActivities_CallsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Wait for next element to present.");
                officeActivities_CallsHelper.WaitForElementPresent("Call1", 10);

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Click on first check box");
                officeActivities_CallsHelper.ClickElement("ChkBox1");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Click on delete button.");
                officeActivities_CallsHelper.ClickElement("Delete");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Click on OK to accept alert message.");
                officeActivities_CallsHelper.AcceptAlert();
                officeActivities_CallsHelper.WaitForWorkAround(5000);

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Wait for text call deleted.");
                officeActivities_CallsHelper.WaitForText("Call deleted successfully.", 20);

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Redirect at call recycle bin page.");
                VisitOffice("calls/recyclebin");

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Verify page title..");
                VerifyTitle("Recycled Calls");
                officeActivities_CallsHelper.WaitForWorkAround(5000);

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Click on delete icon.");
                officeActivities_CallsHelper.ClickElement("DeleteRecycle");
                officeActivities_CallsHelper.AcceptAlert();

                executionLog.Log("VerifyCallsCreatedAndModifiedByCredits", "Wait for deletion success text.");
                officeActivities_CallsHelper.WaitForText("Call Permanently Deleted.", 30);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyCallsCreatedAndModifiedByCredits");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Calls Created And Modified By Credits");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Calls Created And Modified By Credits", "Bug", "Medium", "Calls page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Calls Created And Modified By Credits");
                        TakeScreenshot("VerifyCallsCreatedAndModifiedByCredits");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyCallsCreatedAndModifiedByCredits.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyCallsCreatedAndModifiedByCredits");
                        string id            = loginHelper.getIssueID("Verify Calls Created And Modified By Credits");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyCallsCreatedAndModifiedByCredits.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Calls Created And Modified By Credits"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Calls Created And Modified By Credits");
                //    executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyCallsCreatedAndModifiedByCredits");
                executionLog.WriteInExcel("Verify Calls Created And Modified By Credits", Status, JIRA, "Office Activities");
            }
        }
        public void activitiesBulkUpdatesCalls()
        {
            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_CallsHelper = new OfficeActivities_CallsHelper(GetWebDriver());
            var office_ClientsHelper         = new Office_ClientsHelper(GetWebDriver());
            var office_LeadsHelper           = new Office_LeadsHelper(GetWebDriver());
            var office_OpportunitiesHelper   = new Office_OpportunitiesHelper(GetWebDriver());
            var ticket_CreateATicketHelper   = new OfficeTickets_CreateTicketsHelper(GetWebDriver());

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

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

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

                executionLog.Log("ActivitiesBulkUpdatesCalls", "Redirect at calls page.");
                VisitOffice("calls");
                officeActivities_CallsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesBulkUpdatesCalls", " verify title");
                VerifyTitle("Calls");

                executionLog.Log("ActivitiesBulkUpdatesCalls", "Click on Bulk Update");
                officeActivities_CallsHelper.ClickElement("BulkUpdate");
                officeActivities_CallsHelper.WaitForWorkAround(1000);

                executionLog.Log("ActivitiesBulkUpdatesCalls", "Click on Change Status");
                officeActivities_CallsHelper.ClickElement("ChangeCategory");
                officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesBulkUpdatesCalls", "Verify alert text for selecting task.");
                officeActivities_CallsHelper.VerifyAlertText("Please select atleast one record to proceed.");

                executionLog.Log("ActivitiesBulkUpdatesCalls", "Accept alert message by clickin ok.");
                officeActivities_CallsHelper.AcceptAlert();
                officeActivities_CallsHelper.WaitForWorkAround(1000);

                executionLog.Log("ActivitiesBulkUpdatesCalls", "Click on first task.");
                officeActivities_CallsHelper.ClickElement("ChkBox1");

                executionLog.Log("ActivitiesBulkUpdatesCalls", "Click on second task.");
                officeActivities_CallsHelper.ClickElement("ChkBox2");

                executionLog.Log("ActivitiesBulkUpdatesCalls", "Click on bulk update.");
                officeActivities_CallsHelper.ClickElement("BulkUpdate");
                officeActivities_CallsHelper.WaitForWorkAround(1000);

                executionLog.Log("ActivitiesBulkUpdatesCalls", "Click on change status.");
                officeActivities_CallsHelper.ClickForce("ChangeCategory");
                officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesBulkUpdatesCalls", "Select status to be updated.");
                officeActivities_CallsHelper.SelectByText("SelectCategory", "other");

                executionLog.Log("ActivitiesBulkUpdatesCalls", "Click on update button.");
                officeActivities_CallsHelper.ClickElement("UpdateCategory");
                officeActivities_CallsHelper.AcceptAlert();

                executionLog.Log("ActivitiesBulkUpdatesCalls", "Wait for success text.");
                officeActivities_CallsHelper.WaitForText("Call categories updated successfully.", 05);
                officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesBulkUpdatesCalls", "Redirect at tasks page.");
                VisitOffice("calls");
                officeActivities_CallsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesBulkUpdatesCalls", "Verify Page title as tasks.");
                VerifyTitle("Calls");

                executionLog.Log("ActivitiesBulkUpdatesCalls", "Click on first task.");
                officeActivities_CallsHelper.ClickElement("ChkBox1");

                executionLog.Log("ActivitiesBulkUpdatesCalls", "Click on second task.");
                officeActivities_CallsHelper.ClickElement("ChkBox2");

                executionLog.Log("ActivitiesBulkUpdatesCalls", "Click on bulk update.");
                officeActivities_CallsHelper.ClickElement("BulkUpdate");
                officeActivities_CallsHelper.WaitForWorkAround(1000);

                executionLog.Log("ActivitiesBulkUpdatesCalls", "Click on change user group.");
                officeActivities_CallsHelper.ClickElement("ChangeEmployee");
                officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesBulkUpdatesCalls", "Select group to be updated.");
                officeActivities_CallsHelper.SelectByText("SelectEmployee", "Howard Tang");

                executionLog.Log("ActivitiesBulkUpdatesCalls", "Click on update button.");
                officeActivities_CallsHelper.ClickForce("UpdateOwner");
                officeActivities_CallsHelper.AcceptAlert();
                officeActivities_CallsHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesBulkUpdatesCalls", "Wait for success text.");
                officeActivities_CallsHelper.WaitForText("Call owner updated successfully.", 05);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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