Esempio n. 1
0
        public void verifyOpportunityAddressLabel()
        {
            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_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver());

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

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

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

                executionLog.Log("VerifyOpportunityAddressLabel", "Redirect at opportunities page.");
                VisitOffice("opportunities");

                executionLog.Log("VerifyOpportunityAddressLabel", "Click on Create button");
                office_OpportunitiesHelper.ClickElement("Create");

                executionLog.Log("VerifyOpportunityAddressLabel", "Verify Address Line 1 label");
                office_OpportunitiesHelper.VerifyText("AddressLine1Label", "Address Line 1:");
            }
            catch (Exception e)
            {
            }
        }
Esempio n. 2
0
        public void partnerAgentCodeInQuickLook()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver());

            // Variable

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

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

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

                executionLog.Log("PartnerAgentCodeInQuickLook", "Goto Opportinuties");
                VisitOffice("opportunities");

                executionLog.Log("PartnerAgentCodeInQuickLook", "Open Opportunity");
                office_OpportunitiesHelper.ClickElement("Opportunities1");
                office_OpportunitiesHelper.WaitForWorkAround(5000);

                executionLog.Log("PartnerAgentCodeInQuickLook", "Edit Opportunity");
                office_OpportunitiesHelper.clickJS("OppEdit");
                office_OpportunitiesHelper.WaitForWorkAround(3000);
                executionLog.Log("PartnerAgentCodeInQuickLook", "Enter Partner Agent Code.");
                office_OpportunitiesHelper.TypeText("PartnerAgentCode_Field", "233");

                executionLog.Log("PartnerAgentCodeInQuickLook", "Select the status");
                office_OpportunitiesHelper.SelectByText("State", "New");

                executionLog.Log("PartnerAgentCodeInQuickLook", "Click On Save Button");
                office_OpportunitiesHelper.clickJS("ClickSaveClient");
                office_OpportunitiesHelper.WaitForWorkAround(9000);

                executionLog.Log("PartnerAgentCodeInQuickLook", "Verify added code in Quick Look.");
                office_OpportunitiesHelper.VerifyPageText("223");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            var oXMLData = new XMLParse();

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

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

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

            // Random Variables.
            var    Subject = "Meeting" + GetRandomNumber();
            var    file    = GetPathToFile() + "2.pdf";
            String JIRA    = "";
            String Status  = "Pass";

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

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

                executionLog.Log("ActivitiesMeetingsManagement", "Go to create meetings page");
                VisitOffice("meetings/create");
                officeActivities_MeetingHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesMeetingsManagement", "Verify page title.");
                VerifyTitle("Create a Meeting");

                executionLog.Log("ActivitiesMeetingsManagement", "Click On Save button");
                officeActivities_MeetingHelper.ClickElement("Save");

                executionLog.Log("ActivitiesMeetingsManagement", "Verify validation text for mandatoryness.");
                officeActivities_MeetingHelper.VerifyText("NameError", "This field is required.");

                executionLog.Log("ActivitiesMeetingsManagement", "Verify validation text for mandatoryness.");
                officeActivities_MeetingHelper.VerifyText("StartDateError", "This field is required.");

                executionLog.Log("ActivitiesMeetingsManagement", "Verify validation text for mandatoryness.");
                officeActivities_MeetingHelper.VerifyText("ParentError", "This field is required.");

                executionLog.Log("ActivitiesMeetingsManagement", "Enter Subject for the meeting");
                officeActivities_MeetingHelper.TypeText("Subject", Subject);

                executionLog.Log("ActivitiesMeetingsManagement", "Enter location of meeting.");
                officeActivities_MeetingHelper.TypeText("Location", "Test Location");

                executionLog.Log("ActivitiesMeetingsManagement", "Enter start date.");
                officeActivities_MeetingHelper.TypeText("StartDate", "12/30/2016");

                executionLog.Log("ActivitiesMeetingsManagement", "Enter End Date.");
                officeActivities_MeetingHelper.TypeText("EndDate", "12/22/2016");

                executionLog.Log("ActivitiesMeetingsManagement", "Select Related To");
                officeActivities_MeetingHelper.SelectByText("RelatedTo", "Client");

                executionLog.Log("ActivitiesMeetingsManagement", "Click On find list icon");
                officeActivities_MeetingHelper.ClickElement("FindListIcon");
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click on client for which meeting is created.");
                officeActivities_MeetingHelper.ClickElement("ClickOnClientMeeting");
                officeActivities_MeetingHelper.WaitForWorkAround(1000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click On Save button");
                officeActivities_MeetingHelper.ClickElement("Save");

                executionLog.Log("ActivitiesMeetingsManagement", "Click On Save button");
                officeActivities_MeetingHelper.VerifyAlertText("Start Date & Time should lesser than or equal to Due Date & Time.");
                officeActivities_MeetingHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click On Save button");
                officeActivities_MeetingHelper.AcceptAlert();

                executionLog.Log("ActivitiesMeetingsManagement", "Enter start date");
                officeActivities_MeetingHelper.TypeText("StartDate", "12/22/2016");

                executionLog.Log("ActivitiesMeetingsManagement", "Enter End Date.");
                officeActivities_MeetingHelper.TypeText("EndDate", "12/30/2016");

                executionLog.Log("ActivitiesMeetingsManagement", "Click On Save button");
                officeActivities_MeetingHelper.ClickElement("Save");

                executionLog.Log("ActivitiesMeetingsManagement", "verify page text");
                officeActivities_MeetingHelper.WaitForText("Meeting saved successfully.", 10);

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

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

                executionLog.Log("ActivitiesMeetingsManagement", "Select actitivity type as meetings.");
                office_ClientsHelper.Select("SelectActivityType", "Meetings");
                office_ClientsHelper.WaitForWorkAround(1000);

                executionLog.Log("ActivitiesMeetingsManagement", "Enter ticket name to be search.");
                office_ClientsHelper.TypeText("ActivitySubject", Subject);
                office_ClientsHelper.WaitForWorkAround(2000);

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

                executionLog.Log("ActivitiesMeetingsManagement", "Redirect at meetings page.");
                VisitOffice("meetings");
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesMeetingsManagement", "Search meeting by subject");
                officeActivities_MeetingHelper.TypeText("SearchSubject", Subject);
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesMeetingsManagement", "select all in  owner fiedld");
                officeActivities_MeetingHelper.SelectByText("Owner", "All");
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click on Edit");
                officeActivities_MeetingHelper.ClickElement("Edit");
                officeActivities_MeetingHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesMeetingsManagement", "Verify page title.");
                VerifyTitle("Edit Meeting");

                executionLog.Log("ActivitiesMeetingsManagement", "Select meeting parent as lead");
                officeActivities_MeetingHelper.SelectByText("RelatedTo", "Lead");
                officeActivities_MeetingHelper.WaitForWorkAround(1000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click On find list icon");
                officeActivities_MeetingHelper.ClickElement("FindListIcon");
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click on lead for which meeting is created.");
                officeActivities_MeetingHelper.ClickElement("ClickOnClientMeeting");
                officeActivities_MeetingHelper.WaitForWorkAround(1000);

                executionLog.Log("ActivitiesMeetingsManagement", "Edit end Date");
                officeActivities_MeetingHelper.TypeText("EndDate", "1/1/2017");

                executionLog.Log("ActivitiesMeetingsManagement", "Click On Save button");
                officeActivities_MeetingHelper.ClickElement("Save");

                executionLog.Log("ActivitiesMeetingsManagement", "Wait for updation success.");
                officeActivities_MeetingHelper.WaitForText("Meeting updated successfully.", 10);

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

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

                executionLog.Log("ActivitiesMeetingsManagement", "Select actitivity type as meetings.");
                office_LeadsHelper.Select("SelectActivityType", "Meetings");
                office_LeadsHelper.WaitForWorkAround(1000);

                executionLog.Log("ActivitiesMeetingsManagement", "Enter meeting name to be search.");
                office_LeadsHelper.TypeText("ActivitySubject", Subject);
                office_LeadsHelper.WaitForWorkAround(2000);

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

                executionLog.Log("ActivitiesMeetingsManagement", "Redirect at meetings page.");
                VisitOffice("meetings");
                officeActivities_MeetingHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesMeetingsManagement", "Search meeting by subject");
                officeActivities_MeetingHelper.TypeText("SearchSubject", Subject);
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesMeetingsManagement", "select all in  owner fiedld");
                officeActivities_MeetingHelper.SelectByText("Owner", "All");
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click on Edit");
                officeActivities_MeetingHelper.ClickElement("Edit");
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesMeetingsManagement", "Verify page title.");
                VerifyTitle("Edit Meeting");

                executionLog.Log("ActivitiesMeetingsManagement", "Select parent type to opportunity");
                officeActivities_MeetingHelper.SelectByText("RelatedTo", "Opportunity");
                officeActivities_MeetingHelper.WaitForWorkAround(1000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click On find list icon");
                officeActivities_MeetingHelper.ClickElement("FindListIcon");
                officeActivities_MeetingHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click on opportunity for which meeting is created.");
                officeActivities_MeetingHelper.ClickElement("ClickOnClientMeeting");
                officeActivities_MeetingHelper.WaitForWorkAround(1000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click On Save button");
                officeActivities_MeetingHelper.ClickElement("Save");

                executionLog.Log("ActivitiesMeetingsManagement", "Wait for updation success message.");
                officeActivities_MeetingHelper.WaitForText("Meeting updated successfully.", 10);

                executionLog.Log("ActivitiesMeetingsManagement", "Redirect at opportunities page.");
                VisitOffice("opportunities");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

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

                executionLog.Log("ActivitiesMeetingsManagement", "Select actitivity type as meetings");
                office_LeadsHelper.Select("SelectActivityType", "Meetings");
                office_OpportunitiesHelper.WaitForWorkAround(1000);

                executionLog.Log("ActivitiesMeetingsManagement", "Enter meeting name to be search.");
                office_OpportunitiesHelper.TypeText("ActivitySubject", Subject);
                office_OpportunitiesHelper.WaitForWorkAround(2000);

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

                executionLog.Log("ActivitiesMeetingsManagement", "Redirect at meetings page.");
                VisitOffice("meetings");
                officeActivities_MeetingHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesMeetingsManagement", "Search meeting by subject");
                officeActivities_MeetingHelper.TypeText("SearchSubject", Subject);
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesMeetingsManagement", "select all in  owner fiedld");
                officeActivities_MeetingHelper.SelectByText("Owner", "All");
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click on Edit");
                officeActivities_MeetingHelper.ClickElement("Edit");
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesMeetingsManagement", "Verify page title.");
                VerifyTitle("Edit Meeting");

                executionLog.Log("ActivitiesMeetingsManagement", "Select parent type for meeting.");
                officeActivities_MeetingHelper.SelectByText("RelatedTo", "Ticket");
                officeActivities_MeetingHelper.WaitForWorkAround(1000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click On find list icon");
                officeActivities_MeetingHelper.ClickElement("FindListIcon");
                officeActivities_MeetingHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click on ticket for which meeting is created.");
                officeActivities_MeetingHelper.ClickElement("ClickOnClientMeeting");
                officeActivities_MeetingHelper.WaitForWorkAround(1000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click On Save button");
                officeActivities_MeetingHelper.ClickElement("Save");

                executionLog.Log("ActivitiesMeetingsManagement", "Wait for success message.");
                officeActivities_MeetingHelper.WaitForText("Meeting updated successfully.", 10);

                executionLog.Log("ActivitiesMeetingsManagement", "Redirect at tickets page.");
                VisitOffice("tickets");

                executionLog.Log("ActivitiesMeetingsManagement", "Click On any ticket.");
                ticket_CreateATicketHelper.ClickElement("Ticket1");

                executionLog.Log("ActivitiesMeetingsManagement", "Select actitivity type as meetings");
                office_LeadsHelper.Select("SelectActivityType", "Meetings");

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

                executionLog.Log("ActivitiesMeetingsManagement", "Click on ticket to view details");
                ticket_CreateATicketHelper.IsElementPresent("OpenTicket");

                executionLog.Log("ActivitiesMeetingsManagement", "Redirect at meetings page.");
                VisitOffice("meetings");

                executionLog.Log("ActivitiesMeetingsManagement", "Search meeting by subject");
                officeActivities_MeetingHelper.TypeText("SearchSubject", Subject);
                officeActivities_MeetingHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesMeetingsManagement", "select all in  owner fiedld");
                officeActivities_MeetingHelper.SelectByText("Owner", "All");
                officeActivities_MeetingHelper.WaitForWorkAround(2000);

                executionLog.Log("ActivitiesMeetingsManagement", "Click on the meeting");
                officeActivities_MeetingHelper.ClickElement("ClickOnAnyMeeting");

                executionLog.Log("ActivitiesMeetingsManagement", "Click On Cance meeting.");
                officeActivities_MeetingHelper.ClickElement("CancelMeeting");
                officeActivities_MeetingHelper.AcceptAlert();

                executionLog.Log("ActivitiesMeetingsManagement", "Redirect at recycle bin.");
                VisitOffice("meetings/recyclebin");

                executionLog.Log("ActivitiesMeetingsManagement", "Verify page title");
                VerifyTitle("Recycled Meeting");

                executionLog.Log("ActivitiesMeetingsManagement", "Search meeting by name.");
                officeActivities_MeetingHelper.TypeText("SearchSubject", Subject);
                officeActivities_MeetingHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesMeetingsManagement", "select all in  owner fiedld");
                officeActivities_MeetingHelper.SelectByText("OwnerField", "All");
                officeActivities_MeetingHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesMeetingsManagement", "Wait for delete icon to be present.");
                officeActivities_MeetingHelper.WaitForElementPresent("DeleteMeetingPermanently", 10);

                executionLog.Log("ActivitiesMeetingsManagement", "Click On delete icon");
                officeActivities_MeetingHelper.ClickElement("DeleteMeetingPermanently");

                executionLog.Log("ActivitiesMeetingsManagement", "Accept alert message.");
                officeActivities_MeetingHelper.AcceptAlert();

                executionLog.Log("ActivitiesMeetingsManagement", "Verify text.");
                officeActivities_MeetingHelper.WaitForText("Meeting Permanently Deleted.", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            //Variables
            String JIRA     = "";
            String Status   = "Pass";
            var    filepath = GetPathToFile() + "opportunitysamples - Original.csv";

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

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

                executionLog.Log("VerifyImportOpportunityWithDescription", "Redirect to All opportunities page.");
                VisitOffice("opportunities");

                executionLog.Log("VerifyImportOpportunityWithDescription", "Click on Import button");
                office_OpportunitiesHelper.ClickElement("Import");

                executionLog.Log("VerifyImportOpportunityWithDescription", "Select csv file to import");
                office_OpportunitiesHelper.Upload("SelectFile", filepath);
                Console.WriteLine("Selected File");

                executionLog.Log("VerifyImportOpportunityWithDescription", "Click on Import button");
                office_OpportunitiesHelper.ClickElement("ImportBtn");
                office_OpportunitiesHelper.WaitForWorkAround(3000);
                Console.WriteLine("Opportunity successfully imported");

                executionLog.Log("VerifyImportOpportunityWithDescription", "Redirect to All opportunities page.");
                VisitOffice("opportunities");
                office_OpportunitiesHelper.WaitForWorkAround(3000);
                Console.WriteLine("Redirected to All opportunities page");

                executionLog.Log("VerifyImportOpportunityWithDescription", "Enter opportunity to be searched");
                office_OpportunitiesHelper.TypeText("SearchOpportunity", "Steve");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyImportOpportunityWithDescription", "Click on Imported opportunity");
                office_OpportunitiesHelper.ClickElement("Opportunity1");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyImportOpportunityWithDescription", "Click on Description");
                office_OpportunitiesHelper.ClickForce("DescriptionHead");
                office_OpportunitiesHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyImportOpportunityWithDescription", "Verify Description");
                office_OpportunitiesHelper.VerifyText("Description", "tester1");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver());

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

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

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

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Visit opportunities page.");
                VisitOffice("opportunities");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Verify page title.");
                VerifyTitle("Opportunities");
                //office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Verify delete icon available.");
                office_OpportunitiesHelper.IsElementPresent("DeleteIcon");
                //office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Verify delete label available.");
                office_OpportunitiesHelper.IsElementPresent("DeleteLabel");
                //office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Click on delete button.");
                office_OpportunitiesHelper.ClickElement("DeleteLabel");
                office_OpportunitiesHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Decline alert message.");
                office_OpportunitiesHelper.DeclineAlert();
                //office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Verify bulk update icon.");
                office_OpportunitiesHelper.IsElementPresent("BUlkUpdateIcon");
                //office_OpportunitiesHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Verify bulk update label.");
                office_OpportunitiesHelper.IsElementPresent("BulkUpdateLabel");
                //office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Click on bulk update button.");
                office_OpportunitiesHelper.clickJS("BUlkUpdateIcon");
                office_OpportunitiesHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Click on sales manager.");
                office_OpportunitiesHelper.ClickElement("ChangeSaleManager");
                office_OpportunitiesHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Verify alert text on the page.");
                office_OpportunitiesHelper.VerifyAlertText("Please select atleast one record to proceed.");

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Accept alert message.");
                office_OpportunitiesHelper.AcceptAlert();
                //office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Verify advance filter icon.");
                office_OpportunitiesHelper.IsElementPresent("AdvanceFilIcon");
                //office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Verify advanced filter label.");
                office_OpportunitiesHelper.IsElementPresent("AdvancefiltLabel");
                //office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Verify page text.");
                office_OpportunitiesHelper.VerifyPageText("Tracking Fields");
                //office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Verify create opportunity icon.");
                office_OpportunitiesHelper.IsElementPresent("CreateIcon");
                //office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Verify create opportunity label.");
                office_OpportunitiesHelper.IsElementPresent("CreateLabel");
                //office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Click on create button.");
                office_OpportunitiesHelper.ClickElement("CreateLabel");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Verify page title as create opportunity.");
                VerifyTitle("Create an Opportunity");

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Visit opportunitities page.");
                VisitOffice("opportunities");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

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

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Verify import icon present.");
                office_OpportunitiesHelper.IsElementPresent("ImportIcon");
                //office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Verify import label present.");
                office_OpportunitiesHelper.IsElementPresent("ImportLabel");
                //office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Click on import button.");
                office_OpportunitiesHelper.ClickElement("ImportLabel");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Verify browse button present on page.");
                office_OpportunitiesHelper.IsElementPresent("BrowseFile");
                //office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Visit opportunities page.");
                VisitOffice("opportunities");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

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

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Verify merge icon present on page.");
                office_OpportunitiesHelper.IsElementPresent("MergeIcon");
                //office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Verify merge label present on page.");
                office_OpportunitiesHelper.IsElementPresent("MergeLabel");
                //office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Click on merge button.");
                office_OpportunitiesHelper.ClickElement("MergeLabel");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Verify alert text on the page..");
                office_OpportunitiesHelper.VerifyAlertText("Please select 2 or more opportunities you wish to merge");

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Accept alert message.");
                office_OpportunitiesHelper.AcceptAlert();
                //office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Verify export icon present on page.");
                office_OpportunitiesHelper.IsElementPresent("ExportIcon");
                //office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Click on export button.");
                office_OpportunitiesHelper.clickJS("ExportIcon");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Verify export as csv present on page.");
                office_OpportunitiesHelper.IsElementPresent("ExportCsv");
                //office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Verify recycle bin icon on the page.");
                office_OpportunitiesHelper.IsElementPresent("RecycleIcon");
                //office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Click on recycle bin button.");
                office_OpportunitiesHelper.clickJS("RecycleIcon");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Verify page title as recycled opportunities.");
                VerifyTitle("Opportunities");
                //office_OpportunitiesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Visit opportunities page.");
                VisitOffice("opportunities");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

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

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Verify all opportunities button present on page.");
                office_OpportunitiesHelper.IsElementPresent("AllOpportunities");
                //office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Verify my opportunities button present on page.");
                office_OpportunitiesHelper.IsElementPresent("MyOpportunities");
                //office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Verify my team's opportunities button present on page.");
                office_OpportunitiesHelper.IsElementPresent("MyTeamOppor");
                //office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "Verify my saved filters button present on page.");
                office_OpportunitiesHelper.IsElementPresent("MySavedFilters");
                //office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForOpportunities", "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("VerifyIconAndLabelForOpportunities");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Icon And Label For Opportunities");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Icon And Label For Opportunities", "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 Icon And Label For Opportunities");
                        TakeScreenshot("VerifyIconAndLabelForOpportunities");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyIconAndLabelForOpportunities.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyIconAndLabelForOpportunities");
                        string id            = loginHelper.getIssueID("Verify Icon And Label For Opportunities");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyIconAndLabelForOpportunities.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Icon And Label For Opportunities"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Icon And Label For Opportunities");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyIconAndLabelForOpportunities");
                executionLog.WriteInExcel("Verify Icon And Label For Opportunities", Status, JIRA, "Opportunities Management");
            }
        }
        public void verifyQuickLookLabelsForOpportunity()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver());

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

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

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

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

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Create Opportunities");
                VisitOffice("opportunities/create");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Click on Save");
                office_OpportunitiesHelper.ClickElement("SaveOpp");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify text on page.");
                office_OpportunitiesHelper.VerifyText("RequiredFieldsOpp", "This field is required.");

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Enter Opportunity Name");
                office_OpportunitiesHelper.TypeText("Name", Oppname);

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Enter Company DBA Name");
                office_OpportunitiesHelper.TypeText("CompanyName", CDBA);

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Select Opp Status");
                office_OpportunitiesHelper.SelectByText("State", "New");

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Select Opp Responsibility");
                office_OpportunitiesHelper.SelectByText("Responsibility", "Howard Tang");

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Click on Save button.");
                office_OpportunitiesHelper.ClickElement("SaveOpp");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify label for client type.");
                office_OpportunitiesHelper.VerifyText("ClientType", "Select");

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify label for status.");
                office_OpportunitiesHelper.VerifyText("Status", "New");

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify label for source.");
                office_OpportunitiesHelper.VerifyText("Source", "Select Source");

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify label for category.");
                office_OpportunitiesHelper.VerifyText("Category", "Select Category");

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify label for responsibility.");
                office_OpportunitiesHelper.VerifyText("Responsibilityl", "Howard Tang");

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify label for account manager.");
                office_OpportunitiesHelper.VerifyText("AccountManager", "Select Account Manager");

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify label for partner agent.");
                office_OpportunitiesHelper.VerifyText("PartnerAgentl", "Select Partner Agent");

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify label for partner association.");
                office_OpportunitiesHelper.VerifyText("PartnerAssociationl", "Select Partner Association");

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify label for sales manager.");
                office_OpportunitiesHelper.VerifyText("SalesManager", "Select Sales Manager");

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Click on edit opportunity.");
                office_OpportunitiesHelper.ClickElement("EditLink");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Select client type.");
                office_OpportunitiesHelper.Select("Clientt", "Processing");
                //office_OpportunitiesHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Select refferal source.");
                office_OpportunitiesHelper.Select("RSource", "Campaign");
                //office_OpportunitiesHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Select category.");
                office_OpportunitiesHelper.SelectByText("Categ", "Single");
                //office_OpportunitiesHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Select account manager.");
                office_OpportunitiesHelper.SelectByText("AccntManager", "Howard Tang");
                //office_OpportunitiesHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Select user group.");
                office_OpportunitiesHelper.SelectByText("UGroup", "Primary Group");
                //office_OpportunitiesHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Select sales manager.");
                office_OpportunitiesHelper.SelectByText("SaleMgr", "Howard Tang");
                //office_OpportunitiesHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Select responsibility.");
                office_OpportunitiesHelper.SelectByText("Responsibility", "Howard Tang");
                //office_OpportunitiesHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Select partner agent.");
                office_OpportunitiesHelper.SelectByText("PartnerAgent", "Mark Menu");
                //office_OpportunitiesHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Select partner association.");
                office_OpportunitiesHelper.SelectByText("PartAssociation", "Aslam Associate");
                //office_OpportunitiesHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Click on Save button.");
                office_OpportunitiesHelper.ClickElement("ClickSaveClient");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify client type as processing.");
                office_OpportunitiesHelper.VerifyText("ClientType", "Processing");

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify status as New");
                office_OpportunitiesHelper.VerifyText("Status", "New");

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify source as campaign");
                office_OpportunitiesHelper.VerifyText("Source", "Campaign");

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify category as Test1");
                office_OpportunitiesHelper.VerifyText("Category", "Single");

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify responsibility as Howard.");
                office_OpportunitiesHelper.VerifyText("Responsibilityl", "Howard Tang");

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify account manager as Howard.");
                office_OpportunitiesHelper.VerifyText("AccountManager", "Howard Tang");

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify partner agent as mark matthews.");
                office_OpportunitiesHelper.VerifyText("PartnerAgentl", "Mark Menu");

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify partner association. ");
                office_OpportunitiesHelper.VerifyText("PartnerAssociationl", "Aslam Associate");

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify sales manager as howard.");
                office_OpportunitiesHelper.VerifyText("SalesManager", "Howard Tang");

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Click on delete.");
                office_OpportunitiesHelper.ClickElement("DeleteLink");

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Click on Save");
                office_OpportunitiesHelper.AcceptAlert();

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Wait for success text.");
                office_OpportunitiesHelper.WaitForText("Opportunity deleted successfully.", 10);

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Redirect at recyclebin page.");
                VisitOffice("opportunities/recyclebin");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Verify page title as recycled opportunities.");
                VerifyTitle("Recycled Opportunities");

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Click on delete icon.");
                office_OpportunitiesHelper.ClickElement("DeletePermanaently");

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Accept alert message.");
                office_OpportunitiesHelper.AcceptAlert();

                executionLog.Log("VerifyQuickLookLabelsForOpportunity", "Wait for success text.");
                office_OpportunitiesHelper.WaitForText("Opportunity permanently deleted.", 10);

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

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

            var oXMLData = new XMLParse();

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

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver());

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

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

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

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

                executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Create Opportunities");
                VisitOffice("opportunities/create");

                executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Click on Save");
                office_OpportunitiesHelper.ClickElement("SaveOpp");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Verify text on page.");
                office_OpportunitiesHelper.VerifyText("RequiredFieldsOpp", "This field is required.");

                executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Enter Opportunity Name");
                office_OpportunitiesHelper.TypeText("Name", Oppname);

                executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Enter Company DBA Name");
                office_OpportunitiesHelper.TypeText("CompanyName", CDBA);

                executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Select Opp Status");
                office_OpportunitiesHelper.SelectByText("State", "New");

                executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Select Opp Responsibility");
                office_OpportunitiesHelper.SelectByText("Responsibility", "Howard Tang");

                executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Click on Save");
                office_OpportunitiesHelper.ClickElement("SaveOpp");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

                var loc = "//h3[text()='Existing Opportunities']";
                if (office_OpportunitiesHelper.IsElementPresent(loc))
                {
                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Click Dublicate Button");
                    office_OpportunitiesHelper.ClickOnDisplayed("ClickOnDubBtn");

                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Wait for success message");
                    office_OpportunitiesHelper.WaitForText("Opportunity saved successfully.", 10);

                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Verify opportunity created by");
                    office_OpportunitiesHelper.VerifyText("CreatedBy", "Howard Tang");

                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Verify opportunity modified by");
                    office_OpportunitiesHelper.VerifyText("ModifiedBy", "Howard Tang");

                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Click on edit button.");
                    office_OpportunitiesHelper.ClickElement("EditLink");

                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Click on save button.");
                    office_OpportunitiesHelper.ClickElement("SaveOpp");

                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Verify opportunity created by");
                    office_OpportunitiesHelper.VerifyText("CreatedBy", "Howard Tang");

                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Verify opportunity modified by");
                    office_OpportunitiesHelper.VerifyText("ModifiedBy", "Howard Tang");

                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Redirect at Opportunities");
                    VisitOffice("VerifyOpportunitiesCreatedModifiedByCredits");

                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Click on  1st Opportunities");
                    office_OpportunitiesHelper.ClickElement("ClickOn1stOpp");

                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Click On Merge Records");
                    office_OpportunitiesHelper.ClickElement("DeleteLink");
                    office_OpportunitiesHelper.AcceptAlert();

                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Wait for confirmation");
                    office_OpportunitiesHelper.WaitForText("1 records deleted successfully", 10);

                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Redirect at recyclebin Page.");
                    VisitOffice("opportunities/recyclebin");

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

                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Click on delete icon.");
                    office_OpportunitiesHelper.ClickElement("DeletePermanaently");
                    office_OpportunitiesHelper.AcceptAlert();

                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Wait For Confirmation");
                    office_OpportunitiesHelper.WaitForText("Opportunity permanently deleted.", 10);
                }
                else
                {
                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Wait for success message");
                    office_OpportunitiesHelper.WaitForText("Opportunity saved successfully.", 10);

                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Verify opportunity created by");
                    office_OpportunitiesHelper.VerifyText("CreatedBy", "Howard Tang");

                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Verify opportunity modified by");
                    office_OpportunitiesHelper.VerifyText("ModifiedBy", "Howard Tang");

                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Click on edit button.");
                    office_OpportunitiesHelper.ClickElement("EditLink");

                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Click on save button.");
                    office_OpportunitiesHelper.ClickElement("SaveOpp");

                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Verify opportunity created by");
                    office_OpportunitiesHelper.VerifyText("CreatedBy", "Howard Tang");

                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Verify opportunity modified by");
                    office_OpportunitiesHelper.VerifyText("ModifiedBy", "Howard Tang");

                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Redirect at Opportunities");
                    VisitOffice("opportunities");

                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Click on  1st Opportunities");
                    office_OpportunitiesHelper.ClickElement("ClickOn1stOpp");

                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Click On Merge Records");
                    office_OpportunitiesHelper.ClickElement("DeleteLink");
                    office_OpportunitiesHelper.AcceptAlert();

                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Wait for confirmation");
                    office_OpportunitiesHelper.WaitForText("1 records deleted successfully", 10);

                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Redirect at recyclebin Page.");
                    VisitOffice("opportunities/recyclebin");

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

                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Click on delete icon.");
                    office_OpportunitiesHelper.ClickElement("DeletePermanaently");
                    office_OpportunitiesHelper.AcceptAlert();

                    executionLog.Log("VerifyOpportunitiesCreatedModifiedByCredits", "Wait For Confirmation");
                    office_OpportunitiesHelper.WaitForText("Opportunity permanently deleted.", 10);
                }
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

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

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

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

                executionLog.Log("VerifyAllOptionsInAdvancedFilterOpportunity", "Redirect at opportunities page.");
                VisitOffice("opportunities");

                executionLog.Log("VerifyAllOptionsInAdvancedFilterOpportunity", "Click on Advanced Filter");
                office_OpportunitiesHelper.ClickElement("AdvancefiltLabel");
                office_OpportunitiesHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyAllOptionsInAdvancedFilterOpportunity", "Click on Add Row");
                office_OpportunitiesHelper.ClickElement("AddRowBtn");
                office_OpportunitiesHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyAllOptionsInAdvancedFilterOpportunity", "Verify options present on second row");
                office_OpportunitiesHelper.IsElementPresent("//select[@id='OpportunityCustomColNames1']/optgroup[@label='Opportunities - Details']");
                office_OpportunitiesHelper.IsElementPresent("//select[@id='OpportunityCustomColNames1']/optgroup[@label='Opportunities - Description']");
                office_OpportunitiesHelper.IsElementPresent("//select[@id='OpportunityCustomColNames1']/optgroup[@label='Opportunities - Phones']");
                office_OpportunitiesHelper.IsElementPresent("//select[@id='OpportunityCustomColNames1']/optgroup[@label='Opportunities - Electronic Addresses']");
                office_OpportunitiesHelper.IsElementPresent("//select[@id='OpportunityCustomColNames1']/optgroup[@label='Opportunities - Addresses - Location Address']");
                office_OpportunitiesHelper.IsElementPresent("//select[@id='OpportunityCustomColNames1']/optgroup[@label='Opportunities - Addresses - Mailing Address']");
                office_OpportunitiesHelper.WaitForWorkAround(1000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyAllOptionsInAdvancedFilterOpportunity");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify All Options In Advanced Filter Opportunity");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify All Options In Advanced Filter Opportunity", "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 All Options In Advanced Filter Opportunity");
                        TakeScreenshot("VerifyAllOptionsInAdvancedFilterOpportunity");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyAllOptionsInAdvancedFilterOpportunity.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyAllOptionsInAdvancedFilterOpportunity");
                        string id            = loginHelper.getIssueID("Verify All Options In Advanced Filter Opportunity");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyAllOptionsInAdvancedFilterOpportunity.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify All Options In Advanced Filter Opportunity"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify All Options In Advanced Filter Opportunity");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyAllOptionsInAdvancedFilterOpportunity");
                executionLog.WriteInExcel("Verify All Options In Advanced Filter Opportunity", Status, JIRA, "Opportunities Management");
            }
        }
