public void documentsAdvanceFilterRelatedTo()
        {
            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 officeActivities_DocumentHelper = new OfficeActivities_DocumentHelper(GetWebDriver());

            // Variable
            var    DocName = "Test Exe" + GetRandomNumber();
            var    fileUpl = GetPathToFile() + "chrome.exe";
            String JIRA    = "";
            String Status  = "Pass";

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

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

                // Verify documents with clients.

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Redirect To URL");
                VisitOffice("documents");
                officeActivities_DocumentHelper.WaitForWorkAround(3000);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Verify page title.");
                VerifyTitle("Documents");
                //officeActivities_DocumentHelper.WaitForElementVisible("AdvanceFilter", 5);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Click on advance filter.");
                officeActivities_DocumentHelper.ClickElement("AdvanceFilter");
                officeActivities_DocumentHelper.WaitForWorkAround(2000);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "click document with activity type.");
                officeActivities_DocumentHelper.ClickForce("DocsWithClients");
                //officeActivities_DocumentHelper.WaitForWorkAround(3000);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Click on apply button.");
                officeActivities_DocumentHelper.ClickForce("Apply");
                officeActivities_DocumentHelper.WaitForWorkAround(3000);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Verify document present is related to clients");
                officeActivities_DocumentHelper.VerifyText("RelatedTo", "Merchants");

                //Verify documents with contacts.

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Redirect To URL");
                VisitOffice("documents");
                officeActivities_DocumentHelper.WaitForWorkAround(3000);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Verify page title.");
                VerifyTitle("Documents");
                //officeActivities_DocumentHelper.WaitForElementVisible("AdvanceFilter", 5);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Click on advance filter.");
                officeActivities_DocumentHelper.ClickForce("AdvanceFilter");
                officeActivities_DocumentHelper.WaitForWorkAround(2000);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Selct document related to contacts");
                officeActivities_DocumentHelper.ClickForce("DocsWithContacts");
                //officeActivities_DocumentHelper.WaitForWorkAround(3000);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Click on apply button.");
                officeActivities_DocumentHelper.ClickForce("Apply");
                officeActivities_DocumentHelper.WaitForWorkAround(3000);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Verify document present is related to contacts.");
                officeActivities_DocumentHelper.VerifyText("RelatedTo", "Contact");

                //Verify document with Leads.

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Redirect To URL");
                VisitOffice("documents");
                officeActivities_DocumentHelper.WaitForWorkAround(3000);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Verify page title.");
                VerifyTitle("Documents");
                //officeActivities_DocumentHelper.WaitForElementVisible("AdvanceFilter", 5);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Click on advance filter.");
                officeActivities_DocumentHelper.ClickForce("AdvanceFilter");
                officeActivities_DocumentHelper.WaitForWorkAround(2000);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "click on document with activity type.");
                officeActivities_DocumentHelper.ClickForce("DocsWithLeads");
                //officeActivities_DocumentHelper.WaitForWorkAround(3000);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Click on apply button.");
                officeActivities_DocumentHelper.ClickForce("Apply");
                officeActivities_DocumentHelper.WaitForWorkAround(5000);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Verify document present is related to leads.");
                officeActivities_DocumentHelper.VerifyText("RelatedTo", "Lead");

                // Verify document with meetings .

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Redirect To URL");
                VisitOffice("documents");
                officeActivities_DocumentHelper.WaitForWorkAround(3000);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Verify page title.");
                VerifyTitle("Documents");
                //officeActivities_DocumentHelper.WaitForElementVisible("AdvanceFilter", 5);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Click on advance filter.");
                officeActivities_DocumentHelper.ClickForce("AdvanceFilter");
                officeActivities_DocumentHelper.WaitForWorkAround(2000);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "click on document  with meetings.");
                officeActivities_DocumentHelper.ClickForce("DocsWithMeetings");
                //officeActivities_DocumentHelper.WaitForWorkAround(3000);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Click on apply button.");
                officeActivities_DocumentHelper.ClickForce("Apply");
                officeActivities_DocumentHelper.WaitForWorkAround(3000);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Verify docuemnt present is related to meetings.");
                officeActivities_DocumentHelper.VerifyText("RelatedTo", "Meeting");

                // Verify document with Opportunities .

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Redirect To URL");
                VisitOffice("documents");
                officeActivities_DocumentHelper.WaitForWorkAround(3000);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Verify page title.");
                VerifyTitle("Documents");
                //officeActivities_DocumentHelper.WaitForElementVisible("AdvanceFilter", 5);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Click on advance filter.");
                officeActivities_DocumentHelper.ClickForce("AdvanceFilter");
                officeActivities_DocumentHelper.WaitForWorkAround(2000);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "click on document  with opportunities.");
                officeActivities_DocumentHelper.ClickForce("DocsWithOppo");
                //officeActivities_DocumentHelper.WaitForWorkAround(3000);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Click on apply button.");
                officeActivities_DocumentHelper.ClickForce("Apply");
                officeActivities_DocumentHelper.WaitForWorkAround(3000);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Verify document present is related to opportunities.");
                officeActivities_DocumentHelper.VerifyText("RelatedTo", "Opportunities");

                // Verify document with tasks .

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Redirect To URL");
                VisitOffice("documents");
                officeActivities_DocumentHelper.WaitForWorkAround(3000);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Verify page title.");
                VerifyTitle("Documents");
                //officeActivities_DocumentHelper.WaitForElementVisible("AdvanceFilter", 5);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Click on advance filter.");
                officeActivities_DocumentHelper.ClickForce("AdvanceFilter");
                officeActivities_DocumentHelper.WaitForWorkAround(2000);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "click on document  with tasks.");
                officeActivities_DocumentHelper.ClickForce("DOcsWithTasks");
                //officeActivities_DocumentHelper.WaitForWorkAround(3000);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Click on apply button.");
                officeActivities_DocumentHelper.ClickForce("Apply");
                officeActivities_DocumentHelper.WaitForWorkAround(3000);

                executionLog.Log("DocumentsAdvanceFilterRelatedTo", "Verify document present is related to tasks.");
                officeActivities_DocumentHelper.VerifyText("RelatedTo", "Task");
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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

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

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

                executionLog.Log("VerifyDocumentsOnEmailAttachment", "Redirect at documents page.");
                VisitOffice("documents");
                officeActivities_DocumentHelper.WaitForWorkAround(3000);

                //officeActivities_DocumentHelper.TypeText("SearchDocumet", "Don't Delete");
                //officeActivities_DocumentHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyDocumentsOnEmailAttachment", "Click on any document");
                officeActivities_DocumentHelper.ClickElement("OpenDoc");
                officeActivities_DocumentHelper.WaitForWorkAround(3000);

                //executionLog.Log("VerifyDocumentsOnEmailAttachment", "Wait for locator to present.");
                //officeActivities_DocumentHelper.WaitForElementPresent("EmailThisDocument", 10);

                executionLog.Log("VerifyDocumentsOnEmailAttachment", "Click on add new version button");
                officeActivities_DocumentHelper.ClickElement("AddVersion");
                officeActivities_DocumentHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyDocumentsOnEmailAttachment", "Attach File");
                officeActivities_DocumentHelper.UploadFile("//*[@id='DocumentFile']", "E:/pegqa/Pegasus_New_skin/Files/Up.jpg");
                officeActivities_DocumentHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyDocumentsOnEmailAttachment", "Click on add new version button");
                officeActivities_DocumentHelper.TypeText("DocCommnet", "comment");
                //officeActivities_DocumentHelper.WaitForWorkAround(1000);

                executionLog.Log("VerifyDocumentsOnEmailAttachment", "Click on Save button");
                officeActivities_DocumentHelper.ClickElement("AddVersionSave");
                officeActivities_DocumentHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyDocumentsOnEmailAttachment", "Click on email this note.");
                officeActivities_DocumentHelper.ClickElement("EmailThisDocument");
                officeActivities_DocumentHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyDocumentsOnEmailAttachment", "Verify attached file is pdf file");
                officeActivities_DocumentHelper.VerifyText("VerifyEmailAttachment", "Up.jpg");
                //officeActivities_DocumentHelper.WaitForWorkAround(3000);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyDocumentsOnEmailAttachment");
                String Error       = executionLog.GetAllTextFile("Error");
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Verify Documents On Email Attachment");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Verify Documents On Email Attachment", "Bug", "Medium", "Documents page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("Verify Documents On Email Attachment");
                        TakeScreenshot("VerifyDocumentsOnEmailAttachment");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyDocumentsOnEmailAttachment.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyDocumentsOnEmailAttachment");
                        string id            = loginHelper.getIssueID("Verify Documents On Email Attachment");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\VerifyDocumentsOnEmailAttachment.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Verify Documents On Email Attachment"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Verify Documents On Email Attachment");
                //   executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyDocumentsOnEmailAttachment");
                executionLog.WriteInExcel("Verify Documents On Email Attachment", Status, JIRA, "Activities Management");
            }
        }
