public void officeFieldDictionary()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

            // Initializing the objects5
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var office_FieldDictionary_SectionsHelper = new Office_FieldDictionary_SectionsHelper(GetWebDriver());
            var office_FieldDictionary_TabsHelper     = new Office_FieldDictionary_TabsHelper(GetWebDriver());

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

            // Variable
            var    TabNameFDic = "Test" + RandomNumber(99, 99999);
            var    FDNAME      = "Test" + RandomNumber(99, 99999) + "te";
            var    idsc        = "1" + RandomNumber(1, 99999);
            var    CDBA        = "New" + RandomNumber(99, 99999);
            String JIRA        = "";
            String Status      = "Pass";

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

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

                executionLog.Log("OfficeFieldDictionary", "Goto Office Tab");
                VisitOffice("tabs");

                executionLog.Log("OfficeFieldDictionary", "Click Add New Tab");
                office_FieldDictionary_TabsHelper.ClickElement("Create");
                office_FieldDictionary_TabsHelper.WaitForWorkAround(3000);

                executionLog.Log("OfficeFieldDictionary", "Enter Tab Name");
                office_FieldDictionary_TabsHelper.TypeText("Name", TabNameFDic);

                executionLog.Log("OfficeFieldDictionary", "Click on Save");
                office_FieldDictionary_TabsHelper.ClickOnDisplayed("Save");

                executionLog.Log("OfficeFieldDictionary", "Confirmation");
                office_FieldDictionary_TabsHelper.WaitForText("Tab Created Successfully", 10);

                executionLog.Log("OfficeFieldDictionary", "Goto Sections");
                VisitOffice("sections");

                executionLog.Log("OfficeFieldDictionary", "Click on Create Button");
                office_FieldDictionary_SectionsHelper.ClickElement("Create");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(4000);

                executionLog.Log("OfficeFieldDictionary", "Select Tab Name");
                office_FieldDictionary_SectionsHelper.SelectByText("TabName", TabNameFDic);

                executionLog.Log("OfficeFieldDictionary", "Enter Section Name");
                office_FieldDictionary_SectionsHelper.TypeText("Name", FDNAME);

                executionLog.Log("OfficeFieldDictionary", "Click Save");
                office_FieldDictionary_SectionsHelper.ClickOnDisplayed("Save");

                executionLog.Log("OfficeFieldDictionary", "Verify Alert text.");
                office_FieldDictionary_SectionsHelper.VerifyAlertText("Section Created Successfully");
                office_FieldDictionary_TabsHelper.AcceptAlert();
                office_FieldDictionary_TabsHelper.WaitForWorkAround(3000);

                executionLog.Log("OfficeFieldDictionary", "Goto Tabs");
                VisitOffice("tabs");

                executionLog.Log("OfficeFieldDictionary", "Click Edit");
                office_FieldDictionary_TabsHelper.ClickElement("ClickOnEditTabIcon");
                office_FieldDictionary_TabsHelper.WaitForWorkAround(3000);

                executionLog.Log("OfficeFieldDictionary", "Click Save Button");
                office_FieldDictionary_TabsHelper.Click("//*[@id='dialog_tabedit']//div[3]/button[1]");

                executionLog.Log("OfficeFieldDictionary", "Wait for Confirmation");
                office_FieldDictionary_TabsHelper.WaitForText("Tab Updated Successfully", 10);
            }

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

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

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

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

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

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

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

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

                executionLog.Log("VerifyCreatedSectionReflect", "Go to Field Dictionary Section page");
                VisitOffice("sections");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyCreatedSectionReflect", "Verify Title");
                VerifyTitle("Section Management");

                executionLog.Log("VerifyCreatedSectionReflect", "Select Module >> Clients");
                office_FieldDictionary_SectionsHelper.Selectbytext("SelectModule", "Clients");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyCreatedSectionReflect", "Select Tab >> Company Details");
                office_FieldDictionary_SectionsHelper.Selectbytext("SelectTab", "Company Details");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyCreatedSectionReflect", "Click on Create button");
                office_FieldDictionary_SectionsHelper.ClickElement("Create");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyCreatedSectionReflect", "Enter section name");
                office_FieldDictionary_SectionsHelper.TypeText("Name", secname);

                executionLog.Log("VerifyCreatedSectionReflect", "Click on Save button");
                office_FieldDictionary_SectionsHelper.ClickElement("Save");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(1000);
                office_FieldDictionary_SectionsHelper.AcceptAlert();
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(1000);

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

                executionLog.Log("VerifyCreatedSectionReflect", "Open any merchant");
                office_ClientsHelper.ClickElement("Client1");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyCreatedSectionReflect", "Go to Company Details");
                office_ClientsHelper.ClickElement("CompanyDetailsTab");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyCreatedSectionReflect", "Verify created section appearing");
                office_ClientsHelper.VerifyPageText(secname);

                executionLog.Log("VerifyCreatedSectionReflect", "Log out from the application");
                VisitOffice("logout");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";
                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyCreatedSectionReflect");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Created Section Reflect");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Created Section Reflect", "Bug", "Medium", "Field Section page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Created Section Reflect");
                        TakeScreenshot("VerifyCreatedSectionReflect");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyCreatedSectionReflect.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyCreatedSectionReflect");
                        string id            = loginHelper.getIssueID("Verify Created Section Reflect");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyCreatedSectionReflect.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Created Section Reflect"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Created Section Reflect");
                //    executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyCreatedSectionReflect");
                executionLog.WriteInExcel("Verify Created Section Reflect", Status, JIRA, "Field Management");
            }
        }