Esempio n. 9
0
        public void activitiesDocumentManagement()
        {
            string[] username = null;
            string[] password = null;

            XMLParse oXMLData = new XMLParse();

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            //try
            //{

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

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

            executionLog.Log("VerifyImportOpportunityWithWeblinkEmail", "Redirect to All opportunities page.");
            VisitOffice("opportunities");

            executionLog.Log("VerifyImportOpportunityWithWeblinkEmail", "Click on Import button");
            office_OpportunitiesHelper.ClickElement("Import");

            executionLog.Log("VerifyImportOpportunityWithWeblinkEmail", "Select csv file to import");
            office_OpportunitiesHelper.Upload("SelectFile", "C:/Users/user/Downloads/opportunitysamples.csv");
            Console.WriteLine("Selected File");

            executionLog.Log("VerifyImportOpportunityWithWeblinkEmail", "Click on Import button");
            office_OpportunitiesHelper.ClickElement("ImportBtn");
            office_OpportunitiesHelper.WaitForWorkAround(3000);
            Console.WriteLine("Opportunity successfully imported");

            executionLog.Log("VerifyImportOpportunityWithWeblinkEmail", "Redirect to All opportunities page.");
            VisitOffice("opportunities");
            Console.WriteLine("Redirected to All opportunities page");

            executionLog.Log("VerifyImportOpportunityWithWeblinkEmail", "Click on Imported opportunity");
            office_OpportunitiesHelper.ClickElement("FirstRowSteve");
            office_OpportunitiesHelper.WaitForWorkAround(2000);

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

            executionLog.Log("VerifyImportOpportunityWithWeblinkEmail", "Value of Email Type 2");
            office_OpportunitiesHelper.VerifySelectedValue("EmailType2", "Web Links");
            Console.WriteLine("Email Type 2 is Web Links");

            executionLog.Log("VerifyImportOpportunityWithWeblinkEmail", "Value of Email Label 2");
            office_OpportunitiesHelper.VerifySelectedValue("EmailLabel2", "Web Link");
            Console.WriteLine("Email Label 2 is Web Link");

            Console.WriteLine("Opportunity is imported with Email - 2 as Web Link");


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


            //}
        }
