   # @param selector the Protractor CSS locator argument
   # @returns a promise resolving to the Table array
   findTables: (selectors...) ->
-    @findAll_(selectors...).then (tables) ->
+    @_findAll(selectors...).then (tables) ->
       # Add the Table prototype to each WebElement in the result.
       tables.map(addTableMixin)
+
+  # @param selector the search condition
+  # @returns the By locator object
+  _locatorFor: (selector) ->
+    # If the selector is a string, then make a By locator.
+    # Otherwise, the selector is assumed to already be a
+    # By locator.
+    if _.isString(selector)
+      # An xpath selector string has a slash or equals.
+      # An id selector starts with # and doesn't have a space.
+      # Anything else is assumed to be CSS.
+      if selector == '..' or '/' in selector
+        By.xpath(selector)
+      else if selector[0] == '#' and not ' ' in selector
+        By.id(selector[1..-1])
+      else if selector.match(/^\w[\w-]*$/)
+        By.tagName(selector)
+      else
+        By.css(selector)
+    else if selector?
+      # Pass through a non-string selector.
+      selector
+    else
+      throw new Error("The selector is not defined")
+
 
 #
 # Note - it would be preferable to define the following Table

  # * If the string contains a '/' or equals '..', then the
  #   string is assumed to be an xpath.
  #
  # * Otherwise, if the string starts with '#' the search
  #   is on the id following the hash.
  #
  # * Otherwise, the search argument is assumed to be CSS.
  #
  # For example,
  #

_ = require 'lodash'

webdriver = require 'selenium-webdriver'

expect = require('./expect')()

require './object'

