public void verifyFaxOptionInPhoneType2()
        {
            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_ContactsHelper = new Office_ContactsHelper(GetWebDriver());

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

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

            //try
            //{

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

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

            executionLog.Log("VerifyFaxOptionInPhoneType2", "Reditect at contact page.");
            VisitOffice("contacts");

            executionLog.Log("VerifyFaxOptionInPhoneType2", "Verify title");
            office_ContactsHelper.VerifyText("VerifyContact", "Contacts");

            executionLog.Log("VerifyFaxOptionInPhoneType2", "Reditect at create contact page.");
            VisitOffice("contacts/create");

            executionLog.Log("VerifyFaxOptionInPhoneType2", "Click on Add Phone button");
            office_ContactsHelper.ClickElement("AddPhone");

            executionLog.Log("VerifyFaxOptionInPhoneType2", "Click on Phone Type-2 drop down");
            office_ContactsHelper.ClickElement("PhoneType2");

            executionLog.Log("VerifyFaxOptionInPhoneType2", "Click on Phone Type-2 drop down");
            office_ContactsHelper.IsElementVisible("//select[@id='ContactPhone1PhoneType']/option[@value='Fax']");



            //}
            //catch (Exception e)
            //{

            //}
        }
예제 #2
0
        public void verifyContactCreditsIssue()
        {
            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_ContactsHelper = new Office_ContactsHelper(GetWebDriver());

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

            // Variable
            var FName         = "Test" + RandomNumber(99, 99999);
            var LName         = "Test" + RandomNumber(99, 99999);
            var CDBA          = "New" + RandomNumber(99, 99999);
            var ContactImport = GetPathToFile() + "contactsamples.csv";

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

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

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

                executionLog.Log("VerifyContactCreditsIssue", "Goto Contact");
                VisitOffice("contacts");
                office_ContactsHelper.WaitForWorkAround(5000);

                executionLog.Log("VerifyContactCreditsIssue", "Verify title");
                office_ContactsHelper.VerifyText("VerifyContact", "Contacts");

                executionLog.Log("VerifyContactCreditsIssue", "Goto Create Contact");
                VisitOffice("contacts/create");

                executionLog.Log("VerifyContactCreditsIssue", "Click on Cancel Button");
                office_ContactsHelper.ClickElement("Cancelbtn");

                executionLog.Log("VerifyContactCreditsIssue", "Verify text on page.");
                office_ContactsHelper.VerifyText("VerifyContact", "Contacts");

                executionLog.Log("VerifyContactCreditsIssue", "Create Contact");
                VisitOffice("contacts/create");

                executionLog.Log("VerifyContactCreditsIssue", "Enter First Name");
                office_ContactsHelper.TypeText("FirstNAME", FName);

                executionLog.Log("VerifyContactCreditsIssue", "Enter Last Name");
                office_ContactsHelper.TypeText("LastName", LName);

                executionLog.Log("VerifyContactCreditsIssue", "Enter Company DBA Name");
                office_ContactsHelper.TypeText("CompanyName", CDBA);

                executionLog.Log("VerifyContactCreditsIssue", "Click on Save Contact");
                office_ContactsHelper.ClickElement("SaveContactN");
                office_ContactsHelper.WaitForWorkAround(3000);

/*
 *          if (office_ContactsHelper.IsElementPresent("//h3[text()='Existing Contacts']"))
 *          {
 *
 *              executionLog.Log("VerifyContactCreditsIssue", "Click on Dublicate button");
 *              office_ContactsHelper.ClickElement("ClickOnDuplicate");
 *              office_ContactsHelper.WaitForWorkAround(3000);
 *
 *              executionLog.Log("VerifyContactCreditsIssue", "Confirmation");
 *              office_ContactsHelper.WaitForText("A Contact has been created.", 10);
 *
 *              executionLog.Log("VerifyContactCreditsIssue", "Redirect at contacts page.");
 *              VisitOffice("contacts");
 *
 *              executionLog.Log("VerifyContactCreditsIssue", "Verify page title.");
 *              VerifyTitle("Contacts");
 *
 *              executionLog.Log("VerifyContactCreditsIssue", "Search Contact by company name");
 *              office_ContactsHelper.TypeText("SearchCompany", CDBA);
 *              office_ContactsHelper.WaitForWorkAround(3000);
 *
 *              executionLog.Log("VerifyContactCreditsIssue", "Clcik on searched contact.");
 *              office_ContactsHelper.ClickElement("Contact1");
 *
 *              executionLog.Log("VerifyContactCreditsIssue", "Verify contact created by credits.");
 *              office_ContactsHelper.VerifyText("CreatedBy", "Howard Tang");
 *
 *              executionLog.Log("VerifyContactCreditsIssue", "Verify contact modified by credits.");
 *              office_ContactsHelper.VerifyText("ModifiedBy", "Howard Tang");
 *
 *              executionLog.Log("VerifyContactCreditsIssue", "Goto Contact");
 *              VisitOffice("contacts");
 *              office_ContactsHelper.WaitForWorkAround(3000);
 *
 *              executionLog.Log("VerifyContactCreditsIssue", "Search Contact by company name");
 *              office_ContactsHelper.TypeText("SearchCompany", CDBA);
 *              office_ContactsHelper.WaitForWorkAround(3000);
 *
 *              executionLog.Log("VerifyContactCreditsIssue", "Check the first contact checkbox");
 *              office_ContactsHelper.ClickElement("CheckTheFirstContact");
 *
 *              executionLog.Log("VerifyContactCreditsIssue", "Click delete icon");
 *              office_ContactsHelper.ClickElement("ClickOnDeleteIcon");
 *              office_ContactsHelper.AcceptAlert();
 *
 *              executionLog.Log("VerifyContactCreditsIssue", "Wait for deleted text message");
 *              office_ContactsHelper.WaitForText("records deleted successfully", 10);
 *
 *              executionLog.Log("VerifyContactCreditsIssue", "Redirect to recycled contacts.");
 *              VisitOffice("contacts/recyclebin");
 *
 *              executionLog.Log("VerifyContactCreditsIssue", "Click restore link");
 *              office_ContactsHelper.ClickElement("ClickOnContactRCRestore");
 *              office_ContactsHelper.WaitForWorkAround(3000);
 *
 *              executionLog.Log("VerifyContactCreditsIssue", "Wait for restored message");
 *              office_ContactsHelper.WaitForText("Contact Restored Successfully.", 10);
 *
 *              executionLog.Log("VerifyContactCreditsIssue", "Goto Contact");
 *              VisitOffice("contacts");
 *              office_ContactsHelper.WaitForWorkAround(3000);
 *
 *              executionLog.Log("VerifyContactCreditsIssue", "Search Contact by company name");
 *              office_ContactsHelper.TypeText("SearchCompany", CDBA);
 *              office_ContactsHelper.WaitForWorkAround(3000);
 *
 *              executionLog.Log("VerifyContactCreditsIssue", "Check the  First Checkbox");
 *              office_ContactsHelper.ClickElement("CheckTheFirstContact");
 *
 *              executionLog.Log("VerifyContactCreditsIssue", "Click on Delete Icon");
 *              office_ContactsHelper.ClickElement("ClickOnDeleteIcon");
 *              office_ContactsHelper.AcceptAlert();
 *
 *              executionLog.Log("VerifyContactCreditsIssue", "Confrimation");
 *              office_ContactsHelper.WaitForText("records deleted successfully", 10);
 *
 *              executionLog.Log("VerifyContactCreditsIssue", "Goto Contact Recycle Bin");
 *              VisitOffice("contacts/recyclebin");
 *
 *              executionLog.Log("VerifyContactCreditsIssue", "Delete Icon");
 *              office_ContactsHelper.ClickElement("ClickOnDeleteIconRCBin");
 *              office_ContactsHelper.AcceptAlert();
 *
 *              executionLog.Log("VerifyContactCreditsIssue", "Confiration");
 *              office_ContactsHelper.WaitForText("Contact Permanently Deleted.", 10);
 *
 *          }
 *          else
 *          {   */
                executionLog.Log("VerifyContactCreditsIssue", "Wait for save Confirmation");
                office_ContactsHelper.WaitForText("A Contact has been created.", 20);
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactCreditsIssue", "Redirect at contacts page.");
                VisitOffice("contacts");

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

                executionLog.Log("VerifyContactCreditsIssue", "Search Contact by company name");
                office_ContactsHelper.TypeText("SearchCompany", CDBA);
                office_ContactsHelper.WaitForWorkAround(3000);

                office_ContactsHelper.SelectDropDownByText("//select[@name='owner']", "All");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactCreditsIssue", "Click on searched contact.");
                office_ContactsHelper.ClickElement("Contact1");

                executionLog.Log("VerifyContactCreditsIssue", "Verify contact created by credits.");
                office_ContactsHelper.VerifyText("CreatedBy", "Howard Tang");

                executionLog.Log("VerifyContactCreditsIssue", "Verify contact modified by credits.");
                office_ContactsHelper.VerifyText("ModifiedBy", "Howard Tang");

                executionLog.Log("VerifyContactCreditsIssue", "Goto Contact");
                VisitOffice("contacts");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactCreditsIssue", "Search Contact by company name");
                office_ContactsHelper.TypeText("SearchCompany", CDBA);
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactCreditsIssue", "Check the first contact checkbox");
                office_ContactsHelper.ClickElement("CheckTheFirstContact");

                executionLog.Log("VerifyContactCreditsIssue", "Click delete icon");
                office_ContactsHelper.ClickElement("ClickOnDeleteIcon");
                office_ContactsHelper.AcceptAlert();

                executionLog.Log("VerifyContactCreditsIssue", "Wait for deleted text message");
                office_ContactsHelper.WaitForText("records deleted successfully", 10);

                executionLog.Log("VerifyContactCreditsIssue", "Redirect to recycled contacts.");
                VisitOffice("contacts/recyclebin");

                executionLog.Log("VerifyContactCreditsIssue", "Click restore link");
                office_ContactsHelper.ClickElement("ClickOnContactRCRestore");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactCreditsIssue", "Wait for restored message");
                office_ContactsHelper.WaitForText("Contact Restored Successfully.", 10);

                executionLog.Log("VerifyContactCreditsIssue", "Goto Contact");
                VisitOffice("contacts");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactCreditsIssue", "Search Contact by company name");
                office_ContactsHelper.TypeText("SearchCompany", CDBA);
                office_ContactsHelper.WaitForWorkAround(5000);

                executionLog.Log("VerifyContactCreditsIssue", "Check the  First Checkbox");
                office_ContactsHelper.ClickElement("CheckTheFirstContact");

                executionLog.Log("VerifyContactCreditsIssue", "Click on Delete Icon");
                office_ContactsHelper.ClickElement("ClickOnDeleteIcon");
                office_ContactsHelper.AcceptAlert();

                executionLog.Log("VerifyContactCreditsIssue", "Confrimation");
                office_ContactsHelper.WaitForText("records deleted successfully", 10);

                executionLog.Log("VerifyContactCreditsIssue", "Goto Contact Recycle Bin");
                VisitOffice("contacts/recyclebin");

                executionLog.Log("VerifyContactCreditsIssue", "Delete Icon");
                office_ContactsHelper.ClickElement("ClickOnDeleteIconRCBin");
                office_ContactsHelper.AcceptAlert();

                executionLog.Log("VerifyContactCreditsIssue", "Confiration");
                office_ContactsHelper.WaitForText("Contact Permanently Deleted.", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

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

                executionLog.Log("VerifyContactStatusOfTaskUnderContactHistory", "Goto Contact");
                VisitOffice("contacts");
                office_ContactsHelper.WaitForWorkAround(3000);

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

                executionLog.Log("VerifyContactStatusOfTaskUnderContactHistory", "Click on a contact");
                office_ContactsHelper.ClickElement("Contact1");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactStatusOfTaskUnderContactHistory", "Observe Contact Status");
                var status = office_ContactsHelper.GetText("//div[@id='status']");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactStatusOfTaskUnderContactHistory", "Click Create New(Task/Meeting) button");
                office_ContactsHelper.ClickElement("CreateNewTMBtn");
                office_ContactsHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyContactStatusOfTaskUnderContactHistory", "Click Task Option");
                office_ContactsHelper.ClickElement("TaskOption");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactStatusOfTaskUnderContactHistory", "Enter Subject of task");
                officeActivities_TasksHelper.TypeText("Subject", Subject);

                executionLog.Log("VerifyContactStatusOfTaskUnderContactHistory", "Enter Start Date of task");
                officeActivities_TasksHelper.TypeText("StartDate", "17/11/2017");

                executionLog.Log("VerifyContactStatusOfTaskUnderContactHistory", "Enter End Date of task");
                officeActivities_TasksHelper.TypeText("DueDate", "17/11/2017");

                executionLog.Log("VerifyContactStatusOfTaskUnderContactHistory", "Click on Save button");
                officeActivities_TasksHelper.ClickElement("Save");
                officeActivities_TasksHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactStatusOfTaskUnderContactHistory", "Select Activity Type >> Tasks");
                office_ContactsHelper.SelectByText("SelectActivityType", "Tasks");
                office_ContactsHelper.WaitForWorkAround(1000);

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

                executionLog.Log("VerifyContactStatusOfTaskUnderContactHistory", "Verify Contact Status is appearing");
                office_ContactsHelper.VerifyText("FirstActvtyCntctStatus", status);
                Console.WriteLine("Contact Status is appearing in front of task under Contact History " + status);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            XMLParse oXMLData = new XMLParse();

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

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

            //Initializing the objects
            var executionLog          = new ExecutionLog();
            var loginHelper           = new LoginHelper(GetWebDriver());
            var office_ContactsHelper = new Office_ContactsHelper(GetWebDriver());

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


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

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

                executionLog.Log("VerifyContactEAddressLabelPopulate", "Redirect at import contacts page.");
                VisitOffice("contacts/create");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactEAddressLabelPopulate", "Select eAddress Type >> IM");
                office_ContactsHelper.selectByText("EaddressType", "IM");
                office_ContactsHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyContactEAddressLabelPopulate", "Verify selected eAddress Label");
                office_ContactsHelper.verifyselectedOptn("EaddressLabel", "Google");

                executionLog.Log("VerifyContactEAddressLabelPopulate", "Select eAddress Type >> Social Media");
                office_ContactsHelper.selectByText("EaddressType", "Social Media");
                office_ContactsHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyContactEAddressLabelPopulate", "Verify selected eAddress Label");
                office_ContactsHelper.verifyselectedOptn("EaddressLabel", "Facebook");

                executionLog.Log("VerifyContactEAddressLabelPopulate", "Select eAddress Type >> Web Links");
                office_ContactsHelper.selectByText("EaddressType", "Web Links");
                office_ContactsHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyContactEAddressLabelPopulate", "Verify selected eAddress Label");
                office_ContactsHelper.verifyselectedOptn("EaddressLabel", "Weblink");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

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

            // Variable
            var FName         = "Test" + RandomNumber(99, 99999);
            var LName         = "Test" + RandomNumber(99, 99999);
            var CDBA          = "New" + RandomNumber(99, 99999);
            var ContactImport = GetPathToFile() + "contactsamples.csv";

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

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

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

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Goto Create Contact");
                VisitOffice("contacts/create");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Click on Cancel Button");
                office_ContactsHelper.ClickElement("Cancelbtn");
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify text on page.");
                office_ContactsHelper.VerifyText("VerifyContact", "Contacts");
                //office_ContactsHelper.WaitForWorkAround(3000);


                executionLog.Log("VerifyQuickLookLabelsForContacts", "Redirect at create contacts page.");
                VisitOffice("contacts/create");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Enter First name.");
                office_ContactsHelper.TypeText("FirstNAME", FName);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Enter Last Name");
                office_ContactsHelper.TypeText("LastName", LName);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Enter Company DBA Name");
                office_ContactsHelper.TypeText("CompanyName", CDBA);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Click on Save Contact");
                office_ContactsHelper.ClickElement("SaveContactN");
                office_ContactsHelper.WaitForWorkAround(3000);

                //    executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify Confirmation");
                //office_ContactsHelper.WaitForText("A Contact has been created.", 30);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Click on any contact.");
                office_ContactsHelper.ClickElement("Contact1");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify label for contact type.");
                office_ContactsHelper.VerifyText("Type", "Select Type");
                //office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify label for contact Status.");
                office_ContactsHelper.VerifyText("StatusV", "Active");
                //office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify label for contact source.");
                office_ContactsHelper.VerifyText("Source", "Select Source");
                //office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify label for contact category.");
                office_ContactsHelper.VerifyText("CategoryLabel", "Select Category");
                //office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify label for contact responsibility.");
                office_ContactsHelper.VerifyText("ResponsibilityV", "Howard Tang");
                //office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify label for contact sales manager.");
                office_ContactsHelper.VerifyText("SalesManagerLabel", "Select Sales Manager");
                //office_ContactsHelper.WaitForWorkAround(2000);

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

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify page title as edit contact");
                VerifyTitle("Edit Contact");
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Select contact type.");
                office_ContactsHelper.selectByText("SelectType", "Client Owner");
                //office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Select contact source.");
                office_ContactsHelper.selectByText("SelectSource", "Web Site");
                //office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Select contact category.");
                office_ContactsHelper.selectByText("SelectCategory", "Personal");
                //office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Select contact responsibility.");
                office_ContactsHelper.selectByText("Responsibility", "Howard Tang");
                //office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Select contact sales manager.");
                office_ContactsHelper.selectByText("SalesManager", "Howard Tang");
                //office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Click on save contact.");
                office_ContactsHelper.ClickElement("SaveContactN");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify title as contacts.");
                VerifyTitle("Contacts");
                //office_ContactsHelper.WaitForWorkAround(3000);


                executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify contact label for type.");
                office_ContactsHelper.VerifyText("Type", "Client Owner");
                //office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify contact label for status.");
                office_ContactsHelper.VerifyText("StatusV", "Active");
                //office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify contact label for source.");
                office_ContactsHelper.VerifyText("Source", "Web Site");
                //office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify contact label for category.");
                office_ContactsHelper.VerifyText("CategoryLabel", "Personal");
                //office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify contact label for responsibility.");
                office_ContactsHelper.VerifyText("ResponsibilityV", "Howard Tang");
                //office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Verify contact label for sales manager.");
                office_ContactsHelper.VerifyText("SalesManagerLabel", "Howard Tang");
                //office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Goto Contact");
                VisitOffice("contacts");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Search Contact by company name");
                office_ContactsHelper.TypeText("SearchCompany", CDBA);
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Select 'All' in Responsbitiy field");
                office_ContactsHelper.SelectByText("ResponsibiltyField", "All");
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Check the  First Checkbox");
                office_ContactsHelper.ClickElement("CheckTheFirstContact");
                //office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Click on Delete Icon");
                office_ContactsHelper.ClickElement("ClickOnDeleteIcon");
                office_ContactsHelper.AcceptAlert();
                //office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Confrimation");
                office_ContactsHelper.WaitForText("records deleted successfully", 10);

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Goto Contact Recycle Bin");
                VisitOffice("contacts/recyclebin");

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Delete Icon");
                office_ContactsHelper.ClickElement("ClickOnDeleteIconRCBin");
                office_ContactsHelper.AcceptAlert();

                executionLog.Log("VerifyQuickLookLabelsForContacts", "Confiration");
                office_ContactsHelper.WaitForText("Contact Permanently Deleted.", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            XMLParse oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog          = new ExecutionLog();
            var loginHelper           = new LoginHelper(GetWebDriver());
            var office_ContactsHelper = new Office_ContactsHelper(GetWebDriver());

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


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

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

                executionLog.Log("VerifyInvalidContactFile", "Redirect at contacts page.");
                VisitOffice("contacts");

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

                executionLog.Log("VerifyInvalidContactFile", "Click on Import Vcard.");
                office_ContactsHelper.ClickElement("Import");

                executionLog.Log("VerifyInvalidContactFile", "Browse a file");
                office_ContactsHelper.Upload("BrowseVcard", File);

                executionLog.Log("VerifyInvalidContactFile", "Click on import button");
                office_ContactsHelper.ClickElement("ImportBtn");
                office_ContactsHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyInvalidContactFile", "Wait for invalid file message.");
                office_ContactsHelper.WaitForText("0 Records Imported Successfully.", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

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

            // Variable
            var FName = "Fname" + RandomNumber(1, 999);
            var LName = "Lname" + RandomNumber(1, 999);
            var CDBA  = "Comp" + RandomNumber(99, 99999);

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

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

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

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Goto Contact page");
                VisitOffice("contacts");

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Verify title");
                office_ContactsHelper.VerifyText("VerifyContact", "Contacts");

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Goto Create Contact");
                VisitOffice("contacts/create");

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Verify Page title.");
                VerifyTitle("Create a Contact");

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Enter First Name");
                office_ContactsHelper.TypeText("FirstNAME", FName);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Enter Last Name");
                office_ContactsHelper.TypeText("LastName", LName);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Enter Company DBA Name");
                office_ContactsHelper.TypeText("CompanyName", CDBA);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Select phone type");
                office_ContactsHelper.Select("PhoneType1", "Work");

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Enter phone number.");
                office_ContactsHelper.TypeText("PhoneNumber1", "1222121211");

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Enter first email address.");
                office_ContactsHelper.TypeText("Eaddress", "*****@*****.**");

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Click on add email.");
                office_ContactsHelper.ClickElement("AddEmail");
                office_ContactsHelper.WaitForWorkAround(1000);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Select e adress type as email.");
                office_ContactsHelper.Select("EaddressType2", "E-Mail");

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Enter second email.");
                office_ContactsHelper.TypeText("Eaddress2", "*****@*****.**");
                office_ContactsHelper.WaitForWorkAround(1000);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Click on save button.");
                office_ContactsHelper.ClickElement("SaveContactN");

                // Verifiews if existing overlay present then create duplicate contact.

                var duplicate = "//h3[text()='Existing Contacts']";
                if (office_ContactsHelper.IsElementPresent(duplicate))
                {
                    office_ContactsHelper.WaitForWorkAround(2000);
                    office_ContactsHelper.ClickElement("DuplicateRadio");
                    office_ContactsHelper.WaitForWorkAround(2000);

                    office_ContactsHelper.ClickElement("ClickOnDuplicate");
                    office_ContactsHelper.WaitForWorkAround(2000);
                }

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Wait for success message.");
                //            office_ContactsHelper.WaitForText("A Contact has been created. . ", 10);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Redirect at contacts page.");
                VisitOffice("contacts");

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Search created contact by name.");
                office_ContactsHelper.TypeText("SearchCompany", CDBA);
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Click on edit icon.");
                office_ContactsHelper.ClickElement("EditContactNewSkin");
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Verify page title.");
                VerifyTitle("Edit Contact");
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Verify dropdown label not changed.");
                office_ContactsHelper.VerifyDropdownLabel();
                office_ContactsHelper.WaitForWorkAround(4000);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Verify dropdown type not changed.");
                office_ContactsHelper.VerifyDropdownType();
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Click on save button.");
                office_ContactsHelper.ClickElement("SaveContactN");

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Wait for success message.");
                //            office_ContactsHelper.WaitForText("A Contact has been updated.", 10);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Redirect at contacts page.");
                VisitOffice("contacts");
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Wait for locator to present.");
                office_ContactsHelper.WaitForElementPresent("SearchCompany", 10);
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Enter company name to searched.");
                office_ContactsHelper.TypeText("SearchCompany", CDBA);
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Select first contact.");
                office_ContactsHelper.ClickElement("CheckTheFirstContact");
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Click on delete icon.");
                office_ContactsHelper.ClickElement("ClickOnDeleteIcon");
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Accept alert message.");
                office_ContactsHelper.AcceptAlert();
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Wait for success message.");
                //         office_ContactsHelper.WaitForText("1 records deleted successfully", 10);
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Redirect at recyclebin page");
                VisitOffice("contacts/recyclebin");
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Verify page title.");
                VerifyTitle("Recycled Contacts");
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Enter company name to be searched.");
                //       office_ContactsHelper.TypeText("SearchCompany", CDBA);
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Click on delete icon.");
                office_ContactsHelper.ClickElement("ClickOnDeleteIconRCBin");
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Acccept alert message");
                office_ContactsHelper.AcceptAlert();
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "wait for successa message.");
                //           office_ContactsHelper.WaitForText("Contact Permanently Deleted.", 10);
                office_ContactsHelper.WaitForWorkAround(2000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            XMLParse oXMLData = new XMLParse();

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

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

            //Initializing the objects
            var executionLog          = new ExecutionLog();
            var loginHelper           = new LoginHelper(GetWebDriver());
            var office_ContactsHelper = new Office_ContactsHelper(GetWebDriver());

            // Random Variable
            var    last_name = "Contact" + GetRandomNumber();
            var    comp      = "Automation" + GetRandomNumber();
            String JIRA      = "";
            String Status    = "Pass";


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

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

                executionLog.Log("VerifyContactStatusBulkUpdate", "Redirect at import contacts page.");
                VisitOffice("contacts/create");
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyContactStatusBulkUpdate", "Enter First and Last name");
                office_ContactsHelper.TypeText("FirstNAME", "Automation");
                office_ContactsHelper.TypeText("LastName", last_name);

                executionLog.Log("VerifyContactStatusBulkUpdate", "Enter Company name");
                office_ContactsHelper.TypeText("CompanyName", comp);

                executionLog.Log("VerifyContactStatusBulkUpdate", "Select Status");
                office_ContactsHelper.selectByText("Status", "Active");

                executionLog.Log("VerifyContactStatusBulkUpdate", "Click on Save button");
                office_ContactsHelper.ClickElement("SaveContactN");
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyContactStatusBulkUpdate", "Navigate to All Contacts page");
                VisitOffice("contacts");
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyContactStatusBulkUpdate", "Search by contact name and company");
                var name = "Automation " + last_name;
                office_ContactsHelper.TypeText("SearchName", name);
                office_ContactsHelper.WaitForWorkAround(1000);
                office_ContactsHelper.TypeText("SearchCompanyName", comp);
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyContactStatusBulkUpdate", "Select check box");
                office_ContactsHelper.ClickElement("SelectIstContact");

                executionLog.Log("VerifyContactStatusBulkUpdate", "Click on Bulk Update");
                office_ContactsHelper.ClickElement("BulkUpdate");
                office_ContactsHelper.Click("//div[@title='Bulk Update']/ul/li[3]/a");
                office_ContactsHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyContactStatusBulkUpdate", "Select Status");
                office_ContactsHelper.selectByText("BU_Status", "Inactive");

                executionLog.Log("VerifyContactStatusBulkUpdate", "Click on Update button");
                office_ContactsHelper.ClickElement("BU_StatusUpdate");
                office_ContactsHelper.AcceptAlert();
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyContactStatusBulkUpdate", "Search by contact name and company");
                office_ContactsHelper.TypeText("SearchName", name);
                office_ContactsHelper.WaitForWorkAround(1000);
                office_ContactsHelper.TypeText("SearchCompanyName", comp);
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyContactStatusBulkUpdate", "Open contact");
                office_ContactsHelper.ClickElement("Contact1");
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyContactStatusBulkUpdate", "Verify Status updated");
                Assert.AreEqual(office_ContactsHelper.GetText("//div[@id='status']"), "Inactive");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

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

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

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

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

                executionLog.Log("MergeContact", "Goto Contact");
                VisitOffice("contacts");

                executionLog.Log("MergeContact", "Veify Title Contact");
                office_ContactsHelper.VerifyText("VerifyContact", "Contacts");

                executionLog.Log("MergeContact", "Goto Create Contact page.");
                VisitOffice("contacts/create");

                executionLog.Log("MergeContact", "Click on Cancel");
                office_ContactsHelper.ClickElement("Cancelbtn");

                executionLog.Log("MergeContact", "Verify Title Contact");
                office_ContactsHelper.VerifyText("VerifyContact", "Contacts");
                office_ContactsHelper.WaitForWorkAround(1000);

                executionLog.Log("MergeContact", "Create Contact");
                VisitOffice("contacts/create");

                executionLog.Log("MergeContact", "Enter First Name");
                office_ContactsHelper.TypeText("FirstNAME", FName);

                executionLog.Log("MergeContact", "Enter Last Name");
                office_ContactsHelper.TypeText("LastName", LName);

                executionLog.Log("MergeContact", "Enter Company DBA Name");
                office_ContactsHelper.TypeText("CompanyName", CDBA);

                executionLog.Log("MergeContact", "Click Save Button");
                office_ContactsHelper.ClickElement("SaveContactN");

                executionLog.Log("MergeContact", "Wait for Confirmation");
                office_ContactsHelper.WaitForText("A Contact has been created.", 10);

                executionLog.Log("MergeContact", "Goto Create Contact");
                VisitOffice("contacts/create");

                executionLog.Log("MergeContact", "Enter First Name");
                office_ContactsHelper.TypeText("FirstNAME", FName);

                executionLog.Log("MergeContact", "Enter Last Name");
                office_ContactsHelper.TypeText("LastName", LName);

                executionLog.Log("MergeContact", "Enter Company DBA Name");
                office_ContactsHelper.TypeText("CompanyName", CDBA);

                executionLog.Log("MergeContact", "Save Contact");
                office_ContactsHelper.ClickElement("SaveContactN");
                office_ContactsHelper.WaitForWorkAround(3000);

                if (office_ContactsHelper.IsElementPresent("//h3[text()='Existing Contacts']"))
                {
                    executionLog.Log("MergeContact", "Click on Dublicate");
                    office_ContactsHelper.ClickElement("ClickOnDuplicate");

                    executionLog.Log("MergeContact", "Confirmation");
                    office_ContactsHelper.WaitForText("A Contact has been created.", 10);

                    executionLog.Log("MergeContact", "Visit Contact");
                    VisitOffice("contacts");

                    executionLog.Log("MergeContact", "Select 1st contact");
                    office_ContactsHelper.ClickElement("SelectIstContact");
                    office_ContactsHelper.WaitForWorkAround(1000);

                    executionLog.Log("MergeContact", "Select 2nd contact");
                    office_ContactsHelper.ClickElement("Select2ndContact");
                    office_ContactsHelper.WaitForWorkAround(1000);

                    executionLog.Log("MergeContact", "Click on merge records.");
                    office_ContactsHelper.ClickElement("MergeRecordContact");
                    office_ContactsHelper.WaitForWorkAround(2000);

                    executionLog.Log("MergeContact", "Select Primary Contact.");
                    office_ContactsHelper.ClickElement("SelectCompContact");
                    office_ContactsHelper.WaitForWorkAround(2000);

                    executionLog.Log("MergeContact", "Click On Merge");
                    office_ContactsHelper.ClickElement("ClickOnMergeBtn");
                    office_ContactsHelper.AcceptAlert();

                    executionLog.Log("MergeContact", "Wait for success message.");
                    office_ContactsHelper.WaitForText("Merging Contact(s) Completed Successfully.", 10);
                }
                else
                {
                    executionLog.Log("MergeContact", "Wait for Confirmatoion");
                    office_ContactsHelper.WaitForText("A Contact has been created.", 10);

                    executionLog.Log("MergeContact", "Visist Contact");
                    VisitOffice("contacts");

                    executionLog.Log("MergeContact", "Select 1st Contact");
                    office_ContactsHelper.ClickElement("SelectIstContact");

                    executionLog.Log("MergeContact", "Select 2nd Contact");
                    office_ContactsHelper.ClickElement("Select2ndContact");

                    executionLog.Log("MergeContact", "Merge Record Contact");
                    office_ContactsHelper.ClickElement("MergeRecordContact");

                    executionLog.Log("MergeContact", "Select Comp Contact");
                    office_ContactsHelper.ClickElement("SelectCompContact");

                    executionLog.Log("MergeContact", "Click on Merge Button");
                    office_ContactsHelper.ClickElement("ClickOnMergeBtn");
                    office_ContactsHelper.AcceptAlert();

                    executionLog.Log("MergeContact", "Wait for Confirmation");
                    office_ContactsHelper.WaitForText("Merging Contact(s) Completed Successfully.", 10);
                }
            }

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

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

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

            // Variable
            var FName = "Fname" + RandomNumber(1, 999);
            var LName = "Lname" + RandomNumber(1, 999);
            var CDBA  = "Comp" + RandomNumber(99, 99999);

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

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

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

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Goto Contact");
                VisitOffice("contacts");

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Verify title");
                office_ContactsHelper.VerifyText("VerifyContact", "Contacts");

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Goto Create Contact");
                VisitOffice("contacts/create");

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Click on Cancel Button");
                office_ContactsHelper.ClickElement("Cancelbtn");

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Verify text on page.");
                office_ContactsHelper.VerifyText("VerifyContact", "Contacts");

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Redirect at create contacts page.");
                VisitOffice("contacts/create");

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Enter First Name");
                office_ContactsHelper.TypeText("FirstNAME", FName);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Enter Last Name");
                office_ContactsHelper.TypeText("LastName", LName);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Enter Company DBA Name");
                office_ContactsHelper.TypeText("CompanyName", CDBA);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Select phone type");
                office_ContactsHelper.Select("PhoneType1", "Work");

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Enter phone number.");
                office_ContactsHelper.TypeText("PhoneNumber1", "1222121211");

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Click on add phone.");
                office_ContactsHelper.ClickElement("AddPhone");
                office_ContactsHelper.WaitForWorkAround(1000);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Select phone type.");
                office_ContactsHelper.Select("PhoneType2", "Home");

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Enter phone number.");
                office_ContactsHelper.TypeText("PhoneNumber2", "1222121211");
                office_ContactsHelper.WaitForWorkAround(1000);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Click on radio button primary.");
                office_ContactsHelper.ClickElement("PrimaryRadio2");
                office_ContactsHelper.WaitForWorkAround(1000);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Click on remove icon to remove phone.");
                office_ContactsHelper.ClickElement("RemovePhone");
                office_ContactsHelper.WaitForWorkAround(1000);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Click on Save button.");
                office_ContactsHelper.ClickElement("SaveContactN");

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Verify alert for primary phone");
                office_ContactsHelper.VerifyAlertText("please select a primary phone");
                office_ContactsHelper.WaitForWorkAround(1000);

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Accept alert message.");
                office_ContactsHelper.AcceptAlert();

                executionLog.Log("ContactPrimaryPhoneAndExistingOverlay", "Verify that no exisitng contact overlay present.");
                Assert.IsFalse(office_ContactsHelper.IsElementPresent("ExistingContactOverlay"));
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

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

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

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

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

                executionLog.Log("VerifyingContactValidationMessage", "Reditect at contact page.");
                VisitOffice("contacts");

                executionLog.Log("VerifyingContactValidationMessage", "Verify title");
                office_ContactsHelper.VerifyText("VerifyContact", "Contacts");

                executionLog.Log("VerifyingContactValidationMessage", "Reditect at create contact page.");
                VisitOffice("contacts/create");

                executionLog.Log("VerifyingContactValidationMessage", "First Name");
                office_ContactsHelper.TypeText("FirstNAME", FName);

                executionLog.Log("VerifyingContactValidationMessage", "Last Name");
                office_ContactsHelper.TypeText("LastName", LName);

                executionLog.Log("VerifyingContactValidationMessage", "Company DBA Name");
                office_ContactsHelper.TypeText("CompanyName", CDBA);

                executionLog.Log("VerifyingContactValidationMessage", "Select Eadress type");
                office_ContactsHelper.Select("EaddressType", "E-Mail");

                executionLog.Log("VerifyingContactValidationMessage", "Enter Eadress");
                office_ContactsHelper.TypeText("Eaddress", "*****@*****.**");

                executionLog.Log("VerifyingContactValidationMessage", "Cliclk Add email button");
                office_ContactsHelper.ClickElement("AddEmail");

                executionLog.Log("VerifyingContactValidationMessage", "Select EAddress type");
                office_ContactsHelper.Select("EaddressType2", "E-Mail");

                executionLog.Log("VerifyingContactValidationMessage", "Enter eAddress");
                office_ContactsHelper.TypeText("Eaddress2", "*****@*****.**");

                executionLog.Log("VerifyingContactValidationMessage", "Select Second email as primary");
                office_ContactsHelper.Click("//input[@name='data[ContactElectronicAddress][1][primary]']");

                executionLog.Log("VerifyingContactValidationMessage", "Remove Second Email");
                office_ContactsHelper.ClickElement("RemoveEmailIcon");

                executionLog.Log("VerifyingContactValidationMessage", "Click on savw button");
                office_ContactsHelper.ClickElement("SaveContactN");
                office_ContactsHelper.WaitForWorkAround(4000);

                executionLog.Log("VerifyingContactValidationMessage", "Verify the validation message");
                office_ContactsHelper.VerifyAlertText("please select a primary email");

                executionLog.Log("VerifyingContactValidationMessage", "Accept alert");
                office_ContactsHelper.AcceptAlert();

                executionLog.Log("VerifyingContactValidationMessage", " Verify user is redirected to create page");
                VerifyTitle("Create a Contact");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            // Variable
            var    DocName = "Test Exe" + GetRandomNumber();
            var    fileUpl = GetPathToFile() + "chrome.exe";
            String JIRA    = "";
            String Status  = "Pass";

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

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

            // Verify leads with notes.

            executionLog.Log("ContactsAdvanceFilterActivities", "Redirect To URL");
            VisitOffice("contacts");
            office_ContactsHelper.WaitForWorkAround(3000);

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

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

            executionLog.Log("ContactsAdvanceFilterActivities", "Click on show activiities button.");
            office_ContactsHelper.CheckAndClick("ShowActivities");
            office_ContactsHelper.WaitForWorkAround(1000);

            executionLog.Log("ContactsAdvanceFilterActivities", "Selct contact activity type.");
            office_ContactsHelper.ClickElement("ContactWithNotes");
            //office_ContactsHelper.WaitForWorkAround(3000);

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

            executionLog.Log("ContactsAdvanceFilterActivities", "Click on any contact.");
            office_ContactsHelper.ClickElement("Contact1");
            office_ContactsHelper.WaitForWorkAround(3000);

            executionLog.Log("ContactsAdvanceFilterActivities", "Select actitivity type as notes.");
            office_ContactsHelper.SelectByText("SelectActivityType", "Notes");
            office_ContactsHelper.WaitForWorkAround(2000);

            executionLog.Log("ContactsAdvanceFilterActivities", "Select All in created by field");
            office_ContactsHelper.selectByText("CreatedByField", "All");
            office_ContactsHelper.WaitForWorkAround(2000);

            executionLog.Log("ContactsAdvanceFilterActivities", "Verify notes present for contact.");
            office_ContactsHelper.WaitForElementVisible("NotesContacts", 10);


            // Verify contacts with open tasks.

            executionLog.Log("ContactsAdvanceFilterActivities", "Redirect To URL");
            VisitOffice("contacts");
            office_ContactsHelper.WaitForWorkAround(3000);

            executionLog.Log("ContactsAdvanceFilterActivities", "Verify page title.");
            VerifyTitle("Contacts");
            //office_ContactsHelper.WaitForWorkAround(1000);

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

            executionLog.Log("ContactsAdvanceFilterActivities", "Click on show activiities button.");
            office_ContactsHelper.CheckAndClick("ShowActivities");
            office_ContactsHelper.WaitForWorkAround(1000);

            executionLog.Log("ContactsAdvanceFilterActivities", "Selct contact activity type.");
            office_ContactsHelper.ClickElement("ContactWithTask");
            //office_ContactsHelper.WaitForWorkAround(3000);

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

            executionLog.Log("ContactsAdvanceFilterActivities", "Click on any contact.");
            office_ContactsHelper.ClickElement("Contact1");
            office_ContactsHelper.WaitForWorkAround(3000);

            executionLog.Log("ContactsAdvanceFilterActivities", "Select actitivity type as notes.");
            office_ContactsHelper.SelectByText("SelectActivityType", "Tasks");
            office_ContactsHelper.WaitForWorkAround(2000);

            executionLog.Log("ContactsAdvanceFilterActivities", "Select All in created by field");
            office_ContactsHelper.selectByText("CreatedByField", "All");
            office_ContactsHelper.WaitForWorkAround(2000);

            executionLog.Log("ContactsAdvanceFilterActivities", "Verify notes present for contact.");
            office_ContactsHelper.WaitForElementVisible("TasksContacts", 10);

            // Verify contacts with closed tasks.

            //executionLog.Log("ContactsAdvanceFilterActivities", "Redirect To URL");
            //VisitOffice("contacts");
            //office_ContactsHelper.WaitForWorkAround(3000);

            //executionLog.Log("ContactsAdvanceFilterActivities", "Verify page title.");
            //VerifyTitle("Contacts");

            //executionLog.Log("ContactsAdvanceFilterActivities", "Click on advance filter.");
            //office_ContactsHelper.ClickElement("AdvanceFilter");
            //office_ContactsHelper.WaitForWorkAround(2000);

            //executionLog.Log("ContactsAdvanceFilterActivities", "Click on show activiities button.");
            //office_ContactsHelper.CheckAndClick("ShowActivities");
            //office_ContactsHelper.WaitForWorkAround(1000);

            //executionLog.Log("ContactsAdvanceFilterActivities", "Selct contact activity type.");
            //office_ContactsHelper.ClickElement("ContactsWithCLosedTasks");
            ////office_ContactsHelper.WaitForWorkAround(3000);

            //executionLog.Log("ContactsAdvanceFilterActivities", "Click on apply button.");
            //office_ContactsHelper.ClickElement("Apply");
            //office_ContactsHelper.WaitForWorkAround(3000);

            //executionLog.Log("ContactsAdvanceFilterActivities", "Click on any contact.");
            //office_ContactsHelper.ClickElement("Contact1");
            //office_ContactsHelper.WaitForWorkAround(3000);

            //executionLog.Log("ContactsAdvanceFilterActivities", "Select actitivity type as notes.");
            //office_ContactsHelper.SelectByText("SelectActivityType", "Tasks");
            //office_ContactsHelper.WaitForWorkAround(2000);

            //executionLog.Log("ContactsAdvanceFilterActivities", "Select All in created by field");
            //office_ContactsHelper.selectByText("CreatedByField", "All");
            //office_ContactsHelper.WaitForWorkAround(2000);

            //executionLog.Log("ContactsAdvanceFilterActivities", "Verify notes present for contact.");
            //office_ContactsHelper.WaitForElementVisible("TasksContacts", 10);

            // Verify contacts with documents.

            executionLog.Log("ContactsAdvanceFilterActivities", "Redirect To URL");
            VisitOffice("contacts");
            office_ContactsHelper.WaitForWorkAround(3000);

            executionLog.Log("ContactsAdvanceFilterActivities", "Verify page title.");
            VerifyTitle("Contacts");
            //office_ContactsHelper.WaitForWorkAround(1000);

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

            executionLog.Log("ContactsAdvanceFilterActivities", "Click on show activiities button.");
            office_ContactsHelper.CheckAndClick("ShowActivities");
            office_ContactsHelper.WaitForWorkAround(4000);

            executionLog.Log("ContactsAdvanceFilterActivities", "Selct contact activity type.");
            office_ContactsHelper.ClickElement("ContactWithDocs");
            //office_ContactsHelper.WaitForWorkAround(3000);

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

            executionLog.Log("ContactsAdvanceFilterActivities", "Click on any contact.");
            office_ContactsHelper.ClickElement("Contact1");
            office_ContactsHelper.WaitForWorkAround(3000);

            executionLog.Log("ContactsAdvanceFilterActivities", "Select actitivity type as notes.");
            office_ContactsHelper.SelectByText("SelectActivityType", "Documents");
            office_ContactsHelper.WaitForWorkAround(2000);

            executionLog.Log("ContactsAdvanceFilterActivities", "Select All in created by field");
            office_ContactsHelper.selectByText("CreatedByField", "All");
            office_ContactsHelper.WaitForWorkAround(2000);

            executionLog.Log("ContactsAdvanceFilterActivities", "Verify notes present for contact.");
            office_ContactsHelper.WaitForElementVisible("DOcumentsContacts", 10);

            // Verify contacts with emails.

            executionLog.Log("ContactsAdvanceFilterActivities", "Redirect To URL");
            VisitOffice("contacts");
            office_ContactsHelper.WaitForWorkAround(3000);

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

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

            executionLog.Log("ContactsAdvanceFilterActivities", "Click on show activiities button.");
            office_ContactsHelper.CheckAndClick("ShowActivities");
            office_ContactsHelper.WaitForWorkAround(1000);

            executionLog.Log("ContactsAdvanceFilterActivities", "Selct contact activity type.");
            office_ContactsHelper.ClickElement("ContactWithEmails");
            //office_ContactsHelper.WaitForWorkAround(3000);

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

            executionLog.Log("ContactsAdvanceFilterActivities", "Click on any contact.");
            office_ContactsHelper.ClickElement("Contact1");
            office_ContactsHelper.WaitForWorkAround(3000);

            executionLog.Log("ContactsAdvanceFilterActivities", "Select actitivity type as notes.");
            office_ContactsHelper.SelectByText("SelectActivityType", "E-Mails");
            office_ContactsHelper.WaitForWorkAround(2000);

            executionLog.Log("ContactsAdvanceFilterActivities", "Select All in created by field");
            office_ContactsHelper.selectByText("CreatedByField", "All");
            office_ContactsHelper.WaitForWorkAround(2000);

            executionLog.Log("ContactsAdvanceFilterActivities", "Verify notes present for contact.");
            office_ContactsHelper.WaitForElementVisible("EmailsContacts", 10);
            //office_ContactsHelper.WaitForWorkAround(3000);
            //}
            //catch (Exception e)
            //{
            //    executionLog.Log("Error", e.StackTrace);
            //    Status = "Fail";

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

            //}
            //finally
            //{
            //    executionLog.DeleteFile("ContactsAdvanceFilterActivities");
            //    executionLog.WriteInExcel("Contacts Advance Filter Activities", Status, JIRA, "Opportunities Management");
            //}
        }
예제 #13
0
        public void verifyRemarkBtnInContacts()
        {
            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_ContactsHelper = new Office_ContactsHelper(GetWebDriver());

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

            // Variable
            var FName = "Test" + RandomNumber(99, 99999);
            var LName = "Test" + RandomNumber(99, 99999);
            var CDBA  = "NewComp" + RandomNumber(1, 99999);

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

            //try
            //{

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

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

            executionLog.Log("VerifyRemarkBtnInContacts", "Redirect to contact page.");
            VisitOffice("contacts");

            executionLog.Log("VerifyRemarkBtnInContacts", "Verify title");
            office_ContactsHelper.VerifyText("VerifyContact", "Contacts");

            executionLog.Log("VerifyRemarkBtnInContacts", "Reditect to create contact page.");
            VisitOffice("contacts/create");

            executionLog.Log("VerifyRemarkBtnInContacts", "First Name");
            office_ContactsHelper.TypeText("FirstNAME", FName);

            executionLog.Log("VerifyRemarkBtnInContacts", "Last Name");
            office_ContactsHelper.TypeText("LastName", LName);

            executionLog.Log("VerifyRemarkBtnInContacts", "Company DBA Name");
            office_ContactsHelper.TypeText("CompanyName", CDBA);

            executionLog.Log("VerifyRemarkBtnInContacts", "Click on Add Remark button");
            office_ContactsHelper.ClickElement("AddRemarkPhnBtn1");
            office_ContactsHelper.WaitForWorkAround(2000);

            executionLog.Log("VerifyRemarkBtnInContacts", "Enter Remark");
            office_ContactsHelper.TypeText("AddRemarkPhnArea1", "THIS IS PHONE REMARK");

            executionLog.Log("VerifyRemarkBtnInContacts", "Click Add Remark button");
            office_ContactsHelper.ClickElement("AddRemarkEmailBtn1");
            office_ContactsHelper.WaitForWorkAround(2000);

            executionLog.Log("VerifyRemarkBtnInContacts", "Enter Remark");
            office_ContactsHelper.TypeText("AddRemarkEmailArea1", "THIS IS EMAIL REMARK");

            executionLog.Log("VerifyRemarkBtnInContacts", "Click on Save button");
            office_ContactsHelper.ClickElement("SaveContactN");
            office_ContactsHelper.WaitForWorkAround(3000);

            executionLog.Log("VerifyRemarkBtnInContacts", "Enter Contact Name in Search Box");
            office_ContactsHelper.TypeText("SearchName", FName);
            office_ContactsHelper.WaitForWorkAround(4000);

            executionLog.Log("VerifyRemarkBtnInContacts", "Click on Edit icon");
            office_ContactsHelper.ClickElement("FirstEditIcon");
            office_ContactsHelper.WaitForWorkAround(2000);

            executionLog.Log("VerifyRemarkBtnInContacts", "Verify Show Remark text for Phone");
            office_ContactsHelper.VerifyText("AddRemarkPhnBtn1", "Show remark");
            Console.WriteLine("Show Remark is appearing for Phone");

            executionLog.Log("VerifyRemarkBtnInContacts", "Verify Show Remark text for Email");
            office_ContactsHelper.VerifyText("AddRemarkEmailBtn1", "Show remark");
            Console.WriteLine("Show Remark is appearing for Email");

            executionLog.Log("VerifyRemarkBtnInContacts", "Redirect to contact page.");
            VisitOffice("contacts");

            executionLog.Log("VerifyRemarkBtnInContacts", "Enter Contact Name in Search Box");
            office_ContactsHelper.TypeText("SearchName", FName);
            office_ContactsHelper.WaitForWorkAround(4000);

            executionLog.Log("VerifyRemarkBtnInContacts", "Click on check box");
            office_ContactsHelper.ClickElement("SelectIstContact");

            executionLog.Log("VerifyRemarkBtnInContacts", "Click on Delete button");
            office_ContactsHelper.ClickElement("ClickOnDeleteIcon");



            //}
            //catch (Exception e)
            //{

            //}
        }
        public void verifyContactsAdvanceFilerColumnOrder()
        {
            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_ContactsHelper = new Office_ContactsHelper(GetWebDriver());

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

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

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

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Redirect To URL");
                VisitOffice("contacts");
                office_ContactsHelper.WaitForWorkAround(5000);

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

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify default position of company name column.");
                office_ContactsHelper.IsElementPresent("HeadCompany");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify default position of contact column.");
                office_ContactsHelper.IsElementPresent("HeadContact");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify default position of phone column.");
                office_ContactsHelper.IsElementPresent("HeadPhone");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify default position of email column.");
                office_ContactsHelper.IsElementPresent("HeadEmail");
                office_ContactsHelper.WaitForWorkAround(3000);

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

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Select company in displayed columns.");
                office_ContactsHelper.SelectByText("DisplayedCols", "Company");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Click arrow to move column to avail cols.");
                office_ContactsHelper.ClickElement("RemoveCols");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Select contact in displayed columns.");
                office_ContactsHelper.SelectByText("DisplayedCols", "Contact Type");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Click arrow to move column to avail cols");
                office_ContactsHelper.ClickElement("RemoveCols");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Select phone in displayed columns.");
                office_ContactsHelper.SelectByText("DisplayedCols", "Phone");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Click arrow to move column to avail cols");
                office_ContactsHelper.ClickElement("RemoveCols");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Select email in displayed columns.");
                office_ContactsHelper.SelectByText("DisplayedCols", "E-Mail");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Click arrow to move column to avail cols");
                office_ContactsHelper.ClickElement("RemoveCols");
                office_ContactsHelper.WaitForWorkAround(3000);

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

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify company name not present on page.");
                office_ContactsHelper.IsElementNotPresent("HeadCompany");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify contact name not present on page.");
                office_ContactsHelper.IsElementNotPresent("HeadContact");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify phone not present on page.");
                office_ContactsHelper.IsElementNotPresent("HeadPhone");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify email not present on page.");
                office_ContactsHelper.IsElementNotPresent("HeadEmail");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Redirect at leads page.");
                VisitOffice("leads");

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

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Redirect at clients page.");
                VisitOffice("contacts");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify page title as clients");
                VerifyTitle("Contacts");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify default position of phone column.");
                office_ContactsHelper.IsElementPresent("HeadPhone5");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify default position of email column.");
                office_ContactsHelper.IsElementPresent("HeadEmail4");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Redirect at merchants page.");
                VisitOffice("contacts");
                office_ContactsHelper.WaitForWorkAround(3000);

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

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Select phone in displayed column.");
                office_ContactsHelper.SelectByText("DisplayedCols", "Phone");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Move phone 1 step up.");
                office_ContactsHelper.ClickElement("MoveUp");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Move phone 1 step up.");
                office_ContactsHelper.ClickElement("MoveUp");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Select email in displayed column.");
                office_ContactsHelper.SelectByText("DisplayedCols", "E-Mail");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Move email 1 step down.");
                office_ContactsHelper.ClickElement("MoveDown");
                office_ContactsHelper.WaitForWorkAround(3000);

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

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify changed position of phone column.");
                office_ContactsHelper.IsElementPresent("HeadPhone2");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Verify changed position of email column.");
                office_ContactsHelper.IsElementPresent("HeadEmail5");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyContactsAdvanceFilerColumnOrder", "Logout from the application.");
                VisitCorp("logout");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyContactsAdvanceFilerColumnOrder");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Contacts Advance Filer Column Order");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Contacts Advance Filer Column Order", "Bug", "Medium", "Opportunities page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Contacts Advance Filer Column Order");
                        TakeScreenshot("VerifyContactsAdvanceFilerColumnOrder");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyContactsAdvanceFilerColumnOrder.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyContactsAdvanceFilerColumnOrder");
                        string id            = loginHelper.getIssueID("Verify Contacts Advance Filer Column Order");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyContactsAdvanceFilerColumnOrder.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Contacts Advance Filer Column Order"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Contacts Advance Filer Column Order");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyContactsAdvanceFilerColumnOrder");
                executionLog.WriteInExcel("Verify Contacts Advance Filer Column Order", Status, JIRA, "Opportunities Management");
            }
        }
