Example #1
0
        public void TCAdmin17_VerifyFilterByUserName()
        {
            userNameText   = TestData.GetData("TCAdmin17_UsernameTextValue");
            entereUserName = TestData.GetData("TCAdmin17_EnterUserName");

            AdminFunctions       objAdminFunctions       = new AdminFunctions(TestProgressLogger);
            AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(TestProgressLogger);
            AdminUsersPage       objAdminUsersPage       = new AdminUsersPage(TestProgressLogger);

            try
            {
                TestProgressLogger.StartTest();
                //Login as admin -> Click on "Users" menu button -> Users Tab
                objAdminUsersPage.SelectAdminUserTab();

                //Click on "ViewAll" button
                objAdminUsersPage.ClickOnViewAllButton();

                //Verify if entered value in userId textfield loads the values in userTable dynamically and load the page
                Assert.True(objAdminUsersPage.VerifyUserNameResultsLoad(entereUserName, userNameText));
            }
            catch (NoSuchElementException ex)
            {
                TestProgressLogger.TakeScreenshot();
                TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace);
                TestProgressLogger.LogError(String.Format(LogMessage.VerifyFilteredByFailed, userNameText), ex);
                throw ex;
            }
            catch (Exception e)
            {
                TestProgressLogger.TakeScreenshot();
                TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace);
                TestProgressLogger.LogError(String.Format(LogMessage.VerifyFilteredByFailed, userNameText), e);
                throw e;
            }
            finally
            {
                objAdminCommonFunctions.UserMenuBtn();
                objAdminFunctions.AdminLogOut();
                TestProgressLogger.EndTest();
            }
        }