Esempio n. 1
0
        public void verifyQuickLookLabelsForLeads()
        {
            string[] username = null;
            string[] password = null;

            var oXMLData = new XMLParse();

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

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

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

            // Variable
            var    name   = "Lead" + RandomNumber(99, 99999);
            var    CDBA   = "DBA" + RandomNumber(99, 99999);
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("VerifyQuickLookLabelsForLeads", "Redirect at Create Lead");
                VisitOffice("leads/create");

                executionLog.Log("VerifyQuickLookLabelsForLeads", "Click on Save");
                office_LeadsHelper.ClickElement("SaveLeadNewSkin");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForLeads", "Enter First Name");
                office_LeadsHelper.TypeText("FirstNameLead", "LeadFirst");

                executionLog.Log("VerifyQuickLookLabelsForLeads", "Enter Last Name");
                office_LeadsHelper.TypeText("LeadLastName", "LeadLast");

                executionLog.Log("VerifyQuickLookLabelsForLeads", "Enter Lead Company DBA Name");
                office_LeadsHelper.TypeText("CompanyName", CDBA);

                executionLog.Log("VerifyQuickLookLabelsForLeads", "Wait for element to be visible.");
                office_LeadsHelper.WaitForElementPresent("LeadStatus", 10);

                executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Lead Status");
                office_LeadsHelper.SelectByText("LeadStatus", "New");

                executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Responsibilities");
                office_LeadsHelper.SelectByText("Responsibility", "Howard Tang");

                executionLog.Log("VerifyQuickLookLabelsForLeads", "Click on Save");
                office_LeadsHelper.ClickElement("SaveLeadNewSkin");
                office_LeadsHelper.WaitForWorkAround(7000);


                var loc = "//h3[text()='Existing Leads']";
                if (office_LeadsHelper.IsElementPresent(loc))
                {
                    Console.WriteLine("We are in first If cond as lead is duplicate !!");
                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Click on Duplicate");
                    office_LeadsHelper.ClickJS("CraeteLeadDub");
                    office_LeadsHelper.WaitForText("Lead saved successfully.", 10);
                }
                else
                {
                    Console.WriteLine("We are in first else cond as lead is not duplicate !!");
                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Wait for Confirmation");
                    office_LeadsHelper.WaitForText("Lead saved successfully.", 10);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for Leads type.");
                    office_LeadsHelper.VerifyText("ClientType", "Click to edit");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for status.");
                    office_LeadsHelper.VerifyText("Status", "New");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for source.");
                    office_LeadsHelper.VerifyText("Source", "Select");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for category");
                    office_LeadsHelper.VerifyText("Category", "Click to edit");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for responsibility");
                    office_LeadsHelper.VerifyText("Responsibilityl", "Howard Tang");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for account manager.");
                    office_LeadsHelper.VerifyText("AccountManager", "Select");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for partner agent.");
                    office_LeadsHelper.VerifyText("PartnerAgentl", "Select");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Save Button");
                    office_LeadsHelper.VerifyText("PartnerAssociationl", "Select");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Save Button");
                    office_LeadsHelper.VerifyText("SalesManager", "Select");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Click on company details tab.");
                    office_LeadsHelper.ClickElement("CompanyDetails");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Click on assignments.");
                    office_LeadsHelper.ClickElement("EditAssignment");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Wait for locator to be present.");
                    office_LeadsHelper.WaitForElementPresent("Clientt", 10);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Leads type.");
                    office_LeadsHelper.Select("Clientt", "Processing");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Leads refferal source.");
                    office_LeadsHelper.Select("SelectSource", "Campaign");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Leads category.");
                    office_LeadsHelper.SelectByText("SelectCat", "test");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select account manager.");
                    office_LeadsHelper.SelectByText("SelectAcc.Mgr", "Howard Tang");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Leads user group.");
                    office_LeadsHelper.Select("Ugroup", "81");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select sales manager.");
                    office_LeadsHelper.SelectByText("SelectSaleManager", "Howard Tang");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select Leads responsibility");
                    office_LeadsHelper.SelectByText("Responsibility", "Howard Tang");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select partner agent.");
                    office_LeadsHelper.SelectByText("PartnerAgent", "Mark Matthews");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select partner association.");
                    office_LeadsHelper.SelectByText("PartnerAssociation", "AslamP.Association.");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "click on save Leads");
                    office_LeadsHelper.ClickElement("SaveLead");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "click on info tab.");
                    office_LeadsHelper.ClickElement("InfoTab");

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Wait for locator to be present.");
                    office_LeadsHelper.WaitForElementPresent("ClientsType", 10);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for Leads type.");
                    office_LeadsHelper.VerifyText("ClientsType", "Processing");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for status.");
                    office_LeadsHelper.VerifyText("Status", "New");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for source.");
                    office_LeadsHelper.VerifyText("Source", "Campaign");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for category.");
                    office_LeadsHelper.VerifyText("Category", "test");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for responsibility.");
                    office_LeadsHelper.VerifyText("Responsibilityl", "Howard Tang");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for account manager.");
                    office_LeadsHelper.VerifyText("AccountManager", "Howard Tang");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for partner agent.");
                    office_LeadsHelper.VerifyText("PartnerAgentl", "Mark Matthews");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for partner association.");
                    office_LeadsHelper.VerifyText("PartnerAssociationl", "AslamP.Association.");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Verify label for partner association.");
                    office_LeadsHelper.VerifyText("SalesManager", "Howard Tang");
                    office_LeadsHelper.WaitForWorkAround(3000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Redirect To leads page. ");
                    VisitOffice("leads");

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Enter Company Name");
                    office_LeadsHelper.TypeText("CompanySearch", CDBA);
                    office_LeadsHelper.WaitForWorkAround(2000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Select lead by check box");
                    office_LeadsHelper.ClickElement("ClickOn1stOpp");
                    office_LeadsHelper.WaitForWorkAround(2000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Click on delete lead");
                    office_LeadsHelper.ClickElement("DeleteLead");

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

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Wait for success message.");
                    office_LeadsHelper.WaitForText("1 records deleted successfully", 10);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Redirect To leads recycle bin page. ");
                    VisitOffice("leads/recyclebin");

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Enter Company Name");
                    office_LeadsHelper.TypeText("SearchLeadRbin", CDBA);
                    office_LeadsHelper.WaitForWorkAround(2000);

                    executionLog.Log("VerifyQuickLookLabelsForLeads", "Click on delete leads");
                    office_LeadsHelper.ClickElement("DeleteRbin");

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

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

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

            var oXMLData = new XMLParse();

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

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

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

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

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

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

                executionLog.Log("VerifyIconAndLabelForLeads", "Visit Leads page.");
                VisitOffice("leads");

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

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify page title.");
                VerifyTitle("Leads");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify delete icon available.");
                office_LeadsHelper.IsElementPresent("DeleteIcon");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify delete label available.");
                office_LeadsHelper.IsElementPresent("DeleteLabel");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Click on delete button.");
                office_LeadsHelper.ClickElement("DeleteLabel");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Decline alert message.");
                office_LeadsHelper.DeclineAlert();
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify bulk update icon.");
                office_LeadsHelper.IsElementPresent("BUlkUpdateIcon");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify bulk update label.");
                office_LeadsHelper.IsElementPresent("BulkUpdateLabel");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Click on bulk update button.");
                office_LeadsHelper.ClickForce("BulkUpdateLabel");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Click on sales manager.");
                office_LeadsHelper.ClickElement("ChangeSaleManager");
                office_LeadsHelper.WaitForWorkAround(2000);

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

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

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify advance filter icon.");
                office_LeadsHelper.IsElementPresent("AdvanceFilIcon");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify advanced filter label.");
                office_LeadsHelper.IsElementPresent("AdvancefiltLabel");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify page text.");
                office_LeadsHelper.VerifyPageText("Tracking Fields");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify create leads icon.");
                office_LeadsHelper.IsElementPresent("CreateIcon");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify create leads label.");
                office_LeadsHelper.IsElementPresent("CreateLabel");
                office_LeadsHelper.WaitForWorkAround(2000);

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

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify page title as create leads.");
                VerifyTitle("Create a Lead");

                executionLog.Log("VerifyIconAndLabelForLeads", "Visit opportunitities page.");
                VisitOffice("leads");

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

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify import icon present.");
                office_LeadsHelper.IsElementPresent("ImportIcon");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify import label present.");
                office_LeadsHelper.IsElementPresent("ImportLabel");
                office_LeadsHelper.WaitForWorkAround(2000);

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

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify browse button present on page.");
                office_LeadsHelper.IsElementPresent("BrowseFile");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Visit opportunitities page.");
                VisitOffice("leads");

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

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify import icon present.");
                office_LeadsHelper.IsElementPresent("VcardIcon");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify import label present.");
                office_LeadsHelper.IsElementPresent("VcardLabel");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Click on import button.");
                office_LeadsHelper.ClickForce("VcardLabel");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify browse button present on page.");
                office_LeadsHelper.IsElementPresent("BrowseFile");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Visit Leads page.");
                VisitOffice("leads");

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

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify merge icon present on page.");
                office_LeadsHelper.IsElementPresent("MergeIcon");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify merge label present on page.");
                office_LeadsHelper.IsElementPresent("MergeLabel");
                office_LeadsHelper.WaitForWorkAround(2000);

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

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

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

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify export icon present on page.");
                office_LeadsHelper.IsElementPresent("ExportIcon");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Click on Export Icon");
                office_LeadsHelper.ClickJS("ExportIcon");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify the export label present");
                office_LeadsHelper.IsElementPresent("ExportLabel");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify export as csv present on page.");
                office_LeadsHelper.IsElementPresent("ExportCsv");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify the ");
                office_LeadsHelper.IsElementPresent("ExportExcel");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Click on export label present");
                office_LeadsHelper.ClickElement("ExportLabel");

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify recycle bin icon on the page.");
                office_LeadsHelper.IsElementPresent("RecycleBinIcon");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Click on recycle bin Icon");
                office_LeadsHelper.ClickJS("RecycleBinIcon");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify page title as recycled Leads.");
                office_LeadsHelper.VerifyPageText("Recycled Leads");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Visit Leads page.");
                VisitOffice("leads");
                office_LeadsHelper.WaitForWorkAround(3000);

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

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify all Leads button present on page.");
                office_LeadsHelper.IsElementPresent("AllLeads");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify my Leads button present on page.");
                office_LeadsHelper.IsElementPresent("MyLeads");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyIconAndLabelForLeads", "Verify my team's Leads button present on page.");
                office_LeadsHelper.IsElementPresent("MyTeamLeads");
                office_LeadsHelper.WaitForWorkAround(2000);

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

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

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

            var oXMLData = new XMLParse();

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

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

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

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

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

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

                executionLog.Log("LeadAndClientManagement", "Visit  Lead");
                VisitOffice("leads/create");

                executionLog.Log("LeadAndClientManagement", "Enter First Name");
                office_LeadsHelper.TypeText("FirstNameLead", FName);

                executionLog.Log("LeadAndClientManagement", "Enter Last Name");
                office_LeadsHelper.TypeText("LastName", LName);

                executionLog.Log("LeadAndClientManagement", "Enter Company DBA");
                office_LeadsHelper.TypeText("CompanyName", CDBA);

                executionLog.Log("LeadAndClientManagement", "Click on Assignments");
                office_LeadsHelper.ClickElement("Assignments");

                executionLog.Log("LeadAndClientManagement", "Wait for element to be visible.");
                office_LeadsHelper.WaitForElementPresent("LeadStatus", 10);

                executionLog.Log("LeadAndClientManagement", "Select Status");
                office_LeadsHelper.SelectByText("LeadStatus", "New");

                executionLog.Log("LeadAndClientManagement", "Select Responsibities");
                office_LeadsHelper.SelectByText("Responsibility", "Howard Tang");

                executionLog.Log("LeadAndClientManagement", "Click on Save");
                office_LeadsHelper.ClickElement("SaveLeadNewSkin");

                executionLog.Log("LeadAndClientManagement", "Wait for Confirmation");
                office_LeadsHelper.WaitForText("Lead saved successfully.", 10);

                executionLog.Log("LeadAndClientManagement", "Click on Convert");
                office_LeadsHelper.ClickElement("ClickOnConvert");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadAndClientManagement", "Click Save on Pop Up");
                office_LeadsHelper.ClickOnDisplayed("ClickonPopUpSave");

                executionLog.Log("LeadAndClientManagement", "Verify confirmation");
                office_LeadsHelper.WaitForText("Lead is converted and moved to recyclebin.", 10);

                executionLog.Log("LeadAndClientManagement", "Visit Lead");
                VisitOffice("leads");
                office_LeadsHelper.WaitForWorkAround(4000);

                executionLog.Log("LeadAndClientManagement", "Click Export");
                office_LeadsHelper.ClickElement("ClickOnExport");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadAndClientManagement", "Click Export As CSV");
                office_LeadsHelper.ClickElement("ExportAsCSVlEAD");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadAndClientManagement", "Goto Lead");
                VisitOffice("leads");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadAndClientManagement", "Click on Export");
                office_LeadsHelper.ClickElement("ClickOnExport");

                executionLog.Log("LeadAndClientManagement", "Click on Export as excel");
                office_LeadsHelper.ClickElement("ExportAsExcelLead");
                office_LeadsHelper.WaitForWorkAround(5000);
                office_LeadsHelper.AcceptAlert();

                executionLog.Log("LeadAndClientManagement", "Redirect To leads page. ");
                VisitOffice("leads");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadAndClientManagement", "Select the responsibility");
                office_LeadsHelper.SelectByText("SelectResponsibiltiy", "Howard Tang");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadAndClientManagement", "Select lead by check box");
                office_LeadsHelper.ClickElement("ClickOn1stOpp");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadAndClientManagement", "Click on delete lead");
                office_LeadsHelper.ClickJS("DeleteLead");

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

                executionLog.Log("LeadAndClientManagement", "Wait for success message.");
                office_LeadsHelper.WaitForText("1 records deleted successfully", 10);

                executionLog.Log("LeadAndClientManagement", "Goto Client");
                VisitOffice("clients");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadAndClientManagement", "Click on Export");
                office_ClientsHelper.ClickForce("ClickOnExport");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadAndClientManagement", "Click export AS Excel");
                office_ClientsHelper.ClickElement("ExportAsExcelLead");

                executionLog.Log("LeadAndClientManagement", "Go to create a Lead");
                VisitOffice("leads/create");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadAndClientManagement", "Enter First Name");
                office_LeadsHelper.TypeText("FirstNameLead", FName);

                executionLog.Log("LeadAndClientManagement", "Enter Last Name");
                office_LeadsHelper.TypeText("LastName", LName);

                executionLog.Log("LeadAndClientManagement", "Enter Company DBA Name");
                office_LeadsHelper.TypeText("CompanyName", CDBA);

                executionLog.Log("LeadAndClientManagement", "Click on Assignments");
                office_LeadsHelper.ClickElement("Assignments");

                executionLog.Log("LeadAndClientManagement", "Wait for element to be visible.");
                office_LeadsHelper.WaitForElementPresent("LeadStatus", 10);

                executionLog.Log("LeadAndClientManagement", "Select Status");
                office_LeadsHelper.SelectByText("LeadStatus", "New");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadAndClientManagement", "Responsibilities");
                office_LeadsHelper.SelectByText("Responsibility", "Howard Tang");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadAndClientManagement", "Click Save Button");
                office_LeadsHelper.ClickElement("SaveLeadNewSkin");

                executionLog.Log("LeadAndClientManagement", "Wait for Confirmation");
                office_LeadsHelper.WaitForText("Lead saved successfully.", 10);

                executionLog.Log("LeadAndClientManagement", "Click on Convert");
                office_LeadsHelper.ClickElement("ClickConvert");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadAndClientManagement", "Click on Convert");
                office_LeadsHelper.ClickJS("CancelConvert");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadAndClientManagement", "Click on Convert");
                office_LeadsHelper.ClickElement("ClickConvert");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadAndClientManagement", "Click on No");
                office_LeadsHelper.ClickDisplayed("//*[@id='LeadConversionDelete0']");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadAndClientManagement", "Click on Save");
                office_LeadsHelper.ClickOnDisplayed("ClickonPopUpSave");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadAndClientManagement", "Confirmation");
                office_LeadsHelper.VerifyPageText("Lead is converted successfully.");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadAndClientManagement", "Go to create a Lead");
                VisitOffice("leads/create");

                executionLog.Log("LeadAndClientManagement", "Enter First Name");
                office_LeadsHelper.TypeText("FirstNameLead", FName);

                executionLog.Log("LeadAndClientManagement", "Enter Last Name");
                office_LeadsHelper.TypeText("LastName", LName);

                executionLog.Log("LeadAndClientManagement", "Enter Company DBA Name");
                office_LeadsHelper.TypeText("CompanyName", CDBA);

                executionLog.Log("LeadAndClientManagement", "Click on Assignments");
                office_LeadsHelper.ClickElement("Assignments");

                executionLog.Log("LeadAndClientManagement", "Wait for element to be visible.");
                office_LeadsHelper.WaitForElementPresent("LeadStatus", 10);

                executionLog.Log("LeadAndClientManagement", "Select Status");
                office_LeadsHelper.SelectByText("LeadStatus", "New");

                executionLog.Log("LeadAndClientManagement", "Select Responsibility");
                office_LeadsHelper.SelectByText("Responsibility", "Howard Tang");

                executionLog.Log("LeadAndClientManagement", "Click onSave Button");
                office_LeadsHelper.ClickElement("SaveLeadNewSkin");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadAndClientManagement", "Click on Create duplicate lead");
                office_LeadsHelper.ClickElement("CreateDuplicate");

                executionLog.Log("LeadAndClientManagement", "Verify Confirmation");
                office_LeadsHelper.WaitForText("Lead saved successfully.", 10);

                executionLog.Log("LeadAndClientManagement", "Go to Lead");
                VisitOffice("leads");

                executionLog.Log("LeadAndClientManagement", "Click on First Lead To check");
                office_LeadsHelper.ClickElement("CheckDocToDel");

                executionLog.Log("LeadAndClientManagement", "Click on Delete button.");
                office_LeadsHelper.ClickElement("ClickDelLeadbutton");
                office_LeadsHelper.AcceptAlert();

                executionLog.Log("LeadAndClientManagement", "Verify Confirmation");
                office_LeadsHelper.WaitForText("1 records deleted successfully", 10);

                executionLog.Log("LeadAndClientManagement", "Goto leads/recyclebin ");
                VisitOffice("leads/recyclebin");

                executionLog.Log("LeadAndClientManagement", "Click Restore");
                office_LeadsHelper.ClickElement("ClickOnRestoreLeadIcon");

                executionLog.Log("LeadAndClientManagement", "Verify Confirmation");
                office_LeadsHelper.WaitForText("Lead Restored Successfully.", 10);

                executionLog.Log("LeadAndClientManagement", "Redirect To leads page. ");
                VisitOffice("leads");
                office_LeadsHelper.WaitForWorkAround(3000);

                executionLog.Log("LeadAndClientManagement", "Select lead by check box");
                office_LeadsHelper.ClickElement("ClickOn1stOpp");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadAndClientManagement", "Click on delete lead");
                office_LeadsHelper.ClickElement("DeleteLead");

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

                executionLog.Log("LeadAndClientManagement", "Wait for success message.");
                office_LeadsHelper.WaitForText("1 records deleted successfully", 10);

                executionLog.Log("LeadAndClientManagement", "Redirect To leads page. ");
                VisitOffice("leads");

                executionLog.Log("LeadAndClientManagement", "Select lead by check box");
                office_LeadsHelper.ClickElement("ClickOn1stOpp");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("LeadAndClientManagement", "Click on delete lead");
                office_LeadsHelper.ClickElement("DeleteLead");

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

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

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

            var oXMLData = new XMLParse();

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            var oXMLData = new XMLParse();

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

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

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

            // Variable

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

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

                executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Verify Page title");
                VerifyTitle("Dashboard");
                Console.WriteLine("Redirected at Dashboard screen.");
                office_LeadsHelper.WaitForWorkAround(6000);

                executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Goto Leads page.");
                VisitOffice("leads");
                office_LeadsHelper.WaitForWorkAround(6000);

                executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Open Advance filter.");
                office_LeadsHelper.ClickElement("AdvanceFilter");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Select Result Page per 10.");
                office_LeadsHelper.SelectByText("ResultsPerPage", "10");

                executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Click on apply button.");
                office_LeadsHelper.ClickJS("Apply");

                executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Open Advance filter.");
                office_LeadsHelper.ClickElement("AdvanceFilter");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Open Reset button.");
                office_LeadsHelper.ClickElement("ResetAdvFilter");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Open Advance filter.");
                office_LeadsHelper.ClickElement("AdvanceFilter");
                office_LeadsHelper.WaitForWorkAround(2000);

                executionLog.Log("verifyDefaultValueOfPerPageDropdown", "Verify default value 100 in Result Per page dropdown.");
                office_LeadsHelper.VerifySelectedOption("//*[@id='pageresults']", "100");
            }


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

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