コード例 #1
0
        public void createOffice()
        {
            string[] username1 = null;
            string[] password1 = null;

            var oXMLData = new XMLParse();

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

            username1 = oXMLData.getData("settings/Credentials", "username_corp");
            password1 = oXMLData.getData("settings/Credentials", "password");

            // Initializing the objects
            var executionLog            = new ExecutionLog();
            var loginHelper             = new LoginHelper(GetWebDriver());
            var corpOffice_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

            // Variable random

            var    username = "******" + GetRandomNumber();
            var    name     = "Test" + GetRandomNumber();
            String JIRA     = "";
            String Status   = "Pass";

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

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

                executionLog.Log("CreateOffice", "Go to office page");
                VisitCorp("offices");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateOffice", "Verify title");
                VerifyTitle("Offices");

                executionLog.Log("CreateOffice", "Click On Create button");
                corpOffice_OfficeHelper.ClickElement("Create");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateOffice", "Verify title");
                VerifyTitle("Create an Office");

                executionLog.Log("CreateOffice", "Enter Name");
                corpOffice_OfficeHelper.TypeText("Name", name);

                executionLog.Log("CreateOffice", "Enter DBAName");
                corpOffice_OfficeHelper.TypeText("DBAName", "TEST123");

                executionLog.Log("CreateOffice", "Enter Website");
                corpOffice_OfficeHelper.TypeText("Website", "TEST.COM");

                executionLog.Log("CreateOffice", "Enter OfficeCode");
                corpOffice_OfficeHelper.TypeText("OfficeCode", "12345");

                executionLog.Log("CreateOffice", "Select Address");
                corpOffice_OfficeHelper.Select("AddressType", "Office");

                executionLog.Log("CreateOffice", "Enter AddressLine1");
                corpOffice_OfficeHelper.TypeText("AddressLine1", "FC-89");

                executionLog.Log("CreateOffice", "Enter ZipCode");
                corpOffice_OfficeHelper.TypeText("ZIpCode", "60601");

                executionLog.Log("CreateOffice", "Enter PrimaryUserName");
                corpOffice_OfficeHelper.TypeText("PrimaryUserName", username);

                executionLog.Log("CreateOffice", "Click on AutoGenPassword checkbox");
                corpOffice_OfficeHelper.ClickElement("AutoGenPassword");

                executionLog.Log("CreateOffice", "Enter PrimaryPassword");
                corpOffice_OfficeHelper.TypeText("PrimaryPassword", "pegasus");

                executionLog.Log("CreateOffice", "Select Salutation");
                corpOffice_OfficeHelper.Select("Salutation", "Mr");
                //corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("CreateOffice", "Enter FirstName");
                corpOffice_OfficeHelper.TypeText("FirstName", "Test");

                executionLog.Log("CreateOffice", "Enter LastName");
                corpOffice_OfficeHelper.TypeText("LastName", "Tester");

                executionLog.Log("CreateOffice", "Enter eAddress");
                corpOffice_OfficeHelper.TypeText("eAddress", "*****@*****.**");

                executionLog.Log("CreateOffice", " Click on save button");
                try
                {
                    corpOffice_OfficeHelper.ClickElement("Save");
                }
                catch (OpenQA.Selenium.WebDriverException) { }

                executionLog.Log("CreateOffice", "Verify text on the page");
                corpOffice_OfficeHelper.WaitForText("Office created successfully.", 10);

                executionLog.Log("CreateOffice", "Go to office page");
                VisitCorp("offices");
                corpOffice_OfficeHelper.WaitForWorkAround(4000);

                executionLog.Log("CreateOffice", "Verify title");
                VerifyTitle("Offices");

                executionLog.Log("CreateOffice", "Enter Name to search");
                corpOffice_OfficeHelper.TypeText("EnterSelenium", name);
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateOffice", "Click Delete btn  ");
                corpOffice_OfficeHelper.ClickElement("DeleteOffice");

                executionLog.Log("CreateOffice", "Verify page text");
                corpOffice_OfficeHelper.VerifyPageText("Are you sure want to delete the");

                executionLog.Log("CreateOffice", "Click Delete btn  ");
                corpOffice_OfficeHelper.ClickElement("ConfirmDelete");

                executionLog.Log("CreateOffice", "Accept alert message. ");
                corpOffice_OfficeHelper.AcceptAlert();

                executionLog.Log("CreateOffice", "Wait for delete message. ");
                corpOffice_OfficeHelper.WaitForText("Office deleted successfully.", 20);
            }


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

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

            var oXMLData = new XMLParse();

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

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


            // Initializing the objects
            var executionLog            = new ExecutionLog();
            var loginHelper             = new LoginHelper(GetWebDriver());
            var corpOffice_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

            //Variable random
            var    usernme = "TESTUSER" + RandomNumber(676, 99999);
            var    name    = "Meeting" + RandomNumber(99, 999);
            String JIRA    = "";
            String Status  = "Pass";

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

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

                executionLog.Log("VerifyMeetingTImeIssueForOffices", "Redirect at office page.");
                VisitCorp("offices");

                executionLog.Log("VerifyMeetingTImeIssueForOffices", "Verify Page title.");
                VerifyTitle("Offices");

                executionLog.Log("VerifyMeetingTImeIssueForOffices", "Click on any office..");
                corpOffice_OfficeHelper.ClickElement("ClickOnAnyCorp");

                executionLog.Log("VerifyMeetingTImeIssueForOffices", "Click on add meeting.");
                corpOffice_OfficeHelper.ClickElement("NewMeeting");

                executionLog.Log("VerifyMeetingTImeIssueForOffices", "Enter meeting subject.");
                corpOffice_OfficeHelper.TypeText("MeetingSubject", name);

                executionLog.Log("VerifyMeetingTImeIssueForOffices", "Enter start date.");
                corpOffice_OfficeHelper.TypeText("StartDate", "2015-03-25");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyMeetingTImeIssueForOffices", "Enter same due date as start date..");
                corpOffice_OfficeHelper.TypeText("DueDate", "2015-03-25");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyMeetingTImeIssueForOffices", "Select start time");
                corpOffice_OfficeHelper.Select("StartHour", "02");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyMeetingTImeIssueForOffices", "Select start minute");
                corpOffice_OfficeHelper.Select("StartMinute", "00");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);


                executionLog.Log("VerifyMeetingTImeIssueForOffices", "Select due hour");
                corpOffice_OfficeHelper.Select("DueHour", "01");

                executionLog.Log("VerifyMeetingTImeIssueForOffices", "Click on save meeting.");
                corpOffice_OfficeHelper.ClickElement("SaveMeeting");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyMeetingTImeIssueForOffices", "Verify alert text for lesser start date and time.");
                corpOffice_OfficeHelper.VerifyAlertText("Start Date & Time should lesser than or equal to End Date & Time.");

                executionLog.Log("VerifyMeetingTImeIssueForOffices", "Click ok to accept alert.");
                corpOffice_OfficeHelper.AcceptAlert();
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyMeetingTImeIssueForOffices");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Meeting TIme Issue For Offices");
                if (!result)
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Meeting TIme Issue For Offices", "Bug", "Medium", "Corp office page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Meeting TIme Issue For Offices");
                        TakeScreenshot("VerifyMeetingTImeIssueForOffices");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyMeetingTImeIssueForOffices.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyMeetingTImeIssueForOffices");
                        string id            = loginHelper.getIssueID("Verify Meeting TIme Issue For Offices");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyMeetingTImeIssueForOffices.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Meeting TIme Issue For Offices"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Meeting TIme Issue For Offices");
                executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyMeetingTImeIssueForOffices");
                executionLog.WriteInExcel("Verify Meeting TIme Issue For Offices", Status, JIRA, "Corp Office");
            }
        }
