I'm having some issues accesing some links who are inside a Frame and
Tables.
I've been trying to pull it by myself but with no success.
This is the code I have so far
I included this beforehand:
require 'nokogiri'
//
#Here I Log In, etc
enter_text("some", "pass")
enter_text("password", "hnsc")
click_button_with_image("/images/ci/formbtns/login_off.gif")
//
This is where I try to click the link, I tried using something called
xFirePath in Firefox, using this example:
http://www.layeredthoughts.com/automation/how-to-write-your-first-ruby-web-bot-in-watir-scraping-weather-com
Then I found this document, where in the beginning of Page 2, it
indicates that there are some issues between Watir and Frames.
(Although I'm using right now the RWebSpec code generated by Testwise
Recorder)
//
# can't yet handle followFrame
page_html = Nokogiri::HTML.parse(browser.html)
# Using xFirePath in Firefox I obtain the following xPath, where I
supposedly extract the text
#First the HTML
<a target="_top" href=" /webapps/portal/frameset.jsp?
tab_id=_2_1&url=%2fwebapps%2fblackboard%2fexecute%2flauncher%3ftype
%3dCourse%26id%3d_490590_1%26url%3d">LIU1.TSHE.PRBL.SP.2010FD34B.1</a>
If I just use click_link("LIU1.TSHE.PRBL.SP.2010FD34B.1")
#Now I use xpath to extract the text written above, hoping to make
click link work
texto = page_html.xpath("/html/body/table/tbody/tr/td[3]/table/
tbody/tr[2]/td[1]/table/tbody/tr/td/table[2]/tbody/tr/td/table/tbody/
tr/td/table[1]/tbody/tr[2]/th/font/a").inner_text
Now I try to ways to click the link
Watir:
browser.link(:url, html/body/table[1]/tbody/tr/td[1]/table/tbody/
tr[1]/td[2]/a/img).click
RWebSpec:
click_link(texto)
Sorry if this post is a mess, I was in a hurry. I'll try to explain
myself better promptly
P.S. I have another idea, since this link I'm trying to access, is
only one from many within that frame.
Is there a way to, like, use the DOM to create a list that I can use
readily.
I don't know much maybe I'm speaking gibberish, but I'm trying to
learn all of this, the best I can.