Exemplo n.º 3
0
        public void activitiesDocumentManagement2()
        {
            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 officeActivities_DocumentsHelper = new OfficeActivities_DocumentHelper(GetWebDriver());
            var office_ClientsHelper             = new Office_ClientsHelper(GetWebDriver());
            var office_LeadsHelper         = new Office_LeadsHelper(GetWebDriver());
            var office_OpportunitiesHelper = new Office_OpportunitiesHelper(GetWebDriver());
            var ticket_CreateATicketHelper = new OfficeTickets_CreateTicketsHelper(GetWebDriver());

            // Variable
            var    name        = "Doc" + RandomNumber(1, 9999);
            var    email       = "Test" + GetRandomNumber() + "@gmail.com";
            String ValidFile   = GetPathToFile() + "index.jpg";
            String InvalidFile = GetPathToFile() + "chrome.exe";
            String JIRA        = "";
            String Status      = "Pass";


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

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

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

                executionLog.Log("ActivitiesDocumentManagement2", "Redirect to create document page");
                VisitOffice("documents/create");

                executionLog.Log("ActivitiesDocumentManagement2", "verify title");
                VerifyTitle("Create a New Document");

                executionLog.Log("ActivitiesDocumentManagement2", "Click on Save button");
                officeActivities_DocumentsHelper.ClickElement("Save");

                executionLog.Log("ActivitiesDocumentManagement2", "Verify validation message for name.");
                officeActivities_DocumentsHelper.VerifyText("NameError", "This field is required.");

                executionLog.Log("ActivitiesDocumentManagement2", "Verify validation message for attachment.");
                officeActivities_DocumentsHelper.VerifyText("AttachmentError", "This field is required.");

                executionLog.Log("ActivitiesDocumentManagement2", "Enter Document name");
                officeActivities_DocumentsHelper.TypeText("Name", name);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on document version");
                officeActivities_DocumentsHelper.ClickElement("DocumentVersion");

                executionLog.Log("ActivitiesDocumentManagement2", "Upload an invalid File ");
                officeActivities_DocumentsHelper.Upload("BrowseAttachment", InvalidFile);

                executionLog.Log("ActivitiesDocumentManagement2", "Verify alert message for invalid file.");
                officeActivities_DocumentsHelper.VerifyAlertText("please select a valid file!");
                officeActivities_DocumentsHelper.AcceptAlert();

                executionLog.Log("ActivitiesDocumentManagement2", "Upload a valid File.");
                officeActivities_DocumentsHelper.Upload("BrowseAttachment", ValidFile);

                executionLog.Log("ActivitiesDocumentManagement2", "Select Assign owner");
                officeActivities_DocumentsHelper.SelectByText("AssignOwner", "Howard Tang");

                executionLog.Log("ActivitiesDocumentManagement2", "Select status");
                officeActivities_DocumentsHelper.Select("Status", "Active");

                executionLog.Log("ActivitiesDocumentManagement2", "Click on Save button");
                officeActivities_DocumentsHelper.ClickElement("Save");

                executionLog.Log("ActivitiesDocumentManagement2", "Wait for success message.");
                officeActivities_DocumentsHelper.WaitForText("Document saved successfully.", 10);

                executionLog.Log("ActivitiesDocumentManagement2", "Search document by name.");
                officeActivities_DocumentsHelper.TypeText("SearchDocumet", name);
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Select All in owner field");
                officeActivities_DocumentsHelper.SelectByText("OwnerField", "All");
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on edit icon.");
                officeActivities_DocumentsHelper.ClickElement("EditDoc");

                executionLog.Log("ActivitiesDocumentManagement2", "Select document related to.");
                officeActivities_DocumentsHelper.Select("ReletedTo", "18");
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on find list icon.");
                officeActivities_DocumentsHelper.ClickElement("Assign");
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on any meeting.");
                officeActivities_DocumentsHelper.ClickElement("AssignUser");
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on Save button");
                officeActivities_DocumentsHelper.ClickElement("Save");

                executionLog.Log("ActivitiesDocumentManagement2", "Wait for success message.");
                officeActivities_DocumentsHelper.WaitForText("Document updated successfully.", 10);

                executionLog.Log("ActivitiesDocumentManagement2", "Redirect at meetings page.");
                VisitOffice("meetings");

                executionLog.Log("ActivitiesDocumentManagement2", "Wait for locator to be present.");
                officeActivities_DocumentsHelper.WaitForElementPresent("ClickOnAnyMeeting", 10);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on any meeting.");
                office_ClientsHelper.ClickElement("ClickOnAnyMeeting");
                office_ClientsHelper.WaitForWorkAround(3000);

                VisitOffice("documents");
                office_ClientsHelper.WaitForWorkAround(3000);

                VerifyTitle("Documents");

                executionLog.Log("ActivitiesDocumentManagement2", "Search document by name.");
                officeActivities_DocumentsHelper.TypeText("SearchDocumet", name);
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Select All in owner field");
                officeActivities_DocumentsHelper.SelectByText("OwnerField", "All");
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on edit icon.");
                officeActivities_DocumentsHelper.ClickElement("EditDoc");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Select document related to.");
                officeActivities_DocumentsHelper.SelectByText("ReletedTo", "Client");
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on find list icon.");
                officeActivities_DocumentsHelper.ClickElement("Assign");
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on any task.");
                officeActivities_DocumentsHelper.ClickElement("AssignUser");
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on Save button");
                officeActivities_DocumentsHelper.ClickElement("Save");

                executionLog.Log("ActivitiesDocumentManagement2", "Wait for success message.");
                officeActivities_DocumentsHelper.WaitForText("Document updated successfully.", 10);

                executionLog.Log("ActivitiesDocumentManagement2", "Redirect at tasks page.");
                VisitOffice("tasks");

                executionLog.Log("ActivitiesDocumentManagement2", "Wait for locator to be present.");
                officeActivities_DocumentsHelper.WaitForElementPresent("OpenTask", 10);

                VisitOffice("documents");
                office_ClientsHelper.WaitForWorkAround(3000);

                VerifyTitle("Documents");

                executionLog.Log("ActivitiesDocumentManagement2", "Search document by name.");
                officeActivities_DocumentsHelper.TypeText("SearchDocumet", name);
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Select All in owner field");
                officeActivities_DocumentsHelper.SelectByText("OwnerField", "All");
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on edit icon.");
                officeActivities_DocumentsHelper.ClickElement("EditDoc");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on add new version.");
                officeActivities_DocumentsHelper.ClickElement("NewVersion");
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Upload a valid File.");
                officeActivities_DocumentsHelper.Upload("BrowseAttachment", ValidFile);
                office_ClientsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Write a comment about version.");
                officeActivities_DocumentsHelper.TypeText("DocCommnet", "This is newly added version.");

                executionLog.Log("ActivitiesDocumentManagement2", "Click on save button.");
                officeActivities_DocumentsHelper.ClickElement("AddVersionSave");

                executionLog.Log("ActivitiesDocumentManagement2", "Wait for success message.");
                officeActivities_DocumentsHelper.WaitForText("New Version File Uploaded successfully.", 10);

                executionLog.Log("ActivitiesDocumentManagement2", "Redirect to document page");
                VisitOffice("documents");

                executionLog.Log("ActivitiesDocumentManagement2", "Wait for locator to be present.");
                officeActivities_DocumentsHelper.WaitForElementPresent("SearchDocumet", 10);

                executionLog.Log("ActivitiesDocumentManagement2", "Search document by name.");
                officeActivities_DocumentsHelper.TypeText("SearchDocumet", name);
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);
                officeActivities_DocumentsHelper.SelectByText("OwnerField", "All");
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on Checkbox");
                officeActivities_DocumentsHelper.ClickElement("CheckDocToDel");

                executionLog.Log("ActivitiesDocumentManagement2", "Click on Delete button");
                officeActivities_DocumentsHelper.ClickElement("DeleteDoc");

                executionLog.Log("ActivitiesDocumentManagement2", "Acccept alert to delete doc.");
                officeActivities_DocumentsHelper.AcceptAlert();
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Wait for success message.");
                officeActivities_DocumentsHelper.WaitForText("Document deleted successfully.", 20);

                executionLog.Log("ActivitiesDocumentManagement2", "Redirect at recyclebin page.");
                VisitOffice("documents/recyclebin");

                executionLog.Log("ActivitiesDocumentManagement2", "Wait for locator to be present.");
                officeActivities_DocumentsHelper.WaitForElementPresent("DeleteRecycle", 10);

                executionLog.Log("ActivitiesDocumentManagement2", "Search document by name.");
                officeActivities_DocumentsHelper.TypeText("SearchDocumet", name);
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);
                officeActivities_DocumentsHelper.SelectByText("OwnerField", "All");
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Click on delete icon.");
                officeActivities_DocumentsHelper.ClickElement("DeleteRecycle");
                officeActivities_DocumentsHelper.AcceptAlert();
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("ActivitiesDocumentManagement2", "Wait for success message..");
                officeActivities_DocumentsHelper.WaitForText("Document Permanently Deleted.", 20);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("ActivitiesDocumentManagement2");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("Activities Document Management");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("Activities Document Management", "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("Activities Document Management");
                        TakeScreenshot("ActivitiesDocumentManagement2");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\ActivitiesDocumentManagement2.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("ActivitiesDocumentManagement2");
                        string id            = loginHelper.getIssueID("Activities Document Management");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\ActivitiesDocumentManagement2.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("Activities Document Management"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("Activities Document Management");
                //  executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("ActivitiesDocumentManagement2");
                executionLog.WriteInExcel("Activities Document Management", Status, JIRA, "Office Activities");
            }
        }