コード例 #3
0
        public void verifyStateCountryAutoPopulate()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

            oXMLData.LoadXML("../../Config/ApplicationSettings.xml");
            username = oXMLData.getData("settings/Credentials", "username_corp");
            password = oXMLData.getData("settings/Credentials", "password2");

            // Initializing the objects
            var executionLog            = new ExecutionLog();
            var loginHelper             = new LoginHelper(GetWebDriver());
            var corpOffice_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

            // Variable random
            var    usernme = "Sysprins" + RandomNumber(44, 777);
            var    name    = "Test" + RandomNumber(99, 999);
            String JIRA    = "";
            String Status  = "Pass";

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

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

                executionLog.Log("VerifyStateCountryAutoPopulate", "Redirect to office page.");
                VisitCorp("offices");

                executionLog.Log("VerifyStateCountryAutoPopulate", "Click on create buttton");
                corpOffice_OfficeHelper.ClickElement("Create");

                executionLog.Log("VerifyStateCountryAutoPopulate", "Verify title as create an office.");
                VerifyTitle("Create an Office");

                executionLog.Log("VerifyStateCountryAutoPopulate", "Click on add address button.");
                corpOffice_OfficeHelper.ClickElement("ClickAddAddressBtn");

                executionLog.Log("VerifyStateCountryAutoPopulate", "Enter a valid zip code.");
                corpOffice_OfficeHelper.TypeText("ZipCode2", "60601");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyStateCountryAutoPopulate", "Verify country auto matically filled.");
                corpOffice_OfficeHelper.VerifyText("Country2", "United States");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyStateCountryAutoPopulate");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify State Country Auto Populate");
                if (!result)
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify State Country Auto Populate", "Bug", "Medium", "Corp Office page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify State Country Auto Populate");
                        TakeScreenshot("VerifyStateCountryAutoPopulate");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyStateCountryAutoPopulate.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyStateCountryAutoPopulate");
                        string id            = loginHelper.getIssueID("Verify State Country Auto Populate");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyStateCountryAutoPopulate.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify State Country Auto Populate"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify State Country Auto Populate");
                executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyStateCountryAutoPopulate");
                executionLog.WriteInExcel("Verify State Country Auto Populate", Status, JIRA, "Corp Office");
            }
        }
