### Question:
HtmlElementUtils { public static RemoteWebElement locateElement(String locator) { logger.entering(locator); Preconditions.checkArgument(StringUtils.isNotBlank(locator), INVALID_LOCATOR_ERR_MSG); By locatorBy = resolveByType(locator); RemoteWebElement element = (RemoteWebElement) Grid.driver().findElement(locatorBy); logger.exiting(element); return element; } private  HtmlElementUtils(); static RemoteWebElement locateElement(String locator); static RemoteWebElement locateElement(String locator, ParentTraits parent); static List<WebElement> locateElements(String locator); static List<WebElement> locateElements(String locator, ParentTraits parent); static void isValidXpath(String locator); static By resolveByType(String locator); static By getFindElementType(String locator); static boolean isElementPresent(String locator);  }### Answer:
@Test(groups = { "functional" }) @WebTest public void validateCssLocationStrategy() throws IOException { Grid.open(TestServerUtils.getTestEditableURL()); WebElement e = HtmlElementUtils.locateElement("css=input[name=normal_text]"); e.sendKeys("beamdaddy@paypal.com"); assertTrue(e.getAttribute("value").equals("beamdaddy@paypal.com")); }
@Test(expectedExceptions = { IllegalArgumentException.class }, groups = { "unit" }) public void testLocateElementsWithNull() { HtmlElementUtils.locateElement(null); }
@Test(expectedExceptions = { IllegalArgumentException.class }, groups = { "unit" }) public void testLocateElementsWithEmpty() { HtmlElementUtils.locateElement(" "); }
@Test(expectedExceptions = { NoSuchElementException.class }, groups = { "functional" }) @WebTest public void testLocateElementNegativeCondition() { Grid.driver().get(TestServerUtils.getTestEditableURL()); HtmlElementUtils.locateElement("foo"); }
@Test(expectedExceptions = { NoSuchElementException.class }, groups = { "functional" }) @WebTest public void testLocateElementNegativeCondition1() { Grid.driver().get(TestServerUtils.getTestEditableURL()); HtmlElementUtils.locateElement("name=foo|id=bar"); }