예제 #15
0
        public void one000Added()
        {
            string[] username = null;
            string[] password = null;
            string[] log      = null;
            var      oXMLData = new XMLParse();

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

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

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

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

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

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

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

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

                executionLog.Log("One000Added", "Click on Advance filter");
                office_ClientsHelper.ClickElement("Advance");

                executionLog.Log("One000Added", "Veirfy website is available under the filter");
                office_ClientsHelper.verifyElementPresent("PegResult");

                executionLog.Log("One000Added", "Go to contact page");
                VisitOffice("contacts");

                executionLog.Log("One000Added", "Verify title");
                VerifyTitle("Contacts");

                executionLog.Log("One000Added", "Click on Advance filter");
                office_ContactsHelper.ClickElement("Advance");

                executionLog.Log("One000Added", "Veirfy website is available under the filter");
                office_ContactsHelper.verifyElementPresent("PegResult");

                executionLog.Log("One000Added", "Go to Tickets page");
                VisitOffice("tickets");

                executionLog.Log("One000Added", "Verify title");
                VerifyTitle("Tickets");

                executionLog.Log("One000Added", "Click on Advance filter");
                officeTickets_AllTicketsHelper.ClickElement("Advance");

                executionLog.Log("One000Added", "Veirfy website is available under the filter");
                officeTickets_AllTicketsHelper.verifyElementPresent("PegResult");

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

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

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


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

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

                executionLog.Log("VerifyContactCategorySalesMgrLabel", "Redirect at contacts page.");
                VisitOffice("contacts");

                executionLog.Log("VerifyContactCategorySalesMgrLabel", "Verify page title as contacts.");
                VerifyTitle("Contacts");

                executionLog.Log("VerifyContactCategorySalesMgrLabel", "Click on any contacts.");
                office_ContactsHelper.ClickElement("Contact1");

                executionLog.Log("VerifyContactCategorySalesMgrLabel", "Verify label for contact category.");
                office_ContactsHelper.VerifyText("CategoryLabel", "Select Category");

                executionLog.Log("VerifyContactCategorySalesMgrLabel", "Verify label for contact sales manager.");
                office_ContactsHelper.VerifyText("SalesManagerLabel", "Select Sales Manager");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyContactCategorySalesMgrLabel");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Contact Category SalesMgr Label");
                if (!result)
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Contact Category SalesMgr Label", "Bug", "Medium", "Contacts page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Contact Category SalesMgr Label");
                        TakeScreenshot("VerifyContactCategorySalesMgrLabel");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyContactCategorySalesMgrLabel.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyContactCategorySalesMgrLabel");
                        string id            = loginHelper.getIssueID("Verify Contact Category SalesMgr Label");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyContactCategorySalesMgrLabel.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Contact Category SalesMgr Label"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Contact Category SalesMgr Label");
                executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyContactCategorySalesMgrLabel");
                executionLog.WriteInExcel("Verify Contact Category SalesMgr Label", Status, JIRA, "Contacts Management");
            }
        }
