public void AddCredentialValueToApplication(string applicationName, string credentialName, string credentialValue, string usergroup, log4net.ILog log)
        {
            //instantiate new Adduserdetailspage

            PageFactory.InitElements(driver, this);
            USER_GROUPS_link.Click();


            Application_text.SendKeys(applicationName);
            Search_link.Click();
            APPLICATION_SEARCH_RESULTS_links.Click();

            LAFAdmin_Applications_Page applicationsPage = new LAFAdmin_Applications_Page(driver);

            applicationsPage.credential_Search_text.SendKeys(credentialName);
            applicationsPage.Filter_Credentials_link.Click();
            applicationsPage.Credential_Values_link.Click();
            applicationsPage.Create_New_Values_link.Click();
            applicationsPage.add_values_textbox.SendKeys(credentialValue);
            applicationsPage.Import_link.Click();


            //Assert Credential created:

            applicationsPage.Value_text.SendKeys(credentialValue);
            applicationsPage.Search_link.Click();
            Assert.IsTrue(applicationsPage.isElementPresent(applicationsPage.SEARCH_RESULTS_checkbox));



            //Go to home page
            applicationsPage.USERS_link.Click();
        }
        public void AddCredentialtoApplication(string applicationName, string credentialName, string usergroup, log4net.ILog log)
        {
            //instantiate new USer Group page - as this is the easiest route for finding a specific applicaiton via automation (due to the way the application home page is layed out)
            log.Info("Entered AddCredentialToApplication");
            PageFactory.InitElements(driver, this);
            USER_GROUPS_link.Click();


            Application_text.SendKeys(applicationName);
            Search_link.Click();
            APPLICATION_SEARCH_RESULTS_links.Click();

            //Now we are on the application page - so create an application object
            LAFAdmin_Applications_Page applicationsPage = new LAFAdmin_Applications_Page(driver);

            applicationsPage.Add_Credential_link.Click();
            applicationsPage.credential_Name_text.SendKeys(credentialName);
            applicationsPage.credential_Description_text.SendKeys("Desription Test2");
            applicationsPage.Save_link.Click();

            //Assert Credential created:

            applicationsPage.credential_Search_text.SendKeys(credentialName);
            applicationsPage.Filter_Credentials_link.Click();
            Assert.IsTrue(applicationsPage.isElementPresent(applicationsPage.Credential_Values_link));


            applicationsPage.USERS_link.Click();


            log.Info("At end of AddCredentialTOApplication");
        }
        public void RemoveCredentialValueFromApplication(string applicationName, string credentialName, string credentialValue, string usergroup, log4net.ILog log)
        {
            //find app via User Groups PAge
            PageFactory.InitElements(driver, this);

            USER_GROUPS_link.Click();


            Application_text.SendKeys(applicationName);
            Search_link.Click();
            APPLICATION_SEARCH_RESULTS_links.Click();

            LAFAdmin_Applications_Page applicationsPage = new LAFAdmin_Applications_Page(driver);

            applicationsPage.credential_Search_text.SendKeys(credentialName);
            applicationsPage.Filter_Credentials_link.Click();
            try
            {
                applicationsPage.Credential_Values_link.Click();
            }
            catch
            {
                PageFactory.InitElements(driver, applicationsPage);
                applicationsPage.Credential_Values_link.Click();
            }


            applicationsPage.Value_text.SendKeys(credentialValue);
            applicationsPage.Search_link.Click();
            applicationsPage.SEARCH_RESULTS_checkbox.Click();

            applicationsPage.Delete_Selected_Credential_Values_link.Click();

            //ASSERT:
            try
            {
                applicationsPage.Value_text.SendKeys(credentialValue);
            }
            catch
            {
                Thread.Sleep(1000);
                PageFactory.InitElements(driver, applicationsPage);
                applicationsPage.Value_text.SendKeys(credentialValue);
            }
            applicationsPage.Search_link.Click();
            Assert.IsFalse(applicationsPage.isElementPresent(applicationsPage.SEARCH_RESULTS_checkbox));



            applicationsPage.USERS_link.Click();

            applicationsPage = null;
        }