@Test public void deleteTest() { navigationPage.typeSearchInfo(SEARCH_TEXT); SearchResult searchResult = navigationPage.clickSearch(); int id = searchResult.openPersonalData(SEARCH_TEXT); personalData = PageFactory.initElements(driver, PersonalDataPage.class); personalData.setNavigationPage(navigationPage); if (id >= 0) { personalData.clickDelete().clickOk(); } else { fail("No such sportsman."); } }
@Before public void openNavigationPage() { driver = browser; navigationPage = PageFactory.initElements(driver, NavigationPage.class); navigationPage.openNavigationPage(URL); }