So I'm using this code:
@links = []
@links << @driver.find_elements(:tag_name => "a")
puts @links
and it returns values like this:
#<Selenium::WebDriver::Element:0x0000010225ec18>
#<Selenium::WebDriver::Element:0x0000010225eb28>
#<Selenium::WebDriver::Element:0x0000010225ea88>
#<Selenium::WebDriver::Element:0x0000010225e998>
#<Selenium::WebDriver::Element:0x0000010225e920>
#<Selenium::WebDriver::Element:0x0000010225e858>
#<Selenium::WebDriver::Element:0x0000010225e7b8>
#<Selenium::WebDriver::Element:0x0000010225e6a0>
#<Selenium::WebDriver::Element:0x0000010225e5d8>
So when the script continues and runs this:
@links.each do |link|
value = @driver.find_element(:link => link)
puts value
I get results like this:
Error: test_cec_top_nav(CecTopNav)
Selenium::WebDriver::Error::NoSuchElementError: Unable to locate element: {"method":"link text","selector":"[#<Selenium::WebDriver::Element:0x..fc06799e5bd009338 id=\"{37c39184-4a46-6940-a3d5-d866310145c7}\">
I was expecting/hoping to get plain-text hrefs that I could refer back to in the remainder of the script, and getting the hex values is fine, but it looks like webDriver can't read it's own handwriting.
What am I missing here?