Using juint in appium is to avaoid try catch method

Good programming is to avoid try catch exception.
Can anyone help be to handle Nosuchelementexception using juint in appium without try catch.
Pa…

May i know is there any problem with Catch??

There is no problem with catch but good way of programming in junit is to avoid exception handling.

Shall we handle exception in junit without using try catch…

@Priyank_Shah catch is not getting handled in appium…

@HASEENA

You mean your program @Test method is throwing an exception which is not caught in Super class “Exception” also never heard this before

try {
}

catch (Exception e){
e.getMessage();
}

I am using try catch in appium code , and its working properly. I am using POM framework.

There is NoSuchElement exception is always caught for a long time.
There is a chance for the above exception to be not caught hence we cannot write

@Test(expected=Nosuchelement)
public void Test
{

}