Exemplo n.º 4
0
        public void verifyQuickLookLabelsForDocuments()
        {
            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 officeActivities_DocumentsHelper = new OfficeActivities_DocumentHelper(GetWebDriver());

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

            // Variable
            var    name        = "Doc" + RandomNumber(1, 9999);
            var    email       = "Test" + GetRandomNumber() + "@gmail.com";
            var    ValidFile   = GetPathToFile() + "index.jpg";
            var    InvalidFile = GetPathToFile() + "chrome.exe";
            String JIRA        = "";
            String Status      = "Pass";

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

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

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Redirect at create document page");
                VisitOffice("documents/create");
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "verify title");
                VerifyTitle("Create a New Document");

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Click on Save button");
                officeActivities_DocumentsHelper.ClickElement("Save");

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Verify validation message for name.");
                officeActivities_DocumentsHelper.VerifyText("NameError", "This field is required.");

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Verify validation message for attachment.");
                officeActivities_DocumentsHelper.VerifyText("AttachmentError", "This field is required.");

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Enter Document name");
                officeActivities_DocumentsHelper.TypeText("Name", name);

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Click on document version");
                officeActivities_DocumentsHelper.ClickElement("DocumentVersion");

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Upload an invalid File ");
                officeActivities_DocumentsHelper.Upload("BrowseAttachment", InvalidFile);

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Verify alert message for invalid file.");
                officeActivities_DocumentsHelper.VerifyAlertText("please select a valid file!");
                officeActivities_DocumentsHelper.AcceptAlert();

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Upload a valid File.");
                officeActivities_DocumentsHelper.Upload("BrowseAttachment", ValidFile);

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Select Assign owner");
                officeActivities_DocumentsHelper.SelectByText("AssignOwner", "Howard Tang");

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Select status");
                officeActivities_DocumentsHelper.Select("Status", "Active");

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Click on Save button");
                officeActivities_DocumentsHelper.ClickElement("Save");

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Wait for success message.");
                officeActivities_DocumentsHelper.WaitForText("Document saved successfully.", 10);

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Redirect at document page");
                VisitOffice("documents");
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "verify page title");
                VerifyTitle("Documents");

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Search created document.");
                officeActivities_DocumentsHelper.TypeText("SearchDocumet", name);
                officeActivities_DocumentsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Click on any document.");
                officeActivities_DocumentsHelper.ClickElement("OpenDoc");
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Verify label for document status.");
                officeActivities_DocumentsHelper.VerifyText("VerifyStatus", "Active");
                //officeActivities_DocumentsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Verify label for document category.");
                officeActivities_DocumentsHelper.VerifyText("VerifyCategory", "click to add");
                //officeActivities_DocumentsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Verify label for document responsibility.");
                officeActivities_DocumentsHelper.VerifyText("VerifyResponsibility", "Howard Tang");
                //officeActivities_DocumentsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Click on edit button.");
                officeActivities_DocumentsHelper.ClickElement("EditLink");
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Select status for document.");
                officeActivities_DocumentsHelper.SelectByText("Status", "InActive");
                //officeActivities_DocumentsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Select category for document.");
                officeActivities_DocumentsHelper.SelectByText("Category", "pdf");
                //officeActivities_DocumentsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Select owner for document.");
                officeActivities_DocumentsHelper.SelectByText("AssignOwner", "Howard Tang");
                //officeActivities_DocumentsHelper.WaitForWorkAround(2000);

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

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Verify label for document status.");
                officeActivities_DocumentsHelper.VerifyText("VerifyStatus", "InActive");
                //officeActivities_DocumentsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Verify label for document category.");
                officeActivities_DocumentsHelper.VerifyText("Category2", "pdf");
                //officeActivities_DocumentsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Verify label for document responsibility.");
                officeActivities_DocumentsHelper.VerifyText("VerifyResponsibility", "Howard Tang");
                //officeActivities_DocumentsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Click on delete icon.");
                officeActivities_DocumentsHelper.ClickElement("DeleteVersion");
                officeActivities_DocumentsHelper.AcceptAlert();

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Wait for success message.");
                officeActivities_DocumentsHelper.WaitForText("Document deleted successfully.", 10);

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Redirect at documents recyclebin page.");
                VisitOffice("documents/recyclebin");
                officeActivities_DocumentsHelper.WaitForWorkAround(3000);

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Verify page title.");
                VerifyTitle("Recycled Documents");

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Search document by name.");
                officeActivities_DocumentsHelper.TypeText("SearchDocumet", name);
                officeActivities_DocumentsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Select 'All' at Owner Field");
                officeActivities_DocumentsHelper.SelectByText("OwnerField", "All");
                officeActivities_DocumentsHelper.WaitForWorkAround(2000);

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Click on delete icon.");
                officeActivities_DocumentsHelper.ClickElement("DeleteRecycle");

                executionLog.Log("VerifyQuickLookLabelsForDocuments", "Acccept alert to delete doc.");
                officeActivities_DocumentsHelper.AcceptAlert();

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

                String counter     = executionLog.readLastLine("counter");
                String Description = executionLog.GetAllTextFile("VerifyQuickLookLabelsForDocuments");
                String Error       = executionLog.GetAllTextFile("Error");
                Console.WriteLine(Error);
                if (counter == "")
                {
                    counter = "0";
                }
                bool result = loginHelper.CheckExstingIssue("VerifyQuickLookLabelsForDocuments");
                if (!result)
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        loginHelper.CreateIssue("VerifyQuickLookLabelsForDocuments", "Bug", "Medium", "Tasks page", "QA", "Log in as: " + username[0] + " / " + password[0] + "\n\nSteps:\n" + Description + "\n\n\nError Description:\n" + Error);
                        string id = loginHelper.getIssueID("VerifyQuickLookLabelsForDocuments");
                        TakeScreenshot("VerifyQuickLookLabelsForDocuments");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\Contact.png";
                        loginHelper.AddAttachment(location, id);
                    }
                }
                else
                {
                    if (Int16.Parse(counter) < 9)
                    {
                        executionLog.Count("counter", (Int16.Parse(counter) + 1).ToString());
                        TakeScreenshot("VerifyQuickLookLabelsForDocuments");
                        string id            = loginHelper.getIssueID("VerifyQuickLookLabelsForDocuments");
                        string directoryName = loginHelper.GetnewDirectoryName(GetPath());
                        var    location      = directoryName + "\\Contact.png";
                        loginHelper.AddAttachment(location, id);
                        loginHelper.AddComment(loginHelper.getIssueID("VerifyQuickLookLabelsForDocuments"), "This issue is still occurring");
                    }
                }
                JIRA = loginHelper.getIssueID("VerifyQuickLookLabelsForDocuments");
                //  executionLog.DeleteFile("Error");
                throw;
            }
            finally
            {
                executionLog.DeleteFile("VerifyQuickLookLabelsForDocuments");
                executionLog.WriteInExcel("VerifyQuickLookLabelsForDocuments", Status, JIRA, "Activities Management");
            }
        }
Exemplo n.º 5
0
        public void documentManagement()
        {
            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 officeActivities_DocumentHelper = new OfficeActivities_DocumentHelper(GetWebDriver());

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

            // Variable
            var    fileInvalid = GetPathToFile() + "Invalid.dll";
            var    file        = GetPathToFile() + "index.jpg";
            var    Document    = "New" + RandomNumber(99, 99999);
            var    CDBA        = "New" + RandomNumber(99, 99999);
            String JIRA        = "";
            String Status      = "Pass";

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

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

                executionLog.Log("DocumentManagement", "Visit Document");
                VisitOffice("documents");
                officeActivities_DocumentHelper.WaitForWorkAround(5000);

                executionLog.Log("DocumentManagement", "Click on Create Document");
                officeActivities_DocumentHelper.ClickElement("ClickOnCreateDoc");
                officeActivities_DocumentHelper.WaitForWorkAround(3000);

                executionLog.Log("DocumentManagement", "Document Name");
                officeActivities_DocumentHelper.TypeText("Name", Document);

                executionLog.Log("DocumentManagement", "Upload Document");
                officeActivities_DocumentHelper.UploadFile("//*[@id='DocumentFile']", file);
                officeActivities_DocumentHelper.WaitForWorkAround(3000);

                executionLog.Log("DocumentManagement", "Click on Save button.");
                officeActivities_DocumentHelper.ClickElement("Save");

                executionLog.Log("DocumentManagement", "Wait for Confirmation");
                officeActivities_DocumentHelper.WaitForText("Document saved successfully.", 10);

                executionLog.Log("DocumentManagement", "Search Document");
                officeActivities_DocumentHelper.TypeText("SearchDocumet", Document);
                officeActivities_DocumentHelper.WaitForWorkAround(2000);
                officeActivities_DocumentHelper.selectOwner("//*[@id='gs_first_name']");
                officeActivities_DocumentHelper.WaitForWorkAround(6000);

                executionLog.Log("DocumentManagement", "Click on Edit");
                officeActivities_DocumentHelper.ClickElement("EditDoc");
                officeActivities_DocumentHelper.WaitForWorkAround(2000);

                executionLog.Log("DocumentManagement", "Click on Save");
                officeActivities_DocumentHelper.ClickElement("Save");

                executionLog.Log("DocumentManagement", "Verify Confirmation");
                officeActivities_DocumentHelper.WaitForText("Document updated successfully.", 10);

                executionLog.Log("DocumentManagement", "Redirect at Documents page.");
                VisitOffice("documents");
                officeActivities_DocumentHelper.WaitForWorkAround(5000);

                executionLog.Log("DocumentManagement", "Click on Create Document");
                officeActivities_DocumentHelper.ClickElement("ClickOnCreateDoc");
                officeActivities_DocumentHelper.WaitForWorkAround(2000);

                executionLog.Log("DocumentManagement", "Click on Save button.");
                officeActivities_DocumentHelper.ClickElement("Save");

                executionLog.Log("DocumentManagement", "Wait for Validation");
                officeActivities_DocumentHelper.WaitForText("This field is required.", 10);

                executionLog.Log("DocumentManagement", "Uplaod File");
                officeActivities_DocumentHelper.UploadFile("//*[@id='DocumentFile']", fileInvalid);
                officeActivities_DocumentHelper.WaitForWorkAround(2000);

                executionLog.Log("DocumentManagement", "Accept alert message.");
                officeActivities_DocumentHelper.AcceptAlert();

                executionLog.Log("DocumentManagement", "Valiadtion please select a valid file");
                officeActivities_DocumentHelper.WaitForText("please select a valid file", 10);

                executionLog.Log("DocumentManagement", "Accept alert message.");
                officeActivities_DocumentHelper.AcceptAlert();
                officeActivities_DocumentHelper.WaitForWorkAround(3000);

                executionLog.Log("DocumentManagement", "Click on Cancel");
                officeActivities_DocumentHelper.ClickElement("DocumentCancelButton");
                officeActivities_DocumentHelper.WaitForWorkAround(3000);

                officeActivities_DocumentHelper.VerifyText("VerifyDocumentHeader", "Documents");
                officeActivities_DocumentHelper.WaitForWorkAround(1000);

                executionLog.Log("DocumentManagement", "Redirect at documents page.");
                VisitOffice("documents");
                officeActivities_DocumentHelper.WaitForWorkAround(5000);

                executionLog.Log("DocumentManagement", "Click on first document");
                officeActivities_DocumentHelper.ClickElement("DocumentClick");
                officeActivities_DocumentHelper.WaitForWorkAround(3000);

                executionLog.Log("DocumentManagement", "Add Version");
                officeActivities_DocumentHelper.ClickElement("AddVersion");
                officeActivities_DocumentHelper.WaitForWorkAround(3000);

                executionLog.Log("DocumentManagement", "Uplaod");
                officeActivities_DocumentHelper.UploadFile("//*[@id='DocumentFile']", file);
                officeActivities_DocumentHelper.WaitForWorkAround(3000);

                executionLog.Log("DocumentManagement", "Add Comment");
                officeActivities_DocumentHelper.TypeText("AddComment", "Test Comment");

                executionLog.Log("DocumentManagement", "Click on Save");
                officeActivities_DocumentHelper.ClickElement("AddVersionSave");

                executionLog.Log("DocumentManagement", "Wait for Confirmation");
                officeActivities_DocumentHelper.WaitForText("New Version File Uploaded successfully.", 10);

                executionLog.Log("DocumentManagement", "Click on Delete");
                officeActivities_DocumentHelper.ClickElement("DeleteVersion");
                officeActivities_DocumentHelper.AcceptAlert();

                executionLog.Log("DocumentManagement", "Confirmation");
                officeActivities_DocumentHelper.WaitForText("Document Version Deleted Permanently.", 10);

                executionLog.Log("DocumentManagement", "Goto Document");
                VisitOffice("documents");
                officeActivities_DocumentHelper.WaitForWorkAround(5000);

                executionLog.Log("DocumentManagement", "Search Documet");
                officeActivities_DocumentHelper.TypeText("SearchDocumet", Document);
                officeActivities_DocumentHelper.selectOwner("//*[@id='gs_first_name']");
                officeActivities_DocumentHelper.WaitForWorkAround(4000);

                executionLog.Log("DocumentManagement", "Click on Check box for first document");
                officeActivities_DocumentHelper.ClickElement("ClickOnCheckBox");
                officeActivities_DocumentHelper.WaitForWorkAround(2000);

                executionLog.Log("DocumentManagement", "Click Delete");
                officeActivities_DocumentHelper.ClickElement("DeleteDocument");
                officeActivities_DocumentHelper.AcceptAlert();

                executionLog.Log("DocumentManagement", "Confirmaion");
                officeActivities_DocumentHelper.WaitForText("Document deleted successfully.", 10);

                executionLog.Log("DocumentManagement", "Redirect at Recycle bin");
                VisitOffice("documents/recyclebin");

                executionLog.Log("DocumentManagement", "Search Document");
                officeActivities_DocumentHelper.TypeText("SearchDocumet", Document);
                officeActivities_DocumentHelper.selectOwner("//*[@id='gs_first_name']");
                officeActivities_DocumentHelper.WaitForWorkAround(4000);

                executionLog.Log("DocumentManagement", "Restore Document");
                officeActivities_DocumentHelper.ClickElement("RestoredDoc");
                officeActivities_DocumentHelper.WaitForWorkAround(2000);

                executionLog.Log("DocumentManagement", "Confirmation");
                officeActivities_DocumentHelper.WaitForText("Document Restored Successfully.", 10);

                executionLog.Log("DocumentManagement", "Goto Document");
                VisitOffice("documents");
                officeActivities_DocumentHelper.WaitForWorkAround(5000);

                executionLog.Log("DocumentManagement", "Search Document");
                officeActivities_DocumentHelper.TypeText("SearchDocumet", Document);
                officeActivities_DocumentHelper.selectOwner("//*[@id='gs_first_name']");
                officeActivities_DocumentHelper.WaitForWorkAround(4000);

                executionLog.Log("DocumentManagement", "Select document");
                officeActivities_DocumentHelper.ClickElement("CheckDocToDel");
                officeActivities_DocumentHelper.WaitForWorkAround(2000);

                executionLog.Log("DocumentManagement", "Click on Delete");
                officeActivities_DocumentHelper.ClickElement("DeleteDocument");
                officeActivities_DocumentHelper.AcceptAlert();

                executionLog.Log("DocumentManagement", "Wait for Confirmation");
                officeActivities_DocumentHelper.WaitForText("Document deleted successfully.", 10);

                executionLog.Log("DocumentManagement", "Redirect at Recycle bin");
                VisitOffice("documents/recyclebin");
                officeActivities_DocumentHelper.WaitForWorkAround(5000);

                executionLog.Log("DocumentManagement", "Search Document");
                officeActivities_DocumentHelper.TypeText("SearchDocumet", Document);
                officeActivities_DocumentHelper.selectOwner("//*[@id='gs_first_name']");
                officeActivities_DocumentHelper.WaitForWorkAround(4000);

                executionLog.Log("DocumentManagement", "Delete From Recycle bin");
                officeActivities_DocumentHelper.ClickElement("DeleteRecycleBin");
                officeActivities_DocumentHelper.AcceptAlert();

                executionLog.Log("DocumentManagement", "Wait for Confirmation");
                officeActivities_DocumentHelper.WaitForText("Document Permanently Deleted.", 10);
            }
            catch (Exception e)
            {
                executionLog.Log("Error", e.StackTrace);
                Status = "Fail";

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