コード例 #4
0
        public void userVerifyCountryCorp()
        {
            string[] username = null;
            string[] password = null;
            String   JIRA     = "";
            String   Status   = "Pass";

            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog            = new ExecutionLog();
            var loginHelper             = new LoginHelper(GetWebDriver());
            var corpOffice_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

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

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

                executionLog.Log("UserVerifyCountryCorp", "Click on Menu Icon");
                corpOffice_OfficeHelper.ClickElement("MenuIcon");

                executionLog.Log("UserVerifyCountryCorp", "Click on Agent in Topmenu");
                corpOffice_OfficeHelper.MouseOverAndWait("OfficeTabCorp", 5);

                executionLog.Log("UserVerifyCountryCorp", "Click on Office button");
                corpOffice_OfficeHelper.ClickJS("OfficeBtn");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("UserVerifyCountryCorp", "click on Create Button");
                corpOffice_OfficeHelper.ClickElement("Create");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("UserVerifyCountryCorp", "Verify Page title");
                VerifyTitle("Create an Office");

                executionLog.Log("UserVerifyCountryCorp", "Select Mailing Country");
                corpOffice_OfficeHelper.Select("SelectCountryCorp", "Canada");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("UserVerifyCountryCorp");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("User Verify Country Corp");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("User Verify Country Corp", "Bug", "Medium", "Corp office page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("User Verify Country Corp");
                        TakeScreenshot("UserVerifyCountryCorp");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\UserVerifyCountryCorp.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("UserVerifyCountryCorp");
                        string id            = loginHelper.getIssueID("User Verify Country Corp");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\UserVerifyCountryCorp.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("User Verify Country Corp"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("User Verify Country Corp");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("UserVerifyCountryCorp");
                executionLog.WriteInExcel("User Verify Country Corp", Status, JIRA, "Corp office");
            }
        }
コード例 #5
0
        public void fDNRequirement()
        {
            string[] username = null;
            string[] password = null;
            string[] log      = null;
            var      oXMLData = new XMLParse();

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

            username = oXMLData.getData("settings/Credentials", "username_corp");
            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 corpOffice_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());


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

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

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

                executionLog.Log("FDNRequirement", "Go to Create office page");
                VisitCorp("offices/create");

                executionLog.Log("FDNRequirement", "Verify title");
                VerifyTitle("Create an Office");

                executionLog.Log("FDNRequirement", "Click on 'Save' button");
                corpOffice_OfficeHelper.ClickElement("Save");

                executionLog.Log("FDNRequirement", "Verify FDN field is not mandatory");
                corpOffice_OfficeHelper.verifyElementNotPresent("OfficeFDN");

                executionLog.Log("FDNRequirement", "Logout from the application");
                VisitCorp("logout");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";
                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("FDNRequirement");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("FDN Requirement");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("FDN Requirement", "Bug", "Medium", "Office page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("FDN Requirement");
                        TakeScreenshot("FDNRequirement");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\FDNRequirement.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("FDNRequirement");
                        string id            = loginHelper.getIssueID("FDN Requirement");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\FDNRequirement.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("FDN Requirement"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("FDN Requirement");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("FDNRequirement");
                executionLog.WriteInExcel("FDN Requirement", Status, JIRA, "Corp Office");
            }
        }
コード例 #6
0
        public void deleteOfficeURL()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog            = new ExecutionLog();
            var loginHelper             = new LoginHelper(GetWebDriver());
            var corpOffice_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

            // Variable random
            var    usernme = "TESTUSER" + RandomNumber(44, 777);
            var    name    = "Test" + RandomNumber(99, 999);
            String JIRA    = "";
            String Status  = "Pass";

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

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

                executionLog.Log("DeleteOfficeURL", "Redirect at offices page.");
                VisitCorp("offices");

                executionLog.Log("DeleteOfficeURL", "Verify title");
                VerifyTitle("Offices");

                executionLog.Log("DeleteOfficeURL", "Try to delete an office via URL");
                VisitCorp("offices/delete/1");

                executionLog.Log("DeleteOfficeURL", "Verify User get priviledge message");
                corpOffice_OfficeHelper.WaitForText("You don't have privileges to delete this office.", 10);

                executionLog.Log("DeleteOfficeURL", "Verify title");
                VerifyTitle("Offices");

                executionLog.Log("DeleteOfficeURL", "Try to delete an office via URL");
                VisitCorp("offices/delete/2");

                executionLog.Log("DeleteOfficeURL", "Verify User get privilage message");
                corpOffice_OfficeHelper.WaitForText("You don't have privileges to delete this office.", 10);

                executionLog.Log("DeleteOfficeURL", "Verify title");
                VerifyTitle("Offices");

                executionLog.Log("DeleteOfficeURL", "Try to delete an office via URL");
                VisitCorp("offices/delete/3");

                executionLog.Log("DeleteOfficeURL", "Verify User get privilage message");
                corpOffice_OfficeHelper.WaitForText("You don't have privileges to delete this office.", 10);
            }

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

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

            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog                   = new ExecutionLog();
            var loginHelper                    = new LoginHelper(GetWebDriver());
            var corpOffice_OfficeHelper        = new CorpOffice_OfficeHelper(GetWebDriver());
            var yopmail_Helper                 = new YopMailHelper(GetWebDriver());
            var gmailHelper                    = new GmailHelper(GetWebDriver());
            var officeActivities_MeetingHelper = new OfficeActivities_MeetingHelper(GetWebDriver());

            // Variable random
            var    username1 = "GoogleAuth" + RandomNumber(44, 99999);
            var    name      = "Test" + RandomNumber(999, 999999);
            String JIRA      = "";
            String Status    = "Pass";

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

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

                executionLog.Log("AuthenticateWithGoogleCalendar", "Visit Corp offices");
                VisitCorp("offices");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("AuthenticateWithGoogleCalendar", "Click on create office button");
                corpOffice_OfficeHelper.ClickElement("Create");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter Name");
                corpOffice_OfficeHelper.TypeText("Name", name);

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter DBAName");
                corpOffice_OfficeHelper.TypeText("DBAName", "TESTDBA");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter Website");
                corpOffice_OfficeHelper.TypeText("Website", "TEST.COM");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter OfficeCode");
                corpOffice_OfficeHelper.TypeText("OfficeCode", "12345");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter VenderName");
                corpOffice_OfficeHelper.TypeText("VendorName", "VenderTEST");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter VenderName");
                corpOffice_OfficeHelper.TypeText("VendorCode", "1234");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter VenderName");
                corpOffice_OfficeHelper.TypeText("OfficePhoneNumber", "1234567890");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter VenderName");
                corpOffice_OfficeHelper.TypeText("BusinessPhoneNumber", "1234567890");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter VenderName");
                corpOffice_OfficeHelper.TypeText("FaxNumber", "1234567890");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter VenderName");
                corpOffice_OfficeHelper.TypeText("LinkedURL", "Linked.com");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter VenderName");
                corpOffice_OfficeHelper.TypeText("FacebookURL", "Facebook.com");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter TwitterURL");
                corpOffice_OfficeHelper.TypeText("TwitterURL", "Twitter.com");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Select Address");
                corpOffice_OfficeHelper.Select("AddressType", "Office");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter AddressLine1");
                corpOffice_OfficeHelper.TypeText("AddressLine1", "FC-89");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Select Zip Code");
                corpOffice_OfficeHelper.TypeText("ZIpCode", "60601");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter PrimaryUserName");
                corpOffice_OfficeHelper.TypeText("PrimaryUserName", username1);

                executionLog.Log("AuthenticateWithGoogleCalendar", "Click on AutoGenPassword checkbox");
                corpOffice_OfficeHelper.ClickElement("AutoGenPassword");
                corpOffice_OfficeHelper.WaitForWorkAround(1000);

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter PrimaryPassword");
                corpOffice_OfficeHelper.TypeText("PrimaryPassword", "123456");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Select Salutation");
                corpOffice_OfficeHelper.Select("Salutation", "Mr");
                //corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter FirstName");
                corpOffice_OfficeHelper.TypeText("FirstName", "Test");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter LastName");
                corpOffice_OfficeHelper.TypeText("LastName", "Tester");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter eAddress");
                corpOffice_OfficeHelper.TypeText("eAddress", "*****@*****.**");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Click on save button.");
                try
                {
                    corpOffice_OfficeHelper.ClickElement("Save");
                }
                catch (OpenQA.Selenium.WebDriverException)
                { }
                yopmail_Helper.WaitForWorkAround(7000);

                executionLog.Log("AuthenticateWithGoogleCalendar", "Go to yopmail.com");
                GetWebDriver().Navigate().GoToUrl("http://www.yopmail.com/en/");
                Console.WriteLine("Redirected to yopmail.com");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Enter eAddress in yopmail");
                yopmail_Helper.TypeText("Yopmail", "aslam.pegasus");

                executionLog.Log("AuthenticateWithGoogleCalendar", "Check Inbox");
                yopmail_Helper.ClickElement("YopmailClick");

                yopmail_Helper.switchFrame("ifmail");

                yopmail_Helper.VerifyText("MailSecondPoint", username1);

                executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Office Link");
                yopmail_Helper.ClickElement("OfficeLink");
                corpOffice_OfficeHelper.SwitchToWindow();

                yopmail_Helper.WaitForWorkAround(5000);

                executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Profile Icon");
                VisitCorp("logout");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("AuthenticateWithGoogleCalendar", "Login to office");
                Login(username1, "123456");

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

                executionLog.Log("AuthenticateWithGoogleCalendar", "Redirect at My Calendar page");
                GetWebDriver().Navigate().GoToUrl("https://www.mypegasuscrm.com/newthemecorp/" + username1 + "/meetings/calendar/my");
                officeActivities_MeetingHelper.WaitForWorkAround(3000);

                executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Authenticate with Google button");
                officeActivities_MeetingHelper.ClickElement("GoogleAuth");
                officeActivities_MeetingHelper.WaitForWorkAround(3000);

                if (gmailHelper.IsElementPresent("//div[@id='identifierLink']/div[2]/p"))
                {
                    executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Use Another Account");
                    gmailHelper.ClickElement("UseAnotherAccBtn");
                    gmailHelper.WaitForWorkAround(1000);

                    executionLog.Log("AuthenticateWithGoogleCalendar", "Enter email address");
                    gmailHelper.TypeText("EnterEmail", "*****@*****.**");

                    executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Next button");
                    gmailHelper.ClickElement("NextBtn");
                    gmailHelper.WaitForWorkAround(1000);

                    executionLog.Log("AuthenticateWithGoogleCalendar", "Enter password address");
                    gmailHelper.TypeText("EnterPswrd", "selenium123456");

                    executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Next button");
                    gmailHelper.ClickElement("NextBtn");
                    gmailHelper.WaitForWorkAround(1000);

                    executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Allow button");
                    gmailHelper.ClickElement("AllowBtn");
                    gmailHelper.WaitForWorkAround(4000);
                }

                else
                {
                    executionLog.Log("AuthenticateWithGoogleCalendar", "Enter email address");
                    gmailHelper.TypeText("EnterEmail", "*****@*****.**");

                    executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Next button");
                    gmailHelper.ClickElement("NextBtn");
                    gmailHelper.WaitForWorkAround(1000);

                    executionLog.Log("AuthenticateWithGoogleCalendar", "Enter password address");
                    gmailHelper.TypeText("EnterPswrd", "selenium123456");

                    executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Next button");
                    gmailHelper.ClickElement("NextBtn");
                    gmailHelper.WaitForWorkAround(1000);

                    executionLog.Log("AuthenticateWithGoogleCalendar", "Click on Allow button");
                    gmailHelper.ClickElement("AllowBtn");
                    gmailHelper.WaitForWorkAround(4000);
                }

                executionLog.Log("AuthenticateWithGoogleCalendar", "Verify successfully Google Calendar Synced");
                officeActivities_MeetingHelper.VerifyPageText("Last Sync Time");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("AuthenticateWithGoogleCalendar");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Authenticate With Google Calendar");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Authenticate With Google Calendar", "Bug", "Medium", "Create Office page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Authenticate With Google Calendar");
                        TakeScreenshot("AuthenticateWithGoogleCalendar");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\AuthenticateWithGoogleCalendar.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("AuthenticateWithGoogleCalendar");
                        string id            = loginHelper.getIssueID("Authenticate With Google Calendar");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\AuthenticateWithGoogleCalendar.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Authenticate With Google Calendar"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Authenticate With Google Calendar");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("AuthenticateWithGoogleCalendar");
                executionLog.WriteInExcel("Authenticate With Google Calendar", Status, JIRA, "Corp Office");
            }
        }
