コード例 #1
0
        public void showMeetingOnCalender()
        {
            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_LeadsHelper = new Office_LeadsHelper(GetWebDriver());

            // Variable
            var    Path   = GetPathToFile() + "1.pdf";
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("ShowMeetingOnCalender", "Click on Clients in Topmenu");
                VisitOffice("leads");

                executionLog.Log("ShowMeetingOnCalender", "Click On Opp Check Box");
                office_LeadsHelper.ClickElement("ClickAnyLead");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("ShowMeetingOnCalender", "Click on Email");
                office_LeadsHelper.ClickElement("ClickOnAddMeeting");

                executionLog.Log("SendEmailNoteMultipleCC", "Wait for element to present.");
                office_LeadsHelper.WaitForElementPresent("EnterSubjectMeeting", 20);

                executionLog.Log("ShowMeetingOnCalender", "Enter meeting subject");
                office_LeadsHelper.TypeText("EnterSubjectMeeting", "Test Meeting");

                executionLog.Log("ShowMeetingOnCalender", "Click On Start Date");
                office_LeadsHelper.ClickElement("ClickOnStartDate");

                executionLog.Log("ShowMeetingOnCalender", "Click On Start Date");
                office_LeadsHelper.ClickElement("SelectDate");
                office_LeadsHelper.WaitForWorkAround(1000);

                executionLog.Log("ShowMeetingOnCalender", "Upload file");
                office_LeadsHelper.UploadFile("//*[@id='DocumentFile']", Path);
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("ShowMeetingOnCalender", "Click on Send Email button");
                office_LeadsHelper.ClickElement("ClickOnSaveMeeting");

                executionLog.Log("ShowMeetingOnCalender", "Wait for success message.");
                office_LeadsHelper.WaitForText("Meeting saved successfully.", 10);

                executionLog.Log("ShowMeetingOnCalender", "Select Activity type as meeting");
                office_LeadsHelper.Select("SelectActivityType", "Meetings");

                executionLog.Log("ShowMeetingOnCalender", "Click on meeting");
                office_LeadsHelper.PressEnter("ClickNotes1");

                executionLog.Log("ShowMeetingOnCalender", "Click on cancel meeting button");
                office_LeadsHelper.ClickElement("CancelMeeting");

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

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

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("ShowMeetingOnCalender");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("ShowMeetingOnCalender");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("ShowMeetingOnCalender", "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("ShowMeetingOnCalender");
                        TakeScreenshot("ShowMeetingOnCalender");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\ShowMeetingOnCalender.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("ShowMeetingOnCalender");
                        string id            = loginHelper.getIssueID("ShowMeetingOnCalender");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\ShowMeetingOnCalender.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("ShowMeetingOnCalender"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("ShowMeetingOnCalender");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("ShowMeetingOnCalender");
                executionLog.WriteInExcel("ShowMeetingOnCalender", Status, JIRA, "Office Activities");
            }
        }
コード例 #2
0
        public void leadsDocumentUrlChange()
        {
            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_LeadsHelper = new Office_LeadsHelper(GetWebDriver());

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

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

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

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

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

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

                executionLog.Log("LeadsDocumentUrlChange", "Enter Document Name");
                office_LeadsHelper.TypeText("EnterDocuName", "Document Test");

                executionLog.Log("LeadsDocumentUrlChange", "Upload File");
                office_LeadsHelper.UploadFile("//*[@id='DocumentFiles']", File);
                //office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsDocumentUrlChange", "Click Save");
                office_LeadsHelper.ClickDisplayed("//*[@id='CreateDocumentForm']/div[4]/button[1]");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadsDocumentUrlChange", "Select Activity >> Document");
                office_LeadsHelper.Select("SelectActivityType", "Documents");
                office_LeadsHelper.WaitForWorkAround(3000);

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

                executionLog.Log("LeadsDocumentUrlChange", "Click On Document");
                office_LeadsHelper.ClickJS("ClickNotes1");
                office_LeadsHelper.WaitForWorkAround(3000);

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

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

                executionLog.Log("LeadsDocumentUrlChange", "Redirect to Clients Page");
                VisitOffice("leads");
                office_LeadsHelper.WaitForWorkAround(3000);

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

                executionLog.Log("LeadsDocumentUrlChange", "Select the Document in activity type");
                office_LeadsHelper.SelectByText("SelectActivityType", "Documents");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsDocumentUrlChange", "Click On Document ");
                office_LeadsHelper.PressEnter("ClickNotes1");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadsDocumentUrlChange", "Click OnDelete icon");
                office_LeadsHelper.ClickElement("DeleteDoc");

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

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

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

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

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

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

                executionLog.Log("VerifySuccessMessage", "Go to Import Leads page");
                VisitOffice("leads/import");

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

                string file = GetPathToFile() + "leadslist.csv";
                executionLog.Log("VerifySuccessMessage", "Uplaod file");
                office_LeadsHelper.UploadFile("//*[@id='vcard_file']", file);

                executionLog.Log("VerifySuccessMessage", "Click on Import button");
                office_LeadsHelper.ClickElement("LeadImport");

                executionLog.Log("VerifySuccessMessage", "Verify success message");
                office_LeadsHelper.WaitForText("Records Imported Successfully.", 10);

                executionLog.Log("VerifySuccessMessage", "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("VerifySuccessMessage");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Success Message");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Success Message", "Bug", "Medium", "Lead page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Success Message");
                        TakeScreenshot("VerifySuccessMessage");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifySuccessMessage.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifySuccessMessage");
                        string id            = loginHelper.getIssueID("Verify Success Message");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifySuccessMessage.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Success Message"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Success Message");
                //     executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifySuccessMessage");
                executionLog.WriteInExcel("Verify Success Message", Status, JIRA, "Leads Management");
            }
        }
コード例 #4
0
        public void mergeLeadVerifyConfirmation()
        {
            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_LeadsHelper = new Office_LeadsHelper(GetWebDriver());

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

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

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

                executionLog.Log("MergeLeadVerifyConfirmation", "Redirect at leads import page");
                VisitOffice("leads/import");

                executionLog.Log("MergeLeadVerifyConfirmation", "Upload a csv file.");
                office_LeadsHelper.UploadFile("//*[@id='vcard_file']", File);

                executionLog.Log("MergeLeadVerifyConfirmation", "Click on import button.");
                office_LeadsHelper.ClickElement("LeadImport");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("MergeLeadVerifyConfirmation", "Scroll to merge button.");
                office_LeadsHelper.ScrollDown("//button[@title='Merge']");

                executionLog.Log("MergeLeadVerifyConfirmation", "Click on  merge button");
                office_LeadsHelper.ClickElement("MergeDuplicate");
                office_LeadsHelper.WaitForWorkAround(1000);

                executionLog.Log("MergeLeadVerifyConfirmation", "Accept alert message.");
                office_LeadsHelper.AcceptAlert();
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("MergeLeadVerifyConfirmation", "Verify text on page.");
                office_LeadsHelper.VerifyPageText("No records are merged");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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