Esempio n. 11
0
        public void bulkUpdateSalesManagerForOpportunities()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver());

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

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

                executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Verify Page title");
                VerifyTitle("Dashboard");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Visit opportunities page.");
                VisitOffice("opportunities");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Verify page title..");
                VerifyTitle("Opportunities");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Click On first Check Box");
                office_OpportunitiesHelper.ClickElement("CheckboxOpportunity");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Click On Bulk Update");
                office_OpportunitiesHelper.ClickElement("ClickOnBulkUpdate");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Change Sale Manager");
                office_OpportunitiesHelper.ClickElement("ChangeSaleManager");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Select Sales Manager");
                office_OpportunitiesHelper.SelectDropDownByText("//*[@id='OpportunitySalesManagerUpdateSalesManagerId']", "Howard Tang");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Click on Update button");
                office_OpportunitiesHelper.ClickDisplayed("//button[text()='Update']");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Accept alert message.");
                office_OpportunitiesHelper.AcceptAlert();
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("BulkUpdateSalesManagerForOpportunities", "Wait for success message.");
                office_OpportunitiesHelper.WaitForText("records updated successfully", 30);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("BulkUpdateSalesManagerForOpportunities");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Bulk Update Sales Manager For Opportunities");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Bulk Update Sales Manager For Opportunities", "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("Bulk Update Sales Manager For Opportunities");
                        TakeScreenshot("BulkUpdateSalesManagerForOpportunities");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\BulkUpdateSalesManagerForOpportunities.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("BulkUpdateSalesManagerForOpportunities");
                        string id            = loginHelper.getIssueID("Bulk Update Sales Manager For Opportunities");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\BulkUpdateSalesManagerForOpportunities.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Bulk Update Sales Manager For Opportunities"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Bulk Update Sales Manager For Opportunities");
                //  executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("BulkUpdateSalesManagerForOpportunities");
                executionLog.WriteInExcel("Bulk Update Sales Manager For Opportunities", Status, JIRA, "Opportunities Management");
            }
        }
        public void opportunitiesEmailUrlChange()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var office_OpportunitiesHelper   = new Office_OpportunitiesHelper(GetWebDriver());
            var OfficeActivities_EmailHelper = new OfficeActivities_EmailsHelper(GetWebDriver());

            // Variable
            var    SendTo = "Test" + GetRandomNumber() + "@yopmail.com";
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("OpportunitiesEmailUrlChange", "Goto User Opportunities");
                VisitOffice("opportunities");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

                executionLog.Log("OpportunitiesEmailUrlChange", "Click On Any Opportunity");
                office_OpportunitiesHelper.ClickElement("OpenOpportunity");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

                executionLog.Log("OpportunitiesEmailUrlChange", "Click On Send Email");
                office_OpportunitiesHelper.ClickElement("SendEmail");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

                executionLog.Log("OpportunitiesEmailUrlChange", "Enter Email Id");
                OfficeActivities_EmailHelper.TypeText("Sendto", "*****@*****.**");
                OfficeActivities_EmailHelper.WaitForWorkAround(2000);

                executionLog.Log("OpportunitiesEmailUrlChange", "Enter  Subject");
                OfficeActivities_EmailHelper.TypeText("EmailName", SendTo);
                //OfficeActivities_EmailHelper.WaitForWorkAround(2000);

                executionLog.Log("OpportunitiesEmailUrlChange", "Click Save");
                OfficeActivities_EmailHelper.ClickElement("SendEmailActivity");
                OfficeActivities_EmailHelper.WaitForWorkAround(3000);

                executionLog.Log("OpportunitiesEmailUrlChange", "Select the active type");
                OfficeActivities_EmailHelper.SelectByText("SelectActivityType", "E-Mails");
                OfficeActivities_EmailHelper.WaitForWorkAround(2000);

                executionLog.Log("OpportunitiesEmailUrlChange", "Click On E-mail ");
                OfficeActivities_EmailHelper.ClickJS("ClickEmail1Oppo");
                OfficeActivities_EmailHelper.WaitForWorkAround(3000);

                executionLog.Log("OpportunitiesEmailUrlChange", "Change the url with the url number of another office");
                VisitOffice("mails/view/57");
                office_OpportunitiesHelper.WaitForWorkAround(1000);

                executionLog.Log("OpportunitiesEmailUrlChange", "Verify Validation");
                OfficeActivities_EmailHelper.WaitForText("You don't have privileges to view this E-Mail.", 10);
                OfficeActivities_EmailHelper.WaitForWorkAround(1000);

                executionLog.Log("OpportunitiesEmailUrlChange", "Redirect to URL");
                VisitOffice("mails/sent");
                OfficeActivities_EmailHelper.WaitForWorkAround(3000);

                executionLog.Log("OpportunitiesEmailUrlChange", "Verify page title");
                VerifyTitle("Sent");
                //OfficeActivities_EmailHelper.WaitForWorkAround(4000);

                executionLog.Log("OpportunitiesEmailUrlChange", "Enter Send to in search ");
                OfficeActivities_EmailHelper.TypeText("SearchMailInput", SendTo);
                OfficeActivities_EmailHelper.WaitForWorkAround(1000);

                executionLog.Log("OpportunitiesEmailUrlChange", "Click on search btn");
                OfficeActivities_EmailHelper.ClickElement("SearchBtn");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

                executionLog.Log("OpportunitiesEmailUrlChange", "Select searched email.");
                OfficeActivities_EmailHelper.ClickJS("CheckBox1");
                //OfficeActivities_EmailHelper.WaitForWorkAround(4000);

                executionLog.Log("OpportunitiesEmailUrlChange", "Click on delete btn");
                OfficeActivities_EmailHelper.ClickElement("Delete");
                OfficeActivities_EmailHelper.WaitForWorkAround(3000);

                executionLog.Log("OpportunitiesEmailUrlChange", "Verify Email Deleted successfully");
                OfficeActivities_EmailHelper.WaitForText("E-Mail has been moved to the Recycle Bin.", 05);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver());

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

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

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

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

                executionLog.Log("OpportunitiesUrlChange", "Click On Any Opportunity");
                office_OpportunitiesHelper.ClickElement("OpenOpportunity");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("OpportunitiesUrlChange", "Change the url with the url number of another office");
                VisitOffice("opportunities/view/63347");

                executionLog.Log("OpportunitiesUrlChange", "Verify Validation");
                office_OpportunitiesHelper.WaitForText("You don't have privileges to View this Opportunity.", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

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

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

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

            executionLog.Log("OpportunityGroupWithBlankName", "Redirect at opportunities group page.");
            VisitOffice("opportunities/manage_groups");

            executionLog.Log("OpportunityGroupWithBlankName", "Click on Edit group.");
            office_OpportunitiesHelper.ClickElement("EditGroup");

            executionLog.Log("OpportunityGroupWithBlankName", "Remove the group name.");
            office_OpportunitiesHelper.TypeText("GroupName", "");

            executionLog.Log("OpportunityGroupWithBlankName", "Click on Save button.");
            office_OpportunitiesHelper.ClickElement("SaveGroup");

            executionLog.Log("OpportunityGroupWithBlankName", "Wait for locator to be present.");
            office_OpportunitiesHelper.WaitForElementPresent("GroupError", 10);

            executionLog.Log("OpportunityGroupWithBlankName", "Verify  validation is displayed.");
            office_OpportunitiesHelper.VerifyText("GroupError", "Name: Field is required");

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

            //    String counter = executionLog.readLastLine("counter");
            //    String Description = executionLog.GetAllTextFile("OpportunityGroupWithBlankName");
            //    String Error = executionLog.GetAllTextFile("Error");
            //    if (counter == "")
            //    {
            //        counter = "0";
            //    }
            //    bool result = loginHelper.CheckExstingIssue("Opportunity Group With Blank Name");
            //    if (!result)
            //    {
            //        if (Int16.Parse(counter) < 9)
            //        {
            //            executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
            //            loginHelper.CreateIssue("Opportunity Group With Blank Name", "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("Opportunity Group With Blank Name");
            //            TakeScreenshot("OpportunityGroupWithBlankName");
            //            string directoryName = loginHelper.GetnewDirectoryName(GetPath());
            //            var location = directoryName + "\\OpportunityGroupWithBlankName.png";
            //            loginHelper.AddAttachment(location, id);
            //        }
            //    }
            //    else
            //    {
            //        if (Int16.Parse(counter) < 9)
            //        {
            //            executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
            //            TakeScreenshot("OpportunityGroupWithBlankName");
            //            string id = loginHelper.getIssueID("Opportunity Group With Blank Name");
            //            string directoryName = loginHelper.GetnewDirectoryName(GetPath());
            //            var location = directoryName + "\\OpportunityGroupWithBlankName.png";
            //            loginHelper.AddAttachment(location, id);
            //            loginHelper.AddComment(loginHelper.getIssueID("Opportunity Group With Blank Name"), "This issue is still occurring");
            //        }
            //    }
            //    JIRA = loginHelper.getIssueID("Opportunity Group With Blank Name");
            ////    executionLog.DeleteFile("Error");
            //    throw;

            //}
            //finally
            //{
            //    executionLog.DeleteFile("OpportunityGroupWithBlankName");
            //    executionLog.WriteInExcel("Opportunity Group With Blank Name", Status, JIRA, "Opportunities Management");
            //}
        }
