Remove try-catch from Test classes

This commit is contained in:
Sandeep Kumar 2016-11-02 07:56:47 +05:30
parent 13f7d5dfdf
commit 41da06a7bc
2 changed files with 5 additions and 15 deletions

View File

@ -26,16 +26,11 @@ public class SeleniumWithJUnitLiveTest {
@Test
public void whenAboutBaeldungIsLoaded_thenAboutEugenIsMentionedOnPage() {
try {
seleniumExample.getAboutBaeldungPage();
String actualTitle = seleniumExample.getTitle();
assertNotNull(actualTitle);
assertEquals(actualTitle, expecteTilteAboutBaeldungPage);
assertTrue(seleniumExample.isAuthorInformationAvailable());
} catch (Exception exception) {
exception.printStackTrace();
seleniumExample.closeWindow();
}
}
}

View File

@ -26,15 +26,10 @@ public class SeleniumWithTestNGLiveTest {
@Test
public void whenAboutBaeldungIsLoaded_thenAboutEugenIsMentionedOnPage() {
try {
seleniumExample.getAboutBaeldungPage();
String actualTitle = seleniumExample.getTitle();
assertNotNull(actualTitle);
assertEquals(actualTitle, expecteTilteAboutBaeldungPage);
assertTrue(seleniumExample.isAuthorInformationAvailable());
} catch (Exception exception) {
exception.printStackTrace();
seleniumExample.closeWindow();
}
seleniumExample.getAboutBaeldungPage();
String actualTitle = seleniumExample.getTitle();
assertNotNull(actualTitle);
assertEquals(actualTitle, expecteTilteAboutBaeldungPage);
assertTrue(seleniumExample.isAuthorInformationAvailable());
}
}