Assert EditText Value in Espresso
<p>Can we perform assertion on Edittext Value and write down our test case according to it's output. Like if we Edittext value is Equal to our value we want to perform Condition A else B.</p>

<pre><code> onView(withId(viewId)).check(matches(isEditTextValueEqualTo(viewId, value)));

Matcher&lt;View&gt; isEditTextValueEqualTo(final int viewId, final String content) {

    return new TypeSafeMatcher&lt;View&gt;() {

        @Override
        public void describeTo(Description description) {
            description.appendText("Match Edit Text Value with View ID Value : :  " + content);
        }

        @Override
        public boolean matchesSafely(View view) {
            if (view != null) {
                String editTextValue = ((EditText) view.findViewById(viewId)).getText().toString();

                if (editTextValue.equalsIgnoreCase(content)) {
                    return true;
                }
            }
            return false;
        }
    };
}
</code></pre>

<p>This is not working using try.. Catch(Exception e)</p>