I am getting error for the below part of code:
element = driver.find_element :name => "used_by"
element.send_keys "371101"
element = driver.find_element :name => "btnSearch"
element.click
all_table_data = driver.find_element(:tag_name, "td").text
all_table_data.each do |td|
puts td.text
end
print element
Error:
D:\Ruby script>ruby filedownload.rb
filedownload.rb:24:in `<main>': undefined method `each' for #<Selenium::WebDrive
r::Element:0x2556be8> (NoMethodError)
D:\Ruby script>
can anyone help me to fix the error?
find_elementonly returns the first element matching the given arguments.What you probably what is the
find_elementsmethod which finds all elements matching the given arguments: