def ele_index(class_name, index)
      raise 'Index must be >= 1' unless index == 'last()' || (index.is_a?(Integer) && index >= 1)

      elements = tags(class_name)

      if index == 'last()'
        result = elements.last
      else
        # elements array is 0 indexed
        index -= 1
        result = elements[index]
      end

      raise _no_such_element if result.nil?

      result
    end
def ele_index(class_name, index)
      raise 'Index must be >= 1' unless index == 'last()' || (index.is_a?(Integer) && index >= 1)

      elements = tags(class_name)

      if index == 'last()'
        result = elements.last
      else
        # elements array is 0 indexed
        index -= 1
        result = elements[index]
      end

      raise _no_such_element if result.nil?

      result
    end
Get the element of type class_name at matching index.
 @param class_name [String] the class name to find
 @param index [Integer] the index
 @return [Element]