public void editMyProfile()
        {
            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_MyProfileHelper = new Office_MyProfileHelper(GetWebDriver());

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

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

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

                executionLog.Log("EditMyProfile", "Redirect to my profile");
                VisitOffice("myprofile");
                office_MyProfileHelper.WaitForWorkAround(5000);

                executionLog.Log("EditMyProfile", "Click On EditProfile");
                office_MyProfileHelper.ClickElement("EditProfile");
                office_MyProfileHelper.WaitForWorkAround(5000);

                executionLog.Log("EditMyProfile", "Enter Zip Code");
                office_MyProfileHelper.TypeText("ZipCode", "60601");
                office_MyProfileHelper.WaitForWorkAround(3000);

                executionLog.Log("EditMyProfile", "Click on save button");
                office_MyProfileHelper.ClickElement("Save");

                executionLog.Log("EditMyProfile", "Verify Your profile has been successfully updated. ");
                office_MyProfileHelper.WaitForText("Your profile has been successfully updated.", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";
                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("EditMyProfile");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Edit My Profile");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Edit My Profile", "Bug", "Medium", "Profile page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Edit My Profile");
                        TakeScreenshot("EditMyProfile");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\EditMyProfile.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("EditMyProfile");
                        string id            = loginHelper.getIssueID("Edit My Profile");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\EditMyProfile.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Edit My Profile"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Edit My Profile");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("EditMyProfile");
                executionLog.WriteInExcel("Edit My Profile", Status, JIRA, "My Profile");
            }
        }
Beispiel #2
0
        public void loginError2()
        {
            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_MyProfileHelper = new Office_MyProfileHelper(GetWebDriver());
            String JIRA   = "";
            String Status = "Pass";

            try
            {
                executionLog.Log("LoginError2", "Verify title");
                VerifyTitle("Login");

                executionLog.Log("LoginError2", "Click on Verify my account");
                office_MyProfileHelper.ClickElement("VerifyAccount");

                executionLog.Log("LoginError2", "Enter username");
                office_MyProfileHelper.TypeText("VerifyUsername", "aa");

                executionLog.Log("LoginError2", "Click any where");
                office_MyProfileHelper.ClickElement("VerifyBody");

                executionLog.Log("LoginError2", "Click on Send email button");
                office_MyProfileHelper.ClickMultiple("VerifySend");
                office_MyProfileHelper.WaitForWorkAround(2000);

                executionLog.Log("LoginError2", "Accept Alert");
                office_MyProfileHelper.AcceptAlert();
                office_MyProfileHelper.WaitForWorkAround(2000);

                executionLog.Log("LoginError2", "Enter username");
                office_MyProfileHelper.TypeText("VerifyUsername", "aslamKhan");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("LoginError2");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Login Error 2");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Login Error 2", "Bug", "Medium", "Login page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Login Error 2");
                        TakeScreenshot("LoginError2");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\LoginError2.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("LoginError2");
                        string id            = loginHelper.getIssueID("Login Error 2");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\LoginError2.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Login Error 2"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Login Error 2");
                // executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("LoginError2");
                executionLog.WriteInExcel("Login Error 2", Status, JIRA, "Office");
            }
        }
Beispiel #3
0
        public void uplaodFileAfterDeleting()
        {
            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_MyProfileHelper = new Office_MyProfileHelper(GetWebDriver());

            // Variable
            var    name   = "Testing Subject" + GetRandomNumber();
            var    email  = "Test" + GetRandomNumber() + "@gmail.com";
            String JIRA   = "";
            String Status = "Pass";

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

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

                executionLog.Log("UplaodFileAfterDeleting", "Click On  Admin");
                VisitOffice("admin");

                executionLog.Log("UplaodFileAfterDeleting", "Redirect to My corp page.");
                VisitOffice("mycorp");
                office_MyProfileHelper.WaitForWorkAround(5000);

                executionLog.Log("UplaodFileAfterDeleting", "Click on add document link.");
                office_MyProfileHelper.ClickJS("AddDoc");
                office_MyProfileHelper.WaitForWorkAround(4000);

                executionLog.Log("UplaodFileAfterDeleting", "Enter Document name");
                office_MyProfileHelper.TypeText("DocName", "Test Document");

                executionLog.Log("UplaodFileAfterDeleting", "Upload File ");
                String Filename = GetPathToFile() + "index.jpg";
                office_MyProfileHelper.Upload("BrowseFile", Filename);

                executionLog.Log("UplaodFileAfterDeleting", "Delete uploaded file.");
                office_MyProfileHelper.ClickJS("RemoveFile");

                executionLog.Log("UplaodFileAfterDeleting", "Click on save button.");
                office_MyProfileHelper.ClickJS("SaveDoc");
                office_MyProfileHelper.WaitForWorkAround(6000);

                executionLog.Log("UplaodFileAfterDeleting", "Verify validation is displayed for attacment.");
                office_MyProfileHelper.VerifyText("VerifyValidation", "This field is required.");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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