title: Appium - Check if element exist
body: <p>I am trying to check if an element exist or not in my application (React Native) with Appium (C#). I beleive using <code>.Displayed</code> is the best practice for this, however, this throws an <code>NoSuchElementException</code> when the element does not exist.</p>
  <p>The only workaround I can think of for this is to wrap the <code>.FindElement*</code> method with a <code>try/catch</code>. Is this the best method for checking if an element exist, or am I missing a better approach?</p>
  <p><a href="https://i.stack.imgur.com/qRBim.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qRBim.png" alt="enter image description here" /></a></p>
  <pre class="lang-c prettyprint-override"><code>private AndroidElement Name =&gt; Driver.FindElementByXPath(&quot;//*[@text='John Doe']&quot;);
  
  public void OpenMenu()
  {
      Utils.Log(&quot;Opening menu&quot;);
      if (!Name.Displayed)
          ToggleButton.Click();
  }
  </code></pre>
  <p>Thanks!</p>