Hey All I have a question that I try to resolve. I am using selenium with pure java and test NG. In the test class I want to call a method and if the method throw exception I want to fail the test. this is the method:
public void insertAddress2(String address2) throws Exception {}
and i want to call it from a test class, and if it (the insert address2 method) throw exception I want the test to fail.
this is the the class test Assertion statement
@Test(groups = {"address"},enabled = true)
public void testAddress() throws Exception {
Assert.assertNotEquals(adderess.insertAddress2("test"),ErrorMessagePermission, "");
}
can someone please advise what is the syntax and how to test not exception thrown in the insertAddress2 method from different class