コード例 #8
0
        public void resetPasswordLinkIssue()
        {
            string[] username = null;
            string[] password = null;


            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog             = new ExecutionLog();
            var loginHelper              = new LoginHelper(GetWebDriver());
            var corp_Office_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

            // Variable random
            var    Office = "Test" + GetRandomNumber();
            var    User   = "******" + GetRandomNumber();
            var    Email  = "addressTest" + RandomNumber(1, 99) + "@yop.com";
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("ResetPasswordLinkIssue", "Redirect at Craete Office page");
                VisitCorp("offices");

                executionLog.Log("ResetPasswordLinkIssue", "Verify page title");
                VerifyTitle("Offices");

                executionLog.Log("ResetPasswordLinkIssue", "Click on any office");
                corp_Office_OfficeHelper.ClickElement("ClickOnAnyCorp");
                corp_Office_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("ResetPasswordLinkIssue", "Click on reset password link.");
                corp_Office_OfficeHelper.ClickElement("ResetPassword");
                corp_Office_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("ResetPasswordLinkIssue", "Verify success text for link sent.");
                corp_Office_OfficeHelper.VerifyPageText("Reset password link sent to");
                corp_Office_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("ResetPasswordLinkIssue", "Verify error message not present on page");
                corp_Office_OfficeHelper.VerifyTextNot("Error while sending mail.");
                corp_Office_OfficeHelper.WaitForWorkAround(3000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("ResetPasswordLinkIssue");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Reset Password Link Issue");
                if (!result)
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Reset Password Link Issue", "Bug", "Medium", "Office corp", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Reset Password Link Issue");
                        TakeScreenshot("ResetPasswordLinkIssue");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\ResetPasswordLinkIssue.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 5)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("ResetPasswordLinkIssue");
                        string id            = loginHelper.getIssueID("Reset Password Link Issue");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\ResetPasswordLinkIssue.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Reset Password Link Issue"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Reset Password Link Issue");
                executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("ResetPasswordLinkIssue");
                executionLog.WriteInExcel("Reset Password Link Issue", Status, JIRA, "Corp Office");
            }
        }
