daily pastebin goal
16%
SHARE
TWEET

Validate Element Display function

a guest Jun 28th, 2018 30 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   public static bool IsElementDisplayed(IWebElement element)
  2.         {
  3.             bool ele = false;
  4.             try
  5.             {
  6.                 ele = element.Displayed;
  7.                 if (ele == true) { return true; }
  8.                 else { return false; }
  9.             }
  10.             catch (NoSuchElementException e)
  11.             {
  12.                 Console.WriteLine(e.Message);
  13.                 return false;
  14.                
  15.                // throw new Exception(string.Format("Element Not Displayed or Enabled Exception"));
  16.             }
  17.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top