public void ConvertDocumentIntoPDF()
        {
            #region Private Variables
            var caseId             = string.Empty;
            var caseTitle          = "Case to Convert the document into PDF";
            var registryEntryTitle = "Registry Entry";
            #endregion

            Selenium_Run((driver) =>
            {
                FrontPage.LoginToApplication(driver);

                #region Create case with access code
                CasePage casePage = CasePage.Connect(driver);
                casePage.AddTitle(caseTitle);
                casePage.SaveCase();
                CommonMethods.PlayWait(5000);
                caseId = casePage.GetCaseNumber();
                #endregion

                #region Add U-type Registry Entry
                RegistryEntryPage regEntry = RegistryEntryPage.Connect(driver);
                regEntry.CreateRegistryEntry(RegistryEntryType.OutgoingType.GetStringValue());
                regEntry.AddRegTitle(registryEntryTitle);
                regEntry.AddRegToAddress("AA");
                DocumentPage documentPage = DocumentPage.Connect(driver);
                documentPage.ClickAndAddDocTemplate(AttachmentType.Message.GetStringValue());
                documentPage.AddMessageForDocument("Convert the message into PDF");
                regEntry.ClickSaveBttn();
                #endregion

                #region Change registry entry status to F/done
                regEntry.ClickEditButton();
                regEntry.ChangeREStatusToFerdigOrDone();
                regEntry.ClickSaveBttn();
                #endregion

                #region Convert document to PDF from Attachment/Message
                documentPage.ViewAttachmentInformation("Registry Entry", "Convert to PDF", 1);
                CommonMethods.PlayWait(3000);
                CommonMethods.RefreshBrowserWindow(driver);
                CommonMethods.RefreshBrowserWindow(driver);
                CommonMethods.PlayWait(15000);
                #endregion

                #region Verify the Document is Converted to PDF
                documentPage.VerifyDocumentOrMessageIsConvertedToPDF();
                #endregion

                #region Logout from RM Module
                LogoutPage logoutPage = LogoutPage.Connect(driver);
                logoutPage.LogoutApplication();
                #endregion
            });
        }
        public void InheritDisposalCodeFromRegToDocument()
        {
            #region Variables
            string PreservationTimeLabel = "Preservation time";
            string preservationTime10    = "10";
            string dropdownValue         = "Kasseres";
            string caseTitle             = "NewCase";
            string registryEntryTitle    = "RegEntry";
            #endregion

            /*
             *
             #region Systemadministrasjon Module
             *          Selenium_Run((driver) =>
             *          {
             #region Instanstiation
             *              var logoutPage = LogoutPage.Connect(driver);
             *              var adminPage = AdminstratorPage.Connect(driver);
             #endregion
             *
             #region Login to Admin Module
             *              FrontPage.LoginToApplication(driver, ApplicationModules.Administrator.GetStringValue());
             #endregion
             *
             #region Navigate to Dokumentkategori
             *              AdminstratorPage _adminPage = AdminstratorPage.Connect(driver);
             *              _adminPage.NavigateToMenuItem("Elektronisk arkiv", "Dokumentkategori", "Dokumentkategori (alle)");
             *            //  _adminPage.ClickOnItemInGrid("RT Automatic Test 1");
             #endregion
             *
             #region Update Disposal Code & Preservation Time 10 yrs for the RT1
             *              CommonMethods.PlayWait(3000);
             *              adminPage.SelectHtmlComboBox("Disposal code", "K");
             *              driver.SendTextToTextBoxField(PreservationTimeLabel, preservationTime10);
             *              adminPage.Save();
             #endregion
             *
             #region Logout from Admin Module
             *              LogoutPage logout = LogoutPage.Connect(driver);
             *              logout.LogoutApplication();
             #endregion
             *          });
             #endregion
             */
            #region   Arkivansvarlig Module
            Selenium_Run((driver) =>
            {
                #region Instantiation
                var casePage      = CasePage.Connect(driver);
                var adminPage     = AdminstratorPage.Connect(driver);
                var registryPage  = RegistryEntryPage.Connect(driver);
                var dashboardPage = DashboardPage.Connect(driver);
                var logoutPage    = LogoutPage.Connect(driver);
                #endregion

                #region Login to Arkivansvarlig
                FrontPage.LoginToApplication(driver);
                #endregion
                try
                {
                    #region Change Role
                    dashboardPage.ChangeRole(RolesInApplication.MainRegistrar);
                    #endregion

                    #region Create Case
                    casePage.AddTitle(caseTitle);
                    casePage.SaveCase();
                    #endregion

                    #region Add Registry Entry
                    registryPage.CreateRegistryEntry(RegistryEntryType.OutgoingType.GetStringValue());
                    registryPage.AddRegTitle(registryEntryTitle);
                    registryPage.AddRegToAddress("AA");
                    registryPage.SelectKendoDropdownAndAddValue("Document category", "RT");
                    #endregion

                    #region attach document
                    DocumentPage document = DocumentPage.Connect(driver);
                    document.ClickAndAddDocTemplate(AttachmentType.DocumentTemplate.GetStringValue());
                    document.SelectDocument(DocumentTemplateType.Dokumentmal.GetStringValue(), DocumentSubType.Standardbrev.GetStringValue());
                    document.SaveAndEdit();
                    document.HandleAlertPopupToOpenWordDocument();
                    document.DocumentWebLoginWindow();
                    document.CloseDocument();
                    #endregion

                    #region Edit Registry Entry And Verify Disposal
                    registryPage.ClickEditButton();
                    CommonMethods.PlayWait(4000);
                    registryPage.ClickMoreArrow();
                    //Assert.IsTrue(registryPage.GetDisposalCode() == dropdownValue, string.Format("Disposal Code {0} is not updated in Registry Entry", dropdownValue));
                    //Assert.IsTrue(registryPage.GetPreservationTime() == preservationTime10, string.Format("Preservation Time {0} is not updated in Registry Entry", preservationTime10));
                    #endregion


                    #region Verify Document Details And Verify Disposal
                    document.ViewAttachmentInformation("Document details");
                    document.VerifyDropdownValue("Document category", "RT - Automatic Test 1");
                    //  registryPage.VerifyDocumentDetails("Document details");
                    Assert.IsTrue(registryPage.GetDisposalCode() == dropdownValue, string.Format("Disposal Code {0} is not updated in Registry Entry", dropdownValue));
                    Assert.IsTrue(registryPage.GetPreservationTime() == preservationTime10, string.Format("Preservation Time {0} is not updated in Registry Entry", preservationTime10));
                    #endregion
                }
                catch (System.Exception)
                {
                }
                #region Logout from Application
                logoutPage.LogoutApplication();
                #endregion
            });
            #endregion
        }