예제 #17
0
        public void contactUrlChange()
        {
            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 contact_Helper = new Office_ContactsHelper(GetWebDriver());

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

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

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

                executionLog.Log("ContactUrlChange", "Goto User contacts");
                VisitOffice("contacts");

                executionLog.Log("ContactUrlChange", "Click On Any  Contact");
                contact_Helper.ClickElement("CheckTheFirstContact");
                contact_Helper.WaitForWorkAround(2000);

                executionLog.Log("ContactUrlChange", "Change the url with the url number of another office");
                VisitOffice("contacts/edit/97031");
                contact_Helper.WaitForWorkAround(2000);

                executionLog.Log("ContactUrlChange", "Verify Validation");
                contact_Helper.VerifyPageText("You don't have privileges to edit this Contact.");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            var oXMLData = new XMLParse();

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

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

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


            var DBA       = "ClientDBA" + RandomNumber(111, 999999);
            var ownername = "Owner" + DBA;

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

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

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

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Redirect at Create merchant page");
                VisitOffice("clients/create");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Enter DBA name");
                office_ClientsHelper.TypeText("ClientDBAName", DBA);

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Select the client status");
                office_ClientsHelper.SelectByText("Status", "New");

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "select the responsibity");
                office_ClientsHelper.SelectByText("Responsibility", "Howard Tang");

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Click on save btn");
                office_ClientsHelper.ClickElement("Save");
                office_ClientsHelper.WaitForWorkAround(3000);

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

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Enter Title");
                office_ClientsHelper.TypeText("TitleOwner", "Title");

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Enter Owner First Name");
                office_ClientsHelper.TypeText("OwnerFirstName", ownername);

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Enter Owner Last Name");
                office_ClientsHelper.TypeText("OwnerLastName", "Owner");

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Click on Save button");
                office_ClientsHelper.ClickElement("OwnerSave");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Redirect at All Contacts page");
                VisitOffice("contacts");
                office_ContactsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Search Contact Name");
                office_ContactsHelper.TypeText("SearchName", ownername);
                office_ContactsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Verify Company name");
                office_ContactsHelper.VerifyText("FirstCompName", DBA);

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

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Search the company Name");
                office_ClientsHelper.TypeText("SearchClient", DBA);
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Click on check box");
                office_ClientsHelper.ClickElement("ClickOnCheckBox");

                executionLog.Log("VerifyCompanyNameOfMerchantOwnerContact", "Delete the client");
                office_ClientsHelper.ClickJS("DeleteClient");
                office_ClientsHelper.AcceptAlert();
                office_ClientsHelper.WaitForWorkAround(3000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            // Variable
            var    DocName = "Test Exe" + GetRandomNumber();
            var    fileUpl = GetPathToFile() + "chrome.exe";
            String JIRA    = "";
            String Status  = "Pass";

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

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

                executionLog.Log("ContactsAdvanceFilterResultsPP", "Redirect To URL");
                VisitOffice("contacts");
                office_ContactsHelper.WaitForWorkAround(3000);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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