コード例 #9
0
        public void corporatePortal1()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog            = new ExecutionLog();
            var loginHelper             = new LoginHelper(GetWebDriver());
            var corpOffice_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

            // Variable random
            var    usernme = "Sysprins" + RandomNumber(44, 799999977);
            var    Office  = "Office" + RandomNumber(1, 99999);
            var    name    = "Test" + GetRandomNumber();
            String JIRA    = "";
            String Status  = "Pass";

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

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

                executionLog.Log("CorporatePortal1", "Redircet to office");
                VisitCorp("offices");

                executionLog.Log("CorporatePortal1", "Click On Create New Button");
                corpOffice_OfficeHelper.ClickElement("Create");

                executionLog.Log("CorporatePortal1", "Enter Name");
                corpOffice_OfficeHelper.TypeText("Name", Office);

                executionLog.Log("CorporatePortal1", "Enter DBAName");
                corpOffice_OfficeHelper.TypeText("DBAName", "TEST123");

                executionLog.Log("CorporatePortal1", "Enter Website");
                corpOffice_OfficeHelper.TypeText("Website", "TEST.COM");

                executionLog.Log("CorporatePortal1", "Enter OfficeCode");
                corpOffice_OfficeHelper.TypeText("OfficeCode", "12345");

                executionLog.Log("CorporatePortal1", "Enter VenderName");
                corpOffice_OfficeHelper.TypeText("VendorName", "VenderTEST");

                executionLog.Log("CorporatePortal1", "Enter Vender code");
                corpOffice_OfficeHelper.TypeText("VendorCode", "1234");

                executionLog.Log("CorporatePortal1", "Enter office phone number");
                corpOffice_OfficeHelper.TypeText("OfficePhoneNumber", "1234567890");

                executionLog.Log("CorporatePortal1", "Enter BusinessPhoneNumber");
                corpOffice_OfficeHelper.TypeText("BusinessPhoneNumber", "1234567890");

                executionLog.Log("CorporatePortal1", "Enter FaxNumber");
                corpOffice_OfficeHelper.TypeText("FaxNumber", "1234567890");

                executionLog.Log("CorporatePortal1", "Enter LinkedURL");
                corpOffice_OfficeHelper.TypeText("LinkedURL", "Linked.com");

                executionLog.Log("CorporatePortal1", "Enter FacebookURL");
                corpOffice_OfficeHelper.TypeText("FacebookURL", "Facebook.com");

                executionLog.Log("CorporatePortal1", "Enter TwitterURL");
                corpOffice_OfficeHelper.TypeText("TwitterURL", "Twitter.com");

                executionLog.Log("CorporatePortal1", "Enter Address");
                corpOffice_OfficeHelper.Select("AddressType", "Office");

                executionLog.Log("CorporatePortal1", "Enter AddressLine1");
                corpOffice_OfficeHelper.TypeText("AddressLine1", "FC-89");

                executionLog.Log("CorporatePortal1", "Enter Zip Code");
                corpOffice_OfficeHelper.TypeText("ZIpCode", "60601");
                corpOffice_OfficeHelper.WaitForWorkAround(4000);

                executionLog.Log("CorporatePortal1", "Enter PrimaryUserName");
                corpOffice_OfficeHelper.TypeText("PrimaryUserName", usernme);

                executionLog.Log("CorporatePortal1", "Click on AutoGenPassword checkbox");
                corpOffice_OfficeHelper.ClickElement("AutoGenPassword");

                executionLog.Log("CorporatePortal1", "Enter Primary Password");
                corpOffice_OfficeHelper.TypeText("PrimaryPassword", "1qaz!QAZ");

                executionLog.Log("CorporatePortal1", "Select Salutation");
                corpOffice_OfficeHelper.Select("Salutation", "Mr");
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("CorporatePortal1", "Enter FirstName");
                corpOffice_OfficeHelper.TypeText("FirstName", "Test");

                executionLog.Log("CorporatePortal1", "Enter LastName");
                corpOffice_OfficeHelper.TypeText("LastName", "Tester");

                executionLog.Log("CorporatePortal1", "Enter eAddress");
                corpOffice_OfficeHelper.TypeText("eAddress", "*****@*****.**");

                executionLog.Log("CorporatePortal1", "Save");
                corpOffice_OfficeHelper.ClickElement("Save");
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("CorporatePortal1", "Wait for Confirmation");
                corpOffice_OfficeHelper.WaitForText("Office created successfully.", 50);

                executionLog.Log("CorporatePortal1", "Visit Office");
                VisitCorp("offices");

                executionLog.Log("CorporatePortal1", "Enter Name To Search");
                corpOffice_OfficeHelper.TypeText("EnterNameToSearch", Office);

                executionLog.Log("CorporatePortal1", "Click on Edit Icon");
                corpOffice_OfficeHelper.ClickElement("EditOffice");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("CorporatePortal1", "Click on Save");
                corpOffice_OfficeHelper.ClickElement("SaveEdit");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("CorporatePortal1", "Wait for Confirmation");
                corpOffice_OfficeHelper.WaitForText("Office updated successfully.", 50);

                executionLog.Log("CorporatePortal1", "Goto Office");
                VisitCorp("offices");

                executionLog.Log("CorporatePortal1", "Enter Name To Search");
                corpOffice_OfficeHelper.TypeText("EnterNameToSearch", Office);

                executionLog.Log("CorporatePortal1", "Click On Office");
                corpOffice_OfficeHelper.ClickElement("ClickOnOffice");

                executionLog.Log("CorporatePortal1", "Click On Send Email");
                corpOffice_OfficeHelper.ClickElement("ClickOnSendEmail");
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("CorporatePortal1", "Enter Email");
                corpOffice_OfficeHelper.TypeText("EnterToEmail", "*****@*****.**");

                executionLog.Log("CorporatePortal1", "Enter Email Subject");
                corpOffice_OfficeHelper.TypeText("EnterSubjectEmail", "Test Subject");

                executionLog.Log("CorporatePortal1", "Click On Send Email Pop Up");
                corpOffice_OfficeHelper.ClickElement("ClickOnSendEmailPopUp");
                corpOffice_OfficeHelper.WaitForWorkAround(4000);

                executionLog.Log("CorporatePortal1", "Verify Confirmation");
                corpOffice_OfficeHelper.WaitForText("Email Sent Successfully.", 20);

                executionLog.Log("CorporatePortal1", "Click On Add Notes");
                corpOffice_OfficeHelper.ClickElement("ClickOnAddNotes");
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("CorporatePortal1", "Enter Notes Subject");
                corpOffice_OfficeHelper.TypeText("EnterNoteSubject", "Test Subject");

                executionLog.Log("CorporatePortal1", "Click Save");
                corpOffice_OfficeHelper.ClickElement("SaveNotesOffice");

                executionLog.Log("CorporatePortal1", "Enter Notes Subject");
                corpOffice_OfficeHelper.WaitForText("Note Created Successfully", 10);

                executionLog.Log("CorporatePortal1", "Click on Add Documnet");
                corpOffice_OfficeHelper.ClickElement("AddDocumentOff");
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("CorporatePortal1", "Enter Subject");
                corpOffice_OfficeHelper.TypeText("NameDocumentOff", "Test Doc Name");
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("CorporatePortal1", "Add attachment.");
                var FileName = GetPathToFile() + "index.jpg";
                corpOffice_OfficeHelper.UploadFile("//*[@id='DocumentFiles']", FileName);

                executionLog.Log("CorporatePortal1", "Click Save");
                corpOffice_OfficeHelper.ClickDisplayed("//a[@title='Save']");

                executionLog.Log("CorporatePortal1", "Verify");
                corpOffice_OfficeHelper.WaitForText("Documents successfully Added.", 10);

                executionLog.Log("CorporatePortal1", "Add Meeting");
                corpOffice_OfficeHelper.ClickElement("ClickOnMeeting");
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("CorporatePortal1", "Enter Subject");
                corpOffice_OfficeHelper.TypeText("EnterSubjectMeeting", "Test Subject");
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("CorporatePortal1", "Enter Meeting");
                corpOffice_OfficeHelper.TypeText("EnterMeetingStartDate", "2015-11-03");

                executionLog.Log("CorporatePortal1", "Click Save");
                corpOffice_OfficeHelper.ClickDisplayed("//a[@title='Save']");

                executionLog.Log("CorporatePortal1", "Verify");
                corpOffice_OfficeHelper.WaitForText("Meeting Created Successfully.", 20);

                executionLog.Log("CorporatePortal1", "Go to office page");
                VisitCorp("offices");
                corpOffice_OfficeHelper.WaitForWorkAround(5000);

                executionLog.Log("CorporatePortal1", "Verify title");
                VerifyTitle("Offices");

                executionLog.Log("CorporatePortal1", "Enter Name to search");
                corpOffice_OfficeHelper.TypeText("EnterSelenium", Office);
                corpOffice_OfficeHelper.WaitForWorkAround(5000);

                executionLog.Log("CorporatePortal1", "Click Delete btn  ");
                corpOffice_OfficeHelper.ClickElement("DeleteOffice");
                corpOffice_OfficeHelper.WaitForWorkAround(4000);

                executionLog.Log("CorporatePortal1", "Verify page text");
                corpOffice_OfficeHelper.VerifyPageText("Are you sure want to delete the");
                corpOffice_OfficeHelper.WaitForWorkAround(4000);

                executionLog.Log("CorporatePortal1", "Click Delete btn  ");
                corpOffice_OfficeHelper.ClickElement("ConfirmDelete");
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("CorporatePortal1", "Accept alert message. ");
                corpOffice_OfficeHelper.AcceptAlert();
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("CorporatePortal1", "Wait for delete message. ");
                corpOffice_OfficeHelper.WaitForText("Office deleted successfully.", 50);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

            var oXMLData = new XMLParse();

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

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


            // Initializing the objects
            var executionLog            = new ExecutionLog();
            var loginHelper             = new LoginHelper(GetWebDriver());
            var corpOffice_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

            //Variable random
            var    usernme = "TESTUSER" + RandomNumber(676, 99999);
            var    name    = "DeleteOffice" + GetRandomNumber();
            String JIRA    = "";
            String Status  = "Pass";

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

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

                executionLog.Log("DeleteOffice", "Redirect at office page.");
                VisitCorp("offices");
                corpOffice_OfficeHelper.WaitForWorkAround(4000);

                executionLog.Log("DeleteOffice", "Click on create button.");
                corpOffice_OfficeHelper.ClickElement("Create");
                corpOffice_OfficeHelper.WaitForWorkAround(4000);

                executionLog.Log("DeleteOffice", "Enter Name");
                corpOffice_OfficeHelper.TypeText("Name", name);

                executionLog.Log("DeleteOffice", "Enter DBAName");
                corpOffice_OfficeHelper.TypeText("DBAName", "TEST123");

                executionLog.Log("DeleteOffice", "Enter Website");
                corpOffice_OfficeHelper.TypeText("Website", "TEST.COM");

                executionLog.Log("DeleteOffice", "Enter VenderName");
                corpOffice_OfficeHelper.TypeText("VendorName", "VenderTEST");

                executionLog.Log("DeleteOffice", "Enter Vendor code");
                corpOffice_OfficeHelper.TypeText("VendorCode", "1234");

                executionLog.Log("DeleteOffice", "Enter Phone number ");
                corpOffice_OfficeHelper.TypeText("OfficePhoneNumber", "1234567890");

                executionLog.Log("DeleteOffice", "Enter Business number");
                corpOffice_OfficeHelper.TypeText("BusinessPhoneNumber", "1234567890");

                executionLog.Log("DeleteOffice", "Enter Fax number");
                corpOffice_OfficeHelper.TypeText("FaxNumber", "1234567890");

                executionLog.Log("DeleteOffice", "Enter Linked URL");
                corpOffice_OfficeHelper.TypeText("LinkedURL", "Linked.com");

                executionLog.Log("DeleteOffice", "Enter Facebook url");
                corpOffice_OfficeHelper.TypeText("FacebookURL", "Facebook.com");

                executionLog.Log("DeleteOffice", "Enter TwitterURL");
                corpOffice_OfficeHelper.TypeText("TwitterURL", "Twitter.com");

                executionLog.Log("DeleteOffice", "Select Address");
                corpOffice_OfficeHelper.Select("AddressType", "Office");

                executionLog.Log("DeleteOffice", "Enter AddressLine1");
                corpOffice_OfficeHelper.TypeText("AddressLine1", "FC-89");

                executionLog.Log("DeleteOffice", "Enter Zip Code");
                corpOffice_OfficeHelper.TypeText("ZIpCode", "60601");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("DeleteOffice", "Enter PrimaryUserName");
                corpOffice_OfficeHelper.TypeText("PrimaryUserName", usernme);

                executionLog.Log("DeleteOffice", "Click on AutoGenPassword checkbox");
                corpOffice_OfficeHelper.ClickElement("AutoGenPassword");

                executionLog.Log("DeleteOffice", "Enter PrimaryPassword");
                corpOffice_OfficeHelper.TypeText("PrimaryPassword", "1qaz!QAZ");

                executionLog.Log("DeleteOffice", "Select Salutation");
                corpOffice_OfficeHelper.Select("Salutation", "Mr");
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("DeleteOffice", "Enter FirstName");
                corpOffice_OfficeHelper.TypeText("FirstName", "Test");

                executionLog.Log("DeleteOffice", "Enter LastName");
                corpOffice_OfficeHelper.TypeText("LastName", "Tester");

                executionLog.Log("DeleteOffice", "Enter eAddress");
                corpOffice_OfficeHelper.TypeText("eAddress", "*****@*****.**");

                executionLog.Log("DeleteOffice", "Click on save");
                corpOffice_OfficeHelper.ClickElement("Save");

                executionLog.Log("DeleteOffice", "Verify text on the page");
                corpOffice_OfficeHelper.WaitForText("Office created successfully.", 70);

                executionLog.Log("DeleteOffice", "Search office by name.");
                corpOffice_OfficeHelper.TypeText("EnterNameToSearch", name);
                corpOffice_OfficeHelper.WaitForWorkAround(5000);

                executionLog.Log("DeleteOffice", "Click on delete.");
                corpOffice_OfficeHelper.ClickElement("DeleteOffice");
                corpOffice_OfficeHelper.WaitForWorkAround(3000);

                executionLog.Log("DeleteOffice", "Click on confirm delete.");
                corpOffice_OfficeHelper.ClickElement("ConfirmDelete");
                corpOffice_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("DeleteOffice", "verify messsage Office deleted successfully.");
                corpOffice_OfficeHelper.WaitForText("Office deleted successfully.", 70);
            }
            catch (Exception e)
            {
                Console.WriteLine("ERRROROOR");
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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


            var oXMLData = new XMLParse();

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

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



            // Initializing the objects
            var executionLog             = new ExecutionLog();
            var loginHelper              = new LoginHelper(GetWebDriver());
            var corp_Office_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());
            var yopmail_Helper           = new YopMailHelper(GetWebDriver());
            var office_Common_Layout     = new OfficeCommonLayoutHelper(GetWebDriver());
            var office_Admin_Layout      = new OfficeAdminCommonLayoutHelper(GetWebDriver());


            //  Variable random

            String JIRA       = "";
            String Status     = "Pass";
            var    officename = "Office" + RandomNumber(1, 999999999);
            var    username1  = "user" + RandomNumber(1, 9999);

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

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Page title");
            VerifyTitle("Dashboard");
            Console.WriteLine("Redirected to Dashboard");

            executionLog.Log("VerifyOfficeWithAllModules", "Create Office");
            VisitCorp("offices");
            Console.WriteLine("Redirected to All Office page");

            executionLog.Log("VerifyOfficeWithAllModules", "Click on Create button");
            corp_Office_OfficeHelper.ClickElement("Create");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify page title");
            VerifyTitle("Create an Office");

            executionLog.Log("VerifyOfficeWithAllModules", "Enter Office name");
            corp_Office_OfficeHelper.TypeText("Name", officename);

            executionLog.Log("VerifyOfficeWithAllModules", "Enter Address Line 1");
            corp_Office_OfficeHelper.TypeText("AddressLine1", "Add 1");

            executionLog.Log("VerifyOfficeWithAllModules", "Enter Zip Code");
            corp_Office_OfficeHelper.TypeText("ZIpCode", "20001");
            corp_Office_OfficeHelper.WaitForWorkAround(3000);

            executionLog.Log("VerifyOfficeWithAllModules", "Deselect Auto generate password check box");
            corp_Office_OfficeHelper.ClickElement("AutoGenPassword");
            corp_Office_OfficeHelper.WaitForWorkAround(1000);

            executionLog.Log("VerifyOfficeWithAllModules", "Enter Username");
            corp_Office_OfficeHelper.TypeText("PrimaryUserName", username1);

            executionLog.Log("VerifyOfficeWithAllModules", "Enter Password");
            corp_Office_OfficeHelper.TypeText("PrimaryPassword", "123456");

            executionLog.Log("VerifyOfficeWithAllModules", "Enter First Name");
            corp_Office_OfficeHelper.TypeText("FirstName", "Test");

            executionLog.Log("VerifyOfficeWithAllModules", "Enter Last Name");
            corp_Office_OfficeHelper.TypeText("LastName", "User");

            executionLog.Log("VerifyOfficeWithAllModules", "Select eAddress label");
            corp_Office_OfficeHelper.Select("EaddressLabel", "Home");

            executionLog.Log("VerifyOfficeWithAllModules", "Enter eAddress");
            corp_Office_OfficeHelper.TypeText("eAddress", "*****@*****.**");
            Console.WriteLine("Entered eAddress");


            executionLog.Log("VerifyOfficeWithAllModules", "Click on Save");
            try
            {
                corp_Office_OfficeHelper.ClickElement("Save");
            }
            catch (OpenQA.Selenium.WebDriverException)
            { }

            Console.WriteLine("Office Created");

            executionLog.Log("VerifyOfficeWithAllModules", "Go to yopmail.com");
            GetWebDriver().Navigate().GoToUrl("http://www.yopmail.com/en/");
            Console.WriteLine("Redirected to yopmail.com");

            executionLog.Log("VerifyOfficeWithAllModules", "Enter eAddress in yopmail");
            yopmail_Helper.TypeText("Yopmail", "aslam.pegasus");

            executionLog.Log("VerifyOfficeWithAllModules", "Check Inbox");
            yopmail_Helper.ClickElement("YopmailClick");

            yopmail_Helper.switchFrame("ifmail");

            yopmail_Helper.VerifyText("MailSecondPoint", username1);

            executionLog.Log("VerifyOfficeWithAllModules", "Click on Office Link");
            yopmail_Helper.ClickElement("OfficeLink");
            corp_Office_OfficeHelper.SwitchToWindow();

            yopmail_Helper.WaitForWorkAround(5000);

            executionLog.Log("VerifyOfficeWithAllModules", "Click on Profile Icon");
            corp_Office_OfficeHelper.ClickElement("ProfileIcon");

            executionLog.Log("VerifyOfficeWithAllModules", "Click on Logout");
            corp_Office_OfficeHelper.ClickElement("Logout");
            Console.WriteLine("Redirected to Login Screen");

            executionLog.Log("VerifyOfficeWithAllModules", "Enter Username");
            loginHelper.TypeText("Login/Username", username1);

            executionLog.Log("VerifyOfficeWithAllModules", "Enter Last Name");
            loginHelper.TypeText("Login/Password", "123456");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Office");
            loginHelper.ClickElement("Login/Enter");
            Console.WriteLine("Logged into new office");

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

            executionLog.Log("VerifyOfficeWithAllModules", "Click on Hamburger Icon");
            office_Common_Layout.ClickElement("HamburgerIcon");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Home Module");
            office_Common_Layout.ElementVisible("HomeTab");
            Console.WriteLine("Home Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Opportunities Module");
            office_Common_Layout.ElementVisible("OpportunitiesTab");
            Console.WriteLine("Opportunity Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Leads Module");
            office_Common_Layout.ElementVisible("LeadsTab");
            Console.WriteLine("Leads Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Merchants Module");
            office_Common_Layout.ElementVisible("ClientsTab");
            Console.WriteLine("Merchants Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Contacts Module");
            office_Common_Layout.ElementVisible("ContactsTab");
            Console.WriteLine("Contacts Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Activities Module");
            office_Common_Layout.ElementVisible("ActivitiesTab");
            Console.WriteLine("Activities Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Tickets Module");
            office_Common_Layout.ElementVisible("TicketsTab");
            Console.WriteLine("Tickets Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Agents Module");
            office_Common_Layout.ElementVisible("AgentsTab");
            Console.WriteLine("Agents Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Residual Income Module");
            office_Common_Layout.ElementVisible("ResidualIncomeTab");
            Console.WriteLine("Residual Income Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Reports Module");
            office_Common_Layout.ElementVisible("ReportsTab");
            Console.WriteLine("Reports Module is present");

            office_Common_Layout.ScrollDown("//ul[@id='menu']/li[13]");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Dashboards Module");
            office_Common_Layout.ElementVisible("Dashboards");
            Console.WriteLine("Dashboards Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Redirect To Admin");
            VisitOffice("admin");
            office_Common_Layout.WaitForWorkAround(4000);
            Console.WriteLine("Redirected to Admin Site");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Office Module");
            office_Admin_Layout.ElementVisible("Office");
            Console.WriteLine("Office Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Corporate Module");
            office_Admin_Layout.ElementVisible("Corporate");
            Console.WriteLine("Corporate Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Master Data Module");
            office_Admin_Layout.ElementVisible("MasterDataTab");
            Console.WriteLine("Master Data Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Statistics Module");
            office_Admin_Layout.ElementVisible("StatisticsTab");
            Console.WriteLine("Statistics Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Tickets Module");
            office_Admin_Layout.ElementVisible("TicketsTab");
            Console.WriteLine("Tickets Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify System Module");
            office_Admin_Layout.ElementVisible("System");
            Console.WriteLine("System Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Integrations Module");
            office_Admin_Layout.ElementVisible("IntegrationsTab");
            Console.WriteLine("Integrations Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Products Module");
            office_Admin_Layout.ElementVisible("ProductsTab");
            Console.WriteLine("Products Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify PDF Templates Module");
            office_Admin_Layout.ElementVisible("PDFTemplatesTab");
            Console.WriteLine("PDF Templates Module is present");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Equipment Module");
            office_Admin_Layout.ElementVisible("EquipmentTab");
            Console.WriteLine("Equipment Module is present");

            office_Admin_Layout.ScrollDown("//ul[@id='menu']/li[13]");

            executionLog.Log("VerifyOfficeWithAllModules", "Verify Field Dictionary Module");
            office_Admin_Layout.ElementVisible("FieldDicTab");
            Console.WriteLine("Field Dictionary Module is present");


            //}
            //catch (Exception e)
            //{
            //}
        }
