NavigationService extends BaseServiceHub { public boolean isInitialPageRequested() { String currentUrl = getWebDriver().getCurrentUrl(); if (StringUtils.isBlank(currentUrl) || ( !currentUrl.toLowerCase().startsWith("http") && !currentUrl.toLowerCase().startsWith("file") ) ) { return false; } else { return true; } } NavigationService(ElementService seleniumElementService); void navigate_to_url(String url); void isCurrentlyOnPage(String exectedPage); void clickElementWithAttributeValue(String attributeName, String attributeValue); void clickButtonWithText(String text); boolean isInitialPageRequested(); void mouseHoverOverElement(By locator); void windowScrollBottom(); void windowScrollTop(); void scrollElementIntoView(WebElement element);  }
@Test public void testIsInitialPageRequested() throws IOException { assertFalse(seleniumNavigationService.isInitialPageRequested()); String pageUnderTest = "/test_pages/exampleButton.html"; seleniumNavigationService.navigate_to_url(SenBotContext.RESOURCE_LOCATION_PREFIX + pageUnderTest); assertTrue(seleniumNavigationService.isInitialPageRequested()); }