Пример #1
0
 /// <summary>
 /// Unlock the User which is locked
 /// </summary>
 ///  Author: Anand
 /// <param name="browser">browser Instance</param>
 /// <param name="userName">User Name</param>
 public void UnLockTheLockedUser(ISelenium browser, string userName)
 {
     decimal numberOfAciveRow;
     string amend = "//input[@value='Amend Status Flags']";
     // Enter Customer Name and Search
     SearchCustomer(userName, browser);
     // Click on Amend Status Flag
     browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
     SelectMainFrame(browser);
     if (browser.IsElementPresent(amend))
         browser.Click(amend);
     System.Threading.Thread.Sleep(5000);
     // Get Number of Active rows where user should be unlocked
     numberOfAciveRow = browser.GetXpathCount("//tbody/tr[@class='active']");
     if (numberOfAciveRow > 0)
     {
         for (int i = 0; i < numberOfAciveRow; i++)
         {
             browser.Click("link=[clear]");
             browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
             browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
             System.Threading.Thread.Sleep(5000);
             browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
         }
         Console.WriteLine("AdminSuite:Common:UnLockTheLockedUser-Pass: User " + userName + " Unlocked ");
     }
 }
Пример #2
0
 /// <summary>
 /// releases any SelfExcluded User
 /// </summary>
 ///  Author: Anand
 /// <param name="browser">Browser</param>
 /// <param name="userName">User Name</param>
 public void ReleaseSelfExcludedUser(ISelenium browser, string userName)
 {
     try
     {
         decimal numberOfSelfExcludedLink;
         //Clicking on Event Link in LHN
         LHNavigation(AdminSuite.CommonControls.AdminHomePage.CustomersLink, browser);
         //Selecting TopFrame
         SelectMainFrame(browser);
         // Enter Customer Name and Search
         SearchCustomer(userName, browser);
         // Getting number of SelfExcluded Link
         numberOfSelfExcludedLink = browser.GetXpathCount(AdminSuite.CustomerCreation.CustomersPage.NoOfSelfExcludedCustomer);
         if (numberOfSelfExcludedLink > 0)
         {
             for (int i = 0; i < numberOfSelfExcludedLink; i++)
             {
                 browser.Click(AdminSuite.CustomerCreation.CustomersPage.NoOfSelfExcludedCustomer);
                 browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
                 System.Threading.Thread.Sleep(10000);
                 if (!browser.IsTextPresent("Application Error"))
                 {
                     if (browser.IsElementPresent("//input[@type='submit' and @value='Confirm']"))
                     {
                         browser.Click("//input[@type='submit' and @value='Confirm']");
                         browser.WaitForPageToLoad(FrameGlobals.PageLoadTimeOut);
                         System.Threading.Thread.Sleep(10000);
                     }
                 }
             }
         }
         else
         {
             Console.WriteLine("AdminSuite:ReleaseSelfExcludedUser-Fail- Customer is not SelfExcluded");
         }
         Assert.IsTrue(browser.IsTextPresent("Self exclusion successfully removed"), "Failed to clear SelfExclusion for customer");
         Console.WriteLine("AdminSuite:ReleaseSelfExcludedUser-Pass- Cleared the SelfExcluded");
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }