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");
            }
        }
示例#2
0
        public void mergeOpportunitiesConfirmation()
        {
            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("MergeOpportunitiesConfirmation", "Login with valid username and password");
                Login(username[0], password[0]);
                Console.WriteLine("Logged in as: " + username[0] + " / " + password[0]);

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

                executionLog.Log("MergeOpportunitiesConfirmation", "Redirect at import opportunities page.");
                VisitOffice("opportunities/import");

                executionLog.Log("MergeOpportunitiesConfirmation", "Upload a csv file");
                office_OpportunitiesHelper.Upload("BrowseFile", File);

                executionLog.Log("MergeOpportunitiesConfirmation", "Click on Import Opportunities");
                office_OpportunitiesHelper.ClickElement("ImportOpp.");
                office_OpportunitiesHelper.WaitForWorkAround(1000);

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

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

                executionLog.Log("MergeOpportunitiesConfirmation", "Click ok to accept alert message");
                office_OpportunitiesHelper.AcceptAlert();

                executionLog.Log("MergeOpportunitiesConfirmation", "Click on Import Opportunities");
                office_OpportunitiesHelper.WaitForText("No records are merged", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("MergeOpportunitiesConfirmation");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Merge Opportunities Confirmation");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Merge Opportunities Confirmation", "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("Merge Opportunities Confirmation");
                        TakeScreenshot("MergeOpportunitiesConfirmation");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\MergeOpportunitiesConfirmation.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("MergeOpportunitiesConfirmation");
                        string id            = loginHelper.getIssueID("Merge Opportunities Confirmation");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\MergeOpportunitiesConfirmation.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Merge Opportunities Confirmation"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Merge Opportunities Confirmation");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("MergeOpportunitiesConfirmation");
                executionLog.WriteInExcel("Merge Opportunities Confirmation", Status, JIRA, "Opportunities Management");
            }
        }
        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");
            }
        }
示例#4
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)
            //{


            //}
        }