SenBotReferenceService { public By getElementLocatorForElementReference(String elementReference) { Map<String, By> objectReferenceMap = getObjectReferenceMap(By.class); By elementLocator = objectReferenceMap.get(elementReference); if (elementLocator == null) { fail("No elementLocator is found for element name: '" + elementReference + "'. Available element references are: " + objectReferenceMap.keySet().toString()); } return elementLocator; } SenBotReferenceService(String populatorClassName,
    		CucumberManager cucumberManager); void addUser(String refName, GenericUser user); void addPageReference(String pageReference, String pageUrl); void addLocatorReference(String locatorReference, By locator); By getElementLocatorForElementReference(String elementReference); By getElementLocatorForElementReference(String elementReference, String apendix); void addPageRepresentationReference(String name, Class clazz); GenericUser getUserForUserReference(String userReference); String getUrlForPageReference(String pageReference); Class getPageRepresentationReference(String pageRepresentationReference); T getPageRepresentationInstance(Class<T> referenceClassType); String namespaceString(String plainString); void addReference(Class<T> referenceClass, String referenceName, T referenceObject); Map<String, T> getObjectReferenceMap(Class<T> referenceClass); T getReference(Class<T> referenceClass, String referenceName); static final String NAME_SPACE_PREFIX; static final String SCENARIO_NAME_SPACE_PREFIX; }
@Test public void testGetElementLocatorForElementReference_withApendix() throws Exception { SenBotReferenceService referenceService = SenBotContext.getSenBotContext().getReferenceService(); String result = referenceService.getElementLocatorForElementReference("Ref by ID", " assertEquals("By.xpath: result = referenceService.getElementLocatorForElementReference("Ref by XPath", " assertEquals("By.xpath: }