How to decrease the wait time for NoSuchElementException in Selenium?
<p>In some cases, i know element will not be displayed. but its waiting ~30 Secs.</p>

<p>How to decrease wait time for <code>NoSuchElementException</code> in selenium?</p>

<p>Sample code: </p>

<pre><code>String name;
        try {    
            name = driver.findElement(By.xpath("XPath")).getText();
        } catch (NoSuchElementException e) {
            name = "Name not displayed";
        }
</code></pre>