Esempio n. 15
0
        public void zipCodeError()
        {
            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_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver());
            var office_LeadsHelper         = new Office_LeadsHelper(GetWebDriver());
            var office_ClientsHelper       = new Office_ClientsHelper(GetWebDriver());

            String JIRA   = "";
            String Status = "Pass";
            var    DBA    = "DBA" + GetRandomNumber();



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

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

                executionLog.Log("ZipCodeError", "Go to Create Opportunity page");
                VisitOffice("opportunities/create");

                executionLog.Log("ZipCodeError", "Verify title");
                VerifyTitle("Create an Opportunity");

                executionLog.Log("ZipCodeError", "Enter zip code");
                office_OpportunitiesHelper.TypeText("ZipCode", "60601");

                executionLog.Log("ZipCodeError", "Click On anywhere");
                office_OpportunitiesHelper.ClickElement("V");


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

            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver());

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

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

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

                executionLog.Log("OpportunitiesAdvanceFilterResultsPP", "Redirect To URL");
                VisitOffice("opportunities");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

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

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

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

                executionLog.Log("OpportunitiesAdvanceFilterResultsPP", "Click on apply button.");
                office_OpportunitiesHelper.ClickElement("Apply");
                office_OpportunitiesHelper.WaitForWorkAround(3000);
                //office_OpportunitiesHelper.WaitForElementPresent("No.ofResults", 10);

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

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

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

                executionLog.Log("OpportunitiesAdvanceFilterResultsPP", "Click on apply button.");
                office_OpportunitiesHelper.ClickElement("Apply");
                office_OpportunitiesHelper.WaitForWorkAround(3000);
                //office_OpportunitiesHelper.WaitForElementPresent("No.ofResults", 10);

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

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

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

                executionLog.Log("OpportunitiesAdvanceFilterResultsPP", "Click on apply button.");
                office_OpportunitiesHelper.ClickElement("Apply");
                office_OpportunitiesHelper.WaitForWorkAround(3000);
                //office_OpportunitiesHelper.WaitForElementPresent("No.ofResults", 10);

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

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

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

                executionLog.Log("OpportunitiesAdvanceFilterResultsPP", "Click on apply button.");
                office_OpportunitiesHelper.ClickElement("Apply");
                office_OpportunitiesHelper.WaitForWorkAround(3000);
                //office_OpportunitiesHelper.WaitForElementPresent("No.ofResults", 10);

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

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

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

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

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

                executionLog.Log("OpportunityLabelAgentBlankSave", "Redirect at opportunities page.");
                VisitOffice("opportunities");

                executionLog.Log("OpportunityLabelAgentBlankSave", "Click on any Opportunity");
                office_OpportunitiesHelper.ClickElement("Opportunities1");

                executionLog.Log("OpportunityLabelAgentBlankSave", "Click to add partner agent");
                office_OpportunitiesHelper.DoubleClick("//*[@id='partner']");
                office_OpportunitiesHelper.WaitForWorkAround(1000);

                executionLog.Log("OpportunityLabelAgentBlankSave", "Click on save");
                office_OpportunitiesHelper.ClickElement("SaveQuicklook");

                executionLog.Log("OpportunityLabelAgentBlankSave", "Verify label for Partner Agent");
                office_OpportunitiesHelper.VerifyText("VerifyLabel", "Select");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("OpportunityLabelAgentBlankSave");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Opportunity Label Agent Blank Save");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Opportunity Label Agent Blank Save", "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("Opportunity Label Agent Blank Save");
                        TakeScreenshot("OpportunityLabelAgentBlankSave");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\OpportunityLabelAgentBlankSave.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("OpportunityLabelAgentBlankSave");
                        string id            = loginHelper.getIssueID("Opportunity Label Agent Blank Save");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\OpportunityLabelAgentBlankSave.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Opportunity Label Agent Blank Save"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Opportunity Label Agent Blank Save");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("OpportunityLabelAgentBlankSave");
                executionLog.WriteInExcel("Opportunity Label Agent Blank Save", Status, JIRA, "Opportunities Management");
            }
        }
