def click_button_with_image_src_contains(image_filename)
        all_buttons = button_elements
        found = nil
        all_buttons.select do |x|
          if x["src"] =~ /#{Regexp.escape(image_filename)}/
            found = x
            break
          end
        end

        raise "not image button with src: #{image_filename} found" if found.nil?
        found.click
      end
def click_button_with_image_src_contains(image_filename)
        all_buttons = button_elements
        found = nil
        all_buttons.select do |x|
          if x["src"] =~ /#{Regexp.escape(image_filename)}/
            found = x
            break
          end
        end

        raise "not image button with src: #{image_filename} found" if found.nil?
        found.click
      end
Click image buttion with image source name

 For an image submit button <input name="submit" type="image" src="/images/search_button.gif">
  click_button_with_image("search_button.gif")