Example #3
0
        public void createLeadsSectionMasterData()
        {
            string[] username = null;
            string[] password = null;

            XMLParse oXMLData = new XMLParse();

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

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

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

            // Variable
            String name   = "Test" + GetRandomNumber();
            String num    = "Test" + GetRandomNumber();
            String JIRA   = "";
            String Status = "Pass";

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

                executionLog.Log("CreateLeadsSectionMasterData", "Verify Page title");
                VerifyTitle("Dashboard");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadsSectionMasterData", "Click On  Admin");
                VisitOffice("admin");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadsSectionMasterData", "Redirect To URL");
                VisitOffice("sections");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadsSectionMasterData", "Verify title");
                VerifyTitle("Section Management");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadsSectionMasterData", "Select lead");
                office_FieldDictionary_SectionsHelper.Selectbytext("SelectModule", "Leads");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadsSectionMasterData", "Click Create Btn");
                office_FieldDictionary_SectionsHelper.ClickElement("Create");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadsSectionMasterData", "Select TAB");
                office_FieldDictionary_SectionsHelper.Selectbytext("TabName", "Company Details");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(1000);

                executionLog.Log("CreateLeadsSectionMasterData", "Enter section Name");
                office_FieldDictionary_SectionsHelper.TypeText("Name", name);
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadsSectionMasterData", "Click on save button");
                office_FieldDictionary_SectionsHelper.ClickElement("Save");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadsSectionMasterData", "Accept Alert");
                office_FieldDictionary_SectionsHelper.AcceptAlert();
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadsSectionMasterData", "Click On Lead Tab ");
                VisitOffice("leads");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                VerifyTitle("Leads");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadsSectionMasterData", "Click On Any Lead");
                office_LeadsHelper.ClickElement("ClickAnyLead");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadsSectionMasterData", "Verify title");
                VerifyTitle("- Details");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                executionLog.Log("CreateLeadsSectionMasterData", "Click on Company Details Tab");
                office_LeadsHelper.ClickElement("CompanyDetails");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

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

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

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

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

            // Initializing the objects
            var executionLog = new ExecutionLog();
            var loginHelper  = new LoginHelper(GetWebDriver());
            var office_FieldDictionary_SectionsHelper = new Office_FieldDictionary_SectionsHelper(GetWebDriver());

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

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

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

                executionLog.Log("FieldDictionarySection", "Go to Field Dictionary Section page");
                VisitOffice("sections");

                executionLog.Log("FieldDictionarySection", "Verify Title");
                VerifyTitle("Section Management");

                executionLog.Log("FieldDictionarySection", "Click on Change tab button");
                office_FieldDictionary_SectionsHelper.ClickElement("FSChangeTab");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(3000);

                executionLog.Log("FieldDictionarySection", "Verify error not displayed");
                office_FieldDictionary_SectionsHelper.VerifyTextNotPresent("An Internal Error Has Occurred");

                executionLog.Log("FieldDictionarySection", "Click on Save button");
                office_FieldDictionary_SectionsHelper.ClickOnDisplayed("EditSave");
                office_FieldDictionary_SectionsHelper.WaitForWorkAround(2000);

                executionLog.Log("FieldDictionarySection", "Accept alert");
                office_FieldDictionary_SectionsHelper.AcceptAlert();

                executionLog.Log("FieldDictionarySection", "Verify error not displayed");
                office_FieldDictionary_SectionsHelper.VerifyTextNotPresent("An Internal Error Has Occurred");

                executionLog.Log("FieldDictionarySection", "Log out from the application");
                VisitOffice("logout");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";
                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("FieldDictionarySection");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Field Dictionary Section");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Field Dictionary Section", "Bug", "Medium", "Field Section page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Field Dictionary Section");
                        TakeScreenshot("FieldDictionarySection");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\FieldDictionarySection.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("FieldDictionarySection");
                        string id            = loginHelper.getIssueID("Field Dictionary Section");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\FieldDictionarySection.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Field Dictionary Section"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Field Dictionary Section");
                //    executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("FieldDictionarySection");
                executionLog.WriteInExcel("Field Dictionary Section", Status, JIRA, "Field Management");
            }
        }