コード例 #12
0
        public void officeStateVerifyCorp()
        {
            string[] username = null;
            string[] password = null;


            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog             = new ExecutionLog();
            var loginHelper              = new LoginHelper(GetWebDriver());
            var corp_Office_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

            // Variable random
            var    Email  = "addressTest" + GetRandomNumber() + "@yop.com";
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("OfficeStateVerifyCorp", "Craete Office");
                VisitCorp("offices/create");

                executionLog.Log("OfficeStateVerifyCorp", "Verify Page title");
                VerifyTitle("Create an Office");

                executionLog.Log("OfficeStateVerifyCorp", "Enter Name");
                corp_Office_OfficeHelper.TypeText("Name", "Office OFFICE");

                executionLog.Log("OfficeStateVerifyCorp", "Enter Address");
                corp_Office_OfficeHelper.Select("AddressType", "Office");

                executionLog.Log("OfficeStateVerifyCorp", "Enter AddressLine1");
                corp_Office_OfficeHelper.TypeText("AddressLine1", "FC-89");

                corp_Office_OfficeHelper.TypeText("ZIpCode", "60601");
                corp_Office_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("OfficeStateVerifyCorp", "Enter Username");
                corp_Office_OfficeHelper.TypeText("PrimaryUserName", "Tes");

                executionLog.Log("OfficeStateVerifyCorp", "Enter First NAME");
                corp_Office_OfficeHelper.TypeText("FirstName", "User");

                executionLog.Log("OfficeStateVerifyCorp", "Enter Last Name");
                corp_Office_OfficeHelper.TypeText("LastName", "Test");

                executionLog.Log("OfficeStateVerifyCorp", "Enter eAddress");
                corp_Office_OfficeHelper.TypeText("eAddress", Email);

                executionLog.Log("OfficeStateVerifyCorp", " Click on Save");
                corp_Office_OfficeHelper.ClickElement("Save");
                corp_Office_OfficeHelper.WaitForWorkAround(5000);

                executionLog.Log("OfficeStateVerifyCorp", "Verify text on the page");
                corp_Office_OfficeHelper.VerifyText("SelectState", "IL");
                corp_Office_OfficeHelper.WaitForWorkAround(3000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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


            var oXMLData = new XMLParse();

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

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

            // Initializing the objects
            var executionLog             = new ExecutionLog();
            var loginHelper              = new LoginHelper(GetWebDriver());
            var corp_Office_OfficeHelper = new CorpOffice_OfficeHelper(GetWebDriver());

            // Variable random
            var    Office = "Test" + GetRandomNumber();
            var    User   = "******" + GetRandomNumber();
            var    Email  = "addressTest" + RandomNumber(1, 99) + "@yop.com";
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("OfficeEadresslabelAutoPopUpIssue", "Redirect at Create Office page");
                VisitCorp("offices/create");

                executionLog.Log("OfficeEadresslabelAutoPopUpIssue", "Verify page title");
                VerifyTitle("Create an Office");

                executionLog.Log("OfficeEadresslabelAutoPopUpIssue", "Enter office name.");
                corp_Office_OfficeHelper.TypeText("Name", Office);

                executionLog.Log("OfficeEadresslabelAutoPopUpIssue", "Select Address type.");
                corp_Office_OfficeHelper.Select("AddressType", "Office");

                executionLog.Log("OfficeEadresslabelAutoPopUpIssue", "Enter AddressLine1");
                corp_Office_OfficeHelper.TypeText("AddressLine1", "FC-89");

                executionLog.Log("OfficeEadresslabelAutoPopUpIssue", "Enter Zip Code.");
                corp_Office_OfficeHelper.TypeText("ZIpCode", "60601");
                corp_Office_OfficeHelper.WaitForWorkAround(1000);

                executionLog.Log("OfficeEadresslabelAutoPopUpIssue", "Enter a valid user name.");
                corp_Office_OfficeHelper.TypeText("PrimaryUserName", User);

                executionLog.Log("OfficeEadresslabelAutoPopUpIssue", "Enter First name.");
                corp_Office_OfficeHelper.TypeText("FirstName", "User");

                executionLog.Log("OfficeEadresslabelAutoPopUpIssue", "Enter Last Name");
                corp_Office_OfficeHelper.TypeText("LastName", "Test");

                executionLog.Log("OfficeEadresslabelAutoPopUpIssue", "Enter eAddress");
                corp_Office_OfficeHelper.TypeText("eAddress", Email);

                executionLog.Log("OfficeEadresslabelAutoPopUpIssue", " Click on Save button.");
                corp_Office_OfficeHelper.ClickElement("Save");

                executionLog.Log("OfficeEadresslabelAutoPopUpIssue", "Verify text on the page");
                corp_Office_OfficeHelper.WaitForText("Office created successfully.", 10);

                executionLog.Log("OfficeEadresslabelAutoPopUpIssue", "Enter office name to be Searched.");
                corp_Office_OfficeHelper.TypeText("EnterSelenium", Office);
                corp_Office_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("OfficeEadresslabelAutoPopUpIssue", "Click on edit icon.");
                corp_Office_OfficeHelper.ClickElement("EditOffice");
                corp_Office_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("OfficeEadresslabelAutoPopUpIssue", " Click on add email.");
                corp_Office_OfficeHelper.ClickElement("EditAddEmail");

                executionLog.Log("OfficeEadresslabelAutoPopUpIssue", "Select email type as weblink.");
                corp_Office_OfficeHelper.Select("EmailType2", "Web Links");
                corp_Office_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("OfficeEadresslabelAutoPopUpIssue", " Enter email in added email field.");
                corp_Office_OfficeHelper.TypeText("EnterEmail2", "*****@*****.**");

                executionLog.Log("OfficeEadresslabelAutoPopUpIssue", "Click on save button.");
                corp_Office_OfficeHelper.ClickElement("SaveEdit");
                corp_Office_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("OfficeEadresslabelAutoPopUpIssue", "Click on edit link to edit office..");
                corp_Office_OfficeHelper.ClickElement("EditLink");
                corp_Office_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("OfficeEadresslabelAutoPopUpIssue", "Verify e address label for added email is weblink.");
                corp_Office_OfficeHelper.VerifyeLabel("VerifyLabel2");
                corp_Office_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("OfficeEadresslabelAutoPopUpIssue", "Click on save button.");
                corp_Office_OfficeHelper.ClickElement("SaveEdit");
                corp_Office_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("OfficeEadresslabelAutoPopUpIssue", "Enter office name to be Searched.");
                VisitCorp("offices");
                corp_Office_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("OfficeEadresslabelAutoPopUpIssue", "Enter office name to be Searched.");
                corp_Office_OfficeHelper.TypeText("EnterSelenium", Office);
                corp_Office_OfficeHelper.WaitForWorkAround(2000);

                executionLog.Log("OfficeEadresslabelAutoPopUpIssue", "Click on Delete icon");
                corp_Office_OfficeHelper.ClickElement("DeleteOffice");

                executionLog.Log("OfficeEadresslabelAutoPopUpIssue", "Click Delete to confirm");
                corp_Office_OfficeHelper.ClickElement("ConfirmDelete");

                executionLog.Log("OfficeEadresslabelAutoPopUpIssue", "Wait for success message.");
                corp_Office_OfficeHelper.WaitForText("Office deleted successfully", 30);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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