Esempio n. 18
0
        public void opportunititySubjectFiledValidateBlank()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver());

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

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

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

                executionLog.Log("OpportunititySubjectFiledValidateBlank", "Redirect at opportunities page.");
                VisitOffice("opportunities");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("OpportunititySubjectFiledValidateBlank", "Click TO View Opp");
                office_OpportunitiesHelper.ClickElement("Opportunities1");

                executionLog.Log("OpportunititySubjectFiledValidateBlank", "Click on add note");
                office_OpportunitiesHelper.ClickElement("AddNotes");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("OpportunititySubjectFiledValidateBlank", "Leave note subject blank.");
                office_OpportunitiesHelper.TypeText("EnterNoteName", "    ");

                executionLog.Log("OpportunititySubjectFiledValidateBlank", "Click Save Note Button");
                office_OpportunitiesHelper.ClickElement("SaveNote");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

                executionLog.Log("OpportunititySubjectFiledValidateBlank", "Verify validation message.");
                office_OpportunitiesHelper.VerifyText("VerifyTextNoteValidation", "This field is required.");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver());

            // VARIABLE
            var    Name    = "Test" + RandomNumber(1, 999);
            var    Company = "Company" + RandomNumber(1, 9999);
            String JIRA    = "";
            String Status  = "Pass";


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

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

                executionLog.Log("EditOppStateIssue", "Redirect at create opportunities page.");
                VisitOffice("opportunities/create");

                executionLog.Log("EditOppStateIssue", "Verify Page title");
                VerifyTitle("Create an Opportunity");

                executionLog.Log("EditOppStateIssue", "Enter Name");
                office_OpportunitiesHelper.TypeText("Name", Name);

                executionLog.Log("EditOppStateIssue", "Enter Company Name");
                office_OpportunitiesHelper.TypeText("CompanyName", Company);

                executionLog.Log("EditOppStateIssue", "Select Status");
                office_OpportunitiesHelper.SelectByText("State", "Closed Dead");

                executionLog.Log("EditOppStateIssue", "Select Responsibility");
                office_OpportunitiesHelper.SelectByText("Responsibility", "Howard Tang");

                executionLog.Log("EditOppStateIssue", "Select Country");
                office_OpportunitiesHelper.SelectByText("Country", "United States");

                executionLog.Log("EditOppStateIssue", "Enter zipcode");
                office_OpportunitiesHelper.TypeText("ZipCode", "60601");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

                executionLog.Log("EditOppStateIssue", "Click on 'Copy address' button");
                office_OpportunitiesHelper.ClickForce("SameAsLocation");

                executionLog.Log("EditOppStateIssue", "Click on 'Save' button");
                office_OpportunitiesHelper.ClickElement("SaveOpp");

                executionLog.Log("EditOppStateIssue", "Verify opp saved successfully");
                office_OpportunitiesHelper.WaitForText("Opportunity saved successfully.", 10);

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

                executionLog.Log("EditOppStateIssue", "Click on 'Edit' button");
                office_OpportunitiesHelper.ClickElement("OppEdit");

                executionLog.Log("EditOppStateIssue", "Verify Page title");
                VerifyTitle("Edit an Opportunity");

                executionLog.Log("EditOppStateIssue", "Redirect at create opportunities page.");
                VisitOffice("opportunities");

                executionLog.Log("EditOppStateIssue", "Verify Page title");
                VerifyTitle("Opportunities");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("EditOppStateIssue", "Search company name");
                office_OpportunitiesHelper.TypeText("SearchCompanyopp", Company);
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("EditOppStateIssue", "Select All in responsibity tab");
                office_OpportunitiesHelper.SelectByText("Responsibiltytab", "All");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

                executionLog.Log("EditOppStateIssue", "Select first opportunity");
                office_OpportunitiesHelper.ClickElement("ClickOn1stOpp");

                executionLog.Log("EditOppStateIssue", "Click on delete button.");
                office_OpportunitiesHelper.ClickElement("DeleteOpp");

                executionLog.Log("EditOppStateIssue", "Accept alert message");
                office_OpportunitiesHelper.AcceptAlert();

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

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

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

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

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

                executionLog.Log("EditOpportunityGroupWithExistingName", "Redirect at manage group page.");
                VisitOffice("opportunities/manage_groups");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

                executionLog.Log("EditOpportunityGroupWithExistingName", "Click on edit opportunity group.");
                office_OpportunitiesHelper.ClickElement("EditGroup");
                office_OpportunitiesHelper.WaitForWorkAround(1000);

                executionLog.Log("EditOpportunityGroupWithExistingName", "Enter group name.");
                office_OpportunitiesHelper.TypeText("GroupName", "Required");

                executionLog.Log("EditOpportunityGroupWithExistingName", "Click on save group.");
                office_OpportunitiesHelper.ClickElement("SaveGroup");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("EditOpportunityGroupWithExistingName", "Verify validation for already existing.");
                office_OpportunitiesHelper.VerifyText("GroupError", "Name already exists");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var office_OpportunitiesHelper      = new Office_OpportunitiesHelper(GetWebDriver());
            var officeActivities_DocumentHelper = new OfficeActivities_DocumentHelper(GetWebDriver());

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

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

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

                executionLog.Log("OpportunitiesnDocumentUrlChange", "Goto User Opportunities");
                VisitOffice("opportunities");
                office_OpportunitiesHelper.WaitForWorkAround(4000);

                executionLog.Log("OpportunitiesnDocumentUrlChange", "Click On Any Opportunity");
                office_OpportunitiesHelper.ClickElement("OpenOpportunity");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("OpportunitiesnDocumentUrlChange", "Click On Add Document");
                office_OpportunitiesHelper.ClickElement("AddDocument");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("OpportunitiesnDocumentUrlChange", "Enter Document Name");
                officeActivities_DocumentHelper.TypeText("Name", "Document Test");

                var File = GetPathToFile() + "index.jpg";
                executionLog.Log("OpportunitiesnDocumentUrlChange", "Upload File");
                officeActivities_DocumentHelper.Upload("BrowseFile", File);
                officeActivities_DocumentHelper.WaitForWorkAround(1000);

                executionLog.Log("OpportunitiesnDocumentUrlChange", "Click Save");
                officeActivities_DocumentHelper.ClickOnDisplayed("SaveDocOppo");
                officeActivities_DocumentHelper.WaitForWorkAround(2000);

                executionLog.Log("OpportunitiesnDocumentUrlChange", "Wait for success message.");
                officeActivities_DocumentHelper.WaitForText("Documents successfully Added.", 10);

                executionLog.Log("OpportunitiesnDocumentUrlChange", "Open the document");
                officeActivities_DocumentHelper.PressEnter("ClickDocument1");
                officeActivities_DocumentHelper.WaitForWorkAround(1000);

                executionLog.Log("OpportunitiesnDocumentUrlChange", "Change the url with the url number of another office");
                VisitOffice("documents/view/41");

                executionLog.Log("OpportunitiesnDocumentUrlChange", "Verify Validation");
                officeActivities_DocumentHelper.WaitForText("You don't have privilege.", 10);

                executionLog.Log("OpportunitiesnDocumentUrlChange", "Redirect to opportunity Page");
                VisitOffice("opportunities");
                officeActivities_DocumentHelper.WaitForWorkAround(2000);

                executionLog.Log("OpportunitiesnDocumentUrlChange", "Click On Any Opportunity");
                office_OpportunitiesHelper.ClickElement("OpenOpportunity");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("OpportunitiesnDocumentUrlChange", "Click On Document ");
                officeActivities_DocumentHelper.PressEnter("ClickDocument1");
                officeActivities_DocumentHelper.WaitForWorkAround(2000);

                executionLog.Log("OpportunitiesnDocumentUrlChange", "Click OnDelete icon");
                officeActivities_DocumentHelper.ClickElement("DeleteDocumentopp");

                executionLog.Log("OpportunitiesnDocumentUrlChange", "Accept alert message");
                officeActivities_DocumentHelper.AcceptAlert();
                officeActivities_DocumentHelper.WaitForWorkAround(4000);

                executionLog.Log("OpportunitiesnDocumentUrlChange", "Wait for delete message");
                officeActivities_DocumentHelper.WaitForText("Document deleted successfully.", 5);
            }

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

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

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

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

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

                executionLog.Log("ProfileViewOfClientLeadAndOpportunities", " Redirect To Clients");
                VisitOffice("clients");

                executionLog.Log("ProfileViewOfClientLeadAndOpportunities", "Click on any client.");
                office_ClientsHelper.ClickElement("ClickOnAnyClient");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ProfileViewOfClientLeadAndOpportunities", "Verify View text on page");
                office_ClientsHelper.VerifyPageText("View");

                executionLog.Log("ProfileViewOfClientLeadAndOpportunities", " Redirect To Leads");
                VisitOffice("leads");
                office_ClientsHelper.WaitForWorkAround(4000);

                executionLog.Log("ProfileViewOfClientLeadAndOpportunities", "Click on any lead.");
                office_LeadsHelper.ClickElement("ClickAnyLead");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ProfileViewOfClientLeadAndOpportunities", "Verify view text on page");
                office_LeadsHelper.VerifyPageText("View");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ProfileViewOfClientLeadAndOpportunities", " Redirect To Opportunities page.");
                VisitOffice("opportunities");

                executionLog.Log("ProfileViewOfClientLeadAndOpportunities", "Click on any opportunity.");
                office_OpportunitiesHelper.ClickElement("Opportunities1");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ProfileViewOfClientLeadAndOpportunities", "Verify view text present on page.");
                office_OpportunitiesHelper.VerifyPageText("View");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

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

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

                executionLog.Log("BlankSubjectValidation", "Visit to Opportunities page");
                VisitOffice("opportunities");
                office_OpportunitiesHelper.WaitForWorkAround(5000);

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

                executionLog.Log("BlankSubjectValidation", "Open an opportunities");
                office_OpportunitiesHelper.ClickElement("Opportunities1");
                office_OpportunitiesHelper.WaitForWorkAround(5000);

                executionLog.Log("BlankSubjectValidation", "Verify title");
                VerifyTitle("Details");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("BlankSubjectValidation", "Click on Add note button");
                office_OpportunitiesHelper.ClickElement("AddNote");
                office_OpportunitiesHelper.WaitForWorkAround(1000);

                executionLog.Log("BlankSubjectValidation", "Wait for text");
                office_OpportunitiesHelper.WaitForText("Create a Note", 05);

                executionLog.Log("BlankSubjectValidation", "Click on Save button without subject");
                office_OpportunitiesHelper.ClickElement("Save");
                office_OpportunitiesHelper.WaitForWorkAround(1000);

                executionLog.Log("BlankSubjectValidation", "Verify validation message");
                office_OpportunitiesHelper.WaitForText("This field is required", 10);

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

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

            var oXMLData = new XMLParse();

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

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

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

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

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

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

                executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Create Opportunities");
                VisitOffice("opportunities/create");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Enter Opportunity Name");
                office_OpportunitiesHelper.TypeText("Name", Oppname);

                executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Enter Company DBA Name");
                office_OpportunitiesHelper.TypeText("CompanyName", CDBA);

                executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Select Opp Status");
                office_OpportunitiesHelper.SelectByText("State", "New");

                executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Select Opp Responsibility");
                office_OpportunitiesHelper.SelectByText("Responsibility", "Howard Tang");

                executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Click on Save");
                office_OpportunitiesHelper.clickJS("SaveOpp");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Click on convert button");
                office_OpportunitiesHelper.ClickElement("Convert");
                office_OpportunitiesHelper.WaitForWorkAround(500);

                executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Click on client radio button");
                office_OpportunitiesHelper.ClickElement("ClientRadio");

                executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Click on No Recycle Bin");
                office_OpportunitiesHelper.ClickElement("RecycleNo");

                executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Click on save button.");
                office_OpportunitiesHelper.clickJS("SaveConfirm");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Click on Company Details tab");
                office_ClientsHelper.ClickElement("CompanyDetailsTab");
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Verify Legal Name is blank");
                Assert.AreEqual(office_ClientsHelper.getInputText("//input[@id='ClientDetailCompanyLegalName']"), "");

                executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Click on Merchant Numbers tab");
                office_ClientsHelper.ClickElement("MerchantNumber");
                office_ClientsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyOpportunityToClientConversionDataBleed", "Verify Merchant ID is blank");
                Assert.AreEqual(office_ClientsHelper.getInputText("//input[@id='ClientDetailMerchID']"), "");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            var oXMLData = new XMLParse();

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

                executionLog.Log("ImportOpportunitiesCancel", "Click on Import Opportunities");
                VisitOffice("opportunities/import");

                executionLog.Log("ImportOpportunitiesCancel", "Upload a file with duplicate records");
                office_OpportunitiesHelper.UploadFile("//*[@id='vcard_file']", File);

                executionLog.Log("ImportOpportunitiesCancel", "Click on Import button.");
                office_OpportunitiesHelper.ClickElement("ImportOpp.");

                executionLog.Log("ImportOpportunitiesCancel", "Scroll to merge button.");
                office_OpportunitiesHelper.ScrollDown("//div[@class='row']/div/a[@title='Merge']");

                executionLog.Log("ImportOpportunitiesCancel", "Click on merge button.");
                office_OpportunitiesHelper.ClickElement("MergeOpp.");

                executionLog.Log("ImportOpportunitiesCancel", "Decline the alert message.");
                office_OpportunitiesHelper.DeclineAlert();
                office_OpportunitiesHelper.WaitForWorkAround(1000);

                executionLog.Log("ImportOpportunitiesCancel", "Click on merge button.");
                office_OpportunitiesHelper.ClickElement("MergeOpp.");
            }

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

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

            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver());

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

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

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

                executionLog.Log("OpportunitiesValidateForExe", "Redirect To URL");
                VisitOffice("opportunities");
                office_OpportunitiesHelper.WaitForWorkAround(5000);

                executionLog.Log("OpportunitiesValidateForExe", "Click On Task Edit");
                office_OpportunitiesHelper.ClickElement("ClickOnTaskEdit");
                office_OpportunitiesHelper.WaitForWorkAround(1000);

                executionLog.Log("OpportunitiesValidateForExe", "Click On Add Document");
                office_OpportunitiesHelper.ClickElement("ClickOnAddDocument");
                office_OpportunitiesHelper.WaitForWorkAround(1000);

                executionLog.Log("OpportunitiesValidateForExe", "Enter Document Name");
                office_OpportunitiesHelper.TypeText("EnterDocumentName", DocName);

                executionLog.Log("OpportunitiesValidateForExe", "Browse Doc");
                office_OpportunitiesHelper.Upload("BrowseDoc", fileUpl);
                office_OpportunitiesHelper.WaitForWorkAround(3000);

                executionLog.Log("OpportunitiesValidateForExe", "Click Save Of Doc PopUp");
                office_OpportunitiesHelper.ClickDisplayed("//a[text()='Save']");
                office_OpportunitiesHelper.WaitForWorkAround(1000);

                executionLog.Log("OpportunitiesValidateForExe", "Wait for validation mesage.");
                office_OpportunitiesHelper.WaitForText("This field is required.", 10);
                office_OpportunitiesHelper.WaitForWorkAround(3000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver());

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

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

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

                executionLog.Log("VerifyOpportunitiesAdvanceFilerColumnOrder", "Redirect To URL");
                VisitOffice("opportunities");
                office_OpportunitiesHelper.WaitForWorkAround(5000);

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

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

                executionLog.Log("VerifyOpportunitiesAdvanceFilerColumnOrder", "Verify default position of contact column.");
                office_OpportunitiesHelper.IsElementPresent("HeadAmount");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyOpportunitiesAdvanceFilerColumnOrder", "Verify default position of phone column.");
                office_OpportunitiesHelper.IsElementPresent("HeadIndustry");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyOpportunitiesAdvanceFilerColumnOrder", "Verify default position of email column.");
                office_OpportunitiesHelper.IsElementPresent("HeadSource");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

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

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

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

                executionLog.Log("VerifyOpportunitiesAdvanceFilerColumnOrder", "Select contact in displayed columns.");
                office_OpportunitiesHelper.SelectByText("DisplayedCols", "Name");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

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

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

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

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

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

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

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

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

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

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

                executionLog.Log("VerifyOpportunitiesAdvanceFilerColumnOrder", "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("VerifyOpportunitiesAdvanceFilerColumnOrder");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Opportunities Advance Filter ResultsPP");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Opportunities 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("Opportunities Advance Filter ResultsPP");
                        TakeScreenshot("VerifyOpportunitiesAdvanceFilerColumnOrder");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyOpportunitiesAdvanceFilerColumnOrder.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyOpportunitiesAdvanceFilerColumnOrder");
                        string id            = loginHelper.getIssueID("Opportunities Advance Filter ResultsPP");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyOpportunitiesAdvanceFilerColumnOrder.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Opportunities Advance Filter ResultsPP"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Opportunities Advance Filter ResultsPP");
                //  executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyOpportunitiesAdvanceFilerColumnOrder");
                executionLog.WriteInExcel("Opportunities Advance Filter ResultsPP", Status, JIRA, "Opportunities Management");
            }
        }
