ElementService extends BaseServiceHub { public String getElementLocatorFromReferencedView(String viewName, String elementName) { FindBy findByAnnotatio = getFindByDescriptor(viewName, elementName); return findByAnnotatio.how() + ":" + findByAnnotatio.using(); }  WebElement translateLocatorToWebElement(String locatorString); By translateLocator(String locatorString); WebElement findExpectedElement(By by); WebElement findExpectedElement(By by, boolean includeHiddenElements); List<WebElement> findExpectedElements(By by); WebElement findExpectedFirstMatchedElement(By... bys); WebElement findExpectedFirstMatchedElement(int timeoutInSeconds, By... bys); String constructCaseInsensitiveContains(String identifier, String value); void isElementVisible(By locator, boolean visible); void isElementVisible(WebElement element, boolean visible); boolean getElementExists(By locator); void waitForLoaders(); void assertExpectedGlobalConditions(); void dragElementTo(String draggable, String droppable); void dragElementTo(String draggable, String droppable, int waitForMillies); void dragElementTo(By draggable, By droppable); void dragElementTo(By draggable, int x, int y); void ieSaveButtonClick(WebElement button); void waitForInvisibilityOfElement(WebElement element); WebElement getElementFromReferencedView(String viewName, String elementName); String getElementLocatorFromReferencedView(String viewName, String elementName); FindBy getFindByDescriptor(String viewName, String elementName); WebElement viewShouldContainElement(String viewName, String elementName); void viewShouldNotShowElement(String viewName, String elementName); WebElement viewShouldShowElement(String viewName, String elementName); static final String XPATH_LOCATOR_PREFIX; static final String ID_LOCATOR_PREFIX; static final String NAME_ATTRIBUTE_LOCATOR_PREFIX; static final String CSS_LOCATOR_PREFIX; }
@Test public void testGetElementLocatorFromReferencedView() throws Exception { String elementDescriptor = seleniumElementService.getElementLocatorFromReferencedView("Test page1", "navigation"); assertNotNull(elementDescriptor); assertEquals("ID:navigation", elementDescriptor); }