Esempio n. 29
0
        public void opportunityToLeadConversionIssue()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver());

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

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

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

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

                executionLog.Log("OpportunityToLeadConversionIssue", "Create Opportunities");
                VisitOffice("opportunities/create");

                executionLog.Log("OpportunityToLeadConversionIssue", "Click on Save");
                office_OpportunitiesHelper.ClickElement("SaveOpp");
                office_OpportunitiesHelper.WaitForWorkAround(2000);

                executionLog.Log("OpportunityToLeadConversionIssue", "Verify text on page.");
                office_OpportunitiesHelper.VerifyText("RequiredFieldsOpp", "This field is required.");

                executionLog.Log("OpportunityToLeadConversionIssue", "Enter Opportunity Name");
                office_OpportunitiesHelper.TypeText("Name", Oppname);

                executionLog.Log("OpportunityToLeadConversionIssue", "Enter Company DBA Name");
                office_OpportunitiesHelper.TypeText("CompanyName", CDBA);

                executionLog.Log("OpportunityToLeadConversionIssue", "Select Opp Status");
                office_OpportunitiesHelper.SelectByText("State", "New");

                executionLog.Log("OpportunityToLeadConversionIssue", "Select Opp Responsibility");
                office_OpportunitiesHelper.SelectByText("Responsibility", "Howard Tang");

                executionLog.Log("OpportunityToLeadConversionIssue", "Click on Save");
                office_OpportunitiesHelper.ClickElement("SaveOpp");
                office_OpportunitiesHelper.WaitForWorkAround(3000);

                executionLog.Log("OpportunityToLeadConversionIssue", "Wait for success message");
                office_OpportunitiesHelper.WaitForText("Opportunity saved successfully.", 10);

                executionLog.Log("OpportunityToLeadConversionIssue", "Click on convert.");
                office_OpportunitiesHelper.ClickElement("Convert");

                executionLog.Log("OpportunityToLeadConversionIssue", "Click on radio button lead.");
                office_OpportunitiesHelper.ClickElement("LeadRadio");

                executionLog.Log("OpportunityToLeadConversionIssue", "Click on save button.");
                office_OpportunitiesHelper.clickJS("SaveConfirm");
                office_OpportunitiesHelper.WaitForWorkAround(5000);

                executionLog.Log("OpportunityToLeadConversionIssue", "Verify converted name present on lead page.");
                office_OpportunitiesHelper.VerifyName(Oppname);
                office_OpportunitiesHelper.WaitForWorkAround(3000);

                executionLog.Log("OpportunityToLeadConversionIssue", "Verify converted DBA name present on the page.");
                office_OpportunitiesHelper.VerifyCompName(CDBA);
                office_OpportunitiesHelper.WaitForWorkAround(4000);

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

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

            XMLParse oXMLData = new XMLParse();

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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